/* G02 · Вимов без акценту — YAPOO Arcade (базові токени й компоненти — як у G17) */
: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;
  --good: #1E8A4C;
  --on-accent: #FFFFFF;
  --shadow: 0 6px 24px rgba(27, 30, 43, .10);
  --ring-track: #E1E4EF;
  --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;
  --good: #5FD08A;
  --on-accent: #1A1208;
  --shadow: 0 6px 24px rgba(0, 0, 0, .45);
  --ring-track: #2A2F47;
}
@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; --good: #5FD08A;
    --on-accent: #1A1208; --shadow: 0 6px 24px rgba(0, 0, 0, .45); --ring-track: #2A2F47;
  }
}

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

/* Каркас: фіксований блок рівно у видимій області (visualViewport виставляє --vh / --vtop з JS) */
#app {
  position: fixed; left: 0; right: 0;
  top: var(--vtop, 0px);
  height: var(--vh, 100dvh);
  display: flex; flex-direction: column;
  max-width: 1280px; 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;
}
.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; } }
.topbar-actions { margin-left: auto; display: flex; gap: 6px; }
.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); }
.icon-btn:focus-visible, button:focus-visible, input:focus-visible, summary:focus-visible, a: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, 40px); 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; }
.center { text-align: center; }
.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; }

/* Головна */
.home-hero { display: flex; gap: 14px; align-items: center; margin: 6px 0 18px; }
.loop-canvas { width: 88px; height: 88px; image-rendering: pixelated; flex: none; animation: bob 1.6s ease-in-out infinite; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
.mode-grid { display: grid; gap: 12px; grid-template-columns: 1fr; margin-bottom: 16px; }
.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;
}
.mode-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.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; }
.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); }
:root[data-theme="dark"] .rules-body b { color: var(--accent); }
.kbd { display: inline-block; padding: 0 7px; border-radius: 7px; background: var(--card-2); font-family: var(--font-mono); font-weight: 800; }

