/* ============================================
   ASVAB Mastery - Spring/Dandelion Palette
   ============================================ */

:root {
  --bg: linear-gradient(160deg, #e8f4fd 0%, #fef9ef 50%, #e6f7ee 100%);
  --surface: rgba(255, 255, 255, 0.65);
  --surface-solid: #ffffff;
  --border: rgba(0, 0, 0, 0.08);
  --accent: #f5c518;
  --accent-yellow: #f5c518;
  --accent-hover: #e6b200;
  --accent-pink: #e84393;
  --mint: #00b894;
  --text: #2d3436;
  --text-light: #636e72;
  --danger: #d63031;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.1);
  --font: 'Outfit', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Outfit', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  width: 100vw;
}

/* Home view = scrollable, game view = locked grid */
body.home-view {
  overflow-y: auto;
  display: block;
}

body.game-view {
  height: 100vh;
  overflow: hidden;
  display: grid;
  grid-template-rows: 60px auto;
}

/* ---- NAV ---- */
.sticky-nav {
  background: var(--surface);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
  position: sticky;
  top: 0;
  height: 60px;
}

.nav-content {
  max-width: 900px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
}

.logo-group h1 { font-size: 1.05rem; font-weight: 800; color: var(--text); }
.logo-group .subtitle { font-size: 0.6rem; color: var(--text-light); font-weight: 600; }

.home-nav-btn {
  background: var(--surface-solid);
  border: 1.5px solid var(--border);
  color: var(--text);
  width: 40px; height: 40px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
}
.home-nav-btn:hover { background: var(--accent); border-color: var(--accent); }

.stopwatch-display {
  font-family: 'Outfit', monospace;
  font-size: 1.5rem; font-weight: 800;
  color: var(--text);
  background: var(--accent);
  padding: 0.15rem 0.8rem;
  border-radius: var(--radius-sm);
}
.stopwatch-display.danger { background: var(--danger); color: #fff; animation: shake 0.3s infinite; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-2px); }
  75% { transform: translateX(2px); }
}

.score-board { display: flex; gap: 0.8rem; }
.score-item { text-align: right; }
.score-label { display: block; font-size: 0.5rem; font-weight: 800; color: var(--text-light); letter-spacing: 0.08em; }
.score-val { display: block; font-size: 1.1rem; font-weight: 800; color: var(--text); }

/* ---- NAV RIGHT GROUP ---- */
.nav-right-group {
  display: flex; align-items: center; gap: 0.5rem;
}
.auth-nav-btn {
  background: var(--accent-yellow); color: var(--text); border: none;
  padding: 0.35rem 0.9rem; border-radius: 50px; font-weight: 700;
  font-family: var(--font); cursor: pointer; font-size: 0.75rem;
  transition: all 0.15s;
}
.auth-nav-btn:hover { filter: brightness(1.1); transform: scale(1.03); }
.user-badge {
  display: flex; align-items: center; gap: 0.35rem;
  background: var(--surface-solid); border: 1px solid var(--border);
  padding: 0.2rem 0.6rem 0.2rem 0.2rem; border-radius: 50px;
}
.user-initial {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--accent-pink); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem; font-weight: 800;
}
.user-name { font-size: 0.75rem; font-weight: 700; color: var(--text); }
.notif-btn {
  background: none; border: none; color: var(--text);
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; position: relative; transition: background 0.15s;
}
.notif-btn:hover { background: rgba(0,0,0,0.06); }
.notif-badge {
  position: absolute; top: 0; right: 0;
  background: var(--danger); color: #fff; font-size: 0.55rem;
  font-weight: 800; min-width: 16px; height: 16px;
  border-radius: 50px; display: flex; align-items: center;
  justify-content: center; padding: 0 3px;
}

/* ============================================
   HOME SCREEN
   ============================================ */
.home-screen {
  max-width: 720px;
  margin: 0 auto;
  padding: 1.5rem 1rem 1.5rem;
}

.hero-title {
  font-size: 1.4rem; font-weight: 800; color: var(--text);
  margin-bottom: 0.25rem; line-height: 1.2;
}
.hero-sub {
  font-size: 0.85rem; color: var(--text-light); font-weight: 500;
}

.home-footer {
  text-align: center; padding: 1.5rem 0 0.5rem;
  font-size: 0.7rem; color: #8c8c8c; font-weight: 400;
}

