/* Spell Bee — website styles.
 * Desktop/tablet-first: wide multi-column layouts, generous type, real page
 * chrome. It scales down to a phone, but it is not designed as a phone app. */

/* ── Themes ───────────────────────────────────────────────────────────────
 * Four worlds. The theme follows the page, not a switch:
 *   bee    — the landing page: honey and cream, the Spell Bee badge
 *   safari — Grade 1: green jungle, gold and leaf (Spell Safari artwork)
 *   galaxy — Grade 2: deep space, the same gold, starlight (Word Galaxy art)
 *   garden — Grade 3: a rainbow garden, sky and flowers
 * All four share the logos' gold, which is what ties the site together.
 * Every component reads these variables, so a theme restyles the whole page —
 * including the dark one — without any theme-specific component CSS. */
:root,
[data-theme="bee"] {
  --honey: #f2b40b;
  --amber: #e07b06;
  --ink: #3a2e5c;
  --leaf: #2fbf71;
  --berry: #e5484d;
  --sky: #2f9fc7;
  --cream: #fff9ec;
  --card: #ffffff;
  --page-1: #ffeec2;
  --page-2: #fff9ec;
  --hero-1: #ffe6ad;
  --hero-2: #fff9ec;
  --header-bg: color-mix(in srgb, var(--cream) 92%, transparent);
  --line: color-mix(in srgb, var(--ink) 12%, transparent);
  --on-honey: #3a2e5c;   /* dark text on gold reads far better than white */
  --on-leaf: #ffffff;
  --on-sky: #ffffff;
  --on-berry: #ffffff;
  --on-ink: #fff9ec;
  --overlay: rgba(40, 30, 62, .48);
  --footer-bg: #3a2e5c;
  --logo: url('../assets/logo.png');
  --logo-sm: url('../assets/logo.png');
  --shadow: 0 10px 30px color-mix(in srgb, var(--ink) 14%, transparent);
  --shadow-sm: 0 4px 14px color-mix(in srgb, var(--ink) 10%, transparent);
  --radius: 22px;
  --maxw: 1180px;
  --font: 'Fredoka', 'Baloo 2', 'Segoe UI', system-ui, sans-serif;
}

/* Grade 1 — a proper green jungle, to match the Spell Safari artwork. */
[data-theme="safari"] {
  --honey: #eda60c;
  --amber: #d2760a;
  --ink: #17331b;              /* deep leaf-green ink */
  --leaf: #3f8f2b;
  --berry: #d8452c;
  --sky: #1f8fb5;
  --cream: #e9f6dc;            /* the page: soft jungle light */
  --card: #f9fdf4;
  --page-1: #c9e7ac;
  --page-2: #e9f6dc;
  --hero-1: #b9e096;
  --hero-2: #e9f6dc;
  --header-bg: color-mix(in srgb, var(--cream) 92%, transparent);
  --line: color-mix(in srgb, var(--ink) 14%, transparent);
  --on-honey: #17331b;
  --on-leaf: #ffffff;
  --on-sky: #ffffff;
  --on-berry: #ffffff;
  --on-ink: #e9f6dc;
  --overlay: rgba(16, 40, 20, .5);
  --footer-bg: #17331b;
  --logo: url('../assets/themes/safari-logo.webp');
  --logo-sm: url('../assets/themes/safari-logo-sm.webp');
  --shadow: 0 10px 30px color-mix(in srgb, var(--ink) 16%, transparent);
  --shadow-sm: 0 4px 14px color-mix(in srgb, var(--ink) 11%, transparent);
  --radius: 22px;
  --maxw: 1180px;
  --font: 'Fredoka', 'Baloo 2', 'Segoe UI', system-ui, sans-serif;
}