/* Налаштування */
.seg { display: flex; gap: 6px; background: var(--card-2); padding: 5px; border-radius: 16px; }
.seg button { flex: 1; min-height: 46px; border: 0; border-radius: 12px; background: transparent; font-weight: 800; font-size: 15px; padding: 6px 8px; }
.seg button[aria-pressed="true"] { background: var(--accent-strong); color: var(--on-accent); box-shadow: 0 2px 8px rgba(0,0,0,.18); }
.names { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.names:has(> label:only-child) { grid-template-columns: 1fr; }
.names label { font-size: 13px; font-weight: 700; color: var(--muted); display: grid; gap: 4px; }
.names input, #word {
  height: 48px; border-radius: 14px; border: 2px solid var(--line); background: var(--bg); padding: 0 14px; font-size: 17px; font-weight: 700; width: 100%; min-width: 0;
}
.names input:focus, #word:focus { border-color: var(--teal); outline: none; }
.topic-chips { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin-top: 12px; }
.topic-chip { min-height: 56px; border-radius: 16px; border: 2px solid var(--line); background: var(--card); text-align: left; padding: 8px 12px; display: grid; grid-template-columns: 34px 1fr; align-items: center; column-gap: 8px; font-weight: 800; }
.topic-chip small { grid-column: 2; color: var(--muted); font-weight: 600; font-size: 12.5px; margin-top: -2px; }
.topic-chip .te { grid-row: 1 / 3; font-size: 26px; }
.topic-chip[aria-pressed="true"] { border-color: var(--teal); background: var(--teal-soft); }
.check { display: flex; gap: 10px; align-items: center; margin-top: 12px; font-weight: 600; min-height: 44px; }
.check input { width: 22px; height: 22px; accent-color: var(--teal); }
.stepper { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.step-btn { width: 52px; height: 52px; border-radius: 16px; border: 2px solid var(--line); background: var(--card); font-size: 28px; font-weight: 800; line-height: 1; }
.step-val { font-family: var(--font-mono); font-weight: 800; font-size: 30px; min-width: 76px; text-align: center; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chips button { min-width: 48px; min-height: 48px; border-radius: 14px; border: 2px solid var(--line); background: var(--card); font-family: var(--font-mono); font-weight: 800; font-size: 17px; }
.chips button[aria-pressed="true"] { border-color: var(--teal); background: var(--teal-soft); color: var(--text); }
#timerChips { margin-left: auto; }

.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-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; }


:root { --warn: #D99A0B; --rec: #D92D3F; }
:root[data-theme="dark"] { --warn: #F6C443; --rec: #FF6B7C; }
@media (prefers-color-scheme: dark) { :root[data-theme="auto"] { --warn: #F6C443; --rec: #FF6B7C; } }

/* ---------- Головна ---------- */
.mode-grid { grid-template-columns: 1fr; }
.link-btn { background: none; border: 0; color: var(--teal-strong); font-weight: 800; font-size: 15px; text-decoration: underline; text-underline-offset: 3px; min-height: 44px; padding: 6px 10px; }
:root[data-theme="dark"] .link-btn { color: var(--teal); }
@media (prefers-color-scheme: dark) { :root[data-theme="auto"] .link-btn { color: var(--teal); } }
.mode-desc .best { color: var(--accent-strong); font-weight: 800; }
:root[data-theme="dark"] .mode-desc .best { color: var(--accent); }

/* ---------- Список слів ---------- */
.search { width: 100%; height: 48px; border-radius: 14px; border: 2px solid var(--line); background: var(--bg); padding: 0 14px; font-size: 17px; font-weight: 700; margin-bottom: 10px; }
.search:focus { border-color: var(--teal); outline: none; }
.libraryList { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.libraryList li button { width: 100%; text-align: left; display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: center; min-height: 60px; padding: 10px 14px; border-radius: 16px; border: 2px solid var(--line); background: var(--card); }
.libraryList li button:hover { border-color: var(--accent); }
.libraryList .lw { font-family: var(--font-head); font-weight: 700; font-size: 19px; }
.libraryList .li-ipa { grid-column: 1; color: var(--muted); font-family: var(--font-mono); font-size: 13.5px; }
.libraryList .lvl { grid-row: 1 / 3; grid-column: 2; }
.libraryList .best-mini { font-family: var(--font-mono); font-weight: 800; font-size: 13px; color: var(--teal-strong); }
.empty { color: var(--muted); text-align: center; padding: 20px; }

.lvl { display: inline-block; font-family: var(--font-mono); font-weight: 800; font-size: 13px; padding: 3px 9px; border-radius: 999px; background: var(--teal-soft); color: var(--teal-strong); }
:root[data-theme="dark"] .lvl { color: var(--teal); }
@media (prefers-color-scheme: dark) { :root[data-theme="auto"] .lvl { color: var(--teal); } }

/* ---------- Гра ---------- */
.screen.game { padding-top: 0; }
.gamebar { display: flex; gap: 8px; align-items: stretch; min-height: 44px; margin: 2px 0 10px; flex-wrap: wrap; }
.progress-dots { display: flex; gap: 6px; align-items: center; flex: 1; min-width: 140px; }
.progress-dots .dot { height: 12px; flex: 1; border-radius: 99px; background: var(--ring-track); position: relative; overflow: hidden; }
.progress-dots .dot i { position: absolute; inset: 0; width: 0; background: var(--teal); border-radius: 99px; transition: width .5s; }
.progress-dots .dot.now { outline: 2px solid var(--accent); outline-offset: 1px; }
.progress-dots .dot.good i { background: var(--good); }
.progress-dots .dot.close i { background: var(--warn); }
.progress-dots .dot.miss i { background: var(--danger); }
.gamebar .mode-pill { font-weight: 800; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); align-self: center; white-space: nowrap; }
.demo-chip { font-size: 12.5px; font-weight: 800; background: var(--accent-soft); color: var(--accent-strong); border: 1px dashed var(--accent); border-radius: 10px; padding: 5px 10px; flex-basis: 100%; }
:root[data-theme="dark"] .demo-chip { color: var(--accent); }
@media (prefers-color-scheme: dark) { :root[data-theme="auto"] .demo-chip { color: var(--accent); } }

.scoreboard { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; }
.pcard { border: 2px solid var(--line); border-radius: 16px; background: var(--card); padding: 8px 12px; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 0 8px; transition: border-color .2s, box-shadow .2s; }
.pcard.active { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.pcard .pname { font-weight: 800; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pcard .pscore { font-family: var(--font-mono); font-weight: 800; font-size: 24px; grid-row: 1 / 3; grid-column: 2; }
.pcard .pwins { font-size: 12.5px; color: var(--muted); font-weight: 700; }

.gamegrid { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
.gamegrid > * { min-width: 0; }
.wordcard { text-align: center; padding: 14px 14px 16px; margin: 0; }
.wmeta { display: flex; justify-content: space-between; align-items: center; min-height: 26px; }
.wcount { color: var(--muted); font-weight: 800; font-size: 13px; }
.bigword { font-family: var(--font-head); font-weight: 800; font-size: clamp(34px, 11vw, 64px); line-height: 1.1; letter-spacing: -.02em; margin: 4px 0 4px; word-break: break-word; overflow-wrap: anywhere; }
.bigword.pop { animation: wordpop .45s cubic-bezier(.2, 1.3, .4, 1); }
@keyframes wordpop { 0% { transform: scale(.7); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
.ipa-row { display: flex; justify-content: center; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.ipa { font-family: var(--font-mono); font-weight: 600; font-size: clamp(17px, 5vw, 24px); color: var(--teal-strong); }
:root[data-theme="dark"] .ipa { color: var(--teal); }
@media (prefers-color-scheme: dark) { :root[data-theme="auto"] .ipa { color: var(--teal); } }
.seg-sm { padding: 3px; border-radius: 12px; }
.seg-sm button { min-height: 44px; min-width: 52px; font-family: var(--font-mono); }
.listen-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.listen-row .btn-ghost { min-height: 48px; }
.listen-row .btn-ghost.playing { border-color: var(--teal); background: var(--teal-soft); }
.tts-note { margin: 8px 0 0; text-align: center; }

.actioncol { display: grid; gap: 10px; align-content: start; }
.loopbox { display: flex; align-items: flex-end; gap: 8px; pointer-events: none; min-height: 66px; }
.loopbox .loop-canvas { width: 66px; height: 66px; animation-duration: 1.2s; }
.bubble { max-width: min(78%, 420px); background: var(--card); border: 2px solid var(--line); border-radius: 14px 14px 14px 4px; padding: 7px 12px; font-size: 14.5px; font-weight: 700; opacity: 0; transition: opacity .2s; margin-bottom: 14px; }
.bubble.show { opacity: 1; }

.rec-zone { margin: 0; display: grid; justify-items: center; gap: 8px; padding: 14px; }
.rec-wrap { position: relative; width: 112px; height: 112px; }
.rec-ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: var(--ring-track); stroke-width: 6; }
.ring-fg { fill: none; stroke: var(--rec); stroke-width: 6; stroke-linecap: round; stroke-dasharray: 339.3; stroke-dashoffset: 339.3; }
.rec-btn { position: absolute; inset: 11px; border-radius: 50%; border: 0; background: var(--accent-strong); color: var(--on-accent); display: grid; place-items: center; box-shadow: 0 8px 22px rgba(185, 80, 12, .35); transition: transform .12s, background .2s; }
.rec-btn:active { transform: scale(.94); }
.rec-btn.on { background: var(--rec); color: #fff; animation: recpulse 1s ease-in-out infinite; }
.rec-btn:disabled { opacity: .55; }
@keyframes recpulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--rec) 55%, transparent); } 50% { box-shadow: 0 0 0 14px color-mix(in srgb, var(--rec) 0%, transparent); } }
.wave { width: 100%; max-width: 320px; height: 48px; }
.rec-status { font-weight: 700; color: var(--muted); font-size: 15px; text-align: center; min-height: 22px; }
.rec-status.err { color: var(--danger); }
.rec-extra { display: flex; flex-wrap: wrap; gap: 4px 12px; justify-content: center; }

/* Результат слова */
.result { margin: 0; animation: slidein .3s ease-out; }
@keyframes slidein { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }
.score-row { display: flex; align-items: center; gap: 14px; min-width: 0; }
.score-num { font-family: var(--font-head); font-weight: 800; font-size: clamp(48px, 14vw, 84px); line-height: 1; letter-spacing: -.03em; white-space: nowrap; flex: none; }
.score-num small { font-size: .32em; color: var(--muted); font-weight: 700; margin-left: 2px; }
.score-meta { display: grid; gap: 2px; min-width: 0; flex: 1; }
.verdict { font-family: var(--font-head); font-weight: 700; font-size: 19px; line-height: 1.2; }
.attempt { color: var(--muted); font-size: 13.5px; font-weight: 700; }
.bar { height: 16px; border-radius: 99px; background: var(--ring-track); overflow: hidden; margin: 10px 0 12px; }
.bar i { display: block; height: 100%; width: 0; border-radius: 99px; background: var(--danger); transition: width .9s cubic-bezier(.2, .8, .2, 1), background .3s; }
.bar i.good { background: var(--good); } .bar i.close { background: var(--warn); } .bar i.miss { background: var(--danger); }
.heard { font-size: 16px; min-height: 22px; margin-bottom: 10px; font-weight: 600; }
.heard b { font-family: var(--font-mono); font-size: 17px; }
.heard mark { background: color-mix(in srgb, var(--danger) 22%, transparent); color: inherit; border-radius: 4px; padding: 0 2px; }
.heard .muted { color: var(--muted); font-weight: 600; }
.tipbox { border-radius: 16px; background: var(--teal-soft); padding: 12px 14px; display: grid; gap: 4px; margin-bottom: 12px; }
.tip-label { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; color: var(--teal-strong); }
:root[data-theme="dark"] .tip-label { color: var(--teal); }
@media (prefers-color-scheme: dark) { :root[data-theme="auto"] .tip-label { color: var(--teal); } }
.tip-trap { font-weight: 800; font-size: 15.5px; }
.tip-text { font-size: 16px; line-height: 1.4; }
.round-banner { text-align: center; font-family: var(--font-head); font-weight: 700; font-size: 16px; padding: 10px; border-radius: 14px; background: var(--accent-soft); margin-bottom: 12px; }
.res-actions { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; }
.res-actions.single { grid-template-columns: 1fr; }

/* ---------- Підсумок ---------- */
.result-hero { text-align: center; display: grid; justify-items: center; gap: 6px; }
.result-hero .loop-canvas { width: 96px; height: 96px; }
.result-hero .kicker { color: var(--muted); font-weight: 800; font-size: 13px; text-transform: uppercase; letter-spacing: .07em; }
.result-hero .big { font-family: var(--font-head); font-weight: 800; font-size: clamp(54px, 16vw, 88px); line-height: 1; }
.result-hero .big small { font-size: .3em; color: var(--muted); }
.result-hero .title { font-family: var(--font-head); font-weight: 700; font-size: 20px; }
.result-hero .sub { color: var(--muted); font-size: 15px; }
.rrow { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.rrow:last-child { border-bottom: 0; }
.rrow .rw { font-family: var(--font-head); font-weight: 700; font-size: 18px; }
.rrow .rs { font-family: var(--font-mono); font-weight: 800; font-size: 22px; text-align: right; }
.rrow .rt { grid-column: 1 / 3; color: var(--muted); font-size: 14px; }
.rrow .mini-bar { grid-column: 1 / 3; height: 8px; border-radius: 99px; background: var(--ring-track); overflow: hidden; }
.rrow .mini-bar i { display: block; height: 100%; border-radius: 99px; }
.rrow .mini-bar i.good { background: var(--good); } .rrow .mini-bar i.close { background: var(--warn); } .rrow .mini-bar i.miss { background: var(--danger); }
.duel-table { display: grid; grid-template-columns: 1fr auto auto; gap: 6px 14px; align-items: center; }
.duel-table .h { font-size: 12px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.duel-table .n { font-family: var(--font-mono); font-weight: 800; text-align: right; }
.duel-table .n.win { color: var(--good); }
.result-actions { display: grid; gap: 10px; margin-bottom: 14px; }

/* ---------- Діалоги ---------- */
.story-wrap { display: grid; justify-items: center; margin: 4px 0 12px; }
.story-wrap img { width: min(270px, 62vw); height: auto; aspect-ratio: 9 / 16; border-radius: 14px; border: 1px solid var(--line); background: var(--card-2); }
.story-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.story-actions .btn-ghost { text-align: center; text-decoration: none; display: grid; place-items: center; color: var(--text); }
.story-actions .btn-primary { font-size: 16px; }

/* ---------- Адаптив ---------- */
@media (min-width: 900px) {
  .mode-grid { grid-template-columns: repeat(4, 1fr); }
  .mode-card { grid-template-columns: 1fr; grid-template-rows: auto auto auto; text-align: center; }
  .mode-ico { grid-row: auto; font-size: 52px; }
  .screen:not(.game) { padding-left: 28px; padding-right: 28px; }
  #screen-setup, #screen-result, #screen-library { max-width: 760px; width: 100%; margin: 0 auto; }
  .screen.game { padding-left: 28px; padding-right: 28px; }
  .gamegrid { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 20px; align-items: start; }
  .wordcard { padding: 28px 24px; }
  .bigword { font-size: clamp(54px, 6.4vw, 84px); }
  .loopbox .loop-canvas { width: 88px; height: 88px; }
  .bubble { font-size: 16px; }
}
@media (max-width: 479px) { .brand-t { display: none; } }
.compact .loopbox { display: none; }
.compact .topbar { min-height: 44px; padding-top: 2px; padding-bottom: 2px; }

/* ---------- CTA, діалоги, fx (як у G17) ---------- */
.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(560px, calc(100vw - 24px)); max-height: calc(var(--vh, 90vh) - 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; position: sticky; top: 0; background: var(--card); }
.list-body { display: grid; gap: 10px; }
.lg { display: grid; grid-template-columns: 34px 1fr; gap: 8px; align-items: start; }
.lg-l { font-family: var(--font-head); font-weight: 800; font-size: 20px; color: var(--accent-strong); }
.lg-w { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 14.5px; }
.lg-w span { color: var(--muted); }
.lg-w i { font-style: normal; font-weight: 800; color: var(--text); }
.lg-w .used { text-decoration: line-through; opacity: .5; }
.lg.cur .lg-l { color: var(--teal-strong); }

#fx { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 50; }
@media (prefers-reduced-motion: reduce) { * { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* підтвердження (замість системного confirm) */
#confirmDialog { width: min(420px, calc(100vw - 32px)); padding: 22px; }
.confirm-text { font-family: var(--font-head); font-weight: 700; font-size: 20px; line-height: 1.3; margin: 4px 0 18px; text-align: center; }
.confirm-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.confirm-actions > button { margin: 0; width: 100%; }
@media (prefers-color-scheme: dark) { :root[data-theme="auto"] .btn-cta { background: var(--teal); color: #08211E; } }
