/* Jerry's English: "Open Road" (light) and "Night" (dark). Phone: one column + bottom bar. Tablet: two columns + bottom bar. Computer: sidebar + wide grid. */
:root {
  --bg: #fff6ee; --card: #ffffff; --card-2: #fffaf5; --fg: #1f1d2b; --muted: #85705f; --line: #f1e1d3;
  --or: #ff6000; --or-d: #ea4200; --or-soft: #ffe3cc; --or-ink: #b83400;
  --ok: #18a058; --ok-soft: #dcf3e5; --warn: #b87400; --warn-soft: #fdf0cf; --bad: #e0334a; --bad-soft: #fde0e4;
  --ink: #1f1d2b; --on-ink: #ffffff;
  --shadow: 0 1px 0 rgba(31, 29, 43, .04), 0 14px 34px -20px rgba(31, 29, 43, .35);
  --k-G: #ff6000; --k-C: #c2410c; --k-V: #2f6fdb; --k-P: #8b4fd6; --k-R: #0f9488; --k-L: #18a058; --k-W: #5b5566; --k-T: #1f1d2b;
  --stage: #ff6a10;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1); --ease-io: cubic-bezier(0.77, 0, 0.175, 1);
  --font: "Archivo", "Segoe UI", system-ui, sans-serif; --fun: "Fredoka", "Archivo", system-ui, sans-serif;
  --side: 248px; --bar: 72px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root {
  --bg: #110e18; --card: rgba(255, 255, 255, .06); --card-2: rgba(255, 255, 255, .04); --fg: #f4eee9; --muted: #b3a9c1; --line: rgba(255, 255, 255, .11);
  --or-soft: rgba(255, 96, 0, .18); --or-ink: #ffb27a; --ok-soft: rgba(24, 160, 88, .2); --warn-soft: rgba(184, 116, 0, .22); --bad-soft: rgba(224, 51, 74, .2);
  --ink: #f4eee9; --on-ink: #110e18; --k-T: #e8e2ef; --k-W: #b4adbf;
  --shadow: 0 0 0 1px rgba(255, 255, 255, .06), 0 20px 40px -24px rgba(0, 0, 0, .8);
  color-scheme: dark } }
