/* Linguino — colours from the logo: sky blue, deep blue, penguin orange. Every colour is a token. */

:root {
  --bg: #0b1a2e;
  --bg-2: #10243f;
  --bg-rgb: 11 26 46;
  --fg: 255 255 255;
  --panel: rgba(255, 255, 255, 0.04);
  --panel-solid: #112a48;
  --panel-hi: rgba(255, 255, 255, 0.07);
  --panel-glass: rgba(16, 36, 63, 0.94);
  --ink: #eef5fc;
  --ink-2: #c2d5e9;
  --muted: #89a3bf;
  --line: rgba(255, 255, 255, 0.08);
  --line-hi: rgba(255, 255, 255, 0.16);
  --paper: #f5f7fa;
  --paper-ink: #0f172a;
  --well: rgba(0, 0, 0, 0.22);
  --well-soft: rgba(255, 255, 255, 0.03);
  --placeholder: #5f7c9c;
  --es-ink: #fcd34d;
  --zh-ink: #fca5a5;
  --it-ink: #c4b5fd;
  --ka-ink: #f9a8d4;
  --en-ink: #93b4ff;
  --ru-ink: #6ee7b7;
  --ai-ink: #67e8f9;
  --violet-ink: #9cc8f2;
  --silver: #cbd5e1;
  --aura: 0.6;
  --brand: #ef6c12;
  --brand-rgb: 239 108 18;
  --brand-2: #3e83c4;
  --violet-rgb: 62 131 196;
  --brand-3: #f99a5a;
  --grad: linear-gradient(120deg, #ef6c12 0%, #f99a5a 100%);
  --grad-cool: linear-gradient(135deg, #3e83c4 0%, #275587 100%);
  --navy: #275587;
  --navy-ink: #f8fafc;
  --ok: #10b981;
  --bad: #f43f5e;
  --warn: #f59e0b;
  --es: #f59e0b;
  --zh: #ef4444;
  --it: #8b5cf6;
  --ka: #db2777;
  --en: #3b82f6;
  --ru: #10b981;
  --side-a: #3e83c4;
  --side-b: #ef6c12;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 18px 40px -22px rgba(0, 0, 0, 0.7);
  --glow: 0 0 0 1px rgb(var(--brand-rgb) / 0.5), 0 10px 36px -8px rgb(var(--brand-rgb) / 0.5);
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --display: 'Nunito', 'Plus Jakarta Sans', system-ui, sans-serif;
  /* Motion: five steps of time and four curves, so every screen moves alike.
     Presses take dur-1, exits dur-2 with ease-in, entries dur-3 with ease-out,
     emphasis dur-4 and celebrations dur-5, often with the spring. */
  --dur-1: 90ms;
  --dur-2: 160ms;
  --dur-3: 240ms;
  --dur-4: 400ms;
  --dur-5: 700ms;
  --ease-out: cubic-bezier(.2, .7, .2, 1);
  --ease-in: cubic-bezier(.4, 0, 1, 1);
  --ease-inout: cubic-bezier(.65, 0, .35, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  font-family: var(--font);
  color: var(--ink);
  color-scheme: dark;
  --hero-a: #1b4677;
  --hero-b: #0f2d52;
}

/* Day theme: chosen explicitly, or followed from the OS when nothing is chosen. */
:root[data-theme="light"] {
  --bg: #f2f7fc;
  --bg-2: #e6f0fa;
  --bg-rgb: 242 247 252;
  --fg: 22 48 77;
  --panel: #ffffff;
  --panel-solid: #ffffff;
  --panel-hi: rgba(22, 48, 77, 0.045);
  --panel-glass: rgba(255, 255, 255, 0.96);
  --ink: #15304d;
  --ink-2: #42607f;
  --muted: #6a829d;
  --line: rgba(22, 48, 77, 0.09);
  --line-hi: rgba(22, 48, 77, 0.16);
  --well: #ffffff;
  --well-soft: rgba(22, 48, 77, 0.03);
  --placeholder: #90a4ba;
  --es-ink: #b45309;
  --zh-ink: #b91c1c;
  --it-ink: #6d28d9;
  --ka-ink: #be185d;
  --en-ink: #1d4ed8;
  --ru-ink: #047857;
  --ai-ink: #0e7490;
  --violet-ink: #2b67a6;
  --silver: #94a3b8;
  --aura: 0.35;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 12px 32px -16px rgba(15, 23, 42, 0.16);
  color-scheme: light;
    --hero-a: #4a90d0;
    --hero-b: #336fb0;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f2f7fc;
    --bg-2: #e6f0fa;
    --bg-rgb: 242 247 252;
    --fg: 22 48 77;
    --panel: #ffffff;
    --panel-solid: #ffffff;
    --panel-hi: rgba(22, 48, 77, 0.045);
    --panel-glass: rgba(255, 255, 255, 0.96);
    --ink: #15304d;
    --ink-2: #42607f;
    --muted: #6a829d;
    --line: rgba(22, 48, 77, 0.09);
    --line-hi: rgba(22, 48, 77, 0.16);
    --well: #ffffff;
    --well-soft: rgba(22, 48, 77, 0.03);
    --placeholder: #90a4ba;
    --es-ink: #b45309;
  --zh-ink: #b91c1c;
  --it-ink: #6d28d9;
  --ka-ink: #be185d;
    --en-ink: #1d4ed8;
    --ru-ink: #047857;
    --ai-ink: #0e7490;
    --violet-ink: #2b67a6;
    --silver: #94a3b8;
    --aura: 0.35;
    --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 12px 32px -16px rgba(15, 23, 42, 0.16);
    color-scheme: light;
      --hero-a: #4a90d0;
    --hero-b: #336fb0;
}
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(900px 520px at 100% -10%, rgb(var(--brand-rgb) / calc(0.10 * var(--aura))), transparent 60%),
    radial-gradient(800px 500px at -10% 0%, rgb(var(--violet-rgb) / calc(0.12 * var(--aura))), transparent 60%),
    var(--bg);
  transition: background-color 0.3s, color 0.3s;
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
}
#app { flex: 1; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.12; font-family: var(--display); font-weight: 800; letter-spacing: -0.03em; }
::selection { background: rgb(var(--violet-rgb) / 0.45); }
.hidden { display: none !important; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgb(var(--fg) / 0.14); border-radius: 99px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- primitives ---------- */

.btn {
  border: 0;
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font-weight: 700;
  cursor: pointer;
  background: var(--panel-hi);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line-hi);
  transition: transform 0.12s ease, filter 0.15s, box-shadow 0.2s, background 0.2s;
  white-space: nowrap;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
/* Lifts and brightening on hover only where there is a real pointer: on a
   touch screen :hover sticks after a tap and the button stays raised. */
@media (hover: hover) and (pointer: fine) { .btn:hover { filter: brightness(1.12); transform: translateY(-1px); } }
.btn:active { transform: translateY(1px) scale(0.98); transition-duration: var(--dur-1); }
.btn:focus-visible { outline: 2px solid var(--brand-2); outline-offset: 2px; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; filter: none; }
.btn.brand { background: var(--brand); color: #fff; box-shadow: 0 10px 24px -10px rgb(var(--brand-rgb) / 0.7); }
.btn.brand:hover { filter: none; background: #d95c08; }
.btn.violet { background: var(--brand-2); color: #fff; box-shadow: 0 8px 24px -10px rgb(var(--violet-rgb) / 0.8); }
.btn.ok { background: var(--ok); color: #fff; box-shadow: 0 8px 22px -10px rgb(16 185 129 / 0.7); }
.btn.bad { background: var(--bad); color: #fff; box-shadow: 0 8px 22px -10px rgba(255, 84, 104, 0.7); }
.btn.ghost { background: transparent; color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line-hi); }
.btn.ghost:hover { background: var(--panel-hi); color: var(--ink); }
.btn.small { padding: 7px 11px; font-size: 13px; border-radius: 10px; }
.btn.big { padding: 14px 22px; font-size: 17px; border-radius: 14px; }
.btn.icon { padding: 7px; width: 34px; height: 34px; }

.input, select.input, textarea.input {
  width: 100%;
  border: 1px solid var(--line-hi);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  background: var(--well);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input::placeholder { color: var(--placeholder); }
.input:focus { border-color: var(--brand-2); box-shadow: 0 0 0 4px rgb(var(--violet-rgb) / 0.18); }
select.input option { background: var(--panel-solid); }
textarea.input { resize: vertical; min-height: 64px; }
.field, label.field { display: grid; gap: 7px; font-weight: 600; font-size: 13px; color: var(--ink-2); }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}
.card h3 { font-size: 15px; font-weight: 700; }
.muted { color: var(--muted); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.stack { display: grid; gap: 14px; }
.center { text-align: center; }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 700;
  background: var(--panel-hi); border: 1px solid var(--line);
}
.pill.glass { background: rgba(255, 255, 255, 0.18); border-color: rgba(255, 255, 255, 0.25); color: #fff; }
.pill.es { background: rgb(245 158 11 / 0.14); color: var(--es-ink); border-color: rgb(245 158 11 / 0.3); }
.pill.zh { background: rgb(239 68 68 / 0.12); color: var(--zh-ink); border-color: rgb(239 68 68 / 0.3); }
.pill.it { background: rgb(139 92 246 / 0.12); color: var(--it-ink); border-color: rgb(139 92 246 / 0.3); }
.pill.en { background: rgba(59, 130, 246, 0.14); color: var(--en-ink); border-color: rgba(59, 130, 246, 0.3); }
.pill.ru { background: rgb(16 185 129 / 0.14); color: var(--ru-ink); border-color: rgb(16 185 129 / 0.3); }
.pill.ai { background: rgba(52, 212, 200, 0.12); color: var(--ai-ink); border-color: rgba(52, 212, 200, 0.3); }
.timer { font-variant-numeric: tabular-nums; font-weight: 800; }
.timer.low { color: var(--bad); }
.big-emoji { font-size: 56px; line-height: 1; }
.kbd { font-family: ui-monospace, monospace; background: var(--panel-hi); padding: 2px 8px; border-radius: 8px; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- brand ---------- */

.logo {
  font-family: var(--display); font-size: 46px; font-weight: 800; letter-spacing: -0.045em;
  display: inline-flex; align-items: center; gap: 10px;
}
.logo span:not(.logo-mark) { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.logo-mark {
  width: 1.1em; height: 1.1em; border-radius: 30%; background: var(--grad);
  display: inline-grid; place-items: center; font-size: 0.6em; color: #fff;
  box-shadow: 0 10px 30px -8px rgb(var(--brand-rgb) / 0.7);
}

.credit {
  text-align: center; padding: 22px 16px 26px; font-size: 13px; color: var(--muted);
  letter-spacing: 0.02em;
}
.credit b {
  font-family: var(--display); font-weight: 700; letter-spacing: 0.01em;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.credit .heart { color: var(--brand); }

/* ---------- home ---------- */

.home { max-width: 540px; margin: 0 auto; padding: 56px 16px 24px; }
.home-hero { display: grid; gap: 12px; justify-items: center; text-align: center; }
.home-hero .eyebrow {
  font-size: 12px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  padding: 6px 12px; border-radius: 999px; background: rgb(var(--violet-rgb) / 0.12);
  color: var(--violet-ink); border: 1px solid rgb(var(--violet-rgb) / 0.3);
}
.tagline { font-size: 17px; margin-top: 2px; color: var(--ink-2); }
.home-features { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.home .card { padding: 22px; }
.lang-pair { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: end; }
.lang-pair .arrow {
  padding-bottom: 10px; font-size: 18px; width: 34px; height: 34px; margin-bottom: 4px;
  display: grid; place-items: center; border-radius: 50%; background: var(--panel-hi); padding: 0;
}
.join-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.code-input { text-transform: uppercase; letter-spacing: 8px; font-weight: 800; text-align: center; font-family: var(--display); }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }

/* ---------- room shell ---------- */

.topbar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 10px 20px;
  background: rgb(var(--bg-rgb) / 0.72);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.topbar .logo { font-size: 22px; margin-right: auto; gap: 8px; }
.topbar .logo-mark { width: 1.35em; height: 1.35em; font-size: 0.75em; border-radius: 10px; }
.topbar .tb-gap { flex: 1 1 auto; }
.topbar .tb-group { display: flex; align-items: center; gap: 6px; }
.topbar .tb-group + .tb-group { margin-left: 10px; padding-left: 10px; border-left: 1px solid var(--line); }
.tb-count { min-width: 20px; padding: 0 5px; border-radius: 999px; background: rgb(var(--brand-rgb) / 0.16); color: var(--brand); font-size: 12px; font-weight: 700; }
.tb-more { display: none; }
.tb-menu { display: none; }
.tb-menu:popover-open, .tb-menu.open { display: grid; }
.tb-menu {
  position: fixed; inset: 62px 12px auto auto; margin: 0; width: min(260px, calc(100vw - 24px));
  gap: 4px; padding: 8px; border: 1px solid var(--line-hi); border-radius: 18px; background: var(--panel-solid, var(--bg));
  box-shadow: 0 24px 60px -18px rgb(0 0 0 / 0.5); z-index: 60;
}
.tb-menu .btn { justify-content: flex-start; width: 100%; gap: 10px; padding: 11px 12px; }
.tb-menu .tb-label { display: inline; }
.tb-menu::backdrop { background: rgb(0 0 0 / 0.25); }
/* The bar must stay one row: on two it covers the top of whatever the page
   scrolls to under it. Labels go first from the longest (Russian, Italian),
   then the bar folds into the "more" menu while the layout is one column. */
@media (max-width: 1366px) { .topbar .tb-wide [data-act="leave"] .tb-label { display: none; } }
@media (max-width: 1240px) { .topbar .tb-wide :is([data-act="vocab"], [data-act="reading"], [data-act="story"], [data-act="deck"]) .tb-label { display: none; } }
@media (max-width: 900px) {
  .topbar { flex-wrap: nowrap; gap: 6px; }
  .topbar > * { min-width: 0; flex: 0 0 auto; }
  .topbar .room-code { overflow: hidden; }
  .tb-more { margin-left: auto; }
  .topbar .brand-name { display: none; }
  .topbar .tb-wide { display: none; }
  .tb-more { display: inline-flex; }
  .topbar .tb-group + .tb-group { margin-left: 0; padding-left: 0; border-left: 0; }
}
.room-code { cursor: pointer; font-family: var(--display); letter-spacing: 0.08em; }
.room-code:hover { border-color: var(--brand-2); }
.layout {
  display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px;
  padding: 18px 20px; max-width: 1360px; margin: 0 auto;
}
@media (max-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1fr); padding: 14px 16px; }
  .topbar { padding: 10px 16px; }
}
.stage { display: grid; gap: 18px; align-content: start; min-width: 0; }
.sidebar { display: grid; gap: 16px; align-content: start; min-width: 0; }

.mode-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 18px; }
.mode-bar h2 { font-size: 22px; }
.mode-bar .spacer { flex: 1; }
.mode-bar .big-emoji {
  width: 46px; height: 46px; display: grid; place-items: center; border-radius: 14px;
  background: var(--panel-hi); border: 1px solid var(--line);
}

.players { display: grid; gap: 4px; }
.player {
  display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center;
  padding: 7px 9px; border-radius: 14px; transition: background 0.2s;
}
.player.me { background: rgb(var(--violet-rgb) / 0.12); box-shadow: inset 0 0 0 1px rgb(var(--violet-rgb) / 0.25); }
.player.off { opacity: 0.4; }
.player .avatar {
  width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center;
  font-weight: 800; color: #fff; box-shadow: inset 0 -8px 16px rgba(0, 0, 0, 0.2);
}
.player .name { font-weight: 700; display: flex; gap: 6px; align-items: center; }
.player .langs { font-size: 12px; color: var(--muted); }
.player .score { font-weight: 800; font-size: 18px; font-family: var(--display); }

.clock-bars { display: grid; gap: 10px; }
.clock-bar { display: grid; grid-template-columns: 78px 1fr 44px; gap: 10px; align-items: center; font-size: 13px; font-weight: 600; }
.clock-bar .track { height: 8px; background: rgb(var(--fg) / 0.08); border-radius: 99px; overflow: hidden; }
.clock-bar .fill { height: 100%; border-radius: 99px; transition: width 0.5s ease; }
.clock-bar.active .track { box-shadow: 0 0 0 2px var(--warn), 0 0 16px rgba(255, 181, 71, 0.4); }

.tabs { display: flex; gap: 4px; margin-bottom: 12px; padding: 4px; background: var(--well-soft); border-radius: 12px; border: 1px solid var(--line); }
.tabs button { flex: 1; border: 0; background: transparent; font-weight: 700; padding: 7px 10px; border-radius: 9px; cursor: pointer; color: var(--muted); transition: background 0.2s, color 0.2s; }
.tabs button.on { background: var(--panel-hi); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-hi); }
.feed { display: grid; gap: 6px; max-height: 280px; overflow-y: auto; font-size: 14px; align-content: start; }
.feed .plus { color: var(--ok); font-weight: 800; }
.feed .minus { color: var(--bad); font-weight: 800; }
.chat-form { display: grid; grid-template-columns: 1fr auto auto; gap: 6px; margin-top: 10px; }
.chat-form .input { min-width: 0; }
.chat-msg { line-height: 1.45; overflow-wrap: anywhere; }
.chat-msg .chat-tr { background: none; border: 0; cursor: pointer; opacity: 0.35; padding: 0 2px; font-size: 12px; }
.chat-msg:hover .chat-tr { opacity: 1; }
.chat-msg .tr-out { margin-top: 3px; font-size: 13px; color: var(--ai-ink); padding-left: 10px; border-left: 2px solid rgba(52, 212, 200, 0.4); }

.correction { border: 1px solid var(--line-hi); border-radius: 14px; padding: 12px; display: grid; gap: 6px; font-size: 14px; background: var(--well-soft); }
.correction del { color: var(--bad); }
.correction ins { color: var(--ok); text-decoration: none; font-weight: 700; }

/* ---------- lobby ---------- */

.modes-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.mode-card {
  position: relative; overflow: hidden;
  display: grid; gap: 8px; grid-template-rows: auto auto 1fr auto; text-align: left; cursor: pointer;
  border: 1px solid var(--line); background: var(--panel); border-radius: var(--radius); padding: 18px;
  color: var(--ink);
  transition: transform 0.2s ease, border-color 0.2s, box-shadow 0.25s, background 0.2s;
}
.mode-card::before {
  content: ''; position: absolute; inset: 0; opacity: 0; transition: opacity 0.25s;
  background: radial-gradient(400px 160px at 0% 0%, rgb(var(--violet-rgb) / 0.22), transparent 70%);
  pointer-events: none;
}
@media (hover: hover) and (pointer: fine) { .mode-card:hover { transform: translateY(-3px); border-color: rgb(var(--violet-rgb) / 0.5); box-shadow: var(--glow); } }
.mode-card:hover::before { opacity: 1; }
.mode-card:disabled { cursor: default; transform: none; border-color: var(--line); box-shadow: none; opacity: 0.55; }
.mode-card:disabled::before { opacity: 0; }
.mode-card .icon {
  font-size: 30px; color: var(--violet-ink); width: 54px; height: 54px; display: grid; place-items: center;
  border-radius: 16px; background: var(--panel-hi); border: 1px solid var(--line);
}
.mode-card h3 { font-size: 18px; }
.mode-card p { margin: 0; font-size: 14px; color: var(--muted); line-height: 1.45; }
.mode-card .pill { justify-self: start; }

/* ---------- common game bits ---------- */

.banner {
  border-radius: var(--radius); padding: 16px 20px; background: var(--grad);
  color: #fff; font-weight: 700; font-size: 18px;
  box-shadow: 0 14px 40px -16px rgb(var(--brand-rgb) / 0.6);
}
.banner.soft { background: var(--panel); color: var(--ink); border: 1px solid var(--line); box-shadow: none; }
.list { display: grid; gap: 8px; }
.list-item { display: flex; gap: 10px; align-items: center; justify-content: space-between; border: 1px solid var(--line); background: var(--well-soft); border-radius: 14px; padding: 11px 13px; flex-wrap: wrap; }

/* taboo */
.taboo-card {
  background: linear-gradient(180deg, rgb(var(--violet-rgb) / 0.16), rgb(var(--brand-rgb) / 0.08));
  border: 1px solid rgb(var(--violet-rgb) / 0.45); border-radius: 24px; padding: 24px;
  max-width: 380px; margin: 0 auto; text-align: center; box-shadow: var(--glow);
}
.taboo-card .word { font-size: 36px; font-weight: 700; font-family: var(--display); }
.taboo-card .forbidden { display: grid; gap: 4px; margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line-hi); }
.taboo-card .forbidden span { color: var(--bad); font-weight: 700; font-size: 18px; }

/* pictionary — the drawing surface stays paper-white */
.canvas-wrap { position: relative; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; aspect-ratio: 4 / 3; max-width: 100%; touch-action: none; border: 1px solid var(--line); }
.canvas-wrap canvas { width: 100%; height: 100%; display: block; }
.tools { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.swatch { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--bg); box-shadow: 0 0 0 1px var(--line-hi); cursor: pointer; transition: transform 0.12s; }
@media (hover: hover) and (pointer: fine) { .swatch:hover { transform: scale(1.1); } }
.swatch.on { box-shadow: 0 0 0 2px var(--ink); }
.hint { font-family: ui-monospace, monospace; font-size: 26px; letter-spacing: 3px; font-weight: 700; }
.pic-grid { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 14px; }
@media (max-width: 700px) { .pic-grid { grid-template-columns: minmax(0, 1fr); } }
.guess-log { max-height: 320px; overflow-y: auto; display: grid; gap: 4px; font-size: 14px; }

/* differences — scene cells use paper so the shape colours read true */
.diff-layout { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 14px; }
@media (max-width: 760px) { .diff-layout { grid-template-columns: minmax(0, 1fr); } }
.scene { display: grid; gap: 4px; }
.scene-grid { display: grid; gap: 6px; }
.scene-label { display: grid; place-items: center; font-weight: 800; color: var(--muted); font-size: 13px; }
.cell {
  aspect-ratio: 1; background: var(--paper); color: var(--paper-ink); border-radius: 12px; border: 3px solid transparent; cursor: pointer;
  display: grid; place-items: center; position: relative; padding: 4px; overflow: hidden; transition: transform 0.12s;
}
@media (hover: hover) and (pointer: fine) { .cell:hover { transform: scale(1.03); } }
.cell .items { font-size: clamp(14px, 3.2vw, 30px); line-height: 1; text-align: center; }
.cell svg { width: 70%; height: 70%; }
.cell svg.small { width: 40%; height: 40%; }
.cell.mine { border-color: var(--side-a); box-shadow: 0 0 18px rgb(var(--violet-rgb) / 0.6); }
.cell.theirs::after { content: '👀'; position: absolute; top: 2px; right: 4px; font-size: 14px; }
.cell.side-b.mine { border-color: var(--side-b); box-shadow: 0 0 18px rgba(255, 148, 71, 0.6); }
.cell.found { border-color: var(--ok); background: #dcf7ea; }
.cell.found::before { content: '✓'; position: absolute; top: 0; left: 6px; color: #129a5e; font-weight: 900; }
.cell.diff { border-color: var(--warn); background: #fff1d6; }
.cell.shake { animation: shake 0.4s; border-color: var(--bad); }
@keyframes shake { 20%, 60% { transform: translateX(-4px); } 40%, 80% { transform: translateX(4px); } }
.vocab { font-size: 14px; display: grid; gap: 10px; }
.vocab h4 { margin: 0 0 4px; font-size: 11px; text-transform: uppercase; color: var(--muted); letter-spacing: 0.12em; font-family: var(--font); }
.vocab .chips { display: flex; flex-wrap: wrap; gap: 4px; }
.vocab .chips span { background: var(--panel-hi); border: 1px solid var(--line); padding: 2px 8px; border-radius: 8px; }
.scenes-end { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 700px) { .scenes-end { grid-template-columns: 1fr; } }

/* escape */
.locks { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.lock { display: grid; gap: 10px; align-content: start; }
.lock.solved { border-color: rgb(16 185 129 / 0.6); background: rgb(16 185 129 / 0.08); }
.lock.shake { animation: shake 0.4s; border-color: var(--bad); }
.lock h3 { display: flex; gap: 8px; align-items: center; }
.clue { background: rgba(255, 181, 71, 0.08); border: 1px dashed rgba(255, 181, 71, 0.6); border-radius: 14px; padding: 11px 13px; font-size: 17px; font-weight: 600; display: grid; gap: 6px; }
.clue.native { background: rgb(var(--fg) / 0.04); border-color: var(--line-hi); font-weight: 500; font-size: 14px; }
.shelf { background: linear-gradient(180deg, #7b5a3a, #5c4028); border-radius: 12px; padding: 8px; display: flex; flex-wrap: wrap; gap: 2px; font-size: 26px; box-shadow: inset 0 -6px 0 #3f2b19; }
.digits { display: grid; grid-template-columns: repeat(3, 1fr) auto; gap: 6px; }
.digits input { text-align: center; font-size: 22px; font-weight: 800; font-family: var(--display); }
.wires { display: grid; gap: 8px; }
.wire { height: 22px; border-radius: 99px; border: 2px solid rgba(0, 0, 0, 0.35); cursor: pointer; position: relative; transition: transform 0.12s; }
.wire:hover { transform: scaleY(1.15); }
.wire.cut { background-image: linear-gradient(90deg, transparent 46%, var(--bg) 46%, var(--bg) 54%, transparent 54%) !important; opacity: 0.5; cursor: default; }
.clock-ctl { display: grid; grid-template-columns: 120px 1fr; gap: 12px; align-items: center; }
.clock-face { width: 120px; height: 120px; }

/* truth or lie / telephone */
.statement { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: start; border: 1px solid var(--line); border-radius: 16px; padding: 14px; background: var(--panel); }
.statement .num { font-size: 22px; font-weight: 700; font-family: var(--display); color: var(--brand-2); }
.statement.lie { border-color: rgba(255, 84, 104, 0.6); background: rgba(255, 84, 104, 0.08); }
.statement.truth { border-color: rgb(16 185 129 / 0.6); }
.statement .text { font-size: 18px; font-weight: 600; }
.vote-btn { text-align: left; width: 100%; justify-content: flex-start; }
.chain { display: grid; gap: 8px; }
.chain-step { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 11px 13px; animation: pop 0.3s; }
.chain-step .who { font-size: 12px; color: var(--muted); font-weight: 700; }
.chain-step .txt { font-size: 17px; font-weight: 600; }
@keyframes pop { from { transform: translateY(4px) scale(0.97); opacity: 0; } }

/* pronunciation */
.phrase { font-size: 30px; font-weight: 700; font-family: var(--display); text-align: center; padding: 22px; line-height: 1.3; }
.stars { display: flex; gap: 6px; justify-content: center; }
.stars button { background: none; border: 0; cursor: pointer; opacity: 0.5; transition: transform 0.12s, opacity 0.12s; }
.stars button.on, .stars button:hover { opacity: 1; transform: scale(1.12); }
.rec-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: var(--bad); animation: blink 1s infinite; box-shadow: 0 0 12px var(--bad); }
@keyframes blink { 50% { opacity: 0.2; } }
.meter { height: 12px; background: rgb(var(--fg) / 0.08); border-radius: 99px; overflow: hidden; }
.meter div { height: 100%; background: linear-gradient(90deg, var(--bad), var(--warn), var(--ok)); }
audio { border-radius: 99px; }
:root[data-theme="dark"] audio { filter: invert(0.9) hue-rotate(180deg); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) audio { filter: invert(0.9) hue-rotate(180deg); } }

/* ---------- modal & toasts ---------- */

.modal-backdrop { position: fixed; inset: 0; background: rgba(5, 4, 12, 0.65); backdrop-filter: blur(6px); display: grid; place-items: center; padding: 16px; z-index: 50; animation: fade 0.15s; }
.modal { background: var(--panel-solid); border: 1px solid var(--line-hi); border-radius: 24px; padding: 22px; width: min(520px, 100%); max-height: 90vh; overflow-y: auto; display: grid; gap: 14px; box-shadow: 0 40px 80px -20px rgba(0, 0, 0, 0.8); animation: pop 0.2s; }
.modal-head { display: flex; align-items: center; justify-content: space-between; }
.flashcard { border: 1px solid var(--line-hi); background: var(--well-soft); border-radius: 18px; padding: 22px; text-align: center; display: grid; gap: 10px; }
.flashcard .front { font-size: 22px; font-weight: 700; }
.flashcard .back { font-size: 24px; font-weight: 800; color: var(--ok); }
/* Above the lesson and story screens (z-index 200), or what they confirm (a
   word kept) was said under them, unseen. Toasts are only text, so taps go
   through them to the buttons of the screen underneath. */
#toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; z-index: 210; width: max-content; max-width: calc(100vw - 32px); pointer-events: none; }
/* During a call the captions own the bottom of the screen; toasts go up top. */
body.with-live-bar #toasts { top: 16px; bottom: auto; }
.toast { background: var(--panel-solid); border: 1px solid var(--line-hi); color: var(--ink); padding: 11px 16px; border-radius: 14px; font-weight: 600; animation: pop var(--dur-3) var(--ease-out); box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.7); }
.toast.bad { border-color: rgba(255, 84, 104, 0.6); box-shadow: 0 0 0 1px rgba(255, 84, 104, 0.3), 0 20px 40px -12px rgba(0, 0, 0, 0.7); }
.toast.ok { border-color: rgb(16 185 129 / 0.6); box-shadow: 0 0 0 1px rgb(16 185 129 / 0.3), 0 20px 40px -12px rgba(0, 0, 0, 0.7); }
@keyframes fade { from { opacity: 0; } }

/* ---------- translated call ---------- */

.call-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.call-tile { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 12px; display: grid; justify-items: center; gap: 8px; box-shadow: var(--shadow); transition: box-shadow 0.2s, opacity 0.2s, border-color 0.2s; }
.call-tile.away { opacity: 0.5; }
.call-tile.talking { border-color: var(--ok); box-shadow: 0 0 0 3px rgb(16 185 129 / 0.35), 0 0 40px -6px rgb(16 185 129 / 0.5); }
.call-avatar { width: 64px; height: 64px; border-radius: 22px; display: grid; place-items: center; font-size: 26px; font-weight: 800; color: #fff; }
.call-name { font-weight: 700; text-align: center; overflow-wrap: anywhere; }
.call-live { min-height: 64px; display: grid; gap: 4px; align-content: center; font-size: 18px; }
.call-live-line { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.call-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }
.call-bar { gap: 8px; }
.call-hint { flex-basis: 100%; font-size: 13px; }
.call-log { max-height: 420px; overflow-y: auto; display: grid; gap: 12px; align-content: start; }
.call-line { border-left: 3px solid var(--line-hi); padding: 2px 0 2px 12px; }
.call-line.own { border-left-color: var(--brand-2); }
.call-line-head { font-size: 13px; }
.call-line-main { font-size: 18px; font-weight: 600; }
.call-line-sub { font-size: 14px; }

/* ---------- local AI translator ---------- */

.ai-fab {
  position: fixed; right: 20px; bottom: 20px; z-index: 40;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 18px 13px 14px; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--grad-cool); color: #fff; font-weight: 700; font-size: 15px;
  box-shadow: 0 16px 40px -10px rgba(52, 212, 200, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.15) inset;
  transition: transform 0.2s ease, box-shadow 0.2s;
}
@media (hover: hover) and (pointer: fine) { .ai-fab:hover { transform: translateY(-2px) scale(1.02); } }
.ai-fab .spark { width: 26px; height: 26px; border-radius: 50%; background: rgba(255, 255, 255, 0.2); display: grid; place-items: center; }
.ai-fab.open { opacity: 0; pointer-events: none; transform: scale(0.9); }
@media (max-width: 600px) { .ai-fab .lbl { display: none; } .ai-fab { padding: 13px; } }

.ai-panel {
  position: fixed; right: 20px; bottom: 20px; z-index: 45;
  width: min(420px, calc(100vw - 32px)); max-height: min(720px, calc(100vh - 40px));
  display: grid; grid-template-rows: auto 1fr; overflow: hidden;
  background: var(--panel-glass); border: 1px solid var(--line-hi); border-radius: 26px;
  backdrop-filter: blur(24px) saturate(1.3); -webkit-backdrop-filter: blur(24px) saturate(1.3);
  box-shadow: 0 40px 90px -20px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(52, 212, 200, 0.12);
  transform-origin: bottom right; animation: panel-in 0.22s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
@keyframes panel-in { from { opacity: 0; transform: translateY(12px) scale(0.96); } }
@media (max-width: 600px) { .ai-panel { right: 16px; left: 16px; bottom: 16px; width: auto; } }
.ai-head {
  display: flex; align-items: center; gap: 8px; padding: 12px 14px 12px 10px;
  color: #fff; position: relative; overflow: hidden;
  background: radial-gradient(120% 140% at 18% 0%, #5a9bd8 0%, #3e83c4 45%, #275587 100%);
}
.ai-head .ai-title small { color: rgba(255, 255, 255, 0.82) !important; }
.ai-head .ai-brand { font-family: var(--display); font-weight: 900; font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; opacity: 0.85; }
.ai-head [data-ai="close"] { color: #fff; background: rgba(255, 255, 255, 0.14); border-color: transparent; }
.ai-head [data-ai="close"]:hover { background: rgba(255, 255, 255, 0.26); }

/* the penguin: idle blink + bobbing flags; .busy while translating, .hop when done */
.ai-mascot { width: 92px; height: 80px; flex: none; overflow: visible; filter: drop-shadow(0 6px 10px rgba(12, 30, 60, 0.35)); }
.ai-mascot * { transform-box: fill-box; transform-origin: center; }
.ai-mascot .pg-flag { animation: aim-bob 2.6s ease-in-out infinite; }
.ai-mascot .pg-flag + .pg-flag { animation-delay: -1.3s; }
.ai-mascot .pg-eye { animation: pg-blink 4.8s infinite; }
.ai-mascot .pg-eye + .pg-eye { animation-delay: 0.04s; }
.ai-mascot .pg-bubble { animation: pg-float 3.6s ease-in-out infinite; }
.ai-mascot .pg-bubble.b2 { animation-delay: -1.8s; }
.ai-mascot .pg-head { transform-origin: 50% 100%; animation: pg-sway 6s ease-in-out infinite; }
.ai-mascot .pg-arc { opacity: 0; transition: opacity 0.2s; }
.ai-mascot.busy .pg-arc { opacity: 0.9; animation: pg-dash 0.7s linear infinite; }
.ai-mascot.busy .pg-eyes { animation: pg-look 1.4s ease-in-out infinite; }
.ai-mascot.busy .pg-beak { animation: pg-talk 0.35s ease-in-out infinite; }
.ai-mascot.busy .pg-bubble { animation-duration: 1.2s; }
.ai-mascot.hop .pg-head { animation: pg-hop 0.5s cubic-bezier(0.3, 1.6, 0.5, 1); }
.ai-mascot.sad .pg-eye { transform: scaleY(0.55); animation: none; }
/* Its own name: the tour penguin's pg-bob (in %) would win and the flags barely move. */
@keyframes aim-bob { 50% { transform: translateY(-3px); } }
@keyframes pg-blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(0.1); } }
@keyframes pg-float { 0%, 100% { transform: translateY(0); opacity: 0.8; } 50% { transform: translateY(-4px); opacity: 1; } }
@keyframes pg-sway { 0%, 100% { transform: rotate(0); } 30% { transform: rotate(-2.5deg); } 70% { transform: rotate(2.5deg); } }
@keyframes pg-dash { to { stroke-dashoffset: -7; } }
@keyframes pg-look { 0%, 100% { transform: translate(-2.5px, -1px); } 50% { transform: translate(2.5px, -1px); } }
@keyframes pg-talk { 50% { transform: scaleY(0.82); } }
@keyframes pg-hop { 40% { transform: translateY(-7px) scale(1.04); } }
@media (max-width: 600px) { .ai-mascot { width: 70px; height: 61px; } }
@media (prefers-reduced-motion: reduce) { .ai-mascot *, .ai-mascot.busy * { animation: none !important; } }
.ai-head .ai-title { display: grid; gap: 1px; margin-right: auto; }
.ai-head .ai-title b { font-family: var(--display); font-size: 16px; }
.ai-head .ai-title small { color: var(--muted); font-size: 12px; }
.ai-body { padding: 16px 18px 18px; overflow-y: auto; display: grid; grid-auto-rows: max-content; gap: 12px; align-content: start; }
.ai-langs { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; }
.ai-langs select { padding: 9px 10px; font-size: 14px; }
.ai-swap { width: 36px; height: 36px; padding: 0; border-radius: 50%; }
.ai-input-wrap { position: relative; }
.ai-input-wrap textarea { min-height: 96px; padding-bottom: 40px; font-size: 16px; resize: none; }
.ai-input-tools { position: absolute; left: 8px; right: 8px; bottom: 8px; display: flex; gap: 6px; align-items: center; }
.ai-input-tools .count { margin-left: auto; font-size: 11px; color: var(--muted); padding-right: 4px; }
.ai-out {
  border-radius: 18px; padding: 14px 16px; min-height: 88px; display: grid; gap: 10px; align-content: start;
  background: linear-gradient(180deg, rgba(52, 212, 200, 0.10), rgb(var(--violet-rgb) / 0.08));
  border: 1px solid rgba(52, 212, 200, 0.28);
}
.ai-out .ai-text { font-size: 20px; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; font-family: var(--display); }
.ai-out .ai-text.placeholder { color: var(--muted); font-weight: 500; font-size: 15px; font-family: var(--font); }
.ai-out .ai-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.ai-status { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.ai-status .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.ai-status .dot.ready { background: var(--ok); box-shadow: 0 0 10px var(--ok); }
.ai-status .dot.busy { background: var(--warn); animation: blink 1s infinite; }
.ai-status .dot.bad { background: var(--bad); }
.ai-progress { height: 6px; border-radius: 99px; background: rgb(var(--fg) / 0.08); overflow: hidden; }
.ai-progress div { height: 100%; background: var(--grad-cool); transition: width 0.3s; }
.ai-thinking { display: inline-flex; gap: 4px; }
.ai-thinking i { width: 7px; height: 7px; border-radius: 50%; background: var(--brand-3); animation: bounce 1s infinite; }
.ai-thinking i:nth-child(2) { animation-delay: 0.15s; }
.ai-thinking i:nth-child(3) { animation-delay: 0.3s; }
@keyframes bounce { 0%, 80%, 100% { transform: translateY(0); opacity: 0.4; } 40% { transform: translateY(-5px); opacity: 1; } }
.ai-history { display: grid; gap: 6px; }
.ai-history h4 { font-size: 11px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); font-family: var(--font); }
.ai-hist-item {
  text-align: left; border: 1px solid var(--line); background: var(--well-soft); border-radius: 12px;
  padding: 8px 10px; cursor: pointer; display: grid; gap: 2px; font-size: 13px; color: var(--ink);
}
.ai-hist-item:hover { border-color: var(--line-hi); background: var(--panel-hi); }
.ai-hist-item .src { color: var(--muted); }
.ai-note { font-size: 11.5px; color: var(--muted); line-height: 1.45; }
.rec-on { background: linear-gradient(135deg, #ff5468, #e03352) !important; color: #fff !important; box-shadow: 0 0 0 3px rgba(255, 84, 104, 0.3) !important; }

/* ---------- icons & language tags ---------- */

.i { width: 1.15em; height: 1.15em; flex: none; vertical-align: -0.2em; stroke-width: 1.9; }
.btn .i { width: 16px; height: 16px; vertical-align: middle; }
.btn.big .i { width: 19px; height: 19px; }
.btn.small .i { width: 15px; height: 15px; }
.i.dim { opacity: 0.55; }
.i.ok { color: var(--ok); }
.i.bad { color: var(--bad); }
.i.gold { color: var(--warn); }
h2 .i, h3 .i { vertical-align: -0.15em; color: var(--ink-2); }
.banner .i { width: 20px; height: 20px; vertical-align: -4px; margin-right: 4px; }
.pill .i { width: 14px; height: 14px; }
.muted .i { opacity: 0.8; }

.lt {
  display: inline-grid; place-items: center; min-width: 26px; height: 18px; padding: 0 5px;
  border-radius: 6px; font-size: 10px; font-weight: 800; letter-spacing: 0.06em; line-height: 1;
  font-family: var(--display); vertical-align: 1px;
  background: rgb(var(--fg) / 0.06); color: var(--ink-2); border: 1px solid var(--line-hi);
}
.lt.es { color: var(--es-ink); border-color: rgb(245 158 11 / 0.35); background: rgb(245 158 11 / 0.1); }
.lt.zh { color: var(--zh-ink); border-color: rgb(239 68 68 / 0.35); background: rgb(239 68 68 / 0.1); }
.lt.it { color: var(--it-ink); border-color: rgb(139 92 246 / 0.35); background: rgb(139 92 246 / 0.1); }
.lt.en { color: var(--en-ink); border-color: rgba(59, 130, 246, 0.35); background: rgba(59, 130, 246, 0.1); }
.lt.ru { color: var(--ru-ink); border-color: rgb(16 185 129 / 0.35); background: rgb(16 185 129 / 0.1); }
.pill .lt { background: transparent; border: 0; padding: 0; min-width: 0; color: inherit; }

.mode-icon {
  width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; flex: none;
  background: rgb(var(--violet-rgb) / 0.12); border: 1px solid rgb(var(--violet-rgb) / 0.28); color: var(--violet-ink);
}
.mode-icon .i { width: 21px; height: 21px; }
.mode-card .icon .i { width: 24px; height: 24px; color: var(--violet-ink); }
.mode-card:hover .icon { background: rgb(var(--violet-rgb) / 0.16); border-color: rgb(var(--violet-rgb) / 0.4); }
.hero-icon {
  width: 64px; height: 64px; margin: 0 auto 6px; display: grid; place-items: center; border-radius: 20px;
  background: var(--panel-hi); border: 1px solid var(--line-hi); color: var(--ink-2);
}
.hero-icon .i { width: 30px; height: 30px; stroke-width: 1.6; }
.hero-icon.ok { color: var(--ok); border-color: rgb(16 185 129 / 0.4); background: rgb(16 185 129 / 0.08); }
.logo-mark .i { width: 58%; height: 58%; stroke-width: 2.2; color: #fff; }
.home-hero .logo-mark { font-size: 1em; width: 1.05em; height: 1.05em; border-radius: 28%; }
.ai-fab .spark .i { width: 15px; height: 15px; }
.ai-head small .i { width: 12px; height: 12px; vertical-align: -1px; }
.player .name .i { width: 14px; height: 14px; }
.player .langs { display: flex; align-items: center; gap: 4px; }
.player .langs .i { width: 12px; height: 12px; }
.clock-bar > span:first-child { display: flex; align-items: center; gap: 6px; }
.lang-pair .arrow .i { width: 16px; height: 16px; color: var(--muted); }
.room-code .i { width: 13px; height: 13px; }
.tabs button .i { width: 15px; height: 15px; vertical-align: -3px; margin-right: 2px; }
.chat-msg .chat-tr .i { width: 13px; height: 13px; color: var(--ai-ink); }
.call-tile .muted { display: flex; align-items: center; gap: 6px; }
.dot-size { display: inline-block; border-radius: 50%; background: currentColor; }
.star-row { display: inline-flex; gap: 2px; vertical-align: middle; }
.star-row .i, .i.on { color: var(--warn); }
.star-row .i.on, .stars button.on .i, .i.on { fill: var(--warn); }
.star-row .i:not(.on) { opacity: 0.35; }
.stars button { color: var(--warn); filter: none; }
.stars button .i { width: 34px; height: 34px; stroke-width: 1.6; }
.stars button.on .i, .stars button:hover .i { fill: var(--warn); }
.rank { width: 28px; height: 28px; display: inline-grid; place-items: center; border-radius: 50%; font-weight: 800; background: var(--panel-hi); }
.rank .i { width: 16px; height: 16px; }
.rank-1 { color: #ffc94d; background: rgba(255, 201, 77, 0.12); }
.rank-2 { color: var(--silver); background: rgba(207, 214, 228, 0.12); }
.rank-3 { color: #e0a070; background: rgba(224, 160, 112, 0.12); }
.pill .i + .i { margin-left: -4px; }
.spin .i { animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.feed > div .i { width: 14px; height: 14px; vertical-align: -2px; }

/* ---------- flags & theme switch ---------- */

.flag { width: 18px; height: 12px; border-radius: 3px; flex: none; display: inline-block; vertical-align: -1px; box-shadow: 0 0 0 1px rgb(var(--fg) / 0.12); overflow: hidden; }
.lt { gap: 5px; grid-auto-flow: column; }
.lt .flag { width: 15px; height: 10px; border-radius: 2px; }
.pill .lt { gap: 5px; }
.flag-select { position: relative; }
.flag-select .flag { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); pointer-events: none; width: 20px; height: 14px; }
.flag-select select.input { padding-left: 42px; }
.theme-toggle { width: 36px; height: 36px; padding: 0; border-radius: 50%; }
/* The day/night switch is a round icon everywhere but the phone menu, where
   every row reads as a labelled line. */
.theme-toggle .tb-label { display: none; }
.tb-menu .theme-toggle { width: 100%; height: auto; border-radius: 12px; padding: 11px 12px; justify-content: flex-start; }
.tb-menu .theme-toggle .tb-label { display: inline; }
.theme-toggle .i { width: 17px; height: 17px; }
.home-tools { position: fixed; top: 14px; right: 16px; z-index: 30; }

/* ---------- lessons ---------- */

.ls-intro, .ls-head { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.ls-head-text { flex: 1; min-width: 220px; display: grid; gap: 4px; }
.ls-head h2, .ls-intro h2 { font-size: 22px; }
.ls-head-icon, .ls-card-icon {
  width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; flex: none;
  background: linear-gradient(135deg, rgb(var(--violet-rgb) / 0.18), rgb(var(--brand-rgb) / 0.14));
  border: 1px solid rgb(var(--violet-rgb) / 0.3); color: var(--violet-ink);
}
.ls-head-icon .i, .ls-card-icon .i { width: 24px; height: 24px; }
.ls-card-icon { width: 44px; height: 44px; border-radius: 13px; }
.ls-card-icon .i { width: 21px; height: 21px; }

.ls-library { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.ls-card {
  position: relative; text-align: left; display: grid; gap: 6px; align-content: start; cursor: pointer; color: var(--ink);
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; overflow: hidden;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.25s;
}
@media (hover: hover) and (pointer: fine) { .ls-card:hover:not(:disabled) { transform: translateY(-3px); border-color: rgb(var(--violet-rgb) / 0.5); box-shadow: var(--glow); } }
.ls-card:disabled { cursor: default; }
.ls-card h3 { font-size: 18px; margin-top: 2px; }
.ls-card p { margin: 4px 0 0; font-size: 13.5px; color: var(--muted); line-height: 1.45; }
.ls-card-en { font-size: 12.5px; }
.ls-card-num { position: absolute; right: 16px; bottom: 6px; font-family: var(--display); font-size: 52px; font-weight: 700; color: rgb(var(--fg) / 0.05); pointer-events: none; }
.ok-pill { color: var(--ok); border-color: rgb(16 185 129 / 0.35); background: rgb(16 185 129 / 0.1); }

.ls-stepper { display: flex; align-items: center; gap: 6px; padding: 4px 2px; overflow-x: auto; }
.ls-step { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; font-weight: 600; white-space: nowrap; }
.ls-step-dot { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--panel-hi); border: 1px solid var(--line-hi); flex: none; }
.ls-step-dot .i { width: 15px; height: 15px; }
.ls-step.on { color: var(--ink); }
.ls-step.on .ls-step-dot { background: var(--grad); color: #fff; border-color: transparent; box-shadow: 0 6px 18px -6px rgb(var(--brand-rgb) / 0.6); }
.ls-step.done .ls-step-dot { background: rgb(16 185 129 / 0.14); color: var(--ok); border-color: rgb(16 185 129 / 0.4); }
.ls-step-line { flex: 1; min-width: 14px; height: 2px; border-radius: 2px; background: var(--line-hi); }
@media (max-width: 760px) { .ls-step:not(.on) .ls-step-label { display: none; } }

.ls-ready { gap: 10px; padding: 12px 16px; }
.ls-ready-people { display: flex; gap: 6px; flex-wrap: wrap; }
.ls-person { display: inline-flex; align-items: center; gap: 5px; padding: 5px 11px; border-radius: 99px; font-size: 13px; font-weight: 600; background: var(--panel-hi); border: 1px solid var(--line); color: var(--muted); }
.ls-person.ok { color: var(--ok); border-color: rgb(16 185 129 / 0.4); background: rgb(16 185 129 / 0.1); }
.ls-person .i { width: 13px; height: 13px; }

.ls-vocab { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.ls-word {
  border: 1px solid var(--line); background: var(--well-soft); border-radius: 16px; padding: 14px; cursor: pointer;
  display: grid; gap: 6px; transition: border-color 0.2s, background 0.2s;
}
.ls-word:hover { border-color: var(--line-hi); }
.ls-word.open { border-color: rgb(var(--violet-rgb) / 0.4); background: rgb(var(--violet-rgb) / 0.06); }
.ls-word-en { font-family: var(--display); font-size: 19px; font-weight: 700; }
.ls-word-tr { font-size: 14px; min-height: 20px; }
.ls-word-tools { display: flex; gap: 4px; justify-content: flex-end; }
.ls-say { flex: none; }

.ls-points { margin: 0; padding-left: 22px; display: grid; gap: 10px; line-height: 1.55; }
.ls-points li::marker { color: var(--brand-2); font-weight: 800; font-family: var(--display); }
.ls-point-en { font-size: 13px; margin-top: 2px; }
.ls-sub { font-size: 11px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); font-family: var(--font); margin-top: 4px; }
.ls-examples { display: grid; gap: 8px; }
.ls-example { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 14px; background: var(--well-soft); border: 1px solid var(--line); }
.ls-example-en { font-weight: 700; font-size: 16px; }

.ls-ex { gap: 16px; }
.ls-progress { height: 5px; border-radius: 99px; background: rgb(var(--fg) / 0.08); overflow: hidden; }
.ls-progress div { height: 100%; background: var(--grad); transition: width 0.4s; }
.ls-prompt-label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.1em; font-weight: 700; }
.ls-prompt { font-family: var(--display); font-size: 26px; font-weight: 600; line-height: 1.35; margin-top: -8px; }
.ls-blank { display: inline-block; min-width: 70px; border-bottom: 3px solid var(--brand-2); color: transparent; margin: 0 4px; }
.ls-answer-form { align-items: stretch; }
.ls-options { display: grid; gap: 8px; }
.ls-option { justify-content: flex-start; padding: 13px 14px; font-size: 16px; white-space: normal; text-align: left; }
.ls-letter { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--panel-hi); font-size: 13px; flex: none; margin-right: 4px; }
.ls-order-built { min-height: 58px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px; border-radius: 14px; border: 1px dashed var(--line-hi); background: var(--well-soft); }
.ls-order-pool { display: flex; flex-wrap: wrap; gap: 8px; }
.ls-chip {
  border: 1px solid var(--line-hi); background: var(--panel-hi); color: var(--ink); border-radius: 11px; padding: 9px 13px;
  font-weight: 600; font-size: 15px; cursor: pointer; transition: transform 0.12s, opacity 0.2s;
}
@media (hover: hover) and (pointer: fine) { .ls-chip:hover:not(:disabled) { transform: translateY(-1px); border-color: var(--brand-2); } }
.ls-chip:disabled { opacity: 0.25; cursor: default; }
.ls-chip.on { background: rgb(var(--violet-rgb) / 0.14); border-color: rgb(var(--violet-rgb) / 0.45); }
.ls-waiting { display: flex; gap: 8px; align-items: center; color: var(--muted); padding: 12px; border-radius: 12px; background: var(--well-soft); }
.ls-hint { padding: 10px 12px; border-radius: 12px; background: rgba(255, 181, 71, 0.1); border: 1px solid rgba(255, 181, 71, 0.35); font-size: 14px; }
.ls-result { display: grid; gap: 6px; padding: 14px 16px; border-radius: 16px; border: 1px solid; }
.ls-result.ok { background: rgb(16 185 129 / 0.09); border-color: rgb(16 185 129 / 0.4); }
.ls-result.close { background: rgba(255, 181, 71, 0.09); border-color: rgba(255, 181, 71, 0.45); }
.ls-result.wrong { background: rgba(255, 84, 104, 0.08); border-color: rgba(255, 84, 104, 0.4); }
.ls-result-head { font-family: var(--display); font-weight: 700; font-size: 18px; display: flex; gap: 8px; align-items: center; }
.ls-result.ok .ls-result-head { color: var(--ok); }
.ls-result.close .ls-result-head { color: var(--warn); }
.ls-result.wrong .ls-result-head { color: var(--bad); }
.ls-given { font-weight: 600; }
.ls-solution { display: flex; gap: 8px; align-items: center; font-family: var(--display); font-size: 18px; font-weight: 600; }

.ls-lines { display: grid; gap: 8px; }
.ls-line { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: start; padding: 12px; border-radius: 16px; border: 1px solid var(--line); background: var(--well-soft); opacity: 0.55; transition: opacity 0.2s, border-color 0.2s; }
.ls-line.read { opacity: 0.8; }
.ls-line.current { opacity: 1; border-color: rgb(var(--violet-rgb) / 0.5); background: rgb(var(--violet-rgb) / 0.07); box-shadow: var(--glow); }
.ls-line-en { font-size: 17px; font-weight: 600; }
.ls-role { width: 28px; height: 28px; border-radius: 9px; display: inline-grid; place-items: center; font-weight: 800; font-size: 13px; font-family: var(--display); color: #fff; flex: none; }
.ls-role-A { background: var(--brand-2); }
.ls-role-B { background: linear-gradient(135deg, #ff9447, #ff5c8a); }
.ls-heard { font-size: 13px; color: var(--muted); margin-top: 4px; }
.ls-heard b.good { color: var(--ok); }
.ls-heard b.mid { color: var(--warn); }
.ls-heard b.low { color: var(--bad); }

.ls-speak-prompt { font-family: var(--display); font-size: 22px; font-weight: 600; line-height: 1.4; }
.ls-tips { display: grid; gap: 8px; }
.ls-tips > div { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--well-soft); border: 1px solid var(--line); font-size: 14px; }
.ls-tips .i { color: var(--violet-ink); }

.ls-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.ls-sum-card { display: grid; gap: 8px; padding: 14px; border-radius: 16px; border: 1px solid var(--line); background: var(--well-soft); }
.ls-sum-name { font-weight: 700; }
.ls-sum-row { display: flex; justify-content: space-between; align-items: center; font-size: 14px; }

/* One pass, not infinite: an endless loop cut to 0.01ms freezes at whatever
   point of its cycle it happens to be (a dot left at 75% opacity). */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important; animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important; scroll-behavior: auto !important;
  }
}

/* Shared moves (use them with the --dur-* and --ease-* tokens). Transform and
   opacity only, so they never cost a layout. */
@keyframes m-in { from { opacity: 0; transform: translateY(8px); } }
@keyframes m-out { to { opacity: 0; transform: translateY(6px) scale(.98); } }
@keyframes m-pop { 40% { transform: scale(1.05); } }
@keyframes m-shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(5px); } }
/* A ring that swells and fades from an element's ::after: a pulse that does
   not repaint a growing box-shadow every frame. */
@keyframes m-glow-ring { from { transform: scale(1); opacity: 1; } to { transform: scale(var(--ring, 2.2)); opacity: 0; } }

/* ---------- live subtitles bar (visible in every mode) ---------- */

#live-root[hidden] { display: none; }
.live-bar {
  position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 35;
  display: grid; gap: 8px; padding: 10px 12px;
  background: var(--panel-glass); border: 1px solid var(--line-hi); border-radius: 20px;
  backdrop-filter: blur(20px) saturate(1.3); -webkit-backdrop-filter: blur(20px) saturate(1.3);
  box-shadow: 0 30px 70px -24px rgba(0, 0, 0, 0.8);
}
@media (min-width: 900px) { .live-bar { right: 116px; } }
.live-bar-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.live-badge { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 13px; }
.live-bar-log { display: grid; gap: 8px; max-height: 30vh; overflow-y: auto; }
.live-bar-log .call-line-main { font-size: 16px; }
/* The interim row keeps its line even when nobody is talking: collapsing it
   made the fixed bar grow and shrink on every phrase. It fades instead. */
.live-bar-interim { font-size: 15px; min-height: 1.5em; transition: opacity var(--dur-2) var(--ease-out); }
.live-bar-interim:empty { opacity: 0; }
.live-bar.mini .live-bar-interim:empty { display: none; }
.live-bar.mini { gap: 0; }
/* A line arriving in the log slides in; React mounts only new keys, so old
   lines don't replay it. A phrase just made final settles from grey to ink. */
.call-line { animation: m-in var(--dur-3) var(--ease-out) both; }
.call-line.just-final .call-line-main { animation: cap-settle 500ms var(--ease-out); }
.cap-tr { animation: m-in var(--dur-2) var(--ease-out) both; }
/* Interim words: only the new tail of the phrase fades in, not the whole line. */
.cap-new { animation: cap-in 140ms var(--ease-out); }
@keyframes cap-in { from { opacity: 0; filter: blur(2px); transform: translateY(2px); } }
@keyframes cap-settle { from { color: var(--muted); } }
/* A small breathing dot while a phrase is being heard. */
.live-bar-interim.listening::after {
  content: ''; display: inline-block; width: 6px; height: 6px; margin-left: 6px; vertical-align: middle;
  border-radius: 50%; background: var(--brand-2); animation: cap-dot 1.2s var(--ease-inout) infinite;
}
@keyframes cap-dot { 50% { opacity: .35; transform: scale(.7); } }
body.with-live-bar { padding-bottom: 34vh; }

/* A word in a language you are learning: click it to keep it in the deck. */
.vocab-word {
  background: none; border: 0; padding: 0; margin: 0; font: inherit; color: inherit;
  cursor: pointer; border-bottom: 1px dashed transparent; border-radius: 3px;
}
.vocab-word:hover { border-bottom-color: currentColor; background: rgba(124, 92, 255, 0.18); }
.vocab-word.saving { opacity: 0.5; }
.btn.tiny { padding: 2px 6px; border-radius: 8px; font-size: 12px; line-height: 1; }

/* ---------- tandem: segmented choices ---------- */
.seg { display: inline-flex; gap: 4px; padding: 4px; background: var(--well-soft); border: 1px solid var(--line); border-radius: 12px; }
.seg button, .seg-opt {
  border: 0; background: transparent; color: var(--muted); font: inherit; font-weight: 700; font-size: 13px;
  padding: 6px 10px; border-radius: 9px; cursor: pointer; display: inline-flex; align-items: center; gap: 8px;
  transition: background 0.2s, color 0.2s;
}
.seg button.on, .seg-opt.on { background: var(--panel-hi); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-hi); }
.seg-opt input { position: absolute; opacity: 0; pointer-events: none; }
.seg-opt:has(input:focus-visible) { outline: 2px solid var(--brand-2); outline-offset: 1px; }
.learn-seg { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
.learn-seg .seg-opt { justify-content: center; padding: 11px 12px; font-size: 15px; }
.learn-seg .flag { width: 22px; height: 15px; }
.lobby-me .learn-seg, .card .row .learn-seg { width: auto; }
.home-tools { display: flex; gap: 8px; align-items: center; }
.ui-seg button { padding: 5px 8px; font-size: 12px; letter-spacing: 0.04em; }

/* ---------- home: play form + how it works ---------- */
.home { max-width: 1080px; padding: 64px 16px 24px; }
.home-top { display: grid; gap: 28px; align-items: center; }
.home-side { width: 100%; max-width: 460px; margin: 0 auto; }
.home-hero .eyebrow .flag { vertical-align: -1px; }
.home-scroll { color: var(--muted); font-size: 14px; font-weight: 600; text-decoration: none; display: inline-flex; gap: 6px; align-items: center; }
.home-scroll:hover { color: var(--ink); }
.invite-banner { padding: 10px 12px; border-radius: var(--radius-sm); background: rgb(var(--violet-rgb) / 0.12); color: var(--violet-ink); font-weight: 600; display: flex; gap: 8px; align-items: center; }
.have-code summary { cursor: pointer; color: var(--muted); font-size: 14px; font-weight: 600; text-align: center; list-style: none; }
.have-code summary::-webkit-details-marker { display: none; }
.have-code[open] summary { margin-bottom: 10px; }
@media (min-width: 900px) {
  .home-top { grid-template-columns: 1.15fr 1fr; gap: 48px; min-height: calc(100vh - 140px); }
  .home-top .home-hero { justify-items: start; text-align: left; }
  .home-top .home-features { justify-content: flex-start; }
  .home-top .tagline { font-size: 19px; max-width: 34ch; }
}

.how { display: grid; gap: 56px; padding: 72px 0 24px; }
.how-title { text-align: center; font-family: var(--display); font-size: clamp(26px, 4vw, 36px); }
.how-step { display: grid; gap: 20px; align-items: center; }
.how-num { display: inline-flex; align-items: center; gap: 6px; font-family: var(--display); font-weight: 700; color: var(--violet-ink); background: rgb(var(--violet-rgb) / 0.12); padding: 4px 10px; border-radius: 99px; font-size: 14px; }
.how-num .i { width: 15px; height: 15px; }
.how-text h3 { font-size: clamp(20px, 2.6vw, 26px); margin: 12px 0 8px; font-family: var(--display); }
.how-text p { font-size: 16px; line-height: 1.55; margin: 0; max-width: 42ch; }
.how-shot { margin: 0; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line-hi); box-shadow: var(--shadow), 0 30px 60px -30px rgb(var(--violet-rgb) / 0.35); background: var(--panel-solid); aspect-ratio: 16 / 10; }
.how-shot img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top left; }
.how-shot.missing { display: none; }
@media (min-width: 900px) {
  .how-step { grid-template-columns: 1fr 1.6fr; gap: 48px; }
  .how-step.flip .how-text { order: 2; }
}

/* ---------- team card ---------- */
.team-card { display: grid; gap: 14px; }
.team-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.team-score { font-family: var(--display); font-size: 34px; font-weight: 800; line-height: 1; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.team-head .muted { font-size: 12px; }
.streak { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--muted); text-align: right; }
.streak .i { width: 26px; height: 26px; }
.streak.on { color: var(--warn); }
.streak.on b { color: var(--ink); }
.streak.met .i { filter: drop-shadow(0 0 8px rgba(255, 181, 71, 0.7)); }
.player .score.small { font-size: 13px; color: var(--muted); }
.goal { display: grid; gap: 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.goal-head { justify-content: space-between; }
.goal-head h3 { display: flex; gap: 6px; align-items: center; }
.goal-head h3 .i { width: 16px; height: 16px; }
.goal-seg button { padding: 3px 8px; font-size: 12px; }
.goal-help { font-size: 12px; margin-top: -6px; }
.goal .clock-bar { grid-template-columns: 108px 1fr auto; }
.goal .clock-bar .timer { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.goal-note { font-size: 13px; color: var(--ink-2); display: flex; gap: 6px; align-items: center; }
.goal-note .i { width: 15px; height: 15px; flex: none; }
.goal-note.ok { color: var(--ok); font-weight: 700; }
.room-clock { font-size: 12px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

/* ---------- lessons: tracks and coach ---------- */
.ls-tracks { margin-bottom: 0; }
.ls-tracks button { display: inline-flex; gap: 6px; align-items: center; justify-content: center; }
.ls-tracks .muted { font-weight: 500; }
.ls-word-lat { font-size: 12px; letter-spacing: 0.02em; }
.pill.coach-pill { background: rgba(255, 181, 71, 0.12); color: var(--warn); border-color: rgba(255, 181, 71, 0.3); }
.banner.coach-banner { background: rgba(255, 181, 71, 0.12); color: var(--ink); border: 1px solid rgba(255, 181, 71, 0.3); box-shadow: none; }
.how-shot.card-shot { aspect-ratio: auto; max-width: 400px; width: 100%; justify-self: center; background: transparent; }
.how-shot.card-shot img { height: auto; object-fit: contain; }
@media (min-width: 900px) { .how-step.flip { grid-template-columns: 1.6fr 1fr; } }
.how .btn { text-decoration: none; }

/* =================== home, sigment-style =================== */
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
.site-nav {
  position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 12px;
  padding: 12px max(16px, calc((100vw - 1200px) / 2)); background: rgb(var(--bg-rgb) / 0.78);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
}
.site-nav .spacer { flex: 1; }
.logo.small { font-size: 22px; text-decoration: none; color: var(--ink); gap: 8px; }
.logo.small span:not(.logo-mark) { background: none; color: var(--brand); -webkit-text-fill-color: currentColor; }
.logo-mark { background: var(--brand); box-shadow: 0 8px 20px -8px rgb(var(--brand-rgb) / 0.7); }
.site-links { display: flex; gap: 22px; margin-left: 18px; }
.site-links a { color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: 14px; }
.site-links a:hover { color: var(--ink); }
@media (max-width: 760px) { .site-links, .nav-cta { display: none; } .site-nav { gap: 8px; } }

.hero { position: relative; overflow: hidden; min-height: calc(100vh - 62px); display: grid; align-items: center; }
.hero-graph { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero::after { content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, rgb(var(--bg-rgb) / 0.92) 0%, rgb(var(--bg-rgb) / 0.55) 38%, transparent 62%); }
.hero-inner { position: relative; z-index: 1; width: 100%; max-width: 1200px; margin: 0 auto; padding: 56px 16px 64px; }
.hero-copy { max-width: 640px; display: grid; gap: 20px; justify-items: start; }
.hero .eyebrow {
  font-size: 12px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; display: inline-flex; gap: 8px; align-items: center;
  padding: 6px 12px; border-radius: 999px; background: rgb(var(--brand-rgb) / 0.08); color: var(--brand); border: 1px solid rgb(var(--brand-rgb) / 0.25);
}
.hero-title { font-size: clamp(40px, 6.6vw, 80px); line-height: 1.02; letter-spacing: -0.045em; font-weight: 800; }
.hero-title .hl { color: var(--brand); }
.hero-sub { font-size: clamp(16px, 1.6vw, 19px); line-height: 1.55; color: var(--ink-2); margin: 0; max-width: 52ch; }
.home-form { width: 100%; max-width: 560px; display: grid; gap: 14px; padding: 20px; box-shadow: 0 30px 60px -30px rgb(var(--fg) / 0.25), var(--shadow); }
.home-form-row { display: grid; grid-template-columns: 1fr 1.2fr; gap: 12px; align-items: end; }
.home-form-actions { display: grid; gap: 10px; }
@media (max-width: 560px) { .home-form-row { grid-template-columns: 1fr; } .hero::after { background: rgb(var(--bg-rgb) / 0.6); } }
.hero-links { gap: 8px; }

.band { background: var(--navy); color: var(--navy-ink); position: relative; overflow: hidden; }
.band::before { content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(600px 240px at 15% 0%, rgb(var(--brand-rgb) / 0.22), transparent 70%), radial-gradient(600px 260px at 90% 100%, rgb(16 185 129 / 0.16), transparent 70%); }
.band-inner { position: relative; max-width: 1200px; margin: 0 auto; padding: 44px 16px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; text-align: center; }
.stat-n { font-size: clamp(34px, 4.6vw, 52px); font-weight: 800; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.stat:nth-child(1) .stat-n { color: #ff4fa3; }
.stat:nth-child(2) .stat-n { color: #6ee7b7; }
.stat:nth-child(3) .stat-n { color: #93b4ff; }
.stat:nth-child(4) .stat-n { color: #fcd34d; }
.stat-l { color: #94a3b8; font-weight: 600; font-size: 14px; }
@media (max-width: 700px) { .stats-grid { grid-template-columns: repeat(2, 1fr); row-gap: 28px; } }

.home { max-width: 1200px; padding: 24px 16px 40px; }
.section-title { text-align: center; font-size: clamp(28px, 4vw, 44px); letter-spacing: -0.04em; }
.section-sub { text-align: center; max-width: 60ch; margin: 12px auto 0; font-size: 16px; line-height: 1.55; }
.how { padding-top: 64px; }
.how-shot { transition: transform 0.5s cubic-bezier(.2,.7,.2,1), box-shadow 0.5s; box-shadow: 0 40px 80px -40px rgb(var(--fg) / 0.35), var(--shadow); }
@media (hover: hover) and (pointer: fine) { .how-step:hover .how-shot { transform: translateY(-6px) rotate(-0.4deg); } }
.how-num { background: rgb(var(--brand-rgb) / 0.08); color: var(--brand); }

.vocab-teaser { display: grid; gap: 22px; padding: 90px 0 30px; }
.vt-grid { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; max-width: 900px; margin: 10px auto 0; }
.vt-chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 999px; cursor: pointer;
  background: var(--panel); border: 1px solid var(--line); color: var(--ink); font-weight: 600; box-shadow: var(--shadow);
  transition: transform 0.2s, border-color 0.2s;
}
@media (hover: hover) and (pointer: fine) { .vt-chip:hover { transform: translateY(-2px); border-color: rgb(var(--brand-rgb) / 0.5); } }
.vt-icon { color: var(--brand); display: inline-flex; }
.vt-icon .i { width: 16px; height: 16px; }

.cta-band .band-inner { padding: 80px 16px; }
.cta-band h2 { font-size: clamp(30px, 4.4vw, 50px); letter-spacing: -0.045em; color: #fff; }
.cta-band p { color: #cbd5e1; font-size: 17px; margin: 0; }

/* scroll reveal */
[data-reveal].watch { opacity: 0; transform: translateY(22px); transition: opacity 0.7s ease, transform 0.7s cubic-bezier(.2,.7,.2,1); }
[data-reveal].watch.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { [data-reveal].watch { opacity: 1; transform: none; transition: none; } .how-shot { transition: none; } }

/* =================== vocabulary book =================== */
.vb-modal { width: min(880px, calc(100vw - 32px)); max-height: calc(100vh - 48px); display: grid; grid-template-rows: auto auto 1fr; gap: 14px; }
.vb-scroll { overflow: auto; display: grid; gap: 14px; align-content: start; padding: 2px; }
.vb-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.vb-search { position: relative; flex: 1; min-width: 220px; }
.vb-search > .i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 16px; height: 16px; }
.vb-search .input { padding-left: 36px; }
.vb-dir button { gap: 6px; }
.vb-overall { display: grid; gap: 8px; }
.vb-meter { height: 6px; border-radius: 99px; background: rgb(var(--fg) / 0.08); overflow: hidden; display: block; }
.vb-meter > * { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), #ff4fa3); border-radius: 99px; transition: width 0.4s; }
.vb-topics { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.vb-topic {
  display: grid; gap: 6px; text-align: left; padding: 14px; border-radius: 14px; cursor: pointer; color: var(--ink);
  background: var(--panel); border: 1px solid var(--line); transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}
@media (hover: hover) and (pointer: fine) { .vb-topic:hover { transform: translateY(-2px); border-color: rgb(var(--brand-rgb) / 0.45); box-shadow: var(--shadow); } }
.vb-topic-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: rgb(var(--brand-rgb) / 0.1); color: var(--brand); flex: none; }
.vb-topic-icon .i { width: 18px; height: 18px; }
.vb-topic-name { font-weight: 800; letter-spacing: -0.02em; }
.vb-topic-sub { font-size: 12.5px; }
.vb-topic-head { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; justify-content: space-between; }
.vb-topic-title { display: flex; gap: 10px; align-items: center; flex: 1; min-width: 200px; }
.vb-list { display: grid; gap: 8px; }
.vb-word {
  display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center; padding: 12px 14px;
  border-radius: 14px; background: var(--panel); border: 1px solid var(--line); transition: border-color 0.2s, background 0.2s;
}
.vb-word.known { border-color: rgb(16 185 129 / 0.4); background: rgb(16 185 129 / 0.05); }
.vb-emoji { font-size: 28px; text-align: center; line-height: 1; color: var(--brand); }
.vb-emoji.big { font-size: 54px; }
.vb-main { font-weight: 800; font-size: 18px; letter-spacing: -0.01em; }
.vb-pf { font-weight: 600; font-size: 15px; }
.vb-lat { font-size: 12px; color: var(--muted); letter-spacing: 0.03em; }
.vb-tr { font-size: 14px; color: var(--ink-2); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 2px; }
.vb-gloss { color: var(--muted); display: inline-flex; gap: 5px; align-items: center; }
.vb-ex { font-size: 13px; margin-top: 4px; font-style: italic; color: var(--ink-2); }
.vb-tools { display: flex; gap: 4px; }
.vb-flash { cursor: pointer; min-height: 260px; }
.vb-hidden { font-size: 20px; font-weight: 700; }
.vb-done { gap: 12px; }
@media (max-width: 560px) { .vb-word { grid-template-columns: 34px 1fr; } .vb-tools { grid-column: 1 / -1; justify-content: flex-end; } }
.vb-modal { overflow: hidden; }

/* five languages: the learn picker wraps into a grid of flags */
.learn-seg { grid-template-columns: repeat(5, 1fr); }
.learn-seg .seg-opt { flex-direction: column; gap: 4px; padding: 9px 4px; font-size: 12.5px; }
.card .row .learn-seg { width: auto; }
.card .row .learn-seg .seg-opt { flex-direction: row; padding: 6px 10px; }
@media (max-width: 560px) { .card .row .learn-seg { grid-template-columns: repeat(5, auto); } .card .row .learn-seg .seg-opt span { display: none; } }

/* ---------- five languages: vocabulary switch, practice, "coming soon" ---------- */
.vb-dir button { padding: 5px 8px; gap: 5px; font-size: 12px; }
@media (max-width: 560px) { .vb-dir button span { display: none; } }
.sp-card { gap: 14px; }
.sp-sentence { font-size: clamp(19px, 2.4vw, 24px); font-weight: 700; line-height: 1.4; letter-spacing: -0.01em; }
.sp-blank { display: inline-block; color: var(--brand); border-bottom: 2px solid var(--brand); letter-spacing: 0.08em; padding: 0 2px; }
.sp-hint { font-size: 13.5px; color: var(--ink-2); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.sp-hint .i { width: 15px; height: 15px; color: var(--warn); }
.sp-options { display: grid; gap: 8px; }
.sp-option { justify-content: flex-start; text-align: left; white-space: normal; padding: 12px 14px; gap: 8px; }
.sp-option.right { box-shadow: inset 0 0 0 2px var(--ok); color: var(--ink); opacity: 1; }
.sp-option.wrong { box-shadow: inset 0 0 0 2px var(--bad); opacity: 1; }
.sp-listen { display: flex; gap: 8px; }
.sp-credit { font-size: 12px; text-align: right; display: flex; gap: 6px; align-items: center; justify-content: flex-end; }
.sp-credit .i { width: 13px; height: 13px; }
.mode-card.soon { opacity: 0.7; }
.soon-pill { background: rgb(245 158 11 / 0.1); color: var(--warn); border-color: rgb(245 158 11 / 0.3); }
.soon-pill .flag { width: 14px; height: 10px; }
.ls-tracks { flex-wrap: wrap; }
.ls-tracks button.empty { opacity: 0.6; }
@media (max-width: 700px) { .ls-tracks .ls-track-name { display: none; } }
.ls-soon { display: flex; gap: 8px; align-items: center; }
.credit-data { margin-top: 6px; font-size: 12px; }
.credit-data a { color: var(--muted); text-decoration: none; }
.credit-data a:hover { color: var(--ink); text-decoration: underline; }
.hero .eyebrow .flags { display: inline-flex; gap: 3px; }

/* =================== Linguino brand =================== */
h1, h2, h3, .section-title, .hero-title, .stat-n { font-family: var(--display); }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; font-family: var(--display); font-weight: 900; letter-spacing: -0.01em; }
.brand-mark { width: 38px; height: 38px; border-radius: 50%; display: block; box-shadow: 0 4px 14px -4px rgb(var(--violet-rgb) / 0.6); flex: none; }
.brand-name { font-size: 24px; line-height: 1; }
.brand-name small { display: block; font: 600 11px/1.2 var(--font); letter-spacing: 0.02em; opacity: 0.7; margin-top: 2px; }
.topbar .brand-mark { width: 34px; height: 34px; }
.topbar .brand-name { font-size: 21px; }

/* ---------- opening screen ---------- */
#splash { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; overflow: hidden; cursor: pointer; }
.sp-bg { position: absolute; inset: 0; background: radial-gradient(120% 90% at 50% 45%, #5a9ddb 0%, #3e83c4 45%, #2f6aa8 100%); }
.sp-center { position: relative; width: min(64vmin, 440px); aspect-ratio: 1; display: grid; place-items: center; }
.sp-logo { position: relative; width: 100%; height: 100%; border-radius: 50%; will-change: transform;
  animation: sp-pop 1s cubic-bezier(.34, 1.56, .64, 1) .2s both, sp-float 3.2s ease-in-out 1.3s infinite; }
.sp-ring { position: absolute; inset: -5%; width: 110%; height: 110%; transform: rotate(-90deg); overflow: visible; }
.sp-ring circle { fill: none; stroke: rgba(255, 255, 255, .85); stroke-width: 1.4; stroke-linecap: round; stroke-dasharray: 610; stroke-dashoffset: 610;
  filter: drop-shadow(0 0 6px rgba(255, 255, 255, .8)); animation: sp-draw 1.1s cubic-bezier(.65, 0, .35, 1) .05s forwards, sp-ring-pulse 2.4s ease-in-out 1.2s infinite; }
.sp-glow { position: absolute; inset: -18%; border-radius: 50%; background: radial-gradient(circle, rgba(255, 255, 255, .35), transparent 62%);
  animation: sp-glow 1.4s ease-out .3s both; }
.sp-by { position: absolute; z-index: 2; bottom: max(7vh, 40px); left: 0; right: 0; text-align: center; color: rgba(255, 255, 255, .88);
  font: 600 14px/1 var(--font); letter-spacing: .18em; text-transform: uppercase; animation: sp-rise .8s cubic-bezier(.2, .7, .2, 1) 1.05s both; }
.sp-by b { font-family: var(--display); font-weight: 900; letter-spacing: .06em; color: #fff; text-transform: none; font-size: 18px; margin-left: 4px; }
.sp-bubbles span {
  position: absolute; left: var(--x); bottom: -60px; padding: 8px 14px; border-radius: 16px 16px 16px 4px;
  background: rgba(255, 255, 255, .18); color: #fff; font: 800 15px/1 var(--display); backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, .28); animation: sp-bubble 3.6s cubic-bezier(.3, .6, .4, 1) calc(.4s + var(--d)) both;
}
.sp-vid { position: absolute; width: 112%; height: auto; opacity: 0; transform: scale(.94); will-change: opacity, transform;
  transition: opacity .45s ease, transform .45s cubic-bezier(.2, .7, .2, 1); pointer-events: none; }
#splash.video .sp-vid { opacity: 1; transform: none; }
/* The clip carries the brand on its own; the still logo and its ring step aside
   (their entrance animations would otherwise hold them visible). */
#splash.video .sp-logo, #splash.video .sp-ring { opacity: 0; animation: none !important; transition: opacity .3s ease; }
#splash.video .sp-glow { animation: sp-glow 1.4s ease-out both; opacity: .8; }
.sp-skip {
  position: absolute; right: max(4vw, 18px); bottom: max(4vh, 22px); z-index: 2; opacity: 0; pointer-events: none;
  padding: 9px 16px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .45); background: rgba(255, 255, 255, .14);
  color: #fff; font: 600 13px/1 var(--font); letter-spacing: .04em; cursor: pointer; backdrop-filter: blur(6px);
  transition: opacity .3s ease, background .2s ease, transform .2s ease;
}
#splash.video .sp-skip { opacity: 1; pointer-events: auto; transition-delay: .8s; }
@media (hover: hover) and (pointer: fine) { .sp-skip:hover { background: rgba(255, 255, 255, .26); transform: translateY(-1px); } }
.sp-skip:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
#splash.quick .sp-logo { animation: sp-pop .55s cubic-bezier(.34, 1.56, .64, 1) both; }
#splash.quick .sp-ring circle { animation-duration: .5s; }
#splash.quick .sp-by { animation-delay: .2s; }
#splash.quick .sp-bubbles { display: none; }
body.splash-on { overflow: hidden; }
body.splash-leaving #app { animation: app-in .7s cubic-bezier(.2, .7, .2, 1) both; }

@keyframes sp-pop { from { opacity: 0; transform: scale(.35) rotate(-14deg); filter: blur(10px); } 60% { opacity: 1; filter: blur(0); } to { opacity: 1; transform: scale(1) rotate(0); } }
@keyframes sp-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes sp-draw { to { stroke-dashoffset: 0; } }
@keyframes sp-ring-pulse { 0%, 100% { opacity: .85; } 50% { opacity: .45; } }
@keyframes sp-glow { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: scale(1); } }
@keyframes sp-rise { from { opacity: 0; transform: translateY(14px); letter-spacing: .5em; } to { opacity: 1; transform: none; } }
@keyframes sp-bubble { 0% { opacity: 0; transform: translateY(0) scale(.7); } 15% { opacity: 1; transform: translateY(-12vh) scale(1); } 100% { opacity: 0; transform: translateY(-78vh) scale(.95); } }
@keyframes app-in { from { opacity: 0; transform: translateY(10px) scale(.99); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .sp-logo, .sp-ring circle, .sp-glow, .sp-by, .sp-bubbles span { animation: none !important; }
  .sp-vid { display: none; }
  .sp-ring circle { stroke-dashoffset: 0; }
  .sp-bubbles { display: none; }
}

/* ---------- hero in the logo's blue ---------- */
.hero { background: radial-gradient(90% 120% at 72% 45%, color-mix(in srgb, var(--hero-a) 80%, #fff 20%) 0%, var(--hero-a) 40%, var(--hero-b) 100%);
  --ink: #ffffff; --muted: rgba(255, 255, 255, .72); --fg: 255 255 255; color: #fff; }
.hero::after { background: radial-gradient(60% 80% at 20% 50%, rgb(0 0 0 / .10), transparent 70%); }
.hero-inner { display: grid; gap: 40px; align-items: center; }
@media (min-width: 980px) { .hero-inner { grid-template-columns: 1.1fr 0.9fr; } }
.hero .eyebrow { background: rgba(255, 255, 255, .16); color: #fff; border-color: rgba(255, 255, 255, .3); }
.hero-title { color: #fff; text-shadow: 0 2px 0 rgb(0 0 0 / .06); font-weight: 900; letter-spacing: -0.03em; }
.hero-title .hl { color: #fff; background: linear-gradient(transparent 58%, rgb(var(--brand-rgb) / .95) 58%, rgb(var(--brand-rgb) / .95) 92%, transparent 92%); padding: 0 .06em; }
.hero-sub { color: rgba(255, 255, 255, .88); }
.hero .home-form { color: var(--paper-ink); background: #fff; border: 0; box-shadow: 0 30px 60px -24px rgb(8 30 60 / .45);
  --ink: #15304d; --ink-2: #42607f; --muted: #6a829d; --line: rgba(22, 48, 77, .09); --line-hi: rgba(22, 48, 77, .16); --panel-hi: rgba(22, 48, 77, .05); --well: #fff; --well-soft: rgba(22, 48, 77, .03); --placeholder: #90a4ba; }
.hero .hero-links .btn.ghost { color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .45); }
.hero .hero-links .btn.ghost:hover { background: rgba(255, 255, 255, .14); }
.hero-art { position: relative; display: grid; place-items: center; }
.hero-logo { width: min(440px, 80vw); aspect-ratio: 1; border-radius: 50%; animation: sp-float 4s ease-in-out infinite; filter: drop-shadow(0 30px 40px rgb(8 30 60 / .35)); }
.hero-credit { position: absolute; bottom: -8px; left: 50%; transform: translateX(-50%); white-space: nowrap; padding: 7px 14px; border-radius: 999px;
  background: rgba(255, 255, 255, .95); color: #15304d; font: 700 13px/1 var(--font); box-shadow: 0 10px 24px -10px rgb(8 30 60 / .5); }
.hero-credit b { font-family: var(--display); font-weight: 900; color: var(--brand); }
@media (max-width: 979px) { .hero-art { order: -1; } .hero-logo { width: min(260px, 62vw); } }
.site-nav .brand-name { color: var(--ink); }
.band { background: linear-gradient(135deg, #275587, #3e83c4); }
.band::before { background: radial-gradient(600px 240px at 15% 0%, rgb(255 255 255 / .12), transparent 70%), radial-gradient(600px 260px at 90% 100%, rgb(var(--brand-rgb) / .22), transparent 70%); }
.stat:nth-child(1) .stat-n { color: #fff; }
.stat:nth-child(2) .stat-n { color: #ffd0a8; }
.stat:nth-child(3) .stat-n { color: #cfe6ff; }
.stat:nth-child(4) .stat-n { color: #ffe08a; }
.stat-l { color: rgba(255, 255, 255, .78); }
.cta-band p { color: rgba(255, 255, 255, .85); }
.how-num, .vt-icon, .vb-topic-icon { color: var(--brand-2); }
.how-num { background: rgb(var(--violet-rgb) / .1); }
.vb-topic-icon { background: rgb(var(--violet-rgb) / .1); }
.credit b { background: none; -webkit-text-fill-color: currentColor; color: var(--brand); font-family: var(--display); font-weight: 900; }
.hero-logo { height: auto; object-fit: contain; }
.hero-title .hl { background: linear-gradient(transparent 70%, rgb(var(--brand-rgb) / .9) 70%, rgb(var(--brand-rgb) / .9) 88%, transparent 88%); }
.hero-title { font-size: clamp(38px, 5.6vw, 72px); }
/* Words drift on the right, around the logo, never under the headline. */
@media (min-width: 980px) { .hero-graph { -webkit-mask-image: linear-gradient(90deg, transparent 0 42%, #000 62%); mask-image: linear-gradient(90deg, transparent 0 42%, #000 62%); } }
@media (max-width: 979px) { .hero-graph { opacity: .45; } }
@media (max-width: 700px) { .hero-graph { display: none; } }
@media (max-width: 520px) {
  .site-nav .brand-name { display: none; }
  .site-nav .ui-seg button { padding: 4px 6px; font-size: 11px; }
  .site-nav .theme-toggle { width: 32px; height: 32px; }
}
.sp-bubbles { position: absolute; inset: 0 0 96px; pointer-events: none; }

/* "I speak" and "I want to learn", one row of flags each */
.lang-pick { display: grid; gap: 12px; }
.seg-opt.off { opacity: .35; cursor: not-allowed; }
.lobby-langs { display: grid; gap: 8px; }
.lobby-langs .row > .muted { min-width: 84px; }

/* home form: what I learn is the main choice; my own language is secondary */
.field-small { font-size: 12px; }
.field-small .learn-seg .seg-opt { padding: 6px 4px; font-size: 11.5px; }
.field-small .learn-seg .seg-opt .flag { width: 18px; height: 12px; }
.field-main { font-size: 14px; color: var(--ink); font-weight: 800; }
/* lobby: learn first, then play */
.lobby-h { font-size: 20px; display: flex; gap: 8px; align-items: center; margin-top: 6px; }
.lobby-h .i { width: 20px; height: 20px; color: var(--brand-2); }
.learn-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.learn-card { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; text-align: left; padding: 18px; border-radius: var(--radius);
  background: linear-gradient(135deg, rgb(var(--violet-rgb) / .12), rgb(var(--brand-rgb) / .08)); border: 1px solid rgb(var(--violet-rgb) / .3); color: var(--ink); cursor: pointer;
  transition: transform .2s, box-shadow .2s, border-color .2s; }
@media (hover: hover) and (pointer: fine) { .learn-card:hover { transform: translateY(-2px); border-color: rgb(var(--violet-rgb) / .6); box-shadow: var(--shadow); } }
.learn-card b { display: block; font-family: var(--display); font-size: 18px; font-weight: 900; }
.learn-card .muted { font-size: 13.5px; }
.learn-card > .i { width: 20px; height: 20px; color: var(--brand); }
.learn-icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--brand-2); color: #fff; }
.learn-icon .i { width: 24px; height: 24px; }
.lobby-lang-label { min-width: 130px; font-weight: 700; }
.small-row .learn-seg .seg-opt { padding: 4px 8px; font-size: 12px; }

/* ---------- how to play ---------- */
.card-wrap { position: relative; display: grid; }
.card-wrap > .mode-card, .card-wrap > .learn-card { height: 100%; }
.how-btn { position: absolute; right: 10px; top: 10px; z-index: 1; display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0; border-radius: 999px;
  font: 700 12.5px/1 var(--font); color: var(--brand-2); background: rgb(var(--violet-rgb) / .1); border: 1px solid rgb(var(--violet-rgb) / .3); cursor: pointer; transition: background .2s, transform .2s; }
@media (hover: hover) and (pointer: fine) { .how-btn:hover { background: rgb(var(--violet-rgb) / .2); transform: translateY(-1px); } }
.how-btn .i { width: 16px; height: 16px; }
.mode-card h3, .learn-card b { padding-right: 34px; }
.invite-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.invite-text { margin-right: auto; }
.invite-code { display: flex; gap: 6px; cursor: pointer; }
.invite-code span {
  font-family: var(--display); font-weight: 900; font-size: 22px; line-height: 1; letter-spacing: .04em;
  padding: 10px 12px; border-radius: 12px; background: var(--well-soft); border: 1px solid var(--line);
  color: var(--ink); font-variant-numeric: tabular-nums;
}
.invite-code:hover span { border-color: var(--brand-2); }
.invite-code:focus-visible { outline: 2px solid var(--brand-2); outline-offset: 3px; border-radius: 14px; }

.tut-modal { width: min(620px, calc(100vw - 32px)); }
.tut-icon { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--brand-2); color: #fff; vertical-align: -8px; margin-right: 4px; }
.tut-icon .i { width: 20px; height: 20px; }
.tut-meta { gap: 8px; }
.tut-score { background: rgb(var(--brand-rgb) / .1); color: var(--brand); border-color: rgb(var(--brand-rgb) / .3); }
.tut-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.tut-steps li { display: grid; grid-template-columns: 28px 36px 1fr; gap: 10px; align-items: center; padding: 12px; border-radius: 14px; background: var(--well-soft); border: 1px solid var(--line);
  line-height: 1.45; animation: tut-in .45s cubic-bezier(.2,.7,.2,1) calc(var(--i) * 70ms) both; }
.tut-num { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--brand); color: #fff; font: 900 13px/1 var(--display); }
.tut-step-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: rgb(var(--violet-rgb) / .1); color: var(--brand-2); }
.tut-step-icon .i { width: 18px; height: 18px; }
@keyframes tut-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .tut-steps li { animation: none; } }

/* the AI steps lead the "how it works" section */
.how-step.ai-step .how-num { background: rgb(var(--brand-rgb) / .12); color: var(--brand); }

/* ---------- someone is in the call ---------- */
#call-invite { position: fixed; top: 76px; left: 50%; transform: translateX(-50%); z-index: 60; display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: 18px; background: var(--panel-glass); border: 1px solid rgb(16 185 129 / .5); box-shadow: 0 20px 50px -20px rgb(0 0 0 / .5), 0 0 0 4px rgb(16 185 129 / .12);
  max-width: calc(100vw - 24px); animation: ci-in .45s cubic-bezier(.34,1.56,.64,1) both; backdrop-filter: blur(10px); }
.ci-ring { position: relative; isolation: isolate; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: var(--ok); color: #fff; flex: none; animation: ci-ring 1.6s ease-in-out infinite; }
.ci-ring::after, .btn.pulse::after, .cm-dot::after {
  content: ''; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none;
  background: var(--ring-c, rgb(16 185 129 / .55)); opacity: 0; animation: m-glow-ring 1.6s var(--ease-out) infinite;
}
.ci-ring::after { --ring: 1.6; }
.ci-ring .i { width: 20px; height: 20px; }
.ci-text { display: grid; gap: 2px; min-width: 0; }
.ci-text b { font-family: var(--display); font-size: 16px; }
.ci-text .muted { font-size: 12.5px; }
@keyframes ci-in { from { opacity: 0; transform: translate(-50%, -16px) scale(.96); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes ci-ring { 0%, 30%, 100% { transform: rotate(0); } 10% { transform: rotate(-12deg); } 20% { transform: rotate(12deg); } }
@media (max-width: 600px) { #call-invite { flex-wrap: wrap; top: 64px; width: calc(100vw - 24px); } .ci-text { flex: 1; } }
/* The ring grows more in height than width so it stands ~8px off every side. */
.btn.pulse { position: relative; isolation: isolate; }
.btn.pulse::after { --ring-c: rgb(var(--brand-rgb) / .6); --ring: 1.08, 1.4; animation-duration: 1.4s; }
/* ---------- microphone help ---------- */
#mic-hint { position: fixed; top: 12px; left: 16px; z-index: 70; display: flex; gap: 8px; align-items: center; max-width: 360px; padding: 12px 14px; border-radius: 14px;
  background: var(--brand-2); color: #fff; font-weight: 700; box-shadow: 0 16px 40px -16px rgb(0 0 0 / .5); animation: ci-in-l .35s ease both; }
#mic-hint .i { width: 18px; height: 18px; flex: none; }
#mic-hint .i:first-child { animation: hint-bob 1s ease-in-out infinite; }
@keyframes ci-in-l { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }
@keyframes hint-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
.mic-icon { background: var(--bad); }
.mic-os { font-size: 13px; line-height: 1.5; padding: 10px 12px; border-radius: 12px; background: var(--well-soft); border: 1px dashed var(--line-hi); }
.mic-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.mic-listen-help { font-size: 12.5px; flex-basis: 100%; }
@media (prefers-reduced-motion: reduce) { #call-invite, .ci-ring, .btn.pulse, #mic-hint, #mic-hint .i { animation: none !important; } }

/* ---------- microphone check on entering a room ---------- */
.gate-modal { width: min(460px, calc(100vw - 32px)); text-align: center; justify-items: center; padding: 30px 26px 22px; }
.gate-modal h2 { font-size: 24px; }
.gate-modal p { margin: 0; line-height: 1.55; }
.gate-modal .btn.big { width: 100%; }
.gate-mic { width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; background: var(--brand); color: #fff;
  box-shadow: 0 0 0 10px rgb(var(--brand-rgb) / .15), 0 0 0 22px rgb(var(--brand-rgb) / .07); animation: gate-pulse 1.8s ease-in-out infinite; }
.gate-mic .i { width: 38px; height: 38px; }
.gate-later { font-size: 12.5px; }
@keyframes gate-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
@media (prefers-reduced-motion: reduce) { .gate-mic { animation: none; } }
.gate-mic { background: var(--ok); box-shadow: 0 0 0 10px rgb(16 185 129 / .15), 0 0 0 22px rgb(16 185 129 / .07); }
.gate-here { background: rgb(16 185 129 / .12); color: var(--ok); border-color: rgb(16 185 129 / .3); }

/* what my captions are doing */
.stt-pill { font-size: 12px; }
.stt-listening { background: rgb(16 185 129 / .12); color: var(--ok); border-color: rgb(16 185 129 / .35); }
.stt-listening .i { animation: stt-live 1.4s ease-in-out infinite; }
.stt-paused, .stt-listenOnly { background: rgb(var(--violet-rgb) / .12); color: var(--brand-2); }
.stt-muted, .stt-blocked, .stt-audio { background: rgb(244 63 94 / .12); color: var(--bad); border-color: rgb(244 63 94 / .35); }
.stt-network { background: rgb(245 158 11 / .12); color: var(--warn); }
.stt-optIn { background: rgb(var(--violet-rgb) / .12); color: var(--brand-2); border-color: rgb(var(--violet-rgb) / .35); cursor: pointer; }
@keyframes stt-live { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .stt-listening .i { animation: none; } }

/* ---------- my call: mini panel, big sheet, floating window ---------- */
.call-mini { position: fixed; top: 70px; right: 16px; z-index: 55; animation: ci-in-l .35s ease both; }
.cm { display: grid; gap: 10px; padding: 12px; border-radius: 18px; background: var(--panel-glass); border: 1px solid rgb(16 185 129 / .45);
  box-shadow: 0 20px 50px -24px rgb(0 0 0 / .6); backdrop-filter: blur(10px); min-width: 220px; }
.cm-head { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.cm-dot { position: relative; isolation: isolate; width: 9px; height: 9px; border-radius: 50%; background: var(--ok); }
.cm-dot::after { --ring-c: rgb(16 185 129 / .6); --ring: 2.5; }
.cm-time { font-variant-numeric: tabular-nums; font-size: 12.5px; margin-left: auto; }
.cm-people { display: flex; gap: 6px; flex-wrap: wrap; }
.cm-avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; color: #fff; font: 900 14px/1 var(--display); box-shadow: 0 0 0 2px var(--panel-solid); transition: box-shadow .2s; }
.cm-avatar.talking { box-shadow: 0 0 0 2px var(--panel-solid), 0 0 0 5px var(--ok); }
.cm-actions { display: flex; gap: 6px; justify-content: flex-end; }
.cm .stt-pill { justify-self: start; }
.cm-lines { display: grid; gap: 6px; max-height: 190px; overflow: auto; font-size: 13px; }
.cm-lines .call-line-main { font-size: 14px; }
/* the call floating above the other tabs (client/float.ts): its own small document */
body.float-body { margin: 0; padding: 0; min-height: 100vh; background: var(--bg); overflow: hidden; }
.float { display: flex; flex-direction: column; gap: 8px; height: 100vh; padding: 10px; box-sizing: border-box; }
.float-people { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.float-people .cm-avatar { width: 28px; height: 28px; font-size: 12px; }
.float-screen { position: relative; flex: none; }
.float-screen .screen-video { max-height: 42vh; }
.float-screen-name { position: absolute; left: 6px; bottom: 6px; padding: 2px 8px; border-radius: 999px; background: rgb(0 0 0 / .6); color: #fff; font-size: 12px; }
.float-log { flex: 1; min-height: 0; overflow-y: auto; display: grid; gap: 8px; align-content: start; }
.float-log .call-line-main { font-size: 15px; }
.float-interim { font-size: 14px; }
.float-interim:empty { display: none; }
.float-bar { display: flex; align-items: center; gap: 6px; flex: none; }
.call-sheet-backdrop { position: fixed; inset: 0; background: rgb(5 12 24 / .5); backdrop-filter: blur(4px); z-index: 56; animation: fade .2s; }
.call-sheet { position: fixed; z-index: 57; inset: 64px max(16px, calc((100vw - 1000px) / 2)) 16px; overflow: auto; display: grid; gap: 14px; align-content: start;
  padding: 18px; border-radius: 24px; background: var(--bg); border: 1px solid var(--line-hi); box-shadow: 0 40px 80px -30px rgb(0 0 0 / .7); animation: sheet-in .35s cubic-bezier(.2,.7,.2,1) both; }
.call-sheet-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.call-sheet-head h2 { font-size: 22px; }
@keyframes sheet-in { from { opacity: 0; transform: translateY(24px) scale(.98); } to { opacity: 1; transform: none; } }
@media (max-width: 600px) { .call-mini { top: auto; bottom: 90px; right: 12px; left: 12px; } .call-sheet { inset: 56px 8px 8px; padding: 12px; } }
@media (prefers-reduced-motion: reduce) { .cm-dot, .call-sheet, .call-mini { animation: none; } }
/* the mini call sits in the empty right side of the top bar, as one compact row */
@media (min-width: 901px) {
  .call-mini { top: 9px; right: 16px; }
  .call-mini .cm { display: flex; align-items: center; gap: 10px; padding: 5px 6px 5px 12px; border-radius: 999px; min-width: 0; }
  .call-mini .cm-head { gap: 6px; font-size: 13px; }
  .call-mini .cm-time { margin-left: 2px; }
  .call-mini .cm-avatar { width: 26px; height: 26px; font-size: 12px; }
  .call-mini .cm-people { flex-wrap: nowrap; }
  .call-mini .stt-pill { display: none; }
  .call-mini .cm-actions .btn { width: 30px; height: 30px; padding: 5px; border-radius: 50%; }
}

/* the call bar is one horizontal row everywhere; on phones it sits above the captions */
.call-mini .cm { display: flex; align-items: center; gap: 10px; padding: 5px 6px 5px 12px; border-radius: 999px; min-width: 0; }
.call-mini .cm-head { gap: 6px; font-size: 13px; white-space: nowrap; }
.call-mini .cm-time { margin-left: 2px; }
.call-mini .cm-avatar { width: 26px; height: 26px; font-size: 12px; }
.call-mini .cm-people { flex-wrap: nowrap; }
.call-mini .cm-actions .btn { width: 30px; height: 30px; padding: 5px; border-radius: 50%; }
@media (max-width: 900px) { .call-mini { top: auto; bottom: 12px; left: 50%; right: auto; transform: translateX(-50%); } body.with-live-bar .call-mini { bottom: 150px; } }
.mode-bar .cm-dot { display: inline-block; vertical-align: 1px; }

/* lessons: how to practise, by level, grammar on each card */
.ls-how { display: grid; gap: 14px; }
.ls-how-head { display: flex; gap: 14px; align-items: center; }
.ls-how-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.ls-how-steps li { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border-radius: 14px; background: var(--well-soft); border: 1px solid var(--line); font-size: 14px; line-height: 1.45; }
.ls-how-steps b { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--brand); color: #fff; font: 900 13px/1 var(--display); }
.ls-roles { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ls-level { display: grid; gap: 10px; margin-top: 6px; }
.ls-level-h { display: flex; gap: 8px; align-items: center; font-size: 17px; }
.ls-level-pill { background: var(--brand-2); color: #fff; border-color: transparent; }
.ls-card-grammar { display: flex; gap: 6px; align-items: flex-start; font-size: 13px; font-weight: 700; color: var(--brand-2); line-height: 1.35; }
.ls-card-grammar .i { width: 15px; height: 15px; flex: none; margin-top: 1px; color: var(--warn); }

/* ---------- Memory ---------- */
.mem-intro { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.mem-intro > div { flex: 1; min-width: 220px; }
.mem-topics { display: flex; flex-wrap: wrap; gap: 10px; }
.mem-bar { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.mem-turn { display: flex; gap: 8px; align-items: center; font-size: 15px; }
.mem-turn.mine { color: var(--brand); }
.mem-langs { color: var(--muted); font-size: 13px; display: flex; gap: 6px; align-items: center; }
.mem-scores { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.mem-score { display: inline-flex; gap: 6px; align-items: center; padding: 4px 10px 4px 4px; border-radius: 999px; background: var(--well-soft); border: 1px solid var(--line); font-size: 13px; }
.mem-score.turn { border-color: var(--brand); box-shadow: 0 0 0 3px rgb(var(--brand-rgb) / .15); }
.mem-score .cm-avatar { width: 24px; height: 24px; font-size: 11px; }
.mem-streak { background: rgb(var(--brand-rgb) / .12); color: var(--brand); }
.mem-board { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; perspective: 1000px; }
@media (max-width: 560px) { .mem-board { gap: 8px; } }
.mem-card { aspect-ratio: 4 / 3; border: 0; padding: 0; background: none; cursor: pointer; }
.mem-inner { position: relative; display: block; width: 100%; height: 100%; transition: transform .5s cubic-bezier(.3,.7,.3,1.2); transform-style: preserve-3d; }
.mem-card.up .mem-inner { transform: rotateY(180deg); }
.mem-back, .mem-face { position: absolute; inset: 0; border-radius: 16px; backface-visibility: hidden; display: grid; place-items: center; }
.mem-back {
  background: radial-gradient(120% 120% at 30% 20%, #5fa3de 0%, #3e83c4 45%, #23507f 100%);
  box-shadow: var(--shadow); border: 2px solid rgb(255 255 255 / .18);
}
.mem-back img { width: 34%; opacity: .92; border-radius: 50%; filter: drop-shadow(0 4px 8px rgb(12 30 60 / .45)); }
@media (hover: hover) and (pointer: fine) { .mem-card:not(.up):hover .mem-back { filter: brightness(1.1); transform: translateY(-2px); } }
.mem-face { transform: rotateY(180deg); background: var(--panel-solid); border: 2px solid var(--line-hi); align-content: center; gap: 2px; padding: 8px; text-align: center; }
.mem-card.matched .mem-face { border-color: var(--by); box-shadow: 0 0 0 3px color-mix(in srgb, var(--by) 30%, transparent); }
.mem-flag { position: absolute; top: 8px; left: 8px; }
.mem-emoji { font-size: 22px; line-height: 1; }
.mem-text { font: 800 clamp(14px, 2vw, 19px)/1.2 var(--display); color: var(--ink); }
.mem-sub { font-size: 11.5px; color: var(--muted); }
@media (prefers-reduced-motion: reduce) { .mem-inner { transition: none; } }
.mem-board { max-width: 820px; width: 100%; margin: 0 auto; }
.mem-card { aspect-ratio: 5 / 3; }
.mem-back { overflow: hidden; }
.mem-back img { width: auto; height: auto; max-height: 64%; max-width: 46%; }

/* ---------- back arrow in the mode bar ---------- */
.back-btn { gap: 4px; }
/* ---------- voice channel (Discord-like) ---------- */
.vc-card { display: grid; gap: 10px; }
.vc-head { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.vc-head .i { width: 18px; height: 18px; color: var(--ok); }
.vc-count { margin-left: auto; }
.vc-members { display: grid; gap: 4px; }
.vc-member { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 10px; transition: background .2s; }
.vc-member:hover { background: var(--panel-hi); }
.vc-member .cm-avatar { width: 30px; height: 30px; font-size: 13px; transition: box-shadow .15s; }
.vc-member.talking .cm-avatar { box-shadow: 0 0 0 2px var(--panel-solid), 0 0 0 4px var(--ok); }
.vc-name { flex: 1; font-weight: 700; font-size: 14px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vc-icons { display: flex; gap: 4px; color: var(--bad); }
.vc-icons .i { width: 15px; height: 15px; }
.vc-empty { font-size: 13px; padding: 4px 2px; }
.vc-join { width: 100%; padding: 12px; font-size: 15px; }
.vc-connected { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px; border-radius: 12px; background: rgb(16 185 129 / .08); border: 1px solid rgb(16 185 129 / .3); flex-wrap: wrap; }
.vc-status { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.vc-status b { color: var(--ok); }
.vc-controls { display: flex; gap: 4px; }
.vc-controls .btn { width: 32px; height: 32px; padding: 6px; border-radius: 50%; }
/* the corner call bar is for phones; on desktop the voice channel does its job */
@media (min-width: 901px) { .call-mini { display: none; } }

/* =================== game feel =================== */
.fun-confetti { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 2000; }
.fun-float { position: fixed; z-index: 2001; transform: translateX(-50%); pointer-events: none; font: 900 20px/1 var(--display); color: var(--brand);
  text-shadow: 0 2px 0 rgb(0 0 0 / .15); animation: fun-rise 1.3s cubic-bezier(.2,.7,.2,1) forwards; }
.fun-float.fun-good { color: var(--ok); font-size: 26px; }
.fun-float.fun-bad { color: var(--bad); }
@keyframes fun-rise { 0% { opacity: 0; transform: translate(-50%, 10px) scale(.7); } 15% { opacity: 1; transform: translate(-50%, 0) scale(1.1); } 100% { opacity: 0; transform: translate(-50%, -60px) scale(1); } }
.timer.last { color: var(--bad); animation: tick-pulse 1s ease-in-out infinite; display: inline-block; }
@keyframes tick-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.18); } }

/* level + missions */
.fun-card { display: grid; gap: 10px; }
.lv-head { display: flex; align-items: center; gap: 10px; }
.lv-badge { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font: 900 18px/1 var(--display); color: #fff;
  background: linear-gradient(135deg, var(--brand), #f99a5a); box-shadow: 0 6px 16px -6px rgb(var(--brand-rgb) / .7); }
.lv-text { display: grid; flex: 1; }
.lv-text .muted { font-size: 12px; }
.lv-bar, .mis-bar { height: 7px; border-radius: 99px; background: rgb(var(--fg) / .08); overflow: hidden; }
.lv-bar > div { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--brand), #f99a5a); transition: width .6s cubic-bezier(.2,.7,.2,1); }
.mis-h { display: flex; gap: 6px; align-items: center; font-size: 14px; margin-top: 4px; }
.mis-h .i { width: 16px; height: 16px; color: var(--brand-2); }
.mis-list { display: grid; gap: 8px; }
.mis { display: grid; grid-template-columns: 30px 1fr auto; gap: 10px; align-items: center; }
.mis-icon { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: rgb(var(--violet-rgb) / .12); color: var(--brand-2); }
.mis-icon .i { width: 16px; height: 16px; }
.mis-body { display: grid; gap: 5px; font-size: 13px; font-weight: 600; }
.mis-bar > div { height: 100%; border-radius: 99px; background: var(--brand-2); transition: width .5s; }
.mis-xp { display: grid; justify-items: end; font-size: 12px; font-weight: 800; }
.mis-xp small { color: var(--brand); font-weight: 800; }
.mis.done .mis-icon { background: var(--ok); color: #fff; }
.mis.done .mis-bar > div { background: var(--ok); }
.mis.done .mis-body span { color: var(--muted); text-decoration: line-through; }

/* podium */
#podium { position: fixed; inset: 0; z-index: 1500; display: grid; place-items: center; background: rgb(5 12 24 / .55); backdrop-filter: blur(5px); animation: fade .25s; padding: 16px; }
.pd-card { background: var(--panel-solid); border: 1px solid var(--line-hi); border-radius: 26px; padding: 26px; width: min(480px, 100%); display: grid; gap: 16px; justify-items: center; text-align: center;
  box-shadow: 0 40px 80px -30px rgb(0 0 0 / .7); animation: pd-in .5s cubic-bezier(.34,1.56,.64,1); }
.pd-mascot { width: 92px; height: 92px; border-radius: 50%; }
.pd-mascot.happy { animation: pd-bounce 1s ease-in-out infinite; }
.pd-card h2 { font-size: 28px; }
.pd-stands { display: flex; align-items: flex-end; gap: 10px; }
.pd-col { display: grid; justify-items: center; gap: 4px; width: 110px; }
.pd-col .cm-avatar { width: 40px; height: 40px; font-size: 16px; }
.pd-col b { font-size: 14px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pd-pts { color: var(--brand); font-weight: 900; }
.pd-block { width: 100%; border-radius: 12px 12px 4px 4px; display: grid; place-items: center; font: 900 26px/1 var(--display); color: #fff; animation: pd-grow .6s cubic-bezier(.2,.7,.2,1) both; }
.pd-1 .pd-block { height: 110px; background: linear-gradient(180deg, #f59e0b, #d97706); }
.pd-2 .pd-block { height: 78px; background: linear-gradient(180deg, #94a3b8, #64748b); animation-delay: .1s; }
.pd-3 .pd-block { height: 56px; background: linear-gradient(180deg, #f99a5a, #c2410c); animation-delay: .2s; }
@keyframes pd-in { from { opacity: 0; transform: scale(.85) translateY(20px); } to { opacity: 1; transform: none; } }
@keyframes pd-grow { from { transform: scaleY(0); transform-origin: bottom; } to { transform: scaleY(1); transform-origin: bottom; } }
@keyframes pd-bounce { 0%, 100% { transform: translateY(0) rotate(0); } 30% { transform: translateY(-12px) rotate(-6deg); } 60% { transform: translateY(0) rotate(4deg); } }

/* review */
.rv-modal { width: min(560px, calc(100vw - 32px)); }
.rv-body { display: grid; gap: 14px; }
.rv-top { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.rv-meter { flex: 1; height: 7px; border-radius: 99px; background: rgb(var(--fg) / .08); overflow: hidden; }
.rv-meter > div { height: 100%; background: var(--ok); border-radius: 99px; transition: width .4s; }
.rv-streak { background: rgb(var(--brand-rgb) / .12); color: var(--brand); }
.rv-badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--brand); color: #fff; font: 800 11px/1 var(--font); }
/* the question, then the answer: four choices, tiles to build, or a line to write */
.rv-q { display: grid; gap: 12px; justify-items: center; text-align: center; padding: 22px 18px; border-radius: 20px; background: linear-gradient(135deg, #3e83c4, #275587); color: #fff; box-shadow: 0 20px 40px -24px rgb(8 30 60 / .7); animation: rv-in .3s ease both; }
.rv-q .rv-ask { color: rgb(255 255 255 / .85); font-size: 13px; font-weight: 700; display: flex; gap: 6px; align-items: center; }
.rv-q .btn.ghost { color: #fff; box-shadow: inset 0 0 0 1px rgb(255 255 255 / .4); background: transparent; }
.rv-q.retry { background: linear-gradient(135deg, #ef6c12, #b8500c); }
.rv-retry { font-size: 12px; font-weight: 800; display: flex; gap: 6px; align-items: center; color: rgb(255 255 255 / .9); }
.rv-cue { font: 900 clamp(24px, 4vw, 32px)/1.2 var(--display); }
.rv-cue del { opacity: .85; }
.rv-prompt-word { display: flex; align-items: center; gap: 10px; }
.rv-speakers { display: flex; align-items: flex-end; gap: 12px; }
.rv-q .rv-speak { width: 76px; height: 76px; border-radius: 22px; padding: 0; display: grid; place-items: center; }
.rv-speak .i { width: 34px; height: 34px; }
.rv-q .rv-speak.slow { width: 54px; height: 54px; border-radius: 16px; }
.rv-speak.slow .i { width: 24px; height: 24px; }
.rv-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
/* The 3D lip is a box-shadow in the border's colour (--lip), not a thicker
   bottom border: shrinking a border on press changed the button's height and
   every option below it jumped. */
.rv-opt { display: flex; align-items: center; gap: 10px; padding: 14px; border-radius: 16px; border: 2px solid var(--line-hi); box-shadow: 0 2px 0 var(--lip, var(--line-hi)); background: var(--panel-solid); color: var(--ink); font: 700 16px/1.3 var(--font); text-align: left; cursor: pointer; transition: transform var(--dur-1) var(--ease-out), box-shadow var(--dur-1) var(--ease-out), border-color .15s; }
.rv-opt:hover:not(:disabled) { border-color: var(--brand); --lip: var(--brand); }
.rv-opt:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 0 0 var(--lip, var(--line-hi)); }
.rv-opt:disabled { cursor: default; }
.rv-opt kbd { flex: none; font: 700 11px/1 var(--font); color: var(--muted); border: 1px solid var(--line-hi); border-radius: 6px; padding: 3px 6px; }
.rv-opt.right { border-color: var(--ok); --lip: var(--ok); background: rgb(16 185 129 / .14); }
.rv-opt.wrong { border-color: var(--bad); --lip: var(--bad); background: rgb(244 63 94 / .12); animation: mem-shake .45s ease; }
.rv-build { display: grid; gap: 12px; }
.rv-line { min-height: 58px; display: flex; flex-wrap: wrap; gap: 8px; align-content: flex-start; padding: 10px 2px; border-bottom: 2px solid var(--line-hi); }
.rv-line.right { border-color: var(--ok); } .rv-line.close { border-color: var(--warn); } .rv-line.wrong { border-color: var(--bad); }
.rv-bank { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.rv-tile { padding: 8px 14px; border-radius: 12px; border: 2px solid var(--line-hi); box-shadow: 0 2px 0 var(--lip, var(--line-hi)); background: var(--panel-solid); color: var(--ink); font: 700 16px/1.2 var(--font); cursor: pointer; animation: rv-pop .18s ease both; transition: transform var(--dur-1) var(--ease-out), box-shadow var(--dur-1) var(--ease-out); }
.rv-tile:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 0 0 var(--lip, var(--line-hi)); }
.rv-tile.used { color: transparent; background: var(--well); border-color: var(--line); --lip: var(--line); animation: none; }
.rv-tile:disabled { cursor: default; }
.rv-check, .rv-continue { width: 100%; }
.rv-fb { display: grid; gap: 10px; padding: 16px; border-radius: 18px; border: 1px solid; animation: rv-up .25s ease both; }
.rv-fb.right { background: rgb(16 185 129 / .13); border-color: rgb(16 185 129 / .5); }
.rv-fb.close { background: rgb(245 158 11 / .13); border-color: rgb(245 158 11 / .5); }
.rv-fb.wrong { background: rgb(244 63 94 / .11); border-color: rgb(244 63 94 / .5); }
.rv-fb-head { display: flex; gap: 8px; align-items: center; font-size: 18px; }
.rv-fb.right .rv-fb-head { color: var(--ok); } .rv-fb.close .rv-fb-head { color: var(--warn); } .rv-fb.wrong .rv-fb-head { color: var(--bad); }
.rv-fb-answer { font: 800 20px/1.3 var(--display); }
.rv-fb .rv-note { font-size: 13px; color: var(--muted); }
.rv-continue kbd { margin-left: 6px; opacity: .7; font-family: inherit; }
.rv-cant { justify-self: center; }
.rv-note { font-size: 13px; max-width: 42ch; }
.rv-langs { display: flex; gap: 6px; flex-wrap: wrap; }
.rv-lang { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--well-soft); color: var(--ink); font: 700 13px/1 var(--font); cursor: pointer; }
.rv-lang.on { border-color: var(--brand); background: rgb(var(--brand-rgb) / .14); }
.rv-practice { background: rgb(var(--violet-rgb) / .14); color: var(--violet-ink); }
.rv-after { display: grid; gap: 8px; width: 100%; max-width: 360px; }
.rv-small { font-size: 12px; }
@keyframes rv-in { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes rv-up { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes rv-pop { from { opacity: 0; transform: scale(.85); } to { opacity: 1; transform: none; } }
.rv-done { display: grid; gap: 14px; justify-items: center; text-align: center; padding: 10px 0; }
.rv-mascot { width: 90px; height: 90px; border-radius: 50%; animation: pd-bounce 1.2s ease-in-out 2; }
.rv-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; width: 100%; }
.rv-stats div { display: grid; padding: 10px; border-radius: 14px; background: var(--well-soft); border: 1px solid var(--line); }
.rv-stats b { font: 900 22px/1.1 var(--display); color: var(--brand); } .rv-stats span { font-size: 12px; color: var(--muted); }
.rv-next { font-size: 12px; display: flex; gap: 4px; align-items: center; }
.learn-card.due { border-color: rgb(var(--brand-rgb) / .6); box-shadow: 0 0 0 3px rgb(var(--brand-rgb) / .12); }
.rv-icon { position: relative; background: var(--brand); }
.rv-icon .rv-badge { position: absolute; top: -6px; right: -6px; background: var(--bad); }
@media (max-width: 480px) { .rv-stats { grid-template-columns: repeat(2, 1fr); } .rv-opts { grid-template-columns: 1fr; } }

/* taboo: each new card lands with a bounce */
.taboo-card { animation: card-in .45s cubic-bezier(.34,1.56,.64,1); }
@keyframes card-in { from { opacity: 0; transform: translateY(18px) rotate(-3deg) scale(.92); } to { opacity: 1; transform: none; } }
/* memory: flips, a shake on a miss, a pop on a pair */
.mem-card.just-up .mem-inner { animation: mem-flip-up .45s cubic-bezier(.3,.7,.3,1.2); }
.mem-card.just-down .mem-inner { animation: mem-flip-down .45s ease; }
.mem-card.miss { animation: mem-shake .45s ease; }
.mem-card.just-matched .mem-face { animation: mem-pop .6s cubic-bezier(.34,1.56,.64,1); }
@keyframes mem-flip-up { from { transform: rotateY(0); } to { transform: rotateY(180deg); } }
@keyframes mem-flip-down { from { transform: rotateY(180deg); } to { transform: rotateY(0); } }
@keyframes mem-shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-8px); } 40% { transform: translateX(7px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(3px); } }
@keyframes mem-pop { 0% { transform: rotateY(180deg) scale(1); } 40% { transform: rotateY(180deg) scale(1.12); } 100% { transform: rotateY(180deg) scale(1); } }
@media (prefers-reduced-motion: reduce) {
  .fun-float, .pd-card, .pd-block, .pd-mascot, .rv-mascot, .taboo-card, .mem-card, .mem-inner, .mem-face, .timer.last { animation: none !important; }
  .rv-q, .rv-fb, .rv-tile, .rv-opt { animation: none !important; }
}

.pill.ka { background: rgb(219 39 119 / 0.12); color: var(--ka-ink); border-color: rgb(219 39 119 / 0.3); }
.lt.ka { color: var(--ka-ink); border-color: rgb(219 39 119 / 0.35); background: rgb(219 39 119 / 0.1); }
/* six languages: the flag pickers wrap to two rows of three on narrow screens */
.learn-seg { grid-template-columns: repeat(6, 1fr); }
@media (max-width: 560px) { .learn-seg { grid-template-columns: repeat(3, 1fr); } .card .row .learn-seg { grid-template-columns: repeat(6, auto); } }
@media (max-width: 760px) { .site-nav .nav-cta { display: none; } }
@media (max-width: 420px) { .site-nav .ui-seg button { padding: 4px 5px; font-size: 10.5px; } .site-nav { gap: 6px; padding-left: 10px; padding-right: 10px; } }
.ai-out .ai-wait { display: flex; align-items: center; gap: 10px; color: var(--brand-3); font-weight: 600; font-size: 15px; }
.ai-out .ai-text.stale { opacity: 0.35; filter: blur(0.5px); transition: opacity 0.2s; }

/* ---------- what to talk about: the topic / role-play card in the call ---------- */
.talk-card { display: grid; gap: 10px; }
.talk-card.tk-on { border-color: rgb(var(--violet-rgb) / 0.45); box-shadow: 0 0 0 1px rgb(var(--violet-rgb) / 0.18), var(--shadow); }
.tk-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 15px; }
.tk-head .i { width: 18px; height: 18px; color: var(--brand-2); }
.tk-gap { flex: 1 1 auto; }
.tk-hint { margin: 0; font-size: 14px; }
.tk-actions { gap: 8px; flex-wrap: wrap; }
.tk-topic { margin: 0; font-size: 22px; font-weight: 700; line-height: 1.35; display: flex; align-items: baseline; gap: 8px; overflow-wrap: anywhere; }
.tk-alt { margin: 0; font-size: 15px; }
.tk-note { margin: 0; font-size: 13px; }
.tk-note .i { width: 14px; height: 14px; vertical-align: -2px; }
.tk-role { font-size: 19px; }
.tk-goal, .tk-lines-head { margin: 0; font-size: 14px; }
.tk-lines { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.tk-lines li { display: flex; align-items: baseline; gap: 8px; padding: 7px 10px; border-radius: 10px; background: var(--well-soft); border: 1px solid var(--line); font-size: 16px; overflow-wrap: anywhere; }
.tk-say { flex: none; align-self: center; }
.tk-others { font-size: 13px; border-top: 1px solid var(--line); padding-top: 8px; }
/* the same card, one line, in the voice panel: it stays while they play something else */
.vc-talk { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 12px; cursor: pointer; background: rgb(var(--violet-rgb) / 0.1); border: 1px solid rgb(var(--violet-rgb) / 0.3); font-size: 13px; transition: background .2s; }
.vc-talk:hover { background: rgb(var(--violet-rgb) / 0.18); }
.vc-talk .i { width: 15px; height: 15px; flex: none; color: var(--brand-2); }
.vc-talk-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 560px) {
  .tk-topic { font-size: 19px; }
  .tk-actions .btn { flex: 1 1 auto; justify-content: center; }
}

/* ---------- the penguin asking for help with the bills ---------- */
.donate-band { background: var(--bg-2); color: var(--ink); }
.donate-band .band-inner { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: 28px; align-items: center; padding: 56px 16px; }
.donate-art { width: 100%; height: auto; max-width: 300px; justify-self: center; filter: drop-shadow(0 18px 30px rgb(0 0 0 / .35)); }
.donate-say h2 { font-size: clamp(24px, 3.2vw, 36px); letter-spacing: -0.03em; margin: 0; }
.donate-say p { font-size: 17px; margin: 0; color: var(--ink-2); }
.donate-fine { font-size: 13px; }
.donate a.btn, .donate-btn { text-decoration: none; }
.donate-btn { color: var(--brand); }
.donate-btn .i { color: var(--brand); }
@media (max-width: 720px) {
  .donate-band .band-inner { grid-template-columns: 1fr; gap: 18px; text-align: center; padding: 40px 16px; }
  .donate-art { max-width: 210px; }
  .donate-say p { font-size: 16px; }
}

/* the language the microphone will listen in, asked before joining the call */
.gate-langs { display: grid; gap: 8px; justify-items: center; width: 100%; }
.gate-flags { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.gate-flags .btn { gap: 8px; }
.gate-flags svg { width: 20px; height: 15px; }

/* the play button, with "install" beside it when the browser offers to */
.cta-row { gap: 12px; flex-wrap: wrap; justify-content: center; }

/* ---------- the account: a label on the id this device already had ---------- */

.acc-mount { display: contents; }
.field-hint { font-size: 12px; font-weight: 600; }
.acc-who { position: relative; display: inline-flex; }
.acc-me { gap: 8px; }
.acc-avatar {
  width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  background: var(--brand); color: #fff; font: 900 12px/1 var(--display); flex: 0 0 auto;
}
.acc-avatar.big { width: 42px; height: 42px; font-size: 18px; }
.acc-menu { display: none; }
.acc-menu:popover-open { display: grid; }
.acc-menu {
  position: fixed; inset: 62px 12px auto auto; margin: 0; width: min(280px, calc(100vw - 24px));
  gap: 10px; padding: 14px; border: 1px solid var(--line-hi); border-radius: 18px;
  background: var(--panel-solid, var(--bg)); box-shadow: 0 24px 60px -18px rgb(0 0 0 / 0.5); z-index: 60;
}
.acc-menu::backdrop { background: rgb(0 0 0 / 0.25); }
.acc-head { display: flex; gap: 10px; align-items: center; }
.acc-head b { display: block; }
.acc-note { display: flex; gap: 6px; align-items: center; font-size: 12.5px; }
.acc-menu .btn { justify-content: flex-start; width: 100%; gap: 10px; }

/* In the deck, where "and if this browser forgets?" is already the question. */
.acc-offer { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.acc-offer-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: var(--well-soft); }
.acc-offer > div { flex: 1; min-width: 180px; }

/* Said once, after an account takes this device's id: nothing was lost. */
.acc-welcome { max-width: 420px; text-align: center; justify-items: center; gap: 12px; }
.acc-welcome-art img { width: 96px; height: 96px; }
.acc-kept { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; text-align: start; width: 100%; }
.acc-kept li { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--well-soft); }
@media (max-width: 720px) { .acc-me .tb-label, .acc-in .tb-label { display: none; } }

/* the home, for somebody it already knows: no form, one button */
.home-again { gap: 12px; }
.again-head h2 { font-size: 26px; margin: 0; }
.again-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.again-row .btn { justify-content: center; padding: 12px; }
.again-row .btn.due { box-shadow: inset 0 0 0 2px var(--warn); }
.again-pair { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.again-pair svg { width: 20px; height: 15px; vertical-align: middle; }
.link-btn { background: none; border: 0; padding: 0; color: var(--brand-2); font: inherit; font-weight: 800; cursor: pointer; text-decoration: underline; }
.home-have-account { text-align: center; font-size: 13px; }

/* ---------- the way in, for a stranger ---------- */

.home-gate { text-align: left; }
.home-gate h2 { font-size: clamp(20px, 3.4vw, 26px); letter-spacing: -0.02em; }
.home-gate .btn.big { width: 100%; justify-content: center; }
.gate-why { display: grid; gap: 9px; margin: 2px 0 0; padding: 14px 0 0; border-top: 1px solid var(--line); list-style: none; }
.gate-why li { display: grid; grid-template-columns: 20px 1fr; gap: 10px; align-items: start; font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.gate-why .i { width: 18px; height: 18px; color: var(--brand-2); margin-top: 1px; }

/* ---------- the profile: home, once there is somebody to be at home ---------- */

.profile {
  width: min(980px, 100%);
  margin: 0 auto;
  padding: 18px 16px 48px;
  display: grid;
  gap: 18px;
}
.profile .section-title { text-align: left; font-size: clamp(19px, 2.4vw, 23px); display: flex; align-items: center; gap: 9px; }
.profile .section-title .i { width: 20px; height: 20px; color: var(--brand-2); }
.profile h2 { font-size: 17px; display: flex; align-items: center; gap: 8px; }
.profile h2 .i { width: 18px; height: 18px; color: var(--brand-2); }

.pf-edit { display: grid; gap: 14px; }

.pf-missions { display: grid; gap: 10px; }

/* ---------- the first minute of an account ---------- */

.ob {
  width: min(520px, 100%);
  margin: min(6vh, 48px) auto;
  display: grid;
  gap: 16px;
  padding: 22px;
}
.ob-top { display: grid; grid-template-columns: 32px 1fr auto; gap: 10px; align-items: center; }
.ob-back { justify-self: start; }
.ob-dots { display: flex; gap: 6px; justify-content: center; }
.ob-dots span { width: 26px; height: 4px; border-radius: 99px; background: rgb(var(--fg) / .12); transition: background .3s; }
.ob-dots span.on { background: var(--brand); }
.ob-count { font-size: 12px; font-weight: 700; }
/* Every step stays in the form so an answer survives the next question; the
   ones not being asked are hidden rather than thrown away. */
.ob-step { display: grid; gap: 14px; }
.ob-step[hidden] { display: none; }
.ob-step h1 { font-size: clamp(21px, 3.4vw, 27px); letter-spacing: -0.03em; }
.ob-step > p { margin-top: -8px; }
.ob-art { justify-self: center; width: 96px; height: 96px; }
.ob-name { font-size: 16px; }
.ob .btn.big { justify-content: center; }

.ob-goals { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.ob-goal {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 14px 6px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--well-soft);
  cursor: pointer;
  text-align: center;
  transition: border-color .18s, background .18s;
}
.ob-goal input { position: absolute; opacity: 0; pointer-events: none; }
.ob-goal:hover { border-color: var(--line-hi); }
.ob-goal:has(input:checked) { border-color: var(--brand); background: rgb(var(--brand-rgb) / .1); }
.ob-goal:has(input:focus-visible) { outline: 2px solid var(--brand-2); outline-offset: 2px; }
.ob-goal-n { font: 900 26px/1 var(--display); }
.ob-goal:has(input:checked) .ob-goal-n { color: var(--brand); }
.ob-goal-l { font-size: 11px; font-weight: 700; color: var(--ink-2); }
.ob-goal-h { font-size: 11px; }
.ob-levels { grid-template-columns: repeat(2, 1fr); }
.pf-cefr {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 6px;
  padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line);
  background: none; color: var(--ink-2); font: inherit; font-size: 13px; cursor: pointer;
}
.pf-cefr b { font: 900 13px/1 var(--display); color: var(--brand); }
.pf-cefr.ask { border-color: var(--brand); color: var(--brand); font-weight: 700; }
.pf-cefr:hover { border-color: var(--line-hi); }

.ob-ready { display: grid; gap: 14px; }
.ob-ready-row { display: grid; grid-template-columns: 38px 1fr; gap: 12px; align-items: start; }
.ob-ready-row > div { display: grid; gap: 2px; }
.ob-ready-row b { font-size: 15px; }
.ob-ready-row .muted { font-size: 12.5px; }
.pf-do-i.friends { background: rgb(var(--violet-rgb) / .16); color: var(--brand-2); }
.pf-do-i.deck { background: rgb(var(--fg) / .08); color: var(--ink-2); }
@media (max-width: 420px) {
  .ob { padding: 18px; margin-top: 12px; }
  .ob-goals { gap: 8px; }
}

/* A room left open, offered back rather than walked into. */
.pf-open {
  display: grid;
  gap: 12px;
  border-color: rgb(var(--brand-rgb) / .35);
  background: linear-gradient(180deg, rgb(var(--brand-rgb) / .1), transparent 70%), var(--panel);
}
.pf-open-say p { margin-top: 2px; font-size: 13px; }
.pf-open-do { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pf-open-code {
  font: 900 20px/1 var(--display);
  letter-spacing: .22em;
  padding: 9px 12px 9px 16px;
  border-radius: 12px;
  background: var(--well);
  border: 1px solid var(--line);
  color: var(--brand);
}
.pf-open-do .btn { flex: 1 1 auto; justify-content: center; }
.pf-open-do .link-btn { flex: 0 0 auto; }
@media (min-width: 620px) {
  .pf-open { grid-template-columns: 1fr auto; align-items: center; }
  .pf-open-do .btn { flex: 0 0 auto; }
}

/* ---------- the profile: who you are, then what there is to play ---------- */

/* Not a card. The person's own block, lit from the top like the hero is. */
.pf-head {
  display: grid;
  gap: 16px;
  padding: 20px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background:
    radial-gradient(120% 140% at 0% 0%, rgb(var(--brand-rgb) / .13), transparent 58%),
    radial-gradient(90% 120% at 100% 0%, rgb(var(--violet-rgb) / .14), transparent 60%),
    var(--panel);
}
.pf-id { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center; }
.pf-head h1 { font-size: clamp(22px, 3vw, 29px); letter-spacing: -0.035em; }
.pf-who { min-width: 0; }
.pf-pair { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; margin-top: 3px; }
.pf-pair svg { width: 20px; height: 15px; border-radius: 3px; }
.pf-level { display: grid; gap: 7px; }
.pf-level-say { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: 13px; }

/* The counts read as one line of facts about a person, not as four tiles. */
.pf-counts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  margin: 0;
  background: var(--line);
  border-radius: 14px;
  overflow: hidden;
}
.pf-counts > div { display: grid; gap: 3px; padding: 11px 12px; background: var(--panel-solid); }
.pf-counts dt { display: flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; color: var(--muted); }
.pf-counts dt .i { width: 14px; height: 14px; }
.pf-counts dd { margin: 0; font: 900 21px/1 var(--display); }
.pf-counts .warm dt, .pf-counts .warm dd { color: var(--brand); }

.pf-h { display: flex; align-items: center; gap: 9px; font-size: 18px; margin-bottom: 12px; }
.pf-h .i { width: 19px; height: 19px; color: var(--brand-2); }

/* ---------- the board ---------- */

.pf-games { display: grid; grid-template-columns: repeat(auto-fill, minmax(146px, 1fr)); gap: 12px; }
.pf-game {
  position: relative;
  display: grid;
  gap: 3px;
  justify-items: start;
  padding: 16px 15px 14px;
  border-radius: 16px;
  border: 1px solid rgb(var(--g) / .4);
  background: linear-gradient(165deg, rgb(var(--g) / .26), rgb(var(--g) / .1) 58%, rgb(var(--g) / .04)), var(--panel-solid);
  box-shadow: 0 6px 18px -14px rgb(var(--g) / .9);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  transition: transform .22s cubic-bezier(.2,.7,.2,1), border-color .22s, box-shadow .22s;
}
/* The wash that arrives on hover, painted rather than faded, so the colour
   moves across the card instead of the whole card changing brightness. */
.pf-game::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 110% at 50% 118%, rgb(var(--g) / .34), transparent 68%);
  opacity: 0;
  transition: opacity .28s ease;
  pointer-events: none;
}
@media (hover: hover) and (pointer: fine) { .pf-game:hover { transform: translateY(-4px); border-color: rgb(var(--g) / .78); box-shadow: 0 18px 34px -14px rgb(var(--g) / .85); } }
.pf-game:hover::after { opacity: 1; }
.pf-game:active { transform: translateY(-1px); }
.pf-game:focus-visible { outline: 2px solid rgb(var(--g) / .9); outline-offset: 2px; }
.pf-game-i {
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  margin-bottom: 9px;
  border-radius: 13px;
  background: rgb(var(--g) / .92);
  color: #0e1f36;
  box-shadow: 0 6px 16px -8px rgb(var(--g) / .9);
  transition: transform .28s cubic-bezier(.2,.7,.2,1), background .28s;
}
.pf-game-i .i { width: 22px; height: 22px; }
.pf-game:hover .pf-game-i { background: rgb(var(--g)); }
@media (hover: hover) and (pointer: fine) { .pf-game:hover .pf-game-i { transform: scale(1.09) rotate(-5deg); } }
.pf-game-n { position: relative; font-size: 15.5px; font-weight: 800; letter-spacing: -0.012em; line-height: 1.25; }
.pf-game-p { position: relative; margin-top: 2px; font-size: 11.5px; font-weight: 700; color: var(--ink-2); }
/* The ones that need nobody else say so with the colour, not with a badge. */
/* The ones you can start alone read a touch brighter: no waiting for anyone. */
.pf-game.solo { border-color: rgb(var(--g) / .55); }

/* ---------- the room bar ---------- */

.pf-room {
  display: grid;
  gap: 14px;
  padding: 16px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--panel);
}
.pf-room-say { display: grid; gap: 2px; }
.pf-room-say b { font-size: 15px; }
.pf-room-say .muted { font-size: 12.5px; }
.pf-room-do { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pf-room-or { font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .09em; }
.pf-room .join-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; flex: 1 1 200px; }
@media (min-width: 720px) {
  .pf-room { grid-template-columns: 1fr auto; align-items: center; }
  .pf-room .join-row { flex: 0 0 auto; width: 210px; }
}

/* ---------- rows, deliberately not more tiles ---------- */

.pf-rows { display: grid; gap: 8px; }
.pf-row {
  display: grid;
  grid-template-columns: 38px 1fr auto auto;
  gap: 12px;
  align-items: center;
  padding: 11px 14px 11px 11px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--well-soft);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color .2s, background .2s;
}
.pf-row:hover { border-color: rgb(var(--g) / .5); background: rgb(var(--g) / .07); }
.pf-row:focus-visible { outline: 2px solid var(--brand-2); outline-offset: 2px; }
.pf-row-i { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; background: rgb(var(--g) / .9); color: #0e1f36; }
.pf-row-i .i { width: 19px; height: 19px; }
.pf-row-t { display: grid; gap: 1px; min-width: 0; }
.pf-row-t b { font-size: 14.5px; }
.pf-row-t .muted { font-size: 12px; }
.pf-row-go { width: 17px; height: 17px; color: var(--muted); transition: transform .2s, color .2s; }
.pf-row:hover .pf-row-go { transform: translateX(3px); color: var(--ink); }
.pf-tag { padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 800; background: rgb(var(--fg) / .07); color: var(--ink-2); }
.pf-tag.due { background: rgb(var(--brand-rgb) / .16); color: var(--brand); }
.pf-tag.ok { display: inline-flex; gap: 4px; align-items: center; background: rgb(16 185 129 / .14); color: var(--ok); }
.pf-tag.ok .i { width: 12px; height: 12px; }

/* the deck, lifted out of the rows: reviewing is the habit that makes words stay */
.pf-deck { display: grid; gap: 8px; margin-bottom: 10px; }
.pf-deck-main {
  display: grid; grid-template-columns: 56px 1fr auto; gap: 16px; align-items: center;
  padding: 18px 18px 18px 16px; border-radius: 18px; cursor: pointer; text-align: left; color: inherit; font: inherit;
  border: 1.5px solid rgb(var(--brand-rgb) / .45);
  background: linear-gradient(120deg, rgb(var(--brand-rgb) / .16), rgb(var(--brand-rgb) / .04) 60%), var(--well-soft);
  transition: border-color .2s, transform .2s, box-shadow .2s;
}
@media (hover: hover) and (pointer: fine) { .pf-deck-main:hover { border-color: rgb(var(--brand-rgb) / .8); transform: translateY(-1px); box-shadow: 0 10px 28px -14px rgb(var(--brand-rgb) / .7); } }
.pf-deck-main:focus-visible { outline: 2px solid var(--brand-2); outline-offset: 2px; }
.pf-deck-i { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 16px; background: var(--brand); color: #fff; }
.pf-deck-i .i { width: 28px; height: 28px; }
.pf-deck-t { display: grid; gap: 4px; min-width: 0; }
.pf-deck-t b { font: 900 19px/1.2 var(--display); }
.pf-deck-t > .muted { font-size: 13.5px; }
.pf-deck-n { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 2px; font-size: 12.5px; }
.pf-deck-go { pointer-events: none; white-space: nowrap; }
.pf-deck-tip {
  display: flex; gap: 10px; align-items: flex-start; margin: 0; padding: 10px 14px; border-radius: 12px;
  background: rgb(var(--brand-rgb) / .07); border: 1px dashed rgb(var(--brand-rgb) / .35); font-size: 13px; line-height: 1.45;
}
.pf-deck-tip .i { flex: none; width: 18px; height: 18px; margin-top: 1px; color: var(--brand); }
.pf-deck-tip b { color: var(--brand); }
@media (max-width: 560px) {
  .pf-deck-main { grid-template-columns: 44px 1fr; gap: 12px; }
  .pf-deck-i { width: 44px; height: 44px; border-radius: 13px; }
  .pf-deck-go { grid-column: 1 / -1; justify-content: center; }
}

/* Kept for the onboarding's three lines, which still use this chip. */
.pf-do-i { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; background: rgb(var(--violet-rgb) / .14); color: var(--brand-2); }
.pf-do-i .i { width: 20px; height: 20px; }
.pf-do-i.lesson { background: rgb(var(--brand-rgb) / .14); color: var(--brand); }
.pf-do-i.friends { background: rgb(var(--violet-rgb) / .16); color: var(--brand-2); }
.pf-do-i.deck { background: rgb(var(--fg) / .08); color: var(--ink-2); }

/* ---------- the one authored moment: the board deals itself in ---------- */

@keyframes pf-deal {
  from { opacity: 0; transform: translateY(14px) scale(.965); filter: blur(7px); }
  to { opacity: 1; transform: none; filter: blur(0); }
}
.pf-game {
  animation: pf-deal .52s cubic-bezier(.16,1,.3,1) backwards;
  animation-delay: calc(var(--i) * 34ms);
}
@media (prefers-reduced-motion: reduce) {
  .pf-game { animation: none; }
  .pf-game, .pf-game-i, .pf-row, .pf-row-go { transition: none; }
  .pf-game:hover { transform: none; }
}

/* A game picked before there was anybody to play it with. */
.lobby-waiting {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid rgb(var(--brand-rgb) / .32);
  background: rgb(var(--brand-rgb) / .08);
}
.lobby-waiting > div { display: grid; gap: 1px; }
.lobby-waiting b { font-size: 14.5px; }
.lobby-waiting .muted { font-size: 12.5px; }
.lw-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: rgb(var(--brand-rgb) / .16); color: var(--brand); }
.lw-icon .i { width: 20px; height: 20px; }
.lw-dots { display: flex; gap: 4px; }
/* Waiting, not bouncing: the dots breathe on an ease-out, which is what a
   thing that is listening looks like. */
@keyframes lw-breathe { 0%, 70%, 100% { opacity: .3; transform: scale(.82); } 35% { opacity: 1; transform: scale(1); } }
.lw-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--brand); animation: lw-breathe 1.6s cubic-bezier(.16,1,.3,1) infinite; }
.lw-dots i:nth-child(2) { animation-delay: .16s; }
.lw-dots i:nth-child(3) { animation-delay: .32s; }
@media (prefers-reduced-motion: reduce) { .lw-dots i { animation: none; } }

@media (max-width: 520px) {
  .pf-counts { grid-template-columns: repeat(2, 1fr); }
  .pf-games { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .pf-head { padding: 16px; }
}

/* ---------- the alphabet, for whoever does not have it on their keys ---------- */

.rv-form { display: grid; gap: 12px; }
.rv-keys { display: grid; gap: 5px; user-select: none; }
.rv-keys-row { display: flex; gap: 5px; justify-content: center; }
.rv-key {
  flex: 1 1 0;
  min-width: 0;
  max-width: 46px;
  padding: 9px 0;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--panel-hi);
  color: var(--ink);
  font: 600 16px/1 var(--font);
  cursor: pointer;
  transition: background .12s, border-color .12s, transform .08s;
}
.rv-key:hover { background: rgb(var(--violet-rgb) / .16); border-color: rgb(var(--violet-rgb) / .4); }
.rv-key:active { transform: translateY(1px); background: rgb(var(--violet-rgb) / .28); }
.rv-key.wide { flex: 0 0 52px; max-width: 52px; display: grid; place-items: center; }
.rv-key .i { width: 17px; height: 17px; }
@media (max-width: 480px) {
  .rv-key { padding: 10px 0; max-width: none; font-size: 15px; border-radius: 7px; }
  .rv-keys-row { gap: 3px; }
  .rv-keys { gap: 4px; }
}
@media (prefers-reduced-motion: reduce) { .rv-key { transition: none; } .rv-key:active { transform: none; } }

/* Real sentences under the answer: the word as somebody actually used it. */
.rv-ex { display: grid; gap: 7px; width: 100%; margin-top: 2px; padding-top: 10px; border-top: 1px solid var(--line); text-align: left; }
.rv-ex-row { display: grid; gap: 1px; font-size: 13px; line-height: 1.4; }
.rv-ex-row .muted { font-size: 12px; }

/* A word already collected out of a conversation, and the moment it lands. */
.vocab-word.saved {
  border-bottom-color: rgb(var(--brand-rgb) / .85);
  background: rgb(var(--brand-rgb) / .14);
  color: var(--brand);
}
.vocab-word.saved:hover { background: rgb(var(--brand-rgb) / .24); }
.vocab-word.saving { opacity: .5; }
/* The tap itself: the word swells and settles, so the eye follows what it did. */
@keyframes vw-land { 0% { transform: scale(1); } 34% { transform: scale(1.22); } 100% { transform: scale(1); } }
.vocab-word.saved { animation: vw-land .42s cubic-bezier(.16,1,.3,1); }
/* The translation that rises off it reads as language, not as a score. */
.fun-float.fun-word { font: 800 17px/1.2 var(--font); color: var(--brand-3); max-width: 60vw; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (prefers-reduced-motion: reduce) { .vocab-word.saved { animation: none; } }

/* Any form that takes an answer in the alphabet being learnt. */
.ls-answer-form, .sp-form, .guess-form { display: grid; gap: 10px; }

/* The board made of words the people here saved themselves. */
.vt-chip.mem-mine { border-color: rgb(var(--brand-rgb) / .45); background: rgb(var(--brand-rgb) / .1); }
.vt-chip.mem-mine .vt-icon { color: var(--brand); }
.vt-chip.mem-mine.short { opacity: .68; }
.vt-chip.mem-mine .muted { font-size: 11.5px; }

/* The line under a game that says the translator is there. */
.mode-tip {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  margin: 10px 0 0;
  padding: 9px 12px;
  border-radius: 12px;
  border: 1px solid rgb(var(--violet-rgb) / .3);
  background: rgb(var(--violet-rgb) / .09);
}
.mt-icon { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: rgb(var(--violet-rgb) / .18); color: var(--brand-2); }
.mt-icon .i { width: 15px; height: 15px; }
.mt-say { font-size: 12.5px; line-height: 1.35; color: var(--ink-2); }
.mt-say b { color: var(--brand-2); }
@media (max-width: 560px) {
  .mode-tip { grid-template-columns: auto 1fr; }
  .mt-go { grid-column: 1 / -1; justify-content: center; }
}

/* The roulette that deals every conversation card. */
.tk-wheel { position: relative; width: min(240px, 70vw); margin: 6px auto 0; }
.tk-disc { display: block; width: 100%; height: auto; filter: drop-shadow(0 6px 14px rgb(0 0 0 / .18));
  animation: tk-spin var(--tk-dur) cubic-bezier(.12, .72, .12, 1) var(--tk-delay) both; }
.tk-disc path { stroke: #fff; stroke-width: 2; }
@keyframes tk-spin { from { transform: rotate(0deg); } to { transform: rotate(var(--tk-end)); } }
.tk-pointer { position: absolute; left: 50%; top: -6px; width: 28px; height: 28px; transform: translateX(-50%); z-index: 1;
  fill: var(--ink, #10243a); filter: drop-shadow(0 2px 2px rgb(0 0 0 / .25)); }
.tk-spin-say { text-align: center; margin: 8px 0 0; }
.talk-card:has(.tk-landed) > :not(.tk-landed) { animation: tk-land .5s cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes tk-land { from { opacity: 0; transform: scale(.92) translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .tk-disc { animation-duration: 1ms; animation-delay: 0ms; }
  .talk-card:has(.tk-landed) > :not(.tk-landed) { animation: none; }
}

/* ---------- Mosaic: a picture of beads, set a block at a time ---------- */
.mos-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.mos-left { display: grid; gap: 10px; justify-items: center; }
.mos-right { display: grid; gap: 12px; }
.mos-board {
  display: grid; grid-template-columns: repeat(var(--grid), 1fr); gap: 2px;
  width: min(100%, 420px); aspect-ratio: 1; padding: 10px; border-radius: 16px;
  background: #d9c6b1; box-shadow: inset 0 2px 6px rgb(0 0 0 / .15);
}
.mos-bead {
  border-radius: 28%; background: #c8b8a6;
  box-shadow: inset 0 -2px 0 rgb(0 0 0 / .08);
}
.mos-bead.on {
  background:
    radial-gradient(circle at 32% 28%, rgb(255 255 255 / .55) 0 12%, transparent 34%),
    radial-gradient(circle at 50% 50%, transparent 20%, rgb(0 0 0 / .05) 21% 30%, transparent 31%),
    var(--c);
  box-shadow: inset 0 -2px 2px rgb(0 0 0 / .22), inset 0 1px 1px rgb(255 255 255 / .3);
}
.mos-bead.on.new { animation: mos-drop .38s cubic-bezier(.3, 1.5, .5, 1) var(--d, 0ms) both; }
@keyframes mos-drop { from { transform: scale(.2) translateY(-8px); opacity: 0; } to { transform: none; opacity: 1; } }
.mos-progress { display: flex; gap: 6px; align-items: center; }
.mos-q { display: grid; gap: 12px; }
.mos-prompt { display: flex; gap: 12px; align-items: center; }
.mos-q-emoji { font-size: 40px; line-height: 1; }
.mos-q-word { font-size: 22px; font-family: Nunito, var(--font, sans-serif); font-weight: 900; }
.mos-options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mos-opt { display: grid; justify-items: center; gap: 2px; padding: 12px 10px; font-size: 16px; white-space: normal; text-align: center; }
.mos-sub { font-size: 11.5px; font-weight: 500; }
.mos-last { display: flex; gap: 8px; align-items: center; padding: 8px 10px; border-radius: 10px; font-size: 13.5px;
  animation: tk-land .35s ease both; }
.mos-last.ok { background: rgb(22 163 74 / .12); color: var(--ink); }
.mos-last.bad { background: rgb(220 38 38 / .1); color: var(--ink); }
.mos-last-say { flex: 1; text-align: left; }
.mos-guess { display: grid; gap: 10px; }
.mos-guess-btn { justify-self: start; }
.mos-guess-note { display: flex; gap: 6px; align-items: center; margin: 0; }
.mos-end { display: grid; gap: 12px; justify-items: start; }
.mos-name { display: flex; gap: 12px; align-items: center; }
@media (max-width: 760px) {
  .mos-layout { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { .mos-bead.on.new { animation: none; } }

/* ---------- shared screens ---------- */
.screens { display: grid; gap: 12px; }
.screen-tile { padding: 10px; display: grid; gap: 8px; }
.screen-head { display: flex; align-items: center; gap: 6px; min-width: 0; }
.screen-head b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.screen-video { width: 100%; max-height: 70vh; border-radius: 10px; background: #000; object-fit: contain; display: block; }
.screen-video:fullscreen { max-height: none; border-radius: 0; }
.screen-tile.mine { display: flex; align-items: center; gap: 12px; }
.screen-tile.mine .screen-video { width: 168px; height: 96px; flex: none; }
.screen-mine { display: grid; gap: 8px; justify-items: start; min-width: 0; }
.screen-wait { padding: 28px 12px; text-align: center; border-radius: 10px; background: var(--line); }
.vc-screen { color: #3e83c4; }


/* ---------- the lobby's games, each in its own colour ---------- */
/* The same colours as the profile's board. A game that needs more people is
   not faded into looking broken: it keeps its colour and says who is missing. */
.modes-grid { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.mode-card {
  --g: var(--violet-rgb);
  gap: 6px; padding: 16px;
  border-color: rgb(var(--g) / .38);
  background: linear-gradient(165deg, rgb(var(--g) / .22), rgb(var(--g) / .07) 58%, rgb(var(--g) / .02)), var(--panel-solid);
  box-shadow: 0 6px 18px -14px rgb(var(--g) / .9);
}
.mode-card::before { background: radial-gradient(120% 110% at 50% 118%, rgb(var(--g) / .32), transparent 68%); }
.mode-card:hover { border-color: rgb(var(--g) / .8); box-shadow: 0 18px 34px -14px rgb(var(--g) / .85); }
.mode-card .icon, .mode-card:hover .icon {
  width: 46px; height: 46px; border-radius: 13px; border: 0;
  background: rgb(var(--g) / .92); box-shadow: 0 6px 16px -8px rgb(var(--g) / .9);
}
.mode-card .icon .i { width: 22px; height: 22px; color: #0e1f36; }
.mode-card h3 { font-size: 17px; }
.mode-card p { font-size: 13.5px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.mode-card:disabled { opacity: 1; border-color: rgb(var(--g) / .25); }
.mode-card.short .icon { filter: saturate(.5); }
.mode-card.short h3, .mode-card.short p { opacity: .75; }
.mode-card.soon { opacity: .8; }
.need-pill { background: rgb(var(--brand-rgb) / .1); color: var(--brand); border-color: rgb(var(--brand-rgb) / .35); font-weight: 700; }
@media (max-width: 560px) {
  /* Two to a row on a phone: the colour and the name are enough to choose. */
  .modes-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .mode-card { padding: 13px; gap: 5px; }
  .mode-card .icon { width: 38px; height: 38px; border-radius: 11px; }
  .mode-card .icon .i { width: 19px; height: 19px; }
  .mode-card h3 { font-size: 15px; padding-right: 26px; }
  .mode-card p { display: none; }
  .mode-card .pill { font-size: 11px; padding: 3px 7px; }
  .mode-card .pill.violet { display: none; }
  .card-wrap .how-btn { width: 26px; height: 26px; right: 8px; top: 8px; }
  .card-wrap .how-btn .i { width: 13px; height: 13px; }
  .learn-grid { gap: 8px; }
  .learn-card { padding: 12px 14px; gap: 12px; }
  .learn-card .muted { display: none; }
  .learn-icon { width: 40px; height: 40px; border-radius: 12px; }
}

/* ---------- the lesson library ---------- */
/* One colour per level, so the page reads as a staircase before any title
   is read; the lesson number is a label, not a watermark under the text. */
.ls-card.lv-A1 { --g: 52 211 153; }
.ls-card.lv-A2 { --g: 96 165 250; }
.ls-card.lv-B1 { --g: 251 146 60; }
.ls-card.lv-B2 { --g: 192 132 252; }
.ls-library { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.ls-card {
  grid-template-columns: auto 1fr; align-items: start; gap: 14px; padding: 16px;
  border-color: rgb(var(--g) / .35);
  background: linear-gradient(165deg, rgb(var(--g) / .16), rgb(var(--g) / .04) 60%), var(--panel-solid);
}
.ls-card:hover:not(:disabled) { border-color: rgb(var(--g) / .8); box-shadow: 0 16px 30px -16px rgb(var(--g) / .9); }
.ls-card .ls-card-icon { background: rgb(var(--g) / .9); border: 0; color: #0e1f36; width: 42px; height: 42px; }
.ls-card-body { display: grid; gap: 4px; min-width: 0; }
.ls-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 22px; }
.ls-card-no { font-size: 11.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: rgb(var(--g)); filter: brightness(.8); }
.ls-card h3 { font-size: 16.5px; margin: 0; }
.ls-card-grammar { display: flex; gap: 6px; font-size: 12.5px; line-height: 1.4; }
.ls-card-grammar > span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ls-card p { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin: 2px 0 0; }
.ls-card.done { border-style: solid; }
.ls-card-num { display: none; }
.ls-level-h .ls-level-pill { min-width: 34px; justify-content: center; }
.ls-level:has(.lv-A1) .ls-level-pill { background: rgb(16 185 129); }
.ls-level:has(.lv-A2) .ls-level-pill { background: rgb(59 130 246); }
.ls-level:has(.lv-B1) .ls-level-pill { background: rgb(234 88 12); }
.ls-level:has(.lv-B2) .ls-level-pill { background: rgb(147 51 234); }

.ls-intro-bar { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; justify-content: space-between; }
.ls-wait { font-size: 13.5px; }
details.ls-how { padding: 0; margin-top: 10px; }
details.ls-how > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 12px 16px; font-weight: 700; font-size: 14px; }
details.ls-how > summary::-webkit-details-marker { display: none; }
details.ls-how > summary::after { content: '+'; margin-left: auto; font: 900 18px/1 var(--display); color: var(--muted); }
details.ls-how[open] > summary::after { content: '–'; }
details.ls-how > .ls-how-steps { padding: 0 16px 16px; }

/* The language tabs never wrap into two lines: they scroll sideways. */
.ls-tracks { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.ls-tracks::-webkit-scrollbar { display: none; }
.ls-tracks button { white-space: nowrap; flex: none; position: relative; }
.ls-you { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--brand); margin-left: 6px; vertical-align: middle; box-shadow: 0 0 0 3px rgb(var(--brand-rgb) / .2); }
@media (max-width: 700px) { .ls-tracks .ls-track-name { display: inline; } }
@media (max-width: 560px) {
  .ls-library { grid-template-columns: 1fr; gap: 8px; }
  .ls-card { padding: 12px; gap: 12px; }
  .ls-card p { display: none; }
  .ls-card .ls-card-icon { width: 36px; height: 36px; border-radius: 11px; }
}
.need-pill { white-space: nowrap; }
.ls-card-grammar > .i { flex: none; width: 14px; height: 14px; margin-top: 2px; color: var(--warn); }
details.ls-how { display: block; min-height: 0; }
@media (max-width: 560px) { .card-wrap:has(.how-btn) > .learn-card > .i:last-child { display: none; } }

/* ---------- UNO de palabras ---------- */
/* The four colours are UNO's, the same in either theme: a card is a card. The
   table around them follows the theme. */
.uno, .uno-sheet {
  --u-red: #e5383b; --u-red-ink: #a4161a;
  --u-yellow: #f7b500; --u-yellow-ink: #8a5a00;
  --u-green: #2a9d4b; --u-green-ink: #17652e;
  --u-blue: #1f6fd6; --u-blue-ink: #0b3f8a;
  --u-wild: #1c1d24;
}
.uno { display: grid; gap: 14px; min-width: 0; padding-bottom: 8px; }
.uno > * { min-width: 0; }
.c-red { --uc: var(--u-red); --uc-ink: var(--u-red-ink); }
.c-yellow { --uc: var(--u-yellow); --uc-ink: var(--u-yellow-ink); }
.c-green { --uc: var(--u-green); --uc-ink: var(--u-green-ink); }
.c-blue { --uc: var(--u-blue); --uc-ink: var(--u-blue-ink); }
.c-wild { --uc: var(--u-wild); --uc-ink: #111; }

/* one card */
.uno-card {
  --cw: 78px;
  position: relative; display: grid; place-items: center; flex: none;
  width: var(--cw); height: calc(var(--cw) * 1.5); border-radius: calc(var(--cw) * .13);
  background: var(--uc); border: calc(var(--cw) * .05) solid #fff; overflow: hidden; color: #fff;
  box-shadow: 0 1px 0 rgb(255 255 255 / .35) inset, 0 8px 18px -8px rgb(0 0 0 / .55), 0 0 0 1px rgb(0 0 0 / .12);
  font-family: var(--display); user-select: none;
}
.uno-card::before {
  content: ''; position: absolute; left: -2%; right: -2%; top: 24%; bottom: 24%;
  background: #fff; border-radius: 50%; transform: rotate(-32deg);
}
.uno-card.c-wild::before {
  background: conic-gradient(var(--u-red) 0 25%, var(--u-yellow) 0 50%, var(--u-green) 0 75%, var(--u-blue) 0);
  box-shadow: 0 0 0 2px #fff;
}
.uno-card.big { --cw: 112px; }
.uno-card.mid { --cw: 88px; }
.uc-corner {
  position: absolute; z-index: 1; font: 900 calc(var(--cw) * .2)/1 var(--display); color: #fff;
  text-shadow: 1px 1px 0 rgb(0 0 0 / .35); display: flex;
}
.uc-corner .i { width: 1em; height: 1em; stroke-width: 3; filter: drop-shadow(1px 1px 0 rgb(0 0 0 / .35)); }
.uc-corner.tl { top: 5%; left: 8%; }
.uc-corner.br { bottom: 5%; right: 8%; transform: rotate(180deg); }
.uc-oval {
  position: relative; z-index: 1; display: grid; justify-items: center; gap: 1px;
  width: 90%; text-align: center; color: var(--uc-ink);
}
.uc-emoji { font-size: calc(var(--cw) * .26); line-height: 1; }
.uc-word {
  font: 900 calc(var(--cw) * .18)/1.05 var(--display); overflow-wrap: anywhere; hyphens: auto;
  text-shadow: 0 0 3px #fff, 0 0 6px #fff;
}
.uc-word.long { font-size: calc(var(--cw) * .135); }
.uc-word.xlong { font-size: calc(var(--cw) * .11); }
.uc-sub { font-size: calc(var(--cw) * .11); font-weight: 700; opacity: .8; text-shadow: 0 0 3px #fff; }
.uc-ask {
  position: absolute; z-index: 1; top: 5%; right: 8%; font: 900 calc(var(--cw) * .14)/1 var(--display);
  background: var(--uc); color: #fff; border-radius: 50%; width: 1.4em; height: 1.4em; display: grid; place-items: center;
  border: 2px solid #fff;
}
.uc-big { font: 900 calc(var(--cw) * .36)/1 var(--display); display: flex; }
.uc-big .i { width: 1em; height: 1em; stroke-width: 3; }
.uc-label { font: 800 calc(var(--cw) * .1)/1 var(--font); text-transform: uppercase; letter-spacing: .04em; }
.c-wild .uc-big { color: #fff; text-shadow: 0 2px 0 rgb(0 0 0 / .5), 0 0 8px rgb(0 0 0 / .4); }
.uno-back { background: radial-gradient(120% 120% at 30% 20%, #5fa3de 0%, #3e83c4 45%, #23507f 100%); }
.uno-back::before { background: var(--brand); }
.uno-back .uc-oval img { width: calc(var(--cw) * .5); border-radius: 50%; filter: drop-shadow(0 3px 6px rgb(12 30 60 / .45)); }

/* the others, round the top */
.uno-opps { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.uno-seat {
  position: relative; display: grid; justify-items: center; gap: 4px; min-width: 88px; padding: 8px 12px 10px;
  border-radius: 16px; background: var(--panel); border: 1px solid var(--line); transition: border-color .2s, box-shadow .2s, transform .2s;
}
.uno-seat.turn { border-color: var(--brand); box-shadow: 0 0 0 3px rgb(var(--brand-rgb) / .18); transform: translateY(2px); }
.uno-seat.off { opacity: .5; }
.us-fan { position: relative; width: 70px; height: 30px; }
.us-back {
  position: absolute; left: 50%; bottom: 0; width: 20px; height: 29px; margin-left: -10px; border-radius: 4px;
  background: radial-gradient(120% 120% at 30% 20%, #5fa3de 0%, #3e83c4 50%, #23507f 100%); border: 1.5px solid #fff;
  box-shadow: 0 2px 4px rgb(0 0 0 / .3); transform-origin: 50% 120%;
  transform: translateX(calc(var(--i) * 7px)) rotate(calc(var(--i) * 9deg));
}
.us-name { font-weight: 700; font-size: 13px; max-width: 96px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.us-count {
  position: absolute; top: 4px; right: 6px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px;
  display: grid; place-items: center; font: 900 12px/1 var(--display); background: var(--navy); color: var(--navy-ink);
}
.us-count.one { background: var(--u-red); color: #fff; animation: tick-pulse 1s ease-in-out infinite; }

/* the timer ring */
.uno-ring { position: relative; display: grid; place-items: center; flex: none; }
.uno-ring svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.ur-track { fill: none; stroke: var(--line-hi); stroke-width: 4; }
.ur-fill { fill: none; stroke: var(--brand); stroke-width: 4; stroke-linecap: round; animation-name: uno-ring; animation-timing-function: linear; animation-fill-mode: both; }
@keyframes uno-ring {
  0% { stroke-dashoffset: 0; stroke: var(--ok); }
  70% { stroke: var(--warn); }
  100% { stroke-dashoffset: var(--len); stroke: var(--bad); }
}
.ur-in { position: relative; display: grid; place-items: center; }

/* the middle of the table */
.uno-center {
  --uc: var(--line-hi);
  display: flex; justify-content: center; align-items: center; gap: clamp(14px, 4vw, 34px); flex-wrap: wrap;
  padding: 18px 12px; border-radius: 24px; border: 1px solid var(--line);
  background: radial-gradient(ellipse at 50% 45%, color-mix(in srgb, var(--uc) 24%, var(--panel-solid)) 0%, var(--panel-solid) 72%);
  transition: background .4s;
}
.uno-center.glow-red { --uc: var(--u-red); }
.uno-center.glow-yellow { --uc: var(--u-yellow); }
.uno-center.glow-green { --uc: var(--u-green); }
.uno-center.glow-blue { --uc: var(--u-blue); }
.uno-drawpile {
  position: relative; width: 84px; height: 118px; padding: 0; border: 0; background: none; cursor: default; color: var(--ink);
}
.uno-drawpile .uno-card { --cw: 72px; position: absolute; left: 0; top: 0; }
.uno-drawpile .d2 { transform: translate(4px, 3px) rotate(3deg); }
.uno-drawpile .d3 { transform: translate(8px, 6px) rotate(6deg); }
.uno-drawpile.live { cursor: pointer; }
.uno-drawpile.live .d1 { box-shadow: 0 0 0 3px var(--brand), 0 10px 22px -8px rgb(var(--brand-rgb) / .7); }
.uno-drawpile.live:hover .d1 { transform: translateY(-6px) rotate(-3deg); }
.uno-drawpile .d1 { transition: transform .2s; }
.udp-label {
  position: absolute; left: 50%; bottom: -8px; transform: translateX(-50%); z-index: 2; white-space: nowrap;
  padding: 3px 9px; border-radius: 999px; background: var(--panel-solid); border: 1px solid var(--line-hi);
  font: 800 12px/1.2 var(--font); display: flex; gap: 4px; align-items: center;
}
.uno-drawpile.live .udp-label { background: var(--brand); color: #fff; border-color: transparent; }
.uno-pile { display: grid; justify-items: center; gap: 6px; }
.uno-pilecard { padding: 0; border: 0; background: none; cursor: pointer; border-radius: 14px; }
.uno-pilecard .uno-card { transform: rotate(-4deg); }
.uno-card.landed { animation: uno-land .45s cubic-bezier(.3, 1.4, .5, 1) both; }
@keyframes uno-land { from { transform: translateY(-40px) rotate(-24deg) scale(1.15); opacity: 0; } to { transform: rotate(-4deg); opacity: 1; } }
.uno-pile-meaning { font-size: 13px; color: var(--ink-2); max-width: 150px; text-align: center; }
.uno-now { display: grid; justify-items: center; gap: 6px; }
.uno-dot { width: 34px; height: 34px; border-radius: 50%; background: var(--uc); box-shadow: 0 0 0 3px #fff, 0 0 18px var(--uc); transition: background .3s; }
.uno-dot.c-wild { background: conic-gradient(var(--u-red) 0 25%, var(--u-yellow) 0 50%, var(--u-green) 0 75%, var(--u-blue) 0); }
.uno-dir { color: var(--muted); display: flex; }
.uno-dir .i { animation: uno-spin 4s linear infinite; }
.uno-dir.back .i { animation-direction: reverse; }
@keyframes uno-spin { to { transform: rotate(360deg); } }
.uno-now-topic { font-size: 12.5px; font-weight: 700; display: flex; gap: 4px; align-items: center; max-width: 120px; text-align: center; }

.uno-legend { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.uno-topic {
  display: inline-flex; gap: 5px; align-items: center; padding: 4px 10px 4px 8px; border-radius: 999px; font-size: 12.5px; font-weight: 700;
  background: color-mix(in srgb, var(--uc) 14%, transparent); border: 1.5px solid color-mix(in srgb, var(--uc) 55%, transparent); color: var(--ink);
}
.uno-topic .i { color: var(--uc); }
.uno-topic.on { background: var(--uc); color: #fff; border-color: var(--uc); }
.uno-topic.on .i { color: #fff; }

/* whose turn, and what just happened */
.uno-line { display: grid; gap: 6px; justify-items: center; text-align: center; }
.uno-turn { font: 800 16px/1.2 var(--display); display: flex; gap: 6px; align-items: center; color: var(--ink-2); }
.uno-turn.mine { color: var(--brand); font-size: 18px; }
.uno-last { display: flex; gap: 8px; align-items: center; padding: 6px 8px 6px 12px; border-radius: 12px; font-size: 13.5px; animation: tk-land .35s ease both; text-align: left; }
.uno-last.ok { background: rgb(22 163 74 / .14); }
.uno-last.bad { background: rgb(220 38 38 / .12); }
.uno-news { font-size: 13px; animation: tk-land .35s ease both; }

/* UNO! */
.uno-call {
  justify-self: center; display: grid; justify-items: center; gap: 2px; padding: 10px 28px; border: 3px solid #fff; border-radius: 999px; cursor: pointer;
  background: linear-gradient(135deg, var(--u-red), #ff7a3d 55%, var(--u-yellow)); color: #fff;
  box-shadow: 0 12px 28px -10px rgb(229 56 59 / .8);
}
.uno-call-word { font: 900 26px/1 var(--display); letter-spacing: .04em; text-shadow: 0 2px 0 rgb(0 0 0 / .3); transform: rotate(-4deg); }
.uno-call-left { font: 800 12px/1 var(--font); display: flex; gap: 4px; }
.uno-call.must {
  position: fixed; left: 50%; bottom: 34vh; z-index: 90; padding: 18px 44px;
  animation: uno-shout .7s ease-in-out infinite alternate;
}
.uno-call.must .uno-call-word { font-size: 44px; }
@keyframes uno-shout { from { transform: translateX(-50%) scale(1); } to { transform: translateX(-50%) scale(1.08); } }
.uno-said { justify-self: center; font: 900 18px/1 var(--display); color: var(--u-red); transform: rotate(-4deg); }

/* my hand */
.uno-hand-wrap {
  display: grid; gap: 4px; padding: 10px 0 4px; border-radius: 20px; background: var(--panel); border: 1px solid var(--line);
  transition: border-color .2s, box-shadow .2s;
}
.uno-hand-wrap.mine { border-color: rgb(var(--brand-rgb) / .6); box-shadow: 0 0 0 3px rgb(var(--brand-rgb) / .12); }
.uno-hand-head { display: flex; gap: 8px; align-items: center; padding: 0 14px; font-size: 14px; }
.uno-hand-head .cm-avatar { width: 26px; height: 26px; font-size: 12px; }
.uno-level { margin-left: auto; }
.uno-hand {
  display: flex; overflow-x: auto; overflow-y: hidden; padding: 28px 18px 14px; scroll-snap-type: x proximity;
  overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; scrollbar-width: thin;
}
/* centred while it fits, scrollable from the first card once it does not */
.uno-hand::before, .uno-hand::after { content: ''; flex: 1 0 0; }
.uno-slot {
  flex: none; padding: 0; border: 0; background: none; border-radius: 12px; cursor: pointer; scroll-snap-align: center;
  margin-left: -16px; position: relative; transform-origin: 50% 140%;
  transform: rotate(calc(var(--i) * 2.2deg)); transition: transform .2s cubic-bezier(.3, 1.4, .5, 1), filter .2s;
}
.uno-slot:first-of-type { margin-left: 0; }
.uno-slot:hover, .uno-slot:focus-visible { z-index: 2; transform: translateY(-14px) rotate(0deg); }
.uno-hand-wrap.mine .uno-slot:not(.can) { filter: saturate(.35) brightness(.8); }
.uno-hand-wrap.mine .uno-slot.can { transform: translateY(-10px) rotate(calc(var(--i) * 2.2deg)); }
.uno-hand-wrap.mine .uno-slot.can .uno-card { box-shadow: 0 0 0 3px rgb(var(--brand-rgb) / .9), 0 12px 22px -8px rgb(var(--brand-rgb) / .6); }
.uno-slot.picked { z-index: 3; transform: translateY(-22px) rotate(0deg) !important; }
.uno-slot.nope { animation: mem-shake .45s ease; }
@media (min-width: 760px) {
  .uno-card { --cw: 88px; }
  .uno-card.big { --cw: 128px; }
  .uno-slot { margin-left: -10px; }
}

/* the question a card asks, from the bottom */
.uno-sheet {
  position: fixed; left: 50%; bottom: 0; z-index: 85; width: min(560px, 100vw); transform: translateX(-50%);
  display: grid; gap: 12px; padding: 14px 16px calc(16px + env(safe-area-inset-bottom)); border-radius: 22px 22px 0 0;
  background: var(--panel-glass); border: 1px solid var(--line-hi); border-bottom: 0; backdrop-filter: blur(10px);
  box-shadow: 0 -18px 40px -18px rgb(0 0 0 / .6); animation: uno-sheet .28s cubic-bezier(.3, 1.2, .5, 1) both;
}
@keyframes uno-sheet { from { transform: translate(-50%, 100%); } to { transform: translate(-50%, 0); } }
.uno-sheet-head { display: flex; gap: 8px; align-items: center; justify-content: space-between; font-size: 15px; }
.uno-sheet-body { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px; align-items: center; }
.uno-options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.uno-opt { display: grid; justify-items: center; gap: 2px; padding: 12px 8px; font-size: 15px; white-space: normal; text-align: center; min-height: 48px; }
.uno-opt-sub { font-size: 11.5px; font-weight: 500; }
.uno-type { display: grid; gap: 8px; }
.uno-type input { font-size: 18px; }
.uno-colors { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.uno-color {
  display: flex; gap: 8px; align-items: center; justify-content: center; padding: 16px 10px; border-radius: 16px; border: 3px solid #fff;
  background: var(--uc); color: #fff; font: 800 15px/1.2 var(--font); cursor: pointer; box-shadow: 0 8px 18px -8px var(--uc);
}
@media (hover: hover) and (pointer: fine) { .uno-color:hover { filter: brightness(1.08); transform: translateY(-2px); } }
@media (max-width: 420px) {
  .uno-sheet-body { grid-template-columns: 1fr; justify-items: center; }
  .uno-sheet-body .uno-options, .uno-sheet-body .uno-type { width: 100%; }
  .uno-card.mid { --cw: 70px; }
  .uno-card.big { --cw: 96px; }
  .uno-center { gap: 12px; padding: 14px 8px; }
  .uno-seat { min-width: 76px; padding: 6px 8px 8px; }
}

.uno-end { display: grid; gap: 12px; justify-items: center; text-align: center; }
.uno-end-word {
  font: 900 54px/1 var(--display); transform: rotate(-6deg);
  background: linear-gradient(135deg, var(--u-red), #ff7a3d 50%, var(--u-yellow)); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.uno-end h2 { margin: 0; }
.uno-end-rows { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
@media (prefers-reduced-motion: reduce) {
  .uno-card.landed, .uno-call.must, .us-count.one, .uno-dir .i, .uno-sheet, .uno-slot.nope { animation: none !important; }
  .uno-call.must { transform: translateX(-50%); }
}

/* ---------- choosing a scene (Memory, Mosaic) ---------- */
.tp { display: grid; gap: 18px; }
.tp-head h2 { font-size: clamp(22px, 2.6vw, 28px); }
.tp-head p { margin: 4px 0 0; font-size: 15px; }
.tp-wait {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 14px;
  background: rgb(var(--violet-rgb) / .1); border: 1px solid rgb(var(--violet-rgb) / .3); font-weight: 700; font-size: 14.5px;
}
.tp-wait-dots { display: inline-flex; gap: 4px; }
.tp-wait-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--brand-2); animation: tp-dot 1.2s ease-in-out infinite; }
.tp-wait-dots i:nth-child(2) { animation-delay: .15s; }
.tp-wait-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes tp-dot { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

.tp-feature { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.tp-big {
  display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: 18px; text-align: left;
  color: var(--ink); font: inherit; cursor: pointer; transition: transform .2s, box-shadow .2s, border-color .2s;
}
.tp-random { border: 1px solid rgb(var(--brand-rgb) / .5); background: linear-gradient(135deg, rgb(var(--brand-rgb) / .2), rgb(var(--brand-rgb) / .05)), var(--panel-solid); }
.tp-mine { border: 1px solid rgb(var(--violet-rgb) / .45); background: linear-gradient(135deg, rgb(var(--violet-rgb) / .18), rgb(var(--violet-rgb) / .04)), var(--panel-solid); }
@media (hover: hover) and (pointer: fine) { .tp-big:hover:not(:disabled) { transform: translateY(-3px); box-shadow: 0 16px 30px -18px rgb(var(--brand-rgb) / .9); } }
.tp-big-i { flex: none; width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; color: #fff; }
.tp-random .tp-big-i { background: var(--brand); }
.tp-mine .tp-big-i { background: var(--brand-2); }
.tp-big-i .i { width: 22px; height: 22px; }
.tp-big-t { display: grid; gap: 2px; min-width: 0; flex: 1; }
.tp-big-t b { font: 900 17px/1.2 var(--display); }
.tp-big-t > span { font-size: 13px; color: var(--muted); }
.tp-meter { display: block; height: 6px; border-radius: 99px; background: rgb(var(--fg) / .1); margin-top: 6px; overflow: hidden; }
.tp-meter span { display: block; height: 100%; background: var(--brand-2); border-radius: inherit; }
.tp-mine.short { opacity: .8; }

.tp-group { display: grid; gap: 10px; }
.tp-sub { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 800; margin: 0; }
.tp-sub-i { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: rgb(var(--g) / .18); color: rgb(var(--g)); }
.tp-sub-i .i { width: 15px; height: 15px; }
.tp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.tp-tile {
  display: grid; gap: 5px; align-content: start; padding: 14px; border-radius: 16px; text-align: left;
  border: 1px solid rgb(var(--g) / .28); color: var(--ink); font: inherit; cursor: pointer;
  background: linear-gradient(165deg, rgb(var(--g) / .12), transparent 70%), var(--panel-solid);
  transition: transform .2s cubic-bezier(.2,.7,.2,1), border-color .2s, box-shadow .2s;
  animation: tp-in .4s cubic-bezier(.16,1,.3,1) backwards; animation-delay: calc(var(--i) * 18ms);
}
.tp-tile:hover:not(:disabled), .tp-tile.open { transform: translateY(-3px); border-color: rgb(var(--g) / .8); box-shadow: 0 14px 28px -16px rgb(var(--g) / .9); }
.tp-tile:focus-visible, .tp-big:focus-visible { outline: 2px solid var(--brand-2); outline-offset: 2px; }
.tp-tile-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.tp-tile-i { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: rgb(var(--g) / .18); color: rgb(var(--g)); }
.tp-tile-i .i { width: 20px; height: 20px; }
.tp-level { font: 800 11px/1 var(--font); letter-spacing: .04em; padding: 4px 7px; border-radius: 6px; background: rgb(var(--fg) / .07); color: var(--ink-2); }
.tp-level.big { font-size: 13px; padding: 6px 9px; }
.tp-name { font-weight: 800; font-size: 15.5px; line-height: 1.25; }
.tp-blurb { font-size: 12.5px; color: var(--muted); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@keyframes tp-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.tp.watching .tp-tile, .tp.watching .tp-big { cursor: default; }
.tp.watching .tp-tile:not(.open), .tp.watching .tp-big { opacity: .75; }
.tp-tile:disabled, .tp-big:disabled { cursor: default; }

/* The scene, opened: a dialog on a wide screen, a sheet from the bottom on a phone. */
.tp-backdrop {
  position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 20px;
  background: rgb(4 12 24 / .55); backdrop-filter: blur(3px); animation: tp-fade .18s ease;
}
.tp-scene {
  width: min(560px, 100%); max-height: min(86vh, 760px); overflow: auto; display: grid; gap: 16px;
  padding: 22px; border-radius: 22px; background: var(--panel-solid); border: 1px solid rgb(var(--g) / .45);
  box-shadow: 0 30px 80px -30px rgb(0 0 0 / .6), 0 0 0 1px rgb(var(--g) / .15); animation: tp-pop .24s cubic-bezier(.16,1,.3,1);
}
.tp-scene-head { display: flex; gap: 14px; align-items: flex-start; }
.tp-scene-i { flex: none; width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; background: rgb(var(--g)); color: #0e1f36; }
.tp-scene-i .i { width: 28px; height: 28px; }
.tp-scene-t { flex: 1; min-width: 0; }
.tp-scene-t h2 { font-size: 22px; margin: 0; }
.tp-scene-t p { margin: 4px 0 0; color: var(--muted); font-size: 14.5px; }
.tp-x { flex: none; width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line); background: none; color: var(--ink-2); display: grid; place-items: center; cursor: pointer; }
.tp-x .i { width: 17px; height: 17px; }
.tp-phrase { padding: 14px; border-radius: 16px; background: rgb(var(--g) / .1); border: 1px solid rgb(var(--g) / .3); display: grid; gap: 8px; }
.tp-phrase-l { font-size: 11.5px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: rgb(var(--g)); filter: brightness(.85); }
.tp-phrase-row { display: flex; gap: 12px; align-items: flex-start; }
.tp-phrase-row > div { display: grid; gap: 2px; }
.tp-phrase-row b { font-size: 18px; line-height: 1.35; }
.tp-sub-read { font-size: 12.5px; color: var(--ink-2); font-style: italic; }
.tp-words { list-style: none; margin: 0; padding: 0; display: grid; }
.tp-words li { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 9px 2px; border-bottom: 1px solid var(--line); }
.tp-words li:last-child { border-bottom: 0; }
.tp-w { display: grid; gap: 1px; min-width: 0; }
.tp-w b { font-size: 15.5px; }
.tp-m { text-align: right; font-size: 14px; }
.tp-say { flex: none; width: 34px; height: 34px; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer; background: rgb(var(--g) / .16); color: rgb(var(--g)); }
.tp-say:hover { background: rgb(var(--g) / .3); }
.tp-say .i { width: 16px; height: 16px; }
.tp-more { justify-self: start; }
.tp-scene-foot { display: flex; justify-content: flex-end; gap: 10px; align-items: center; padding-top: 4px; }
.tp-looking { display: flex; gap: 10px; align-items: center; font-weight: 700; font-size: 14px; color: var(--ink-2); margin-right: auto; }
@keyframes tp-fade { from { opacity: 0; } }
@keyframes tp-pop { from { opacity: 0; transform: translateY(14px) scale(.97); } }

@media (max-width: 560px) {
  .tp-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .tp-tile { padding: 11px; }
  .tp-blurb { display: none; }
  .tp-name { font-size: 14px; }
  .tp-feature { grid-template-columns: 1fr; gap: 8px; }
  .tp-big { padding: 12px 14px; }
  .tp-big-i { width: 40px; height: 40px; }
  .tp-backdrop { place-items: end stretch; padding: 0; }
  .tp-scene { width: 100%; max-height: 88vh; border-radius: 22px 22px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); animation-name: tp-sheet; }
  .tp-scene-foot .btn.big { flex: 1; justify-content: center; }
  @keyframes tp-sheet { from { transform: translateY(40%); opacity: 0; } }
}
@media (prefers-reduced-motion: reduce) {
  .tp-tile, .tp-scene, .tp-backdrop { animation: none; }
  .tp-wait-dots i { animation: none; opacity: .7; }
}

/* =================== reading room =================== */
.rd-modal { grid-template-rows: auto 1fr; width: min(820px, calc(100vw - 32px)); }
.rd-note { display: flex; gap: 8px; align-items: center; font-size: 13.5px; color: var(--ink-2); padding: 10px 12px; border-radius: 12px; background: rgb(62 131 196 / 0.1); border: 1px solid rgb(62 131 196 / 0.3); }
.rd-note .flag, .rd-tr .flag, .rd-sheet-tr .flag { width: 18px; height: 13px; flex: none; }
.rd-levels { align-self: start; justify-self: start; flex-wrap: wrap; }
.rd-levels button { gap: 6px; }
.rd-count { font-size: 11.5px; font-weight: 600; }
.rd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.rd-cover {
  display: grid; grid-template-rows: auto 1fr; text-align: left; padding: 0; overflow: hidden; border-radius: 16px; cursor: pointer; color: var(--ink);
  background: var(--panel-solid); border: 1px solid rgb(var(--g) / 0.35); box-shadow: 0 8px 22px -18px rgb(var(--g) / 0.9);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
@media (hover: hover) and (pointer: fine) { .rd-cover:hover { transform: translateY(-3px); border-color: rgb(var(--g) / 0.7); box-shadow: 0 14px 30px -16px rgb(var(--g) / 0.9); } }
.rd-cover-art {
  position: relative; display: block; height: 92px; overflow: hidden;
  background: radial-gradient(120% 140% at 0% 0%, rgb(var(--g) / 0.55), rgb(var(--g) / 0.18) 60%, rgb(var(--g) / 0.08));
}
.rd-cover-art .rd-cover-mark { position: absolute; right: -10px; bottom: -18px; width: 104px; height: 104px; color: rgb(var(--g)); opacity: 0.55; transform: rotate(-12deg); stroke-width: 1.5; }
.rd-cover.lg .rd-cover-art { height: 118px; }
.rd-cover.lg .rd-cover-art .rd-cover-mark { width: 132px; height: 132px; }
.rd-cover-art .rd-level { position: absolute; left: 12px; top: 12px; background: var(--panel-solid); }
.rd-cover-done { position: absolute; right: 10px; top: 10px; display: inline-flex; gap: 4px; align-items: center; font-size: 12px; font-weight: 800; padding: 3px 8px; border-radius: 99px; background: var(--panel-solid); color: var(--ink-2); }
.rd-cover-done.good { color: var(--ok); }
.rd-cover-done .i { width: 13px; height: 13px; }
.rd-cover-body { display: grid; gap: 6px; align-content: start; padding: 12px 14px 14px; }
.rd-cover-title { font-family: var(--display); font-weight: 900; font-size: 17px; letter-spacing: -0.02em; line-height: 1.2; }
.rd-cover.lg .rd-cover-title { font-size: 19px; }
.rd-cover-sum { font-size: 13px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rd-cover-meta { display: flex; gap: 5px; align-items: center; font-size: 12.5px; }
.rd-cover-meta .i { width: 13px; height: 13px; }
.rd-shelf { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.pf-shelf-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.pf-shelf-head .pf-h { margin: 0; }
.pf-shelf-count { font-size: 13px; margin-right: auto; }
.pf-shelf-sub { margin: 4px 0 12px; font-size: 14px; }
@media (max-width: 900px) { .rd-shelf { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) {
  .rd-shelf { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -16px; padding: 2px 16px 8px; }
  .rd-shelf .rd-cover { flex: 0 0 72%; scroll-snap-align: start; }
}
.rd-level { display: inline-block; font-size: 11.5px; font-weight: 800; letter-spacing: 0.04em; padding: 2px 8px; border-radius: 99px; }
.rd-level.lv-a1 { background: rgb(16 185 129 / 0.14); color: #10b981; }
.rd-level.lv-a2 { background: rgb(62 131 196 / 0.16); color: #4f95d6; }
.rd-level.lv-b1 { background: rgb(239 108 18 / 0.14); color: #ef6c12; }
.rd-level.lv-b2 { background: rgb(168 85 247 / 0.15); color: #a855f7; }
.rd-head { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.rd-head-title { display: flex; gap: 10px; align-items: center; flex: 1; min-width: 200px; }
.rd-head-title h3 { margin: 0; font-family: var(--display); font-weight: 900; font-size: 22px; letter-spacing: -0.02em; }
.rd-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.rd-rate button { padding: 5px 9px; font-size: 12.5px; gap: 4px; }
.rd-rate .i { width: 14px; height: 14px; }
.rd-hint { font-size: 13px; display: flex; gap: 6px; align-items: flex-start; }
.rd-hint .i { width: 15px; height: 15px; color: var(--warn); flex: none; margin-top: 1px; }
.rd-text { font-size: clamp(17px, 2vw, 19px); line-height: 1.75; color: var(--ink); max-width: 68ch; }
.rd-para { margin: 0 0 18px; }
.rd-para p { margin: 0; }
.rd-sent { border-radius: 4px; transition: background 0.2s; }
.rd-sent.on { background: rgb(var(--brand-rgb) / 0.16); box-shadow: 0 0 0 2px rgb(var(--brand-rgb) / 0.16); }
.rd-w { cursor: pointer; border-radius: 3px; }
.rd-w:hover { background: rgb(var(--fg) / 0.07); }
.rd-key { font-weight: 700; text-decoration: underline dotted rgb(var(--brand-rgb) / 0.7); text-underline-offset: 4px; text-decoration-thickness: 2px; }
.rd-w.picked { background: rgb(62 131 196 / 0.25); }
.rd-tr { margin: 6px 0 0 !important; font-size: 15px; line-height: 1.55; color: var(--ink-2); padding-left: 12px; border-left: 3px solid rgb(62 131 196 / 0.4); }
.rd-h { display: flex; gap: 8px; align-items: center; margin: 0 0 10px; font-family: var(--display); font-weight: 900; font-size: 17px; }
.rd-h .i { width: 17px; height: 17px; color: var(--brand); }
.rd-keys { display: grid; gap: 4px; padding-top: 14px; border-top: 1px solid var(--line); }
.rd-key-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.rd-key-item { display: grid; gap: 2px; text-align: left; padding: 10px 12px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); color: var(--ink); cursor: pointer; }
.rd-key-item:hover { border-color: rgb(var(--brand-rgb) / 0.45); }
.rd-key-item .muted { font-size: 13px; }
.rd-cta { display: flex; justify-content: center; padding: 6px 0 70px; }
.rd-sheet {
  position: sticky; bottom: 0; z-index: 2; display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 16px;
  background: var(--panel-solid); border: 1px solid var(--line-hi); box-shadow: 0 -10px 30px -12px rgba(0, 0, 0, 0.45);
  animation: rd-up 0.18s ease-out;
}
@keyframes rd-up { from { transform: translateY(12px); opacity: 0; } }
.rd-sheet-body { flex: 1; min-width: 0; display: grid; gap: 2px; }
.rd-sheet-word { font-weight: 800; font-size: 18px; }
.rd-sheet-tr { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; color: var(--ink-2); }
.rd-sheet-def { font-size: 12.5px; }
.rd-peek { max-height: 38vh; overflow: auto; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--well-soft); }
.rd-peek .rd-text { font-size: 15.5px; }
.sp-options.rd-tf { grid-template-columns: 1fr 1fr; }
.sp-options.rd-tf .sp-option { justify-content: center; }
@media (max-width: 560px) { .rd-hide-sm { display: none; } .rd-cta { padding-bottom: 80px; } }

/* =================== the guide: Linguino the penguin =================== */
.penguin { position: relative; display: inline-block; flex: none; }
.penguin .pg-all { position: absolute; inset: 0; transform-origin: 50% 96%; animation: pg-bob 2.6s ease-in-out infinite; }
.penguin .pg-p { position: absolute; height: auto; max-width: none; user-select: none; pointer-events: none; }
.penguin .pg-shadow { position: absolute; left: 20%; right: 20%; bottom: -1.5%; height: 5%; border-radius: 50%; background: rgb(0 0 0 / 0.18); animation: pg-shadow 2.6s ease-in-out infinite; }
.penguin .pg-flip-l, .penguin .pg-flip-r { transition: transform 0.35s cubic-bezier(.3,1.5,.5,1); }
/* blinking: the open eyes give way to the shut ones for a moment */
.penguin .pg-lid { opacity: 0; animation: pg-lid 4.4s infinite; }
.penguin:has(.pg-lid) .pg-eye { animation: pg-open 4.4s infinite; }
/* talking: the beak opens and shuts while he has something to say */
.penguin .pg-talk, .penguin .pg-off { opacity: 0; }
.penguin.talking .pg-talk { animation: pg-talk-open 0.3s steps(1) infinite; }
.penguin.talking .pg-shut { animation: pg-talk-shut 0.3s steps(1) infinite; }
.pg-wave .pg-flip-r { z-index: 1; animation: pg-wave 0.9s ease-in-out infinite; }
.pg-wave .pg-all { animation: pg-bob 2.6s ease-in-out infinite, pg-lean 1.8s ease-in-out infinite; }
.pg-point .pg-flip-r { transform: rotate(-80deg); animation: pg-jab 1.1s ease-in-out infinite; }
.pg-happy .pg-all { animation: pg-jump 0.8s cubic-bezier(.3,.7,.4,1) infinite; }
.pg-happy .pg-shadow { animation: pg-shadow-jump 0.8s cubic-bezier(.3,.7,.4,1) infinite; }
.pg-happy .pg-flip-l { transform: rotate(60deg); }
.pg-happy .pg-flip-r { transform: rotate(-60deg); }
.pg-sad .pg-all { animation: pg-sigh 3.4s ease-in-out infinite; }
.pg-sad .pg-flip-l { transform: rotate(-8deg); }
.pg-sad .pg-flip-r { transform: rotate(8deg); }
.pg-think .pg-all { animation: pg-bob 2.6s ease-in-out infinite, pg-ponder 3s ease-in-out infinite; }
.pg-think .pg-flip-r { animation: pg-tap 1.4s ease-in-out infinite; }
@keyframes pg-bob { 50% { translate: 0 -3%; } }
@keyframes pg-shadow { 50% { transform: scaleX(0.9); opacity: 0.7; } }
@keyframes pg-lid { 0%, 94%, 100% { opacity: 0; } 95.5%, 98% { opacity: 1; } }
@keyframes pg-open { 0%, 94%, 100% { opacity: 1; } 95.5%, 98% { opacity: 0; } }
@keyframes pg-talk-open { 0% { opacity: 1; } 50% { opacity: 0; } }
@keyframes pg-talk-shut { 0% { opacity: 0; } 50% { opacity: 1; } }
@keyframes pg-wave { 0%, 100% { transform: rotate(-100deg); } 50% { transform: rotate(-145deg); } }
@keyframes pg-lean { 0%, 100% { rotate: 0deg; } 50% { rotate: 3deg; } }
@keyframes pg-jab { 50% { transform: rotate(-72deg) translateX(4%); } }
@keyframes pg-jump { 0%, 100% { transform: translateY(0) scale(1.04, 0.96); } 15% { transform: translateY(0) scale(1); } 50% { transform: translateY(-14%) scale(0.98, 1.03); } 85% { transform: translateY(0) scale(1); } }
@keyframes pg-shadow-jump { 50% { transform: scaleX(0.6); opacity: 0.4; } }
@keyframes pg-sigh { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(-3deg) translateY(1.5%) scaleY(0.98); } }
@keyframes pg-ponder { 0%, 100% { rotate: -4deg; } 50% { rotate: 3deg; } }
@keyframes pg-tap { 0%, 100% { transform: rotate(-12deg); } 50% { transform: rotate(-24deg); } }
@media (prefers-reduced-motion: reduce) { .penguin *, .penguin { animation: none !important; transition: none !important; } .penguin .pg-lid, .penguin .pg-talk { opacity: 0; } }

/* speech bubble beside him */
.pg-say { display: flex; gap: 10px; align-items: flex-end; }
.pg-bubble {
  position: relative; flex: 1; min-width: 0; padding: 12px 14px; border-radius: 16px; background: var(--panel-solid); color: var(--ink);
  border: 1.5px solid var(--line-hi); box-shadow: var(--shadow); font-size: 15px; line-height: 1.45; animation: pg-pop 0.25s cubic-bezier(.3,1.4,.5,1);
}
.pg-bubble::before {
  content: ''; position: absolute; left: -9px; bottom: 18px; width: 16px; height: 16px; background: inherit;
  border-left: 1.5px solid var(--line-hi); border-bottom: 1.5px solid var(--line-hi); transform: rotate(45deg);
}
.pg-bubble b { font-family: var(--display); font-weight: 900; }
@keyframes pg-pop { from { transform: scale(0.85); opacity: 0; } }

/* the tour: a spotlight on the part being shown, and the penguin talking */
.guide-spot {
  position: fixed; z-index: 90; pointer-events: none; border-radius: 18px;
  box-shadow: 0 0 0 4px rgb(var(--brand-rgb) / 0.9), 0 0 0 9999px rgb(8 18 34 / 0.55);
  top: 0; left: 0;
}
/* Placed with transform (set by guide.tsx). It glides only while .moving, the
   moment after the step changes; on scroll it follows its part at once. */
.guide-spot.moving {
  transition: transform var(--dur-4) var(--ease-inout), width var(--dur-4) var(--ease-inout), height var(--dur-4) var(--ease-inout);
}
.guide-spot.none { transform: translate(50vw, 50vh) !important; width: 0 !important; height: 0 !important; box-shadow: 0 0 0 9999px rgb(8 18 34 / 0.55); }
.guide-card {
  position: fixed; z-index: 91; width: min(430px, calc(100vw - 32px)); display: grid; gap: 10px;
  animation: m-in var(--dur-3) var(--ease-out) both;
}
.guide-card.moving {
  transition: top var(--dur-4) var(--ease-inout), left var(--dur-4) var(--ease-inout);
}
.guide-card .pg-bubble { font-size: 15.5px; }
.guide-foot { display: flex; gap: 8px; align-items: center; justify-content: flex-end; }
.guide-dots { display: flex; gap: 5px; margin-right: auto; }
.guide-dots i { width: 7px; height: 7px; border-radius: 99px; background: rgb(255 255 255 / 0.35); transition: width 0.25s, background 0.25s; }
.guide-dots i.on { width: 20px; background: var(--brand); }
.guide-card .btn.ghost { background: var(--panel-solid); }
.pf-guide-btn { display: inline-flex; align-items: center; gap: 6px; }
.pf-guide-btn .penguin { margin: -6px 0 -4px -2px; }

/* the penguin in the reading room */
.rd-pg { display: flex; gap: 8px; align-items: flex-end; }
.rd-pg .pg-bubble { font-size: 14px; padding: 10px 12px; }
.rd-pg-x { align-self: flex-start; }
.rd-quiz-pg { display: flex; justify-content: flex-start; margin-bottom: -6px; }
.vb-done .penguin { margin: 0 auto -4px; }
.rd-quiz-pg .pg-bubble { flex: 0 1 auto; }
.tut-pg { align-items: center; }
.tut-pg .pg-bubble { font-size: 14.5px; padding: 10px 13px; }
.rv-pg, .pd-pg { margin: 0 auto; }

/* ---------- the learning path (web/profile/path.tsx) ---------- */
.pf-path { display: grid; gap: 16px; }
.pth-skel { min-height: 320px; background: linear-gradient(100deg, var(--panel) 30%, var(--panel-hi) 50%, var(--panel) 70%) 0 0 / 300% 100%; animation: pth-shimmer 1.4s linear infinite; }
@keyframes pth-shimmer { to { background-position: -150% 0; } }
.pth-head { display: flex; gap: 14px; align-items: center; }
.pth-head .pf-h { margin: 0 0 6px; }
.pth-head-t { display: grid; flex: 1; min-width: 0; }
.pth-flag { display: inline-flex; width: 46px; height: 46px; border-radius: 14px; overflow: hidden; flex: none; box-shadow: 0 0 0 2px var(--line-hi); }
.pth-flag svg { width: 100%; height: 100%; object-fit: cover; }
.pth-head-n { display: flex; gap: 8px; flex-wrap: wrap; }
.pth-chip { display: inline-flex; gap: 5px; align-items: center; font-size: 12.5px; font-weight: 800; padding: 4px 10px; border-radius: 99px; background: var(--panel-hi); color: var(--ink-2); }
.pth-chip.xp { background: rgb(var(--brand-rgb) / 0.14); color: var(--brand); }
.pth-chip .i { width: 14px; height: 14px; }
.pth-review { flex: none; }

/* The card on top: where I am and the one button that moves me on. */
.pth-now {
  position: relative; display: grid; gap: 14px; padding: 18px; border-radius: 22px; color: #fff; overflow: visible;
  background: radial-gradient(120% 140% at 100% 0%, rgb(255 255 255 / 0.16), transparent 55%), linear-gradient(135deg, rgb(var(--g)) 0%, rgb(var(--g) / 0.72) 100%);
  box-shadow: 0 18px 36px -22px rgb(var(--g)), inset 0 -4px 0 rgb(0 0 0 / 0.14);
}
.pth-now.all-done { --g: 16 185 129; display: flex; align-items: center; gap: 12px; font: 900 18px/1.3 var(--display); }
.pth-now-top { display: flex; gap: 12px; align-items: center; }
.pth-now-icon { display: inline-flex; flex: none; width: 46px; height: 46px; border-radius: 14px; align-items: center; justify-content: center; background: rgb(255 255 255 / 0.2); }
.pth-now-icon .i { width: 24px; height: 24px; }
.pth-now-t { display: grid; flex: 1; min-width: 0; }
.pth-now-t small { font-size: 12px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; opacity: 0.85; }
.pth-now-t b { font: 900 clamp(20px, 3vw, 26px)/1.15 var(--display); letter-spacing: -0.01em; }
.pth-now .pth-trail { background: rgb(0 0 0 / 0.16); border-radius: 18px; }
.pth-now .pth-step-l { color: rgb(255 255 255 / 0.85); }
.pth-now .pth-trail::before { background: rgb(255 255 255 / 0.22); }
.pth-now .pth-step:not(.done):not(.now) { background: rgb(255 255 255 / 0.16); color: #fff; box-shadow: 0 5px 0 rgb(0 0 0 / 0.2); }
.pth-now .pth-step.now { background: #fff; color: rgb(var(--g)); box-shadow: 0 5px 0 rgb(0 0 0 / 0.22); }
.pth-now .pth-step.now::after { border-color: rgb(255 255 255 / 0.6); }
.pth-now .pth-chest { color: rgb(255 255 255 / 0.75); }
.pth-go {
  justify-self: stretch; justify-content: center; font: 900 17px/1 var(--display); letter-spacing: 0.02em; text-transform: uppercase;
  background: #fff; color: rgb(var(--g)); border: 0; border-radius: 16px; padding: 16px; box-shadow: 0 5px 0 rgb(0 0 0 / 0.22);
}
@media (hover: hover) and (pointer: fine) { .pth-go:hover { filter: brightness(1.04); transform: translateY(-1px); } }
.pth-go:active { transform: translateY(4px); box-shadow: 0 1px 0 rgb(0 0 0 / 0.22); }
.pth-go .i { width: 20px; height: 20px; }
.pth-stars { display: inline-flex; gap: 2px; flex: none; }
.pth-stars .i { width: 18px; height: 18px; opacity: 0.4; }
.pth-stars .i.on { opacity: 1; fill: #fde047; color: #fde047; }

/* A unit's steps, in a row joined by a line. */
.pth-trail { position: relative; display: flex; justify-content: space-between; align-items: flex-start; gap: 4px; padding: 14px 10px 10px; }
.pth-trail::before { content: ''; position: absolute; left: 40px; right: 40px; top: 39px; height: 6px; border-radius: 99px; background: var(--line-hi); }
.pth-node { position: relative; z-index: 1; display: grid; justify-items: center; gap: 6px; flex: 1 1 0; min-width: 0; }
.pth-step {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 54px; height: 50px; border-radius: 50%; border: 0; cursor: pointer; color: #fff;
  background: rgb(var(--g)); box-shadow: 0 5px 0 rgb(var(--g) / 0.55);
  transition: transform 0.12s, box-shadow 0.12s;
}
.pth-step .i { width: 23px; height: 23px; stroke-width: 2.4; }
@media (hover: hover) and (pointer: fine) { .pth-step:hover:not(:disabled) { transform: translateY(-2px); } }
.pth-step:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 1px 0 rgb(var(--g) / 0.55); }
.pth-step:not(.done):not(.now) { background: var(--panel-solid); color: rgb(var(--g)); box-shadow: 0 5px 0 var(--line-hi), inset 0 0 0 2px var(--line-hi); }
.pth-step.done { background: var(--ok); color: #fff; box-shadow: 0 5px 0 rgb(16 185 129 / 0.5); }
.pth-step:disabled { cursor: not-allowed; color: var(--muted) !important; }
.pth-step.now::after {
  content: ''; position: absolute; inset: -8px; border-radius: inherit; border: 3px solid rgb(var(--g) / 0.45);
  animation: pth-halo 1.8s ease-in-out infinite; pointer-events: none;
}
.pth-step.final:not(.done) { border-radius: 16px; }
@keyframes pth-halo { 50% { transform: scale(1.12); opacity: 0.3; } }
@media (prefers-reduced-motion: reduce) { .pth-step.now::after, .pth-skel { animation: none; } }
.pth-step-l { font-size: 11.5px; font-weight: 800; color: var(--muted); text-align: center; line-height: 1.2; max-width: 100%; overflow-wrap: anywhere; }
.pth-chest-i { display: inline-flex; width: 50px; height: 50px; align-items: center; justify-content: center; }
.pth-chest { color: var(--muted); }
.pth-chest .i { width: 30px; height: 30px; }
.pth-chest.open { color: var(--warn); }
.pth-ask {
  position: absolute; top: calc(100% + 8px); right: -6px; z-index: 20; width: min(300px, 84vw); display: grid; gap: 8px; padding: 12px;
  border-radius: 16px; background: var(--panel-solid); color: var(--ink); border: 1px solid var(--line-hi); box-shadow: 0 20px 40px -18px rgb(0 0 0 / 0.6);
  animation: pop 0.16s ease-out; text-align: left;
}
.pth-ask > b { font-size: 14px; }
.pth-ask-o {
  display: flex; gap: 10px; align-items: center; text-align: left; padding: 10px 12px; border-radius: 12px; cursor: pointer; font: inherit;
  background: var(--panel-hi); border: 1px solid var(--line); color: var(--ink);
}
.pth-ask-o:hover { border-color: rgb(var(--g)); }
.pth-ask-o > .i { width: 22px; height: 22px; color: rgb(var(--g)); flex: none; }
.pth-ask-o span { display: grid; gap: 2px; }
.pth-ask-o small { font-size: 12px; }

/* Alone or with friends, said once. */
.pth-how { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pth-how-i { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 14px; background: var(--panel-hi); border: 1px solid var(--line); }
.pth-how-i > span:last-child { display: grid; gap: 2px; }
.pth-how-i b { font-size: 14px; }
.pth-how-i small { font-size: 12.5px; line-height: 1.4; }
.pth-how-icon { display: inline-flex; flex: none; width: 34px; height: 34px; border-radius: 10px; align-items: center; justify-content: center; }
.pth-how-icon .i { width: 18px; height: 18px; }
.pth-how-icon.solo { background: rgb(var(--brand-rgb) / 0.14); color: var(--brand); }
.pth-how-icon.duo { background: rgb(var(--violet-rgb) / 0.16); color: var(--violet-ink); }
@media (max-width: 560px) { .pth-how { grid-template-columns: 1fr; } }

/* The grammar of a lesson, before its exercises. */
.dr-tip { display: grid; gap: 12px; padding: 18px; border-radius: 20px; border: 2px solid var(--line-hi); border-bottom-width: 5px; background: var(--panel-solid); }
.dr-tip-head { display: flex; gap: 12px; align-items: center; }
.dr-tip-head b { font: 900 20px/1.25 var(--display); }
.dr-tip ul { margin: 0; padding-left: 20px; display: grid; gap: 10px; font-size: 16px; line-height: 1.5; }
.dr-tip li::marker { color: var(--brand); }

/* The levels, as tabs. */
.pth-tabs { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 8px; }
.pth-tab {
  display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 4px 8px; padding: 9px 12px; border-radius: 14px; cursor: pointer; font: inherit; text-align: left;
  background: var(--panel-hi); border: 2px solid transparent; color: var(--ink);
}
.pth-tab b { font: 900 16px/1 var(--display); }
.pth-tab small { grid-column: 2; justify-self: end; grid-row: 1; font-size: 12px; font-weight: 800; color: var(--muted); }
.pth-tab-bar { grid-column: 1 / -1; height: 6px; border-radius: 99px; background: var(--well); overflow: hidden; }
.pth-tab-bar > span { display: block; height: 100%; border-radius: inherit; background: var(--ok); transition: width 0.4s; }
.pth-tab:hover { border-color: var(--line-hi); }
.pth-tab.on { border-color: var(--brand); background: rgb(var(--brand-rgb) / 0.1); }

/* The units of a level: one short row each, opened one at a time. */
.pth-units { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.pth-row { border-radius: 16px; background: var(--panel-hi); border: 1px solid var(--line); transition: border-color 0.15s, background 0.15s; }
.pth-row.current { border-color: rgb(var(--g) / 0.7); box-shadow: inset 4px 0 0 rgb(var(--g)); }
.pth-row.open { background: var(--panel); border-color: var(--line-hi); }
.pth-row-head { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; background: none; border: 0; color: var(--ink); font: inherit; text-align: left; cursor: pointer; border-radius: inherit; }
.pth-row-head:hover .pth-row-t b { color: rgb(var(--g)); }
.pth-row-icon { display: inline-flex; flex: none; width: 40px; height: 40px; border-radius: 12px; align-items: center; justify-content: center; color: #fff; background: rgb(var(--g)); box-shadow: 0 3px 0 rgb(var(--g) / 0.5); }
.pth-row-icon .i { width: 20px; height: 20px; }
.pth-row.full .pth-row-icon { background: var(--ok); box-shadow: 0 3px 0 rgb(16 185 129 / 0.5); }
.pth-row.locked .pth-row-icon { background: var(--panel-solid); color: var(--muted); box-shadow: inset 0 0 0 2px var(--line-hi); }
.pth-row.locked .pth-row-t b { color: var(--muted); }
.pth-row-t { display: grid; flex: 1; min-width: 0; gap: 1px; }
.pth-row-t b { font: 800 15.5px/1.25 var(--display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color 0.15s; }
.pth-row-t small { font-size: 12px; }
.pth-here { color: rgb(var(--g)); font-weight: 900; }
.pth-dots { display: inline-flex; gap: 4px; flex: none; }
.pth-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--line-hi); }
.pth-dots i.on { background: var(--ok); }
.pth-row .pth-stars .i { width: 15px; height: 15px; }
.pth-row-chev { width: 18px; height: 18px; color: var(--muted); flex: none; }
.pth-row-body { display: grid; gap: 8px; padding: 0 12px 12px; animation: pop 0.16s ease-out; }
.pth-row-body .pth-trail { padding-top: 6px; }
.pth-row-body .pth-trail::before { top: 31px; }
.pth-locked { margin: 0; font-size: 13px; display: flex; gap: 6px; align-items: center; justify-content: center; }
.pth-again { justify-self: center; }

.pth-trophy { display: flex; gap: 12px; align-items: center; justify-content: center; padding: 10px 12px; border-radius: 16px; border: 2px dashed var(--line-hi); font-size: 13.5px; }
.pth-trophy-icon .i { width: 26px; height: 26px; color: var(--muted); }
.pth-trophy.won { border-style: solid; border-color: var(--warn); background: rgb(245 158 11 / 0.08); }
.pth-trophy.won .pth-trophy-icon .i { color: var(--warn); }
.pth-trophy-t { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.path-note { margin-top: 6px; font-size: 14px; font-weight: 700; color: var(--muted); display: inline-flex; gap: 6px; align-items: center; justify-content: center; }
.path-note.ok { color: var(--ok); }
@media (max-width: 560px) {
  .pth-head { flex-wrap: wrap; }
  .pth-review { order: 3; width: 100%; justify-content: center; }
  .pth-now { padding: 14px; }
  .pth-trail { padding: 12px 4px 8px; }
  .pth-trail::before { left: 28px; right: 28px; top: 35px; }
  .pth-step, .pth-chest-i { width: 46px; height: 44px; }
  .pth-row-body .pth-trail::before { top: 29px; }
  .pth-step .i { width: 20px; height: 20px; }
  .pth-step-l { font-size: 10.5px; }
  .pth-dots { display: none; }
}

/* ---------- a lesson of the path (web/drill/index.tsx) ---------- */
.dr-screen {
  position: fixed; inset: 0; z-index: 200; display: grid; grid-template-rows: auto 1fr auto;
  background: var(--bg); color: var(--ink); animation: dr-in 0.22s ease-out both;
}
@keyframes dr-in { from { opacity: 0; transform: translateY(12px); } }
.dr-top { display: flex; align-items: center; gap: 14px; width: min(760px, 100%); margin: 0 auto; padding: 18px 16px 6px; }
.dr-x { flex: none; display: inline-flex; width: 40px; height: 40px; align-items: center; justify-content: center; border-radius: 12px; border: 0; background: none; color: var(--muted); cursor: pointer; }
.dr-x:hover { background: var(--panel-hi); color: var(--ink); }
.dr-x .i { width: 24px; height: 24px; }
.dr-bar { flex: 1; height: 16px; border-radius: 99px; background: var(--panel-hi); overflow: hidden; }
.dr-bar > div {
  position: relative; height: 100%; min-width: 16px; border-radius: inherit; background: var(--ok); transition: width 0.45s cubic-bezier(.3, 1.3, .5, 1);
}
.dr-bar > div::after { content: ''; position: absolute; left: 8px; right: 8px; top: 3px; height: 4px; border-radius: 99px; background: rgb(255 255 255 / 0.35); }
.dr-combo { display: inline-flex; gap: 3px; align-items: center; font: 900 16px/1 var(--display); color: var(--muted); min-width: 44px; opacity: 0.5; transition: opacity 0.2s, color 0.2s; }
.dr-combo.on { color: var(--brand); opacity: 1; }
.dr-combo.bump { animation: dr-bump 0.35s ease-out; }
@keyframes dr-bump { 40% { transform: scale(1.35); } }
.dr-sound { width: 36px; height: 36px; }
.dr-sound .i { width: 20px; height: 20px; }
.dr-bar.glow > div { box-shadow: 0 0 14px rgb(16 185 129 / 0.8); }
.dr-milestone {
  position: fixed; top: 64px; left: 50%; z-index: 6; transform: translateX(-50%); display: inline-flex; gap: 8px; align-items: center;
  padding: 10px 18px; border-radius: 99px; background: var(--brand); color: #fff; font: 900 18px/1 var(--display);
  box-shadow: 0 12px 30px -10px rgb(var(--brand-rgb)); animation: dr-milestone 1.6s ease both; pointer-events: none;
}
.dr-milestone .i { width: 22px; height: 22px; }
@keyframes dr-milestone { 0% { opacity: 0; transform: translate(-50%, 16px) scale(0.7); } 15% { opacity: 1; transform: translate(-50%, 0) scale(1.08); } 25% { transform: translate(-50%, 0) scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -12px); } }
.dr-foot.right .dr-foot-icon, .dr-foot.close .dr-foot-icon { animation: dr-yay 0.5s cubic-bezier(.3, 1.6, .5, 1); }
.dr-foot.wrong .dr-foot-icon { animation: mem-shake 0.45s ease; }
@keyframes dr-yay { 0% { transform: scale(0.3) rotate(-20deg); } 100% { transform: none; } }
.dr-stats > div { animation: dr-stat 0.45s cubic-bezier(.3, 1.5, .5, 1) both; }
.dr-stats > div:nth-child(2) { animation-delay: 0.15s; } .dr-stats > div:nth-child(3) { animation-delay: 0.3s; }
@keyframes dr-stat { from { opacity: 0; transform: translateY(18px) scale(0.85); } }
.dr-tile.in { animation: dr-drop 0.18s ease-out; }
@keyframes dr-drop { from { transform: translateY(14px) scale(0.9); opacity: 0.4; } }
.dr-combo .i { width: 20px; height: 20px; }
.dr-main { width: min(640px, 100%); margin: 0 auto; padding: 18px 16px 24px; display: flex; flex-direction: column; gap: 20px; overflow-y: auto; animation: dr-slide 0.26s ease-out both; }
@keyframes dr-slide { from { opacity: 0; transform: translateX(18px); } }
.dr-ask { margin: 0; font: 900 clamp(22px, 3.4vw, 30px)/1.2 var(--display); letter-spacing: -0.01em; }
.dr-retry { display: inline-flex; gap: 6px; align-items: center; align-self: flex-start; font-size: 13px; font-weight: 900; color: var(--brand); text-transform: uppercase; letter-spacing: 0.05em; }
.dr-retry .i { width: 15px; height: 15px; }
.dr-loading { display: grid; place-items: center; color: var(--muted); }
.dr-loading .i { width: 34px; height: 34px; animation: spin 1s linear infinite; }

/* A new word. */
.dr-intro { display: grid; gap: 12px; justify-items: center; }
.dr-new { display: inline-flex; gap: 6px; align-items: center; padding: 5px 12px; border-radius: 99px; background: rgb(var(--violet-rgb) / 0.16); color: var(--violet-ink); font-size: 13px; font-weight: 900; text-transform: uppercase; letter-spacing: 0.05em; }
.dr-intro-card { display: grid; gap: 8px; justify-items: center; text-align: center; width: min(380px, 100%); padding: 26px 20px; border-radius: 24px; border: 2px solid var(--line-hi); border-bottom-width: 5px; background: var(--panel-solid); }
.dr-emoji { font-size: 84px; line-height: 1.1; }
.dr-emoji.none { display: inline-flex; width: 104px; height: 104px; border-radius: 30px; align-items: center; justify-content: center; background: rgb(var(--brand-rgb) / 0.14); color: var(--brand); }
.dr-emoji.none .i { width: 54px; height: 54px; }
.dr-intro-word { display: inline-flex; gap: 10px; align-items: center; border: 0; background: none; color: var(--brand-2); font: 900 34px/1.2 var(--display); cursor: pointer; }
.dr-intro-word .i { width: 26px; height: 26px; }
.dr-reading { color: var(--muted); font-size: 15px; font-weight: 700; }
.dr-intro-mean { font-size: 19px; font-weight: 800; }
.dr-intro-ex { font-size: 14px; line-height: 1.45; max-width: 36ch; }

/* The penguin asks. */
.dr-prompt { display: flex; align-items: flex-end; gap: 10px; }
.dr-prompt .penguin, .dr-prompt > :first-child { flex: none; }
.dr-bubble {
  position: relative; display: grid; gap: 4px; padding: 14px 18px; border-radius: 18px; border: 2px solid var(--line-hi); background: var(--panel-solid);
  color: var(--ink); font: 800 20px/1.35 var(--font); text-align: left; margin-bottom: 18px;
}
button.dr-bubble { display: flex; align-items: center; gap: 10px; cursor: pointer; flex-wrap: wrap; }
button.dr-bubble .i { width: 22px; height: 22px; color: var(--brand-2); }
.dr-bubble small { display: block; flex-basis: 100%; font-size: 13px; font-weight: 700; color: var(--muted); }
.dr-bubble::before { content: ''; position: absolute; left: -9px; bottom: 16px; width: 14px; height: 14px; background: inherit; border-left: 2px solid var(--line-hi); border-bottom: 2px solid var(--line-hi); transform: rotate(45deg); }
.dr-bubble-emoji { font-size: 30px; margin-right: 8px; vertical-align: middle; }

.dr-speakers { display: flex; gap: 14px; align-items: flex-end; justify-content: center; }
.dr-speak { display: inline-flex; align-items: center; justify-content: center; width: 64px; height: 64px; border-radius: 20px; border: 0; cursor: pointer; color: #fff; background: var(--brand-2); box-shadow: 0 5px 0 rgb(30 80 130); }
.dr-speak .i { width: 30px; height: 30px; }
.dr-speak.slow { width: 50px; height: 50px; border-radius: 16px; }
.dr-speak.slow .i { width: 22px; height: 22px; }
.dr-speakers.big .dr-speak:not(.slow) { width: 110px; height: 110px; border-radius: 28px; }
.dr-speakers.big .dr-speak:not(.slow) .i { width: 50px; height: 50px; }
.dr-speak:active { transform: translateY(4px); box-shadow: 0 1px 0 rgb(30 80 130); }

/* Choices: pictures in a grid, or a list. */
.dr-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.dr-grid.words .dr-card { min-height: 96px; align-content: center; font-size: 20px; }
.dr-card, .dr-opt {
  position: relative; border-radius: 16px; border: 2px solid var(--line-hi); box-shadow: 0 3px 0 var(--lip, var(--line-hi)); background: var(--panel-solid);
  color: var(--ink); cursor: pointer; font: 800 17px/1.3 var(--font);
  transition: transform var(--dur-1) var(--ease-out), box-shadow var(--dur-1) var(--ease-out), border-color 0.12s, background 0.12s;
}
.dr-card { display: grid; justify-items: center; gap: 8px; padding: 18px 10px 14px; }
.dr-card-emoji { font-size: 56px; line-height: 1.1; }
.dr-card kbd, .dr-opt kbd { font: 800 11px/1 var(--font); color: var(--muted); border: 2px solid var(--line-hi); border-radius: 7px; padding: 3px 6px; }
.dr-card kbd { position: absolute; top: 8px; left: 8px; }
.dr-list { display: grid; gap: 10px; }
.dr-opt { display: flex; gap: 12px; align-items: center; padding: 14px 16px; text-align: left; }
.dr-card:hover:not(:disabled), .dr-opt:hover:not(:disabled) { background: var(--panel-hi); }
.dr-card:active:not(:disabled), .dr-opt:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 0 0 var(--lip, var(--line-hi)); }
.dr-card:disabled, .dr-opt:disabled { cursor: default; }
.dr-card.on, .dr-opt.on { border-color: var(--brand-2); --lip: var(--brand-2); background: rgb(62 131 196 / 0.14); color: var(--brand-2); }
.dr-card.on kbd, .dr-opt.on kbd { border-color: var(--brand-2); color: var(--brand-2); }
/* A right answer gets a little springy pop, not just a colour change. */
.dr-card.right, .dr-opt.right { border-color: var(--ok); --lip: var(--ok); background: rgb(16 185 129 / 0.14); color: var(--ok); animation: m-pop var(--dur-4) var(--ease-spring); }
.dr-card.wrong, .dr-opt.wrong { border-color: var(--bad); --lip: var(--bad); background: rgb(244 63 94 / 0.12); color: var(--bad); animation: m-shake var(--dur-4) var(--ease-out); }

/* Tiles: a line to build on, and the bank they come from. */
.dr-line { min-height: 64px; display: flex; flex-wrap: wrap; gap: 8px; align-content: flex-start; padding: 10px 2px; border-bottom: 2px solid var(--line-hi); background: repeating-linear-gradient(transparent 0 62px, var(--line) 62px 64px); }
.dr-line.spell { justify-content: center; background: none; border-bottom: 0; gap: 6px; min-height: 60px; }
.dr-line.right { border-color: var(--ok); } .dr-line.close { border-color: var(--warn); } .dr-line.wrong { border-color: var(--bad); }
.dr-line.spell.right .dr-tile { border-color: var(--ok); --lip: var(--ok); color: var(--ok); }
.dr-line.spell.wrong .dr-tile { border-color: var(--bad); --lip: var(--bad); color: var(--bad); }
.dr-slot { width: 48px; height: 52px; border-radius: 12px; border: 2px dashed var(--line-hi); }
.dr-bank { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.dr-tile {
  min-width: 44px; padding: 10px 14px; border-radius: 12px; border: 2px solid var(--line-hi); box-shadow: 0 2px 0 var(--lip, var(--line-hi)); background: var(--panel-solid);
  color: var(--ink); font: 800 17px/1.2 var(--font); cursor: pointer; animation: rv-pop 0.18s ease both;
  transition: transform var(--dur-1) var(--ease-out), box-shadow var(--dur-1) var(--ease-out);
}
.dr-bank.spell .dr-tile, .dr-line.spell .dr-tile { width: 48px; height: 52px; padding: 0; font: 900 22px/1 var(--display); text-transform: none; }
.dr-tile:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 0 0 var(--lip, var(--line-hi)); }
.dr-tile.used { color: transparent; background: var(--panel-hi); border-color: transparent; --lip: transparent; animation: none; }
.dr-tile:disabled { cursor: default; }

/* Pairs. */
.dr-match { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.dr-match-col { display: grid; gap: 10px; align-content: start; }
.dr-match-o { justify-content: center; text-align: center; min-height: 58px; }
.dr-match-o.done { opacity: 0.35; border-color: var(--ok); --lip: var(--ok); color: var(--ok); }
.dr-match-o.bad { border-color: var(--bad); --lip: var(--bad); background: rgb(244 63 94 / 0.12); color: var(--bad); animation: mem-shake 0.45s ease; }

.dr-input { font-size: 20px; padding: 16px; border-radius: 16px; }
.dr-input.right { border-color: var(--ok); } .dr-input.close { border-color: var(--warn); } .dr-input.wrong { border-color: var(--bad); }

/* The strip at the bottom: check, then how it went. */
.dr-foot { border-top: 2px solid var(--line); background: var(--bg); }
.dr-foot-in { width: min(760px, 100%); margin: 0 auto; padding: 16px; display: flex; gap: 14px; align-items: center; justify-content: flex-end; min-height: 96px; }
.dr-go { min-width: 180px; justify-content: center; font: 900 16px/1 var(--display); letter-spacing: 0.04em; text-transform: uppercase; padding: 15px 22px; border-radius: 16px; }
.dr-foot .btn.dr-go:disabled { background: var(--panel-hi); color: var(--muted); box-shadow: none; opacity: 1; cursor: not-allowed; }
.dr-skip { margin-right: auto; text-transform: uppercase; font-weight: 900; letter-spacing: 0.04em; }
.dr-foot.right, .dr-foot.close { background: rgb(16 185 129 / 0.14); border-color: transparent; animation: dr-up 0.2s ease-out both; }
.dr-foot.close { background: rgb(245 158 11 / 0.14); }
.dr-foot.wrong { background: rgb(244 63 94 / 0.13); border-color: transparent; animation: dr-up 0.2s ease-out both; }
@keyframes dr-up { from { transform: translateY(30px); opacity: 0; } }
.dr-foot-icon { display: inline-flex; flex: none; width: 56px; height: 56px; border-radius: 50%; align-items: center; justify-content: center; background: var(--panel-solid); }
.dr-foot-icon .i { width: 32px; height: 32px; stroke-width: 3; }
.dr-foot.right .dr-foot-icon, .dr-foot.close .dr-foot-icon { color: var(--ok); }
.dr-foot.close .dr-foot-icon { color: var(--warn); }
.dr-foot.wrong .dr-foot-icon { color: var(--bad); }
.dr-foot-t { display: grid; gap: 3px; flex: 1; min-width: 0; }
.dr-foot-t > b { font: 900 22px/1.2 var(--display); }
.dr-foot.right .dr-foot-t > b { color: var(--ok); } .dr-foot.close .dr-foot-t > b { color: var(--warn); } .dr-foot.wrong .dr-foot-t > b { color: var(--bad); }
.dr-foot-t span { font-size: 15px; }
.dr-foot-t small { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.dr-foot .btn.ok { background: var(--ok); color: #fff; box-shadow: 0 4px 0 rgb(8 120 84); }
.dr-foot .btn.bad { background: var(--bad); color: #fff; box-shadow: 0 4px 0 rgb(170 30 60); }

/* The end, and the "are you sure" on the way out. */
.dr-end { grid-row: 1 / -1; display: grid; gap: 16px; justify-items: center; align-content: center; text-align: center; padding: 24px 16px; width: min(560px, 100%); margin: 0 auto; }
.dr-end-t { margin: 0; font: 900 clamp(26px, 4vw, 34px)/1.15 var(--display); color: var(--warn); }
.dr-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; width: 100%; }
.dr-stats > div { display: grid; border-radius: 16px; overflow: hidden; border: 2px solid var(--c); background: var(--c); }
.dr-stats > div > span { padding: 6px; font-size: 12px; font-weight: 900; color: #fff; text-transform: uppercase; letter-spacing: 0.05em; }
.dr-stats b { display: flex; gap: 6px; align-items: center; justify-content: center; padding: 14px 6px; background: var(--panel-solid); color: var(--c); font: 900 22px/1 var(--display); font-variant-numeric: tabular-nums; border-radius: 13px 13px 0 0; }
.dr-stats b .i { width: 20px; height: 20px; }
.dr-stats .xp { --c: #f59e0b; } .dr-stats .good { --c: #10b981; } .dr-stats .meh { --c: #f97316; } .dr-stats .time { --c: #3e83c4; }
.dr-end-btns { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; width: 100%; }
.dr-end-btns .btn { min-width: 200px; justify-content: center; text-transform: uppercase; font-weight: 900; letter-spacing: 0.04em; }
.dr-quit { position: absolute; inset: 0; z-index: 5; display: grid; align-items: center; padding: 16px; background: rgb(0 0 0 / 0.5); animation: dr-in 0.15s ease-out; }
.dr-quit-in { display: grid; gap: 10px; justify-items: center; text-align: center; padding: 24px 16px 28px; background: var(--panel-solid); border-radius: 24px; width: min(560px, 100%); margin: 0 auto; box-shadow: var(--shadow); animation: pg-pop 0.2s ease-out; }
.dr-quit-in b { font: 900 22px/1.2 var(--display); }
.dr-quit-in .btn { width: min(360px, 100%); justify-content: center; }
@media (max-width: 560px) {
  .dr-top { padding-top: 12px; gap: 8px; }
  .dr-main { gap: 16px; padding-top: 10px; }
  .dr-card-emoji { font-size: 44px; }
  .dr-foot-in { flex-wrap: wrap; min-height: 0; }
  .dr-foot .dr-go { width: 100%; }
  .dr-foot-icon { width: 42px; height: 42px; }
  .dr-foot-icon .i { width: 24px; height: 24px; }
  .dr-prompt .dr-bubble { font-size: 17px; }
  .dr-bank.spell .dr-tile, .dr-line.spell .dr-tile { width: 42px; height: 46px; font-size: 19px; }
  .dr-slot { width: 42px; height: 46px; }
  .dr-stats b { font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) { .dr-screen, .dr-main, .dr-foot, .dr-quit, .dr-combo, .dr-stats > div, .dr-tile.in, .dr-foot-icon { animation: none !important; } }

/* the better recogniser on its way (web/live, Bar) */
.live-upgrade { display: flex; gap: 10px; align-items: center; margin: 6px 12px 0; padding: 8px 12px; border-radius: 12px; background: rgb(var(--brand-rgb) / .1); border: 1px solid rgb(var(--brand-rgb) / .35); font-size: 13px; line-height: 1.35; }
.live-upgrade > .i { flex: none; width: 18px; height: 18px; color: var(--brand); }
.live-upgrade > span:first-of-type { flex: 1; min-width: 0; }
.live-upgrade-bar { flex: none; width: 90px; height: 6px; border-radius: 99px; background: rgb(var(--brand-rgb) / .18); overflow: hidden; }
.live-upgrade-bar > i { display: block; height: 100%; background: var(--brand); transition: width .4s ease; }
@media (max-width: 560px) { .live-upgrade-bar { display: none; } }

/* Caption quality: a button in the caption bar and its menu (web/live). */
.live-q-menu { display: none; }
.live-q-menu:popover-open { display: grid; }
.live-q-menu {
  position: fixed; inset: auto 16px 140px auto; margin: 0; width: min(330px, calc(100vw - 32px));
  gap: 4px; padding: 8px; border: 1px solid var(--line-hi); border-radius: 18px; background: var(--panel-solid, var(--bg));
  box-shadow: 0 24px 60px -18px rgb(0 0 0 / 0.5); z-index: 60;
}
/* In and out as it opens and closes: display and overlay are kept for the
   way out (allow-discrete), @starting-style gives the way in a first frame.
   Browsers without them just show and hide it. */
.live-q-menu {
  opacity: 0; transform: translateY(6px);
  transition: opacity var(--dur-2) var(--ease-in), transform var(--dur-2) var(--ease-in),
    display var(--dur-2) allow-discrete, overlay var(--dur-2) allow-discrete;
}
.live-q-menu:popover-open { opacity: 1; transform: none; transition-timing-function: var(--ease-out); }
@starting-style { .live-q-menu:popover-open { opacity: 0; transform: translateY(6px); } }
.live-q-title { padding: 6px 10px 4px; font-weight: 800; font-size: 13px; color: var(--muted, inherit); }
.live-q-opt { justify-content: flex-start; align-items: flex-start; width: 100%; gap: 10px; padding: 10px 12px; text-align: left; }
.live-q-opt > span { display: grid; gap: 2px; min-width: 0; }
.live-q-opt small { font-weight: 500; font-size: 12px; line-height: 1.35; opacity: .75; white-space: normal; }
.live-q-opt.on { background: rgb(var(--brand-rgb) / .1); border-color: rgb(var(--brand-rgb) / .35); }
.live-q-opt.on .i { color: var(--brand); }
@media (max-width: 560px) { .live-q-label { display: none; } }

/* game feel */
/* The moments of the learning path, and the level up. Windows leaving the
   screen (modals, the lesson screen, the translator) are played from script
   (web/shared/motion.ts), because React has to wait for them to finish.
   Everything that moves here moves only transform and opacity, and only when
   the person has not asked for less motion: the still state is the end state. */

/* The trail's line, filled up to the furthest step done. Scaled, not sized,
   so it grows without moving anything around it. */
.pth-fill {
  position: absolute; left: 40px; right: 40px; top: 39px; height: 6px; border-radius: 99px; pointer-events: none;
  background: var(--ok); transform-origin: left center; transform: scaleX(var(--p, 0));
}
.pth-now .pth-fill { background: rgb(255 255 255 / 0.85); }
.pth-row-body .pth-fill { top: 31px; }
@media (max-width: 560px) {
  .pth-fill { left: 28px; right: 28px; top: 35px; }
  .pth-row-body .pth-fill { top: 29px; }
}
.pth-chip.xp { font-variant-numeric: tabular-nums; }

/* level up: a badge in the middle of the screen that takes no clicks */
.fun-lvup { position: fixed; inset: 0; z-index: 2002; display: grid; place-items: center; padding: 16px; pointer-events: none; }
.fun-lvup-card {
  position: relative; display: grid; justify-items: center; gap: 12px; width: min(360px, 100%); padding: 26px 26px 22px; text-align: center;
  background: var(--panel-solid); border: 1px solid var(--line-hi); border-radius: 26px; box-shadow: 0 40px 80px -30px rgb(0 0 0 / 0.7);
}
.fun-lvup-card strong { font: 900 20px/1.25 var(--display); }
.fun-lvup-badge {
  position: relative; z-index: 1; display: grid; place-items: center; width: 84px; height: 84px; border-radius: 26px; color: #fff;
  background: linear-gradient(135deg, var(--brand), #f99a5a); box-shadow: 0 10px 24px -8px rgb(var(--brand-rgb) / 0.8);
}
.fun-lvup-badge b { font: 900 40px/1 var(--display); font-variant-numeric: tabular-nums; }
.fun-lvup-ring { position: absolute; top: 26px; left: 50%; width: 84px; height: 84px; margin-left: -42px; border-radius: 50%; opacity: 0;
  background: radial-gradient(circle, rgb(var(--brand-rgb) / 0.55), transparent 70%); }

@media (prefers-reduced-motion: no-preference) {
  .pth-fill { transition: transform var(--dur-5, 700ms) var(--ease-out, cubic-bezier(.2, .7, .2, 1)); }

  /* A step just done pops (scale, so a hover's translate is left alone),
     sends out a ring, and its tick draws itself. */
  .pth-step.just { animation: gf-pop var(--dur-4, 400ms) var(--ease-spring, cubic-bezier(.34, 1.56, .64, 1)) backwards; }
  .pth-step.just::before {
    content: ''; position: absolute; inset: -6px; border-radius: inherit; pointer-events: none;
    box-shadow: 0 0 0 3px var(--ok); opacity: 0; animation: gf-ring 700ms var(--ease-out, cubic-bezier(.2, .7, .2, 1)) 120ms;
  }
  .pth-step.just:not(.final) .i * { stroke-dasharray: 30; stroke-dashoffset: 30; animation: gf-draw 360ms var(--ease-out, cubic-bezier(.2, .7, .2, 1)) 160ms forwards; }

  /* A unit just opened: its icon pops with a glow ring in its own colour. */
  .pth-row.fresh .pth-row-icon, .pth-now.fresh .pth-now-icon { position: relative; animation: gf-pop var(--dur-4, 400ms) var(--ease-spring, cubic-bezier(.34, 1.56, .64, 1)) 200ms backwards; }
  .pth-row.fresh .pth-row-icon::after, .pth-now.fresh .pth-now-icon::after {
    content: ''; position: absolute; inset: -4px; border-radius: inherit; pointer-events: none; opacity: 0;
    box-shadow: 0 0 0 3px rgb(var(--g)), 0 0 18px 4px rgb(var(--g) / 0.6); animation: gf-ring 900ms ease-out 300ms;
  }
  .pth-now.fresh .pth-now-icon::after { box-shadow: 0 0 0 3px #fff, 0 0 20px 6px rgb(255 255 255 / 0.55); }

  /* The chest of a unit just finished bursts open. */
  .pth-chest.just .pth-chest-i { animation: gf-chest 700ms var(--ease-spring, cubic-bezier(.34, 1.56, .64, 1)) 250ms backwards; }

  .fun-lvup-card { animation: gf-land var(--dur-4, 400ms) var(--ease-spring, cubic-bezier(.34, 1.56, .64, 1)) both; }
  .fun-lvup-badge { animation: gf-pop var(--dur-4, 400ms) var(--ease-spring, cubic-bezier(.34, 1.56, .64, 1)) 160ms backwards; }
  .fun-lvup-ring { animation: gf-burst 1.1s var(--ease-out, cubic-bezier(.2, .7, .2, 1)) 150ms; }
}
@keyframes gf-pop { 0% { scale: 0.6; } 55% { scale: 1.14; } 100% { scale: 1; } }
@keyframes gf-ring { 0% { opacity: 0.9; transform: scale(0.85); } 100% { opacity: 0; transform: scale(1.5); } }
@keyframes gf-draw { to { stroke-dashoffset: 0; } }
@keyframes gf-chest { 0% { transform: scale(0.7) rotate(0); } 35% { transform: scale(1.25) rotate(-10deg); } 60% { transform: scale(1.1) rotate(8deg); } 100% { transform: none; } }
@keyframes gf-land { from { opacity: 0; transform: translateY(16px) scale(0.85); } }
@keyframes gf-burst { 0% { opacity: 0; transform: scale(0.4); } 30% { opacity: 1; } 100% { opacity: 0; transform: scale(2.6); } }

/* stories */
/* The stories (web/stories): a chat that grows line by line, one face and
   colour per character (--c, "r g b"), on the whole screen like a lesson. */
.st-screen {
  position: fixed; inset: 0; z-index: 200; display: grid; grid-template-rows: auto 1fr auto;
  background: var(--bg); color: var(--ink); animation: dr-in 0.22s ease-out both;
}
.st-screen.st-wait { place-items: center; color: var(--muted); }
.st-screen.st-wait .i { width: 34px; height: 34px; animation: spin 1s linear infinite; }
.st-top { display: flex; align-items: center; gap: 8px; width: min(760px, 100%); margin: 0 auto; padding: 14px 16px 6px; }
.st-top .dr-bar { min-width: 60px; }
.st-top-t { flex: 1; display: flex; gap: 8px; align-items: center; font: 900 22px/1.1 var(--display); }
.st-toggle { width: 38px; height: 38px; }
.st-toggle .i { width: 20px; height: 20px; }
.st-toggle.on { color: var(--brand-2); background: rgb(var(--violet-rgb) / 0.14); }
.st-lib-body { overflow-y: auto; padding: 8px 16px 32px; }
.st-lib-body > * { width: min(900px, 100%); margin-left: auto; margin-right: auto; }
.st-lib-body > * + * { margin-top: 14px; }
.st-pg { margin-bottom: 4px; }
.st-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }

/* a story's cover: its cast in a row, on the colour of the story */
.st-cover {
  display: grid; grid-template-rows: auto 1fr; text-align: left; padding: 0; overflow: hidden; border-radius: 16px; cursor: pointer; color: var(--ink);
  background: var(--panel-solid); border: 1px solid rgb(var(--g) / 0.35); box-shadow: 0 8px 22px -18px rgb(var(--g) / 0.9);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s; font: inherit;
}
@media (hover: hover) and (pointer: fine) { .st-cover:hover { transform: translateY(-3px); border-color: rgb(var(--g) / 0.7); box-shadow: 0 14px 30px -16px rgb(var(--g) / 0.9); } }
.st-cover-art {
  position: relative; display: flex; align-items: flex-end; justify-content: center; height: 100px; overflow: hidden;
  background: radial-gradient(120% 140% at 0% 0%, rgb(var(--g) / 0.55), rgb(var(--g) / 0.18) 60%, rgb(var(--g) / 0.08));
}
.st-cover.lg .st-cover-art { height: 120px; }
.st-cover-cast { display: flex; margin-bottom: -10px; }
.st-face {
  display: grid; place-items: center; width: 54px; height: 54px; margin: 0 -6px; border-radius: 50%; font-size: 28px;
  background: rgb(var(--c) / 0.85); border: 3px solid var(--panel-solid); transform: translateY(calc(var(--i) * 4px - 4px)) rotate(calc(var(--i) * 5deg - 5deg));
}
.st-cover.lg .st-face { width: 62px; height: 62px; font-size: 32px; }
@media (hover: hover) and (pointer: fine) { .st-cover:hover .st-face { animation: st-bob 0.6s ease-in-out calc(var(--i) * 0.08s); } }
@keyframes st-bob { 50% { transform: translateY(-8px); } }
.st-cover-art .rd-level { position: absolute; left: 12px; top: 12px; background: var(--panel-solid); }
.st-cover-found { position: absolute; right: 10px; top: 10px; display: inline-flex; gap: 4px; align-items: center; font-size: 12px; font-weight: 800; padding: 3px 8px; border-radius: 99px; background: var(--panel-solid); color: var(--ink-2); }
.st-cover-found.all { color: var(--warn); }
.st-cover-found .i { width: 13px; height: 13px; }
.st-cover-body { display: grid; gap: 4px; align-content: start; padding: 14px 14px 14px; }
.st-cover-title { font-family: var(--display); font-weight: 900; font-size: 18px; letter-spacing: -0.02em; line-height: 1.2; }
.st-cover-tr { font-size: 12.5px; font-weight: 700; }
.st-cover-sum { font-size: 13px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.st-cover-meta { display: flex; gap: 5px; align-items: center; font-size: 12.5px; }
.st-cover-meta .i { width: 13px; height: 13px; }
.st-shelf-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
@media (max-width: 640px) {
  .st-shelf-row { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; }
  .st-shelf-row .st-cover { flex: 0 0 72%; scroll-snap-align: start; }
}

/* the chat */
.st-chat { overflow-y: auto; overscroll-behavior: contain; padding: 8px 16px 24px; }
.st-chat > * { width: min(720px, 100%); margin-left: auto; margin-right: auto; }
.st-chat > * + * { margin-top: 12px; }
.st-bottom { height: 1px; }
.st-intro { display: grid; gap: 8px; justify-items: center; text-align: center; padding: 10px 0 14px; border-bottom: 2px dashed var(--line-hi); }
.st-intro h2 { font: 900 clamp(22px, 3.4vw, 28px)/1.15 var(--display); margin: 0; }
.st-intro p { margin: 0; max-width: 46ch; }
.st-intro-cast { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.st-intro-c { display: grid; gap: 4px; justify-items: center; font-size: 13px; }
.st-you { display: inline-flex; gap: 6px; align-items: center; font-weight: 800; }
.st-avatar {
  flex: none; display: inline-grid; place-items: center; border-radius: 50%; line-height: 1;
  background: rgb(var(--c) / 0.22); box-shadow: inset 0 0 0 2px rgb(var(--c) / 0.75);
}
.st-line { display: flex; gap: 10px; align-items: flex-end; }
.st-line.mine { flex-direction: row-reverse; }
.st-bubble {
  position: relative; min-width: 0; max-width: min(78%, 560px); padding: 9px 14px 11px; border-radius: 18px 18px 18px 6px;
  background: var(--panel-solid); border: 1px solid rgb(var(--c) / 0.4);
}
.st-line.mine .st-bubble { border-radius: 18px 18px 6px 18px; background: rgb(var(--c) / 0.16); border-color: rgb(var(--c) / 0.55); }
.st-line.now .st-bubble { animation: st-pop 0.32s cubic-bezier(.3, 1.4, .5, 1) both; box-shadow: 0 10px 26px -18px rgb(var(--c)); }
.st-line.now .st-avatar { animation: st-hop 0.42s ease-out both; }
@keyframes st-pop { from { opacity: 0; transform: translateY(12px) scale(0.94); } }
@keyframes st-hop { 40% { transform: translateY(-6px); } }
/* A line that was a choice: it arrives from where the options were, and glows once. */
.st-line.chosen .st-bubble { animation: st-branch 0.55s cubic-bezier(.3, 1.3, .5, 1) both; }
@keyframes st-branch { from { opacity: 0; transform: translateY(40px) scale(0.9); box-shadow: 0 0 0 6px rgb(var(--c) / 0.5); } 70% { box-shadow: 0 0 0 10px rgb(var(--c) / 0); } }
.st-who { font-size: 12.5px; color: rgb(var(--c)); }
.st-who b { font-family: var(--display); font-weight: 900; }
.st-text { margin: 2px 0 0; font-size: 19px; line-height: 1.45; font-weight: 600; overflow-wrap: anywhere; }
.st-w { cursor: pointer; border-radius: 4px; transition: background 0.15s; }
.st-w:hover { background: rgb(var(--violet-rgb) / 0.16); }
.st-w.picked { background: rgb(var(--violet-rgb) / 0.3); box-shadow: 0 2px 0 var(--brand-2); }
.st-gloss { margin: 4px 0 0; font-size: 14px; line-height: 1.35; }
.st-say { flex: none; display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; border: 0; cursor: pointer; background: var(--panel-hi); color: var(--muted); }
.st-say:hover { color: var(--brand-2); }
.st-say .i { width: 17px; height: 17px; }
.st-sheet { position: fixed; left: 50%; bottom: 112px; transform: translateX(-50%); width: min(600px, calc(100% - 32px)); z-index: 3; }
.st-qdone { display: flex; gap: 6px; align-items: center; justify-content: center; font-size: 13.5px; color: var(--muted); }
.st-qdone.ok .i { color: var(--ok); } .st-qdone.bad .i { color: var(--bad); }

/* a question, inside the chat */
.st-q { display: grid; gap: 12px; padding: 16px; border-radius: 18px; animation: st-pop 0.3s ease-out both; }
.st-q-head { display: flex; gap: 8px; align-items: center; font: 900 18px/1.2 var(--display); color: var(--brand-2); }
.st-q-cue { margin: 0; font-size: 16px; color: var(--ink-2); }
.st-quote { display: flex; gap: 8px; align-items: center; margin: 0; padding: 10px 14px; border: 0; border-radius: 14px; background: var(--well); color: var(--ink); font: 700 19px/1.4 var(--font); text-align: left; cursor: pointer; }
p.st-quote { cursor: default; }
.st-q-go { justify-content: flex-end; }
.st-order { min-height: 56px; }

/* the footer: continue, or the choice to make */
.st-foot-hint { display: inline-flex; gap: 6px; align-items: center; margin-right: auto; font-weight: 800; color: var(--brand); }
.st-foot-choice .dr-foot-in { display: grid; justify-content: stretch; gap: 10px; }
.st-choose-h { display: flex; gap: 8px; align-items: center; font: 900 18px/1.2 var(--display); }
.st-choices { display: grid; gap: 10px; }
.st-choice { display: flex; gap: 8px; align-items: center; animation: st-pop 0.3s ease-out calc(var(--i) * 0.07s) both; transition: opacity 0.3s, transform 0.35s; }
.st-choice-go {
  flex: 1; display: flex; gap: 12px; align-items: center; padding: 13px 16px; border-radius: 16px; cursor: pointer; text-align: left; font: inherit; color: var(--ink);
  background: var(--panel-solid); border: 2px solid var(--line-hi); box-shadow: 0 4px 0 var(--line-hi); transition: transform 0.1s, border-color 0.15s, background 0.15s;
}
.st-choice-go:hover:not(:disabled) { border-color: var(--brand); background: rgb(var(--brand-rgb) / 0.08); }
.st-choice-go:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 var(--line-hi); }
.st-choice-go:disabled { cursor: default; }
.st-choice-n { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: rgb(var(--brand-rgb) / 0.14); color: var(--brand); }
.st-choice-n .i { width: 16px; height: 16px; }
.st-choice-t { display: grid; gap: 2px; font-size: 17px; font-weight: 700; line-height: 1.35; }
.st-choice-t small { font-size: 13px; font-weight: 500; }
/* The branch being taken: the chosen one lights up and lifts, the others fall away. */
.st-choice.taken .st-choice-go { border-color: var(--brand); background: rgb(var(--brand-rgb) / 0.16); box-shadow: 0 0 0 6px rgb(var(--brand-rgb) / 0.18); }
.st-choice.taken { transform: translateY(-6px) scale(1.02); }
.st-choice.gone { opacity: 0; transform: translateX(-24px) scale(0.96); }

/* an ending */
.st-end { display: grid; gap: 12px; justify-items: center; align-content: start; text-align: center; overflow-y: auto; padding: 12px 16px 32px; width: min(620px, 100%); margin: 0 auto; }
.st-done .st-end { grid-row: 2 / -1; }
.st-flavour { display: inline-flex; gap: 6px; align-items: center; padding: 5px 12px; border-radius: 99px; font-weight: 900; font-size: 13px; letter-spacing: 0.04em; text-transform: uppercase; }
.st-flavour.good { background: rgb(16 185 129 / 0.15); color: var(--ok); }
.st-flavour.neutral { background: rgb(var(--violet-rgb) / 0.15); color: var(--brand-2); }
.st-flavour.funny { background: rgb(245 158 11 / 0.16); color: var(--warn); }
.st-end-t { margin: 0; font: 900 clamp(28px, 5vw, 38px)/1.1 var(--display); animation: st-pop 0.5s cubic-bezier(.3, 1.4, .5, 1) 0.1s both; }
.st-end-tr { margin: -6px 0 0; font-weight: 700; }
.st-end-text { display: grid; gap: 4px; margin: 0; font-size: 17px; line-height: 1.45; max-width: 44ch; }
.st-end-text small { font-size: 14px; }
.st-end-new { font-weight: 800; color: var(--muted); }
.st-end-new.fresh { color: var(--warn); animation: dr-yay 0.5s cubic-bezier(.3, 1.6, .5, 1) 0.3s both; }
.st-endings { display: grid; gap: 8px; justify-items: center; width: 100%; }
.st-slots { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.st-slot { display: inline-flex; gap: 5px; align-items: center; padding: 6px 12px; border-radius: 12px; font-size: 14px; font-weight: 700; border: 2px dashed var(--line-hi); color: var(--muted); }
.st-slot .i { width: 15px; height: 15px; }
.st-slot.got { border-style: solid; color: var(--ink); background: var(--panel-solid); }
.st-slot.got.good .i { color: var(--ok); } .st-slot.got.neutral .i { color: var(--brand-2); } .st-slot.got.funny .i { color: var(--warn); }
.st-slot.now { border-color: var(--brand); box-shadow: 0 0 0 4px rgb(var(--brand-rgb) / 0.18); animation: dr-yay 0.5s cubic-bezier(.3, 1.6, .5, 1) 0.45s both; }
.st-all { color: var(--warn); font-family: var(--display); }
.st-stats { grid-template-columns: repeat(2, 1fr); max-width: 420px; }

/* together, in a room */
.st-room-pick .st-peek { display: grid; gap: 10px; justify-items: center; text-align: center; border: 2px solid rgb(var(--g) / 0.5); animation: st-pop 0.3s ease-out both; }
.st-room-pick .st-peek h3 { font: 900 24px/1.15 var(--display); margin: 0; }
.st-room-pick .st-peek p { margin: 0; max-width: 50ch; }
.st-langs { justify-self: center; }
.st-room { display: grid; gap: 10px; }
.st-room-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: space-between; }
.st-cast { display: flex; gap: 8px; flex-wrap: wrap; }
.st-cast-c { display: inline-flex; gap: 6px; align-items: center; padding: 4px 10px 4px 4px; border-radius: 99px; font-size: 13px; background: var(--panel); border: 1px solid rgb(var(--c, 148 163 184) / 0.45); }
.st-cast-c.me { background: rgb(var(--c) / 0.16); box-shadow: 0 0 0 2px rgb(var(--c) / 0.5); }
.st-cast-c.muted { padding-left: 10px; }
.st-room-tools { display: flex; gap: 6px; }
.st-room-chat { max-height: min(58vh, 560px); padding: 8px 4px 16px; border-radius: 16px; background: var(--well-soft); }
.st-room-foot { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 12px 14px; border-radius: 16px; background: var(--panel); border: 2px solid var(--line); }
.st-room-foot.mine { border-color: var(--brand); background: rgb(var(--brand-rgb) / 0.08); animation: st-pop 0.3s ease-out both; }
.st-room-foot.right { border-color: transparent; background: rgb(16 185 129 / 0.14); }
.st-room-foot.wrong { border-color: transparent; background: rgb(244 63 94 / 0.12); }
.st-room-foot.st-foot-choice { display: grid; justify-content: stretch; }
.st-verdict { display: inline-flex; gap: 6px; align-items: center; font-weight: 800; }
.st-verdict.ok { color: var(--ok); } .st-verdict.bad { color: var(--bad); }
.st-room-end { width: 100%; }
@media (max-width: 640px) {
  .st-text { font-size: 17px; }
  .st-bubble { max-width: 82%; }
  .st-line .st-say { width: 30px; height: 30px; }
  .st-sheet { bottom: 96px; }
  .st-top { padding: 10px 12px 4px; gap: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  .st-screen, .st-line .st-bubble, .st-line .st-avatar, .st-q, .st-choice, .st-end-t, .st-slot.now, .st-end-new.fresh, .st-face, .st-room-foot.mine, .st-peek { animation: none !important; }
  .st-choice { transition: none; }
}
