/* G10 · Мільйон слів — YAPOO Arcade */
:root {
  --bg: #F3F4F8;
  --card: #FFFFFF;
  --card-2: #ECEEF5;
  --text: #1B1E2B;
  --muted: #565C72;
  --line: #D9DCE8;
  --accent: #D9691F;
  --accent-strong: #B9500C;
  --accent-soft: #FCE9DA;
  --teal: #0F7E76;
  --teal-strong: #0B655E;
  --teal-soft: #D8F0ED;
  --danger: #C62E2E;
  --danger-soft: #FBE1E1;
  --good: #1E8A4C;
  --good-soft: #DCF3E5;
  --on-accent: #FFFFFF;
  --glow: rgba(217, 105, 31, .14);
  --shadow: 0 6px 24px rgba(27, 30, 43, .10);
  --font-head: "Unbounded", system-ui, sans-serif;
  --font-body: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
}
:root[data-theme="dark"] {
  --bg: #11131D;
  --card: #1B1E2C;
  --card-2: #252940;
  --text: #EEF0F8;
  --muted: #A8AEC4;
  --line: #333852;
  --accent: #F39A55;
  --accent-strong: #F39A55;
  --accent-soft: #3A2A1D;
  --teal: #45C3B5;
  --teal-strong: #45C3B5;
  --teal-soft: #17353A;
  --danger: #FF7B7B;
  --danger-soft: #4A1E22;
  --good: #5FD08A;
  --good-soft: #173B27;
  --on-accent: #1A1208;
  --glow: rgba(243, 154, 85, .16);
  --shadow: 0 6px 24px rgba(0, 0, 0, .45);
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] {
    --bg: #11131D; --card: #1B1E2C; --card-2: #252940; --text: #EEF0F8; --muted: #A8AEC4;
    --line: #333852; --accent: #F39A55; --accent-strong: #F39A55; --accent-soft: #3A2A1D;
    --teal: #45C3B5; --teal-strong: #45C3B5; --teal-soft: #17353A; --danger: #FF7B7B; --danger-soft: #4A1E22;
    --good: #5FD08A; --good-soft: #173B27; --on-accent: #1A1208; --glow: rgba(243, 154, 85, .16);
    --shadow: 0 6px 24px rgba(0, 0, 0, .45);
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; color: var(--text); overscroll-behavior: none; }
body {
  font-family: var(--font-body); font-size: 16px; line-height: 1.4; -webkit-text-size-adjust: 100%;
  background: radial-gradient(1100px 520px at 72% -12%, var(--glow), transparent 70%), var(--bg);
  background-color: var(--bg);
  overflow: hidden;
}
button { font: inherit; color: inherit; cursor: pointer; touch-action: manipulation; }
button:disabled { cursor: default; }

