/* =================================================================
   styles.css — BrainQuest Arena — Space-themed Glassmorphism
   ================================================================= */

/* --- RESET & BASE --- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --primary: #667eea;
  --primary-end: #764ba2;
  --secondary: #f093fb;
  --secondary-end: #f5576c;
  --accent: #4facfe;
  --accent-end: #00f2fe;
  --success: #43e97b;
  --success-end: #38f9d7;
  --warning: #fa709a;
  --warning-end: #fee140;
  --bg-start: #0f0c29;
  --bg-mid: #302b63;
  --bg-end: #24243e;
  --glass: rgba(255, 255, 255, 0.06);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-hover: rgba(255, 255, 255, 0.1);
  --text: #f0f0f0;
  --text-muted: #8b8fa3;
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 6px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Nunito', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: linear-gradient(135deg, var(--bg-start), var(--bg-mid), var(--bg-end));
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
}

h1, h2, h3, h4 {
  font-family: 'Fredoka One', 'Nunito', sans-serif;
  font-weight: 700;
}

a { color: var(--accent); text-decoration: none; }

/* --- CANVAS STARFIELD --- */
#starfield {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 0;
  pointer-events: none;
}

#particles-container {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

#app {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  width: 100%;
}

/* --- GLASSMORPHISM --- */
.glass-card {
  background: var(--glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
}

.glass-card:hover {
  background: var(--glass-hover);
}

.glass-nav {
  background: rgba(15, 12, 41, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: none;
  border-bottom: 1px solid var(--glass-border);
  border-radius: 0;
}

/* --- TEXT HELPERS --- */
.text-gradient {
  background: linear-gradient(135deg, var(--accent), var(--accent-end));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-success { color: var(--success) !important; }
.text-warning { color: var(--warning) !important; }
.text-muted { color: var(--text-muted); }

/* --- BUTTONS --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: 'Nunito', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
  color: #fff;
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.15), transparent);
  opacity: 0;
  transition: opacity var(--transition);
}

.btn:hover::after { opacity: 1; }
.btn:active { transform: scale(0.96); }

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-end));
  box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
}
.btn-primary:hover { box-shadow: 0 6px 30px rgba(102, 126, 234, 0.6); transform: translateY(-2px); }

.btn-secondary {
  background: var(--glass);
  border: 1px solid var(--glass-border);
}
.btn-secondary:hover { background: var(--glass-hover); }

.btn-hero {
  background: linear-gradient(135deg, var(--warning), var(--warning-end));
  font-size: 1.2rem;
  padding: 16px 40px;
  border-radius: 50px;
  box-shadow: 0 4px 30px rgba(250, 112, 154, 0.5);
}
.btn-hero:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 8px 40px rgba(250, 112, 154, 0.7);
}

.btn-hint {
  background: linear-gradient(135deg, #f7971e, #ffd200);
  color: #1a1a2e;
  box-shadow: 0 4px 20px rgba(247, 151, 30, 0.3);
}

.btn-danger {
  background: linear-gradient(135deg, var(--secondary-end), #ff4444);
  padding: 10px 24px;
  font-size: 0.9rem;
  border: none;
  border-radius: var(--radius-sm);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  font-family: 'Nunito', sans-serif;
}

.btn-full { width: 100%; justify-content: center; }

.btn-action {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  padding: 14px 20px;
  border-radius: var(--radius);
  font-size: 1rem;
  color: #fff;
  cursor: pointer;
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.btn-action:hover {
  background: var(--glass-hover);
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}

.btn-back {
  position: absolute;
  top: 20px;
  left: 20px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  color: #fff;
  padding: 8px 16px;
  border-radius: 50px;
  cursor: pointer;
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  z-index: 10;
  transition: all var(--transition);
}
.btn-back:hover { background: var(--glass-hover); }

.btn-sm {
  padding: 6px 14px;
  font-size: 0.85rem;
  border-radius: var(--radius-xs);
}

.btn-send {
  background: linear-gradient(135deg, var(--primary), var(--primary-end));
  border: none;
  color: #fff;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  flex-shrink: 0;
}
.btn-send:hover { transform: scale(1.1); box-shadow: 0 4px 20px rgba(102, 126, 234, 0.5); }

/* --- ANIMATIONS --- */
@keyframes confetti-fly {
  0% { transform: translate(0, 0) rotate(0); opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) rotate(var(--rot)); opacity: 0; }
}

@keyframes float-up {
  0% { bottom: -30px; opacity: 0; }
  10% { opacity: var(--max-opacity, 0.08); }
  90% { opacity: var(--max-opacity, 0.08); }
  100% { bottom: 110vh; opacity: 0; }
}

@keyframes xp-float {
  0% { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-80px) scale(1.3); }
}

@keyframes pulse-glow {
  0%, 100% { filter: drop-shadow(0 0 10px rgba(102, 126, 234, 0.5)); }
  50% { filter: drop-shadow(0 0 25px rgba(102, 126, 234, 0.8)); }
}

@keyframes pulse-btn {
  0%, 100% { box-shadow: 0 4px 30px rgba(250, 112, 154, 0.5); }
  50% { box-shadow: 0 4px 50px rgba(250, 112, 154, 0.8), 0 0 60px rgba(250, 112, 154, 0.3); }
}

@keyframes floating-y {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-15px); }
}

