/* =====================================================================
   Aurora Arctic: the foundation (owned by the foundation pass only).

   Loaded after /style.css and before the screen groups' own sheets:
     /style.css            tokens (old names + --au-*) and every old rule
     /aurora/base.css      this file: the sky and the shared pieces
     /aurora/<group>.css   one per screen group, overriding what it owns

   The source of truth is the phone app (linguino-mobile/mobile/src/lib/
   theme.ts and components/Aurora.tsx). The rules of the look:
   - one orange 3D primary per screen (.btn.brand);
   - no 1px borders on surfaces: depth is an inset top highlight plus a soft
     drop shadow (--au-shadow);
   - unit, game and language hues only as soft glows (.au-glow with --hue)
     or 8px glowing dots (.au-dot), never as flat fills or borders;
   - Outfit for titles and numerals, Plus Jakarta Sans for everything else;
   - night is the default; the day ("polar day") only when picked.

   New pieces are prefixed .au-; the old shared classes (.btn, .card, .input,
   .pill, .seg, .tabs, .list-item, .modal, .toast, .topbar, .theme-toggle) are
   restyled here in place, so every screen changes at once.
   ===================================================================== */

:root {
  /* The night's stars: two seeded tiles repeated across the top (different
     widths, so the pattern never lines up) and four sparkles at the right edge. */
  --au-stars-a: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='420' height='360' fill='%23eaf4ff'%3E%3Ccircle cx='54.7' cy='113.6' r='1.3' fill-opacity='0.40'/%3E%3Ccircle cx='268' cy='60.1' r='0.9' fill-opacity='0.30'/%3E%3Ccircle cx='405.3' cy='143.6' r='0.4' fill-opacity='0.31'/%3E%3Ccircle cx='24.2' cy='238.3' r='1.1' fill-opacity='0.41'/%3E%3Ccircle cx='299.8' cy='233' r='0.9' fill-opacity='0.37'/%3E%3Ccircle cx='70.8' cy='338.7' r='1' fill-opacity='0.14'/%3E%3Ccircle cx='388.9' cy='58.8' r='0.5' fill-opacity='0.45'/%3E%3Ccircle cx='187.4' cy='150.9' r='0.7' fill-opacity='0.57'/%3E%3Ccircle cx='138.9' cy='122.4' r='0.5' fill-opacity='0.62'/%3E%3Ccircle cx='193.3' cy='43.9' r='0.9' fill-opacity='0.65'/%3E%3Ccircle cx='405.7' cy='110.3' r='0.7' fill-opacity='0.50'/%3E%3Ccircle cx='212.7' cy='307.4' r='0.8' fill-opacity='0.33'/%3E%3Ccircle cx='234.6' cy='317.8' r='0.7' fill-opacity='0.15'/%3E%3Ccircle cx='384.6' cy='296.2' r='1' fill-opacity='0.27'/%3E%3Ccircle cx='139.2' cy='140.1' r='0.5' fill-opacity='0.54'/%3E%3Ccircle cx='286.6' cy='329.5' r='0.9' fill-opacity='0.18'/%3E%3Ccircle cx='11.2' cy='166.8' r='1' fill-opacity='0.48'/%3E%3Ccircle cx='238.4' cy='4' r='1.1' fill-opacity='0.73'/%3E%3C/svg%3E");
  --au-stars-b: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='610' height='300' fill='%23eaf4ff'%3E%3Ccircle cx='500.6' cy='78.3' r='0.5' fill-opacity='0.64'/%3E%3Ccircle cx='467.3' cy='69.9' r='1' fill-opacity='0.35'/%3E%3Ccircle cx='191' cy='20.5' r='1' fill-opacity='0.51'/%3E%3Ccircle cx='488.7' cy='204' r='1.3' fill-opacity='0.28'/%3E%3Ccircle cx='280.7' cy='250.3' r='1.3' fill-opacity='0.25'/%3E%3Ccircle cx='8.7' cy='204.9' r='0.9' fill-opacity='0.29'/%3E%3Ccircle cx='430.3' cy='88.6' r='1.2' fill-opacity='0.64'/%3E%3Ccircle cx='439.9' cy='183.3' r='1' fill-opacity='0.25'/%3E%3Ccircle cx='180.2' cy='134.5' r='0.6' fill-opacity='0.42'/%3E%3Ccircle cx='503.4' cy='10.1' r='1.1' fill-opacity='0.60'/%3E%3Ccircle cx='357.5' cy='101.7' r='1.1' fill-opacity='0.44'/%3E%3Ccircle cx='393.7' cy='53.9' r='0.5' fill-opacity='0.39'/%3E%3C/svg%3E");
  --au-sparks: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='300' fill='%23eaf4ff'%3E%3Cpath d='M9.4 34.5L10.2 37.7L13.4 38.5L10.2 39.3L9.4 42.5L8.6 39.3L5.4 38.5L8.6 37.7Z' fill-opacity='.6'/%3E%3Cpath d='M10.7 82.6L11.5 85.8L14.7 86.6L11.5 87.4L10.7 90.6L9.9 87.4L6.7 86.6L9.9 85.8Z' fill-opacity='.6'/%3E%3Cpath d='M8.9 158.3L9.7 161.5L12.9 162.3L9.7 163.1L8.9 166.3L8.1 163.1L4.9 162.3L8.1 161.5Z' fill-opacity='.6'/%3E%3Cpath d='M8 222.2L8.8 225.4L12 226.2L8.8 227L8 230.2L7.2 227L4 226.2L7.2 225.4Z' fill-opacity='.6'/%3E%3C/svg%3E");
}