* { box-sizing: border-box }
html, body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--font); font-size: 16px; line-height: 1.45; -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent }
body { min-height: 100vh; min-height: 100dvh }
[hidden] { display: none !important }
button, input, select, textarea { font: inherit; color: inherit }
button { cursor: pointer }
:focus-visible { outline: 3px solid var(--or); outline-offset: 3px; border-radius: 8px }
a { color: var(--or-d) }
h1, h2, h3 { margin: 0; text-wrap: balance; letter-spacing: -0.01em }
h1 { font-stretch: 118%; font-weight: 900; font-size: clamp(28px, 4vw, 40px); line-height: 1.04 }
h2 { font-stretch: 112%; font-weight: 900; font-size: clamp(19px, 2.2vw, 23px); line-height: 1.15 }
h3 { font-weight: 800; font-size: 17px }
p { margin: 0 }
.muted { color: var(--muted) }
.small { font-size: 13px }
.eyebrow { font-size: 12px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; color: var(--muted) }
.accent { color: var(--or-d) }
@media (prefers-color-scheme: dark) { .accent { color: #ff8a3d } }

/* ---------- night glow (dark mode only) */
.glow { display: none }
@media (prefers-color-scheme: dark) {
  .glow { display: block; position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none }
  .glow i { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .5; animation: morph 26s ease-in-out infinite alternate }
  .glow i:nth-child(1) { width: 420px; height: 420px; left: -120px; top: -140px; background: #ea4200 }
  .glow i:nth-child(2) { width: 360px; height: 360px; right: -140px; top: 30%; background: #9b2c66; animation-duration: 32s; animation-delay: -9s }
  .glow i:nth-child(3) { width: 380px; height: 380px; left: 20%; bottom: -200px; background: #c97a12; opacity: .3; animation-duration: 36s; animation-delay: -15s }
  .panel, .scard, .mod { backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px) }
}
@keyframes morph { 0% { transform: translate(0, 0) scale(1) } 50% { transform: translate(50px, -40px) scale(1.15) } 100% { transform: translate(-40px, 50px) scale(.95) } }

/* ---------- shell */
.shell { min-height: 100dvh; padding-bottom: calc(var(--bar) + env(safe-area-inset-bottom) + 24px) }
.main { width: 100%; max-width: 1240px; margin: 0 auto; padding-block: 20px 40px;
  padding-left: max(18px, env(safe-area-inset-left)); padding-right: max(18px, env(safe-area-inset-right));
  display: flex; flex-direction: column; gap: 22px }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px;
  padding: calc(10px + env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) 10px max(18px, env(safe-area-inset-left));
  background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px) }
.topbar .sp { flex: 1 }
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: inherit }
.logo svg { width: 36px; height: 36px; flex: none }
.logo b { font-stretch: 125%; font-weight: 900; font-size: 16px; line-height: 1 }
.logo b span { color: var(--or) }
.iconbtn { border: 0; background: var(--card); color: var(--fg); box-shadow: var(--shadow); border-radius: 14px; min-width: 44px; height: 44px; padding: 0 12px; display: inline-grid; place-items: center; font-weight: 800; font-size: 13px }

.nav { position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-around;
  padding: 8px max(10px, env(safe-area-inset-right)) calc(8px + env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
  background: color-mix(in srgb, var(--bg) 90%, transparent); border-top: 1px solid var(--line); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px) }
.nav .brand, .nav .navfoot { display: none }
.nav a { flex: 1; max-width: 120px; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 4px; border-radius: 14px; text-decoration: none; color: var(--muted); font-size: 11px; font-weight: 800; min-height: 52px; justify-content: center; transition: color .15s ease, background-color .15s ease }
.nav a svg { width: 24px; height: 24px }
.nav a[aria-current="page"] { color: var(--or-ink); background: var(--or-soft) }

@media (min-width: 1024px) {
  .shell { padding-bottom: 0; padding-left: var(--side) }
  .topbar { display: none }
  .nav { top: 0; right: auto; width: var(--side); flex-direction: column; justify-content: flex-start; gap: 6px; padding: 26px 16px 20px; border-top: 0; border-right: 1px solid var(--line) }
  .nav .brand { display: flex; margin: 0 8px 26px }
  .nav a { flex: none; max-width: none; flex-direction: row; gap: 12px; font-size: 15px; padding: 0 14px; min-height: 48px; justify-content: flex-start }
  .nav a svg { width: 22px; height: 22px }
  .nav .navfoot { display: flex; flex-direction: column; gap: 6px; margin-top: auto }
  .nav .navfoot button { border: 0; background: none; color: var(--muted); font-weight: 800; text-align: left; padding: 0 14px; min-height: 44px; border-radius: 14px; display: flex; align-items: center; gap: 12px }
  .main { padding-block: 36px 60px; padding-inline: 40px; gap: 28px }
}
@media (hover: hover) and (pointer: fine) {
  .nav a:hover { color: var(--fg) }
  .nav .navfoot button:hover { color: var(--fg); background: var(--card-2) }
}

/* ---------- entrance: one stagger per screen */
.rise { animation: rise .5s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 70ms) }
@keyframes rise { from { opacity: 0; transform: translateY(14px); filter: blur(4px) } to { opacity: 1; transform: none; filter: none } }

