/* =========================================================
   NEVER HAVE I EVER — Main Stylesheet v1.1
   Glory Games Arcade
   Fonts: Fredoka (headings) + Nunito (body)
   Themes applied via JS themes.js overriding --ne-* vars.
   Default palette: Pastel Arcade Pop (themes.js sets values).
   ========================================================= */

/* ── CSS Custom Properties (Pastel Arcade Pop defaults) ─────
   themes.js overrides all --ne-* vars at runtime via JS.
   These fallbacks ensure the page looks right before JS.   */
:root {
  /* ── Background: semi-transparent whites → frosted glass
        over the body gradient. themes.js swaps these.     */
  --ne-bg:          #2d1b69;
  --ne-bg-card:     rgba(255,255,255,0.09);
  --ne-bg-surface:  rgba(255,255,255,0.14);
  --ne-bg-elevated: rgba(255,255,255,0.20);
  --ne-bg-hover:    rgba(255,255,255,0.26);

  /* ── Candy accent colors ─────────────────────────────── */
  --ne-lime:        #FF6EB4;   /* bubblegum pink  = primary  */
  --ne-lime-dim:    #CC3D88;
  --ne-purple:      #00CFFF;   /* electric cyan   = secondary */
  --ne-purple-dark: #0099BB;
  --ne-cyan:        #FFE566;   /* pastel yellow   = accent   */
  --ne-gold:        #FFD700;
  --ne-pink:        #FF4DA6;
  --ne-red:         #FF6B6B;
  --ne-green:       #4ADE80;
  --ne-orange:      #FB923C;

  /* ── Text (overridden to dark in sunny-party theme) ──── */
  --ne-text:        #FFFFFF;
  --ne-text-muted:  rgba(255,255,255,0.78);
  --ne-text-dim:    rgba(255,255,255,0.44);

  /* ── Glow box-shadows ───────────────────────────────── */
  --glow-lime:      0 0 28px rgba(255,110,180,0.65), 0 0 56px rgba(255,110,180,0.20);
  --glow-purple:    0 0 28px rgba(0,207,255,0.65),   0 0 56px rgba(0,207,255,0.20);
  --glow-cyan:      0 0 22px rgba(255,229,102,0.55);
  --glow-gold:      0 0 22px rgba(255,215,0,0.60);
  --glow-pink:      0 0 22px rgba(255,77,166,0.60);
  --glow-red:       0 0 22px rgba(255,107,107,0.60);

  /* ── Full-screen body + splash gradient ─────────────── */
  --splash-grad:    linear-gradient(160deg, #4c1d95 0%, #2d1b69 45%, #1a3a8f 100%);

  /* ── Border tokens ─────────────────────────────────── */
  --ne-border:       rgba(255,255,255,0.14);
  --ne-border-hover: rgba(255,255,255,0.28);

  /* ── Radii ──────────────────────────────────────────── */
  --radius-sm:   10px;
  --radius-md:   16px;
  --radius-lg:   22px;
  --radius-xl:   32px;
  --radius-pill: 100px;

  /* ── Motion timing ─────────────────────────────────── */
  --t-fast: 0.12s ease;
  --t-med:  0.26s ease;
  --t-slow: 0.46s ease;

  /* ── Max content width ──────────────────────────────── */
  --max-w: 460px;
}

/* =========================================================
   RESET & BASE
   ========================================================= */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  height: 100%;
  height: 100dvh;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  color-scheme: dark light;
}

body {
  min-height: 100%;
  min-height: 100dvh;
  font-family: 'Nunito', 'Segoe UI', sans-serif;
  /* Per-theme background image — gradient var kept as colour fallback */
  background-image: url('../assets/bgs/bg-pastel.png');
  background-color: var(--ne-bg);
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  background-repeat: no-repeat;
  color: var(--ne-text);
  overflow: hidden;
}

/* ---- Per-theme body backgrounds ---- */
[data-theme="candy-neon"] body  { background-image: url('../assets/bgs/bg-candy.png'); }
[data-theme="sunny-party"] body { background-image: url('../assets/bgs/bg-sunny.png'); }

button {
  cursor: pointer;
  font-family: inherit;
  border: none;
  outline: none;
  background: none;
}

input, textarea, select {
  font-family: inherit;
  outline: none;
}

/* Fredoka for arcade headings */
.orbitron,
.screen-title,
.splash-title-never,
.splash-brand-label,
.hud-player-name,
.hud-turn-num,
.score-value,
.gameover-title,
.gameover-winner-name,
.question-eyebrow,
.settings-section-title,
.htp-section-title,
.guided-title,
.category-count-badge,
.btn-back,
.hud-btn,
.modal-title,
.cooldown-title {
  font-family: 'Fredoka', 'Nunito', cursive !important;
}

/* Strong btn text */
.btn {
  font-family: 'Fredoka', 'Nunito', cursive;
}

/* =========================================================
   APP SHELL
   ========================================================= */
#app {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── Desktop: show gradient background on wide viewports ── */
@media (min-width: 641px) {
  body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
      radial-gradient(ellipse at 20% 50%, rgba(255,110,180,0.12) 0%, transparent 55%),
      radial-gradient(ellipse at 80% 50%, rgba(0,207,255,0.12) 0%, transparent 55%);
    pointer-events: none;
    z-index: 0;
  }

  #app {
    /* Center game content area on desktop */
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: min(100%, 520px);
    box-shadow: 0 0 120px rgba(0,0,0,0.55);
  }
}

/* =========================================================
   SCREEN TRANSITIONS
   ========================================================= */
.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  /* Transparent — body gradient shows through all screens */
  background: transparent;
}

.screen.entering {
  animation: screenEnter var(--t-med) cubic-bezier(0.34,1.3,0.64,1) both;
}

.screen.exiting {
  animation: screenExit var(--t-fast) ease both;
}

@keyframes screenEnter {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}

@keyframes screenExit {
  from { opacity: 1; transform: scale(1); }
  to   { opacity: 0; transform: scale(0.97); }
}

/* Reduced-motion overrides */
@media (prefers-reduced-motion: reduce) {
  .screen.entering, .screen.exiting { animation: none !important; }
  .question-card { animation: none !important; }
  .gameover-trophy { animation: none !important; }
  .splash-title-never { animation: none !important; }
  .player-row { animation: none !important; }
  .particle { display: none !important; }
}

/* =========================================================
   SCROLLABLE SCREEN BODY
   ========================================================= */
