/* ============================================================
   Gallop Learning Academy — design system
   Themes: pro (landing/parents) · junior (K-2) · explorer (3-5)
           scholar (6-8) · academy (9-12, dark)
   ============================================================ */
:root {
  --ink: #16213a;
  --paper: #ffffff;
  --pagebg: #f7f4ee;
  --pagebg2: #f7f4ee;
  --chrome-ink: #16213a;          /* text that sits on the page background */
  --chrome-sub: #5b6478;
  --brand: #1f5e46;               /* hunter green */
  --brand-2: #2d6a4f;
  --accent: #c9971c;              /* brass */
  --accent-soft: #f3e3b2;
  --math: #5b5bd6; --english: #0f9d76; --science: #2f78c2; --spanish: #d26440;
  --danger: #d64545;
  --card-bg: #ffffff;
  --card-border: #e8e2d6;
  --field-border: #d9d2c4;
  --soft-bg: #f4f1ea;
  --radius: 14px;
  --btn-radius: 10px;
  --shadow: 0 1px 2px rgba(22, 33, 58, .06), 0 8px 24px rgba(22, 33, 58, .07);
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body: 'Mulish', -apple-system, 'Segoe UI', sans-serif;
  --heading-weight: 600;
  font-size: 16px;
}

/* ---- age themes (palettes tuned to learning-color research) ---- */
/* K-2: warm & sunny — bright sky + golden accents energize little learners */
body[data-theme="junior"] {
  --pagebg: #3d8fe0; --pagebg2: #7a67dd;
  --brand: #f59f37; --brand-2: #ef8b52;
  --chrome-ink: #ffffff; --chrome-sub: rgba(255,255,255,.88);
  --card-border: transparent;
  --radius: 22px; --btn-radius: 999px;
  --font-display: 'Fredoka', sans-serif; --font-body: 'Fredoka', sans-serif;
  --shadow: 0 10px 30px rgba(20, 40, 90, .2);
  --soft-bg: #fef6e7; --field-border: #dfe6e9;
}
/* 3-5: green — proven to aid concentration & reading comprehension */
body[data-theme="explorer"] {
  --pagebg: #178a5f; --pagebg2: #2fae7d;
  --brand: #0d6e4a; --brand-2: #12855a;
  --chrome-ink: #ffffff; --chrome-sub: rgba(255,255,255,.88);
  --card-border: transparent;
  --radius: 18px; --btn-radius: 14px;
  --font-display: 'Fredoka', sans-serif; --font-body: 'Mulish', sans-serif;
  --shadow: 0 8px 26px rgba(8, 55, 40, .2);
  --soft-bg: #eef8f2; --field-border: #d3e5db;
}
/* 6-8: calm blue — lowers arousal, sharpens sustained focus */
body[data-theme="scholar"] {
  --pagebg: #e9eef6; --pagebg2: #e9eef6;
  --brand: #2b64ad; --brand-2: #2f74c4;
  --chrome-ink: #1d2433; --chrome-sub: #5b6478;
  --radius: 12px; --btn-radius: 9px;
  --shadow: 0 1px 3px rgba(20, 28, 45, .08), 0 6px 18px rgba(20, 28, 45, .06);
  --card-border: #dde4ef; --soft-bg: #f0f4fa; --field-border: #cfd9e8;
}
/* 9-12: deep navy dark mode + restrained amber — serious, low-strain, adult */
body[data-theme="academy"] {
  --ink: #e8eaf0;
  --pagebg: #101627; --pagebg2: #101627;
  --chrome-ink: #e8eaf0; --chrome-sub: #8b94a7;
  --card-bg: #19203a; --card-border: #2a3352;
  --soft-bg: #222b47; --field-border: #38426a;
  --radius: 12px; --btn-radius: 8px;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 10px 30px rgba(0,0,0,.35);
  --accent: #e0b64f; --brand: #3d6fc2; --brand-2: #4a80d6;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font-body);
  color: var(--ink);
  background: linear-gradient(160deg, var(--pagebg), var(--pagebg2)) fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
#app { min-height: 100vh; display: flex; flex-direction: column; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: var(--heading-weight); line-height: 1.18; letter-spacing: -.01em; }

/* ---------- shared ---------- */
.container { width: min(1080px, 94vw); margin: 0 auto; padding: 18px 0 64px; flex: 1; }
.card {
  background: var(--card-bg); border: 1px solid var(--card-border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 26px; margin-bottom: 18px;
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; cursor: pointer; font-family: var(--font-body); font-weight: 600;
  font-size: 1rem; padding: 12px 24px; border-radius: var(--btn-radius);
  background: var(--brand); color: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,.12);
  transition: transform .12s ease, filter .12s ease, box-shadow .12s ease;
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.06); }
.btn:active { transform: translateY(0); }
.btn.green { background: var(--brand-2); }
.btn.sun { background: var(--accent); color: #241c04; }
.btn.coral { background: var(--danger); }
.btn.ghost { background: transparent; color: var(--chrome-ink); box-shadow: none; border: 1.5px solid currentColor; opacity: .9; }
.btn.small { font-size: .88rem; padding: 8px 15px; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
body[data-theme="junior"] .btn { font-size: 1.05rem; padding: 13px 26px; box-shadow: 0 6px 16px rgba(0,0,0,.18); }
input, select {
  font-family: var(--font-body); font-size: 1rem; padding: 11px 14px; width: 100%;
  border: 1.5px solid var(--field-border); border-radius: calc(var(--btn-radius) + 2px);
  outline: none; background: var(--card-bg); color: var(--ink);
  transition: border-color .15s;
}
input:focus, select:focus { border-color: var(--brand); }
label { font-weight: 600; font-size: .9rem; display: block; margin: 12px 0 6px; }
.error-msg { background: #fdecec; color: #b03030; border-radius: 10px; padding: 10px 14px; margin-top: 12px; font-weight: 600; display: none; }
.error-msg.show { display: block; animation: shake .4s; }
body[data-theme="academy"] .error-msg { background: #3a2226; color: #ff9c9c; }
.muted { color: var(--chrome-sub); }
.card .muted, .subject-report .muted { color: #7d8496; }
body[data-theme="academy"] .card .muted { color: #8b94a7; }
.center { text-align: center; }

/* ---------- topbar ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 3vw; color: var(--chrome-ink);
}
.logo { font-family: var(--font-display); font-size: 1.32rem; font-weight: 700; letter-spacing: .01em; cursor: pointer; display: flex; align-items: center; gap: 10px; color: var(--chrome-ink); }
.logo .spark { display: inline-block; }
.logo-img { height: 30px; width: auto; display: block; }
body[data-theme="junior"] .logo-img { animation: float 3s ease-in-out infinite; }
.gallop-horse img { height: 30px; width: auto; display: block; }
.horse-runner img { height: 46px; width: auto; display: block; filter: drop-shadow(0 2px 3px rgba(0,0,0,.2)); }
body[data-theme="junior"] .logo .spark { animation: float 3s ease-in-out infinite; }
.topbar .right { display: flex; gap: 10px; align-items: center; }

/* ---------- landing (pro theme) ---------- */
.hero { text-align: center; color: var(--chrome-ink); padding: 72px 20px 40px; }
.hero .eyebrow { text-transform: uppercase; letter-spacing: .18em; font-size: .78rem; font-weight: 700; color: var(--brand); margin-bottom: 18px; }
.hero h1 { font-size: clamp(2.2rem, 5.2vw, 3.6rem); margin-bottom: 18px; max-width: 780px; margin-left: auto; margin-right: auto; }
.hero p { font-size: 1.15rem; max-width: 620px; margin: 0 auto 30px; color: var(--chrome-sub); line-height: 1.6; }
.hero .btn { font-size: 1.05rem; padding: 14px 30px; }
.statband { display: flex; gap: 0; justify-content: center; flex-wrap: wrap; border-top: 1px solid var(--card-border); border-bottom: 1px solid var(--card-border); margin: 26px auto 40px; max-width: 860px; }
.statband > div { padding: 18px 34px; text-align: center; }
.statband b { display: block; font-family: var(--font-display); font-size: 1.5rem; color: var(--brand); }
.statband span { font-size: .85rem; color: var(--chrome-sub); }
.section-title { text-align: center; font-size: clamp(1.5rem, 3vw, 2.1rem); margin: 46px 0 8px; color: var(--chrome-ink); }
.section-sub { text-align: center; color: var(--chrome-sub); margin-bottom: 26px; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin-top: 8px; }
.feature { background: var(--card-bg); border: 1px solid var(--card-border); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow); }
.feature .fnum { font-family: var(--font-display); font-size: .9rem; font-weight: 700; color: var(--accent); letter-spacing: .12em; }
.feature h3 { margin: 10px 0 8px; font-size: 1.12rem; }
.feature p { font-size: .94rem; color: #6a7183; line-height: 1.55; }
.subject-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.subject-strip .sub {
  border-radius: var(--radius); padding: 20px; color: #fff; box-shadow: var(--shadow);
}
.subject-strip .sub h4 { font-size: 1.05rem; margin-bottom: 6px; }
.subject-strip .sub p { font-size: .87rem; opacity: .92; line-height: 1.5; }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; }
.plan { border: 1.5px solid var(--card-border); border-radius: var(--radius); padding: 28px 24px; text-align: center; background: var(--card-bg); }
.plan.hot { border-color: var(--accent); position: relative; }
.plan .price { font-family: var(--font-display); font-size: 2.5rem; font-weight: 700; }
.plan .tag { position: absolute; top: -13px; left: 50%; transform: translateX(-50%); background: var(--accent); color: #241c04; font-weight: 700; padding: 4px 14px; border-radius: 999px; font-size: .78rem; letter-spacing: .04em; }
.site-footer { border-top: 1px solid var(--card-border); margin-top: 60px; padding: 30px 3vw; text-align: center; color: var(--chrome-sub); font-size: .88rem; line-height: 2; }
.ig-link { color: var(--brand); font-weight: 600; text-decoration: none; }
.ig-link:hover { text-decoration: underline; }

/* ---------- kid home ---------- */
.kid-header { display: flex; align-items: center; gap: 16px; color: var(--chrome-ink); flex-wrap: wrap; margin-bottom: 16px; }
.avatar-big { font-size: 3.2rem; background: rgba(127,127,127,.14); border-radius: 50%; width: 84px; height: 84px; display: flex; align-items: center; justify-content: center; }
body[data-theme="junior"] .avatar-big, body[data-theme="explorer"] .avatar-big { background: rgba(255,255,255,.22); }
.stat-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { background: rgba(127,127,127,.13); border-radius: 999px; padding: 7px 14px; font-weight: 600; font-size: .9rem; color: var(--chrome-ink); }
body[data-theme="junior"] .chip, body[data-theme="explorer"] .chip { background: rgba(255,255,255,.22); font-weight: 700; }
body[data-theme="academy"] .chip { background: #232b3d; }
.subject-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.subject-card {
  border-radius: var(--radius); padding: 24px 22px; color: #fff; cursor: pointer;
  box-shadow: var(--shadow); transition: transform .15s ease; position: relative; overflow: hidden;
}
.subject-card:hover { transform: translateY(-3px); }
body[data-theme="junior"] .subject-card:hover { transform: translateY(-4px) rotate(-.5deg) scale(1.02); }
.subject-card .semoji { font-size: 2.4rem; }
body[data-theme="scholar"] .subject-card .semoji, body[data-theme="academy"] .subject-card .semoji { font-size: 1.8rem; }
.subject-card h3 { font-size: 1.3rem; margin: 8px 0 2px; }
.subject-card .lvl { opacity: .92; font-weight: 500; font-size: .92rem; }
.subject-card .blob { position: absolute; right: -30px; top: -30px; width: 130px; height: 130px; border-radius: 50%; background: rgba(255,255,255,.13); }
body[data-theme="scholar"] .subject-card .blob, body[data-theme="academy"] .subject-card .blob { display: none; }

/* ---------- lesson player ---------- */
.lesson-wrap { max-width: 720px; margin: 0 auto; }
.lesson-top { display: flex; align-items: center; justify-content: space-between; color: var(--chrome-ink); margin-bottom: 12px; gap: 10px; flex-wrap: wrap; }
.progress-track { flex: 1; min-width: 160px; height: 12px; background: rgba(127,127,127,.22); border-radius: 999px; overflow: hidden; }
body[data-theme="junior"] .progress-track { height: 16px; background: rgba(255,255,255,.25); }
.progress-fill { height: 100%; border-radius: 999px; background: var(--accent); width: 0%; transition: width .4s ease; }
body[data-theme="junior"] .progress-fill { background: linear-gradient(90deg, #ffeaa7, #fdcb6e); }

/* ---------- the Gallop track: our horse IS the progress bar ---------- */
.gallop-wrap { flex: 1; min-width: 180px; position: relative; height: 40px; }
.gallop-rail {
  position: absolute; left: 0; right: 0; bottom: 6px; height: 6px; border-radius: 999px;
  background: rgba(127,127,127,.25);
}
body[data-theme="junior"] .gallop-rail, body[data-theme="explorer"] .gallop-rail { background: rgba(255,255,255,.3); }
.gallop-done {
  position: absolute; left: 0; bottom: 6px; height: 6px; border-radius: 999px;
  background: var(--accent); transition: width .5s ease; max-width: 100%;
}
.g-flag {
  position: absolute; bottom: 10px; transform: translateX(-50%); font-size: .8rem;
  opacity: .45; transition: opacity .3s, transform .3s;
}
.g-flag.passed { opacity: 1; transform: translateX(-50%) scale(1.25); }
.g-finish { position: absolute; right: -4px; bottom: 10px; font-size: 1rem; }
.gallop-horse {
  position: absolute; bottom: 8px; font-size: 1.7rem; line-height: 1;
  transform: translateX(-50%) scaleX(-1);   /* face the finish line */
  transition: left .6s cubic-bezier(.34,1.4,.64,1);
  animation: gallop-bounce .5s ease;
  filter: drop-shadow(0 2px 2px rgba(0,0,0,.25));
}
.gallop-horse.finished { animation: gallop-rear .8s ease; }
.gallop-label { position: absolute; top: -4px; right: 0; font-size: .75rem; font-weight: 700; color: var(--chrome-sub); }
@keyframes gallop-bounce {
  0% { transform: translateX(-50%) scaleX(-1) translateY(0); }
  25% { transform: translateX(-50%) scaleX(-1) translateY(-9px) rotate(-6deg); }
  50% { transform: translateX(-50%) scaleX(-1) translateY(0); }
  75% { transform: translateX(-50%) scaleX(-1) translateY(-5px) rotate(-3deg); }
  100% { transform: translateX(-50%) scaleX(-1) translateY(0); }
}
@keyframes gallop-rear {
  0%,100% { transform: translateX(-50%) scaleX(-1) rotate(0); }
  40% { transform: translateX(-50%) scaleX(-1) rotate(-18deg) translateY(-8px); }
}
.week-gallop { background: var(--card-bg); border: 1px solid var(--card-border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 20px 10px; margin: 4px 0 16px; }
.week-gallop .wg-head { display: flex; justify-content: space-between; font-size: .85rem; font-weight: 600; color: #7d8496; margin-bottom: 2px; }
body[data-theme="academy"] .week-gallop .wg-head { color: #8b94a7; }
.q-card { background: var(--card-bg); border: 1px solid var(--card-border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 30px; }
.q-skill { display: inline-block; font-size: .8rem; font-weight: 700; padding: 5px 13px; border-radius: 999px; margin-bottom: 14px; color: #fff; }
.q-prompt { font-size: 1.3rem; font-weight: 600; white-space: pre-line; line-height: 1.5; font-family: var(--font-body); }
/* Reading-friendly scaling: big, roomy type for early readers */
body[data-theme="junior"] .q-prompt { font-size: 1.72rem; line-height: 1.65; letter-spacing: .01em; word-spacing: .08em; }
body[data-theme="explorer"] .q-prompt { font-size: 1.48rem; line-height: 1.6; }
body[data-theme="junior"] .choice { font-size: 1.35rem; padding: 19px 22px; line-height: 1.45; }
body[data-theme="explorer"] .choice { font-size: 1.18rem; padding: 17px 20px; }
body[data-theme="junior"] .feedback, body[data-theme="junior"] .hint-box { font-size: 1.15rem; line-height: 1.55; }
.choices { display: grid; gap: 11px; margin-top: 22px; }
.choice {
  text-align: left; font-family: var(--font-body); font-size: 1.06rem; font-weight: 600; cursor: pointer;
  padding: 15px 19px; border-radius: calc(var(--btn-radius) + 4px); border: 2px solid var(--field-border); background: var(--soft-bg);
  color: var(--ink); transition: all .13s ease;
}
.choice:hover:not(:disabled) { border-color: var(--brand); transform: translateX(3px); }
.choice.correct { border-color: #14a37f; background: #e2f8f1; color: #0c6b53; animation: pop .35s ease; }
.choice.wrong { border-color: var(--danger); background: #fdecec; color: #96323a; animation: shake .4s ease; }
.choice.reveal { border-color: #14a37f; background: #edfaf5; color: #0c6b53; }
body[data-theme="academy"] .choice.correct, body[data-theme="academy"] .choice.reveal { background: #16362e; color: #7fe0c0; }
body[data-theme="academy"] .choice.wrong { background: #3a2226; color: #ff9c9c; }
.choice:disabled { cursor: default; }
.lesson-actions { display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; align-items: center; }
.feedback { margin-top: 18px; padding: 15px 19px; border-radius: 12px; font-weight: 600; display: none; font-size: 1rem; }
.feedback.good { display: block; background: #e2f8f1; color: #0c6b53; }
.feedback.bad { display: block; background: #fdf3d7; color: #7a5b00; }
body[data-theme="academy"] .feedback.good { background: #16362e; color: #7fe0c0; }
body[data-theme="academy"] .feedback.bad { background: #3a3222; color: #e6c877; }
.why-line { margin-top: 10px; padding-top: 10px; border-top: 1px dashed rgba(0,0,0,.15); font-weight: 500; font-size: .92rem; opacity: .92; }
.choice.idk { border-style: dashed; opacity: .85; font-size: .95rem; background: transparent; }
.choice.idk:hover { opacity: 1; }
.dash-welcome { color: var(--ink); }
/* Daily Quests */
.quest-card { background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.25); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 18px; color: #fff; backdrop-filter: blur(4px); }
.quest-card.ready { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent); animation: quest-glow 1.6s ease infinite alternate; }
@keyframes quest-glow { from { box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 25%, transparent); } to { box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 45%, transparent); } }
.quest-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.quest-item { display: flex; align-items: center; gap: 10px; font-weight: 600; opacity: .95; }
.quest-item.done { opacity: .75; }
.quest-item.done .q-label { text-decoration: line-through; }
.quest-item .q-prog { margin-left: auto; font-size: .85rem; opacity: .85; }
body[data-theme="pro"] .quest-card, body[data-theme="scholar"] .quest-card { background: var(--card-bg); border-color: var(--card-border); color: var(--ink); box-shadow: var(--shadow); }
@media (prefers-reduced-motion: reduce) { .quest-card.ready { animation: none; } }

/* ===== Age-differentiated interface: K-2 chunky & bouncy ↔ 9-12 dense & serious ===== */
body[data-theme="junior"] .btn { font-size: 1.1rem; padding: 14px 26px; border-radius: 999px; }
body[data-theme="junior"] .btn.small { font-size: .98rem; padding: 10px 18px; }
body[data-theme="junior"] .subject-card .semoji { font-size: 3.8rem; }
body[data-theme="junior"] .subject-card h3 { font-size: 1.55rem; }
body[data-theme="junior"] .subject-card { border-radius: 26px; }
body[data-theme="junior"] .subject-card:hover { transform: translateY(-6px) rotate(-1.5deg) scale(1.03); }
body[data-theme="junior"] .chip { font-size: 1rem; padding: 8px 16px; }
body[data-theme="junior"] .kid-header h1 { font-size: 2.1rem; }
body[data-theme="junior"] .zone-card .zemoji { font-size: 2.6rem; }
body[data-theme="junior"] .card { border-radius: 22px; }
body[data-theme="explorer"] .subject-card .semoji { font-size: 3.1rem; }
body[data-theme="explorer"] .subject-card:hover { transform: translateY(-5px) scale(1.02); }
body[data-theme="scholar"] .subject-card .semoji { font-size: 2.4rem; }
body[data-theme="academy"] .subject-card .blob { display: none; }
body[data-theme="academy"] .subject-card .semoji { font-size: 1.8rem; }
body[data-theme="academy"] .subject-card h3 { font-size: 1.1rem; }
body[data-theme="academy"] .subject-card { border-radius: 12px; padding: 20px; }
body[data-theme="academy"] .subject-card:hover { transform: translateY(-2px); rotate: none; }
body[data-theme="academy"] .btn { border-radius: 9px; }
body[data-theme="academy"] .card { border-radius: 14px; }
body[data-theme="academy"] .zone-card .zemoji { font-size: 1.5rem; }
body[data-theme="academy"] .kid-header h1 { font-size: 1.5rem; }
body[data-theme="academy"] .big-emoji { font-size: 3.4rem; }

/* Typed-answer mode */
.typed-wrap { display: flex; gap: 12px; margin-top: 22px; align-items: stretch; }
.typed-input { flex: 1; font-size: 1.5rem; font-weight: 700; padding: 14px 18px; border: 2px solid var(--field-border); border-radius: calc(var(--btn-radius) + 4px); text-align: center; letter-spacing: .02em; }
.typed-input:focus { border-color: var(--brand); }
.typed-input.good { border-color: #14a37f; background: #e2f8f1; color: #0c6b53; }
.typed-input.bad { border-color: var(--danger); background: #fdecec; color: #96323a; animation: shake .4s ease; }
body[data-theme="junior"] .typed-input { font-size: 1.9rem; }
body[data-theme="academy"] .typed-input.good { background: #16362e; color: #7fe0c0; }
body[data-theme="academy"] .typed-input.bad { background: #3a2226; color: #ff9c9c; }

/* Kid edit inline form */
.kid-edit { background: var(--soft-bg); border-radius: 12px; padding: 12px 16px 14px; margin: -4px 0 10px; }
.ke-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.ke-grid label { margin: 0 0 4px; font-size: .78rem; }
.ke-levels { margin-top: 14px; border-top: 1px dashed var(--field-border); padding-top: 12px; }
.lvl-rows { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.lvl-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.lvl-sub { font-weight: 700; min-width: 76px; font-size: .9rem; }
.lvl-name { font-size: .85rem; flex: 1; }
.lvl-btn { padding: 3px 10px; font-size: .78rem; }

/* Reading passage card */
.passage-box { background: #fdf9ef; border: 1px solid #ecdfc2; border-left: 5px solid #c9971c; border-radius: 12px; padding: 16px 18px; margin: 14px 0 4px; font-size: 1.06rem; line-height: 1.65; color: #3d3628; clear: both; }
.passage-tag { display: block; font-size: .72rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #a67c0e; margin-bottom: 8px; }
body[data-theme="junior"] .passage-box { font-size: 1.2rem; line-height: 1.8; }
body[data-theme="explorer"] .passage-box { font-size: 1.12rem; line-height: 1.7; }
body[data-theme="academy"] .passage-box { background: #2a2921; border-color: #4a442f; color: #e8e2cf; }
body[data-theme="academy"] .passage-tag { color: #d9b64a; }

/* Too tricky? level back-out */
.too-tricky { text-align: center; margin-top: 16px; }
.tt-btn { background: none; border: none; cursor: pointer; font-family: inherit; font-size: .82rem; color: #8a94a3; text-decoration: underline dotted; padding: 4px 8px; }
.tt-btn:hover { color: var(--brand); }

/* Toast */
.gallop-toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px); background: #17462f; color: #fff; padding: 12px 22px; border-radius: 999px; box-shadow: 0 8px 24px rgba(0,0,0,.25); font-weight: 600; font-size: .95rem; z-index: 3000; opacity: 0; transition: all .35s ease; max-width: 90vw; text-align: center; border: 1px solid #c9971c; }
.gallop-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Trial-ending banner */
.trial-banner { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; background: linear-gradient(120deg, #1f5e46, #17462f); color: #fff; border-radius: var(--radius); padding: 16px 20px; margin-bottom: 16px; box-shadow: var(--shadow); border: 1px solid #c9971c; }
.trial-banner span { opacity: .85; font-size: .9rem; }

/* Limited seasonal shop tag */
.limited-tag { position: absolute; top: -8px; left: 50%; transform: translateX(-50%); background: #ff6b35; color: #fff; font-size: .58rem; font-weight: 800; letter-spacing: .05em; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }

/* Up Next smart recommendation */
.up-next { display: flex; align-items: center; gap: 16px; background: linear-gradient(120deg, var(--accent-soft, #f6ecd3), #fff); border: 2px solid var(--accent); border-radius: var(--radius); padding: 16px 20px; margin-bottom: 16px; cursor: pointer; transition: transform .15s ease, box-shadow .15s ease; box-shadow: var(--shadow); }
.up-next:hover { transform: translateY(-3px); box-shadow: 0 10px 26px rgba(0,0,0,.14); }
.un-emoji { font-size: 2.6rem; }
.un-text { flex: 1; display: flex; flex-direction: column; gap: 2px; color: var(--ink); }
.un-label { font-size: .72rem; font-weight: 800; letter-spacing: .14em; color: var(--accent); }
.un-text b { font-size: 1.15rem; }
.un-sub { font-size: .85rem; color: #7d8496; }
body[data-theme="junior"] .up-next { border-radius: 24px; }
body[data-theme="junior"] .un-emoji { font-size: 3.2rem; }
body[data-theme="junior"] .un-text b { font-size: 1.3rem; }
body[data-theme="academy"] .up-next { background: rgba(255,255,255,.06); border-color: var(--accent); }
body[data-theme="academy"] .un-text { color: #e8ebf2; }
body[data-theme="academy"] .un-sub { color: #8b94a7; }

/* streak dots + rank */
.streak-dots { display: flex; align-items: center; gap: 5px; margin-top: 8px; }
.sdot { width: 9px; height: 9px; border-radius: 50%; background: #e3e0d8; }
.sdot.on { background: #1f8a5f; box-shadow: 0 0 0 2px rgba(31,138,95,.2); }
body[data-theme="academy"] .sdot { background: #2a3350; }
body[data-theme="academy"] .sdot.on { background: #2fae7d; }
.sdot-label { font-size: .72rem; color: #98a0af; margin-left: 6px; }
.rank-chip { background: var(--accent); color: #fff; font-weight: 800; }

/* Focus Session launcher (teens) */
.focus-launch { background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.22); border-radius: var(--radius); padding: 14px 18px; margin-bottom: 16px; color: #fff; display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; }
.focus-launch .muted-inv { opacity: .8; font-size: .88rem; }
.focus-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.focus-btns .btn.ghost { color: #fff; border-color: rgba(255,255,255,.45); }
body[data-theme="scholar"] .focus-launch { background: var(--card-bg); border-color: var(--card-border); color: var(--ink); box-shadow: var(--shadow); }
body[data-theme="scholar"] .focus-btns .btn.ghost { color: var(--brand); border-color: var(--brand); }
body[data-theme="academy"] .focus-launch { background: rgba(255,255,255,.06); }

/* Team Gallop co-op goal */
.team-goal { margin: 10px auto 2px; max-width: 260px; text-align: left; background: var(--soft-bg, #f4f1ea); border-radius: 12px; padding: 10px 12px; }
.team-goal.ready { box-shadow: 0 0 0 2px var(--accent); }
.tg-head { font-size: .82rem; font-weight: 600; color: var(--ink); margin-bottom: 5px; }
.tg-bar { height: 9px; border-radius: 999px; background: rgba(0,0,0,.1); overflow: hidden; }
.tg-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #1f8a5f, #c9971c); transition: width .5s ease; }
.tg-note { font-size: .74rem; color: #7d8496; margin-top: 5px; }
body[data-theme="academy"] .team-goal { background: rgba(255,255,255,.07); }
body[data-theme="academy"] .tg-head { color: #e8ebf2; }

/* Parent per-skill drill-down */
.skill-detail { margin-top: 10px; }
.skill-detail summary { cursor: pointer; font-weight: 600; font-size: .88rem; color: #1f5e46; }
.skill-rows { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.skill-row { display: grid; grid-template-columns: 1fr auto 110px; gap: 10px; align-items: center; font-size: .84rem; }
.sk-name { font-weight: 600; }
.sk-grade { font-size: .7rem; color: #98a0af; font-weight: 700; }
.sk-meta { color: #7d8496; font-size: .78rem; white-space: nowrap; }
.sk-bar { height: 8px; border-radius: 999px; background: #eceae3; overflow: hidden; }
.sk-fill { display: block; height: 100%; border-radius: 999px; }
.sk-fill.hi { background: #1f8a5f; } .sk-fill.mid { background: #c9971c; } .sk-fill.lo { background: #d97b4f; }

/* ===== Printable certificate ===== */
.cert-frame { background: #fdfcf8; border: 10px solid #1f5e46; border-radius: 6px; padding: 10px; box-shadow: var(--shadow); }
.cert-inner { border: 2px solid #c9971c; border-radius: 2px; padding: 44px 40px 36px; text-align: center; position: relative; }
.cert-inner::before, .cert-inner::after { content: '✦'; position: absolute; color: #c9971c; font-size: 1.1rem; top: 12px; }
.cert-inner::before { left: 16px; } .cert-inner::after { right: 16px; }
.cert-crest { width: 92px; height: 92px; margin-bottom: 10px; }
.cert-academy { font-family: var(--font-display); font-weight: 700; letter-spacing: .32em; font-size: .85rem; color: #1f5e46; }
.cert-title { font-family: var(--font-display); font-weight: 800; font-size: clamp(1.9rem, 5vw, 2.8rem); color: #16213a; margin: 10px 0 2px; }
.cert-rule { width: 120px; height: 3px; background: #c9971c; margin: 12px auto 18px; border-radius: 2px; }
.cert-line { color: #7d8496; font-size: .98rem; margin: 6px 0; }
.cert-name { font-family: var(--font-display); font-weight: 800; font-size: clamp(2rem, 6vw, 3.2rem); color: #1f5e46; margin: 6px 0; }
.cert-achievement { font-family: var(--font-display); font-weight: 700; font-size: clamp(1.2rem, 3.5vw, 1.7rem); color: #16213a; margin: 6px 0 4px; }
.cert-date { color: #7d8496; font-size: .9rem; margin-top: 14px; }
.cert-footer { display: flex; justify-content: space-between; gap: 30px; margin-top: 34px; }
.cert-sig { flex: 1; font-size: .8rem; color: #7d8496; font-weight: 600; }
.cert-sigline { display: block; border-top: 1.5px solid #16213a; margin-bottom: 6px; }
@media print {
  .topbar, .no-print { display: none !important; }
  body { background: #fff !important; }
  .container { max-width: none !important; padding: 0 !important; }
  .cert-frame { box-shadow: none; margin: 0; }
}

/* Lightning Round */
.blitz-timer { height: 12px; border-radius: 999px; background: rgba(255,255,255,.25); overflow: hidden; margin-bottom: 14px; }
.blitz-fill { height: 100%; background: linear-gradient(90deg, #2fae7d, #c9971c); transition: width 1s linear; }
.blitz-fill.hot { background: linear-gradient(90deg, #e74c3c, #f39c12); }
.blitz-q { font-family: var(--font-display); font-size: clamp(2.2rem, 8vw, 3.4rem); font-weight: 800; margin: 10px 0 18px; }
.blitz-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; max-width: 380px; margin: 0 auto; }
.blitz-btn { font-size: 1.5rem; padding: 18px 10px; font-weight: 800; }
.combo-badge { display: inline-block; background: #ff6b35; color: #fff; font-weight: 800; padding: 6px 16px; border-radius: 999px; animation: pop .3s ease; margin-bottom: 8px; }
body[data-theme="junior"] .blitz-q { font-size: clamp(2.8rem, 10vw, 4rem); }
.dash-welcome p { color: var(--muted, #667085); }
.explain-pop { display: flex; flex-direction: column; align-items: center; gap: 6px; max-width: 560px; }
.explain-pop .explain-text { font-size: 1.35rem; line-height: 1.6; font-weight: 600; }
body[data-theme="junior"] .explain-pop .explain-text { font-size: 1.55rem; line-height: 1.65; }
.explain-pop .why-line { border-top-color: rgba(255,255,255,.35); color: #fff; opacity: .95; font-size: 1.02rem; }
body[data-theme="academy"] .why-line { border-top-color: rgba(255,255,255,.18); }
.stock-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: rgba(0,0,0,.04); margin-bottom: 8px; flex-wrap: wrap; }
body[data-theme="academy"] .stock-row { background: rgba(255,255,255,.06); }
.stock-row .up { color: #0c8a5f; font-weight: 700; }
.stock-row .down { color: #c0392b; font-weight: 700; }
.news-flash { border-left: 4px solid var(--accent); background: var(--accent-soft); padding: 12px 16px; border-radius: 10px; font-weight: 600; margin-bottom: 12px; }
body[data-theme="academy"] .news-flash { background: #33301f; color: #e6d9a8; }
.hint-box { margin-top: 14px; background: var(--accent-soft); color: #4d3c07; border-left: 4px solid var(--accent); padding: 12px 16px; border-radius: 8px; display: none; font-weight: 500; }
.hint-box.show { display: block; animation: pop .3s ease; }
body[data-theme="academy"] .hint-box { background: #33301f; color: #e6d9a8; }
.mastery-mini { margin-top: 16px; font-size: .87rem; color: var(--chrome-sub); }
.card .mastery-mini { color: #7d8496; }
.mastery-bar { height: 8px; border-radius: 999px; background: var(--soft-bg); overflow: hidden; margin-top: 4px; }
.mastery-bar > div { height: 100%; background: var(--brand-2); transition: width .5s ease; }

/* summary screen */
.big-emoji { font-size: 4rem; animation: bounceIn .6s ease; display: inline-block; }
.summary-stats { display: flex; gap: 14px; justify-content: center; margin: 18px 0; flex-wrap: wrap; }
.sstat { background: var(--soft-bg); border-radius: 12px; padding: 14px 22px; font-weight: 600; }
.sstat .n { font-family: var(--font-display); font-size: 1.5rem; color: var(--brand); }
body[data-theme="academy"] .sstat .n { color: var(--accent); }

/* ---------- parent dashboard ---------- */
.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }
.kid-row { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 12px; background: var(--soft-bg); margin-bottom: 10px; flex-wrap: wrap; }
.kid-row .avatar-sm { font-size: 2rem; }
.subject-report { border: 1px solid var(--card-border); border-radius: 12px; padding: 16px; margin-bottom: 12px; }
.subject-report .head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }
.letter { font-family: var(--font-display); font-size: 1.55rem; font-weight: 700; }
.pill { display: inline-block; padding: 3px 12px; border-radius: 999px; font-size: .8rem; font-weight: 600; }
.pill.strength { background: #e2f8f1; color: #0c6b53; }
.pill.focus { background: #fdeeda; color: #9a5b12; }
body[data-theme="academy"] .pill.strength { background: #16362e; color: #7fe0c0; }
body[data-theme="academy"] .pill.focus { background: #3a2f1d; color: #e6b877; }
.badge-shelf { display: flex; gap: 10px; flex-wrap: wrap; }
.badge-item { background: var(--accent-soft); color: #4d3c07; border-radius: 10px; padding: 9px 13px; font-weight: 600; font-size: .88rem; }
body[data-theme="academy"] .badge-item { background: #33301f; color: #e6d9a8; }
.cert { border: 2px solid var(--accent); border-radius: 12px; padding: 14px 18px; margin-bottom: 10px; background: var(--card-bg); }

/* PIN pad */
.pinpad { display: grid; grid-template-columns: repeat(3, 76px); gap: 10px; justify-content: center; margin-top: 16px; }
.pinkey { font-size: 1.4rem; font-weight: 700; padding: 15px 0; border-radius: 12px; border: 1.5px solid var(--field-border); background: var(--card-bg); color: var(--ink); cursor: pointer; font-family: var(--font-body); }
.pinkey:hover { border-color: var(--brand); }
.pin-dots { display: flex; gap: 12px; justify-content: center; margin-top: 14px; font-size: 1.5rem; letter-spacing: 4px; min-height: 38px; }
.avatar-pick { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.avatar-opt { font-size: 2.1rem; padding: 10px; border-radius: 14px; border: 2px solid transparent; cursor: pointer; background: var(--soft-bg); text-align: center; }
.avatar-opt.sel { border-color: var(--brand); }

/* celebration overlay */
.celebrate {
  position: fixed; inset: 0; display: flex; flex-direction: column; gap: 12px;
  align-items: center; justify-content: center; z-index: 60;
  background: rgba(16, 20, 34, .82); color: #fff; text-align: center; padding: 20px;
}
.celebrate h2 { font-size: clamp(1.6rem, 5vw, 2.5rem); }
.celebrate .big-emoji { font-size: 5.4rem; }
#confetti-canvas { position: fixed; inset: 0; pointer-events: none; z-index: 70; }

/* ---------- Play Zone ---------- */
.zone-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-top: 18px; }
.zone-card {
  background: var(--card-bg); border: 1px solid var(--card-border); border-radius: var(--radius); padding: 18px 20px; cursor: pointer;
  box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 4px; transition: transform .15s ease; color: var(--ink);
}
.zone-card:hover { transform: translateY(-3px); }
.zone-card .zemoji { font-size: 1.9rem; }
.zone-card .muted { color: #7d8496; font-size: .9rem; }
body[data-theme="academy"] .zone-card .muted { color: #8b94a7; }

/* layered avatar */
.av-wrap { position: relative; display: inline-block; line-height: 1; }
.av-bg { position: absolute; inset: -8%; font-size: 1.1em; opacity: .45; z-index: 0; }
.av-base { position: relative; z-index: 1; }
.av-hat { position: absolute; top: -38%; left: 52%; font-size: .55em; z-index: 2; }
.av-acc { position: absolute; bottom: -12%; left: -18%; font-size: .5em; z-index: 2; }
.av-pet { position: absolute; bottom: -15%; right: -22%; font-size: .55em; z-index: 2; }

/* memory match */
.mem-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.mem-card {
  aspect-ratio: 3/2.6; font-size: clamp(1rem, 3.4vw, 1.4rem); font-weight: 700; font-family: var(--font-body);
  border-radius: 14px; border: 2px solid var(--card-border); background: var(--card-bg);
  color: transparent; cursor: pointer; transition: transform .15s ease;
}
.mem-card span { color: var(--chrome-sub); }
.mem-card.up { background: var(--accent-soft); transform: scale(1.03); }
.mem-card.up span, .mem-card.matched span { color: var(--ink); }
.mem-card.matched { background: #e2f8f1; border-color: #14a37f; }
.mem-card.matched span { color: #0c6b53; }
body[data-theme="academy"] .mem-card.up { background: #33301f; }
body[data-theme="academy"] .mem-card.up span { color: #e6d9a8; }
body[data-theme="academy"] .mem-card.matched { background: #16362e; }
body[data-theme="academy"] .mem-card.matched span { color: #7fe0c0; }

/* word search */
.ws-grid { display: grid; gap: 4px; }
.ws-cell {
  aspect-ratio: 1; font-family: var(--font-body); font-weight: 700; font-size: clamp(.8rem, 2.6vw, 1.05rem);
  border-radius: 7px; border: 1px solid var(--card-border); background: var(--card-bg); color: var(--ink); cursor: pointer;
}
.ws-cell.sel { background: var(--accent); color: #241c04; }
.ws-cell.found { background: #14a37f; color: #fff; }

/* code quest */
.code-grid { display: grid; gap: 6px; max-width: 380px; margin: 0 auto; }
.code-cell {
  aspect-ratio: 1; display: flex; align-items: center; justify-content: center; font-size: 1.7rem;
  background: var(--card-bg); border: 1px solid var(--card-border); border-radius: 10px;
}

/* room designer */
.room-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; background: var(--soft-bg); padding: 8px; border-radius: var(--radius); }
.room-cell { aspect-ratio: 1; font-size: 1.5rem; border: 0; border-radius: 8px; background: var(--card-bg); cursor: pointer; }
.furn { font-size: 1.5rem; background: var(--card-bg); border: 2px solid var(--card-border); border-radius: 10px; padding: 6px 8px; cursor: pointer; margin: 2px; }
.furn.sel { border-color: var(--accent); }

/* art studio */
#art-canvas { width: 100%; border-radius: var(--radius); box-shadow: var(--shadow); touch-action: none; cursor: crosshair; background: #fff; }
.paint { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--card-bg); cursor: pointer; margin: 2px; box-shadow: 0 2px 6px rgba(0,0,0,.25); }
.paint.sel { border-color: var(--accent); transform: scale(1.15); }

/* print */
@media print {
  body { background: #fff !important; }
  .topbar, .btn, .no-print { display: none !important; }
  .card { box-shadow: none; border: 1px solid #ddd; }
}

/* ---------- motion: the site feels alive ---------- */
.reveal { opacity: 0; }
.reveal.in { animation: rise-in .7s cubic-bezier(.22,.9,.36,1) forwards; }
@keyframes rise-in { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: translateY(0); } }
.hero .eyebrow, .hero h1, .hero p, .hero .btn { animation: rise-in .8s cubic-bezier(.22,.9,.36,1) both; }
.hero h1 { animation-delay: .08s; }
.hero p { animation-delay: .18s; }
.hero .btn { animation-delay: .3s; }
.subject-card, .zone-card { animation: rise-in .55s cubic-bezier(.22,.9,.36,1) both; }
.subject-card:nth-child(1) { animation-delay: .02s } .subject-card:nth-child(2) { animation-delay: .09s }
.subject-card:nth-child(3) { animation-delay: .16s } .subject-card:nth-child(4) { animation-delay: .23s }
.zone-card:nth-child(1) { animation-delay: .28s } .zone-card:nth-child(2) { animation-delay: .34s } .zone-card:nth-child(3) { animation-delay: .4s }
/* the resident horse trots across the landing hero */
.hero { position: relative; overflow: hidden; }
.horse-runner {
  position: absolute; bottom: 4px; left: -10%; font-size: 2rem; pointer-events: none;
  transform: scaleX(-1);
  animation: run-across 15s linear infinite 2s, runner-bob .4s ease-in-out infinite;
  opacity: .9;
}
@keyframes run-across { 0% { left: -8%; } 38% { left: 106%; } 100% { left: 106%; } }
@keyframes runner-bob { 0%,100% { bottom: 4px; } 50% { bottom: 12px; } }
@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal.in, .hero .eyebrow, .hero h1, .hero p, .hero .btn, .subject-card, .zone-card { animation: none; opacity: 1; }
  .horse-runner { display: none; }
}

@keyframes float { 0%,100% { transform: translateY(0) } 50% { transform: translateY(-6px) } }
@keyframes pop { 0% { transform: scale(.92) } 60% { transform: scale(1.04) } 100% { transform: scale(1) } }
@keyframes shake { 0%,100% { transform: translateX(0) } 25% { transform: translateX(-7px) } 75% { transform: translateX(7px) } }
@keyframes bounceIn { 0% { transform: scale(.3); opacity: 0 } 60% { transform: scale(1.15) } 100% { transform: scale(1); opacity: 1 } }

@media (max-width: 560px) {
  .card { padding: 18px; }
  .q-prompt { font-size: 1.12rem; }
  .pinpad { grid-template-columns: repeat(3, 64px); }
  .hero { padding-top: 44px; }
  .statband > div { padding: 12px 18px; }
}

/* ============================================================
   V25 GRAPHIC UPGRADE — depth, gradients, polish, micro-interactions
   Overrides above defaults; keeps age-theme palettes intact.
   ============================================================ */

/* --- richer page backdrop: soft light bloom instead of flat gradient --- */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(1100px 620px at 12% -8%, rgba(255,255,255,.16), transparent 60%),
    radial-gradient(900px 560px at 108% 4%, rgba(255,255,255,.10), transparent 55%);
}
body[data-theme="scholar"]::before, body[data-theme="pro"]::before, body:not([data-theme])::before {
  background:
    radial-gradient(1000px 560px at 8% -6%, rgba(31,94,70,.06), transparent 60%),
    radial-gradient(820px 520px at 106% 2%, rgba(201,151,28,.06), transparent 58%);
}

/* --- buttons: gradient fill, soft glow, glossy press --- */
.btn {
  background-image: linear-gradient(180deg, rgba(255,255,255,.16), rgba(255,255,255,0) 42%);
  box-shadow: 0 1px 1px rgba(0,0,0,.12), 0 6px 16px -6px rgba(0,0,0,.35);
  letter-spacing: .005em;
}
.btn.green { background-color: var(--brand-2); }
.btn.sun { background-image: linear-gradient(180deg, rgba(255,255,255,.32), rgba(255,255,255,0) 46%); }
.btn:hover { transform: translateY(-2px); box-shadow: 0 2px 3px rgba(0,0,0,.12), 0 12px 24px -8px rgba(0,0,0,.4); filter: brightness(1.05) saturate(1.05); }
.btn:active { transform: translateY(0) scale(.985); filter: brightness(.98); }
.btn.ghost { background-image: none; box-shadow: none; }
.btn.ghost:hover { background: color-mix(in srgb, currentColor 10%, transparent); }

/* --- cards: layered depth + hairline top highlight --- */
.card, .feature, .q-card {
  box-shadow: 0 1px 2px rgba(22,33,58,.05), 0 2px 6px rgba(22,33,58,.05), 0 18px 40px -20px rgba(22,33,58,.28);
  position: relative;
}
.feature { transition: transform .18s ease, box-shadow .18s ease; }
.feature:hover { transform: translateY(-4px); box-shadow: 0 1px 2px rgba(22,33,58,.05), 0 22px 48px -22px rgba(22,33,58,.4); }
.feature .fnum { display: inline-block; padding: 3px 10px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 16%, transparent); }

/* --- chips: subtle glass --- */
.chip { backdrop-filter: blur(6px); box-shadow: inset 0 0 0 1px rgba(255,255,255,.18); }

/* --- subject cards: gradient wash, glow ring, moving shine --- */
.subject-card { box-shadow: 0 10px 26px -12px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.18); isolation: isolate; }
.subject-card::after {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: linear-gradient(150deg, rgba(255,255,255,.22), rgba(255,255,255,0) 42%, rgba(0,0,0,.10));
}
.subject-card::before {
  content: ""; position: absolute; top: 0; left: -60%; width: 55%; height: 100%; z-index: 1; pointer-events: none;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.28), transparent);
  transform: skewX(-18deg); transition: left .55s ease; opacity: 0;
}
.subject-card:hover::before { left: 120%; opacity: 1; }
.subject-card > * { position: relative; z-index: 2; }
.subject-card:hover { box-shadow: 0 20px 44px -16px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.25); }
.subject-card .semoji { filter: drop-shadow(0 3px 6px rgba(0,0,0,.22)); }
.subject-card .blob { background: radial-gradient(circle at 35% 35%, rgba(255,255,255,.28), rgba(255,255,255,.05)); }

/* --- zone cards: icon badge + accent hover --- */
.zone-card { transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease; overflow: hidden; position: relative; }
.zone-card .zemoji {
  display: inline-flex; align-items: center; justify-content: center;
  width: 52px; height: 52px; border-radius: 15px; margin-bottom: 4px;
  background: linear-gradient(150deg, color-mix(in srgb, var(--brand) 16%, transparent), color-mix(in srgb, var(--accent) 16%, transparent));
  box-shadow: inset 0 0 0 1px rgba(127,127,127,.12);
}
.zone-card:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--accent) 55%, transparent); box-shadow: 0 18px 40px -18px rgba(0,0,0,.4); }
body[data-theme="junior"] .zone-card .zemoji, body[data-theme="explorer"] .zone-card .zemoji { background: rgba(255,255,255,.25); }

/* --- avatar ring glow --- */
.avatar-big { box-shadow: inset 0 0 0 3px rgba(255,255,255,.35), 0 8px 20px -8px rgba(0,0,0,.4); position: relative; }
.kid-header .avatar-big { background-image: linear-gradient(150deg, rgba(255,255,255,.25), rgba(255,255,255,0)); }

/* --- choice buttons: lift + accent bar on hover --- */
.choice { box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.choice:hover:not(:disabled) { transform: translateX(4px); box-shadow: 0 6px 16px -8px rgba(0,0,0,.35); }

/* --- hero headline: gradient ink (pro/landing) --- */
body:not([data-theme]) .hero h1, body[data-theme="pro"] .hero h1 {
  background: linear-gradient(120deg, var(--brand), #2f8f68 55%, var(--accent));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ============================================================
   RARITY badges + glow (avatars & snacks)
   ============================================================ */
.rar-tag {
  position: absolute; top: 5px; left: 50%; transform: translateX(-50%);
  font-size: .5rem; font-weight: 800; letter-spacing: .04em; padding: 2px 6px;
  border-radius: 999px; white-space: nowrap; z-index: 3; color: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.25);
}
.rar-tag-rare { background: linear-gradient(120deg, #3d8bff, #6aa8ff); }
.rar-tag-epic { background: linear-gradient(120deg, #a855f7, #c98bff); }
.rar-tag-legendary { background: linear-gradient(120deg, #f0a500, #ffcf47); color: #3a2a00; }
.avatar-opt.rar-rare { box-shadow: 0 0 0 2px rgba(61,139,255,.5), 0 6px 16px -8px rgba(61,139,255,.6); }
.avatar-opt.rar-epic { box-shadow: 0 0 0 2px rgba(168,85,247,.55), 0 6px 18px -8px rgba(168,85,247,.6); }
.avatar-opt.rar-legendary { box-shadow: 0 0 0 2px rgba(240,165,0,.7), 0 0 22px -4px rgba(255,207,71,.65); animation: legend-pulse 2.2s ease-in-out infinite; }
@keyframes legend-pulse { 0%,100% { box-shadow: 0 0 0 2px rgba(240,165,0,.7), 0 0 18px -6px rgba(255,207,71,.55); } 50% { box-shadow: 0 0 0 2px rgba(240,165,0,.9), 0 0 28px -2px rgba(255,207,71,.85); } }
.avatar-opt { padding-top: 16px; transition: transform .14s ease; }
.avatar-opt:hover { transform: translateY(-3px) scale(1.04); }
.avatar-opt.sel { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 45%, transparent); }

/* ============================================================
   SNACK SHACK & VENDING MACHINE
   ============================================================ */
.vending {
  max-width: 640px; margin: 0 auto; border-radius: 26px; padding: 18px 18px 0;
  background: linear-gradient(180deg, #d8402f, #b32b1f);
  box-shadow: 0 24px 60px -22px rgba(0,0,0,.6), inset 0 2px 0 rgba(255,255,255,.25), inset 0 -6px 16px rgba(0,0,0,.3);
  border: 3px solid rgba(0,0,0,.12); position: relative;
}
.vending.is-shack { background: linear-gradient(180deg, #2d8f5f, #1c6f47); }
.vending-head {
  text-align: center; font-family: var(--font-display); font-weight: 800; letter-spacing: .06em;
  color: #fff; font-size: 1.05rem; padding: 6px 0 14px; text-shadow: 0 2px 4px rgba(0,0,0,.35);
}
.vending-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px;
  background: linear-gradient(180deg, #10233b, #16304f); padding: 14px; border-radius: 14px;
  box-shadow: inset 0 3px 12px rgba(0,0,0,.55); border: 2px solid rgba(0,0,0,.3);
}
.snack-slot {
  position: relative; background: linear-gradient(180deg, rgba(255,255,255,.96), rgba(236,240,247,.9));
  border-radius: 12px; padding: 14px 8px 10px; text-align: center;
  box-shadow: inset 0 -2px 0 rgba(0,0,0,.08), 0 2px 6px rgba(0,0,0,.2);
  border: 1px solid rgba(255,255,255,.5); transition: transform .13s ease;
}
.snack-slot:hover { transform: translateY(-2px); }
.snack-slot.rar-rare { box-shadow: 0 0 0 2px rgba(61,139,255,.45), inset 0 -2px 0 rgba(0,0,0,.08); }
.snack-slot.rar-epic { box-shadow: 0 0 0 2px rgba(168,85,247,.5), inset 0 -2px 0 rgba(0,0,0,.08); }
.snack-slot.rar-legendary { box-shadow: 0 0 0 2px rgba(240,165,0,.65), 0 0 20px -6px rgba(255,207,71,.6); }
.snack-emoji { font-size: 2.3rem; line-height: 1; filter: drop-shadow(0 3px 4px rgba(0,0,0,.2)); }
.snack-name { font-size: .78rem; font-weight: 700; color: #1d2740; margin: 6px 0 8px; min-height: 2em; display: flex; align-items: center; justify-content: center; }
.snack-buy { font-size: .82rem; padding: 6px 12px; width: 100%; }
.snack-count {
  position: absolute; top: 5px; right: 5px; z-index: 3; background: #17462f; color: #fff;
  font-size: .68rem; font-weight: 800; padding: 2px 7px; border-radius: 999px; box-shadow: 0 2px 5px rgba(0,0,0,.3);
}
.vending-tray {
  margin: 14px -18px 0; padding: 0; height: 92px; position: relative;
  background: linear-gradient(180deg, rgba(0,0,0,.28), rgba(0,0,0,.5));
  border-radius: 0 0 22px 22px; overflow: hidden;
  box-shadow: inset 0 6px 14px rgba(0,0,0,.5);
}
.vending-slot-mouth {
  position: absolute; top: 10px; left: 50%; transform: translateX(-50%);
  width: 62%; height: 16px; background: #05070c; border-radius: 6px;
  box-shadow: inset 0 3px 6px rgba(0,0,0,.8);
}
#drop-zone { position: absolute; bottom: 14px; left: 0; right: 0; display: flex; justify-content: center; gap: 8px; font-size: 2.4rem; }
.snack-drop { filter: drop-shadow(0 4px 8px rgba(0,0,0,.5)); }
body[data-theme="junior"] .snack-name { font-size: .85rem; }

@media (max-width: 560px) {
  .vending-grid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
  .zone-card .zemoji { width: 46px; height: 46px; }
}

/* ============================================================
   TROPHY CASE / BADGE BOOK
   ============================================================ */
.trophy-rank .tr-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; font-size: 1.1rem; }
.rank-bar { height: 14px; border-radius: 999px; background: color-mix(in srgb, var(--brand) 12%, transparent); overflow: hidden; box-shadow: inset 0 1px 3px rgba(0,0,0,.15); }
.rank-bar-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--accent), #ffd873); transition: width .6s cubic-bezier(.22,.9,.36,1); box-shadow: 0 0 10px rgba(201,151,28,.5); }
.rank-ladder { display: flex; justify-content: space-between; margin-top: 14px; gap: 2px; overflow-x: auto; }
.rl-node { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 52px; opacity: .4; transition: opacity .3s; }
.rl-node.on { opacity: 1; }
.rl-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--field-border); box-shadow: inset 0 1px 2px rgba(0,0,0,.2); }
.rl-node.on .rl-dot { background: linear-gradient(135deg, var(--accent), #ffd873); box-shadow: 0 0 8px rgba(201,151,28,.6); }
.rl-name { font-size: .62rem; font-weight: 700; text-align: center; color: var(--chrome-sub); }
.rl-node.on .rl-name { color: var(--ink); }
body[data-theme="junior"] .rl-name, body[data-theme="explorer"] .rl-name { color: rgba(255,255,255,.7); }
body[data-theme="junior"] .rl-node.on .rl-name, body[data-theme="explorer"] .rl-node.on .rl-name { color: #fff; }

/* next goals */
.ng-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.ng-card { display: flex; gap: 12px; align-items: center; padding: 14px; border-radius: 14px; background: var(--soft-bg); border: 2px solid transparent; }
.ng-card.rar-rare { border-color: rgba(61,139,255,.4); }
.ng-card.rar-epic { border-color: rgba(168,85,247,.45); }
.ng-card.rar-legendary { border-color: rgba(240,165,0,.55); box-shadow: 0 0 18px -6px rgba(255,207,71,.5); }
.ng-emoji { font-size: 2.4rem; filter: grayscale(.3); }
.ng-body { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.ng-body b { font-size: .98rem; }
.ng-body .muted { font-size: .8rem; line-height: 1.35; }
.ng-count { font-size: .78rem; font-weight: 700; color: var(--accent); }

/* rarity legend */
.rar-legend { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; padding-bottom: 14px; border-bottom: 1px dashed var(--field-border); }
.rar-leg-item { display: flex; align-items: center; gap: 6px; font-size: .84rem; color: var(--chrome-sub); }
.rar-dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.rar-tag-common, .rar-dot.rar-tag-common { background: linear-gradient(120deg, #9aa4b2, #c3ccd8); }

/* badge categories & grid */
.badge-cat { margin-bottom: 20px; }
.badge-cat-head { font-family: var(--font-display); font-weight: 700; font-size: 1rem; margin-bottom: 10px; }
.badge-cat-head .muted { font-weight: 400; font-size: .85rem; }
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
.badge-cell { position: relative; text-align: center; padding: 14px 8px 10px; border-radius: 14px; background: var(--soft-bg); border: 1.5px solid var(--card-border); transition: transform .14s ease; }
.badge-cell.earned { cursor: pointer; background: linear-gradient(160deg, #fffdf6, #fff4d8); border-color: rgba(201,151,28,.35); }
body[data-theme="academy"] .badge-cell.earned { background: linear-gradient(160deg, #26314f, #2c3860); border-color: rgba(224,182,79,.35); }
.badge-cell.earned:hover { transform: translateY(-3px); }
.badge-cell.locked { opacity: .72; }
.badge-cell.locked .badge-emoji { filter: grayscale(1); opacity: .5; }
.badge-emoji { font-size: 2.2rem; line-height: 1; filter: drop-shadow(0 3px 4px rgba(0,0,0,.15)); }
.badge-name { font-size: .72rem; font-weight: 700; margin-top: 6px; line-height: 1.2; min-height: 2.4em; display: flex; align-items: center; justify-content: center; }
.badge-rar { font-size: .58rem; font-weight: 800; letter-spacing: .04em; padding: 2px 7px; border-radius: 999px; color: #fff; display: inline-block; margin-top: 4px; }
.badge-cell.rar-legendary { box-shadow: 0 0 16px -4px rgba(255,207,71,.6); animation: legend-pulse 2.4s ease-in-out infinite; }
.badge-cell.rar-epic { box-shadow: 0 0 12px -5px rgba(168,85,247,.5); }
.badge-prog { height: 6px; border-radius: 999px; background: rgba(127,127,127,.18); overflow: hidden; margin: 8px 2px 3px; }
.badge-prog-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--brand), var(--brand-2)); transition: width .5s ease; }
.badge-prog-txt { font-size: .66rem; font-weight: 700; color: var(--chrome-sub); }

/* certificate shelf */
.cert-shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.cert-mini { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 3px; padding: 16px 12px; border-radius: 14px; cursor: pointer;
  background: linear-gradient(165deg, #fffdf6, #f6ecd0); border: 1.5px solid rgba(201,151,28,.4); box-shadow: var(--shadow); transition: transform .14s ease; }
.cert-mini:hover { transform: translateY(-3px) rotate(-1deg); }
.cert-mini b { font-size: .9rem; }
.cert-mini .muted { font-size: .75rem; }
.cert-mini-seal { font-size: 2rem; }
body[data-theme="academy"] .cert-mini { background: linear-gradient(165deg, #26314f, #2c3860); }

/* Home achievements banner */
.ach-banner { display: flex; align-items: center; gap: 14px; padding: 14px 18px; margin-bottom: 16px; cursor: pointer;
  border-radius: var(--radius); background: linear-gradient(120deg, #1f5e46, #17462f); color: #fff;
  box-shadow: 0 12px 30px -14px rgba(0,0,0,.5); border: 1px solid rgba(201,151,28,.5); transition: transform .15s ease, box-shadow .15s ease; }
.ach-banner:hover { transform: translateY(-2px); box-shadow: 0 16px 36px -14px rgba(0,0,0,.6); }
.ab-trophy { font-size: 2.4rem; filter: drop-shadow(0 3px 5px rgba(0,0,0,.35)); }
.ab-mid { flex: 1; min-width: 0; }
.ab-top { display: flex; align-items: baseline; gap: 10px; }
.ab-top b { font-family: var(--font-display); font-size: 1.05rem; }
.ab-count { font-size: .82rem; opacity: .85; background: rgba(255,255,255,.15); padding: 2px 10px; border-radius: 999px; }
.ab-goal { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.ab-goal-emoji { font-size: 1.4rem; }
.ab-goal-body { flex: 1; min-width: 0; }
.ab-goal-name { font-size: .82rem; opacity: .95; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ab-prog { height: 7px; border-radius: 999px; background: rgba(255,255,255,.22); overflow: hidden; margin-top: 4px; }
.ab-prog-fill { height: 100%; border-radius: 999px; transition: width .6s ease; }
.ab-goal-count { font-size: .78rem; font-weight: 800; white-space: nowrap; }
.ab-cta { font-weight: 700; font-size: .9rem; background: var(--accent); color: #241c04; padding: 8px 14px; border-radius: 999px; white-space: nowrap; }
@media (max-width: 560px) { .ab-cta { display: none; } .ab-goal-name { white-space: normal; } }

/* Sound settings popover */
.sound-wrap { position: relative; display: inline-block; }
.sound-menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 900; width: 232px;
  background: var(--card-bg); border: 1px solid var(--card-border); border-radius: 14px; padding: 8px;
  box-shadow: 0 16px 40px -12px rgba(0,0,0,.45); }
.sound-menu[hidden] { display: none; }
.sound-opt { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%;
  background: none; border: 0; cursor: pointer; padding: 11px 12px; border-radius: 10px; font: inherit;
  font-size: .92rem; font-weight: 600; color: var(--ink); }
.sound-opt:hover { background: var(--soft-bg); }
.sw { width: 40px; height: 23px; border-radius: 999px; background: var(--field-border); position: relative; transition: background .2s; flex-shrink: 0; }
.sw::after { content: ""; position: absolute; top: 2px; left: 2px; width: 19px; height: 19px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .2s; }
.sw.on { background: var(--brand); }
.sw.on::after { transform: translateX(17px); }
body[data-theme="academy"] .sound-menu { background: #19203a; }

/* Read-along storytime */
.passage-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.passage-read { flex-shrink: 0; }
.passage-words .pw { transition: background .15s ease, color .15s ease; border-radius: 5px; padding: 0 1px; }
.passage-words .pw-on { background: var(--accent); color: #241c04; box-shadow: 0 0 0 2px var(--accent); }
.passage-box.reading { box-shadow: 0 0 0 3px rgba(201,151,28,.35); }
body[data-theme="junior"] .passage-words { font-size: 1.24rem; line-height: 1.85; letter-spacing: .01em; }
body[data-theme="junior"] .passage-words .pw-on { background: #ffcf47; }
body[data-theme="academy"] .passage-words .pw-on { background: #d9b64a; color: #1a1205; }

/* Snack muncher — the avatar eats what you buy */
.snack-muncher { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-top: 16px; }
.muncher-av { width: 92px; height: 92px; font-size: 3.4rem; background: rgba(255,255,255,.22); box-shadow: inset 0 0 0 3px rgba(255,255,255,.4), 0 10px 24px -10px rgba(0,0,0,.5); }
.muncher-caption { color: #fff !important; font-size: .88rem; }
.snack-flyer { position: fixed; z-index: 4000; font-size: 2.2rem; pointer-events: none; filter: drop-shadow(0 4px 8px rgba(0,0,0,.45)); }
.yum-pop { position: fixed; z-index: 4001; transform: translate(-50%,0); font-weight: 800; font-size: 1.05rem; color: #fff; background: #17462f; padding: 5px 14px; border-radius: 999px; box-shadow: 0 6px 18px rgba(0,0,0,.35); border: 1px solid #c9971c; pointer-events: none; white-space: nowrap; }

/* ============================================================
   PARENT: Strengths & Future Paths (career insights)
   ============================================================ */
.career-card { background: linear-gradient(180deg, #ffffff, #fbfaf6); }
body[data-theme="academy"] .career-card { background: linear-gradient(180deg, #19203a, #161d33); }
.career-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.career-head h3 { font-size: 1.25rem; }
.career-badge { font-size: .72rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: #7a5c00; background: linear-gradient(120deg, #f6e6b8, #f3dd97); padding: 4px 12px; border-radius: 999px; }
.strength-panel { display: flex; flex-direction: column; gap: 9px; padding: 14px 16px; background: var(--soft-bg); border-radius: 14px; }
.str-row { display: flex; align-items: center; gap: 12px; }
.str-name { min-width: 118px; font-weight: 700; font-size: .92rem; }
.str-bar { flex: 1; height: 12px; border-radius: 999px; background: rgba(127,127,127,.16); overflow: hidden; box-shadow: inset 0 1px 2px rgba(0,0,0,.12); }
.str-fill { display: block; height: 100%; border-radius: 999px; transition: width .7s cubic-bezier(.22,.9,.36,1); box-shadow: 0 0 8px rgba(0,0,0,.12) inset; }
.str-pct { min-width: 26px; text-align: right; font-weight: 800; font-size: .85rem; color: var(--chrome-sub); }
.path-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }
.path-card { display: flex; gap: 14px; padding: 16px; border-radius: 16px; background: var(--card-bg); border: 1px solid var(--card-border);
  box-shadow: 0 1px 2px rgba(22,33,58,.05), 0 14px 34px -22px rgba(22,33,58,.3); transition: transform .16s ease, box-shadow .16s ease; }
.path-card:hover { transform: translateY(-3px); box-shadow: 0 1px 2px rgba(22,33,58,.05), 0 20px 42px -22px rgba(22,33,58,.42); }
.path-emoji { font-size: 2.3rem; line-height: 1; filter: drop-shadow(0 3px 5px rgba(0,0,0,.18)); }
.path-body { flex: 1; min-width: 0; }
.path-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.path-top b { font-size: 1.05rem; font-family: var(--font-display); }
.path-match { font-size: .72rem; font-weight: 800; color: #1f8a5f; background: rgba(31,138,95,.12); padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.path-why { font-size: .88rem; line-height: 1.5; color: var(--chrome-sub); margin: 6px 0 0; }
.path-hs { font-size: .82rem; line-height: 1.45; margin: 8px 0 0; padding: 8px 10px; background: color-mix(in srgb, var(--accent) 10%, transparent); border-radius: 10px; }
body[data-theme="academy"] .path-hs { background: rgba(224,182,79,.12); }

/* ============================================================
   V28 AESTHETICS ELEVATION — premium, "legit" polish
   ============================================================ */
/* Refined type rhythm */
h1, h2, h3, h4 { letter-spacing: -.018em; }
.hero h1 { letter-spacing: -.01em; line-height: 1.08; font-weight: 600; }
/* Fraunces headings read best a touch looser than a sans; give them room. */
body:not([data-theme="junior"]):not([data-theme="explorer"]) h1,
body:not([data-theme="junior"]):not([data-theme="explorer"]) h2,
body:not([data-theme="junior"]):not([data-theme="explorer"]) h3 { letter-spacing: -.005em; }

/* Hero: soft glow behind the headline + refined eyebrow chip */
.hero { position: relative; }
.hero .eyebrow { display: inline-block; padding: 7px 16px; border-radius: 999px; background: color-mix(in srgb, var(--brand) 9%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand) 18%, transparent); }
.hero::after { content: ""; position: absolute; left: 50%; top: 90px; width: 620px; height: 320px; transform: translateX(-50%); z-index: -1; pointer-events: none;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%); filter: blur(20px); }

/* Stat band: refined dividers, weight, tighter */
.statband { gap: 0; border-color: color-mix(in srgb, var(--ink) 10%, transparent); }
.statband > div { position: relative; }
.statband > div + div::before { content: ""; position: absolute; left: 0; top: 22%; height: 56%; width: 1px; background: color-mix(in srgb, var(--ink) 12%, transparent); }
.statband b { font-weight: 800; letter-spacing: -.02em; }

/* Cards: crisper hairline + refined elevation; feature number chips */
.card, .feature, .q-card, .path-card, .subject-report { border-color: color-mix(in srgb, var(--ink) 9%, transparent); }
.feature { position: relative; overflow: hidden; }
.feature::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: linear-gradient(90deg, var(--brand), var(--accent)); opacity: 0; transition: opacity .2s; }
.feature:hover::before { opacity: 1; }

/* Section headings: subtle refinement */
.section-title { letter-spacing: -.025em; }
.section-sub { max-width: 620px; margin-left: auto; margin-right: auto; }

/* Buttons: slightly tighter, more confident */
.btn { letter-spacing: -.005em; }
.hero .btn { border-radius: calc(var(--btn-radius) + 2px); }

/* Pills refined */
.pill { border-radius: 999px; font-weight: 700; letter-spacing: -.01em; }
.pill.strength { background: color-mix(in srgb, #1f8a5f 14%, transparent); color: #14663f; }
.pill.focus { background: color-mix(in srgb, var(--accent) 18%, transparent); color: #7a5c00; }
body[data-theme="academy"] .pill.strength { color: #7fe0b6; }
body[data-theme="academy"] .pill.focus { color: #e6c675; }

/* Subject report: nicer letter grade badge */
.subject-report .letter { font-weight: 800; letter-spacing: -.03em; }

/* Topbar logo: crisper */
.logo { letter-spacing: -.02em; }

/* Plans: premium hot-plan treatment */
.plan { transition: transform .16s ease, box-shadow .16s ease; }
.plan:hover { transform: translateY(-4px); box-shadow: 0 24px 50px -24px rgba(22,33,58,.4); }
.plan.hot { box-shadow: 0 20px 46px -22px rgba(201,151,28,.45); }
.plan .price { letter-spacing: -.03em; }

/* Site footer refined */
.site-footer { border-color: color-mix(in srgb, var(--ink) 8%, transparent); }

/* Smooth focus rings for accessibility + polish */
a:focus-visible, button:focus-visible, .zone-card:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px;
}

/* ============================================================
   LANDING: Career Pathways spotlight
   ============================================================ */
.lp-career { display: grid; grid-template-columns: 1.05fr 1fr; gap: 24px; align-items: center; margin-top: 10px; }
.lp-career-panel { background: linear-gradient(180deg, #ffffff, #fbfaf5); border: 1px solid color-mix(in srgb, var(--ink) 9%, transparent);
  border-radius: 20px; padding: 22px; box-shadow: 0 1px 2px rgba(22,33,58,.05), 0 26px 54px -28px rgba(22,33,58,.4); }
.lp-career-badge { display: inline-block; font-size: .72rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase;
  color: #7a5c00; background: linear-gradient(120deg, #f6e6b8, #f3dd97); padding: 5px 13px; border-radius: 999px; margin-bottom: 16px; }
.lp-strength { display: flex; align-items: center; gap: 12px; margin: 9px 0; }
.lp-s-name { min-width: 108px; font-weight: 700; font-size: .9rem; }
.lp-s-bar { flex: 1; height: 12px; border-radius: 999px; background: rgba(127,127,127,.15); overflow: hidden; box-shadow: inset 0 1px 2px rgba(0,0,0,.12); }
.lp-s-bar i { display: block; height: 100%; border-radius: 999px; }
.lp-strength b { min-width: 24px; text-align: right; font-size: .85rem; color: var(--chrome-sub); }
.lp-paths { margin-top: 16px; display: flex; flex-direction: column; gap: 8px; }
.lp-path { display: flex; align-items: center; gap: 8px; background: var(--soft-bg); border-radius: 12px; padding: 10px 14px; font-size: .95rem; }
.lp-path b { flex: 1; font-family: var(--font-display); }
.lp-path span { font-size: .74rem; font-weight: 800; color: #1f8a5f; background: rgba(31,138,95,.12); padding: 2px 9px; border-radius: 999px; }
.lp-career-copy h3 { font-size: 1.5rem; margin-bottom: 10px; }
.lp-career-copy p { color: var(--chrome-sub); line-height: 1.6; margin-bottom: 14px; }
.lp-check { list-style: none; display: flex; flex-direction: column; gap: 9px; }
.lp-check li { font-size: .95rem; line-height: 1.45; }
@media (max-width: 800px) { .lp-career { grid-template-columns: 1fr; } }

/* ============================================================
   LANDING: competitor comparison table
   ============================================================ */
.compare { margin-top: 28px; }
.compare-head { text-align: center; margin-bottom: 14px; }
.compare-head span { display: inline-block; font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; padding-bottom: 6px; border-bottom: 3px solid var(--accent); }
.compare-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .92rem; }
.compare-table th, .compare-table td { padding: 12px 14px; text-align: center; border-bottom: 1px solid color-mix(in srgb, var(--ink) 8%, transparent); }
.compare-table thead th { font-weight: 700; font-size: .85rem; color: var(--chrome-sub); vertical-align: bottom; }
.compare-table thead th span { font-weight: 500; font-size: .74rem; opacity: .8; }
.compare-table tbody td:first-child, .compare-table thead th:first-child { text-align: left; font-weight: 600; }
.compare-table .us { background: color-mix(in srgb, var(--brand) 7%, transparent); }
.compare-table thead th.us { color: var(--brand); font-size: 1.05rem; font-weight: 800; border-top-left-radius: 12px; border-top-right-radius: 12px; }
.compare-table tbody tr:last-child td.us { border-bottom-left-radius: 12px; border-bottom-right-radius: 12px; }
.compare-table td.us { font-weight: 700; }
body[data-theme="academy"] .compare-table .us { background: rgba(74,128,214,.14); }
@media (max-width: 620px) {
  .compare-table { font-size: .8rem; }
  .compare-table th, .compare-table td { padding: 9px 6px; }
}

/* Per-subject pace status badges (parent report) */
.status-badge { display: inline-block; font-size: .72rem; font-weight: 800; letter-spacing: .01em; padding: 3px 10px; border-radius: 999px; margin-left: 6px; vertical-align: middle; white-space: nowrap; }
.st-excelling { background: color-mix(in srgb, #1f8a5f 16%, transparent); color: #14663f; }
.st-ontrack { background: color-mix(in srgb, #2f78c2 15%, transparent); color: #235d97; }
.st-support { background: color-mix(in srgb, var(--accent) 20%, transparent); color: #7a5c00; }
.st-building { background: rgba(127,127,127,.14); color: var(--chrome-sub); }
body[data-theme="academy"] .st-excelling { color: #7fe0b6; }
body[data-theme="academy"] .st-support { color: #e6c675; }

/* Parent placement rationale */
.place-note { font-size: .88rem; line-height: 1.55; color: var(--chrome-sub); background: var(--soft-bg); border-left: 3px solid color-mix(in srgb, var(--brand) 40%, transparent); border-radius: 8px; padding: 8px 12px; margin: 8px 0 4px; }
.place-note b { color: var(--ink); }
body[data-theme="academy"] .place-note b { color: var(--chrome-ink); }

/* ============================================================
   Testimonials
   ============================================================ */
.quote-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; margin-top: 10px; }
.quote-card { margin: 0; background: var(--card-bg); border: 1px solid color-mix(in srgb, var(--ink) 9%, transparent);
  border-radius: 18px; padding: 26px 24px 20px; box-shadow: 0 1px 2px rgba(22,33,58,.05), 0 18px 40px -24px rgba(22,33,58,.32); position: relative; }
.quote-card::before { content: "\201C"; position: absolute; top: 6px; left: 18px; font-family: var(--font-display); font-size: 3.6rem; line-height: 1; color: color-mix(in srgb, var(--accent) 55%, transparent); }
.quote-card blockquote { margin: 18px 0 16px; font-size: 1.05rem; line-height: 1.6; color: var(--ink); font-family: var(--font-display); font-weight: 400; letter-spacing: -.005em; }
.quote-card figcaption { display: flex; flex-direction: column; gap: 1px; border-top: 1px solid color-mix(in srgb, var(--ink) 8%, transparent); padding-top: 12px; }
.q-name { font-weight: 700; font-size: .95rem; }
.q-detail { font-size: .82rem; color: var(--chrome-sub); }
body[data-theme="academy"] .quote-card blockquote { color: var(--chrome-ink); }

/* ============================================================
   LESSONS — teaching player, widgets, and hub
   ============================================================ */
.lp-wrap { max-width: 640px; }
.lp-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.lp-progress { display: flex; gap: 6px; flex: 1; justify-content: center; }
.lp-dot { width: 9px; height: 9px; border-radius: 50%; background: color-mix(in srgb, var(--sub) 22%, transparent); transition: background .3s, transform .3s; }
.lp-dot.on { background: var(--sub); transform: scale(1.15); }
.lp-card { background: var(--card-bg); border: 1px solid color-mix(in srgb, var(--ink) 9%, transparent); border-radius: 22px; padding: 30px 28px; box-shadow: 0 2px 6px rgba(22,33,58,.05), 0 26px 56px -30px rgba(22,33,58,.4); }
.lp-kind { font-size: .74rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--sub); margin-bottom: 10px; }
.lp-title { font-size: 1.6rem; line-height: 1.15; margin-bottom: 14px; }
.lp-body { font-size: 1.12rem; line-height: 1.6; color: var(--ink); }
.lp-analogy { margin-top: 12px; padding: 12px 14px; background: color-mix(in srgb, var(--accent) 12%, transparent); border-radius: 12px; font-size: 1rem; line-height: 1.5; }
.lp-widget { margin: 20px 0 6px; display: flex; flex-direction: column; align-items: center; }
.lp-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 22px; }
.lp-actions .btn.green { min-width: 140px; }
.lp-locked { opacity: .5; }
.lp-trynote { text-align: center; margin-top: 12px; font-size: .92rem; color: var(--chrome-sub); }
.lp-trynote.done { color: #1f8a5f; font-weight: 700; }
.lp-reveal { margin-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.lp-reveal-line { background: var(--soft-bg); border-left: 3px solid var(--sub); border-radius: 8px; padding: 11px 14px; font-size: 1.02rem; line-height: 1.5; }
.lp-recap { text-align: center; padding: 10px 0; }
.lp-recap-emoji { font-size: 3.2rem; }
.lp-takeaway { font-family: var(--font-display); font-size: 1.3rem; line-height: 1.35; margin-top: 10px; }
body[data-theme="junior"] .lp-title { font-size: 1.8rem; }
body[data-theme="junior"] .lp-body { font-size: 1.24rem; }

/* lesson widgets */
.lw-svg { display: block; margin: 0 auto; }
.lw-objects { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; font-size: 2.2rem; }
.lw-obj { line-height: 1; }
.lw-groups { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: center; }
.lw-group { display: flex; gap: 6px; padding: 10px; background: var(--soft-bg); border-radius: 12px; font-size: 1.7rem; }
.lw-plus { font-size: 1.6rem; font-weight: 800; color: var(--sub); }
.lw-sum { font-size: 2rem; color: var(--sub); }
.lw-array { display: flex; flex-direction: column; gap: 8px; }
.lw-arow { display: flex; gap: 10px; font-size: 1.5rem; }
.lw-arraylabel { margin-top: 12px; font-size: 1.1rem; }
.lw-frac { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.fw-cell { transition: fill .15s; }
.lw-fraclabel { display: flex; flex-direction: column; align-items: center; font-family: var(--font-display); font-size: 1.4rem; line-height: 1; }
.lw-fraclabel span { width: 34px; height: 3px; background: var(--ink); margin: 4px 0; }
.lw-tiphint { font-size: .95rem; color: var(--chrome-sub); text-align: center; margin-top: 10px; }
.lw-tiphint b { color: var(--sub); }
.lw-sbs { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.lw-sbs-card { flex: 1; min-width: 130px; max-width: 190px; text-align: center; padding: 16px 12px; border: 2px solid; border-radius: 16px; background: var(--card-bg); display: flex; flex-direction: column; gap: 4px; }
.lw-sbs-emoji { font-size: 2.4rem; }
.lw-sbs-card b { font-size: 1.05rem; }
.lw-sbs-card span { font-size: .86rem; color: var(--chrome-sub); line-height: 1.4; }

/* interactive widgets */
.lw-tapwrap { text-align: center; }
.lw-tapcount { font-family: var(--font-display); font-size: 2.6rem; color: var(--sub); min-height: 1.2em; }
.lw-taprow { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 8px; }
.lw-tap { font-size: 2rem; background: var(--soft-bg); border: 2px solid transparent; border-radius: 14px; padding: 8px 10px; cursor: pointer; transition: transform .1s, border-color .15s, opacity .2s; }
.lw-tap:hover { transform: translateY(-2px); }
.lw-tap.done { border-color: #1f8a5f; opacity: .55; }
.lw-build { text-align: center; }
.lw-build-cols { display: flex; gap: 24px; justify-content: center; }
.lw-build-col { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.lw-build-col > span:last-child { font-weight: 700; font-size: .85rem; color: var(--chrome-sub); }
.lw-build-stack { display: flex; flex-wrap: wrap; gap: 3px; min-height: 90px; width: 96px; align-content: flex-end; justify-content: center; }
.lw-rod { width: 10px; height: 44px; background: var(--sub); border-radius: 3px; }
.lw-cube { width: 16px; height: 16px; background: var(--accent); border-radius: 3px; }
.lw-build-btns { display: flex; gap: 6px; }
.lw-bt { font-size: .85rem; font-weight: 700; padding: 6px 12px; border-radius: 999px; border: 0; background: var(--sub); color: #fff; cursor: pointer; }
.lw-bt.ghost { background: var(--soft-bg); color: var(--ink); }
.lw-build-read { margin-top: 14px; font-size: 1.05rem; }
.lw-build-read b { color: var(--sub); font-size: 1.2rem; }
.lw-pick { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 360px; }
.lw-pickbtn { font-size: 1.15rem; font-weight: 700; padding: 14px; border-radius: 14px; border: 2px solid var(--field-border); background: var(--soft-bg); cursor: pointer; transition: all .13s; }
.lw-pickbtn:hover { border-color: var(--sub); }
.lw-pickbtn.good { border-color: #14a37f; background: #e2f8f1; color: #0c6b53; }
.lw-pickbtn.bad { border-color: var(--danger); background: #fdecec; }
.lw-sort { width: 100%; }
.lw-pool { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; min-height: 44px; margin-bottom: 14px; }
.lw-chip { font-size: 1rem; font-weight: 700; padding: 9px 15px; border-radius: 999px; border: 2px solid var(--field-border); background: var(--card-bg); cursor: pointer; transition: all .12s; }
.lw-chip.sel { border-color: var(--sub); background: color-mix(in srgb, var(--sub) 14%, transparent); transform: scale(1.05); }
.lw-chip.placed { opacity: .5; cursor: default; }
.lw-buckets { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.lw-bucket { flex: 1; min-width: 130px; max-width: 200px; border: 2px dashed var(--field-border); border-radius: 14px; padding: 10px; cursor: pointer; }
.lw-bucket:hover { border-color: var(--sub); }
.lw-bucket-head { font-weight: 800; font-size: .9rem; text-align: center; margin-bottom: 8px; }
.lw-bucket-body { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; min-height: 40px; }
.lw-highlight { width: 100%; }
.lw-passage { font-size: 1.14rem; line-height: 1.9; background: #fdf9ef; border: 1px solid #ecdfc2; border-radius: 12px; padding: 16px 18px; }
body[data-theme="academy"] .lw-passage { background: #2a2921; border-color: #4a442f; color: #e8e2cf; }
.lw-sent { cursor: pointer; border-radius: 5px; padding: 1px 2px; transition: background .15s; }
.lw-sent:hover { background: color-mix(in srgb, var(--sub) 12%, transparent); }
.lw-sent.good { background: #14a37f; color: #fff; }
.lw-sent.bad { background: #fdecec; }

/* lessons hub */
.learn-subhead { font-size: 1.15rem; margin: 22px 0 10px; }
.learn-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.learn-card { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 16px; background: var(--card-bg); border: 1px solid var(--card-border); cursor: pointer;
  box-shadow: 0 1px 2px rgba(22,33,58,.05), 0 14px 32px -22px rgba(22,33,58,.3); transition: transform .15s, box-shadow .15s; border-left: 4px solid var(--sub); }
.learn-card:hover { transform: translateY(-3px); box-shadow: 0 18px 40px -20px rgba(22,33,58,.42); }
.learn-card.ldone { opacity: .82; }
.learn-emoji { font-size: 2rem; }
.learn-body { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.learn-body b { font-size: 1.02rem; }
.learn-body span { font-size: .85rem; color: var(--chrome-sub); }
.learn-meta { font-size: .78rem !important; }
.learn-go { font-weight: 800; color: var(--sub); white-space: nowrap; }

/* ---- Sale-readiness: trust strip + FAQ ---- */
.trust-strip { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 22px; margin: 18px 0 4px; }
.trust-strip span { font-family: var(--font-body); font-size: .9rem; font-weight: 600; color: var(--ink); opacity: .82; white-space: nowrap; }
.faq details { border-bottom: 1px solid var(--card-border); padding: 14px 2px; }
.faq details:first-of-type { border-top: 1px solid var(--card-border); }
.faq summary { font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--ink); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; font-size: 1.4rem; line-height: 1; color: var(--brand); font-weight: 400; transition: transform .2s ease; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin: 12px 2px 2px; font-family: var(--font-body); line-height: 1.6; color: var(--ink); opacity: .88; max-width: 68ch; }
.faq details a { color: var(--brand); font-weight: 600; }