/* ---------- surfaces */
.panel { background: var(--card); border-radius: 26px; padding: clamp(18px, 2.4vw, 28px); box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 14px; min-width: 0 }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: end }
.row > * { min-width: 0 }
.stack { display: flex; flex-direction: column; gap: 14px }
.stack label.f { flex: none }
.grid-home { display: grid; gap: 22px; grid-template-columns: minmax(0, 1fr) }
.grid-home .side { display: flex; flex-direction: column; gap: 22px; min-width: 0 }
@media (min-width: 760px) { .grid-home { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); align-items: start } }
label.f { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 700; color: var(--muted); flex: 1 1 170px }
input, select, textarea { background: var(--card-2); border: 1.5px solid var(--line); border-radius: 14px; padding: 11px 14px; min-height: 48px; width: 100%; transition: border-color .15s ease }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--or) }
textarea { min-height: 84px; resize: vertical }
.btn { background: var(--or); color: #fff; border: 0; border-radius: 16px; padding: 0 20px; min-height: 48px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; gap: 10px; text-decoration: none; transition: transform .15s var(--ease-out), background-color .15s ease }
.btn:not(:disabled):active { transform: scale(.96) }
.btn:disabled { opacity: .5 }
.btn.ink { background: var(--ink); color: var(--on-ink) }
.btn.ghost { background: transparent; color: var(--fg); border: 1.5px solid var(--line) }
.btn.soft { background: var(--or-soft); color: var(--or-ink) }
.btn.danger { background: var(--bad) }
.btn.big { min-height: 60px; font-size: 18px; padding: 0 28px; border-radius: 20px }
.btn.sm { min-height: 38px; padding: 0 12px; font-size: 14px; border-radius: 12px }
.btn.copied { background: var(--ok); color: #fff; border-color: var(--ok) }
.btn .badge { background: var(--or); color: #fff; border-radius: 999px; padding: 3px 10px; font-size: 13px }
.err { color: var(--bad); font-weight: 700 }
.note { background: var(--or-soft); border-radius: 18px; padding: 14px 16px }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--or-soft); color: var(--or-ink); font-weight: 800; font-size: 13px; border-radius: 999px; padding: 7px 13px }
.pill { display: inline-block; font-size: 12px; font-weight: 800; padding: 3px 10px; border-radius: 999px; background: var(--line) }
.pill.planned { background: var(--or-soft); color: var(--or-ink) }
.pill.done { background: var(--ok-soft); color: var(--ok) }
.pill.cancelled { background: var(--bad-soft); color: var(--bad) }
.lv { font-stretch: 125%; font-weight: 900; color: var(--or); font-size: 13px }
.empty { text-align: center; padding: 40px 20px; color: var(--muted) }
@media (hover: hover) and (pointer: fine) {
  .btn.ghost:hover { border-color: var(--or) }
  .btn:not(.ghost):not(:disabled):hover { filter: brightness(1.06) }
}

/* ---------- login */
.login { min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr) }
.login .hero { position: relative; overflow: hidden; background: var(--or); color: #fff; padding: calc(24px + env(safe-area-inset-top)) 24px 24px; min-height: 300px; display: flex; flex-direction: column; justify-content: space-between; gap: 20px }
.login .hero h1 { font-size: clamp(32px, 5vw, 60px); max-width: 11ch; position: relative }
.login .hero .logo b span { color: #fff3e8 }
.login .hero svg.bg { position: absolute; left: -5%; right: -5%; bottom: -8%; width: 110%; height: auto }
.login .form { display: flex; align-items: center; justify-content: center; padding: 28px max(20px, env(safe-area-inset-right)) calc(28px + env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left)) }
.login .form > div { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 18px }
@media (min-width: 900px) { .login { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) } .login .hero { padding: 48px } .login .hero svg.bg { bottom: 4% } }
.cred { background: var(--ok-soft); border-radius: 18px; padding: 16px; display: flex; flex-direction: column; gap: 8px }
.cred code { font-size: 20px; font-weight: 800; user-select: all; font-family: ui-monospace, Menlo, Consolas, monospace }

/* ---------- road */
.road { position: relative; width: 100% }
.road svg { display: block; width: 100%; height: auto; overflow: visible }
.road .draw { stroke-dasharray: 100; stroke-dashoffset: 100; animation: draw 1.5s var(--ease-out) .15s forwards }
.road .lane { animation: lane 1.2s linear infinite }
.road .stop { opacity: 0; transform: scale(.9); transform-box: fill-box; transform-origin: center; animation: pop .5s var(--ease-out) forwards }
.road .ring { transform-box: fill-box; transform-origin: center; animation: ring 1.8s var(--ease-out) infinite }
.road .hit { position: absolute; width: 46px; height: 46px; margin: -23px 0 0 -23px; border-radius: 50%; border: 0; background: transparent; padding: 0 }
.road .tip { position: absolute; transform: translate(-50%, calc(-100% - 26px)); background: var(--ink); color: var(--on-ink); border-radius: 12px; padding: 7px 11px; font-size: 12px; font-weight: 800; white-space: nowrap; pointer-events: none; animation: rise .45s var(--ease-out) 2.1s both; max-width: 70vw; overflow: hidden; text-overflow: ellipsis }
@keyframes draw { to { stroke-dashoffset: 0 } }
@keyframes lane { to { stroke-dashoffset: -22 } }
@keyframes pop { to { opacity: 1; transform: scale(1) } }
@keyframes ring { 0% { opacity: .75; transform: scale(1) } 100% { opacity: 0; transform: scale(2.1) } }
.minirod { position: relative; height: 14px; border-radius: 999px; background: var(--or-soft); overflow: hidden }
.minirod i { position: absolute; inset: 0 auto 0 0; background: var(--or); border-radius: 999px; transform-origin: left; animation: grow .9s var(--ease-out) both; min-width: 14px }
.minirod i::after { content: ""; position: absolute; left: 7px; right: 7px; top: 6px; border-top: 2px dashed rgba(255, 255, 255, .7) }
@keyframes grow { from { transform: scaleX(0) } }