.screen-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 0 1.25rem 2rem;
  /* Centre content up to max-w on desktop */
  display: flex;
  flex-direction: column;
  align-items: center;
}

.screen-body > * {
  width: 100%;
  max-width: var(--max-w);
}

/* =========================================================
   SCREEN HEADER (sticky top bar)
   ========================================================= */
.screen-header {
  position: sticky;
  top: 0;
  z-index: 10;
  /* Frosted glass header — no opaque background */
  background: transparent;
  padding: 1.1rem 1.25rem 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  max-width: 100%;
  flex-shrink: 0;
}

.screen-header-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
}

.screen-title {
  font-family: 'Fredoka', cursive;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--ne-lime);
  text-shadow: var(--glow-lime);
  text-align: center;
  flex: 1;
}

.screen-subtitle {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ne-text-muted);
  text-align: center;
  margin-top: 0.2rem;
}

/* =========================================================
   BACK BUTTON
   ========================================================= */
.btn-back {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-family: 'Fredoka', cursive;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ne-purple);
  letter-spacing: 0.5px;
  padding: 0.5rem 0.9rem;
  border: 2px solid rgba(var(--ne-purple-dark), 0.3);
  border-radius: var(--radius-pill);
  background: rgba(0,212,255,0.08);
  transition: all var(--t-fast);
  flex-shrink: 0;
  white-space: nowrap;
}

.btn-back:hover, .btn-back:active {
  background: rgba(0,212,255,0.18);
  border-color: var(--ne-purple);
  box-shadow: var(--glow-purple);
  transform: scale(0.97);
}

/* =========================================================
   CORE BUTTON SYSTEM
   ========================================================= */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 1rem 1.75rem;
  border-radius: var(--radius-pill);
  font-family: 'Fredoka', 'Nunito', cursive;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  transition: transform var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
  position: relative;
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  min-height: 58px;
  -webkit-user-select: none;
  user-select: none;
  text-decoration: none;
}

.btn:active {
  transform: scale(0.93) !important;
}

/* Shimmer swipe on press */
.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 35%, rgba(255,255,255,0.18) 50%, transparent 65%);
  transform: translateX(-100%);
  transition: transform 0.35s ease;
  pointer-events: none;
}
.btn:active::after { transform: translateX(100%); }

/* === Primary — theme lime color === */
.btn-primary {
  background: linear-gradient(135deg, var(--ne-lime-dim) 0%, var(--ne-lime) 100%);
  color: #fff;
  border-color: var(--ne-lime);
  box-shadow: 0 6px 22px rgba(0,0,0,0.35), 0 0 0 0 var(--ne-lime);
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}
.btn-primary:not(:disabled):hover {
  box-shadow: var(--glow-lime), 0 6px 22px rgba(0,0,0,0.35);
  transform: translateY(-2px);
}

/* === Secondary — theme purple color === */
.btn-secondary {
  background: linear-gradient(135deg, var(--ne-purple-dark) 0%, var(--ne-purple) 100%);
  color: #fff;
  border-color: var(--ne-purple);
  box-shadow: 0 6px 22px rgba(0,0,0,0.35);
}
.btn-secondary:not(:disabled):hover {
  box-shadow: var(--glow-purple), 0 6px 22px rgba(0,0,0,0.35);
  transform: translateY(-2px);
}