/* ---- SECTION HEADER ---- */
.section-header {
  margin: 1.2rem 0 0.6rem; padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}
.section-header h2 {
  font-size: 0.95rem; font-weight: 800; color: var(--text);
  margin-bottom: 0.15rem;
}
.section-header p {
  font-size: 0.72rem; color: var(--text-light); font-weight: 500;
}

/* ---- SITE STATS WIDGET ---- */
.site-stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.5rem;
  margin-bottom: 1.5rem;
}
.stat-pill {
  display: flex; align-items: center; gap: 0.5rem;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 0.6rem 0.7rem;
  transition: transform 0.15s, box-shadow 0.15s;
}
.stat-pill:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.08);
}
.stat-icon { font-size: 1.2rem; }
.stat-data { display: flex; flex-direction: column; }
.stat-num {
  font-size: 1.1rem; font-weight: 800; color: var(--text);
  line-height: 1;
}
.stat-label {
  font-size: 0.55rem; font-weight: 700; color: var(--text-light);
  text-transform: uppercase; letter-spacing: 0.06em;
}
@media (max-width: 600px) {
  .site-stats { grid-template-columns: repeat(2, 1fr); }
}

/* ---- EXAM INFO PANELS ---- */
.info-panels {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem;
  margin-bottom: 1rem;
}
.info-panel {
  border-radius: var(--radius-lg); padding: 1.2rem;
  position: relative; overflow: hidden; color: #fff;
}
.info-panel::before {
  content: ''; position: absolute; top: -40px; right: -40px;
  width: 120px; height: 120px;
  background: rgba(255,255,255,0.06); border-radius: 50%;
}
.panel-badge {
  display: inline-block; background: rgba(255,255,255,0.2);
  font-weight: 800; font-size: 0.6rem; letter-spacing: 0.1em;
  padding: 0.15rem 0.6rem; border-radius: 50px; margin-bottom: 0.5rem;
}
.info-panel h3 { font-size: 0.95rem; font-weight: 800; margin-bottom: 0.3rem; }
.info-panel p { font-size: 0.75rem; opacity: 0.92; line-height: 1.5; margin-bottom: 0.6rem; }

/* ASVAB panel - blue for recruits */
.asvab-panel {
  background: linear-gradient(135deg, #1e3a5f 0%, #2d6a8a 100%);
}
.subtest-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.25rem;
  margin-bottom: 0.6rem;
}
.subtest {
  display: flex; align-items: center; gap: 0.4rem;
  font-size: 0.7rem; font-weight: 500; padding: 0.2rem 0;
  opacity: 0.75;
}
.subtest.afqt-sub {
  opacity: 1; font-weight: 700;
}
.sub-code {
  background: rgba(255,255,255,0.18); padding: 0.1rem 0.35rem;
  border-radius: 4px; font-size: 0.6rem; font-weight: 800;
  min-width: 24px; text-align: center;
}
.afqt-sub .sub-code {
  background: var(--accent-yellow); color: #1a1a2e;
}
.panel-highlight {
  background: rgba(255,255,255,0.1); border-radius: var(--radius-md);
  padding: 0.4rem 0.6rem; font-size: 0.7rem; line-height: 1.4;
}

/* AFCT panel - olive for enlisted */
.afct-panel {
  background: linear-gradient(135deg, #4b5320 0%, #6b7a3a 100%);
}
.afct-reasons {
  display: grid; gap: 0.25rem; margin-bottom: 0.6rem;
}
.afct-reason {
  font-size: 0.7rem; padding: 0.25rem 0.5rem;
  background: rgba(255,255,255,0.08); border-radius: var(--radius-sm);
  line-height: 1.4;
}
.afct-steps {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.3rem;
  margin-bottom: 0.6rem;
}
.afct-step {
  display: flex; align-items: center; gap: 0.4rem;
  font-size: 0.7rem; font-weight: 600;
}
.afct-step span {
  background: rgba(255,255,255,0.2); width: 20px; height: 20px;
  border-radius: 50%; display: flex; align-items: center;
  justify-content: center; font-size: 0.6rem; font-weight: 800;
  flex-shrink: 0;
}
.afct-warning {
  background: rgba(255,200,50,0.15); border: 1px solid rgba(255,200,50,0.3);
  border-radius: var(--radius-md);
  padding: 0.4rem 0.6rem; font-size: 0.68rem; line-height: 1.4;
}
@media (max-width: 600px) {
  .info-panels { grid-template-columns: 1fr; }
  .subtest-grid { grid-template-columns: 1fr; }
  .afct-steps { grid-template-columns: 1fr; }
}


.home-greeting {
  text-align: center;
  margin-bottom: 1.5rem;
}

.greeting-text {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.35rem;
}

.greeting-sub {
  font-size: 0.8rem;
  color: var(--text-light);
  font-weight: 500;
}

.goal-badge {
  display: inline-block;
  background: var(--accent);
  color: var(--text);
  padding: 0.1rem 0.5rem;
  border-radius: 6px;
  font-weight: 800;
  font-size: 0.85rem;
}

.activity-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

.activity-card {
  background: var(--surface-solid);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.2rem;
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 0.8rem;
  align-items: center;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow);
}