/* ---------- next lesson + word card */
.next { display: flex; align-items: center; gap: 14px }
.next .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--or); flex: none; animation: beat 1.6s ease-out infinite }
.next .t { font-weight: 900; font-size: 19px; font-stretch: 105% }
@keyframes beat { 0% { box-shadow: 0 0 0 0 rgba(255, 96, 0, .45) } 100% { box-shadow: 0 0 0 12px rgba(255, 96, 0, 0) } }
.flip { all: unset; display: block; cursor: pointer; position: relative; width: 100%; height: 180px; perspective: 1000px }
.flip .in { position: absolute; inset: 0; transition: transform .55s var(--ease-out); transform-style: preserve-3d }
.flip.on .in { transform: rotateY(180deg) }
.flip .face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 26px; padding: 20px 22px; display: flex; flex-direction: column; justify-content: space-between; background: var(--or); color: #fff; text-align: left }
.flip .back { transform: rotateY(180deg); background: #1f1d2b }
.flip .w { font-stretch: 112%; font-weight: 900; font-size: clamp(32px, 4vw, 42px); line-height: 1 }
.flip .face .eyebrow { color: rgba(255, 255, 255, .85) }
.flip .back .eyebrow { color: #ffb27a }

/* ---------- students, progress, lessons */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 18px }
.scard { background: var(--card); border-radius: 24px; padding: 20px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 12px; text-decoration: none; color: inherit; transition: transform .2s var(--ease-out) }
.scard .nm { display: flex; justify-content: space-between; gap: 8px; align-items: baseline }
.scard:active { transform: scale(.98) }
@media (hover: hover) and (pointer: fine) { .scard:hover { transform: translateY(-3px) } }
.big-pct { font-stretch: 125%; font-weight: 900; font-size: clamp(40px, 5vw, 56px); line-height: 1; color: var(--or); font-variant-numeric: tabular-nums }
.stats { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--muted) }
.stats b { color: var(--fg); font-variant-numeric: tabular-nums }
.tabs { display: flex; gap: 6px; flex-wrap: wrap }
.tab { border: 0; background: none; padding: 0 16px; border-radius: 14px; font-weight: 800; color: var(--muted); min-height: 44px; display: inline-flex; align-items: center; text-decoration: none }
.tab[aria-current="page"] { background: var(--ink); color: var(--on-ink) }
.mods { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr) }
@media (min-width: 1180px) { .mods.two { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start } }
.mod { background: var(--card); border-radius: 22px; overflow: hidden; box-shadow: var(--shadow); scroll-margin-top: 90px }
.mod > button.mhead { width: 100%; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center; background: none; border: 0; padding: 16px 18px; text-align: left; min-height: 64px }
.num { background: var(--or); color: #fff; font-stretch: 125%; font-weight: 900; font-size: 14px; height: 30px; min-width: 38px; padding: 0 10px 0 8px; display: grid; place-items: center; clip-path: polygon(0 0, 78% 0, 100% 50%, 78% 100%, 0 100%) }
.mod.full .num { background: var(--ok) }
.mname { font-weight: 800; font-size: 17px }
.mprog { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap }
.mini { height: 6px; background: var(--line); border-radius: 9px; margin-top: 7px; overflow: hidden }
.mini i { display: block; height: 100%; background: var(--or) }
.mod.full .mini i { background: var(--ok) }
.unit { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 18px; border-top: 1px solid var(--line) }
.kind { font-stretch: 125%; font-weight: 900; font-size: 12px; color: #fff; border-radius: 9px; height: 30px; display: grid; place-items: center }
.kind[data-k="T"] { color: var(--bg) }
.utitle { font-weight: 650; min-width: 0 }
.ucode { font-size: 12px; color: var(--muted) }
.uright { display: flex; gap: 8px; align-items: center }
.score { width: 78px; min-height: 40px; padding: 6px 8px; text-align: center }
.st { min-width: 120px; min-height: 40px; border-radius: 12px; border: 1.5px solid var(--line); background: transparent; font-size: 14px; font-weight: 800; color: var(--muted); transition: background-color .15s ease, border-color .15s ease, color .15s ease, transform .15s var(--ease-out) }
button.st:active { transform: scale(.96) }
span.st { display: inline-grid; place-items: center; min-width: 100px }
.st[data-s="doing"] { background: var(--or-soft); border-color: var(--or); color: var(--or-ink) }
.st[data-s="done"] { background: var(--ok-soft); border-color: var(--ok); color: var(--ok) }
.st[data-s="review"] { background: var(--warn-soft); border-color: var(--warn); color: var(--warn) }
.lessons { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column }
.lessons li { display: grid; grid-template-columns: 130px minmax(0, 1fr) auto; gap: 14px; padding: 14px 0; border-top: 1px solid var(--line); align-items: start }
.lessons li:first-child { border-top: 0 }
.lessons .d { font-weight: 800; font-variant-numeric: tabular-nums }
.days { display: flex; gap: 6px; flex-wrap: wrap }
.days label { display: inline-flex; align-items: center; gap: 6px; border: 1.5px solid var(--line); border-radius: 12px; padding: 0 12px; font-weight: 800; min-height: 44px; cursor: pointer; color: var(--fg) }
.days label:has(input:checked) { background: var(--or-soft); border-color: var(--or); color: var(--or-ink) }
.days input { width: auto; min-height: 0; accent-color: var(--or) }
.acc { width: 100%; border-collapse: collapse; min-width: 640px }
.acc th { text-align: left; font-size: 12px; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); padding: 18px 20px 8px }
.acc td { padding: 14px 20px; border-top: 1px solid var(--line); vertical-align: middle }
.acc code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 15px; user-select: all }
.acc .pw { background: var(--or-soft); color: var(--or-ink); padding: 4px 9px; border-radius: 9px; font-weight: 700 }
.acc .acts { white-space: nowrap; text-align: right }
.scroll-x { overflow-x: auto; padding: 0 }
@media (max-width: 640px) {
  .lessons li { grid-template-columns: minmax(0, 1fr) auto }
  .lessons .d { grid-column: 1 / -1 }
  .st { min-width: 100px }
  .unit { padding-inline: 14px }
}