/* === Ghost / Outline === */
.btn-ghost {
  background: var(--ne-bg-card);
  color: var(--ne-text-muted);
  border-color: var(--ne-border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.btn-ghost:not(:disabled):hover {
  border-color: var(--ne-border-hover);
  color: var(--ne-text);
  background: var(--ne-bg-surface);
}

/* === Danger === */
.btn-danger {
  background: linear-gradient(135deg, #aa1010 0%, var(--ne-red) 100%);
  color: #fff;
  border-color: var(--ne-red);
  box-shadow: 0 4px 18px rgba(255,100,100,0.28);
}
.btn-danger:not(:disabled):hover {
  box-shadow: var(--glow-red);
  transform: translateY(-2px);
}

/* === Gold === */
.btn-gold {
  background: linear-gradient(135deg, #b87800 0%, var(--ne-gold) 100%);
  color: #1a1040;
  border-color: var(--ne-gold);
  box-shadow: 0 4px 18px rgba(255,215,0,0.28);
  text-shadow: none;
  font-weight: 700;
}
.btn-gold:not(:disabled):hover {
  box-shadow: var(--glow-gold);
  transform: translateY(-2px);
}

/* === Small === */
.btn-sm {
  font-size: 0.88rem;
  padding: 0.6rem 1.1rem;
  min-height: 44px;
}

/* === Icon only === */
.btn-icon {
  width: 46px;
  min-height: 46px;
  padding: 0;
  border-radius: 50%;
  font-size: 1.1rem;
}

/* Disabled */
.btn:disabled, .btn[disabled] {
  opacity: 0.32;
  pointer-events: none;
  transform: none !important;
}

/* =========================================================
   CARD
   ========================================================= */
.card {
  background: var(--ne-bg-card);
  border: 1.5px solid var(--ne-border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  transition: all var(--t-fast);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.card-hover:hover, .card-hover:active {
  border-color: var(--ne-border-hover);
  background: var(--ne-bg-surface);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.25);
}

/* =========================================================
   TOGGLE SWITCH
   ========================================================= */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.toggle-label {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.toggle-label span:first-child {
  font-size: 1rem;
  font-weight: 600;
  color: var(--ne-text);
}

.toggle-label span.toggle-desc {
  font-size: 0.8rem;
  color: var(--ne-text-muted);
}

.toggle-switch {
  position: relative;
  width: 52px;
  height: 28px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.toggle-thumb {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.12);
  border-radius: 14px;
  cursor: pointer;
  transition: all var(--t-fast);
  border: 1px solid var(--ne-border);
}

.toggle-thumb::before {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  left: 3px;
  top: 3px;
  background: var(--ne-text-muted);
  border-radius: 50%;
  transition: all var(--t-fast);
}

.toggle-switch input:checked + .toggle-thumb {
  background: rgba(255,110,180,0.22);
  border-color: var(--ne-lime);
  box-shadow: var(--glow-lime);
}

.toggle-switch input:checked + .toggle-thumb::before {
  transform: translateX(24px);
  background: var(--ne-lime);
}

/* =========================================================
   TOAST NOTIFICATIONS
   ========================================================= */
#toast-container {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: center;
  pointer-events: none;
  width: calc(100% - 2rem);
  max-width: 400px;
}

.toast {
  background: var(--ne-bg-elevated);
  border: 1px solid var(--ne-border);
  color: var(--ne-text);
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 600;
  text-align: center;
  animation: toastIn 0.3s ease both;
  pointer-events: auto;
  width: 100%;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.toast.success { border-color: var(--ne-green); color: var(--ne-green); }
.toast.error   { border-color: var(--ne-red);   color: var(--ne-red); }
.toast.warning { border-color: var(--ne-gold);  color: var(--ne-gold); }
.toast.info    { border-color: var(--ne-cyan);  color: var(--ne-cyan); }

.toast.hiding {
  animation: toastOut 0.3s ease both;
}

@keyframes toastIn  { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toastOut { from { opacity: 1; transform: translateY(0); }   to { opacity: 0; transform: translateY(-8px); } }

/* =========================================================
   MODAL OVERLAY
   ========================================================= */
#modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 8000;
  background: rgba(0,0,0,0.8);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  backdrop-filter: blur(4px);
  animation: fadeIn var(--t-med) ease both;
  padding: 0 1rem 1.5rem;
}

#modal-overlay.hidden { display: none; }

.modal-box {
  background: var(--ne-bg-elevated);
  border: 1px solid var(--ne-border-hover);
  border-radius: var(--radius-xl) var(--radius-xl) var(--radius-lg) var(--radius-lg);
  width: 100%;
  max-width: var(--max-w);
  padding: 2rem 1.5rem 1.5rem;
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  animation: slideUp var(--t-med) ease both;
}

@keyframes slideUp { from { transform: translateY(40px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes fadeIn  { from { opacity: 0; } to { opacity: 1; } }

.modal-title {
  font-family: 'Fredoka', cursive;
  font-size: 1.2rem;
  color: var(--ne-lime);
  text-shadow: var(--glow-lime);
  margin-bottom: 0.75rem;
  letter-spacing: 1px;
}

/* =========================================================
   SPLASH SCREEN
   ========================================================= */
.splash-screen {
  /* Splash fills the full game panel — NO SCROLLBAR */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: env(safe-area-inset-top, 2rem) 1.5rem env(safe-area-inset-bottom, 2rem);
  padding-top:    max(env(safe-area-inset-top,  0px), 2.5rem);
  padding-bottom: max(env(safe-area-inset-bottom, 0px), 2rem);
  overflow: hidden;
  position: relative;
  background: transparent;
  height: 100%;
}

/* Floating particle blobs — generated by game.js */
.particle {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  animation: particleFloat linear infinite;
  filter: blur(4px);
}

@keyframes particleFloat {
  0%   { opacity: 0; transform: translateY(110vh) rotate(0deg) scale(0.6); }
  8%   { opacity: 0.6; }
  90%  { opacity: 0.4; }
  100% { opacity: 0; transform: translateY(-80px) rotate(540deg) scale(1.2); }
}

.splash-version {
  font-size: 0.62rem;
  color: var(--ne-text-dim);
  letter-spacing: 1.5px;
  text-align: center;
  position: relative;
  z-index: 1;
}

.splash-logo-img {
  /* The actual game logo SVG */
  width: min(88vw, 340px);
  height: auto;
  display: block;
  margin: 0 auto;
  position: relative;
  z-index: 1;
  animation: logoReveal 0.7s cubic-bezier(0.34,1.56,0.64,1) both;
  filter: drop-shadow(0 8px 32px rgba(255,110,180,0.35))
          drop-shadow(0 0 60px rgba(0,207,255,0.20));
}

@keyframes logoReveal {
  from { opacity: 0; transform: scale(0.78) translateY(16px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.splash-logo-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  position: relative;
  z-index: 1;
}

.splash-tagline {
  font-family: 'Nunito', sans-serif;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--ne-text-muted);
  text-align: center;
  letter-spacing: 1px;
  text-transform: uppercase;
  animation: fadeUp 0.5s 0.45s ease both;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.splash-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  width: 100%;
  max-width: var(--max-w);
  position: relative;
  z-index: 1;
  animation: fadeUp 0.5s 0.55s ease both;
}

/* Small secondary links row in splash */
.splash-links {
  display: flex;
  gap: 0.6rem;
  justify-content: center;
  margin-top: 0.2rem;
}

.splash-link {
  font-family: 'Nunito', sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ne-text-muted);
  padding: 0.55rem 1rem;
  border-radius: var(--radius-pill);
  background: var(--ne-bg-card);
  border: 1px solid var(--ne-border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  cursor: pointer;
  transition: all var(--t-fast);
  flex: 1;
  text-align: center;
}

.splash-link:hover, .splash-link:active {
  background: var(--ne-bg-surface);
  border-color: var(--ne-border-hover);
  color: var(--ne-text);
  transform: translateY(-1px);
}

/* Pulsing start button ring */
.btn-start-pulse {
  animation: startPulse 2.2s ease-in-out infinite;
}

@keyframes startPulse {
  0%,100% { box-shadow: 0 6px 22px rgba(0,0,0,0.35), 0 0 0 0 rgba(255,110,180,0.6); }
  50%      { box-shadow: 0 6px 22px rgba(0,0,0,0.35), 0 0 0 12px rgba(255,110,180,0); }
}

/* =========================================================
   AGE SELECT SCREEN
   ========================================================= */
.age-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1.5rem;
}

.age-card {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.4rem 1.25rem;
  background: var(--ne-bg-card);
  border: 2px solid var(--ne-border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--t-fast);
  text-align: left;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  animation: fadeSlideIn 0.35s ease both;
}

.age-card:nth-child(2) { animation-delay: 0.07s; }
.age-card:nth-child(3) { animation-delay: 0.14s; }

.age-card:hover, .age-card:active {
  border-color: var(--ne-purple);
  background: var(--ne-bg-surface);
  transform: translateY(-3px) scale(1.01);
  box-shadow: 0 10px 32px rgba(0,0,0,0.25), var(--glow-purple);
}

.age-card.selected {
  border-color: var(--ne-lime);
  background: var(--ne-bg-surface);
  box-shadow: 0 8px 28px rgba(0,0,0,0.2), var(--glow-lime);
}

.age-icon {
  font-size: 2.8rem;
  flex-shrink: 0;
  width: 60px;
  text-align: center;
}

.age-info { min-width: 0; }
.age-name {
  font-family: 'Fredoka', cursive;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--ne-text);
  letter-spacing: 0.5px;
}
.age-desc {
  font-size: 0.85rem;
  color: var(--ne-text-muted);
  margin-top: 0.2rem;
}

/* =========================================================
   QUESTION CARD — GAMEPLAY
   ========================================================= */

/* Score pop animation — triggered via JS adding .score-pop class */
.score-value.score-pop {
  animation: scorePop 0.45s cubic-bezier(0.34,1.56,0.64,1) both;
}

@keyframes scorePop {
  0%  { transform: scale(1); }
  40% { transform: scale(1.5) translateY(-4px); color: var(--ne-lime); }
  100%{ transform: scale(1) translateY(0); }
}

/* +1 floating burst */
.score-burst {
  position: absolute;
  font-family: 'Fredoka', cursive;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--ne-gold);
  text-shadow: var(--glow-gold);
  pointer-events: none;
  animation: burstFloat 0.9s ease both;
  z-index: 999;
  white-space: nowrap;
}

@keyframes burstFloat {
  0%   { opacity: 1; transform: translateY(0) scale(0.6); }
  40%  { opacity: 1; transform: translateY(-32px) scale(1.2); }
  100% { opacity: 0; transform: translateY(-64px) scale(0.8); }
}

/* Question card slide-in variants */
.question-card.slide-from-right {
  animation: slideFromRight 0.35s cubic-bezier(0.34,1.2,0.64,1) both;
}

@keyframes slideFromRight {
  from { opacity: 0; transform: translateX(40px) scale(0.95); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}

/* =========================================================
   CATEGORY SELECT SCREEN
   ========================================================= */
.category-header-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 1rem 0 0.75rem;
}

.category-count-badge {
  font-family: 'Fredoka', cursive;
  font-size: 0.82rem;
  color: var(--ne-lime);
  background: var(--ne-bg-card);
  border: 1px solid var(--ne-border-hover);
  border-radius: 20px;
  padding: 0.25rem 0.75rem;
  backdrop-filter: blur(10px);
}

.category-random-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.1rem 1.25rem;
  background: linear-gradient(135deg, rgba(168,85,247,0.1) 0%, rgba(132,255,0,0.05) 100%);
  border: 2px solid rgba(168,85,247,0.4);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--t-fast);
  margin-bottom: 0.75rem;
}

.category-random-card:hover, .category-random-card:active {
  border-color: var(--ne-purple);
  box-shadow: var(--glow-purple);
}

.category-random-card.active {
  border-color: var(--ne-lime);
  background: linear-gradient(135deg, rgba(132,255,0,0.1) 0%, rgba(168,85,247,0.05) 100%);
  box-shadow: var(--glow-lime);
}

.cat-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 5.5rem; /* space for sticky button */
}

.cat-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: var(--ne-bg-card);
  border: 2px solid var(--ne-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--t-fast);
  position: relative;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.cat-item:hover, .cat-item:active {
  border-color: rgba(255,255,255,0.22);
  background: var(--ne-bg-surface);
  transform: translateY(-1px);
}

.cat-item.selected {
  border-color: var(--ne-lime);
  background: var(--ne-bg-surface);
  box-shadow: 0 4px 16px rgba(0,0,0,0.15), var(--glow-lime);
}

.cat-item.selected .cat-name { color: var(--ne-lime); }

.cat-item.selected .cat-check {
  background: var(--ne-lime);
  border-color: var(--ne-lime);
  color: #fff;
}

.cat-icon-wrap {
  font-size: 1.9rem;
  width: 48px;
  text-align: center;
  flex-shrink: 0;
}

.cat-info { flex: 1; min-width: 0; }
.cat-name {
  font-family: 'Nunito', sans-serif;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--ne-text);
}
.cat-desc {
  font-size: 0.78rem;
  color: var(--ne-text-muted);
  margin-top: 0.15rem;
}

.cat-check {
  width: 26px;
  height: 26px;
  border: 2px solid rgba(255,255,255,0.2);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  color: transparent;
  flex-shrink: 0;
  transition: all var(--t-fast);
}

.cat-item.selected .cat-check::after { content: '✓'; }

/* Sticky bottom action bar */
.bottom-action-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1rem 1.25rem 1.5rem;
  background: linear-gradient(0deg, var(--ne-bg) 60%, transparent);
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.bottom-action-bar > * {
  width: 100%;
  max-width: var(--max-w);
}

/* =========================================================
   PLAYER SETUP SCREEN
   ========================================================= */
.player-list {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  margin: 1rem 0;
}

.player-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: var(--ne-bg-card);
  border: 1px solid var(--ne-border);
  border-radius: var(--radius-md);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  animation: fadeSlideIn 0.25s ease both;
}

@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateX(-16px); }
  to   { opacity: 1; transform: translateX(0); }
}