.activity-card:hover {
  border-color: var(--accent);
  box-shadow: 0 6px 24px rgba(245, 197, 24, 0.18);
  transform: translateY(-2px);
}

.activity-card:active { transform: translateY(0) scale(0.98); }

.quiz-card-menu { border-left: 3px solid var(--accent-pink); }
.mixed-card { border-left: 3px solid var(--mint); }

.activity-icon {
  font-size: 1.8rem;
  display: flex; align-items: center; justify-content: center;
}

.activity-info h3 { font-size: 0.95rem; font-weight: 800; color: var(--text); }
.activity-desc { font-size: 0.7rem; color: var(--text-light); margin-top: 0.15rem; }
.activity-count { font-size: 0.65rem; font-weight: 700; color: var(--mint); margin-top: 0.2rem; }

.activity-stats {
  text-align: right;
  min-width: 70px;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-light);
  line-height: 1.6;
}

.stat-row span:last-child {
  font-weight: 800;
  color: var(--text);
}

/* ============================================
   GAME VIEW (study + quiz)
   ============================================ */
#gameView {
  display: grid;
  grid-template-rows: 44px 1fr 60px;
  height: calc(100vh - 60px);
  overflow: hidden;
}

.app-header {
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 1rem;
}

.category-selector { display: flex; gap: 0.4rem; }

.cat-btn {
  background: var(--surface);
  border: 1.5px solid var(--border);
  color: var(--text-light);
  padding: 0.35rem 0.9rem;
  border-radius: 30px;
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.cat-btn.active {
  background: var(--accent);
  color: var(--text);
  border-color: var(--accent);
  box-shadow: 0 2px 10px rgba(245, 197, 24, 0.25);
}

.stats { font-size: 0.75rem; font-weight: 700; color: var(--text-light); }

/* ---- MAIN ---- */
main {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.8rem 1rem;
  overflow: hidden;
  width: 100%;
}

#studyContainer, #quizContainer {
  width: 100%; max-width: 620px; height: 100%;
  display: flex; align-items: center; justify-content: center;
}

#studyContainer {
  gap: 0.5rem;
}

/* ---- SIDE NAV ARROWS ---- */
.side-nav-btn {
  background: var(--surface-solid); border: 1.5px solid var(--border);
  color: var(--text); width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all 0.15s; flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  z-index: 5;
}
.side-nav-btn:hover { background: var(--accent); border-color: var(--accent); }
.side-nav-btn:active { transform: scale(0.9); }

@media (max-width: 500px) {
  .side-nav-btn { width: 36px; height: 36px; }
  .side-nav-btn svg { width: 18px; height: 18px; }
}

.card-scene {
  width: min(92vw, 520px);
  height: min(55vh, 380px);
  perspective: 1200px;
  cursor: pointer;
}

.flashcard {
  width: 100%; height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.5s ease;
}

.flashcard.is-flipped { transform: rotateY(180deg); }

.card-face {
  position: absolute; inset: 0;
  backface-visibility: hidden;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 2rem;
  background: var(--surface-solid);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
}

.card-back { transform: rotateY(180deg); }

.card-word {
  font-size: clamp(1.8rem, 5vw, 3rem);
  font-weight: 800; color: var(--text);
  text-align: center; line-height: 1.2;
  word-break: break-word;
}

.card-hint {
  font-size: 0.65rem; font-weight: 600;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-top: 1rem; opacity: 0.5;
}