/* ---------- the sky ---------- */

/* The body's background paints the whole canvas (html has none): the sky
   gradient and two or three soft aurora blobs, fixed while the page scrolls. */
/* A tap on a phone paints no square of the system's colour over what was
   touched (Android Chrome's default); pressed states draw their own. */
html { -webkit-tap-highlight-color: transparent; }
/* Glows and pictures that reach past a card's edge (the path's unit art, the
   guide penguin) never make the page wider than the phone: a few pixels of
   that and every screen slid sideways under the thumb. clip, not hidden, so
   nothing becomes a scroller and sticky bars keep sticking. */
html, body { overflow-x: clip; }

body {
  background-image:
    radial-gradient(70% 42% at 16% 3%, rgb(var(--au-blob-teal) / calc(0.30 * var(--au-blob-o))), rgb(var(--au-blob-teal) / calc(0.12 * var(--au-blob-o))) 45%, transparent 75%),
    radial-gradient(62% 44% at 92% 12%, rgb(var(--au-blob-violet) / calc(0.30 * var(--au-blob-o))), rgb(var(--au-blob-violet) / calc(0.12 * var(--au-blob-o))) 45%, transparent 75%),
    radial-gradient(48% 30% at var(--au-blob3-at, 46% 28%), rgb(var(--au-blob-blue) / calc(0.17 * var(--au-blob-o))), transparent 72%),
    var(--au-sky);
  background-repeat: no-repeat;
  background-attachment: fixed;
  font-size: var(--au-fs-body);
}
:root[data-theme="light"] { --au-blob3-at: 45% 88%; }

/* The stars: night only, in the top of the sky, thinning as they come down
   and dimmed to pinpricks over the content column, so they sit over the
   header and the margins rather than under the cards. Behind everything
   (z-index -1 in the root stacking context, above the canvas sky). */