.player-avatar {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--ne-purple-dark), var(--ne-purple));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.player-name-text {
  flex: 1;
  font-size: 1rem;
  font-weight: 600;
  color: var(--ne-text);
}

.btn-remove-player {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,59,59,0.1);
  border: 1px solid rgba(255,59,59,0.3);
  color: var(--ne-red);
  font-size: 1rem;
  transition: all var(--t-fast);
  flex-shrink: 0;
}

.btn-remove-player:hover {
  background: rgba(255,59,59,0.2);
  box-shadow: var(--glow-red);
}

.player-add-row {
  display: flex;
  gap: 0.75rem;
  margin: 0.25rem 0 0.5rem;
}

.player-input {
  flex: 1;
  background: var(--ne-bg-card);
  border: 2px solid var(--ne-border);
  border-radius: var(--radius-md);
  color: var(--ne-text);
  font-size: 1rem;
  font-weight: 600;
  padding: 0.85rem 1rem;
  backdrop-filter: blur(12px);
  transition: border-color var(--t-fast);
}

.player-input:focus {
  border-color: var(--ne-purple);
  box-shadow: 0 0 0 3px rgba(0,207,255,0.15);
}

.player-input::placeholder { color: var(--ne-text-dim); }

/* =========================================================
   THEME PICKER  (settings screen)
   ========================================================= */
.theme-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.65rem;
  margin-top: 0.5rem;
}

.theme-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  padding: 0.85rem 0.5rem;
  background: var(--ne-bg-card);
  border: 2px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--t-fast);
  text-align: center;
}

.theme-card:hover, .theme-card:active {
  border-color: rgba(255,255,255,0.28);
  background: var(--ne-bg-surface);
  transform: translateY(-2px);
}

.theme-card.active {
  border-color: var(--ne-lime);
  box-shadow: var(--glow-lime);
}