.card-answer {
  font-size: clamp(1rem, 3vw, 1.4rem);
  color: var(--text); text-align: center;
  line-height: 1.5; font-weight: 500;
}

.card-extra {
  margin-top: 1rem; display: flex;
  flex-wrap: wrap; gap: 0.4rem;
  justify-content: center;
}

.chip {
  background: rgba(0, 184, 148, 0.12);
  color: var(--mint);
  padding: 0.3rem 0.7rem;
  border-radius: 8px;
  font-size: 0.7rem; font-weight: 700;
}

/* ---- QUIZ CARD ---- */
.quiz-card {
  width: min(92vw, 520px);
  background: var(--surface-solid);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  padding: 1.2rem 1.5rem;
  display: flex; flex-direction: column;
  align-items: center;
}

.quiz-cat-label {
  font-size: 0.6rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-pink);
  margin-bottom: 0.3rem;
}

.quiz-card .card-word {
  font-size: clamp(1rem, 3vw, 1.4rem);
  line-height: 1.25;
}

.quiz-options { display: grid; gap: 0.4rem; width: 100%; margin-top: 0.8rem; }

.option-btn {
  background: #f8f9fa;
  border: 1.5px solid var(--border);
  color: var(--text);
  padding: 0.65rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem; font-weight: 600;
  cursor: pointer; text-align: left;
  transition: all 0.15s ease;
}