[data-theme="galaxy"] {
  --honey: #fccc24;
  --amber: #fca800;
  --ink: #eef1ff;              /* text is light on this theme */
  --leaf: #3ddc97;
  --berry: #ff6b6b;
  --sky: #55d6ff;
  --cream: #0a0a2b;            /* the page itself */
  --card: #1b1b57;             /* raised surfaces */
  --page-1: #14143f;
  --page-2: #0a0a2b;
  --hero-1: #191952;
  --hero-2: #0a0a2b;
  --header-bg: color-mix(in srgb, #0a0a2b 92%, transparent);
  --line: color-mix(in srgb, var(--ink) 18%, transparent);
  --on-honey: #1a1a3f;
  --on-leaf: #06251a;
  --on-sky: #05263a;
  --on-berry: #2e0606;
  --on-ink: #0a0a2b;     /* --ink is light here, so text on it must be dark */
  --overlay: rgba(2, 2, 16, .64);
  --footer-bg: #05051c;
  --logo: url('../assets/themes/galaxy-logo.webp');
  --logo-sm: url('../assets/themes/galaxy-logo-sm.webp');
  --shadow: 0 10px 34px rgba(0, 0, 0, .45);
  --shadow-sm: 0 4px 16px rgba(0, 0, 0, .35);
  --radius: 22px;
  --maxw: 1180px;
  --font: 'Fredoka', 'Baloo 2', 'Segoe UI', system-ui, sans-serif;
}


/* Grade 3 — the Rainbow Garden. Bright daylight rather than jungle shade: a
 * clear sky overhead, a rainbow behind the page, and flowers along the foot.
 * The ink stays a deep leafy brown-green so long sentences are still restful
 * to read against all that colour. */
[data-theme="garden"] {
  --honey: #ffb703;
  --amber: #f97316;
  --ink: #33324e;
  --leaf: #22b573;
  --berry: #ef4d7a;
  --sky: #2ba6e0;
  --violet: #8e7dff;
  --cream: #f4fbff;            /* the page: a clean, sunny sky-white */
  --card: #ffffff;
  --page-1: #cdeeff;
  --page-2: #f4fbff;
  --hero-1: #b9e7ff;
  --hero-2: #f4fbff;
  --header-bg: color-mix(in srgb, var(--cream) 90%, transparent);
  --line: color-mix(in srgb, var(--ink) 13%, transparent);
  --on-honey: #33324e;
  --on-leaf: #ffffff;
  --on-sky: #ffffff;
  --on-berry: #ffffff;
  --on-ink: #f4fbff;
  --overlay: rgba(32, 40, 60, .5);
  --footer-bg: #2f3a52;
  --logo: url('../assets/themes/garden-logo.svg');
  --logo-sm: url('../assets/themes/garden-logo.svg');
  --shadow: 0 10px 30px color-mix(in srgb, var(--ink) 15%, transparent);
  --shadow-sm: 0 4px 14px color-mix(in srgb, var(--ink) 10%, transparent);
  --radius: 22px;
  --maxw: 1180px;
  --font: 'Fredoka', 'Baloo 2', 'Segoe UI', system-ui, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--page-2);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* Themed backdrop. Safari gets a warm sky wash with soft canopy blobs;
   Galaxy gets a night sky with a scatter of stars. Both are pure CSS, fixed
   behind the content, and never intercept clicks. */
body::before {
  content: ''; position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background: linear-gradient(170deg, var(--page-1) 0%, var(--page-2) 55%);
}
body::after {
  content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  opacity: .55;
}
/* Bee (landing): soft honey warmth in the corners. */
body::after,
[data-theme="bee"] body::after {
  background:
    radial-gradient(150px 110px at 5% 14%, color-mix(in srgb, #ffc93c 42%, transparent), transparent 70%),
    radial-gradient(170px 120px at 96% 18%, color-mix(in srgb, #ffb703 32%, transparent), transparent 70%),
    radial-gradient(150px 110px at 4% 82%, color-mix(in srgb, #ffd45c 34%, transparent), transparent 70%),
    radial-gradient(190px 130px at 98% 86%, color-mix(in srgb, #ffb703 26%, transparent), transparent 70%);
}

/* Safari (Grade 1): the painted jungle clearing. The artwork frames the page —
 * trees, vines and the animals live in the margins, and the clearing in the
 * middle is where the content sits. The veil on top lifts that middle back
 * towards cream so body text keeps its contrast over the painting; without it
 * the greens are strong enough to fight the ink. */
[data-theme="safari"] body::after {
  opacity: 1;
  background:
    radial-gradient(closest-side at 50% 42%,
      color-mix(in srgb, var(--cream) 82%, transparent),
      color-mix(in srgb, var(--cream) 34%, transparent) 62%,
      transparent 100%),
    url('../assets/themes/jungle-bg.webp') center center / cover no-repeat;
}
/* Phones only ever see the middle of the painting, where there is nothing to
 * look at, so drop it for the plain wash and save the download. */
@media (max-width: 620px) {
  [data-theme="safari"] body::after {
    background:
      radial-gradient(200px 130px at 2% 6%, color-mix(in srgb, #2f7d1e 45%, transparent), transparent 72%),
      radial-gradient(240px 160px at 99% 8%, color-mix(in srgb, #1f5e14 42%, transparent), transparent 72%),
      radial-gradient(200px 140px at 1% 92%, color-mix(in srgb, #3f8f2b 38%, transparent), transparent 72%),
      radial-gradient(240px 170px at 99% 96%, color-mix(in srgb, #1f5e14 34%, transparent), transparent 72%);
  }
}

[data-theme="galaxy"] body::after {
  opacity: 1;
  background-image:
    radial-gradient(1.6px 1.6px at 12% 18%, #fff, transparent),
    radial-gradient(1.4px 1.4px at 28% 62%, #cfe4ff, transparent),
    radial-gradient(1.8px 1.8px at 46% 12%, #fff, transparent),
    radial-gradient(1.3px 1.3px at 63% 78%, #ffe9a8, transparent),
    radial-gradient(1.7px 1.7px at 78% 32%, #fff, transparent),
    radial-gradient(1.4px 1.4px at 88% 68%, #cfe4ff, transparent),
    radial-gradient(1.5px 1.5px at 8% 88%, #fff, transparent),
    radial-gradient(1.3px 1.3px at 36% 92%, #ffe9a8, transparent),
    radial-gradient(1.6px 1.6px at 94% 8%, #fff, transparent),
    radial-gradient(1.2px 1.2px at 20% 40%, #fff, transparent),
    radial-gradient(1.1px 1.1px at 55% 48%, #cfe4ff, transparent),
    radial-gradient(1.4px 1.4px at 70% 6%, #fff, transparent),
    radial-gradient(1.2px 1.2px at 4% 56%, #ffe9a8, transparent),
    radial-gradient(1.5px 1.5px at 84% 88%, #fff, transparent),
    radial-gradient(1.1px 1.1px at 40% 30%, #fff, transparent),
    radial-gradient(1.3px 1.3px at 66% 58%, #cfe4ff, transparent);
  animation: sb-twinkle 5.5s ease-in-out infinite;
}

/* Deep space, layer two. The starfield above lives on <body>; the nebulae and
 * the planets live on <html>, so they can drift on their own clock without
 * disturbing the stars. Both sit behind everything and swallow no clicks.
 *
 * Note the selector: data-theme is set ON <html>, so these have to be
 * html[data-theme=…]::before. A descendant selector would never match, since
 * the root element is not a descendant of itself. */
html[data-theme="galaxy"]::before,
html[data-theme="galaxy"]::after {
  content: ''; position: fixed; z-index: -1; pointer-events: none;
}
/* The nebulae are drawn oversized so they can drift without an edge sliding
   into view; the planets are pinned to the viewport, because they are objects
   with a place rather than a wash. */
html[data-theme="galaxy"]::before { inset: -12%; }
html[data-theme="galaxy"]::after  { inset: 0; }
/* Nebulae: three coloured clouds breathing very slowly across the sky. */
html[data-theme="galaxy"]::before {
  background:
    radial-gradient(38vw 30vw at 16% 24%, rgba(124, 58, 237, .34), transparent 68%),
    radial-gradient(34vw 26vw at 84% 32%, rgba(14, 116, 233, .30), transparent 68%),
    radial-gradient(42vw 30vw at 52% 92%, rgba(219, 39, 119, .22), transparent 70%),
    radial-gradient(26vw 20vw at 74% 76%, rgba(6, 182, 212, .18), transparent 70%);
  filter: blur(6px);
  animation: sb-nebula 26s ease-in-out infinite alternate;
}
/* Two planets and a distant ringed world, parked in the corners where the
   content is not. */
html[data-theme="galaxy"]::after {
  background-image:
    radial-gradient(circle 58px at calc(100% - 110px) 172px,
      #ffb703 0 46%, #e07b06 46% 76%, rgba(224,123,6,.22) 76% 100%, transparent 100%),
    radial-gradient(circle 32px at 84px calc(100% - 130px),
      #7dd3fc 0 52%, #3b82f6 52% 82%, rgba(59,130,246,.2) 82% 100%, transparent 100%),
    radial-gradient(circle 18px at calc(100% - 230px) calc(100% - 96px),
      #f0abfc 0 60%, rgba(240,171,252,.18) 60% 100%, transparent 100%);
  background-repeat: no-repeat;
  animation: sb-drift 30s ease-in-out infinite alternate;
}
/* A comet crosses now and then — long gaps, so it stays a surprise rather
   than a tic in the corner of the eye. */
[data-theme="galaxy"] .site-header::after {
  content: ''; position: fixed; top: 16vh; left: -18vw; z-index: -1;
  width: 16vw; height: 2px; pointer-events: none; border-radius: 2px;
  background: linear-gradient(90deg, transparent, #fff9, #fff);
  box-shadow: 0 0 12px 2px rgba(255, 255, 255, .55);
  animation: sb-comet 14s linear infinite;
}
@keyframes sb-twinkle { 0%, 100% { opacity: .95; } 50% { opacity: .55; } }
@keyframes sb-nebula {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(2.5%, -2%, 0) scale(1.08); }
}
@keyframes sb-drift {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(-10px, 12px, 0); }
}
@keyframes sb-comet {
  0%      { transform: translate3d(0, 0, 0) rotate(14deg); opacity: 0; }
  4%      { opacity: 1; }
  22%     { transform: translate3d(140vw, 34vh, 0) rotate(14deg); opacity: 0; }
  100%    { transform: translate3d(140vw, 34vh, 0); opacity: 0; }
}

/* ── Garden (Grade 3): the rainbow, the sun and the flower bed ────────────
 * All painted, no artwork to download. The rainbow is a set of concentric
 * bands from a circle centred below the page, so only its arc shows; the
 * flowers are soft blobs along the bottom edge, well clear of the text. */
[data-theme="garden"] body::before {
  background:
    linear-gradient(178deg, #bfe9ff 0%, #e6f7ff 46%, #f4fbff 74%, #eaf9e4 100%);
}
[data-theme="garden"] body::after {
  opacity: 1;
  background:
    /* sun, top right */
    radial-gradient(220px 220px at 88% 6%, rgba(255, 214, 84, .55), transparent 68%),
    /* The rainbow arc. The circle is centred well below the page and drawn
       large, so only the top of it shows — an arc across the upper half,
       behind the content rather than under the footer. */
    radial-gradient(circle 165vh at 50% 152%,
      transparent 0 60.5%,
      rgba(139, 92, 246, .34) 60.5% 63%,
      rgba(59, 130, 246, .34) 63% 65.5%,
      rgba(34, 197, 94, .32)  65.5% 68%,
      rgba(250, 204, 21, .36) 68% 70.5%,
      rgba(249, 115, 22, .34) 70.5% 73%,
      rgba(239, 68, 68, .32)  73% 75.5%,
      transparent 75.5% 100%),
    /* clouds */
    radial-gradient(120px 54px at 18% 12%, rgba(255,255,255,.9), transparent 70%),
    radial-gradient(90px 44px at 26% 16%, rgba(255,255,255,.8), transparent 70%),
    radial-gradient(140px 58px at 72% 20%, rgba(255,255,255,.72), transparent 70%),
    /* the flower bed along the foot of the page */
    radial-gradient(70px 42px at 6% 100%, rgba(34, 197, 94, .40), transparent 72%),
    radial-gradient(90px 50px at 22% 101%, rgba(22, 163, 74, .34), transparent 72%),
    radial-gradient(80px 46px at 44% 100%, rgba(74, 222, 128, .34), transparent 72%),
    radial-gradient(96px 52px at 68% 101%, rgba(34, 197, 94, .34), transparent 72%),
    radial-gradient(76px 44px at 92% 100%, rgba(22, 163, 74, .36), transparent 72%),
    radial-gradient(13px 13px at 12% 94%, rgba(239, 77, 122, .85), transparent 70%),
    radial-gradient(11px 11px at 31% 96%, rgba(250, 204, 21, .85), transparent 70%),
    radial-gradient(12px 12px at 52% 94%, rgba(139, 92, 246, .80), transparent 70%),
    radial-gradient(11px 11px at 76% 96%, rgba(249, 115, 22, .82), transparent 70%),
    radial-gradient(12px 12px at 88% 93%, rgba(43, 166, 224, .80), transparent 70%);
}
/* Petals drifting down. Slow and few — a garden, not a snowstorm. */
html[data-theme="garden"]::before {
  content: ''; position: fixed; inset: -20% 0 0 0; z-index: -1;
  pointer-events: none; opacity: .7;
  background-image:
    radial-gradient(6px 4px at 10% 10%, rgba(239, 77, 122, .8), transparent 70%),
    radial-gradient(5px 4px at 34% 26%, rgba(250, 204, 21, .75), transparent 70%),
    radial-gradient(6px 4px at 58% 8%, rgba(139, 92, 246, .7), transparent 70%),
    radial-gradient(5px 3px at 78% 30%, rgba(249, 115, 22, .75), transparent 70%),
    radial-gradient(6px 4px at 92% 14%, rgba(43, 166, 224, .7), transparent 70%);
  animation: sb-petals 18s linear infinite;
}
@keyframes sb-petals {
  from { transform: translate3d(0, -8vh, 0) rotate(0deg); }
  to   { transform: translate3d(-3vw, 108vh, 0) rotate(24deg); }
}

/* Phones: keep the rainbow and the sun, drop the fiddly flower detail. */
@media (max-width: 620px) {
  html[data-theme="garden"]::before { display: none; }
}

/* Nothing above should move for a child who has asked for stillness. */
@media (prefers-reduced-motion: reduce) {
  [data-theme="galaxy"] body::after,
  html[data-theme="galaxy"]::before,
  html[data-theme="galaxy"]::after,
  html[data-theme="garden"]::before { animation: none; }
  [data-theme="galaxy"] .site-header::after { display: none; }
}

img { max-width: 100%; display: block; }
/* color: inherit matters — a <button> does NOT inherit colour by default
   (the UA gives it near-black `buttontext`). The card tiles, menu items and
   letter keys are all buttons, so without this their text stays dark and
   vanishes on the Galaxy theme. */
button { font-family: inherit; cursor: pointer; border: none; background: none;
  color: inherit; }
a { color: inherit; text-decoration: none; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ── Header ─────────────────────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--header-bg);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid color-mix(in srgb, var(--ink) 8%, transparent);
}
.site-header .wrap {
  display: flex; align-items: center; gap: 16px;
  height: 72px;
}
.brand { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 22px; }
.brand img { width: 42px; height: 42px; border-radius: 12px; }
.nav { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.nav a, .nav button {
  padding: 9px 16px; border-radius: 20px; font-size: 15px; font-weight: 500;
  color: var(--ink); transition: background .15s;
}
.nav a:hover, .nav button:hover { background: color-mix(in srgb, var(--honey) 25%, transparent); }
.nav .cta {
  background: var(--honey); color: var(--on-honey); font-weight: 600;
  box-shadow: var(--shadow-sm);
}
.nav .cta:hover { background: var(--amber); }
.user-chip {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 14px 7px 8px; border-radius: 22px; background: var(--card);
  box-shadow: var(--shadow-sm); font-weight: 600; font-size: 15px;
}
.user-chip .av { font-size: 22px; }

/* ── Buttons ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 14px 26px; border-radius: 30px; font-size: 17px; font-weight: 600;
  color: var(--on-honey); background: var(--honey); box-shadow: var(--shadow-sm);
  transition: transform .08s, box-shadow .15s, background .15s;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn.leaf { background: var(--leaf); color: var(--on-leaf); }
.btn.sky { background: var(--sky); color: var(--on-sky); }
.btn.berry { background: var(--berry); color: var(--on-berry); }
.btn.ink { background: var(--ink); color: var(--on-ink); }
.btn.ghost { background: var(--card); color: var(--ink); border: 2px solid color-mix(in srgb, var(--ink) 12%, transparent); box-shadow: none; }
.btn.big { padding: 16px 34px; font-size: 19px; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }

/* ── Landing: hero ──────────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(160deg, var(--hero-1) 0%, var(--hero-2) 62%);
  padding: 70px 0 60px;
}
.hero .wrap { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; }
.hero h1 { font-size: 52px; line-height: 1.08; margin-bottom: 18px; }
.hero h1 .hl { color: var(--amber); }
.hero p.lead { font-size: 20px; color: color-mix(in srgb, var(--ink) 80%, transparent); margin-bottom: 28px; max-width: 34ch; }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-art {
  display: flex; align-items: center; justify-content: center;
}
.hero-art img { width: 320px; height: 320px; filter: drop-shadow(0 20px 40px color-mix(in srgb, var(--ink) 18%, transparent)); }

.stats-strip {
  display: flex; gap: 14px; flex-wrap: wrap; margin-top: 34px;
}
.stat-pill {
  background: var(--card); border-radius: 18px; padding: 14px 20px; box-shadow: var(--shadow-sm);
  min-width: 120px;
}
.stat-pill b { display: block; font-size: 26px; }
.stat-pill span { font-size: 13px; color: color-mix(in srgb, var(--ink) 60%, transparent); }

/* ── Sections ───────────────────────────────────────────────────────────── */
section.block { padding: 64px 0; }
section.block.alt { background: var(--card); }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 40px; }
.section-head .eyebrow {
  display: inline-block; font-size: 13px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--amber); margin-bottom: 10px;
}
.section-head h2 { font-size: 36px; margin-bottom: 12px; }
.section-head p { font-size: 17px; color: color-mix(in srgb, var(--ink) 72%, transparent); }

.prose { max-width: 760px; margin: 0 auto; }
.prose p { font-size: 17px; color: color-mix(in srgb, var(--ink) 82%, transparent); margin-bottom: 16px; }

/* Feature / practice cards */
.grid { display: grid; gap: 20px; }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }

.feature {
  background: var(--card); border-radius: var(--radius); padding: 26px;
  box-shadow: var(--shadow-sm); border: 1px solid color-mix(in srgb, var(--ink) 5%, transparent);
}
.feature .ico { font-size: 40px; margin-bottom: 12px; }
.feature h3 { font-size: 20px; margin-bottom: 8px; }
.feature p { font-size: 15px; color: color-mix(in srgb, var(--ink) 70%, transparent); }

/* ── Grade cards ────────────────────────────────────────────────────────── */
.grade-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 20px; }
.grade-card {
  position: relative; display: block; text-align: center;
  background: var(--card); border-radius: var(--radius); padding: 30px 20px;
  box-shadow: var(--shadow-sm); border: 2px solid transparent;
  transition: transform .12s, box-shadow .15s, border-color .15s;
}
.grade-card.live { cursor: pointer; }
.grade-card.live:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--honey); }
.grade-card .num { font-size: 44px; font-weight: 700; color: var(--amber); }
.grade-card .label { font-size: 17px; font-weight: 600; margin-top: 4px; }
.grade-card .sub { font-size: 13px; color: color-mix(in srgb, var(--ink) 55%, transparent); margin-top: 6px; }
.grade-card.soon { opacity: .6; }
.grade-card .badge {
  position: absolute; top: 12px; right: 12px; font-size: 11px; font-weight: 700;
  padding: 4px 10px; border-radius: 12px; background: color-mix(in srgb, var(--ink) 8%, transparent); color: color-mix(in srgb, var(--ink) 60%, transparent);
}
.grade-card.live .badge { background: color-mix(in srgb, var(--leaf) 18%, transparent); color: var(--leaf); }

/* ── Footer ─────────────────────────────────────────────────────────────── */
.site-footer { background: var(--footer-bg); color: #fff6e2; padding: 40px 0; margin-top: 40px; }
.site-footer .wrap { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.site-footer .brand { color: #fff6e2; }
.site-footer small { margin-left: auto; opacity: .7; }

/* ── Grade hub ──────────────────────────────────────────────────────────── */
.hub { display: grid; grid-template-columns: 260px 1fr; gap: 32px; padding: 32px 0 60px; align-items: start; }
.side {
  position: sticky; top: 96px;
  background: var(--card); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-sm);
}
.side .who { text-align: center; padding-bottom: 16px; border-bottom: 1px solid color-mix(in srgb, var(--ink) 8%, transparent); margin-bottom: 16px; }
.side .who .av { font-size: 54px; }
.side .who .nm { font-size: 20px; font-weight: 700; margin-top: 6px; }
.side .who .sub { font-size: 13px; color: color-mix(in srgb, var(--ink) 55%, transparent); }
.side .menu { list-style: none; }
.side .menu button {
  width: 100%; text-align: left; display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: 14px; font-size: 15px; font-weight: 500; color: var(--ink);
  transition: background .12s;
}
.side .menu button:hover, .side .menu button.active { background: color-mix(in srgb, var(--honey) 24%, transparent); }
.side .menu .ico { font-size: 20px; }
.side .mini-stats { display: flex; gap: 8px; margin-top: 16px; }
.side .mini-stats div { flex: 1; text-align: center; background: color-mix(in srgb, var(--honey) 14%, transparent); border-radius: 12px; padding: 10px 4px; }
.side .mini-stats b { display: block; font-size: 18px; }
.side .mini-stats span { font-size: 11px; color: color-mix(in srgb, var(--ink) 55%, transparent); }

.panel-title { font-size: 26px; margin-bottom: 6px; }
.panel-sub { font-size: 15px; color: color-mix(in srgb, var(--ink) 66%, transparent); margin-bottom: 22px; }

.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }
.cat {
  background: var(--card); border-radius: var(--radius); padding: 20px;
  box-shadow: var(--shadow-sm); border: 2px solid transparent; text-align: left;
  transition: transform .12s, box-shadow .15s, border-color .15s; cursor: pointer;
  display: flex; flex-direction: column; min-height: 150px;
}
.cat:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--c, var(--honey)); }
.cat .ico { font-size: 34px; margin-bottom: 8px; }
.cat h4 { font-size: 17px; margin-bottom: 4px; }
.cat p { font-size: 13px; color: color-mix(in srgb, var(--ink) 78%, transparent); flex: 1; }
.cat .meta { font-size: 12px; font-weight: 600; color: var(--c, var(--amber)); margin-top: 8px; }

.hero-cat {
  grid-column: 1 / -1;
  display: flex; align-items: center; gap: 20px; padding: 24px 28px;
  border-radius: var(--radius); color: #fff; box-shadow: var(--shadow); cursor: pointer;
  transition: transform .12s;
}
.hero-cat:hover { transform: translateY(-2px); }
.hero-cat .ico { font-size: 46px; }
.hero-cat h4 { font-size: 22px; color: #fff; }
.hero-cat p { font-size: 14px; color: color-mix(in srgb, var(--card) 90%, transparent); }
.hero-cat .arrow { margin-left: auto; font-size: 30px; }

/* ── Play screen ────────────────────────────────────────────────────────── */
/* Compact on purpose: the earlier layout wasted space at the top and pushed
 * the Next button below the fold. Tighter paddings keep the whole question,
 * options and Next on one screen. */
/* position: relative so the buddy can hang in the gutter beside it. */
.play-wrap { max-width: 760px; margin: 0 auto; padding: 12px 0 24px; position: relative; }
.play-bar { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.play-bar .back { font-size: 15px; font-weight: 600; color: var(--ink); padding: 8px 12px; border-radius: 14px; }
.play-bar .back:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); }
.progress-track { flex: 1; height: 10px; background: var(--card); border-radius: 8px; overflow: hidden; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 6%, transparent); }
.progress-fill { height: 100%; background: var(--honey); width: 0; transition: width .3s; }
.progress-label { font-size: 13px; color: color-mix(in srgb, var(--ink) 60%, transparent); white-space: nowrap; }

.qcard {
  background: var(--card); border-radius: 22px; padding: 18px 24px; box-shadow: var(--shadow);
  text-align: center; margin-bottom: 14px;
}
.qcard .subprompt { font-size: 17px; font-weight: 600; color: color-mix(in srgb, var(--ink) 85%, transparent); margin-bottom: 2px; }
.qcard .qemoji { font-size: 56px; margin: 4px 0; line-height: 1; }
.qcard .prompt { font-size: 28px; font-weight: 600; margin: 6px 0 2px; }
.qcard .prompt.long { font-size: 20px; }
.qcard .prompt.jumble { letter-spacing: 6px; }

.opts { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.opt {
  display: flex; align-items: center; gap: 14px; text-align: left;
  padding: 18px 20px; border-radius: 18px; background: var(--card); border: 2px solid var(--honey);
  box-shadow: var(--shadow-sm); font-size: 21px; font-weight: 500; color: var(--ink);
  transition: transform .1s, background .15s;
}
.opt:hover:not(:disabled) { transform: translateY(-2px); }
.opt .badge { width: 30px; height: 30px; flex: none; display: grid; place-items: center;
  border-radius: 50%; background: color-mix(in srgb, var(--honey) 26%, transparent); font-size: 15px; font-weight: 600; }
.opt.right { background: var(--leaf); color: var(--on-leaf); border-color: var(--leaf); }
.opt.wrong { background: var(--berry); color: var(--on-berry); border-color: var(--berry); }
.opt.dim { opacity: .45; }
.opt.right .badge, .opt.wrong .badge { background: color-mix(in srgb, var(--card) 25%, transparent); color: #fff; }

.explain { margin-top: 14px; padding: 14px 18px; border-radius: 18px; text-align: center; }
.explain.ok { background: color-mix(in srgb, var(--leaf) 14%, transparent); }
.explain.no { background: color-mix(in srgb, var(--berry) 14%, transparent); }
.explain h3 { font-size: 18px; margin-bottom: 4px; }
.explain.ok h3 { color: var(--leaf); }
.explain.no h3 { color: var(--berry); }
.explain p { font-size: 15px; color: color-mix(in srgb, var(--ink) 75%, transparent); }

/* ── Jungle friends ───────────────────────────────────────────────────────
 * Grade 1 only. The baby animal that sits beside the question and reacts to
 * the answer, the one that laughs on the score card, and the monkey that runs
 * across the foot of the screen between questions.
 *
 * All three are the same thing underneath: a <canvas> that buddies.js paints
 * a video into with the backdrop cut away. The canvas carries the animal's
 * own shape, so it takes a drop-shadow like any cut-out would — which is the
 * whole point of keying it rather than showing a boxed video.
 *
 * They are decoration: aria-hidden, never clickable, and losing them costs
 * the page nothing. */
.buddy-canvas {
  display: block; width: 100%; height: auto;
  pointer-events: none; user-select: none;
}

/* The buddy lives in the gutter beside the question, so it costs the question
 * card no width. Below 1100px there is no gutter left to put it in, and it is
 * dropped rather than allowed to overlap the options. */
.buddy {
  position: absolute; right: -196px; bottom: 0; width: 176px;
  pointer-events: none;
  filter: drop-shadow(0 12px 22px color-mix(in srgb, var(--ink) 26%, transparent));
}
@media (max-width: 1100px) { .buddy { display: none; } }

/* The animal that laughs on the score card. */
.result-buddy {
  width: 156px; margin: 0 auto 2px;
  filter: drop-shadow(0 10px 20px color-mix(in srgb, var(--ink) 24%, transparent));
}

/* The runner crosses the foot of the screen and leaves. Its travel is a Web
 * Animation set up in buddies.js, because where it starts depends on the
 * window width; what stays here is only what never varies. */
.buddy-runner {
  position: fixed; left: 0; bottom: 4vh; z-index: 60;
  width: 150px; pointer-events: none;
  filter: drop-shadow(0 10px 18px color-mix(in srgb, var(--ink) 22%, transparent));
}
@media (max-width: 620px) { .buddy-runner { width: 108px; } }

/* buddies.js already declines to start anything when motion is reduced; this
   is the belt to that pair of braces. */
@media (prefers-reduced-motion: reduce) {
  .buddy-runner { display: none; }
}

/* The Next / action bar sticks to the bottom of the screen, so it is always in
 * reach no matter how tall the question is. The fade keeps content from
 * showing through as it scrolls under. */
.action-bar {
  display: flex; gap: 14px; justify-content: center; align-items: center;
  position: sticky; bottom: 0; z-index: 5; margin-top: 14px; padding: 14px 0 10px;
  background: linear-gradient(transparent, var(--page-2) 45%);
}

/* Round controls (speaker buttons) */
.round-controls { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; margin: 10px 0 2px; }
.circle-btn { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 96px; }
.circle-btn .circle {
  width: 64px; height: 64px; border-radius: 50%; background: var(--card); display: grid; place-items: center;
  border: 3px solid var(--c, var(--amber)); box-shadow: var(--shadow-sm); font-size: 26px;
  transition: transform .1s, background .15s;
}
.circle-btn:hover .circle { transform: translateY(-2px); }
.circle-btn.active .circle { background: var(--c, var(--amber)); color: var(--card); }
.circle-btn .lbl { font-size: 12.5px; color: color-mix(in srgb, var(--ink) 72%, transparent); text-align: center; }
.circle-btn.pulse .circle { animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.08); } }

/* Answer boxes + on-screen keyboard */
.answer-strip { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin: 8px 0; }
.abox {
  width: 44px; height: 54px; border-radius: 12px; background: var(--card); border: 2px solid color-mix(in srgb, var(--ink) 15%, transparent);
  display: grid; place-items: center; font-size: 26px; font-weight: 600;
}
.abox.filled { background: color-mix(in srgb, var(--honey) 20%, transparent); border-color: var(--amber); }
.abox.extra { border-color: var(--berry); }
.abox.right { background: var(--leaf); border-color: var(--leaf); color: var(--on-leaf); }
.abox.wrong { background: var(--berry); border-color: var(--berry); color: var(--on-berry); }
.abox.lit { background: var(--honey); border-color: var(--amber); color: var(--on-honey); }

.keyboard { display: flex; flex-direction: column; gap: 7px; align-items: center; margin-top: 10px; }
.krow { display: flex; gap: 7px; }
.key {
  width: 46px; height: 48px; border-radius: 11px; background: var(--card); border: 1.6px solid color-mix(in srgb, var(--honey) 70%, transparent);
  font-size: 19px; font-weight: 600; color: var(--ink); box-shadow: var(--shadow-sm);
  transition: transform .06s, background .12s;
}
.key:hover { transform: translateY(-1px); background: #fffdf5; }
.heard { font-size: 13px; color: color-mix(in srgb, var(--ink) 70%, transparent); background: rgba(76,201,240,.12); padding: 7px 12px; border-radius: 14px; display: inline-block; margin-top: 10px; }

/* mic panel */
.mic-panel { border: 2px solid color-mix(in srgb, var(--honey) 60%, transparent); border-radius: 22px; padding: 20px; margin: 16px 0; text-align: center; }
.mic-panel.rec { border-color: var(--berry); background: rgba(229,72,77,.06); }
.mic-panel.listen { border-color: var(--sky); background: rgba(76,201,240,.08); }

/* ── Report ─────────────────────────────────────────────────────────────── */
.report-hero { background: var(--card); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow-sm); text-align: center; border: 2px solid; }
.report-hero .big { font-size: 52px; font-weight: 700; }
.report-hero .small { font-size: 20px; color: color-mix(in srgb, var(--ink) 70%, transparent); }
.report-bar { height: 12px; border-radius: 8px; overflow: hidden; margin: 12px 0 8px; background: color-mix(in srgb, var(--ink) 8%, transparent); }
.report-bar > span { display: block; height: 100%; }

.overall-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin: 20px 0; }
.overall-grid .cell { background: var(--card); border-radius: 16px; padding: 14px 6px; text-align: center; box-shadow: var(--shadow-sm); }
.overall-grid .cell .em { font-size: 20px; }
.overall-grid .cell b { display: block; font-size: 18px; }
.overall-grid .cell span { font-size: 11px; color: color-mix(in srgb, var(--ink) 55%, transparent); }

.round-row {
  display: flex; align-items: center; gap: 14px; background: var(--card); border-radius: 16px;
  padding: 14px 16px; box-shadow: var(--shadow-sm); margin-bottom: 10px; text-align: left; width: 100%;
}
.round-row.clickable { cursor: pointer; transition: transform .1s; }
.round-row.clickable:hover { transform: translateX(3px); }
.round-row .stripe { width: 8px; height: 36px; border-radius: 4px; }
.round-row .info { flex: 1; }
.round-row .info b { font-size: 15px; }
.round-row .info span { display: block; font-size: 12px; color: color-mix(in srgb, var(--ink) 55%, transparent); }
.round-row .score { font-size: 18px; font-weight: 700; }

.mode-row { background: var(--card); border-radius:16px; padding:14px 16px; box-shadow:var(--shadow-sm); margin-bottom:10px; }
.mode-row .top { display:flex; align-items:center; gap:10px; }
.mode-row .top b { flex:1; font-size:16px; }
.mode-row .pill { padding:4px 10px; border-radius:12px; font-size:14px; font-weight:700; }
.mode-row .track { height:7px; border-radius:6px; background:color-mix(in srgb, var(--ink) 10%, transparent); overflow:hidden; margin:8px 0 6px; }
.mode-row .track > span { display:block; height:100%; }
.mode-row .sub { font-size:12px; color:color-mix(in srgb, var(--ink) 55%, transparent); }

/* Review rows */
.rev-row { background: var(--card); border-radius:18px; padding:14px 16px; box-shadow:var(--shadow-sm); border:2px solid; margin-bottom:9px; cursor:pointer; }
.rev-row .head { display:flex; align-items:center; gap:11px; }
.rev-row .n { width:28px; height:28px; border-radius:50%; display:grid; place-items:center; font-size:12.5px; font-weight:700; flex:none; }
.rev-row .q { flex:1; }
.rev-row .q b { font-size:15px; }
.rev-row .q span { display:block; font-size:11.5px; color:color-mix(in srgb, var(--ink) 50%, transparent); }
.rev-row .mark { font-size:22px; }
.rev-body { margin-top:10px; padding-top:10px; border-top:1px solid color-mix(in srgb, var(--ink) 8%, transparent); }
.rev-line { display:flex; gap:10px; margin-bottom:5px; font-size:15px; }
.rev-line .k { width:70px; color:color-mix(in srgb, var(--ink) 55%, transparent); font-size:12.5px; }
.rev-line b { font-weight:600; }
.filter-chips { display:flex; gap:9px; margin:14px 0; flex-wrap:wrap; }
.chip { padding:8px 14px; border-radius:18px; background: var(--card); border:1.8px solid; font-size:13.5px; font-weight:600; }

.cat-tally { background: var(--card); border-radius:18px; padding:16px 18px; box-shadow:var(--shadow-sm); margin-bottom:16px; }
.cat-tally h4 { font-size:15px; margin-bottom:12px; }
.cat-tally .row { display:flex; align-items:center; gap:10px; margin-bottom:9px; }
.cat-tally .row .nm { flex:1; font-size:13.5px; }
.cat-tally .row .tr { width:90px; height:7px; border-radius:5px; background:color-mix(in srgb, var(--ink) 8%, transparent); overflow:hidden; }
.cat-tally .row .tr > span { display:block; height:100%; }
.cat-tally .row .sc { width:44px; text-align:right; font-size:13px; font-weight:700; }

/* ── Modal (profile / result) ───────────────────────────────────────────── */
.modal-back {
  position: fixed; inset: 0; background: var(--overlay); z-index: 100;
  display: grid; place-items: center; padding: 20px; opacity: 0; pointer-events: none;
  transition: opacity .18s;
}
.modal-back.show { opacity: 1; pointer-events: auto; }
.modal {
  background: var(--card); border-radius: 28px; padding: 30px; max-width: 460px; width: 100%;
  box-shadow: var(--shadow); max-height: 88vh; overflow-y: auto; text-align: center;
  transform: translateY(12px); transition: transform .18s;
}
.modal-back.show .modal { transform: none; }
.modal h2 { font-size: 24px; margin-bottom: 8px; }
.modal p.sub { color: color-mix(in srgb, var(--ink) 66%, transparent); margin-bottom: 18px; }
.field { width: 100%; padding: 14px 16px; border-radius: 16px; border: none; background: var(--card);
  font-family: inherit; font-size: 18px; font-weight: 600; text-align: center; color: var(--ink);
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--ink) 6%, transparent); }
.field:focus { outline: 2px solid var(--honey); }
.avatars { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 18px 0; }
.avatars button { width: 54px; height: 54px; border-radius: 15px; background: var(--card); font-size: 27px;
  border: 2.5px solid color-mix(in srgb, var(--ink) 10%, transparent); transition: transform .1s; }
.avatars button.sel { background: color-mix(in srgb, var(--honey) 32%, transparent); border-color: var(--amber); }
.avatars button:hover { transform: translateY(-2px); }
.modal-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 16px; }

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: #fff; padding: 12px 22px; border-radius: 24px; font-size: 15px;
  box-shadow: var(--shadow); z-index: 200; opacity: 0; pointer-events: none; transition: .2s;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.hidden { display: none !important; }

/* ── Confetti ───────────────────────────────────────────────────────────── */
.confetti { position: fixed; top: -10px; width: 10px; height: 14px; z-index: 90; pointer-events: none; border-radius: 2px; }

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 960px) {
  .hero .wrap { grid-template-columns: 1fr; text-align: center; }
  .hero p.lead { margin-left: auto; margin-right: auto; }
  .hero-cta, .stats-strip { justify-content: center; }
  .hero-art { order: -1; }
  .hero-art img { width: 220px; height: 220px; }
  .hero h1 { font-size: 40px; }
  .grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
  .grid.cols-3 { grid-template-columns: repeat(2, 1fr); }
  .hub { grid-template-columns: 1fr; }
  .side { position: static; }
  .overall-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 620px) {
  .wrap { padding: 0 16px; }
  .hero h1 { font-size: 32px; }
  .grid.cols-4, .grid.cols-3, .grid.cols-2 { grid-template-columns: 1fr; }
  .opts { grid-template-columns: 1fr; }
  .nav a, .nav button { padding: 8px 12px; font-size: 14px; }
  .nav .hide-sm { display: none; }
  .overall-grid { grid-template-columns: repeat(2, 1fr); }
  .section-head h2 { font-size: 28px; }
  /* Ten fixed-width keys plus their gaps are wider than a phone, so the top
     row was running off both edges. Let the keys share the width instead —
     they still cap at their desktop size on a wide phone. */
  .keyboard { width: 100%; }
  .krow { gap: 5px; width: 100%; }
  .key {
    width: auto; flex: 1 1 0; min-width: 0; max-width: 40px;
    height: 46px; font-size: 16px; padding: 0;
  }
  .key.wide { flex: 0 0 auto; width: auto; max-width: none; padding: 0 16px; font-size: 15px; }
}

/* ── Logo-led hero ────────────────────────────────────────────────────────
 * The chosen world's artwork is the hero image, so the page and the logo
 * always belong to each other. */
.hero-art .theme-logo {
  width: min(400px, 78vw); height: auto; border-radius: 24px;
  filter: drop-shadow(0 18px 44px color-mix(in srgb, var(--ink) 30%, transparent));
  animation: floaty 6s ease-in-out infinite;
}
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@media (prefers-reduced-motion: reduce) { .hero-art .theme-logo { animation: none; } }

/* Each grade card previews its world. */
.grade-card .world {
  width: 72px; height: 72px; margin: 0 auto 6px; border-radius: 16px;
  filter: drop-shadow(0 6px 14px color-mix(in srgb, var(--ink) 22%, transparent));
}
.grade-card .world-name {
  margin-top: 6px; font-size: 12px; font-weight: 700; letter-spacing: .02em;
  color: var(--amber);
}

/* The brand mark in the header follows the theme too. */
.brand .mark {
  width: 44px; height: 44px; border-radius: 12px; background-size: cover;
  background-position: center; background-image: var(--logo-sm);
  box-shadow: var(--shadow-sm);
}
[data-theme="galaxy"] .brand .mark { background-color: #0a0a2b; }

/* Section headings get a themed rule under them. */
.section-head h2::after {
  content: ''; display: block; width: 76px; height: 5px; margin: 12px auto 0;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--honey), var(--leaf));
}

/* Cards lift a little more on the dark theme so they read as raised. */
[data-theme="galaxy"] .feature,
[data-theme="galaxy"] .grade-card,
[data-theme="galaxy"] .cat,
[data-theme="galaxy"] .qcard,
[data-theme="galaxy"] .side,
[data-theme="galaxy"] .opt {
  border: 1px solid color-mix(in srgb, var(--ink) 14%, transparent);
}
[data-theme="galaxy"] .site-header { border-bottom-color: color-mix(in srgb, var(--ink) 16%, transparent); }

/* Settings row inside the profile modal. */
.opt-row {
  display: flex; align-items: center; gap: 10px; justify-content: center;
  margin: 4px 0 14px; font-size: 14.5px; cursor: pointer;
  color: color-mix(in srgb, var(--ink) 80%, transparent);
}
.opt-row input { width: 20px; height: 20px; accent-color: var(--leaf); cursor: pointer; }

/* ── Level Quest ──────────────────────────────────────────────────────────
 * The ladder screen and the timed word challenge behind it. Everything reads
 * the theme variables, so the quest is a rainbow garden on Grade 3 and would
 * be a night sky on any later grade that grows a ladder of its own. */
.play-wrap.wide { max-width: 860px; }

.lv-summary { display: flex; gap: 12px; margin: 0 0 20px; }
.lv-summary div {
  flex: 1; text-align: center; background: var(--card); border-radius: 16px;
  padding: 12px 8px; box-shadow: var(--shadow-sm);
}
.lv-summary b { display: block; font-size: 22px; }
.lv-summary span { font-size: 12px; color: color-mix(in srgb, var(--ink) 58%, transparent); }

.lv-list { display: grid; gap: 12px; }
.lv-card {
  display: flex; align-items: center; gap: 16px; width: 100%; text-align: left;
  background: var(--card); border-radius: 20px; padding: 14px 18px;
  box-shadow: var(--shadow-sm); border: 2px solid transparent;
  transition: transform .12s, border-color .12s, box-shadow .12s;
}
.lv-card:hover:not(:disabled) {
  transform: translateX(4px); border-color: var(--honey); box-shadow: var(--shadow);
}
.lv-card:disabled { opacity: .5; cursor: not-allowed; }
.lv-card .lv-num {
  width: 52px; height: 52px; flex: none; border-radius: 16px; display: grid;
  place-items: center; font-size: 23px; font-weight: 700;
  background: color-mix(in srgb, var(--honey) 26%, transparent); color: var(--ink);
}
.lv-card.champ .lv-num {
  background: linear-gradient(135deg, var(--honey), var(--amber)); color: var(--on-honey);
}
.lv-card .lv-body { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.lv-card .lv-body b { font-size: 17px; }
.lv-card .lv-diff { font-size: 12.5px; color: color-mix(in srgb, var(--ink) 58%, transparent); }
.lv-card .lv-stars { font-size: 15px; letter-spacing: 2px; margin-top: 2px; }
.lv-card .lv-stars i { font-style: normal; color: color-mix(in srgb, var(--ink) 20%, transparent); }
.lv-card .lv-stars i.on { color: var(--honey); }
.lv-card .lv-side { flex: none; }
.lv-card .lv-go { font-weight: 700; color: var(--amber); font-size: 15px; }
.lv-card .lv-best { font-weight: 700; font-size: 17px; color: var(--leaf); }
.lv-card .lv-lock { font-size: 20px; }

/* The strip above a word: which rung, and the running score. */
.lv-strip { display: flex; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.lv-pill {
  padding: 6px 14px; border-radius: 16px; font-size: 13px; font-weight: 700;
  background: color-mix(in srgb, var(--honey) 22%, transparent); color: var(--ink);
}
.lv-pill.score { background: color-mix(in srgb, var(--leaf) 18%, transparent); color: var(--leaf); }

/* The clock. It turns amber with ten seconds left and red with five, so the
 * pressure is visible before it is a surprise. */
.clock { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.clock-track {
  flex: 1; height: 12px; border-radius: 8px; overflow: hidden; background: var(--card);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 8%, transparent);
}
.clock-fill { height: 100%; background: var(--leaf); transition: width 1s linear; }
.clock-fill.warn { background: var(--amber); }
.clock-fill.low { background: var(--berry); animation: sb-clock-pulse .8s ease-in-out infinite; }
.clock-label {
  font-size: 14px; font-weight: 700; min-width: 42px; text-align: right;
  color: color-mix(in srgb, var(--ink) 70%, transparent);
}
.clock.stopped .clock-fill { animation: none; opacity: .35; }
@keyframes sb-clock-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .5; } }

.lv-card-q .qemoji.big { font-size: 76px; }
.lv-sentence {
  font-size: 18px; font-weight: 500; margin: 6px auto 2px; max-width: 46ch;
  color: color-mix(in srgb, var(--ink) 82%, transparent);
}

/* A letter the child was given, rather than one they worked out. */
.abox.given {
  background: color-mix(in srgb, var(--sky) 16%, transparent);
  border-color: color-mix(in srgb, var(--sky) 55%, transparent);
}

.key.wide { width: auto; padding: 0 16px; font-size: 15px; }
.key.go { background: var(--leaf); color: var(--on-leaf); }

.lv-result-stars { font-size: 42px; letter-spacing: 6px; }
.lv-result-stars i { font-style: normal; color: color-mix(in srgb, var(--ink) 18%, transparent); }
.lv-result-stars i.on { color: var(--honey); }
.lv-result-score { font-size: 46px; font-weight: 700; margin: 6px 0; }

@media (max-width: 620px) {
  .lv-card { padding: 12px 14px; gap: 12px; }
  .lv-card .lv-num { width: 44px; height: 44px; font-size: 19px; }
  .lv-summary b { font-size: 18px; }
  .lv-card-q .qemoji.big { font-size: 58px; }
}

/* Galaxy: the same lift the other cards get, so the quest belongs to the
   night sky too. */
[data-theme="galaxy"] .lv-card,
[data-theme="galaxy"] .lv-summary div,
[data-theme="galaxy"] .clock-track {
  border: 1px solid color-mix(in srgb, var(--ink) 14%, transparent);
}