@keyframes bounce-in {
  0% { transform: scale(0); opacity: 0; }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes slide-in {
  0% { transform: translateX(30px); opacity: 0; }
  100% { transform: translateX(0); opacity: 1; }
}

@keyframes slide-up {
  0% { transform: translateY(20px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(5px); }
}

@keyframes glow-pulse {
  0%, 100% { box-shadow: 0 0 5px var(--success), 0 0 10px rgba(67, 233, 123, 0.3); }
  50% { box-shadow: 0 0 15px var(--success), 0 0 30px rgba(67, 233, 123, 0.5); }
}

@keyframes spin-slow {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes floater-drift {
  0% { transform: translateY(0) rotate(0deg); }
  25% { transform: translateY(-40px) rotate(10deg); }
  50% { transform: translateY(-20px) rotate(-5deg); }
  75% { transform: translateY(-60px) rotate(8deg); }
  100% { transform: translateY(0) rotate(0deg); }
}

@keyframes slide-in-msg {
  0% { transform: translateX(-20px); opacity: 0; }
  100% { transform: translateX(0); opacity: 1; }
}

@keyframes star-pop {
  0% { transform: scale(0) rotate(-30deg); opacity: 0; }
  60% { transform: scale(1.3) rotate(10deg); opacity: 1; }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

@keyframes score-circle {
  0% { stroke-dashoffset: 326.73; }
}

@keyframes flame-flicker {
  0%, 100% { transform: scale(1) rotate(-3deg); }
  25% { transform: scale(1.1) rotate(3deg); }
  50% { transform: scale(0.95) rotate(-2deg); }
  75% { transform: scale(1.05) rotate(2deg); }
}

.pulse-glow { animation: pulse-glow 2s ease-in-out infinite; }
.pulse-btn { animation: pulse-btn 2s ease-in-out infinite; }
.floating-y { animation: floating-y 3s ease-in-out infinite; }
.bounce-in { animation: bounce-in 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards; }
.slide-in { animation: slide-in 0.4s ease-out forwards; }
.slide-up { animation: slide-up 0.4s ease-out forwards; }
.shake-anim { animation: shake 0.5s ease-in-out; }
.bounce-anim { animation: bounce-in 0.6s cubic-bezier(0.34, 1.56, 0.64, 1); }
.slide-in-msg { animation: slide-in-msg 0.3s ease-out forwards; }

/* Page transitions */
.page-exit { opacity: 0; transform: translateY(10px); transition: all 0.2s ease-in; }
.page-enter { animation: slide-up 0.3s ease-out forwards; }

/* Floating background icons */
.float-icon {
  position: absolute;
  bottom: -30px;
  color: rgba(255, 255, 255, 0.06);
  font-weight: 800;
  animation: float-up linear infinite;
  pointer-events: none;
  user-select: none;
}

/* XP float */
.xp-float {
  position: fixed;
  font-family: 'Fredoka One', sans-serif;
  font-size: 1.4rem;
  color: var(--success);
  text-shadow: 0 0 10px rgba(67, 233, 123, 0.5);
  pointer-events: none;
  z-index: 9999;
  animation: xp-float 1.2s ease-out forwards;
}

/* Loading spinner */
.loading-spinner {
  width: 50px; height: 50px;
  border: 4px solid var(--glass-border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin-slow 0.8s linear infinite;
  margin: 40vh auto;
}

/* =================================================================
   LANDING PAGE
   ================================================================= */
.landing-page {
  min-height: 100vh;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
}

.landing-glow {
  position: absolute;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(102, 126, 234, 0.2), transparent 70%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.landing-content {
  text-align: center;
  padding: 2rem;
  position: relative;
  z-index: 2;
  max-width: 640px;
  width: 90%;
}

.logo-container {
  position: relative;
  margin-bottom: 1.5rem;
}

.logo-icon {
  font-size: 5rem;
  display: block;
  margin-bottom: 0.5rem;
  filter: drop-shadow(0 0 20px rgba(102, 126, 234, 0.5));
}

.logo-text {
  font-size: 3.5rem;
  color: #fff;
  letter-spacing: -1px;
  text-shadow: 0 0 40px rgba(102, 126, 234, 0.3);
}

.logo-accent {
  background: linear-gradient(135deg, var(--warning), var(--warning-end));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.logo-rocket {
  position: absolute;
  top: -10px;
  right: -40px;
  font-size: 2.5rem;
}

.tagline {
  font-size: 1.5rem;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 0.3rem;
}

.tagline-sub {
  font-size: 1.05rem;
  color: var(--text-muted);
  margin-bottom: 2.5rem;
  white-space: nowrap;
}

.btn-sparkle {
  font-size: 1.3rem;
}

.landing-stats {
  display: flex;
  justify-content: center;
  gap: 3rem;
  margin-top: 3rem;
}

.landing-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.landing-stat-num {
  font-family: 'Fredoka One', sans-serif;
  font-size: 2rem;
  background: linear-gradient(135deg, var(--accent), var(--accent-end));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.landing-stat span:last-child {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* Floating decorations */
.landing-floaters {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.floater {
  position: absolute;
  font-size: 2rem;
  opacity: 0.15;
  animation: floater-drift ease-in-out infinite;
}
.f1 { top: 10%; left: 5%; animation-duration: 8s; }
.f2 { top: 20%; right: 8%; animation-duration: 9s; animation-delay: 1s; }
.f3 { top: 60%; left: 3%; animation-duration: 10s; animation-delay: 2s; }
.f4 { top: 70%; right: 5%; animation-duration: 7s; animation-delay: 0.5s; }
.f5 { top: 40%; left: 10%; animation-duration: 11s; animation-delay: 3s; }
.f6 { top: 85%; left: 15%; animation-duration: 9s; animation-delay: 1.5s; }
.f7 { top: 15%; left: 50%; animation-duration: 8s; animation-delay: 2.5s; }
.f8 { top: 50%; right: 12%; animation-duration: 10s; animation-delay: 0.8s; }

/* =================================================================
   AUTH PAGE
   ================================================================= */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  position: relative;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  padding: 2rem;
}

.auth-tabs {
  display: flex;
  gap: 4px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 50px;
  padding: 4px;
  margin-bottom: 1.5rem;
}

.auth-tab {
  flex: 1;
  padding: 10px;
  border: none;
  border-radius: 50px;
  background: transparent;
  color: var(--text-muted);
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all var(--transition);
}

.auth-tab.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-end));
  color: #fff;
}

.auth-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.auth-icon {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

.auth-header h2 {
  font-size: 1.4rem;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.input-group label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.input-group input, .input-select {
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: #fff;
  font-family: 'Nunito', sans-serif;
  font-size: 1rem;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.input-group input:focus, .input-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.input-group input::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

.input-select {
  cursor: pointer;
  -webkit-appearance: none;
}

.input-select option {
  background: #1a1a2e;
  color: #fff;
}

.age-selector {
  display: flex;
  gap: 8px;
}

.age-btn {
  flex: 1;
  padding: 10px;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.2);
  color: var(--text-muted);
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: all var(--transition);
}

.age-btn.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-end));
  color: #fff;
  border-color: var(--primary);
}

.avatar-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.avatar-pick {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  background: rgba(0, 0, 0, 0.2);
  border: 2px solid var(--glass-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
}

.avatar-pick:hover {
  transform: scale(1.1);
  border-color: rgba(255, 255, 255, 0.3);
}

.avatar-pick.active {
  border-color: var(--primary);
  background: rgba(102, 126, 234, 0.2);
  box-shadow: 0 0 15px rgba(102, 126, 234, 0.3);
  transform: scale(1.1);
}

.error-msg {
  color: var(--secondary-end);
  font-size: 0.9rem;
  font-weight: 600;
  min-height: 1.4em;
  text-align: center;
}

/* =================================================================
   NAVBAR
   ================================================================= */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: transform var(--transition);
}

.nav-brand:hover { transform: scale(1.05); }

.nav-logo {
  font-size: 1.6rem;
  filter: drop-shadow(0 0 8px rgba(102, 126, 234, 0.5));
}

.nav-title {
  font-family: 'Fredoka One', sans-serif;
  font-size: 1.2rem;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-links {
  display: flex;
  gap: 4px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: none;
  border-radius: 50px;
  background: transparent;
  color: var(--text-muted);
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all var(--transition);
}

.nav-link:hover { background: var(--glass); color: #fff; }
.nav-link.active { background: rgba(102, 126, 234, 0.2); color: var(--accent); }

.nav-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-xp {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--warning-end);
}

.nav-avatar {
  font-size: 1.5rem;
}

.nav-sound {
  font-size: 1.1rem;
  padding: 6px 10px;
}

/* =================================================================
   DASHBOARD
   ================================================================= */
.dashboard-page {
  min-height: 100vh;
}

.dash-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem;
}

.welcome-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 2rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.welcome-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.welcome-avatar {
  font-size: 3.5rem;
  filter: drop-shadow(0 0 10px rgba(102, 126, 234, 0.4));
}

.welcome-info h2 {
  font-size: 1.4rem;
  margin-bottom: 4px;
}

.level-badge {
  display: inline-block;
  padding: 3px 12px;
  background: linear-gradient(135deg, var(--primary), var(--primary-end));
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 700;
}

.welcome-right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.xp-section {
  min-width: 180px;
}

.xp-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.xp-bar {
  height: 10px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 50px;
  overflow: hidden;
}

.xp-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--success), var(--success-end));
  border-radius: 50px;
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.glow-bar {
  box-shadow: 0 0 8px rgba(67, 233, 123, 0.4), 0 0 20px rgba(67, 233, 123, 0.2);
}

.streak-display {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 50px;
  background: rgba(0, 0, 0, 0.2);
}

.streak-display.on-fire .streak-flame {
  animation: flame-flicker 0.5s ease-in-out infinite;
  display: inline-block;
}

.streak-flame { font-size: 1.3rem; }
.streak-num { font-family: 'Fredoka One', sans-serif; font-size: 1.3rem; color: #ffd200; }
.streak-label { font-size: 0.75rem; color: var(--text-muted); font-weight: 700; }

/* Stats row */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  padding: 1rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.stat-card:hover { transform: translateY(-4px); }

.stat-icon { font-size: 1.8rem; }
.stat-value { font-family: 'Fredoka One', sans-serif; font-size: 1.5rem; }
.stat-name { font-size: 0.8rem; color: var(--text-muted); font-weight: 600; }

/* Section titles */
.section-title {
  font-size: 1.2rem;
  margin-bottom: 1rem;
  margin-top: 0.5rem;
  padding-left: 4px;
}

/* Category grid */
.category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.category-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 1.2rem;
  cursor: pointer;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  color: #fff;
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  text-align: left;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.category-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--cat-color), transparent);
  opacity: 0.08;
  transition: opacity var(--transition);
}

.category-card:hover {
  transform: translateY(-5px);
  border-color: var(--cat-color);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3), 0 0 20px color-mix(in srgb, var(--cat-color) 20%, transparent);
}

