:root {
  --cream: #FFFBF5;
  --peach: #FFF0E3;
  --orange: #FFA26B;
  --orange-dark: #FF8B4D;
  --pink: #FFD6E8;
  --mint: #B5EAD7;
  --mint-light: #E3F9F0;
  --lavender: #E2E8FF;
  --text: #5C4B51;
  --text-dark: #3E3E3E;
  --white: #FFFFFF;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Nunito', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background-color: var(--cream);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 { color: var(--text-dark); font-weight: 800; }

main { min-height: calc(100vh - 80px); }

/* Navbar */
.navbar {
  background: rgba(255, 251, 245, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 162, 107, 0.15);
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--orange-dark);
  cursor: pointer;
}

.nav-link {
  color: var(--text);
  font-weight: 700;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  transition: all 0.3s ease;
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 1rem;
}

.nav-link:hover, .nav-link.active {
  color: var(--orange-dark);
  background: rgba(255, 162, 107, 0.12);
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 1rem;
  background: var(--white);
  border-radius: 9999px;
  box-shadow: 0 2px 10px rgba(92, 75, 81, 0.08);
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
}

.user-chip:hover { transform: translateY(-2px); box-shadow: 0 6px 14px rgba(92, 75, 81, 0.12); }

.mobile-menu { max-height: 0; overflow: hidden; transition: max-height 0.35s ease; }
.mobile-menu.open { max-height: 400px; }

/* Buttons */
.btn-primary, .btn-secondary { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; font-weight: 700; padding: 0.75rem 1.5rem; border-radius: 9999px; transition: all 0.3s ease; border: none; cursor: pointer; font-family: inherit; font-size: 1rem; }
.btn-primary { background: linear-gradient(135deg, var(--orange) 0%, var(--orange-dark) 100%); color: var(--white); box-shadow: 0 10px 20px rgba(255, 162, 107, 0.3); }
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 14px 28px rgba(255, 162, 107, 0.4); }
.btn-secondary { background: transparent; color: var(--orange-dark); border: 2px solid var(--orange); }
.btn-secondary:hover { background: var(--orange); color: var(--white); transform: translateY(-3px); }

/* Hero */
.hero {
  position: relative;
  padding: 4rem 0 5rem;
  text-align: center;
  background: linear-gradient(135deg, var(--cream) 0%, var(--peach) 50%, var(--pink) 100%);
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 20% 30%, rgba(255, 162, 107, 0.12) 0%, transparent 25%),
                    radial-gradient(circle at 80% 70%, rgba(181, 234, 215, 0.2) 0%, transparent 30%);
  pointer-events: none;
}

.hero .container { position: relative; z-index: 10; }

/* Cards */
.card {
  background: var(--white);
  border-radius: 1.5rem;
  box-shadow: 0 8px 24px rgba(92, 75, 81, 0.08);
  transition: all 0.35s ease;
  border: 1px solid rgba(255, 162, 107, 0.1);
}

.card:hover { transform: translateY(-6px); box-shadow: 0 18px 40px rgba(92, 75, 81, 0.15); }

/* Forms */
.form-input {
  width: 100%;
  padding: 0.85rem 1.1rem;
  border: 2px solid rgba(255, 162, 107, 0.2);
  border-radius: 1rem;
  background: var(--white);
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.form-input::placeholder { color: rgba(92, 75, 81, 0.45); }
.form-input:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 4px rgba(255, 162, 107, 0.15); }

