/* ═══════════════════════════════════════════════════════════════════════
   STARKIDS ACADEMY — Design System v4
   Aesthetic: Luminous Storybook
   Fonts: Baloo 2 (display) + Nunito (body)
   Philosophy: Jewel-tone warmth, organic shapes, tactile interactions
═══════════════════════════════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Baloo+2:wght@400;600;700;800&family=Nunito:wght@600;700;800;900&display=swap');

/* ── Tokens ──────────────────────────────────────────────────────────── */
:root {
  --f: 'Baloo 2', sans-serif;
  --b: 'Nunito', sans-serif;

  /* Zone accent colors */
  --c-spell:  #22c55e; --c-spell2:  #15803d;
  --c-math:   #f97316; --c-math2:   #c2410c;
  --c-read:   #ec4899; --c-read2:   #be185d;
  --c-sci:    #06b6d4; --c-sci2:    #0e7490;
  --c-time:   #eab308; --c-time2:   #a16207;
  --c-bible:  #a855f7; --c-bible2:  #7e22ce;
  --c-art:    #f43f5e; --c-art2:    #be123c;
  --c-brain:  #10b981; --c-brain2:  #065f46;
  --c-fun:    #3b82f6; --c-fun2:    #1d4ed8;

  /* Neutral palette */
  --ink:      #0f172a;
  --ink-soft: #334155;
  --mist:     #f8fafc;
  --glass:    rgba(255,255,255,0.08);
  --glass2:   rgba(255,255,255,0.15);

  /* Spacing */
  --r-sm: 12px;
  --r-md: 20px;
  --r-lg: 28px;
  --r-xl: 40px;

  /* Shadows */
  --sh-sm: 0 2px 8px rgba(0,0,0,.2);
  --sh-md: 0 8px 24px rgba(0,0,0,.25);
  --sh-lg: 0 16px 48px rgba(0,0,0,.3);
  --sh-glow: 0 0 40px rgba(255,255,255,.1);
}

/* ── Reset ───────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: var(--b); overflow-x: hidden; }

/* ── NAVIGATION ──────────────────────────────────────────────────────── */
.site-nav {
  background: rgba(10,10,20,0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  padding: 0 20px;
  position: sticky; top: 0; z-index: 500;
  display: flex; align-items: center;
  justify-content: space-between;
  min-height: 56px;
}
.site-nav .logo {
  font-family: var(--f);
  font-size: 1.35rem;
  font-weight: 800;
  color: #fbbf24;
  text-decoration: none;
  letter-spacing: 1px;
  display: flex; align-items: center; gap: 6px;
  white-space: nowrap;
}
.site-nav .logo::before {
  content: '⭐';
  animation: logospin 8s linear infinite;
  display: inline-block;
}
@keyframes logospin { to { transform: rotate(360deg); } }

.site-nav .links {
  display: flex; gap: 3px; flex-wrap: wrap;
  align-items: center;
}
.site-nav .links a {
  font-family: var(--f);
  font-size: .72rem;
  font-weight: 700;
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  padding: 5px 10px;
  border-radius: 30px;
  border: 1.5px solid transparent;
  transition: all .2s;
  white-space: nowrap;
  letter-spacing: .3px;
}
.site-nav .links a:hover {
  color: #fff;
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.2);
  transform: translateY(-1px);
}
.site-nav .links a.active {
  background: #fbbf24;
  color: #0f172a;
  border-color: #fbbf24;
  font-weight: 800;
}