.category-card:hover::before { opacity: 0.15; }

.cat-icon { font-size: 2rem; flex-shrink: 0; }
.cat-name { flex: 1; }
.cat-arrow { opacity: 0.4; transition: all var(--transition); }
.category-card:hover .cat-arrow { opacity: 1; transform: translateX(4px); }

/* Challenge grid */
.challenge-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.challenge-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 1.2rem;
  cursor: pointer;
  border: none;
  color: #fff;
  font-family: 'Nunito', sans-serif;
  text-align: left;
  transition: all var(--transition);
}

.challenge-card:hover { transform: translateY(-4px); }

.challenge-daily { border-left: 3px solid var(--accent); }
.challenge-weekly { border-left: 3px solid var(--warning); }
.challenge-monthly { border-left: 3px solid var(--secondary); }

.challenge-icon { font-size: 2rem; }
.challenge-info { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.challenge-name { font-weight: 700; font-size: 0.95rem; }
.challenge-timer { font-size: 0.8rem; color: var(--text-muted); }
.challenge-badge {
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 700;
}

/* Quick actions */
.quick-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

/* =================================================================
   QUIZ PAGE
   ================================================================= */
.quiz-page { min-height: 100vh; }

.quiz-container {
  max-width: 750px;
  margin: 0 auto;
  padding: 1.5rem;
}

.quiz-header {
  padding: 1.2rem;
  margin-bottom: 1.5rem;
}

.quiz-progress-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.quiz-counter {
  font-weight: 700;
  font-size: 0.95rem;
}

.quiz-category-tag {
  padding: 4px 12px;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 700;
}

.quiz-progress-bar {
  height: 6px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 50px;
  overflow: hidden;
  margin-bottom: 8px;
}

.quiz-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 50px;
  transition: width 0.5s ease;
}

.quiz-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.quiz-timer {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.quiz-difficulty {
  padding: 2px 10px;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.diff-easy { background: rgba(67, 233, 123, 0.2); color: var(--success); }
.diff-medium { background: rgba(247, 151, 30, 0.2); color: #f7971e; }
.diff-hard { background: rgba(245, 87, 108, 0.2); color: var(--secondary-end); }

.quiz-question {
  padding: 2rem;
  margin-bottom: 1.5rem;
  text-align: center;
}

.question-text {
  font-size: 1.3rem;
  line-height: 1.6;
  font-weight: 700;
}

.quiz-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.quiz-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 1rem 1.2rem;
  cursor: pointer;
  border: 2px solid var(--glass-border);
  background: var(--glass);
  color: #fff;
  font-family: 'Nunito', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  text-align: left;
  transition: all var(--transition);
}

.option-hoverable:hover {
  transform: translateY(-3px);
  border-color: var(--primary);
  background: rgba(102, 126, 234, 0.1);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.2);
}

.option-letter {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  font-weight: 800;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.option-text { flex: 1; }

.option-correct {
  border-color: var(--success) !important;
  background: rgba(67, 233, 123, 0.15) !important;
  animation: glow-pulse 1s ease-in-out infinite;
}

.option-correct .option-letter {
  background: var(--success);
  color: #000;
}

.option-wrong {
  border-color: var(--secondary-end) !important;
  background: rgba(245, 87, 108, 0.15) !important;
}

.option-wrong .option-letter {
  background: var(--secondary-end);
  color: #fff;
}

.option-eliminated {
  opacity: 0.3;
  transform: scale(0.95);
  pointer-events: none;
  text-decoration: line-through;
}

/* Quiz feedback */
.quiz-feedback {
  padding: 1.5rem;
  text-align: center;
}

.feedback-correct {
  border-color: var(--success);
  background: rgba(67, 233, 123, 0.08);
}

.feedback-wrong {
  border-color: var(--secondary-end);
  background: rgba(245, 87, 108, 0.08);
}

.feedback-icon {
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.feedback-fact {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  line-height: 1.5;
  padding: 0.8rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-sm);
}

.quiz-actions {
  text-align: center;
}

/* =================================================================
   RESULTS PAGE
   ================================================================= */
.results-page { min-height: 100vh; }

.results-container {
  max-width: 600px;
  margin: 0 auto;
  padding: 1.5rem;
}

.results-card {
  padding: 2rem;
  text-align: center;
}

.results-header { margin-bottom: 1.5rem; }

.results-title {
  font-size: 2rem;
  background: linear-gradient(135deg, var(--warning), var(--warning-end));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.results-score-ring {
  position: relative;
  width: 160px;
  height: 160px;
  margin: 0 auto 1.5rem;
}

.score-ring { width: 100%; height: 100%; }

.score-circle-anim {
  animation: score-circle 1.5s ease-out forwards;
}

.score-center {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.score-number {
  font-family: 'Fredoka One', sans-serif;
  font-size: 2.8rem;
}

.score-pct {
  font-family: 'Fredoka One', sans-serif;
  font-size: 1.2rem;
  color: var(--text-muted);
  margin-left: 2px;
  align-self: flex-end;
  padding-bottom: 8px;
}

/* Stars */
.results-stars {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 1.5rem;
}

.star-icon {
  font-size: 2rem;
  animation: star-pop 0.5s ease-out forwards;
  opacity: 0;
}

.star-filled { color: #ffd200; text-shadow: 0 0 10px rgba(255, 210, 0, 0.5); }
.star-empty { color: rgba(255, 255, 255, 0.15); }

/* Results stats */
.results-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.result-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0.8rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-sm);
}

.result-stat-label { font-size: 0.8rem; color: var(--text-muted); font-weight: 600; }
.result-stat-value { font-family: 'Fredoka One', sans-serif; font-size: 1.2rem; }

/* Badges in results */
.results-badges {
  margin-bottom: 1.5rem;
}

.results-badges h3 { margin-bottom: 0.8rem; }

.badge-row {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.badge-earned {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 1rem;
  animation: bounce-in 0.6s ease-out forwards;
}

.badge-icon { font-size: 2.5rem; }
.badge-name { font-size: 0.85rem; font-weight: 700; }

/* Results actions */
.results-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* =================================================================
   LEADERBOARD
   ================================================================= */
.leaderboard-page { min-height: 100vh; }

.lb-container {
  max-width: 700px;
  margin: 0 auto;
  padding: 1.5rem;
}

.page-title {
  text-align: center;
  font-size: 1.8rem;
  margin-bottom: 1.5rem;
}

.lb-tabs {
  display: flex;
  padding: 4px;
  margin-bottom: 2rem;
  border-radius: 50px;
}

.lb-tab {
  flex: 1;
  padding: 10px;
  border: none;
  border-radius: 50px;
  background: transparent;
  color: var(--text-muted);
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all var(--transition);
}

.lb-tab.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-end));
  color: #fff;
}

/* Podium */
.lb-podium {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 1rem;
  margin-bottom: 2rem;
  min-height: 200px;
}

.podium-spot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 1.2rem 1rem;
  width: 140px;
  text-align: center;
  transition: transform var(--transition);
}