/* ---------- words: unit picker */
.units-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 12px }
.upick { border-radius: 20px; padding: 16px; display: flex; flex-direction: column; gap: 6px; min-height: 84px; text-decoration: none; color: inherit; background: var(--card-2); border: 1.5px solid var(--line); transition: transform .15s var(--ease-out), border-color .15s ease }
.upick:active { transform: scale(.97) }
.upick[aria-pressed="true"] { border-color: var(--or); background: var(--or-soft) }
@media (hover: hover) and (pointer: fine) { .upick:hover { border-color: var(--or) } }
.modes { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr)); gap: 14px }
.mode { border-radius: 22px; padding: 18px; color: #fff; background: var(--or); min-height: 112px; display: flex; flex-direction: column; justify-content: space-between; text-decoration: none; transition: transform .12s var(--ease-out), box-shadow .12s var(--ease-out); box-shadow: 0 6px 0 rgba(0, 0, 0, .2) }
.mode:active { transform: translateY(4px); box-shadow: 0 2px 0 rgba(0, 0, 0, .2) }
.mode b { font-family: var(--fun); font-weight: 700; font-size: 22px }
.mode:nth-child(2) { background: var(--k-V) } .mode:nth-child(3) { background: var(--k-R) } .mode:nth-child(4) { background: var(--k-P) }

/* ---------- game stage (Sticker Arcade) */
.stage { position: relative; overflow: hidden; background: var(--stage); color: #fff; font-family: var(--fun); border-radius: 30px; min-height: min(780px, calc(100dvh - 140px)); display: flex; flex-direction: column; padding: clamp(18px, 3vw, 34px); isolation: isolate }
@media (max-width: 640px) { .stage { margin: -20px calc(-1 * max(18px, env(safe-area-inset-left))) 0; border-radius: 0 0 30px 30px; min-height: calc(100dvh - 150px) } }
.stage .stk { position: absolute; z-index: -1; pointer-events: none }
.stage .float { animation: float 9s ease-in-out infinite }
.stage .spin { animation: spin 26s linear infinite }
.stage .ghead { display: flex; align-items: center; gap: 12px }
.stage .close { width: 48px; height: 48px; border-radius: 16px; background: rgba(255, 255, 255, .18); display: grid; place-items: center; color: #fff; flex: none }
.stage .xpbar { flex: 1; height: 18px; border-radius: 999px; background: rgba(0, 0, 0, .18); overflow: hidden; position: relative }
.stage .xpbar i { position: absolute; inset: 0; background: #fff; border-radius: 999px; transform-origin: left; transition: transform .6s var(--ease-out) }
.stage .xpbar b { position: absolute; top: 0; bottom: 0; width: 44px; background: linear-gradient(90deg, transparent, rgba(255, 177, 92, .85), transparent); animation: shine 2.8s var(--ease-io) infinite }
.stage .flame { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; font-size: 19px }
.stage .flame svg { transform-origin: 50% 90%; animation: flick .9s ease-in-out infinite alternate }
.stage .gbody { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 26px; text-align: center; width: 100%; max-width: 660px; margin: 0 auto; padding-block: 24px }
.stage .eyebrow { color: #ffe3cc; font-family: var(--font); font-stretch: 125% }
.stage .prompt { font-weight: 700; font-size: clamp(26px, 4vw, 38px); line-height: 1.1 }
.stage .sticker { background: #fff; color: #1f1d2b; border-radius: 20px; padding: 10px 20px; font-weight: 700; font-size: clamp(24px, 4vw, 36px); box-shadow: 0 6px 0 #e3cdbb; display: inline-block; transform: rotate(-2deg) }
.stage .def { font-family: var(--font); font-size: 17px; color: #fff3e8; max-width: 40ch }
.stage .say { border: 0; width: 56px; height: 56px; border-radius: 18px; background: #1f1d2b; color: #fff; display: inline-grid; place-items: center; box-shadow: 0 6px 0 #0d0c14; transition: transform .12s var(--ease-out), box-shadow .12s var(--ease-out); flex: none }
.stage .say:active { transform: translateY(4px); box-shadow: 0 2px 0 #0d0c14 }
.stage .say.huge { width: 116px; height: 116px; border-radius: 34px }
.stage .say.huge svg { width: 48px; height: 48px }
.opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; width: 100% }
.opt, .tile { border: 0; min-height: 66px; border-radius: 20px; background: #fff; color: #1f1d2b; font-family: var(--fun); font-weight: 600; font-size: clamp(18px, 2.4vw, 22px); padding: 8px 12px; box-shadow: 0 6px 0 #e3cdbb; transition: transform .12s var(--ease-out), box-shadow .12s var(--ease-out), background-color .2s ease, color .2s ease, opacity .2s ease }
.opt:not(:disabled):active, .tile:not(:disabled):active { transform: translateY(4px); box-shadow: 0 2px 0 #e3cdbb }
.opt.ok, .tile.ok { background: #22b36b; color: #fff; box-shadow: 0 6px 0 #138049 }
.opt.no, .tile.no { background: #ff4d5e; color: #fff; box-shadow: 0 6px 0 #c22a3a; animation: shake .35s ease }
.opt.dim { opacity: .55 }
.tile.sel { background: #1f1d2b; color: #fff; box-shadow: 0 6px 0 #0d0c14 }
.tile.ok { opacity: .45 }
.match { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; width: 100% }
.match .col { display: flex; flex-direction: column; gap: 12px }
.gcard { all: unset; cursor: pointer; display: block; width: min(100%, 540px); height: 300px; perspective: 1200px; position: relative }
.gcard .in { position: absolute; inset: 0; transition: transform .55s var(--ease-out); transform-style: preserve-3d }
.gcard.on .in { transform: rotateY(180deg) }
.gcard .face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 30px; background: #fff; color: #1f1d2b; box-shadow: 0 8px 0 #e3cdbb; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 24px; text-align: center }
.gcard .back { transform: rotateY(180deg); background: #1f1d2b; color: #fff; box-shadow: 0 8px 0 #0d0c14 }
.gcard .w { font-size: clamp(34px, 5vw, 48px); font-weight: 700; line-height: 1.05 }
.gcard .uk { font-size: clamp(24px, 3.4vw, 32px); font-weight: 700; color: #ffb27a }
.gcard .ex { font-family: var(--font); font-style: italic; color: #c9c2d6; font-size: 15px }
.gcard .pos { font-family: var(--font); color: #85705f; font-size: 14px }
.spell { width: min(100%, 460px); font-family: var(--fun); font-size: 28px; font-weight: 600; text-align: center; background: #fff; color: #1f1d2b; border: 0; border-radius: 20px; min-height: 70px; box-shadow: 0 6px 0 #e3cdbb }
.spell:focus { outline: 4px solid #1f1d2b; outline-offset: 2px; border-color: transparent }
.gbtns { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center }
.gbtn { border: 0; min-height: 60px; padding: 0 28px; border-radius: 20px; font-family: var(--fun); font-weight: 700; font-size: 20px; background: #1f1d2b; color: #fff; box-shadow: 0 6px 0 #0d0c14; transition: transform .12s var(--ease-out), box-shadow .12s var(--ease-out); text-decoration: none; display: inline-flex; align-items: center; justify-content: center }
.gbtn:active { transform: translateY(4px); box-shadow: 0 2px 0 #0d0c14 }
.gbtn.light { background: #fff; color: #1f1d2b; box-shadow: 0 6px 0 #e3cdbb }
.gbtn.light:active { box-shadow: 0 2px 0 #e3cdbb }
.verdict { width: 100%; background: #fff; color: #1f1d2b; border-radius: 24px; padding: 14px 14px 14px 22px; display: flex; align-items: center; gap: 14px; text-align: left; animation: rise .35s var(--ease-out) both }
.verdict b { font-size: 20px; display: block }
.verdict .ok { color: #138049 } .verdict .no { color: #c22a3a }
.verdict small { font-family: var(--font); color: #6f6670; font-size: 14px }
.score-big { font-family: var(--font); font-stretch: 125%; font-weight: 900; font-size: clamp(64px, 12vw, 110px); line-height: 1 }
.fx { position: fixed; inset: 0; pointer-events: none; z-index: 60; overflow: hidden }
.fx .piece { position: absolute; width: 10px; height: 14px; border-radius: 3px; animation: burst .9s var(--ease-out) forwards }
.fx .xp { position: absolute; font-family: var(--fun); font-weight: 700; font-size: 24px; color: #ffe14d; text-shadow: 0 3px 0 rgba(0, 0, 0, .2); animation: xp 1.1s var(--ease-out) forwards; white-space: nowrap }
.fx svg { position: absolute; inset: 0; width: 100%; height: 100% }
@keyframes float { 0%, 100% { transform: translate(0, 0) rotate(0) } 50% { transform: translate(8px, -14px) rotate(8deg) } }
@keyframes spin { to { transform: rotate(360deg) } }
@keyframes flick { from { transform: scale(1, 1) } to { transform: scale(.92, 1.08) } }
@keyframes shine { 0% { transform: translateX(-120%) } 60%, 100% { transform: translateX(900%) } }
@keyframes shake { 25% { transform: translateX(-7px) } 50% { transform: translateX(6px) } 75% { transform: translateX(-3px) } }
@keyframes burst { from { transform: translate(-50%, -50%) rotate(0); opacity: 1 } to { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) rotate(var(--r)); opacity: 0 } }
@keyframes xp { 0% { opacity: 0; transform: translate(-50%, 8px) scale(.95) } 25% { opacity: 1; transform: translate(-50%, -8px) scale(1) } 100% { opacity: 0; transform: translate(-50%, -54px) } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important }
  .glow i { animation: none !important }
  .fx .piece { display: none }
}
.mode:nth-child(5) { background: #c2367a }
.no-anim .rise, .no-anim .road .draw, .no-anim .road .stop, .no-anim .road .tip, .no-anim .minirod i { animation: none; opacity: 1; transform: none; filter: none; stroke-dashoffset: 0 }
.no-anim .road .tip { transform: translate(-50%, calc(-100% - 26px)) }
.nav .navfoot svg, .iconbtn svg { width: 20px; height: 20px; flex: none }
.road .tip { transform: none; translate: -50% calc(-100% - 26px) }
.no-anim .road .tip { transform: none }
.panel:has(> .road) { overflow: hidden }

.viewbar { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; padding: 10px max(18px, env(safe-area-inset-right)) 10px max(18px, env(safe-area-inset-left)); background: var(--ink); color: var(--on-ink); font-weight: 700; font-size: 14px }
.viewbar .btn.ink { background: var(--or); color: #fff }
@media (min-width: 1024px) { .viewbar { margin-left: var(--side) } }