#app {
  position: fixed; inset: 0;
  display: flex; flex-direction: column;
  max-width: 1440px; margin: 0 auto;
  padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right);
}
.topbar { flex: none; display: flex; align-items: center; gap: 8px; min-height: 52px; padding: 6px 12px; }
.top-loop { width: 36px; height: 36px; image-rendering: pixelated; flex: none; }
.brand { font-family: var(--font-head); font-weight: 700; font-size: 15px; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-g { color: var(--accent); }
@media (max-width: 479px) { .brand-t { display: none; } .view-seg button { padding: 0 8px; font-size: 13px; } }
.topbar-actions { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.icon-btn {
  width: 44px; height: 44px; min-width: 44px; border-radius: 14px; border: 1px solid var(--line);
  background: var(--card); font-size: 18px; font-weight: 800; display: grid; place-items: center; padding: 0;
}
.icon-btn:active { transform: scale(.94); }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; }

.screen { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 4px 16px calc(24px + env(safe-area-inset-bottom)); -webkit-overflow-scrolling: touch; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 16px; margin-bottom: 14px; box-shadow: var(--shadow); }
h1, h2, h3 { font-family: var(--font-head); margin: 0; letter-spacing: -.02em; }
h1 { font-size: clamp(26px, 7vw, 42px); line-height: 1.1; }
h2 { font-size: 22px; margin: 6px 0 14px; }
.lead { margin: 8px 0 0; color: var(--muted); font-size: 16px; }
.hint { color: var(--muted); font-size: 14px; margin: 10px 0 0; }
.hint.nomt { margin-top: 0; }
.center { text-align: center; }
.small-note { font-size: 13px; margin-top: 6px; }
.field-label { font-weight: 800; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 14px 0 8px; }
.field-label:first-child { margin-top: 0; }
.kbd { display: inline-block; padding: 0 7px; border-radius: 7px; background: var(--card-2); font-family: var(--font-mono); font-weight: 800; }

.loop-canvas { width: 88px; height: 88px; image-rendering: pixelated; flex: none; animation: bob 1.6s ease-in-out infinite; }
.loop-canvas.big { width: 120px; height: 120px; }
.loop-canvas.call { width: 72px; height: 72px; animation-duration: 1.2s; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }

.center-screen { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; max-width: 560px; margin: 0 auto; width: 100%; }

/* ---- Головна ---- */
.home-hero { display: flex; gap: 14px; align-items: center; margin: 6px 0 18px; }
.mode-grid { display: grid; gap: 12px; grid-template-columns: 1fr; margin-bottom: 14px; }
.mode-card {
  display: grid; grid-template-columns: 56px 1fr; grid-template-rows: auto auto; column-gap: 12px; row-gap: 2px;
  text-align: left; padding: 16px; border-radius: 20px; border: 2px solid var(--line); background: var(--card);
  box-shadow: var(--shadow); transition: transform .12s, border-color .12s, background .12s;
}
.mode-card[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.mode-card:hover { border-color: var(--accent); }
.mode-card:active { transform: scale(.98); }
.mode-ico { grid-row: 1 / 3; font-size: 38px; display: grid; place-items: center; }
.mode-title { font-family: var(--font-head); font-weight: 700; font-size: 17px; align-self: end; }
.mode-desc { color: var(--muted); font-size: 14px; }
.chips { display: flex; gap: 8px; }
.chips.wrap { flex-wrap: wrap; }
.chips button { min-height: 48px; border-radius: 14px; border: 2px solid var(--line); background: var(--card); font-weight: 800; font-size: 15px; padding: 6px 14px; }
.chips button small { color: var(--muted); font-family: var(--font-mono); font-weight: 600; margin-left: 4px; }
.chips button[aria-pressed="true"] { border-color: var(--teal); background: var(--teal-soft); }
.two-tabs { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.two-tabs code { font-family: var(--font-mono); font-size: 13px; background: var(--card-2); padding: 6px 10px; border-radius: 10px; word-break: break-all; }
.rules-inline summary { font-weight: 800; cursor: pointer; font-size: 17px; min-height: 28px; }
.rules-body { font-size: 15.5px; }
.rules-body ol { margin: 10px 0 0; padding-left: 22px; }
.rules-body li { margin-bottom: 8px; }
.rules-body b { color: var(--accent-strong); }

.btn-primary, .btn-cta {
  display: block; width: 100%; min-height: 58px; border: 0; border-radius: 18px; background: var(--accent-strong); color: var(--on-accent);
  font-family: var(--font-head); font-weight: 700; font-size: 18px; padding: 12px 18px; text-align: center; text-decoration: none;
  box-shadow: 0 8px 20px rgba(185, 80, 12, .28);
}
.btn-primary:active, .btn-cta:active { transform: translateY(1px) scale(.99); }
.btn-primary:disabled { opacity: .6; }
.btn-primary.sm, .btn-ghost.sm { width: auto; min-height: 44px; font-size: 16px; padding: 8px 20px; }
.btn-ghost { display: block; width: 100%; min-height: 50px; border-radius: 16px; border: 2px solid var(--line); background: var(--card); font-weight: 800; font-size: 16px; padding: 10px 14px; }
.btn-ghost.sm { display: inline-block; }
#btnStart { margin-bottom: 8px; }

/* ---- Перемикач вчитель/учень ---- */
.seg { display: flex; gap: 4px; background: var(--card-2); padding: 4px; border-radius: 14px; }
.seg button { min-height: 36px; border: 0; border-radius: 10px; background: transparent; font-weight: 800; font-size: 14px; padding: 0 12px; white-space: nowrap; }
.seg button[aria-pressed="true"] { background: var(--accent-strong); color: var(--on-accent); box-shadow: 0 2px 8px rgba(0,0,0,.18); }

/* ---- Гра ---- */
.screen.game { padding: 0 16px calc(10px + env(safe-area-inset-bottom)); }
.gamegrid { display: block; }
.maincol { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.statusrow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lifelines { display: flex; gap: 8px; flex: 1 1 auto; }
.life {
  display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 6px 14px; border-radius: 999px;
  border: 2px solid var(--teal); background: var(--card); font-weight: 800; font-size: 15px; flex: 1 1 0; position: relative; white-space: nowrap;
}
.life .li-ico { font-size: 20px; line-height: 1; font-family: var(--font-head); font-weight: 800; color: var(--teal-strong); }
.life:not(:disabled):hover { background: var(--teal-soft); }
.life:not(:disabled):active { transform: scale(.97); }
.life:disabled:not(.used) { opacity: .55; }
.ro .life:disabled:not(.used) { opacity: 1; }
.life.used { opacity: .45; border-color: var(--line); }
.life.used .li-lbl { text-decoration: line-through; }
.life.used::after { content: "✕"; color: var(--danger); font-weight: 800; margin-left: 2px; }
.btn-walk {
  min-height: 48px; border-radius: 999px; border: 2px solid var(--accent); background: transparent; color: var(--accent-strong);
  font-weight: 800; font-size: 15px; padding: 0 16px; margin-left: auto; white-space: nowrap;
}
.btn-walk b { font-family: var(--font-mono); }
.btn-walk:hover { background: var(--accent-soft); }

.ladder-strip {
  display: flex; align-items: center; gap: 10px; flex: 1 1 100%; min-height: 44px; padding: 6px 12px; border-radius: 14px;
  border: 1px solid var(--line); background: var(--card); font-weight: 800;
}
.ls-dots { display: flex; gap: 3px; flex: 1; align-items: center; }
.ls-dots i { flex: 1; height: 10px; border-radius: 4px; background: var(--card-2); }
.ls-dots i.done { background: var(--teal); }
.ls-dots i.safe { box-shadow: 0 0 0 2px var(--teal) inset; }
.ls-dots i.cur { background: var(--accent-strong); }
.ls-text { font-family: var(--font-mono); font-size: 14px; white-space: nowrap; }
.ls-text::after { content: "  ▾"; color: var(--muted); }

.qcard {
  background: var(--card); border: 2px solid var(--line); border-radius: 22px; padding: 14px 18px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 8px; min-height: 0;
}
.qcard.enter { animation: qin .35s ease-out; }
@keyframes qin { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.qmeta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13px; font-weight: 800; color: var(--muted); }
.qno { font-family: var(--font-head); color: var(--accent-strong); }
.qstake { font-family: var(--font-mono); }
.pick-note { font-size: 12px; font-weight: 600; opacity: .85; }
.tag { background: var(--card-2); border-radius: 999px; padding: 2px 10px; font-size: 12px; }
.qtext { font-family: var(--font-body); font-weight: 800; font-size: clamp(22px, 5.4vw, 30px); line-height: 1.25; letter-spacing: -.01em; margin: 0; }
.callout { display: flex; gap: 10px; align-items: center; }
.callout .loop-canvas { width: 56px; height: 56px; }
.callout-bubble { background: var(--teal-soft); border: 2px solid var(--teal); border-radius: 14px 14px 14px 4px; padding: 8px 12px; font-weight: 700; font-size: 15px; }
.callout-bubble b { color: var(--teal-strong); }

.opts { display: grid; grid-template-columns: 1fr; gap: 10px; }
.opt {
  position: relative; display: flex; align-items: center; gap: 12px; text-align: left; min-height: 58px; padding: 10px 14px; overflow: hidden;
  border: 3px solid var(--line); background: var(--card); border-radius: 18px; font-weight: 800; font-size: 17px; line-height: 1.25;
  transition: border-color .12s, background .12s, transform .12s, opacity .2s;
}
.opt .ltr {
  position: relative; flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--card-2); display: grid; place-items: center;
  font-family: var(--font-head); font-weight: 800; font-size: 15px;
}
.opt .txt { position: relative; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.opt:not(:disabled):hover { border-color: var(--accent); }
.opt:not(:disabled):active { transform: scale(.985); }
.opt:disabled { color: inherit; }
.opt.selected { border-color: var(--accent); background: var(--accent-soft); }
.opt.selected .ltr, .opt.locked .ltr { background: var(--accent-strong); color: var(--on-accent); }
.opt.locked { border-color: var(--accent); background: var(--accent-soft); animation: lockpulse .76s ease-in-out infinite; }
@keyframes lockpulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 0%, transparent); } 40% { box-shadow: 0 0 0 8px color-mix(in srgb, var(--accent) 38%, transparent); } }
.opt.correct { border-color: var(--good); background: var(--good-soft); animation: pop .5s cubic-bezier(.2, 1.6, .4, 1); }
.opt.correct .ltr { background: var(--good); color: var(--on-accent); }
.opt.wrong { border-color: var(--danger); background: var(--danger-soft); animation: shake .45s; }
.opt.wrong .ltr { background: var(--danger); color: var(--on-accent); }
.opt.dim { opacity: .5; }
.opt.removed { display: none; }
.opt.tcorrect { outline: 3px dashed var(--teal); outline-offset: -3px; }
.tbadge { position: relative; flex: none; background: var(--teal); color: var(--on-accent); width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 14px; }
:root[data-theme="dark"] .tbadge { color: #08211E; }
@keyframes pop { 0% { transform: scale(.94); } 100% { transform: scale(1); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-8px); } 40% { transform: translateX(8px); } 60% { transform: translateX(-6px); } 80% { transform: translateX(6px); } }
.pollbar { position: absolute; left: 0; top: 0; bottom: 0; width: var(--p, 0); background: color-mix(in srgb, var(--teal) 28%, transparent); animation: grow .8s ease-out; }
@keyframes grow { from { width: 0; } }
.pct { position: relative; order: 3; flex: none; font-family: var(--font-mono); font-weight: 800; font-size: 18px; color: var(--teal-strong); }

/* ---- Нижня панель ---- */
.dock { display: flex; flex-direction: column; gap: 6px; }
.dock-hint { margin: 0; text-align: center; color: var(--muted); font-weight: 700; font-size: 15px; min-height: 24px; }
.confirm { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 6px 12px; border-radius: 18px; background: var(--card); border: 2px solid var(--accent); }
.confirm.ro, .confirm.suspense { justify-content: center; }
.cq { font-family: var(--font-head); font-weight: 700; font-size: 18px; flex: 1 1 auto; }
.cq b { color: var(--accent-strong); font-size: 1.2em; }
.confirm.ro .cq, .confirm.suspense .cq { text-align: center; }
.dots i { font-style: normal; animation: dot 1.2s infinite; opacity: .2; }
.dots i:nth-child(2) { animation-delay: .2s; } .dots i:nth-child(3) { animation-delay: .4s; }
@keyframes dot { 50% { opacity: 1; } }
.reveal { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 12px 16px; border-radius: 18px; border: 3px solid var(--good); background: var(--good-soft); }
.reveal.bad { border-color: var(--danger); background: var(--danger-soft); }
.rv-main { flex: 1 1 280px; min-width: 0; }
.rv-head { font-family: var(--font-head); font-weight: 700; font-size: 17px; line-height: 1.25; }
.explain { margin: 4px 0 0; font-size: 15px; }
.reveal .next { width: auto; min-height: 52px; font-size: 16px; white-space: nowrap; padding: 8px 22px; }

.tbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 8px 12px; border-radius: 16px; background: var(--teal-soft); border: 2px dashed var(--teal); }
.tinfo { flex: 1 1 260px; min-width: 0; }
.tans { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.tk { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.tletter { font-family: var(--font-head); font-size: 22px; color: var(--teal-strong); }
.tt { font-weight: 800; }
.texp { margin: 2px 0 0; font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tbtns { display: flex; flex-direction: row; gap: 8px; align-items: center; }
.btn-good, .btn-bad { min-height: 44px; border-radius: 12px; font-weight: 800; font-size: 15px; padding: 0 16px; border: 2px solid; white-space: nowrap; }
.btn-good { background: var(--good); border-color: var(--good); color: var(--on-accent); }
:root[data-theme="dark"] .btn-good { color: #08211E; }
.btn-bad { background: transparent; border-color: var(--danger); color: var(--danger); }
.pollin { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 4px 10px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); }
.pk { font-weight: 800; font-size: 13px; }
.pv { display: flex; align-items: center; gap: 4px; }
.pv.gone { opacity: .3; }
.pv b { font-family: var(--font-head); width: 18px; }
.pv span { font-family: var(--font-mono); font-weight: 800; min-width: 26px; text-align: center; }
.pv button { width: 34px; height: 34px; border-radius: 10px; border: 2px solid var(--line); background: var(--card-2); font-weight: 800; font-size: 18px; line-height: 1; }
.btn-mini { min-height: 38px; border-radius: 10px; border: 2px solid var(--teal); background: transparent; font-weight: 800; padding: 0 12px; margin-left: auto; }

/* ---- Драбина ---- */
.ladder { display: none; }
.rungs { display: grid; gap: 3px; }
.rung {
  display: grid; grid-template-columns: 30px 1fr auto; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 10px;
  font-family: var(--font-mono); font-weight: 800; font-size: 15px; color: var(--muted);
}
.rung .rtag { font-family: var(--font-body); font-size: 10px; text-transform: uppercase; letter-spacing: .04em; font-weight: 800; }
.rung.safe { color: var(--teal-strong); background: var(--teal-soft); }
.rung.done { opacity: .5; }
.rung.done .rn::after { content: "✓"; margin-left: 2px; }
.rung.cur { background: var(--accent-strong); color: var(--on-accent); opacity: 1; }
.rung.cur .rn::after { content: ""; }
#ladderDlgBody .rung { padding: 7px 12px; }

/* ---- Підсумок ---- */
.result-hero { text-align: center; margin: 4px 0 14px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.rh-title { font-family: var(--font-head); font-weight: 800; font-size: clamp(22px, 6vw, 36px); line-height: 1.15; }
.rh-amount { font-family: var(--font-head); font-weight: 800; font-size: clamp(34px, 10vw, 64px); color: var(--accent-strong); line-height: 1.1; }
.rh-sub { color: var(--muted); font-weight: 600; max-width: 480px; }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 14px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 12px 14px; box-shadow: var(--shadow); }
.stat .sv { font-family: var(--font-mono); font-weight: 800; font-size: 28px; line-height: 1.1; }
.stat .sv small { font-size: 16px; color: var(--muted); }
.stat .sv.word { font-family: var(--font-head); font-size: 20px; }
.stat.wide { grid-column: span 2; }
.stat .sl { color: var(--muted); font-size: 13px; font-weight: 700; margin-top: 2px; }
.result-actions { display: grid; gap: 10px; margin-bottom: 14px; }
.review { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.review li { border: 2px solid var(--line); border-left-width: 6px; border-radius: 14px; padding: 10px 12px; background: var(--card); }
.review li.ok { border-left-color: var(--good); }
.review li.bad { border-left-color: var(--danger); }
.rv-top { display: flex; gap: 8px; align-items: baseline; }
.rv-n { font-family: var(--font-mono); font-weight: 800; color: var(--muted); }
.rv-mark { font-weight: 800; }
.review .ok .rv-mark { color: var(--good); }
.review .bad .rv-mark { color: var(--danger); }
.rv-q { font-weight: 800; }
.rv-ans { font-size: 14.5px; margin-top: 4px; }
.rv-exp { font-size: 14px; color: var(--muted); margin-top: 4px; }
.cta { text-align: center; background: linear-gradient(135deg, var(--accent-soft), var(--teal-soft)); }
.cta-text { font-family: var(--font-head); font-weight: 700; font-size: 17px; margin-bottom: 12px; line-height: 1.3; }
.btn-cta { background: var(--teal-strong); box-shadow: 0 8px 20px rgba(11, 101, 94, .28); }
:root[data-theme="dark"] .btn-cta { background: var(--teal); color: #08211E; }

/* ---- Діалоги ---- */
dialog { border: 0; border-radius: 22px; background: var(--card); color: var(--text); padding: 16px; width: min(520px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); box-shadow: 0 20px 60px rgba(0,0,0,.4); }
dialog::backdrop { background: rgba(10, 12, 20, .6); }
.dlg-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.dlg-actions { display: grid; gap: 10px; margin-top: 16px; grid-template-columns: 1fr 1fr; }
#fx { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 50; }

.ro .opts, .ro .tbar { pointer-events: none; }

/* ---- Планшет / ноутбук ---- */
@media (min-width: 720px) {
  .mode-grid { grid-template-columns: repeat(2, 1fr); }
  .stats { grid-template-columns: repeat(4, 1fr); }
  .stat.wide { grid-column: span 1; }
  .screen:not(.game) { padding-left: 28px; padding-right: 28px; }
  #screen-home, #screen-result { max-width: 860px; width: 100%; margin: 0 auto; }
  .opts { grid-template-columns: 1fr 1fr; }
  .opt.removed { display: flex; visibility: hidden; }
  .opt { min-height: 74px; font-size: 20px; }
  .opt .ltr { width: 40px; height: 40px; font-size: 17px; }
  .life { font-size: 16px; }
  .qtext { font-size: clamp(26px, 3.4vw, 44px); }
  .rv-head { font-size: 19px; }
  .explain { font-size: 16px; }
}

/* ---- Широкий екран / стрім 16:9: усе без скролу, драбина збоку ---- */
@media (min-width: 900px) and (min-height: 560px) {
  .screen.game { overflow: hidden; padding-bottom: 12px; }
  .gamegrid { height: 100%; display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 16px; }
  .maincol { min-height: 0; }
  .ladder { display: block; min-height: 0; background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 8px; box-shadow: var(--shadow); }
  .ladder .rungs { height: 100%; grid-template-rows: repeat(15, minmax(0, 1fr)); }
  .ladder .rung { padding: 0 10px; font-size: clamp(12px, 2.1vh, 17px); }
  .ladder-strip { display: none; }
  .lifelines { flex: 0 1 auto; }
  .life { flex: 0 0 auto; }
  .qcard { flex: 1 1 auto; justify-content: center; overflow: auto; padding: 12px 22px; }
  .qtext { font-size: clamp(34px, 2.9vw, 46px); }
  .opts { flex: none; }
  .opt { min-height: clamp(52px, 8.8vh, 90px); font-size: clamp(19px, 1.9vw, 27px); }
  .cq { font-size: clamp(18px, 1.8vw, 26px); }
  .rv-head { font-size: clamp(17px, 1.7vw, 24px); }
  .explain { font-size: clamp(14px, 1.3vw, 19px); }
  .callout .loop-canvas { width: 52px; height: 52px; }
  .callout-bubble { font-size: clamp(15px, 1.4vw, 20px); }
}
@media (max-width: 899px), (max-height: 559px) {
  .life .long { display: none; }
}
@media (max-width: 899px) {
  .life { padding: 6px 8px; font-size: 14px; }
  .life .li-ico { font-size: 18px; }
  .btn-walk { flex: 1 1 100%; margin-left: 0; }
}
@media (max-width: 479px) {
  .dlg-actions { grid-template-columns: 1fr; }
  .reveal .next { width: 100%; }
  .confirm .btn-primary.sm, .confirm .btn-ghost.sm { flex: 1 1 0; padding: 8px 10px; }
  .tbtns { width: 100%; }
  .tbtns button { flex: 1; }
}
@media (prefers-reduced-motion: reduce) { * { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* учень на своєму пристрої (кімната): може обирати й підтверджувати */
.ro.sp .opts { pointer-events: auto; }
.opt.pending { outline: 3px dashed var(--accent, #D9691F); outline-offset: 2px; }
#btnCopyStudent { min-height: 44px; }