.podium-spot:hover { transform: translateY(-5px); }

.podium-1 { order: 2; }
.podium-2 { order: 1; }
.podium-3 { order: 3; }

.podium-first {
  border-color: rgba(255, 210, 0, 0.3);
  background: rgba(255, 210, 0, 0.08);
  transform: scale(1.08);
}

.podium-medal { font-size: 2rem; }
.podium-avatar { font-size: 2.5rem; }
.podium-name { font-weight: 700; font-size: 0.95rem; }
.podium-score { font-family: 'Fredoka One', sans-serif; font-size: 1.1rem; color: var(--warning-end); }
.podium-level { font-size: 0.75rem; color: var(--text-muted); }

/* List */
.lb-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lb-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0.8rem 1rem;
  animation: slide-in 0.3s ease-out forwards;
  opacity: 0;
}

.lb-row-me {
  border-color: var(--primary);
  background: rgba(102, 126, 234, 0.1);
}

.lb-rank { width: 36px; font-weight: 800; color: var(--text-muted); }
.lb-avatar { font-size: 1.5rem; }
.lb-name { flex: 1; font-weight: 700; }
.lb-level { font-size: 0.8rem; color: var(--text-muted); }
.lb-score { font-family: 'Fredoka One', sans-serif; color: var(--warning-end); }

/* =================================================================
   PROFILE
   ================================================================= */
.profile-page { min-height: 100vh; }

.profile-container {
  max-width: 700px;
  margin: 0 auto;
  padding: 1.5rem;
}

.profile-header {
  text-align: center;
  padding: 2rem;
  margin-bottom: 1.5rem;
}

.profile-avatar-large { font-size: 5rem; margin-bottom: 0.5rem; }
.profile-name { font-size: 1.6rem; margin-bottom: 0.3rem; }
.profile-level { color: var(--text-muted); font-weight: 700; margin-bottom: 0.5rem; }

.profile-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.p-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 1rem;
  text-align: center;
}

.p-stat:hover { transform: translateY(-3px); }

.p-stat-icon { font-size: 1.5rem; }
.p-stat-val { font-family: 'Fredoka One', sans-serif; font-size: 1.4rem; }
.p-stat span:last-child { font-size: 0.8rem; color: var(--text-muted); font-weight: 600; }

/* Badges */
.badge-collection {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.badge-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 1rem;
  text-align: center;
  transition: all var(--transition);
}

.badge-unlocked {
  border-color: rgba(255, 210, 0, 0.3);
}

.badge-unlocked:hover {
  transform: translateY(-4px);
  box-shadow: 0 0 20px rgba(255, 210, 0, 0.2);
}

.badge-locked {
  opacity: 0.4;
  filter: grayscale(100%);
}

.badge-icon-large { font-size: 2rem; }
.badge-item-name { font-size: 0.75rem; font-weight: 700; }

/* History */
.history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 2rem;
}

.history-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.8rem 1rem;
  font-size: 0.9rem;
}

.history-type {
  padding: 3px 10px;
  background: rgba(102, 126, 234, 0.2);
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.history-score { font-weight: 800; }
.history-xp { font-weight: 700; }
.history-date { color: var(--text-muted); font-size: 0.8rem; margin-left: auto; }

.profile-actions { text-align: center; margin-top: 1rem; }

/* =================================================================
   CHAT
   ================================================================= */
.chat-page { min-height: 100vh; display: flex; flex-direction: column; }

.chat-container {
  flex: 1;
  display: flex;
  max-width: 1000px;
  margin: 0 auto;
  padding: 1rem;
  gap: 1rem;
  width: 100%;
  min-height: 0;
}

.chat-sidebar {
  width: 200px;
  padding: 1rem;
  flex-shrink: 0;
  overflow-y: auto;
  max-height: calc(100vh - 80px);
}

.chat-sidebar h3 {
  font-size: 0.9rem;
  margin-bottom: 0.8rem;
}

.online-list { display: flex; flex-direction: column; gap: 6px; }

.online-user {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 600;
}

.online-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 6px rgba(67, 233, 123, 0.5);
  margin-left: auto;
}

.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: calc(100vh - 80px);
}

.chat-header {
  padding: 0.8rem 1.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  border-radius: var(--radius) var(--radius) 0 0;
}

.chat-header h3 { font-size: 1rem; }
.chat-info { font-size: 0.8rem; color: var(--text-muted); }

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: rgba(0, 0, 0, 0.15);
  border-radius: 0;
  min-height: 300px;
}

.chat-messages::-webkit-scrollbar { width: 6px; }
.chat-messages::-webkit-scrollbar-track { background: transparent; }
.chat-messages::-webkit-scrollbar-thumb { background: var(--glass-border); border-radius: 3px; }

.chat-msg {
  display: flex;
  gap: 10px;
  width: fit-content;
  max-width: 60%;
  align-self: flex-start;
}