/* ── CHARACTER WIDGET ────────────────────────────────────────────────── */
.char-speaker {
  position: fixed;
  bottom: 18px; right: 18px;
  z-index: 400;
  display: flex; flex-direction: column;
  align-items: flex-end; gap: 8px;
  pointer-events: none;
  max-width: 270px;
}
.char-bubble {
  background: rgba(15,23,42,0.92);
  backdrop-filter: blur(12px);
  border: 2px solid var(--char-color, #22c55e);
  border-radius: 20px 20px 4px 20px;
  padding: 10px 16px;
  max-width: 250px;
  font-family: var(--b);
  font-size: .82rem;
  font-weight: 700;
  color: #f8fafc;
  line-height: 1.4;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4),
              0 0 0 1px rgba(255,255,255,0.05);
  pointer-events: none;
  animation: bubblePop .3s cubic-bezier(.34,1.4,.64,1);
}
.char-bubble::after {
  content: '';
  position: absolute;
  bottom: -10px; right: 26px;
  border: 6px solid transparent;
  border-top-color: var(--char-color, #22c55e);
}
.char-bubble.hide { opacity: 0; transform: scale(.85); transition: all .2s; }

@keyframes bubblePop {
  from { transform: scale(.5) translateY(10px); opacity: 0; }
  to   { transform: scale(1) translateY(0); opacity: 1; }
}

.char-svg-wrap {
  width: 88px; height: 88px;
  cursor: pointer; pointer-events: all;
  filter: drop-shadow(0 6px 16px rgba(0,0,0,.4));
  transition: transform .2s;
}
.char-svg-wrap:hover { transform: scale(1.12) rotate(-5deg); }
.char-svg-wrap:active { transform: scale(.92); }
.char-svg-wrap svg { width: 100%; height: 100%; display: block; }

.char-blink { animation: blink 4s ease-in-out infinite; }
@keyframes blink {
  0%,85%,95%,100% { transform: scaleY(1); }
  90% { transform: scaleY(0.05); }
}
.char-talking { animation: talking .2s ease infinite alternate; }
@keyframes talking { 0%{transform:scaleY(1) translateY(0)} 100%{transform:scaleY(.95) translateY(2px)} }
.char-happy { animation: happy .5s ease infinite alternate; }
@keyframes happy { 0%{transform:rotate(-9deg) scale(1)} 100%{transform:rotate(9deg) scale(1.06)} }
.char-bounce { animation: bounce .55s cubic-bezier(.34,1.56,.64,1); }
@keyframes bounce {
  0%{transform:translateY(0)} 40%{transform:translateY(-26px) scale(1.12)} 100%{transform:translateY(0)}
}

/* ── CHEER SQUAD LABEL ───────────────────────────────────────────────── */
.cheer-squad-wrap { margin: 10px auto 14px; max-width: 400px; padding: 4px 0; }
.cheer-squad-label {
  text-align: center; font-family: var(--f); font-size: .68rem;
  font-weight: 700; letter-spacing: 2px;
  color: rgba(255,255,255,0.35); margin-bottom: 4px;
  text-transform: uppercase;
}

/* ── SHARED BUTTON STYLES ────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  border: none; border-radius: var(--r-md);
  padding: 14px 24px;
  font-family: var(--f); font-size: 1.1rem; font-weight: 800;
  cursor: pointer; transition: all .2s; letter-spacing: .5px;
  position: relative; overflow: hidden;
}
.btn::after {
  content: '';
  position: absolute; inset: 0;
  background: rgba(255,255,255,0);
  transition: background .2s;
}
.btn:hover::after { background: rgba(255,255,255,0.12); }
.btn:hover { transform: translateY(-2px); box-shadow: var(--sh-md); }
.btn:active { transform: translateY(0); }
.btn-block { width: 100%; display: flex; margin-bottom: 10px; }

.btn-primary {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #0f172a;
  box-shadow: 0 4px 0 #b45309;
}
.btn-sky {
  background: linear-gradient(135deg, #38bdf8, #0284c7);
  color: #fff;
  box-shadow: 0 4px 0 #075985;
}
.btn-green {
  background: linear-gradient(135deg, #4ade80, #16a34a);
  color: #fff;
  box-shadow: 0 4px 0 #14532d;
}
.btn-ghost {
  background: rgba(255,255,255,0.08);
  border: 1.5px solid rgba(255,255,255,0.2);
  color: #fff;
  box-shadow: none;
}
.btn-ghost:hover { background: rgba(255,255,255,0.15); }

/* ── PILL STATS ──────────────────────────────────────────────────────── */
.stats { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-bottom: 20px; }
.pill {
  background: rgba(255,255,255,0.08);
  border: 1.5px solid rgba(255,255,255,0.15);
  border-radius: 100px;
  padding: 6px 16px;
  font-family: var(--f);
  font-size: 1rem; font-weight: 700;
  color: #fff;
  backdrop-filter: blur(8px);
}
.pill small { display: block; font-size: .58rem; color: rgba(255,255,255,.5); font-family: var(--b); margin-top: -2px; }

/* ── FEEDBACK BOXES ──────────────────────────────────────────────────── */
.fb-box {
  border-radius: var(--r-md);
  padding: 14px 18px;
  margin-bottom: 14px;
  display: none;
  animation: fadeUp .3s ease;
}
@keyframes fadeUp { from{opacity:0;transform:translateY(-10px)} to{opacity:1;transform:translateY(0)} }
.fb-box.ok { background: rgba(74,222,128,.12); border: 2px solid #4ade80; display: block; }
.fb-box.no { background: rgba(248,113,113,.12); border: 2px solid #f87171; display: block; }
.fb-msg { font-family: var(--f); font-size: 1.2rem; font-weight: 700; color: #f8fafc; }
.fb-ans { font-size: 1.6rem; letter-spacing: 4px; color: #f8fafc; margin-top: 4px; }

/* ── DROPDOWN SELECTS ────────────────────────────────────────────────── */
.sel-wrap { position: relative; display: inline-block; }
.sel-wrap::after {
  content: '▾';
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  color: #fbbf24; pointer-events: none; font-weight: 900;
}
select.sel {
  appearance: none; -webkit-appearance: none;
  background: rgba(255,255,255,0.06);
  border: 2px solid rgba(255,255,255,0.2);
  border-radius: var(--r-sm);
  color: #fff;
  padding: 10px 40px 10px 16px;
  font-family: var(--f); font-size: .95rem; font-weight: 700;
  cursor: pointer; outline: none;
  transition: border-color .2s;
}
select.sel:focus { border-color: #fbbf24; }
select.sel option { background: #0f172a; color: #fff; }

/* ── SCREEN SWITCHER ─────────────────────────────────────────────────── */
.screen { display: none; }
.screen.on { display: block; }

/* ── ANSWER BUTTONS (quiz style) ─────────────────────────────────────── */
.ans-grid { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.ans-btn {
  background: rgba(255,255,255,0.06);
  border: 2px solid rgba(255,255,255,0.18);
  border-radius: var(--r-sm);
  color: #f8fafc;
  padding: 14px 18px;
  font-family: var(--b); font-size: 1rem; font-weight: 700;
  cursor: pointer; transition: all .2s; text-align: left;
  display: flex; align-items: center; gap: 12px;
}
.ans-btn:hover { background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,.4); transform: translateX(4px); }
.ans-btn.correct { background: rgba(74,222,128,.15); border-color: #4ade80; }
.ans-btn.wrong   { background: rgba(248,113,113,.15); border-color: #f87171; animation: shake .4s; }
.ans-btn:disabled { cursor: not-allowed; opacity: .85; transform: none; }
.ans-ltr {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 50%;
  background: #fbbf24; color: #0f172a;
  font-family: var(--f); font-size: .88rem; font-weight: 800;
  flex-shrink: 0;
}
@keyframes shake { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-8px)} 75%{transform:translateX(8px)} }

/* ── RESULT SCREEN ───────────────────────────────────────────────────── */
.res-wrap { text-align: center; padding: 10px; }
.res-trophy { font-size: 5rem; margin-bottom: 8px; animation: trophyIn .6s cubic-bezier(.34,1.56,.64,1); }
@keyframes trophyIn { from{transform:scale(0) rotate(-20deg);opacity:0} to{transform:scale(1) rotate(0);opacity:1} }
.res-title { font-family: var(--f); font-size: 2.2rem; font-weight: 800; color: #fbbf24; margin-bottom: 6px; }
.res-score { font-family: var(--f); font-size: 3.2rem; font-weight: 800; margin-bottom: 20px; }
.score-g { color: #4ade80; } .score-o { color: #fb923c; } .score-r { color: #f87171; }

/* ── RESPONSIVE ──────────────────────────────────────────────────────── */
@media (max-width: 560px) {
  .site-nav { flex-wrap: wrap; gap: 4px; padding: 8px 12px; }
  .site-nav .links a { font-size: .65rem; padding: 4px 8px; }
  .char-svg-wrap { width: 72px; height: 72px; }
  .char-bubble { font-size: .75rem; max-width: 200px; }
}