body::before {
  content: '';
  position: fixed; left: 0; right: 0; top: 0; height: 52vh; z-index: -1;
  pointer-events: none;
  background-image: var(--au-sparks), var(--au-stars-a), var(--au-stars-b);
  background-repeat: no-repeat, repeat-x, repeat-x;
  background-position: right 2px top 18px, 0 0, 170px 26px;
  -webkit-mask-image:
    linear-gradient(180deg, #000 0, #000 35%, transparent 100%),
    linear-gradient(90deg, #000 0, #000 calc(50% - 600px), rgb(0 0 0 / 0.38) calc(50% - 540px), rgb(0 0 0 / 0.38) calc(50% + 540px), #000 calc(50% + 600px));
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(180deg, #000 0, #000 35%, transparent 100%),
    linear-gradient(90deg, #000 0, #000 calc(50% - 600px), rgb(0 0 0 / 0.38) calc(50% - 540px), rgb(0 0 0 / 0.38) calc(50% + 540px), #000 calc(50% + 600px));
  mask-composite: intersect;
}
:root[data-theme="light"] body::before { display: none; }

/* One focus ring for everything: teal. */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible { outline: 2px solid var(--au-teal); outline-offset: 2px; }
::selection { background: rgb(var(--violet-rgb) / 0.4); }
::-webkit-scrollbar-thumb { background: rgb(var(--fg) / 0.16); }

/* ---------- type ---------- */

body { font-family: var(--font); font-weight: 500; }
b, strong { font-weight: 700; }
.au-numeral { font: 700 var(--au-fs-numeral)/0.95 var(--display); letter-spacing: -0.04em; }
.au-welcome { font: 700 var(--au-fs-welcome)/1.05 var(--display); letter-spacing: -0.02em; }
.au-title { font: 700 var(--au-fs-screen)/1.05 var(--display); letter-spacing: -0.025em; }
.au-hero-title { font: 700 var(--au-fs-hero)/1.1 var(--display); letter-spacing: -0.02em; }
.au-hero-sm { font: 700 var(--au-fs-hero-sm)/1.08 var(--display); letter-spacing: -0.02em; }
.au-section { font: 600 var(--au-fs-section)/1.2 var(--display); letter-spacing: -0.01em; }
.au-card-title { font: 600 var(--au-fs-card)/1.2 var(--display); letter-spacing: -0.01em; }
.au-stat-n { font: 600 var(--au-fs-stat)/1.1 var(--display); letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.au-body-sm { font-size: var(--au-fs-body-sm); line-height: 1.4; }
.au-meta { font-size: var(--au-fs-meta); font-weight: 600; line-height: 1.3; color: var(--muted); }
.au-label { font-size: var(--au-fs-label); font-weight: 700; line-height: 1.25; }
.au-eyebrow { font-size: 11px; font-weight: 700; line-height: 14px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--au-teal); }
/* "Linguino" in the Welcome title: white to mint to lavender. */
.au-grad-text { background: linear-gradient(100deg, #ffffff 10%, #b6fff0 55%, #c9bcff 95%); -webkit-background-clip: text; background-clip: text; color: transparent; }
:root[data-theme="light"] .au-grad-text:not(.au-hero *) { background-image: linear-gradient(100deg, #0d2140 10%, #0fb39b 60%, #6b56f0 95%); }
/* A section title with a quiet note or link on the right ("Games" · "12 games"). */
.au-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 0 2px; }
.au-section-head > :first-child { font: 600 var(--au-fs-section)/1.2 var(--display); letter-spacing: -0.01em; margin: 0; }
.au-section-head > :last-child:not(:first-child) { font-size: 12px; font-weight: 600; color: var(--muted); }

/* ---------- layout ---------- */

/* A page column: the phone's 16px gutter, and on a desktop a centred column
   that uses the width (pair it with .au-grid / .au-split), never a stretched phone. */
.au-page { width: 100%; max-width: 1180px; margin: 0 auto; padding: 24px var(--au-gutter) 40px; display: grid; gap: 18px; align-content: start; }
.au-page.narrow { max-width: 720px; }
@media (max-width: 480px) { .au-page { padding-top: 16px; gap: 16px; } }
.au-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(var(--min, 150px), 1fr)); }
/* Main column and a side column on a desktop; one column below 1024. */
.au-split { display: grid; gap: 18px; align-items: start; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1024px) { .au-split { grid-template-columns: minmax(0, 1fr) var(--side, 360px); gap: 24px; } }
.au-stack { display: grid; gap: 14px; align-content: start; }

/* ---------- glass ---------- */

/* The default surface: a white-alpha gradient over a solid night base (so
   the stars never show through), an inset highlight on top, no border, a
   soft drop shadow. The 1px border stays transparent so a rule that marks
   a card as selected with border-color still shows. */
.card, .au-glass {
  background-color: var(--au-glass-base);
  background-image: var(--au-glass);
  border: 1px solid transparent;
  border-radius: var(--au-r-card);
  box-shadow: var(--au-shadow);
}
.card { padding: 18px; }
.au-glass.flat { background-image: linear-gradient(var(--au-glass-flat) 0 0); }
.card h3 { font: 600 var(--au-fs-card)/1.2 var(--display); letter-spacing: -0.01em; }
/* A unit / game / language hue as a soft glow in the top-right corner:
   style="--hue: #3ee6c8". Warm hues glow at half strength (they go muddy). */
.au-glow { background-image: radial-gradient(var(--glow-size, 130px) var(--glow-size, 130px) at calc(100% - 8px) 0, color-mix(in srgb, var(--hue, var(--au-teal)) calc(var(--glow-o, 42) * 1%), transparent), transparent 72%), var(--au-glass); }
.au-glow.warm { --glow-o: 20; }
:root[data-theme="light"] .au-glow { --glow-o: 32; }
:root[data-theme="light"] .au-glow.warm { --glow-o: 22; }
/* The 8px glowing hue dot (a game tile, "you are here"). */
.au-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--hue, var(--au-teal)); box-shadow: 0 0 10px 2px color-mix(in srgb, var(--hue, var(--au-teal)) 60%, transparent); }

/* The hero card: one per screen, the focal point. Radius 30, a deep gradient,
   two aurora glows, a brighter top highlight. Always a dark island, in the
   day theme too (style.css re-inks everything inside it). */
.au-hero, .au-night { color: var(--ink); }
.au-hero {
  position: relative; isolation: isolate; overflow: hidden;
  border-radius: var(--au-r-hero); padding: 20px;
  background:
    radial-gradient(320px 260px at calc(100% + 40px) -30px, color-mix(in srgb, var(--hue, #3ee6c8) 40%, transparent), transparent 70%),
    radial-gradient(260px 220px at -40px calc(100% + 30px), color-mix(in srgb, var(--hue2, #9a83ff) 30%, transparent), transparent 70%),
    var(--au-hero-navy);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), inset 0 0 0 1px rgba(255, 255, 255, 0.04), 0 22px 44px -20px rgba(0, 0, 0, 0.65);
}
.au-hero.violet {
  --hue: #9a83ff; --hue2: #3ee6c8;
  background:
    radial-gradient(320px 260px at calc(100% + 40px) -30px, color-mix(in srgb, var(--hue) 40%, transparent), transparent 70%),
    radial-gradient(260px 220px at -40px -40px, color-mix(in srgb, var(--hue2) 30%, transparent), transparent 70%),
    var(--au-hero-violet);
}
.au-hero.deck {
  background: radial-gradient(320px 260px at calc(100% + 40px) -30px, color-mix(in srgb, var(--hue, #3ee6c8) 55%, transparent), transparent 70%), var(--au-hero-deck);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 22px 44px -20px rgba(91, 71, 232, 0.6);
}
:root[data-theme="light"] .au-hero { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 16px 34px -18px rgba(30, 70, 130, 0.45); }

/* A game or practice tile: glass, the hue's glow top-right, a picture there,
   a dot or chip top-left, the title and a count pinned to the bottom. */
.au-tile {
  position: relative; display: grid; align-content: end; gap: 4px; min-height: 98px; padding: 12px 12px 11px;
  border: 0; border-radius: var(--au-r-tile); color: var(--ink); text-align: left; cursor: pointer;
  background-color: var(--au-glass-base);
  background-image: radial-gradient(110px 110px at calc(100% - 6px) 0, color-mix(in srgb, var(--hue, var(--au-teal)) 42%, transparent), transparent 72%), var(--au-glass);
  box-shadow: var(--au-shadow);
  transition: transform var(--dur-1) var(--ease-out), filter var(--dur-2);
}
.au-tile > .au-dot { position: absolute; top: 13px; left: 13px; }
.au-tile .au-tile-pic { position: absolute; top: 8px; right: 8px; width: 46px; height: 46px; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.25)); }
.au-tile .au-tile-t { font: 600 var(--au-fs-tile)/1.12 var(--display); letter-spacing: -0.01em; }
.au-tile .au-tile-n { font-size: 12px; font-weight: 600; color: var(--muted); display: inline-flex; align-items: center; gap: 4px; }
@media (hover: hover) and (pointer: fine) { .au-tile:hover { filter: brightness(1.08); transform: translateY(-1px); } }
.au-tile:active { transform: scale(0.985); }
:root[data-theme="light"] .au-tile { background-image: radial-gradient(110px 110px at calc(100% - 6px) 0, color-mix(in srgb, var(--hue, var(--au-teal)) 32%, transparent), transparent 72%), var(--au-glass); }

/* ---------- buttons ---------- */

/* Every .btn is the glass secondary button unless it says otherwise. */
.btn {
  border: 0; border-radius: var(--au-r-small);
  padding: 10px 16px;
  font-family: var(--font); font-weight: 700; font-size: 14.5px; line-height: 1.2;
  color: var(--ink);
  background-color: var(--au-glass-base);
  background-image: var(--au-glass);
  box-shadow: inset 0 1px 0 var(--au-highlight), inset 0 0 0 1px var(--line-hi);
  transition: transform var(--dur-1) var(--ease-out), filter var(--dur-2), box-shadow var(--dur-2), background-color var(--dur-2);
}
@media (hover: hover) and (pointer: fine) { .btn:hover { filter: brightness(1.1); transform: none; } }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--au-teal); outline-offset: 2px; }
.btn:disabled { opacity: 0.45; }
.btn.small { padding: 7px 12px; font-size: 13px; border-radius: 12px; }
.btn.big { min-height: 54px; padding: 14px 22px; font-size: 16px; border-radius: var(--au-r-btn); }

/* The 3D buttons: a gradient face on a lip; pressed, the face sinks.
   Orange (.brand) is the one primary of a screen; violet the secondary
   ("Join"); ok / bad the verdicts; .au-light the white one on a hero. */
.btn.brand, .btn.violet, .btn.ok, .btn.bad, .btn.au-light {
  --lip: 4px;
  border-radius: var(--au-r-btn);
  background-color: var(--k-bottom);
  background-image: linear-gradient(180deg, var(--k-top), var(--k-bottom));
  color: var(--k-ink);
  box-shadow: 0 var(--lip) 0 var(--k-deep), 0 14px 30px -12px var(--k-glow), inset 0 1px 0 var(--au-btn-highlight);
}
.btn.small:is(.brand, .violet, .ok, .bad, .au-light) { --lip: 3px; border-radius: 12px; }
.btn.brand { --k-top: #ffa04d; --k-bottom: #ff7a1a; --k-deep: #c24f05; --k-ink: #fff; --k-glow: rgba(255, 122, 26, 0.65); }
.btn.violet { --k-top: #a996ff; --k-bottom: #7a62f5; --k-deep: #4f37c9; --k-ink: #fff; --k-glow: rgba(122, 98, 245, 0.6); }
.btn.ok { --k-top: #5af0d4; --k-bottom: #22c3a6; --k-deep: #11806d; --k-ink: #053a33; --k-glow: rgba(34, 195, 166, 0.55); }
.btn.bad { --k-top: #ff8197; --k-bottom: #ff5d7a; --k-deep: #c22c4c; --k-ink: #fff; --k-glow: rgba(255, 93, 122, 0.55); }
.btn.au-light { --k-top: #ffffff; --k-bottom: #eef1ff; --k-deep: #b9c0e6; --k-ink: #3a33b8; --k-glow: rgba(20, 10, 80, 0.4); }
@media (hover: hover) and (pointer: fine) { .btn:is(.brand, .violet, .ok, .bad, .au-light):hover { filter: brightness(1.06); background-color: var(--k-bottom); } }
.btn:is(.brand, .violet, .ok, .bad, .au-light):active:not(:disabled) {
  transform: translateY(calc(var(--lip) / 2));
  box-shadow: 0 calc(var(--lip) / 2) 0 var(--k-deep), 0 8px 18px -10px var(--k-glow), inset 0 1px 0 var(--au-btn-highlight);
}
/* Off: no colour at all (a faded orange reads as broken): brighter glass,
   a visible ring, a faint neutral lip, the label muted. Same footprint. */
.btn:is(.brand, .violet, .ok, .bad, .au-light):disabled {
  opacity: 1; color: var(--muted);
  background-color: var(--au-glass-base);
  background-image: linear-gradient(var(--au-glass-hi) 0 0);
  box-shadow: 0 var(--lip) 0 var(--line-hi), inset 0 0 0 1px var(--line-hi);
}
/* The quiet action: no surface ("Skip", "Continue with email"). */
.btn.ghost { background: transparent; color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line); }
@media (hover: hover) and (pointer: fine) { .btn.ghost:hover { background: var(--au-glass-flat); color: var(--ink); filter: none; } }
.btn.au-text { background: transparent; box-shadow: none; color: var(--ink-2); padding-left: 8px; padding-right: 8px; }

/* Round glass icon buttons: close, settings, listen, the day/night switch. */
.btn.icon, .btn.theme-toggle, .au-icon-btn {
  width: 38px; height: 38px; padding: 0; border-radius: 50%;
  background-color: var(--au-glass-base);
  background-image: linear-gradient(rgb(var(--fg) / 0.12) 0 0);
  box-shadow: inset 0 1px 0 var(--au-highlight), inset 0 0 0 1px var(--line-hi);
  color: var(--ink);
}
:root[data-theme="light"] :is(.btn.icon, .btn.theme-toggle, .au-icon-btn) { background-image: linear-gradient(var(--au-glass-hi) 0 0); }
.btn.icon { width: 36px; height: 36px; }
.btn.icon.small { width: 32px; height: 32px; }
/* The phone menu's labelled rows keep their own shape. */
.tb-menu .theme-toggle { width: 100%; height: auto; border-radius: 12px; background: transparent; box-shadow: none; }

/* ---------- fields ---------- */

.input, select.input, textarea.input {
  border: 2px solid var(--line); border-radius: var(--au-r-small);
  padding: 11px 13px; background: var(--au-field); color: var(--ink);
  font-weight: 500;
  transition: border-color var(--dur-2), box-shadow var(--dur-2), background-color var(--dur-2);
}
.input:focus, .input:focus-visible {
  outline: none; border-color: var(--au-teal); background: var(--au-field-focus);
  box-shadow: 0 0 14px 0 color-mix(in srgb, var(--au-teal) 35%, transparent);
}
:root[data-theme="light"] .input { border-color: var(--line-hi); }
.code-input { font-family: var(--display); font-weight: 700; }
.field, label.field { font-weight: 600; color: var(--ink-2); }

/* ---------- pills, chips, stats ---------- */

.pill, .au-chip {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 26px; padding: 4px 11px; border-radius: 999px;
  font-size: 12.5px; font-weight: 700; color: var(--ink);
  background: linear-gradient(var(--au-glass-flat) 0 0), linear-gradient(var(--au-glass-base) 0 0);
  border: 1px solid var(--au-edge);
  box-shadow: inset 0 1px 0 var(--au-highlight);
}
/* A language pill: its own ink on glass (the hue is the ink, never a fill). */
.pill:is(.es, .zh, .it, .de, .ja, .sv, .no, .lv, .kk, .be, .fr, .en, .ru, .ai) { background: linear-gradient(var(--au-glass-flat) 0 0), linear-gradient(var(--au-glass-base) 0 0); border-color: var(--au-edge); }
.pill.glass { background: rgba(255, 255, 255, 0.14); border-color: rgba(255, 255, 255, 0.2); color: #fff; box-shadow: none; }
.au-chip.big { min-height: 36px; padding: 0 12px; font-size: 14px; }
/* Selected / NEW: a teal-washed glass pill with a teal ring. */
.au-chip.on, .au-chip.teal { background: linear-gradient(color-mix(in srgb, var(--au-teal) 16%, transparent) 0 0), linear-gradient(var(--au-glass-base) 0 0); border-color: color-mix(in srgb, var(--au-teal) 70%, transparent); }
.au-chip.teal { min-height: 20px; padding: 2px 7px; font-size: 9.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--au-teal); }
:root[data-theme="light"] .au-chip.teal { color: var(--ink); }

/* A header stat: a picture and a big Outfit numeral (streak 12, XP 1 240). */
.au-stat {
  display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 12px; border-radius: 20px;
  background: linear-gradient(var(--au-glass-flat) 0 0), linear-gradient(var(--au-glass-base) 0 0);
  box-shadow: inset 0 1px 0 var(--au-highlight), inset 0 0 0 1px var(--au-edge);
  font: 600 var(--au-fs-stat)/1 var(--display); letter-spacing: -0.01em; font-variant-numeric: tabular-nums; color: var(--ink);
}
.au-stat img, .au-stat svg { width: 22px; height: 22px; }
.au-stat.zero { color: var(--muted); }

/* The level ring: a teal-to-violet arc (style="--v: .4") around the number. */
.au-ring {
  --v: 0; --s: 42px;
  position: relative; width: var(--s); height: var(--s); flex: none; border-radius: 50%;
  display: inline-grid; place-items: center;
  font: 600 calc(var(--s) * 0.4)/1 var(--display); color: var(--ink);
  background: linear-gradient(var(--au-glass-flat) 0 0), linear-gradient(var(--au-glass-base) 0 0);
}
.au-ring::before {
  content: ''; position: absolute; inset: 0; border-radius: 50%; padding: 3.5px;
  background: conic-gradient(var(--au-teal), var(--au-violet) calc(max(var(--v), 0.06) * 100%), var(--line-hi) 0);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}

/* Three gold stars: .au-stars > i.on × n. */
.au-stars { display: inline-flex; gap: 3px; }
.au-stars > i { width: 16px; height: 16px; background: rgb(var(--fg) / 0.32); clip-path: polygon(50% 4%, 62% 37%, 97% 38%, 69% 59%, 79% 93%, 50% 73%, 21% 93%, 31% 59%, 3% 38%, 38% 37%); }
.au-stars > i.on { background: var(--au-gold); }

/* ---------- progress ---------- */

/* style="--v: .6" on the bar, or a width on its span. */
.au-progress { height: 6px; border-radius: 99px; background: var(--line-hi); overflow: hidden; }
.au-progress > span { display: block; height: 100%; width: calc(var(--v, 0) * 100%); min-width: 9px; border-radius: inherit; background: var(--au-progress); transition: width var(--dur-4) var(--ease-out); }
.au-progress.done > span { background: var(--au-teal); }
.au-progress.thin { height: 3px; }

/* ---------- segmented control & tabs ---------- */

/* One glass track; the chosen segment brighter, with a ring and a short
   teal underline so it never relies on a faint fill alone. */
.seg, .tabs {
  display: inline-flex; gap: 4px; padding: 4px; border: 0;
  border-radius: var(--au-r-seg);
  background: linear-gradient(var(--au-glass-flat) 0 0), linear-gradient(var(--au-glass-base) 0 0);
  box-shadow: inset 0 1px 0 var(--au-highlight), inset 0 0 0 1px var(--au-edge);
}
.tabs { display: flex; }
.seg button, .seg-opt, .tabs button {
  position: relative; border-radius: var(--au-r-seg-in); color: var(--muted);
  font-family: var(--display); font-weight: 600; font-size: 14px; letter-spacing: -0.005em;
  padding: 8px 12px 10px;
}
.seg button.on, .seg-opt.on, .tabs button.on {
  color: var(--ink);
  background: rgb(var(--fg) / 0.16);
  box-shadow: inset 0 1px 0 var(--au-highlight), inset 0 0 0 1px var(--line-hi);
}
:root[data-theme="light"] :is(.seg button.on, .seg-opt.on, .tabs button.on) { background: var(--au-glass-hi); box-shadow: inset 0 1px 0 #fff, inset 0 0 0 1px var(--line-hi), 0 4px 10px -6px rgba(30, 70, 130, 0.35); }
.seg button.on::after, .seg-opt.on::after, .tabs button.on::after {
  content: ''; position: absolute; left: 50%; bottom: 3px; width: 18px; height: 3px; margin-left: -9px;
  border-radius: 2px; background: var(--au-teal); pointer-events: none;
}
.learn-seg .seg-opt { font-family: var(--font); font-weight: 700; font-size: 15px; padding: 11px 12px 13px; }
/* The language pickers are a grid (style.css), which .seg above would turn
   back into one long row: fourteen languages then pushed the home form, its
   name field and its Play button off a phone's screen. */
.learn-seg { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); }
.learn-seg .seg-opt { min-width: 0; padding-left: 4px; padding-right: 4px; font-size: 13.5px; }
.learn-seg .seg-opt span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 560px) { .learn-seg .seg-opt { font-size: 13px; letter-spacing: -0.01em; } }
.ui-seg button { padding: 5px 8px 8px; font-size: 12px; }
/* Fourteen interface languages do not fit one row on a phone: they wrap
   inside the card instead of widening it (the site bar keeps its one row). */
.ui-seg { flex-wrap: wrap; max-width: 100%; }
.site-nav .ui-seg { flex-wrap: nowrap; }

/* ---------- list rows ---------- */

/* Lists are not cards: bare rows (a 46px disc with a picture, a title, a
   meta line, something on the right), or grouped in one glass card with
   hairlines between them (.au-rows). */
.au-row { display: flex; align-items: center; gap: 12px; padding: 10px 4px; min-height: 56px; color: var(--ink); text-decoration: none; }
.au-row-disc { width: 46px; height: 46px; flex: none; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(var(--au-glass-flat) 0 0), linear-gradient(var(--au-glass-base) 0 0); box-shadow: inset 0 1px 0 var(--au-highlight), inset 0 0 0 1px var(--au-edge); }
.au-row-disc img, .au-row-disc svg { width: 28px; height: 28px; }
.au-row-body { flex: 1; min-width: 0; display: grid; gap: 2px; }
.au-row-t { font: 600 var(--au-fs-card)/1.2 var(--display); letter-spacing: -0.01em; }
.au-row-m { font-size: 12px; font-weight: 600; color: var(--muted); }
.au-row-end { flex: none; font-size: 12.5px; font-weight: 700; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.au-row-end.done { color: var(--au-teal); }
.au-rows { padding: 4px 14px; border-radius: var(--au-r-card); background-color: var(--au-glass-base); background-image: var(--au-glass); box-shadow: var(--au-shadow); }
.au-rows > .au-row + .au-row { border-top: 1px solid var(--line-hi); }
button.au-row { width: 100%; border: 0; background: transparent; font: inherit; text-align: left; cursor: pointer; }
.list-item { border: 0; background: linear-gradient(var(--au-glass-flat) 0 0), linear-gradient(var(--au-glass-base) 0 0); box-shadow: inset 0 1px 0 var(--au-highlight), inset 0 0 0 1px var(--au-edge); border-radius: var(--au-r-small); }

/* ---------- language tags & flags ---------- */

.lt { background: var(--au-glass-flat); border-color: var(--au-edge); font-family: var(--display); font-weight: 700; }
.lt:is(.es, .zh, .it, .de, .ja, .sv, .no, .lv, .kk, .be, .fr, .en, .ru) { background: var(--au-glass-flat); border-color: var(--au-edge); }
.flag { box-shadow: 0 0 0 1px rgb(var(--fg) / 0.14); }

/* ---------- modal & sheet ---------- */

.modal-backdrop { background: var(--au-backdrop); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.modal {
  border: 0; border-radius: var(--au-r-sheet); padding: 22px;
  background: var(--au-sheet);
  box-shadow: inset 0 1px 0 var(--au-highlight), inset 0 0 0 1px var(--au-edge), 0 40px 80px -24px rgba(0, 0, 0, 0.7);
}
:root[data-theme="light"] .modal { box-shadow: inset 0 1px 0 #fff, 0 30px 60px -24px rgba(30, 70, 130, 0.45); }
.modal-head h2, .modal-head h3 { font: 700 22px/1.15 var(--display); letter-spacing: -0.02em; }
/* On a phone a modal is a bottom sheet: full width, rounded on top, a grab handle. */
@media (max-width: 480px) {
  .modal-backdrop { place-items: end center; padding: 12px 0 0; }
  .modal-backdrop > .modal {
    width: 100%; max-width: 100%; max-height: calc(100dvh - 24px);
    border-radius: var(--au-r-sheet) var(--au-r-sheet) 0 0;
    padding: 26px 18px calc(20px + env(safe-area-inset-bottom));
    animation: au-sheet-in var(--dur-3) var(--ease-out);
    position: relative;
  }
  .modal-backdrop > .modal::before { content: ''; position: absolute; top: 9px; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 2px; background: var(--line-hi); }
}
@keyframes au-sheet-in { from { transform: translateY(40px); opacity: 0; } }

/* ---------- toasts ---------- */

.toast {
  border: 0; border-radius: var(--au-r-btn); padding: 12px 18px;
  font-weight: 700; font-size: 14.5px; text-align: center;
  background: var(--panel-solid); color: var(--ink);
  box-shadow: inset 0 1px 0 var(--au-highlight), inset 0 0 0 1px var(--line-hi), 0 20px 40px -14px rgba(0, 0, 0, 0.6);
}
.toast.ok { background: linear-gradient(180deg, #5af0d4, #22c3a6); color: #053a33; border: 0; box-shadow: 0 3px 0 #11806d, 0 18px 34px -14px rgba(34, 195, 166, 0.6); }
.toast.bad { background: linear-gradient(180deg, #ff8197, #ff5d7a); color: #fff; border: 0; box-shadow: 0 3px 0 #c22c4c, 0 18px 34px -14px rgba(255, 93, 122, 0.6); }
@media (max-width: 480px) { #toasts { bottom: calc(24px + env(safe-area-inset-bottom)); } }
/* Above the dock while there is one. */
@media (max-width: 1023px) { #app:has(.au-dock) ~ #toasts { bottom: calc(100px + env(safe-area-inset-bottom)); } }

/* ---------- top bar (room) & generic bars ---------- */

/* A frosted bar that stays put: nearly opaque, so what scrolls under it
   never shows through its labels. No border line, a soft shadow instead. */
.topbar, .au-topbar {
  background: var(--au-dock);
  backdrop-filter: blur(18px) saturate(1.3); -webkit-backdrop-filter: blur(18px) saturate(1.3);
  border-bottom: 0;
  box-shadow: 0 1px 0 var(--line), 0 12px 30px -24px rgba(0, 0, 0, 0.6);
}
.topbar .tb-group + .tb-group { border-left-color: var(--line-hi); }
.tb-count { background: rgb(var(--brand-rgb) / 0.18); color: var(--brand-3); }
.tb-menu { border: 0; border-radius: var(--au-r-card); background: var(--au-sheet); box-shadow: inset 0 1px 0 var(--au-highlight), inset 0 0 0 1px var(--au-edge), 0 24px 60px -18px rgba(0, 0, 0, 0.55); }
/* A page bar's content shares the page column's edges: .au-page and
   .hero-inner are a 1180 box with --au-gutter inside it, so the bar pads by
   half the slack plus that same gutter. 100% (not 100vw) keeps a scrollbar
   from shifting it. Below 1180 this is just --au-gutter. The home bar
   (.site-nav.au-topbar) and the profile bar (.site-nav.pf-nav) both use it;
   the profile's keeps style.css's own padding on a phone. */
:root { --au-bar-x: max(var(--au-gutter), calc((100% - 1180px) / 2 + var(--au-gutter))); }
.au-topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px; padding: 10px var(--au-bar-x); }
@media (min-width: 481px) { .site-nav { padding-inline: var(--au-bar-x); } }
.room-code { font-family: var(--display); font-weight: 700; }

/* ---------- the dock (phone) / the rail (desktop) ---------- */

/* <nav class="au-dock"><button class="au-dock-tab on"><span class="au-dock-ic">svg</span><span class="au-dock-l">Learn</span></button>...</nav>
   Up to 1023px a floating frosted capsule at the bottom: the chosen tab is an
   orange bubble with a white icon and a small teal star above it. From
   1024px the same markup is a rail down the left side, and the page moves
   over to make room for it. */
.au-dock {
  position: fixed; z-index: 30; left: 14px; right: 14px; bottom: calc(20px + env(safe-area-inset-bottom));
  height: 64px; display: flex; align-items: stretch; justify-content: space-around; gap: 4px; padding: 6px 8px;
  border-radius: var(--au-r-dock); background: var(--au-dock);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  box-shadow: inset 0 1px 0 var(--au-highlight), inset 0 0 0 1px var(--au-edge), 0 18px 40px -16px rgba(0, 0, 0, 0.6);
  max-width: 560px; margin: 0 auto;
}
/* The page fades into the sky well above the dock. */
.au-dock::before {
  content: ''; position: absolute; z-index: -1; pointer-events: none;
  left: -14px; right: -14px; bottom: calc(-20px - env(safe-area-inset-bottom)); height: 150px;
  background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--au-fade) 72%, transparent) 30%, color-mix(in srgb, var(--au-fade) 95%, transparent) 55%, var(--au-fade));
}
.au-dock-tab {
  flex: 1; min-width: 0; position: relative; display: grid; justify-items: center; align-content: center; gap: 3px;
  border: 0; background: transparent; padding: 0; cursor: pointer; color: var(--muted); text-decoration: none;
  font: 700 11px/1.2 var(--font);
}
.au-dock-ic { width: 52px; height: 34px; display: grid; place-items: center; border-radius: 14px; transition: background var(--dur-2), transform var(--dur-1); }
.au-dock-ic svg, .au-dock-ic .i { width: 22px; height: 22px; }
.au-dock-l { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.au-dock-tab.on { color: var(--ink); }
.au-dock-tab.on .au-dock-ic { color: #fff; background: linear-gradient(180deg, #ffa04d, #ff7a1a); box-shadow: 0 3px 0 #c24f05, 0 10px 20px -8px rgba(255, 122, 26, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.35); }
.au-dock-tab.on::before { content: ''; position: absolute; top: -3px; left: 50%; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: var(--au-teal); box-shadow: 0 0 8px 2px color-mix(in srgb, var(--au-teal) 60%, transparent); }
.au-dock-tab:active .au-dock-ic { transform: translateY(1px); }
/* Room for the dock under the last thing on the page. */
#app:has(.au-dock) { padding-bottom: calc(110px + env(safe-area-inset-bottom)); }
@media (min-width: 1024px) {
  .au-dock {
    top: 0; bottom: 0; left: 0; right: auto; width: 232px; height: auto; max-width: none; margin: 0;
    flex-direction: column; justify-content: flex-start; gap: 4px; padding: 24px 14px;
    border-radius: 0; box-shadow: 1px 0 0 var(--line);
  }
  .au-dock::before { display: none; }
  .au-dock-tab { flex: none; display: flex; align-items: center; justify-content: flex-start; gap: 12px; padding: 6px 8px; border-radius: 16px; font-size: 15px; font-weight: 600; }
  @media (hover: hover) { .au-dock-tab:hover { background: var(--au-glass-flat); color: var(--ink); } }
  .au-dock-ic { width: 44px; height: 36px; }
  .au-dock-tab.on::before { top: 50%; left: 2px; margin: -2.5px 0 0; }
  #app:has(.au-dock) { padding-bottom: 0; padding-left: 232px; }
}

/* ---------- small shared bits ---------- */

.divider { color: var(--muted); }
.divider::before, .divider::after { background: var(--line-hi); }
.kbd { background: var(--au-glass-flat); }
.big-emoji { filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.25)); }
.timer { font-family: var(--display); font-weight: 700; }
.credit b { font-family: var(--display); }

@media (prefers-reduced-motion: reduce) {
  .modal-backdrop > .modal { animation: none; }
}