@media (max-width: 600px) {
  .chat-msg { max-width: 85%; }
}

.chat-msg-me {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.chat-msg-avatar { font-size: 1.5rem; flex-shrink: 0; }

.chat-msg-body {
  background: var(--glass);
  padding: 6px 10px;
  border-radius: 12px 12px 12px 4px;
  border: 1px solid var(--glass-border);
  min-width: 60px;
}

.chat-msg-me .chat-msg-body {
  background: rgba(102, 126, 234, 0.15);
  border-radius: 12px 12px 4px 12px;
}

.chat-msg-header {
  display: flex;
  gap: 5px;
  align-items: baseline;
  margin-bottom: 1px;
}

.chat-msg-name { font-weight: 700; font-size: 0.75rem; color: var(--accent); }
.chat-msg-time { font-size: 0.7rem; color: var(--text-muted); }
.chat-msg-text { font-size: 0.95rem; line-height: 1.4; word-break: break-word; }

.chat-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 3rem 1rem;
  font-size: 1.1rem;
}

.chat-input-area {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 0 0 var(--radius) var(--radius);
  position: relative;
}

.chat-input-area input {
  flex: 1;
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--glass-border);
  border-radius: 50px;
  color: #fff;
  font-family: 'Nunito', sans-serif;
  font-size: 0.95rem;
  outline: none;
}

.chat-input-area input:focus {
  border-color: var(--primary);
}

.chat-input-area input::placeholder { color: rgba(255, 255, 255, 0.3); }

.emoji-picker-container { position: relative; }

.btn-emoji-toggle {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 4px;
  transition: transform var(--transition);
}

.btn-emoji-toggle:hover { transform: scale(1.15); }

.emoji-picker {
  display: none;
  position: absolute;
  bottom: 50px;
  left: 0;
  background: rgba(15, 12, 41, 0.95);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 8px;
  display: none;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  z-index: 50;
  box-shadow: var(--shadow);
}

.emoji-picker.show { display: grid; }

.emoji-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  font-size: 1.3rem;
  cursor: pointer;
  border-radius: 6px;
  transition: background var(--transition);
}

.emoji-btn:hover { background: var(--glass-hover); }

/* =================================================================
   BATTLES
   ================================================================= */
.battles-page { min-height: 100vh; }

.battles-container {
  max-width: 700px;
  margin: 0 auto;
  padding: 1.5rem;
}

.battle-create {
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.battle-create h3 { margin-bottom: 1rem; }

.battle-form {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

.battle-form .input-select {
  flex: 1;
  min-width: 150px;
}

.battle-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.battle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
}

.battle-row-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.battle-creator-avatar { font-size: 1.8rem; }
.battle-creator-name { font-weight: 700; }
.battle-details { font-size: 0.8rem; color: var(--text-muted); }

.battle-row-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.battle-status {
  padding: 4px 10px;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.battle-status-waiting { background: rgba(250, 112, 154, 0.2); color: var(--warning); }
.battle-status-active { background: rgba(67, 233, 123, 0.2); color: var(--success); }

/* =================================================================
   EMPTY STATE
   ================================================================= */
.empty-state {
  text-align: center;
  padding: 3rem 2rem;
}

.empty-icon { font-size: 3rem; display: block; margin-bottom: 0.5rem; }
.empty-state p { color: var(--text-muted); }

/* =================================================================
   NAV UNREAD BADGE
   ================================================================= */
.nav-unread-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  background: #f5576c;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  min-width: 16px;
  height: 16px;
  border-radius: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  line-height: 1;
  pointer-events: none;
  box-shadow: 0 0 6px rgba(245, 87, 108, 0.7);
  animation: pulse-btn 1.5s ease-in-out infinite;
}

/* =================================================================
   ONLINE STATUS DOTS
   ================================================================= */
@keyframes status-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(67, 233, 123, 0.5); }
  50% { box-shadow: 0 0 0 4px rgba(67, 233, 123, 0); }
}

.status-online {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--success);
  border: 2px solid rgba(15, 12, 41, 0.9);
  animation: status-pulse 2s ease-in-out infinite;
}

.status-offline {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text-muted);
  border: 2px solid rgba(15, 12, 41, 0.9);
}

/* =================================================================
   FRIENDS PAGE
   ================================================================= */
.friends-page { min-height: 100vh; }

.friends-container {
  max-width: 700px;
  margin: 0 auto;
  padding: 1.5rem;
}

.friends-search-card {
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.friends-search-card h3 { margin-bottom: 1rem; }

.friends-search-row {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.friends-search-input {
  flex: 1;
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: #fff;
  font-family: 'Nunito', sans-serif;
  font-size: 1rem;
  outline: none;
  transition: border-color var(--transition);
}
.friends-search-input:focus { border-color: var(--primary); }
.friends-search-input::placeholder { color: rgba(255,255,255,0.3); }

.search-results {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 1rem;
}

.search-result-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0.75rem 1rem;
}

.friends-section {
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.friends-section h3 { margin-bottom: 1rem; }

.requests-group {
  margin-bottom: 1rem;
}

.requests-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.request-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--glass-border);
}

.request-row:last-child { border-bottom: none; }

.request-actions {
  display: flex;
  gap: 6px;
  margin-left: auto;
}

.request-pending-badge {
  margin-left: auto;
  padding: 3px 10px;
  background: rgba(102, 126, 234, 0.2);
  color: var(--primary);
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 700;
}

.friends-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.friend-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
}

.friend-card-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.friend-avatar { font-size: 1.5rem; }
.friend-avatar-lg { font-size: 2rem; }

.friend-avatar-wrap {
  position: relative;
  display: inline-block;
}

.friend-avatar-wrap .status-online,
.friend-avatar-wrap .status-offline {
  position: absolute;
  bottom: -1px;
  right: -1px;
}

.friend-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.friend-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.friend-name { font-weight: 700; font-size: 0.95rem; }
.friend-level-title { font-size: 0.8rem; color: var(--text-muted); }
.friend-online-text { font-size: 0.75rem; font-weight: 700; }

/* =================================================================
   DM / PRIVATE MESSAGES PAGE
   ================================================================= */
.dm-page { min-height: 100vh; }

.dm-container {
  max-width: 700px;
  margin: 0 auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  height: calc(100vh - 80px);
}

.dm-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.8rem 1.2rem;
  margin-bottom: 0.5rem;
  border-radius: var(--radius) var(--radius) 0 0;
}

.btn-back-inline {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  color: #fff;
  padding: 6px 12px;
  border-radius: 50px;
  cursor: pointer;
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  transition: all var(--transition);
  flex-shrink: 0;
}
.btn-back-inline:hover { background: var(--glass-hover); }

.dm-header-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dm-header-avatar-wrap {
  position: relative;
  display: inline-block;
}

.dm-header-avatar { font-size: 2rem; }

.dm-header-avatar-wrap .status-online,
.dm-header-avatar-wrap .status-offline {
  position: absolute;
  bottom: -1px;
  right: -1px;
}