.theme-card-emoji { font-size: 1.6rem; }
.theme-card-name  {
  font-family: 'Fredoka', cursive;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ne-text-muted);
  line-height: 1.2;
}
.theme-card.active .theme-card-name { color: var(--ne-lime); }

/* =========================================================
   ONLINE / OFFLINE STATUS BADGE
   ========================================================= */
.offline-badge {
  position: fixed;
  bottom: 5.5rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255,107,107,0.15);
  border: 1px solid rgba(255,107,107,0.4);
  border-radius: var(--radius-pill);
  color: var(--ne-red);
  font-size: 0.72rem;
  font-weight: 600;
  font-family: 'Fredoka', cursive;
  padding: 0.3rem 0.9rem;
  z-index: 500;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  letter-spacing: 0.5px;
  animation: fadeUp 0.4s ease both;
  pointer-events: none;
}

.sync-badge {
  position: fixed;
  top: 0.6rem;
  right: 0.75rem;
  background: rgba(255,215,0,0.15);
  border: 1px solid rgba(255,215,0,0.4);
  border-radius: var(--radius-pill);
  color: var(--ne-gold);
  font-size: 0.65rem;
  font-weight: 600;
  font-family: 'Fredoka', cursive;
  padding: 0.2rem 0.65rem;
  z-index: 500;
  pointer-events: none;
  letter-spacing: 0.5px;
}

/* =========================================================
   GAMEPLAY SCREEN
   ========================================================= */
.gameplay-screen {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.gameplay-hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem 0.5rem;
  background: transparent;
  position: relative;
  z-index: 10;
}

.hud-player {
  display: flex;
  flex-direction: column;
}

.hud-player-label {
  font-size: 0.65rem;
  color: var(--ne-text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.hud-player-name {
  font-family: 'Fredoka', cursive;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--ne-lime);
  text-shadow: var(--glow-lime);
  max-width: 160px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hud-center {
  text-align: center;
}

.hud-turn-label {
  font-size: 0.65rem;
  color: var(--ne-text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.hud-turn-num {
  font-family: 'Fredoka', cursive;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--ne-text-muted);
}

.hud-actions {
  display: flex;
  gap: 0.5rem;
}

.hud-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--ne-text-muted);
  font-size: 0.55rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all var(--t-fast);
  cursor: pointer;
  min-width: 44px;
}

.hud-btn span.hud-icon { font-size: 1.2rem; line-height: 1; }
.hud-btn:hover { border-color: var(--ne-purple); color: var(--ne-purple); }

.gameplay-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1.25rem;
  overflow-y: auto;
}

/* Large question card */
.question-card {
  width: 100%;
  max-width: var(--max-w);
  background: var(--ne-bg-card);
  border: 2px solid rgba(255,110,180,0.28);
  border-radius: var(--radius-xl);
  padding: 2rem 1.75rem;
  text-align: center;
  position: relative;
  box-shadow: 0 12px 48px rgba(0,0,0,0.30), inset 0 1px 0 rgba(255,255,255,0.08);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  animation: questionReveal 0.4s cubic-bezier(0.34,1.56,0.64,1) both;
}

@keyframes questionReveal {
  from { opacity: 0; transform: scale(0.9) translateY(20px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.question-card::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(168,85,247,0.15) 0%, rgba(132,255,0,0.05) 100%);
  z-index: -1;
  border-radius: var(--radius-xl);
}

.question-eyebrow {
  font-family: 'Fredoka', cursive;
  font-size: 0.78rem;
  color: var(--ne-purple);
  text-shadow: var(--glow-purple);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 1.25rem;
}

.question-text {
  font-family: 'Nunito', sans-serif;
  font-size: clamp(1.2rem, 5vw, 1.65rem);
  font-weight: 700;
  color: var(--ne-text);
  line-height: 1.55;
}

.question-category-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem;
  margin-top: 1.25rem;
}

.category-tag {
  font-size: 0.7rem;
  padding: 0.2rem 0.6rem;
  background: rgba(168,85,247,0.12);
  border: 1px solid rgba(168,85,247,0.25);
  border-radius: 20px;
  color: var(--ne-purple);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.question-pool-warning {
  font-size: 0.78rem;
  color: var(--ne-gold);
  text-align: center;
  padding: 0.5rem;
  margin-top: 0.75rem;
  animation: pulse 2s ease infinite;
}

@keyframes pulse { 0%,100% { opacity:1; } 50% { opacity:0.5; } }

/* =========================================================
   GAMEPLAY ACTION BUTTONS
   ========================================================= */
.gameplay-actions {
  padding: 0.75rem 1.25rem 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  flex-shrink: 0;
}

.gameplay-actions > * {
  max-width: var(--max-w);
  width: 100%;
  margin: 0 auto;
}

.action-row {
  display: flex;
  gap: 0.65rem;
  max-width: var(--max-w);
  width: 100%;
  margin: 0 auto;
}

.action-row .btn { flex: 1; }

/* =========================================================
   SCOREBOARD SCREEN
   ========================================================= */
.score-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 1rem 0;
}

.score-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: var(--ne-bg-card);
  border: 2px solid var(--ne-border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: all var(--t-fast);
}

.score-row.current-player {
  border-color: var(--ne-lime);
  background: var(--ne-bg-surface);
  box-shadow: var(--glow-lime);
}

.score-rank {
  font-family: 'Fredoka', cursive;
  font-size: 0.9rem;
  color: var(--ne-text-dim);
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}

.score-rank.rank-1 { color: var(--ne-gold); font-size: 1.2rem; }

.score-avatar {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, var(--ne-purple-dark), var(--ne-purple));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.score-name {
  flex: 1;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ne-text);
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.score-value {
  font-family: 'Fredoka', cursive;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--ne-gold);
  text-shadow: var(--glow-gold);
  flex-shrink: 0;
  min-width: 40px;
  text-align: center;
}

.score-controls {
  display: flex;
  gap: 0.4rem;
  flex-shrink: 0;
}

.score-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid;
  font-size: 1.1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--t-fast);
  cursor: pointer;
}

.score-btn-minus {
  border-color: rgba(255,59,59,0.4);
  color: var(--ne-red);
  background: rgba(255,59,59,0.08);
}
.score-btn-minus:hover { background: rgba(255,59,59,0.2); box-shadow: var(--glow-red); }

.score-btn-plus {
  border-color: rgba(132,255,0,0.4);
  color: var(--ne-lime);
  background: rgba(132,255,0,0.08);
}
.score-btn-plus:hover { background: rgba(132,255,0,0.2); box-shadow: var(--glow-lime); }