.option-btn:hover { background: #fff3cd; border-color: var(--accent); }
.option-btn.correct { background: #d4edda !important; border-color: var(--mint) !important; color: #155724 !important; }
.option-btn.wrong { background: #f8d7da !important; border-color: var(--danger) !important; color: #721c24 !important; }

.quiz-feedback { margin-top: 0.8rem; font-size: 1rem; font-weight: 800; min-height: 1.5rem; text-align: center; }

/* ---- FOOTER ---- */
.controls {
  background: var(--surface);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 1rem;
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
  z-index: 100;
}

.footer-left, .footer-right { display: flex; align-items: center; gap: 0.6rem; }

.ctrl-btn {
  background: var(--surface-solid);
  border: 1.5px solid var(--border);
  color: var(--text);
  width: 42px; height: 42px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all 0.15s;
}
.ctrl-btn:hover { background: var(--accent); border-color: var(--accent); }
.ctrl-btn:active { transform: scale(0.93); }

.shuffle-btn { background: var(--accent-pink); border-color: var(--accent-pink); color: #fff; }
.shuffle-btn:hover { background: #d63384; }

.mode-toggle { display: flex; background: #f1f3f5; border-radius: 8px; padding: 3px; }

.mode-btn {
  background: transparent; border: none;
  color: var(--text-light);
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  font-size: 0.75rem; font-weight: 700;
  cursor: pointer;
}
.mode-btn.active { background: var(--accent); color: var(--text); }

/* ---- MODAL ---- */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; padding: 1rem;
}

.modal-box {
  background: var(--surface-solid);
  border-radius: var(--radius-lg);
  width: 100%; max-width: 420px;
  padding: 2rem; box-shadow: var(--shadow-lg);
}

.modal-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.modal-top h2 { font-size: 1.1rem; font-weight: 800; }
.modal-close { background: none; border: none; font-size: 1.8rem; cursor: pointer; color: var(--text-light); }

.history-list { max-height: 300px; overflow-y: auto; }

.history-entry {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.8rem; background: #f8f9fa;
  border-radius: var(--radius-sm); margin-bottom: 0.5rem;
}
.history-entry .h-score { font-weight: 800; font-size: 1.1rem; }
.history-entry .h-meta { font-size: 0.65rem; color: var(--text-light); }

/* ---- MOBILE ---- */
@media (max-width: 600px) {
  .sticky-nav { height: 55px; }
  .logo-group h1 { font-size: 0.9rem; }
  .stopwatch-display { font-size: 1.2rem; padding: 0.1rem 0.5rem; }
  .score-val { font-size: 0.9rem; }
  .card-word { font-size: clamp(1.4rem, 5vw, 2rem); }
  .card-face { padding: 1.5rem; }
  .option-btn { padding: 0.7rem; font-size: 0.8rem; }
  .ctrl-btn { width: 36px; height: 36px; }
  .greeting-text { font-size: 1.05rem; }
  .activity-card { padding: 0.9rem 1rem; }
  #gameView { height: calc(100vh - 55px); }
  body.game-view { grid-template-rows: 55px auto; }
}

/* ---- CONFETTI ---- */
.confetti-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  overflow: hidden;
}

.confetti-piece {
  position: absolute;
  animation: confetti-fall 2s ease-out forwards;
}

@keyframes confetti-fall {
  0% {
    opacity: 1;
    transform: translateY(-10px) translateX(0) rotate(0deg) scale(1);
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(100vh) translateX(var(--drift, 50px)) rotate(720deg) scale(0.4);
  }
}

/* ---- NAV RIGHT GROUP ---- */
.nav-right-group { display: flex; align-items: center; gap: 0.5rem; }

/* ---- USER BADGE ---- */
.user-badge {
  display: flex; align-items: center; gap: 0.35rem;
  background: rgba(255,255,255,0.7); border-radius: 50px;
  padding: 0.2rem 0.6rem 0.2rem 0.25rem; border: 1px solid var(--border);
}
.user-initial {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--accent-pink); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem; font-weight: 800;
}
.user-name { font-size: 0.75rem; font-weight: 600; color: var(--text); }



/* ---- LEADERBOARD BUTTON ---- */
.home-actions { text-align: center; margin-bottom: 0.8rem; }
.leaderboard-btn {
  background: linear-gradient(135deg, var(--accent-yellow), #f39c12);
  border: none; padding: 0.55rem 1.5rem; border-radius: 50px;
  font-family: var(--font); font-weight: 700; font-size: 0.85rem;
  cursor: pointer; color: var(--text);
  box-shadow: 0 2px 8px rgba(245,197,24,0.3);
  transition: transform 0.15s, box-shadow 0.15s;
}
.leaderboard-btn:hover { transform: scale(1.05); box-shadow: 0 4px 16px rgba(245,197,24,0.45); }

/* ---- LEADERBOARD MODAL ---- */
.leaderboard-modal { max-width: 440px; padding: 0; }
.leaderboard-modal .modal-top { padding: 1rem 1.5rem; }
.leaderboard-list { max-height: 400px; overflow-y: auto; padding: 0 1rem 1rem; }
.lb-row {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.6rem 0.8rem; border-radius: var(--radius-md);
  margin-bottom: 0.4rem; background: #f8f9fa; border: 1px solid var(--border);
}
.lb-row:nth-child(1) { background: #fff9e6; border-color: var(--accent-yellow); }
.lb-row:nth-child(2) { background: #f0f0f0; border-color: #bbb; }
.lb-row:nth-child(3) { background: #fdf0e8; border-color: #cd7f32; }
.lb-rank {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--accent-teal); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem; font-weight: 800; flex-shrink: 0;
}
.lb-row:nth-child(1) .lb-rank { background: var(--accent-yellow); color: var(--text); }
.lb-row:nth-child(2) .lb-rank { background: #aaa; }
.lb-row:nth-child(3) .lb-rank { background: #cd7f32; }
.lb-info { flex: 1; min-width: 0; }
.lb-name { font-weight: 700; font-size: 0.9rem; }
.lb-meta { font-size: 0.7rem; color: #636e72; }
.lb-score { font-weight: 800; font-size: 1.1rem; color: var(--accent-teal); white-space: nowrap; }
.lb-cheers { display: flex; gap: 0.15rem; flex-wrap: wrap; margin-top: 0.1rem; }
.lb-cheer-emoji { font-size: 0.75rem; }
.lb-cheer-btns { display: flex; gap: 0.15rem; flex-shrink: 0; }
.cheer-btn {
  background: none; border: 1px solid var(--border); border-radius: 50%;
  width: 26px; height: 26px; font-size: 0.8rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.15s, background 0.15s;
}
.cheer-btn:hover { transform: scale(1.2); background: #fff3cd; }

/* ---- NOTIFICATION BELL ---- */
.notif-btn {
  position: relative; background: none; border: none; cursor: pointer;
  padding: 0.3rem; border-radius: 50%; color: var(--text);
  transition: background 0.15s;
}
.notif-btn:hover { background: rgba(0,0,0,0.06); }
.notif-badge {
  position: absolute; top: -2px; right: -4px;
  background: #d63031; color: #fff; font-size: 0.55rem; font-weight: 800;
  min-width: 16px; height: 16px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  padding: 0 3px;
}

/* ---- NOTIFICATION DROPDOWN ---- */
.notif-dropdown {
  position: fixed; top: 50px; right: 16px; z-index: 200;
  background: var(--surface-solid); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  width: min(340px, 90vw); max-height: 360px; overflow: hidden;
}
.notif-header {
  padding: 0.7rem 1rem; font-weight: 700; font-size: 0.85rem;
  border-bottom: 1px solid var(--border);
}
.notif-list { max-height: 300px; overflow-y: auto; padding: 0.3rem; }
.notif-item {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.5rem 0.7rem; border-radius: var(--radius-md);
  font-size: 0.8rem; transition: background 0.15s;
}
.notif-item:hover { background: #f8f9fa; }
.notif-item .notif-emoji { font-size: 1.2rem; }
.notif-item .notif-text { flex: 1; }
.notif-item.unseen { background: #fff9e6; }
.notif-empty { text-align: center; opacity: 0.5; padding: 1.5rem; font-size: 0.8rem; }

/* ---- ADMIN ---- */
.admin-nav-btn {
  background: none; border: 1px solid var(--border); border-radius: 50%;
  width: 28px; height: 28px; font-size: 0.9rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
}
.admin-nav-btn:hover { background: rgba(0,0,0,0.06); }
.admin-modal { max-width: 560px; padding: 0; }
.admin-content { padding: 0 1.5rem 1.5rem; }
.admin-content h3 { font-size: 0.85rem; margin: 1rem 0 0.5rem; color: var(--text-light); }
.admin-form { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.admin-form input {
  padding: 0.5rem 0.7rem; border: 1.5px solid var(--border);
  border-radius: var(--radius-md); font-family: var(--font); font-size: 0.8rem;
}
.admin-form .auth-submit { grid-column: 1 / -1; }
.admin-form .auth-error { grid-column: 1 / -1; }
.admin-user-list { max-height: 280px; overflow-y: auto; }
.admin-user-row {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.5rem 0.6rem; border-radius: var(--radius-md);
  border: 1px solid var(--border); margin-bottom: 0.3rem; font-size: 0.8rem;
}
.admin-user-row .au-name { font-weight: 700; flex: 1; }
.admin-user-row .au-meta { color: #636e72; font-size: 0.7rem; }
.admin-user-row .au-role { font-size: 0.65rem; font-weight: 700; text-transform: uppercase; color: var(--accent-teal); }
.admin-delete-btn {
  background: #ff7675; color: #fff; border: none; border-radius: 50%;
  width: 22px; height: 22px; font-size: 0.7rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.admin-delete-btn:hover { background: #d63031; }

/* ---- PWA INSTALL POPUP ---- */
.pwa-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,0.55); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
}
.pwa-popup {
  background: var(--surface-solid); border-radius: var(--radius-lg);
  padding: 2rem; text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  max-width: 340px; width: 90vw;
  animation: popIn 0.3s ease;
}
@keyframes popIn {
  from { transform: scale(0.85); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.pwa-popup-icon { font-size: 3rem; margin-bottom: 0.5rem; }
.pwa-popup h3 {
  font-size: 1.1rem; font-weight: 800; color: var(--text);
  margin-bottom: 0.3rem;
}
.pwa-popup p {
  font-size: 0.8rem; color: var(--text-light); line-height: 1.5;
  margin-bottom: 1rem;
}
.pwa-install-btn {
  background: var(--accent-yellow); color: var(--text); border: none;
  padding: 0.7rem 2rem; border-radius: 50px; font-weight: 800;
  font-family: var(--font); cursor: pointer; font-size: 0.95rem;
  transition: transform 0.1s;
  width: 100%;
}
.pwa-install-btn:hover { transform: scale(1.02); }
.pwa-install-btn:active { transform: scale(0.97); }
.pwa-dismiss-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 0.8rem;
}
.pwa-dismiss-row label {
  display: flex; align-items: center; gap: 0.3rem;
  font-size: 0.7rem; color: var(--text-light); cursor: pointer;
}
.pwa-dismiss-row input[type="checkbox"] { width: 14px; height: 14px; cursor: pointer; }
.pwa-dismiss-btn {
  background: none; border: none; color: var(--text-light);
  font-size: 0.75rem; cursor: pointer; font-family: var(--font);
  font-weight: 600; text-decoration: underline;
}
.pwa-dismiss-btn:hover { color: var(--text); }

@media (max-width: 600px) {
  .auth-modal { max-width: 92vw; padding: 1.5rem; }
  .leaderboard-modal { max-width: 95vw; }
  .admin-modal { max-width: 95vw; }
  .user-name { display: none; }
  .admin-form { grid-template-columns: 1fr; }
}

/* ============================================
   MODALS
   ============================================ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,0.55); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
}
.modal-box {
  background: var(--surface-solid); border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  animation: popIn 0.25s ease;
  overflow: hidden;
}
.modal-top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.2rem; border-bottom: 1px solid var(--border);
}
.modal-top h2 { font-size: 1rem; font-weight: 800; }
.modal-close {
  background: none; border: none; font-size: 1.5rem;
  color: var(--text-light); cursor: pointer; line-height: 1;
  padding: 0 0.2rem;
}
.modal-close:hover { color: var(--text); }

/* ---- AUTH MODAL ---- */
.auth-modal {
  max-width: 380px; width: 90vw; padding: 0;
}
.auth-modal .modal-close {
  position: absolute; top: 0.8rem; right: 0.8rem; z-index: 2;
}
.auth-tabs {
  display: flex; border-bottom: 2px solid var(--border);
}
.auth-tab {
  flex: 1; padding: 0.9rem 0; background: none; border: none;
  font-family: var(--font); font-size: 0.85rem; font-weight: 700;
  color: var(--text-light); cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all 0.15s;
  position: relative;
}
.auth-tab.active {
  color: var(--text);
  border-bottom-color: var(--accent-yellow);
  background: rgba(245,197,24,0.06);
}
.auth-tab:hover { background: rgba(0,0,0,0.03); }
.auth-form {
  padding: 1.5rem;
  display: flex; flex-direction: column; gap: 0.75rem;
}
.auth-form input {
  width: 100%; padding: 0.7rem 0.9rem;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-family: var(--font); font-size: 0.85rem;
  background: var(--surface); color: var(--text);
  transition: border-color 0.15s;
  box-sizing: border-box;
}
.auth-form input:focus {
  outline: none; border-color: var(--accent-yellow);
  box-shadow: 0 0 0 3px rgba(245,197,24,0.15);
}
.auth-form input::placeholder { color: var(--text-light); opacity: 0.6; }
.auth-submit {
  background: linear-gradient(135deg, var(--accent-yellow), #e8b30e);
  color: var(--text); border: none;
  padding: 0.75rem; border-radius: var(--radius-sm);
  font-family: var(--font); font-size: 0.9rem; font-weight: 800;
  cursor: pointer; transition: all 0.15s;
  margin-top: 0.3rem;
}
.auth-submit:hover { filter: brightness(1.05); transform: translateY(-1px); }
.auth-submit:active { transform: translateY(0); }
.auth-error {
  color: var(--danger); font-size: 0.75rem; font-weight: 600;
  text-align: center; min-height: 1rem;
}

/* ---- LEADERBOARD MODAL ---- */
.leaderboard-modal {
  max-width: 420px; width: 90vw;
}
.leaderboard-list {
  max-height: 400px; overflow-y: auto; padding: 0.5rem;
}

/* ---- ADMIN MODAL ---- */
.admin-modal {
  max-width: 500px; width: 90vw;
}
.admin-form {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem;
  padding: 0.8rem;
}
.admin-form input {
  padding: 0.5rem 0.7rem;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-family: var(--font); font-size: 0.8rem;
  background: var(--surface); color: var(--text);
}
.admin-form input:focus {
  outline: none; border-color: var(--accent-yellow);
}
.admin-form button {
  grid-column: 1 / -1;
}

/* ============================================
   INFO PANELS (ASVAB / AFCT)
   ============================================ */
.info-panels {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem;
  margin-bottom: 1rem;
}
@media (max-width: 600px) {
  .info-panels { grid-template-columns: 1fr; }
}
.info-panel {
  border-radius: var(--radius-lg); padding: 1.2rem;
  color: #fff;
}
.info-panel h3 {
  font-size: 1rem; font-weight: 800; margin-bottom: 0.4rem;
}
.info-panel p {
  font-size: 0.75rem; line-height: 1.5; opacity: 0.92;
  margin-bottom: 0.6rem;
}

/* -- ASVAB Panel -- */
.asvab-panel {
  background: linear-gradient(135deg, #1e3a5f, #2d5a8e);
}
.panel-badge {
  display: inline-block;
  background: rgba(255,255,255,0.2);
  padding: 0.15rem 0.6rem; border-radius: 50px;
  font-size: 0.6rem; font-weight: 800;
  letter-spacing: 0.1em; text-transform: uppercase;
  margin-bottom: 0.5rem;
}
.subtest-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.3rem;
  margin-bottom: 0.6rem;
}
.subtest {
  display: flex; align-items: center; gap: 0.4rem;
  font-size: 0.7rem; font-weight: 500;
  padding: 0.25rem 0.4rem; border-radius: 6px;
  background: rgba(255,255,255,0.08);
}
.subtest.afqt-sub {
  background: rgba(245,197,24,0.2);
  font-weight: 700;
}
.sub-code {
  background: rgba(255,255,255,0.25);
  padding: 0.1rem 0.35rem; border-radius: 4px;
  font-size: 0.6rem; font-weight: 800;
  min-width: 22px; text-align: center;
}
.afqt-sub .sub-code {
  background: var(--accent-yellow); color: #1a1a1a;
}
.panel-highlight {
  background: rgba(245,197,24,0.15);
  border: 1px solid rgba(245,197,24,0.3);
  padding: 0.5rem 0.7rem; border-radius: 8px;
  font-size: 0.7rem; font-weight: 600;
}

/* -- AFCT Panel -- */
.afct-panel {
  background: linear-gradient(135deg, #3d4a2e, #5a6b3d);
}
.afct-reasons {
  display: flex; flex-direction: column; gap: 0.3rem;
  margin-bottom: 0.6rem;
}
.afct-reason {
  background: rgba(255,255,255,0.1);
  padding: 0.35rem 0.6rem; border-radius: 6px;
  font-size: 0.7rem; line-height: 1.4;
}
.afct-steps {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.3rem;
  margin-bottom: 0.6rem;
}
.afct-step {
  display: flex; align-items: center; gap: 0.4rem;
  font-size: 0.7rem; font-weight: 600;
}
.afct-step span {
  width: 20px; height: 20px; border-radius: 50%;
  background: rgba(255,255,255,0.2); display: flex;
  align-items: center; justify-content: center;
  font-size: 0.6rem; font-weight: 800; flex-shrink: 0;
}
.afct-warning {
  background: rgba(220,53,69,0.2);
  border: 1px solid rgba(220,53,69,0.4);
  padding: 0.5rem 0.7rem; border-radius: 8px;
  font-size: 0.68rem; line-height: 1.4;
}

/* ============================================
   CONTENT GATING (login required)
   ============================================ */
.gated-content {
  display: none;
}
body.logged-in .gated-content {
  display: block;
}

/* -- Login CTA for logged-out users -- */
.login-cta {
  text-align: center; padding: 2rem 1rem;
  margin: 1rem 0;
  background: var(--surface);
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
}
.login-cta h3 {
  font-size: 1rem; font-weight: 800; color: var(--text);
  margin-bottom: 0.3rem;
}
.login-cta p {
  font-size: 0.8rem; color: var(--text-light);
  margin-bottom: 1rem;
}
.login-cta-btn {
  background: linear-gradient(135deg, var(--accent-yellow), #e8b30e);
  color: var(--text); border: none;
  padding: 0.65rem 2rem; border-radius: 50px;
  font-family: var(--font); font-size: 0.9rem; font-weight: 800;
  cursor: pointer; transition: all 0.15s;
}
.login-cta-btn:hover { filter: brightness(1.05); transform: scale(1.02); }

/* ---- NOTIFICATION DROPDOWN ---- */
.notif-dropdown {
  position: absolute; top: 100%; right: 0;
  background: var(--surface-solid); border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 30px rgba(0,0,0,0.12);
  min-width: 260px; max-height: 300px; overflow-y: auto;
  z-index: 150;
}
.notif-item {
  padding: 0.6rem 0.8rem; border-bottom: 1px solid var(--border);
  font-size: 0.75rem; color: var(--text);
}
.notif-item:last-child { border-bottom: none; }
.notif-empty {
  padding: 1.5rem; text-align: center;
  font-size: 0.75rem; color: var(--text-light);
}