.dm-header-name { font-weight: 700; font-size: 1rem; }
.dm-header-status { font-size: 0.8rem; font-weight: 700; }

.dm-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: rgba(0, 0, 0, 0.15);
  min-height: 200px;
}

.dm-messages::-webkit-scrollbar { width: 6px; }
.dm-messages::-webkit-scrollbar-track { background: transparent; }
.dm-messages::-webkit-scrollbar-thumb { background: var(--glass-border); border-radius: 3px; }

.dm-msg {
  display: flex;
  gap: 8px;
  max-width: 75%;
}

.msg-mine {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.msg-theirs {
  align-self: flex-start;
}

.dm-msg-avatar { font-size: 1.4rem; flex-shrink: 0; }

.dm-msg-bubble {
  padding: 8px 12px;
  border-radius: 16px;
  border: 1px solid var(--glass-border);
}

.msg-theirs .dm-msg-bubble {
  background: var(--glass);
  border-radius: 4px 16px 16px 16px;
}

.msg-mine .dm-msg-bubble {
  background: rgba(102, 126, 234, 0.2);
  border-radius: 16px 4px 16px 16px;
  border-color: rgba(102, 126, 234, 0.3);
}

.dm-msg-text { font-size: 0.95rem; line-height: 1.4; word-break: break-word; }
.dm-msg-time { font-size: 0.7rem; color: var(--text-muted); margin-top: 3px; text-align: right; }

/* =================================================================
   GROUPS PAGE
   ================================================================= */
.groups-page { min-height: 100vh; }

.groups-container {
  max-width: 750px;
  margin: 0 auto;
  padding: 1.5rem;
}

.groups-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.groups-title-row .page-title { margin-bottom: 0; }

.groups-title-actions {
  display: flex;
  gap: 8px;
}

.group-join-card {
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.group-join-card h3 { margin-bottom: 1rem; }

.group-join-row {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.join-code-input {
  flex: 1;
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.3);
  border: 2px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: #fff;
  font-family: 'Fredoka One', monospace;
  font-size: 1.4rem;
  letter-spacing: 6px;
  text-align: center;
  outline: none;
  transition: border-color var(--transition);
}
.join-code-input:focus { border-color: var(--primary); }
.join-code-input::placeholder { color: rgba(255,255,255,0.2); letter-spacing: 4px; font-size: 1rem; }

.join-code-display {
  font-family: 'Fredoka One', monospace;
  font-size: 2.5rem;
  letter-spacing: 8px;
  color: var(--accent-end);
  background: rgba(79, 172, 254, 0.1);
  border: 2px solid rgba(79, 172, 254, 0.3);
  border-radius: var(--radius);
  padding: 1rem 2rem;
  margin: 1rem 0;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  user-select: all;
}
.join-code-display:hover {
  background: rgba(79, 172, 254, 0.18);
  box-shadow: 0 0 20px rgba(79, 172, 254, 0.2);
}

.copy-hint {
  display: block;
  font-family: 'Nunito', sans-serif;
  font-size: 0.8rem;
  letter-spacing: 0;
  color: var(--text-muted);
  margin-top: 4px;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.modal-card {
  width: 100%;
  max-width: 420px;
  padding: 2rem;
}

.modal-card h3 { margin-bottom: 0; }

.modal-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-top: 0.5rem;
}

.modal-success {
  text-align: center;
}

.modal-success-icon { font-size: 3rem; margin-bottom: 0.5rem; }
.modal-success h3 { margin-bottom: 0.5rem; }

.groups-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.group-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.2rem 1.5rem;
  gap: 1rem;
}

.group-card-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.group-icon { font-size: 2.2rem; }
.group-name { font-weight: 700; font-size: 1rem; }
.group-school { font-size: 0.85rem; color: var(--text-muted); }
.group-meta { font-size: 0.8rem; color: var(--text-muted); margin-top: 2px; }

/* =================================================================
   GROUP CHAT PAGE
   ================================================================= */
.group-chat-page { min-height: 100vh; }

.group-chat-layout {
  display: flex;
  gap: 0;
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  height: calc(100vh - 80px);
  align-items: flex-start;
}

.group-chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
}

.group-chat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0.8rem 1.2rem;
  margin-bottom: 0.5rem;
  border-radius: var(--radius) var(--radius) 0 0;
  flex-wrap: wrap;
}

.group-header-info { flex: 1; }
.group-header-name { font-weight: 700; font-size: 1rem; }
.group-header-sub { font-size: 0.8rem; color: var(--text-muted); }

.group-header-actions {
  display: flex;
  gap: 6px;
}

.group-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: rgba(0, 0, 0, 0.15);
  min-height: 200px;
}

.group-messages::-webkit-scrollbar { width: 6px; }
.group-messages::-webkit-scrollbar-track { background: transparent; }
.group-messages::-webkit-scrollbar-thumb { background: var(--glass-border); border-radius: 3px; }

.group-sidebar {
  width: 200px;
  flex-shrink: 0;
  margin-left: 1rem;
  padding: 1rem;
  align-self: flex-start;
  position: sticky;
  top: 90px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}

.group-sidebar-title {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.75rem;
}

.group-members-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.group-member-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.group-member-name {
  font-size: 0.85rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* =================================================================
   CHAT REACTIONS & DM BUTTONS
   ================================================================= */
.msg-reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 5px;
  align-items: center;
}

/* Only used reactions (with count) are always visible */
.reactions-used {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

/* The "add reaction" smiley + popup */
.reaction-add-wrap {
  position: relative;
  display: inline-flex;
}

.reaction-add-btn {
  background: none;
  border: 1px solid transparent;
  border-radius: 50px;
  padding: 2px 6px;
  font-size: 0.85rem;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s, background 0.15s;
  color: #fff;
}

/* Show the add button only when hovering the message */
.chat-msg:hover .reaction-add-btn {
  opacity: 0.6;
  border-color: var(--glass-border);
  background: rgba(255,255,255,0.06);
}
.reaction-add-btn:hover { opacity: 1 !important; }

.reaction-picker-popup {
  display: none;
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  background: rgba(20, 20, 40, 0.95);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 6px;
  gap: 4px;
  flex-wrap: nowrap;
  z-index: 50;
  white-space: nowrap;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

.reaction-add-wrap:hover .reaction-picker-popup {
  display: flex;
}

.reaction-btn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 7px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--glass-border);
  border-radius: 50px;
  font-size: 0.85rem;
  cursor: pointer;
  color: #fff;
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  transition: all var(--transition);
  line-height: 1.2;
}

.reaction-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: scale(1.1);
}

.reaction-btn.reacted {
  background: rgba(102, 126, 234, 0.25);
  border-color: rgba(102, 126, 234, 0.5);
  box-shadow: 0 0 8px rgba(102, 126, 234, 0.3);
}