/* =========================================================
   GAME OVER SCREEN
   ========================================================= */
.gameover-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 3rem 1.5rem 2.5rem;
  background: transparent;
  overflow-y: auto;
  text-align: center;
}

.gameover-trophy {
  font-size: 6rem;
  animation: trophyBounce 0.7s cubic-bezier(0.34,1.56,0.64,1) both;
  margin-bottom: 0.5rem;
  filter: drop-shadow(0 0 20px rgba(255,215,0,0.5));
}

@keyframes trophyBounce {
  from { transform: scale(0) rotate(-25deg); opacity: 0; }
  to   { transform: scale(1) rotate(0deg);  opacity: 1; }
}

.gameover-title {
  font-family: 'Fredoka', cursive;
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--ne-lime);
  text-shadow: var(--glow-lime);
  letter-spacing: 2px;
}

.gameover-winner-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ne-text-muted);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-top: 1.5rem;
}

.gameover-winner-name {
  font-family: 'Fredoka', cursive;
  font-size: 2rem;
  font-weight: 700;
  color: var(--ne-gold);
  text-shadow: var(--glow-gold);
  margin-top: 0.25rem;
}

.gameover-final-scores {
  width: 100%;
  max-width: var(--max-w);
  margin: 1.5rem 0;
}

.gameover-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
  max-width: var(--max-w);
}

/* =========================================================
   SETTINGS SCREEN
   ========================================================= */
.settings-section {
  margin: 1.25rem 0;
}

.settings-section-title {
  font-family: 'Fredoka', cursive;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ne-text-dim);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  cursor: pointer;
  gap: 1rem;
}

.settings-row-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.settings-row-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--ne-text);
}

.settings-row-desc {
  font-size: 0.78rem;
  color: var(--ne-text-muted);
}

.settings-arrow {
  color: var(--ne-text-dim);
  font-size: 1rem;
  flex-shrink: 0;
}

/* =========================================================
   HOW TO PLAY SCREEN
   ========================================================= */
.htp-section {
  margin: 1.25rem 0;
}

.htp-section-title {
  font-family: 'Fredoka', cursive;
  font-size: 1rem;
  font-weight: 700;
  color: var(--ne-purple);
  text-shadow: var(--glow-purple);
  letter-spacing: 1px;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.htp-step {
  display: flex;
  gap: 1rem;
  margin-bottom: 0.9rem;
  align-items: flex-start;
}

.htp-step-num {
  font-family: 'Fredoka', cursive;
  font-size: 0.88rem;
  font-weight: 700;
  color: #fff;
  background: var(--ne-lime);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 0.05rem;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.htp-step-text {
  font-size: 0.95rem;
  color: var(--ne-text-muted);
  line-height: 1.6;
}

.htp-tip {
  background: rgba(168,85,247,0.08);
  border-left: 3px solid var(--ne-purple);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 0.85rem 1rem;
  font-size: 0.88rem;
  color: var(--ne-text-muted);
  margin: 0.75rem 0;
}

/* =========================================================
   SUBMIT QUESTION SCREEN
   ========================================================= */
.submit-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-top: 1rem;
  padding-bottom: 6rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-label {
  font-family: 'Fredoka', cursive;
  font-size: 0.82rem;
  color: var(--ne-text-muted);
  text-transform: uppercase;
  letter-spacing: 2px;
}

.form-textarea {
  background: var(--ne-bg-card);
  border: 2px solid var(--ne-border);
  border-radius: var(--radius-md);
  color: var(--ne-text);
  font-size: 1rem;
  font-weight: 500;
  padding: 1rem;
  resize: none;
  line-height: 1.6;
  min-height: 120px;
  transition: border-color var(--t-fast);
  font-family: 'Nunito', sans-serif;
  backdrop-filter: blur(12px);
}

.form-textarea:focus {
  border-color: var(--ne-purple);
  box-shadow: 0 0 0 3px rgba(0,207,255,0.15);
}

.form-textarea::placeholder { color: var(--ne-text-dim); }

.form-char-count {
  font-size: 0.75rem;
  color: var(--ne-text-dim);
  text-align: right;
}

.age-selector {
  display: flex;
  gap: 0.5rem;
}

.age-chip {
  flex: 1;
  padding: 0.75rem 0.5rem;
  background: var(--ne-bg-card);
  border: 2px solid var(--ne-border);
  border-radius: var(--radius-md);
  color: var(--ne-text-muted);
  font-family: 'Fredoka', cursive;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: all var(--t-fast);
  backdrop-filter: blur(12px);
}

.age-chip.selected {
  border-color: var(--ne-lime);
  color: var(--ne-text);
  background: var(--ne-bg-surface);
  box-shadow: var(--glow-lime);
}

.cat-checkgrid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}

.cat-checkbox-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 0.85rem;
  background: var(--ne-bg-card);
  border: 2px solid var(--ne-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--t-fast);
  font-size: 0.85rem;
  color: var(--ne-text-muted);
  backdrop-filter: blur(12px);
}

.cat-checkbox-item.selected {
  border-color: var(--ne-lime);
  color: var(--ne-text);
  background: var(--ne-bg-surface);
  box-shadow: var(--glow-lime);
}

.cat-checkbox-item span:first-child { font-size: 1.1rem; }

/* =========================================================
   REPORT COOLDOWN NOTICE
   ========================================================= */
.cooldown-notice {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1.25rem;
  background: rgba(255,215,0,0.06);
  border: 1px solid rgba(255,215,0,0.3);
  border-radius: var(--radius-lg);
  text-align: center;
  margin: 0.75rem 0;
}

.cooldown-icon { font-size: 2rem; }
.cooldown-title { font-family: 'Fredoka', cursive; font-size: 0.95rem; color: var(--ne-gold); text-transform: uppercase; letter-spacing: 1px; }
.cooldown-text  { font-size: 0.88rem; color: var(--ne-text-muted); }
.cooldown-timer { font-family: 'Fredoka', cursive; font-size: 1.6rem; font-weight: 700; color: var(--ne-gold); text-shadow: var(--glow-gold); }

/* =========================================================
   GUIDED PLAYTHROUGH
   ========================================================= */
.guided-step {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
  padding: 2rem 1.5rem;
  text-align: center;
}

.guided-icon { font-size: 4rem; animation: pulse 2s ease infinite; }
.guided-title {
  font-family: 'Fredoka', cursive;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--ne-lime);
  text-shadow: var(--glow-lime);
  letter-spacing: 1px;
}
.guided-desc { font-size: 1rem; color: var(--ne-text-muted); max-width: 320px; line-height: 1.6; }