/* Post */
.post-card { padding: 1.5rem; }
.post-header { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.75rem; }
.post-name { font-weight: 800; color: var(--text-dark); }
.post-time { font-size: 0.8rem; color: rgba(92, 75, 81, 0.55); }
.post-content { white-space: pre-line; color: var(--text); margin-bottom: 0.75rem; word-break: break-word; }
.post-image { border-radius: 1rem; overflow: hidden; margin-bottom: 1rem; }
.post-image img { width: 100%; max-height: 360px; object-fit: cover; }
.post-actions { display: flex; align-items: center; gap: 1.5rem; color: rgba(92, 75, 81, 0.7); }
.post-action { display: inline-flex; align-items: center; gap: 0.4rem; background: none; border: none; cursor: pointer; font-weight: 700; font-family: inherit; font-size: 0.95rem; transition: all 0.2s; color: inherit; }
.post-action:hover { color: var(--orange-dark); transform: scale(1.05); }
.post-action.liked { color: #FF6B9D; }

/* Comments */
.comments-box { margin-top: 1rem; padding-top: 1rem; border-top: 1px dashed rgba(255, 162, 107, 0.25); }
.comment { margin-bottom: 0.75rem; font-size: 0.92rem; }
.comment-name { font-weight: 700; color: var(--text-dark); }
.comment-form { display: flex; gap: 0.5rem; margin-top: 0.75rem; }
.comment-form input { flex: 1; padding: 0.55rem 0.9rem; }
.comment-form button { padding: 0.55rem 1rem; font-size: 0.85rem; }

/* Topics */
.topic-link { display: block; color: rgba(92, 75, 81, 0.85); font-weight: 700; transition: color 0.2s; }
.topic-link:hover { color: var(--orange-dark); }

/* Rank */
.rank-item { display: flex; align-items: center; gap: 1rem; padding: 1rem 1.5rem; }
.rank-num { width: 2rem; height: 2rem; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 800; background: var(--cream); color: var(--text); }
.rank-num.top { background: linear-gradient(135deg, var(--orange) 0%, var(--orange-dark) 100%); color: white; }
.rank-img { width: 50px; height: 50px; border-radius: 1rem; object-fit: cover; background: var(--cream); }
.rank-info { flex: 1; }
.rank-name { font-weight: 800; color: var(--text-dark); }
.rank-author { font-size: 0.8rem; color: rgba(92, 75, 81, 0.65); }
.rank-likes { color: #FF6B9D; font-weight: 800; }

/* Stats */
.stat-number { font-size: 2rem; font-weight: 800; background: linear-gradient(135deg, var(--orange) 0%, #FF6B9D 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }

/* Modal */
.modal { position: fixed; inset: 0; z-index: 2000; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,0.35); padding: 1rem; }
.modal.hidden { display: none; }
.modal-content { background: var(--white); border-radius: 1.5rem; padding: 2rem; box-shadow: 0 20px 60px rgba(0,0,0,0.2); border: 1px solid rgba(255, 162, 107, 0.15); }
.avatar-options { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.5rem; margin-bottom: 1.5rem; }
.avatar-option { width: 100%; aspect-ratio: 1/1; border-radius: 1rem; border: 3px solid transparent; background: var(--cream); font-size: 1.7rem; cursor: pointer; transition: all 0.2s; }
.avatar-option:hover { background: var(--peach); transform: scale(1.08); }
.avatar-option.selected { border-color: var(--orange); background: var(--peach); }

/* Toast */
.toast { position: fixed; bottom: 2rem; right: 2rem; background: var(--text-dark); color: var(--white); padding: 1rem 1.5rem; border-radius: 1rem; box-shadow: 0 10px 30px rgba(0,0,0,0.2); transform: translateY(150%); opacity: 0; transition: all 0.4s ease; z-index: 3000; font-weight: 700; display: flex; align-items: center; gap: 0.75rem; }
.toast.show { transform: translateY(0); opacity: 1; }

/* Reveal */
.reveal { opacity: 0; transform: translateY(30px); transition: all 0.8s cubic-bezier(0.22, 1, 0.36, 1); }
.reveal.visible { opacity: 1; transform: translateY(0); }
.delay-1 { transition-delay: 0.1s; }
.delay-2 { transition-delay: 0.2s; }
.delay-3 { transition-delay: 0.3s; }

@media (min-width: 1024px) {
  .hero { padding: 6rem 0 7rem; }
}

@media (max-width: 767px) {
  .rank-img { width: 40px; height: 40px; }
  .rank-name { font-size: 1rem; }
}