.reaction-count {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.reaction-btn.reacted .reaction-count { color: var(--accent); }

.btn-dm-inline {
  background: rgba(79, 172, 254, 0.15);
  border: 1px solid rgba(79, 172, 254, 0.3);
  color: var(--accent);
  padding: 2px 8px;
  border-radius: 50px;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  font-family: 'Nunito', sans-serif;
  transition: all var(--transition);
  margin-left: 4px;
}

.btn-dm-inline:hover {
  background: rgba(79, 172, 254, 0.25);
  box-shadow: 0 0 8px rgba(79, 172, 254, 0.3);
}

/* =================================================================
   RESPONSIVE
   ================================================================= */
@media (max-width: 768px) {
  .nav-link-text { display: none; }
  .nav-title { display: none; }
  .nav-links { gap: 2px; }
  .nav-link { padding: 8px 10px; }

  .welcome-banner { flex-direction: column; text-align: center; }
  .welcome-left { flex-direction: column; }
  .welcome-right { flex-direction: column; width: 100%; }
  .xp-section { width: 100%; }

  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .category-grid { grid-template-columns: repeat(2, 1fr); }
  .challenge-grid { grid-template-columns: 1fr; }

  .quiz-options { grid-template-columns: 1fr; }

  .logo-text { font-size: 2.5rem; }
  .logo-rocket { right: -20px; font-size: 1.8rem; }

  .landing-stats { gap: 1.5rem; }

  .chat-sidebar { display: none; }

  .lb-podium { gap: 0.5rem; }
  .podium-spot { width: 110px; padding: 0.8rem; }

  .profile-stats-grid { grid-template-columns: repeat(2, 1fr); }
  .badge-collection { grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); }

  .avatar-grid { grid-template-columns: repeat(5, 1fr); }

  .results-stats { grid-template-columns: 1fr 1fr; }

  .battle-form { flex-direction: column; }
  .battle-form .input-select { width: 100%; }

  /* Social features responsive */
  .friends-search-row { flex-direction: column; align-items: stretch; }
  .groups-title-row { flex-direction: column; align-items: flex-start; }
  .group-chat-layout { flex-direction: column; height: auto; padding: 0.75rem; }
  .group-chat-main { height: calc(100vh - 160px); }
  .group-sidebar { width: 100%; margin-left: 0; margin-top: 0.75rem; position: static; max-height: 200px; order: -1; }
  .dm-container { height: calc(100vh - 80px); padding: 0.75rem; }
  .join-code-display { font-size: 2rem; letter-spacing: 6px; padding: 0.75rem 1rem; }
  .friend-card { flex-wrap: wrap; gap: 8px; }
  .group-card { flex-wrap: wrap; }
}

@media (max-width: 480px) {
  .stats-row { grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
  .category-grid { grid-template-columns: 1fr; }
  .quick-actions { flex-direction: column; }
  .quick-actions .btn-action { width: 100%; justify-content: center; }

  .logo-text { font-size: 2rem; }

  .question-text { font-size: 1.1rem; }
  .quiz-option { padding: 0.8rem; }

  .podium-spot { width: 90px; padding: 0.6rem; }
  .podium-avatar { font-size: 1.8rem; }
}

/* =================================================================
   FOCUS & ACCESSIBILITY
   ================================================================= */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

button:focus:not(:focus-visible) {
  outline: none;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* =================================================================
   FUN FACT CARD (Dashboard)
   ================================================================= */
.fun-fact-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.2rem 1.5rem;
  margin-bottom: 1.5rem;
  border-left: 4px solid var(--warning-end);
  background: rgba(255, 210, 0, 0.06);
}

.fun-fact-icon {
  font-size: 2.2rem;
  flex-shrink: 0;
  animation: floating-y 3s ease-in-out infinite;
}

.fun-fact-title {
  font-family: 'Fredoka One', sans-serif;
  font-size: 1rem;
  color: var(--warning-end);
  margin-bottom: 4px;
}

.fun-fact-text {
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.5;
}

/* =================================================================
   LOADING STATE (Quiz)
   ================================================================= */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  gap: 1.5rem;
}

.loading-message {
  font-family: 'Fredoka One', sans-serif;
  font-size: 1.2rem;
  color: var(--text-muted);
  text-align: center;
  animation: pulse-glow 2s ease-in-out infinite;
}

/* =================================================================
   COMBO / STREAK TEXT
   ================================================================= */
@keyframes combo-rise {
  0% { opacity: 1; transform: translate(-50%, 0) scale(1); }
  50% { opacity: 1; transform: translate(-50%, -60px) scale(1.4); }
  100% { opacity: 0; transform: translate(-50%, -120px) scale(1.6); }
}

.combo-float {
  position: fixed;
  top: 35%;
  left: 50%;
  transform: translate(-50%, 0);
  font-family: 'Fredoka One', sans-serif;
  font-size: 2.5rem;
  color: #ffd200;
  text-shadow: 0 0 20px rgba(255, 210, 0, 0.7), 0 0 40px rgba(255, 210, 0, 0.4);
  pointer-events: none;
  z-index: 9999;
  animation: combo-rise 1.6s ease-out forwards;
  white-space: nowrap;
}

.combo-fire {
  color: #ff8c00;
  text-shadow: 0 0 20px rgba(255, 140, 0, 0.7), 0 0 40px rgba(255, 69, 0, 0.5);
}

.combo-unstoppable {
  font-size: 3rem;
  color: #f5576c;
  text-shadow: 0 0 25px rgba(245, 87, 108, 0.8), 0 0 50px rgba(245, 87, 108, 0.5), 0 0 80px rgba(240, 147, 251, 0.3);
}

/* =================================================================
   EMOJI RAIN
   ================================================================= */
@keyframes emoji-fall {
  0% { transform: translateY(-40px) rotate(0deg); opacity: 1; }
  80% { opacity: 1; }
  100% { transform: translateY(105vh) rotate(360deg); opacity: 0; }
}

.emoji-rain-drop {
  position: fixed;
  top: -40px;
  pointer-events: none;
  z-index: 9998;
  animation: emoji-fall linear forwards;
  user-select: none;
}

/* =================================================================
   TOAST NOTIFICATION
   ================================================================= */
.toast-notification {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  background: rgba(15, 12, 41, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-left: 4px solid var(--warning-end);
  border-radius: var(--radius);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
  z-index: 10000;
  max-width: 90vw;
  animation: slide-up 0.4s ease-out forwards;
}

.toast-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.toast-text {
  font-size: 0.95rem;
  line-height: 1.4;
  color: var(--text);
}

.toast-fade-out {
  opacity: 0;
  transform: translateX(-50%) translateY(20px);
  transition: all 0.4s ease-in;
}

/* =================================================================
   SCROLLBAR
   ================================================================= */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.1); }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.2); }

/* Recovery / modal-box */
.btn-link-subtle {
  background: none;
  border: none;
  color: rgba(255,255,255,0.55);
  font-size: 0.85rem;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}
.btn-link-subtle:hover { color: rgba(255,255,255,0.9); }

.modal-box {
  width: 100%;
  max-width: 440px;
  padding: 2rem;
  border-radius: 20px;
}

/* =================================================================
   BrainQuest Kid-Art Styles — hand-drawn crayon look
   ================================================================= */