.guided-progress {
  display: flex;
  gap: 0.4rem;
  justify-content: center;
  margin-top: 0.5rem;
}

.guided-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  transition: all var(--t-fast);
}

.guided-dot.active {
  background: var(--ne-lime);
  box-shadow: var(--glow-lime);
  width: 24px;
  border-radius: 4px;
}

/* =========================================================
   UTILITY CLASSES
   ========================================================= */
.text-lime    { color: var(--ne-lime); }
.text-purple  { color: var(--ne-purple); }
.text-gold    { color: var(--ne-gold); }
.text-red     { color: var(--ne-red); }
.text-muted   { color: var(--ne-text-muted); }
.text-center  { text-align: center; }
.text-small   { font-size: 0.85rem; }

.mt-sm { margin-top: 0.5rem; }
.mt-md { margin-top: 1rem; }
.mt-lg { margin-top: 1.5rem; }
.mb-sm { margin-bottom: 0.5rem; }
.mb-md { margin-bottom: 1rem; }

.divider {
  width: 60px; height: 3px;
  background: linear-gradient(90deg, var(--ne-lime), var(--ne-purple));
  border-radius: 2px;
  margin: 0.75rem auto;
}

.glow-lime   { text-shadow: var(--glow-lime); }
.glow-purple { text-shadow: var(--glow-purple); }

.orbitron { font-family: 'Orbitron', 'Arial Black', sans-serif; }

/* =========================================================
   INSTALL PROMPT MODAL CONTENT
   ========================================================= */
.install-steps {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  margin: 0.75rem 0 1.25rem;
}

.install-step {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: 0.9rem;
  color: var(--ne-text-muted);
  line-height: 1.5;
}

.install-step-num {
  font-family: 'Fredoka', cursive;
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
  background: var(--ne-purple);
  min-width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 0.1rem;
  text-shadow: none;
}

.install-highlight {
  font-weight: 700;
  color: var(--ne-text);
  background: rgba(255,255,255,0.08);
  border-radius: 6px;
  padding: 0.1rem 0.4rem;
  font-family: 'Fredoka', cursive;
}

/* =========================================================
   SCORE ROW — Fredoka numbers
   ========================================================= */
.score-value {
  font-family: 'Fredoka', cursive;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--ne-gold);
  text-shadow: var(--glow-gold);
  flex-shrink: 0;
  min-width: 44px;
  text-align: center;
  position: relative;
}

/* =========================================================
   MODE SELECT — game mode choice cards
   ========================================================= */
.mode-section-label {
  font-family: 'Fredoka', cursive;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--ne-text-dim);
  margin: 1.25rem 0 0.6rem;
}

.mode-section-label:first-child {
  margin-top: 0;
}

/* Each mode choice card */
.mode-card {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  background: var(--ne-bg-card);
  border: 1.5px solid var(--ne-border);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.25rem;
  margin-bottom: 0.65rem;
  cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast), transform var(--t-fast);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.mode-card:hover,
.mode-card:active {
  background: var(--ne-bg-elevated);
  border-color: var(--ne-lime);
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(0,0,0,0.18), var(--glow-lime);
}

.mode-icon {
  font-size: 2.2rem;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.mode-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.mode-name {
  font-family: 'Fredoka', cursive;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ne-text);
  line-height: 1.2;
}

.mode-desc {
  font-family: 'Nunito', sans-serif;
  font-size: 0.83rem;
  color: var(--ne-text-muted);
  line-height: 1.5;
}

.mode-badge {
  display: inline-block;
  font-family: 'Fredoka', cursive;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 0.15rem 0.55rem;
  border-radius: 20px;
  margin-top: 0.3rem;
  width: fit-content;
}

.mode-badge-classic {
  background: rgba(255,110,180,0.18);
  color: var(--ne-lime);
  border: 1px solid rgba(255,110,180,0.35);
}

.mode-badge-score {
  background: rgba(0,207,255,0.15);
  color: var(--ne-purple);
  border: 1px solid rgba(0,207,255,0.30);
}

/* =========================================================
   FINGER PIPS — lives visualisation in HUD + scoreboard
   ========================================================= */

/* Container in HUD */
.finger-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  flex-wrap: wrap;
  max-width: 120px;
}

/* Individual pip dot */
.finger-pip {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
  transition: background var(--t-fast), opacity var(--t-fast);
}

.finger-pip.pip-on {
  background: var(--ne-lime);
  box-shadow: 0 0 8px rgba(255,110,180,0.7);
}

.finger-pip.pip-off {
  background: rgba(255,255,255,0.12);
  box-shadow: none;
}

/* Smaller pips for scoreboard mini-display */
.finger-pip.finger-pip-sm {
  width: 8px;
  height: 8px;
}

.mini-pips {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
}

/* Player status sub-label in HUD */
.hud-player-status {
  font-family: 'Nunito', sans-serif;
  font-size: 0.7rem;
  color: var(--ne-text-muted);
  margin-top: 2px;
}

/* =========================================================
   ELIMINATED PLAYER STYLING
   ========================================================= */

/* Eliminated bar above question card */
.gameplay-eliminated-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.4rem var(--screen-px);
  background: rgba(255,107,107,0.08);
  border-bottom: 1px solid rgba(255,107,107,0.18);
}

.elim-badge {
  font-family: 'Fredoka', cursive;
  font-size: 0.72rem;
  color: var(--ne-red);
  background: rgba(255,107,107,0.12);
  border: 1px solid rgba(255,107,107,0.25);
  border-radius: 20px;
  padding: 0.15rem 0.6rem;
}

/* Score row for eliminated players */
.score-row.player-eliminated {
  opacity: 0.45;
}

.score-row.player-eliminated .score-name {
  text-decoration: line-through;
  text-decoration-color: var(--ne-red);
}

/* =========================================================
   BTN-WARNING — orange/amber for high-stakes actions
   ========================================================= */