.landing-content { position: relative; z-index: 1; }

.bq-art-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

/* All kid SVG art shares these base traits */
.bq-kid-art {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(2px 3px 0px rgba(0,0,0,0.18));
}

/* Individual piece animations — each slightly different timing for liveliness */
.bq-art-item { animation: kidWobble 3s ease-in-out infinite; }
.bq-art-item:nth-child(1) { animation-duration: 3.2s; animation-delay: 0s; }
.bq-art-item:nth-child(2) { animation-duration: 2.8s; animation-delay: -0.8s; }
.bq-art-item:nth-child(3) { animation-duration: 3.6s; animation-delay: -1.4s; }
.bq-art-item:nth-child(4) { animation-duration: 2.6s; animation-delay: -0.4s; }
.bq-art-item:nth-child(5) { animation-duration: 3.4s; animation-delay: -1.8s; }
.bq-art-item:nth-child(6) { animation-duration: 4.0s; animation-delay: -2.2s; }

@keyframes kidWobble {
  0%   { transform: rotate(-4deg) translateY(0px); }
  25%  { transform: rotate(2deg)  translateY(-6px); }
  50%  { transform: rotate(-2deg) translateY(-10px); }
  75%  { transform: rotate(3deg)  translateY(-5px); }
  100% { transform: rotate(-4deg) translateY(0px); }
}

/* Dashboard corner rocket */
.bq-dash-rocket {
  position: absolute;
  top: -10px;
  right: 12px;
  pointer-events: none;
  width: 52px;
  animation: kidWobble 3s ease-in-out infinite;
  opacity: 0.9;
}

/* =================================================================
   TIMER MODE
   ================================================================= */
.countdown-bar-wrap { height: 8px; background: rgba(255,255,255,0.1); border-radius: 4px; margin-bottom: 1rem; overflow: hidden; }
.countdown-bar { height: 100%; background: #43e97b; border-radius: 4px; transition: width 1s linear; }
.timer-toggle-wrap { display: flex; align-items: center; gap: 1rem; padding: 0.75rem 1.25rem; margin-bottom: 1rem; flex-wrap: wrap; }
.toggle-switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background: rgba(255,255,255,0.1); border-radius: 24px; transition: 0.3s; }
.toggle-slider:before { content: ''; position: absolute; height: 18px; width: 18px; left: 3px; bottom: 3px; background: white; border-radius: 50%; transition: 0.3s; }
input:checked + .toggle-slider { background: #43e97b; }
input:checked + .toggle-slider:before { transform: translateX(20px); }
.timer-desc { font-size: 0.8rem; opacity: 0.6; }

/* =================================================================
   WRONG ANSWER REVIEW
   ================================================================= */
.wrong-review { padding: 1.5rem; margin-top: 1.5rem; }
.review-item { margin-bottom: 1.5rem; padding-bottom: 1.5rem; border-bottom: 1px solid rgba(255,255,255,0.08); }
.review-item:last-child { border-bottom: none; margin-bottom: 0; }
.review-q { font-weight: 700; margin-bottom: 0.75rem; }
.review-options { display: flex; flex-direction: column; gap: 0.4rem; }
.review-opt { padding: 0.5rem 0.75rem; border-radius: 8px; font-size: 0.9rem; background: rgba(255,255,255,0.05); }
.opt-correct { background: rgba(67,233,123,0.2); border: 1px solid rgba(67,233,123,0.4); }
.opt-wrong { background: rgba(255,107,107,0.2); border: 1px solid rgba(255,107,107,0.4); }
.review-funfact { margin-top: 0.5rem; font-size: 0.85rem; opacity: 0.7; font-style: italic; }

/* =================================================================
   WEAK SPOTS TRACKER
   ================================================================= */
.weakspots { padding: 1.25rem 1.5rem; margin-bottom: 1.5rem; }
.ws-row { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.75rem; }
.ws-row:last-child { margin-bottom: 0; }
.ws-icon { font-size: 1.1rem; width: 24px; text-align: center; }
.ws-name { width: 120px; font-size: 0.85rem; font-weight: 600; flex-shrink: 0; }
.ws-bar-wrap { flex: 1; height: 10px; background: rgba(255,255,255,0.08); border-radius: 5px; overflow: hidden; }
.ws-bar { height: 100%; border-radius: 5px; transition: width 0.6s ease; }
.ws-pct { width: 40px; text-align: right; font-size: 0.85rem; font-weight: 700; }
.pct-low { color: #ff6b6b; } .pct-mid { color: #ffd200; } .pct-high { color: #43e97b; }

/* =================================================================
   DAILY MISSION CARD
   ================================================================= */
.mission-card { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.5rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.mission-done-card { border-color: rgba(67,233,123,0.4); }
.mission-left { display: flex; align-items: center; gap: 0.75rem; }
.mission-icon { font-size: 1.6rem; }
.mission-title { font-weight: 800; font-size: 0.9rem; }
.mission-desc { font-size: 0.8rem; opacity: 0.7; }
.mission-right { display: flex; flex-direction: column; gap: 0.3rem; min-width: 160px; }
.mission-bar-wrap { height: 8px; background: rgba(255,255,255,0.1); border-radius: 4px; overflow: hidden; }
.mission-bar { height: 100%; background: linear-gradient(90deg,#667eea,#43e97b); border-radius: 4px; transition: width 0.5s ease; }
.mission-count { font-size: 0.8rem; font-weight: 700; text-align: right; }

/* =================================================================
   REPORT USER
   ================================================================= */
.btn-report-inline { background: rgba(255,107,107,0.12); border: 1px solid rgba(255,107,107,0.25); color: #ff6b6b; padding: 2px 6px; border-radius: 50px; font-size: 0.7rem; cursor: pointer; }
.btn-report-inline:hover { background: rgba(255,107,107,0.25); }

/* =================================================================
   TEACHER DASHBOARD
   ================================================================= */
.teacher-page { min-height: 100vh; }
.teacher-container { max-width: 900px; margin: 0 auto; padding: 1.5rem; }
.class-card { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.5rem; margin-bottom: 0.75rem; cursor: pointer; transition: all 0.2s; }
.class-card:hover { transform: translateY(-2px); border-color: rgba(102,126,234,0.5); }
.class-info { display: flex; flex-direction: column; gap: 0.25rem; }
.class-name { font-weight: 700; font-size: 1.05rem; }
.class-members { font-size: 0.85rem; opacity: 0.7; }
.class-arrow { opacity: 0.5; font-size: 1.2rem; }
.members-table { overflow-x: auto; margin-bottom: 1rem; }

/* =================================================================
   PRINTABLE CERTIFICATE
   ================================================================= */
.btn-gold { background: linear-gradient(135deg, #fde68a, #f59e0b); color: #1a1a2e; font-weight: 800; border: none; padding: 0.75rem 1.5rem; border-radius: 50px; cursor: pointer; display: inline-block; text-decoration: none; }
.btn-gold:hover { transform: translateY(-2px); box-shadow: 0 4px 20px rgba(245,158,11,0.4); }