.btn-warning {
  background: linear-gradient(135deg, #fb923c, #f59e0b);
  color: #1a0a2e;
  font-weight: 800;
  box-shadow: 0 4px 20px rgba(251,146,60,0.40);
  border: none;
}

.btn-warning:hover:not(:disabled),
.btn-warning:active:not(:disabled) {
  background: linear-gradient(135deg, #f97316, #d97706);
  box-shadow: 0 0 28px rgba(251,146,60,0.65), 0 6px 24px rgba(251,146,60,0.30);
  transform: translateY(-2px);
}

.btn-warning:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* =========================================================
   SETTINGS — Theme image button grid
   ========================================================= */

/* 3-column grid for the three theme JPEG buttons */
.theme-btn-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.65rem;
}

/* Each theme button: transparent wrapper with active border ring */
.theme-btn {
  background: none;
  border: 3px solid transparent;
  border-radius: 18px;
  padding: 0;
  cursor: pointer;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  transition: transform var(--t-fast), border-color var(--t-med), box-shadow var(--t-med);
}

/* Image fills the full button square */
.theme-btn img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 15px;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

/* Active (current theme) — bright pink glow ring */
.theme-btn.active {
  border-color: var(--ne-pink);
  box-shadow: 0 0 0 2px var(--ne-pink),
              0 0 22px rgba(255, 110, 180, 0.55);
}

/* Hover state for non-active buttons */
.theme-btn:hover:not(.active) {
  transform: scale(1.06);
  border-color: rgba(255, 255, 255, 0.40);
}

.theme-btn:active {
  transform: scale(0.95);
}

/* =========================================================
   AGE SELECT — stacked image buttons
   ========================================================= */
.age-btn-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
  max-width: var(--max-w);
  padding: 0.5rem 0;
}

/* =========================================================
   SPLASH — image button overrides
   ========================================================= */

/* The buttons stacked in splash-buttons need consistent spacing */
.splash-buttons .btn-asset {
  margin: 0;
}

/* Secondary splash links row — two small image buttons side by side */
.splash-links {
  display: flex;
  gap: 1.25rem;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 0.25rem;
}

.splash-links .btn-asset.btn-asset-sm {
  width: auto;
}

/* =========================================================
   RESPONSIVE — Desktop adjustments
   ========================================================= */
@media (min-width: 600px) {
  :root { --max-w: 500px; }
  .cat-checkgrid { grid-template-columns: repeat(3, 1fr); }
}

/* =========================================================
   IMAGE BUTTONS — PNG asset button system
   ========================================================= */

/* Wrapper button — strips all default styling, becomes transparent */
.btn-asset {
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform var(--t-fast), filter var(--t-fast);
}

/* The actual <img> inside a btn-asset wrapper */
.btn-img-asset {
  display: block;
  width: 100%;
  height: auto;
  max-width: 340px;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
  -webkit-user-select: none;
}

/* Small variant — fixed height, auto width (header / inline buttons) */
.btn-asset.btn-asset-sm {
  width: auto;
}
.btn-asset.btn-asset-sm .btn-img-asset {
  width: auto;
  height: 2.6rem;
  max-width: none;
}

/* Toggle variant — settings on/off buttons */
.btn-asset.btn-asset-toggle {
  width: auto;
}
.btn-asset.btn-asset-toggle .btn-img-asset {
  width: auto;
  height: 2.1rem;
  max-width: none;
}

/* Hover / active states for all asset buttons */
.btn-asset:hover:not(:disabled):not([disabled]) {
  transform: translateY(-2px) scale(1.03);
  filter: drop-shadow(0 6px 18px rgba(255,110,180,0.55)) brightness(1.09);
}

.btn-asset:active:not(:disabled):not([disabled]) {
  transform: scale(0.96);
  filter: brightness(0.92);
}

.btn-asset:disabled,
.btn-asset[disabled] {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
  transform: none;
  filter: none;
}

/* Header back button using image — strips btn-back visual styling */
.btn-back-img {
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  color: transparent !important;
  display: flex;
  align-items: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform var(--t-fast), filter var(--t-fast);
  flex-shrink: 0;
}

.btn-back-img .btn-img-asset {
  display: block;
  height: 2.6rem;
  width: auto;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.btn-back-img:hover {
  transform: translateY(-1px) scale(1.04);
  filter: drop-shadow(0 4px 10px rgba(255,110,180,0.5)) brightness(1.1);
}

.btn-back-img:active {
  transform: scale(0.95);
  filter: brightness(0.9);
}

/* =========================================================
   REDUCED MOTION (user preference)
   ========================================================= */
[data-reduced-motion="true"] .particle,
[data-reduced-motion="true"] .splash-logo-img,
[data-reduced-motion="true"] .gameover-trophy,
[data-reduced-motion="true"] .question-card,
[data-reduced-motion="true"] .player-row {
  animation: none !important;
  transition: none !important;
}

/* =========================================================
   SAFE AREA INSETS (iPhone notch/home bar)
   ========================================================= */
@supports (padding: max(0px)) {
  .bottom-action-bar   { padding-bottom: max(1.5rem, env(safe-area-inset-bottom)); }
  .gameplay-actions    { padding-bottom: max(1.75rem, env(safe-area-inset-bottom)); }
  .gameover-screen     { padding-bottom: max(2.5rem, env(safe-area-inset-bottom)); }
}

/* =========================================================
   SUNNY PARTY MODE — Light Theme Overrides
   Applied when data-theme="sunny-party" is set on <html>.
   Overrides dark-mode colors to warm pastel daytime palette.
   ========================================================= */
[data-theme="sunny-party"] {
  color-scheme: light;
}

/* Light theme body gradient */
[data-theme="sunny-party"] body {
  background: var(--splash-grad);
}

/* All cards: bright frosted white panels */
[data-theme="sunny-party"] .card,
[data-theme="sunny-party"] .age-card,
[data-theme="sunny-party"] .cat-item,
[data-theme="sunny-party"] .player-row,
[data-theme="sunny-party"] .score-row,
[data-theme="sunny-party"] .question-card,
[data-theme="sunny-party"] .cat-checkbox-item,
[data-theme="sunny-party"] .theme-card,
[data-theme="sunny-party"] .player-input,
[data-theme="sunny-party"] .form-textarea,
[data-theme="sunny-party"] .age-chip,
[data-theme="sunny-party"] .modal-box,
[data-theme="sunny-party"] .toast,
[data-theme="sunny-party"] .splash-link,
[data-theme="sunny-party"] .btn-ghost {
  box-shadow: 0 4px 24px rgba(0,0,0,0.10);
}

/* Settings section dividers for light bg */
[data-theme="sunny-party"] .toggle-row,
[data-theme="sunny-party"] .settings-section-title {
  border-color: rgba(0,0,0,0.08);
}

[data-theme="sunny-party"] .settings-section-title {
  border-bottom-color: rgba(0,0,0,0.1);
}

/* Tagline / muted text contrast on light */
[data-theme="sunny-party"] .splash-tagline {
  letter-spacing: 1.5px;
}
