:root {
  --bg: #12100e;
  --surface: #1b1814;
  --surface2: #241f1a;
  --line: #342d25;
  --text: #ede6da;
  --muted: #a1978a;
  --faint: #776d61;
  --accent: #f2b134;
  --accent-ink: #1a1305;
  --danger: #e5604f;
  --ok: #7fc77a;
  --radius: 14px;
  --head: "Russo One", system-ui, sans-serif;
  --body: "Onest", system-ui, sans-serif;
  --tabs-h: 58px;
  --dock-h: 0px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 var(--body);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  min-height: 100dvh;
  overflow-wrap: anywhere;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
img { max-width: 100%; }
h1, h2, h3 { font-family: var(--head); font-weight: 400; margin: 0; letter-spacing: .02em; }
b { font-weight: 700; }

.stripe {
  height: 6px;
  background: repeating-linear-gradient(-45deg, var(--accent) 0 10px, var(--bg) 10px 20px);
  opacity: .9;
}

.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 13px; }
.row { display: flex; gap: 10px; align-items: center; min-width: 0; }
.row.wrap { flex-wrap: wrap; }
.stack { display: grid; gap: 12px; min-width: 0; }
.grow { flex: 1; min-width: 0; }

/* ---------- кнопки и поля ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 18px;
  border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface2); font-weight: 600; text-decoration: none;
  transition: transform .08s, background .15s, border-color .15s;
}
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn.ghost { background: transparent; }
.btn.small { min-height: 38px; padding: 0 12px; font-size: 14px; border-radius: 10px; }
.btn.big { min-height: 54px; font-size: 16px; }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .45; pointer-events: none; }
@media (hover: hover) {
  .btn:hover { border-color: #4a4035; }
  .btn.primary:hover { filter: brightness(1.07); }
}

.field {
  width: 100%; min-width: 0; min-height: 50px; padding: 0 14px;
  background: var(--surface2); border: 1px solid var(--line); border-radius: 12px;
  outline: none; transition: border-color .15s; font-size: 16px; /* 16px — без автозума в iOS */
}
.field:focus { border-color: var(--accent); }
.field.code { text-transform: uppercase; letter-spacing: .3em; font-family: var(--head); text-align: center; }

/* ---------- вход ---------- */
.entry { max-width: 440px; margin: 0 auto; padding: 44px 16px 40px; display: grid; gap: 20px; }
.logo { display: grid; gap: 6px; text-align: center; }
.logo h1 { font-size: clamp(40px, 13vw, 52px); line-height: 1; color: var(--accent); text-shadow: 0 0 40px color-mix(in srgb, var(--accent) 35%, transparent); }
.logo p { margin: 0; color: var(--muted); }
.panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; min-width: 0;
}
.panel h2 { font-size: 18px; margin-bottom: 12px; }
.panel h3 { font-size: 13px; color: var(--muted); margin-bottom: 8px; text-transform: uppercase; letter-spacing: .08em; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--faint); font-size: 13px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

details.rules summary { cursor: pointer; color: var(--muted); font-weight: 600; list-style: none; }
details.rules summary::-webkit-details-marker { display: none; }
details.rules summary::before { content: "▸ "; }
details.rules[open] summary::before { content: "▾ "; }
.rules-list { margin: 12px 0 0; padding-left: 20px; color: var(--muted); display: grid; gap: 8px; }
.rules-list b { color: var(--text); }

/* ---------- лобби ---------- */
.lobby { max-width: 640px; margin: 0 auto; padding: 14px 16px calc(40px + var(--safe-b)); display: grid; gap: 14px; }
.code-big { font-family: var(--head); font-size: clamp(36px, 12vw, 48px); letter-spacing: .2em; color: var(--accent); line-height: 1; }
.screen-link {
  display: flex; gap: 12px; align-items: center; text-decoration: none; color: inherit;
  padding: 12px 14px; border-radius: 12px; border: 1px dashed #4a4136; background: var(--surface2);
}
.screen-link .ic { font-size: 26px; }
.themes { display: grid; gap: 10px; }
.theme {
  text-align: left; padding: 14px; border-radius: 12px;
  background: var(--surface2); border: 1px solid var(--line);
  display: grid; gap: 4px;
}
.theme .tn { font-family: var(--head); font-size: 17px; }
.theme.on { border-color: var(--t); box-shadow: 0 0 0 1px var(--t) inset; }
.theme.on .tn { color: var(--t); }
.lobby-pl { display: flex; align-items: center; gap: 10px; min-height: 48px; border-bottom: 1px solid var(--line); }
.lobby-pl:last-of-type { border-bottom: 0; }
.seg { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.seg button { min-height: 42px; padding: 0 4px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface2); font-size: 14px; }
.seg button.on { border-color: var(--accent); color: var(--accent); }
.lobby-cta { position: sticky; bottom: calc(10px + var(--safe-b)); z-index: 5; }
.wait-note {
  text-align: center; padding: 16px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--accent); color: var(--text); font-weight: 600;
  box-shadow: 0 10px 30px rgba(0,0,0,.5);
}

/* ---------- шапка ---------- */
.top {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.top-in {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; padding-top: max(8px, env(safe-area-inset-top));
  max-width: 1280px; margin: 0 auto; min-width: 0;
}
.top .brand { font-family: var(--head); color: var(--accent); font-size: 18px; display: none; }
.top .code {
  font-family: var(--head); letter-spacing: .15em; font-size: 13px; flex: none;
  padding: 5px 8px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); background: none;
}
.top .round { font-weight: 700; font-size: 14px; white-space: nowrap; }
.top .stat { font-size: 13px; color: var(--muted); white-space: nowrap; }
.help-btn {
  flex: none; width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--surface2); font-weight: 700; color: var(--muted);
}
@media (min-width: 420px) { .top .brand { display: inline; } .top-in { gap: 12px; padding-left: 16px; padding-right: 16px; } }

/* ---------- плашка «что делать» ---------- */
.dock {
  position: fixed; left: 0; right: 0; z-index: 19;
  bottom: calc(var(--tabs-h) + var(--safe-b));
  padding: 14px 10px 8px;
  background: linear-gradient(to top, var(--bg) 70%, transparent);
  pointer-events: none;
}
.dock-in {
  pointer-events: auto;
  max-width: 640px; margin: 0 auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  padding: 12px 14px; display: grid; gap: 4px;
  box-shadow: 0 -6px 30px rgba(0,0,0,.45);
}
.dock.act .dock-in {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent) inset, 0 -6px 30px color-mix(in srgb, var(--accent) 22%, transparent);
}
.dock-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 22px; }
.step { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--faint); font-weight: 600; }
.dock.act .step { color: var(--accent); }
.dock-title { font-weight: 700; font-size: 17px; line-height: 1.25; }
.dock-text { font-size: 14px; color: var(--muted); }
.dock-text b { color: var(--text); }
.soon { color: var(--accent); font-weight: 600; }
.dock-actions { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.dock-actions .btn.primary { flex: 1 1 100%; }
.dock-actions .btn.ghost { flex: 1; }
.timer {
  font-family: var(--head); font-size: 15px; min-width: 52px; text-align: center;
  padding: 3px 8px; border-radius: 8px; background: var(--surface2); color: var(--text);
}
.timer.late { color: var(--danger); }

/* ---------- раскладка ---------- */
.main {
  max-width: 1280px; margin: 0 auto;
  padding: 12px 12px calc(var(--dock-h) + var(--tabs-h) + var(--safe-b) + 20px);
  display: grid; gap: 14px;
}
.col { display: grid; gap: 14px; align-content: start; min-width: 0; }
.tabbed .col { display: none; }
.tabbed .col.on { display: grid; }

.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: grid; grid-template-columns: repeat(3, 1fr);
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding-bottom: var(--safe-b);
}
.tabs button {
  background: none; border: 0; height: var(--tabs-h); color: var(--muted); font-weight: 600; font-size: 12px;
  display: grid; place-items: center; align-content: center; gap: 3px; position: relative; min-width: 0;
}
.tabs button .ic { font-size: 20px; line-height: 1; }
.tabs button.on { color: var(--accent); }
.tabs .dot { position: absolute; top: 8px; left: calc(50% + 12px); width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--surface); }

@media (min-width: 980px) {
  .dock { position: sticky; top: 55px; bottom: auto; padding: 10px 16px; background: var(--bg); }
  .dock-in { max-width: 1248px; grid-template-columns: 1fr auto; column-gap: 16px; padding: 14px 18px; }
  .dock-head { grid-column: 1; }
  .dock-title, .dock-text { grid-column: 1; }
  .dock-actions { grid-column: 2; grid-row: 1 / span 3; align-self: center; margin: 0; flex-wrap: nowrap; }
  .dock-actions .btn.primary { flex: none; min-width: 220px; }
  .main { grid-template-columns: 1.05fr 1fr 1fr; padding-bottom: 32px; padding-left: 16px; padding-right: 16px; }
  .tabbed .col { display: grid; }
  .tabs { display: none !important; }
}

/* ---------- стол ---------- */
.spot { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); background: color-mix(in srgb, var(--accent) 7%, var(--surface)); }
.spot-lbl { font-size: 13px; color: var(--muted); }
.spot-cat { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); margin-top: 8px; }
.spot-val { font-family: var(--head); font-size: 22px; line-height: 1.2; margin-top: 4px; }

.scenario .cat-title { font-size: 22px; line-height: 1.2; color: var(--accent); margin-bottom: 6px; font-family: var(--head); }
.scenario p { margin: 0 0 14px; color: var(--muted); }
.facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.facts li { padding-left: 18px; position: relative; }
.facts li::before { content: "•"; position: absolute; left: 4px; color: var(--faint); }
.facts li.item::before { content: "✓"; left: 0; color: var(--ok); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 14px; padding: 5px 10px; border-radius: 999px; background: var(--surface2); border: 1px solid var(--line); }
.threats { display: grid; gap: 8px; margin-top: 4px; }
.threat {
  padding: 10px 12px; border-radius: 10px;
  background: color-mix(in srgb, var(--danger) 10%, var(--surface2));
  border: 1px solid color-mix(in srgb, var(--danger) 40%, var(--line));
}
.threat.done { background: var(--surface2); border-color: var(--line); color: var(--faint); text-decoration: line-through; }
.threat.wait { background: none; border-style: dashed; color: var(--faint); }
.section-gap { height: 14px; }

.log { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
.log div:first-child { color: var(--text); }

/* ---------- голосование ---------- */
.vote-list { display: grid; gap: 8px; }
.vote-opt {
  display: flex; align-items: center; gap: 10px; text-align: left; min-width: 0;
  min-height: 56px; padding: 10px 14px; border-radius: 12px; font-size: 16px;
  background: var(--surface2); border: 1px solid var(--line);
}
.vote-opt:disabled { opacity: 1; }
.vote-opt.me { opacity: .35; }
.vote-opt.chosen { border-color: var(--danger); background: color-mix(in srgb, var(--danger) 16%, var(--surface2)); }
.vote-opt .mark { margin-left: auto; color: var(--danger); font-weight: 700; white-space: nowrap; flex: none; }
.bar-track { grid-column: 1 / -1; height: 6px; border-radius: 3px; background: color-mix(in srgb, var(--danger) 14%, transparent); overflow: hidden; }
.bar { height: 100%; background: var(--danger); border-radius: 3px; }
.result-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; align-items: center; font-size: 15px; }
.result-row .who { color: var(--faint); font-size: 12px; grid-column: 1 / -1; }

/* ---------- игроки ---------- */
.players { display: grid; gap: 10px; }
.players-sum { font-size: 14px; color: var(--muted); padding: 2px 2px 4px; }
.players-sum b { color: var(--text); }
.pl { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; min-width: 0; }
.pl.out { opacity: .5; }
.pl.turn { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.pl-head { display: flex; align-items: center; gap: 8px; min-width: 0; flex-wrap: wrap; }
.pl-name { font-weight: 700; flex: 1; }
.badges { display: flex; gap: 4px; flex-wrap: wrap; }
.badge {
  font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 6px; white-space: nowrap;
  background: var(--surface2); color: var(--muted); border: 1px solid var(--line);
}
.badge.acc { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
.badge.bad { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 50%, var(--line)); }
.badge.ok { color: var(--ok); }
.offline { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); display: inline-block; flex: none; }
.online { background: var(--ok); }
.pl-cards { display: grid; gap: 6px; margin-top: 8px; font-size: 14px; }
.pl-cards .k { display: block; color: var(--faint); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.pl-hidden { margin-top: 8px; font-size: 12px; color: var(--faint); }

/* ---------- мои карты ---------- */
.panel.choosing { border-color: var(--accent); }
.cards { display: grid; gap: 8px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card {
  position: relative; text-align: left; min-width: 0;
  min-height: 104px; padding: 11px; border-radius: 12px;
  background: var(--surface2); border: 1px dashed #4a4136;
  display: grid; align-content: start; gap: 6px; transition: opacity .2s;
}
.card .lbl { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); display: flex; justify-content: space-between; gap: 4px; }
.card .val { font-weight: 600; font-size: 14px; line-height: 1.3; }
.card.open { border-style: solid; border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); background: color-mix(in srgb, var(--accent) 8%, var(--surface2)); }
.card.can { cursor: pointer; border-style: solid; border-color: var(--accent); animation: pulse 1.6s ease-in-out infinite; }
.card.sel { box-shadow: 0 0 0 2px var(--accent); animation: none; }
.card.dim { opacity: .35; }
.card .reveal-btn { margin-top: 4px; width: 100%; }
@keyframes pulse { 50% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 30%, transparent); } }
@media (max-width: 340px) { .cards { grid-template-columns: 1fr; } .card { min-height: 0; } }

.action-card {
  border-radius: var(--radius); padding: 16px;
  background: radial-gradient(120% 80% at 100% 0%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 60%), var(--surface);
  border: 1px solid color-mix(in srgb, var(--accent) 50%, var(--line));
  display: grid; gap: 8px;
}
.action-card.used { opacity: .5; border-color: var(--line); background: var(--surface); }
.action-card .name { font-family: var(--head); font-size: 18px; color: var(--accent); }
.notes { display: grid; gap: 6px; font-size: 14px; }
.notes div { padding: 8px 10px; background: var(--surface2); border-radius: 8px; }

/* ---------- финал ---------- */
.verdict { font-family: var(--head); font-size: 28px; line-height: 1.15; }
.verdict.t0 { color: var(--ok); }
.verdict.t1 { color: var(--accent); }
.verdict.t2 { color: var(--danger); }
.ep-text { margin: 0; }
.ep-threat { padding: 10px 12px; border-radius: 10px; background: var(--surface2); border: 1px solid var(--line); display: grid; gap: 4px; }
.ep-threat.open { border-color: color-mix(in srgb, var(--danger) 50%, var(--line)); }
.ep-threat .st { font-size: 12px; font-weight: 700; }

/* ---------- окно ---------- */
.sheet-bg {
  position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.6);
  display: grid; align-items: end; justify-items: center; animation: fade .15s;
}
.sheet {
  width: 100%; max-width: 520px; max-height: 88dvh; overflow: auto; overscroll-behavior: contain;
  background: var(--surface); border: 1px solid var(--line); border-bottom: 0;
  border-radius: 18px 18px 0 0; padding: 18px 16px calc(18px + var(--safe-b));
  display: grid; gap: 14px; animation: up .2s ease-out;
}
.sheet .rules-list { margin: 0; }
@media (min-width: 600px) {
  .sheet-bg { align-items: center; }
  .sheet { border-radius: 18px; border-bottom: 1px solid var(--line); }
}
.pick { display: grid; gap: 8px; }
.pick button { text-align: left; min-height: 48px; padding: 8px 14px; border-radius: 10px; background: var(--surface2); border: 1px solid var(--line); }
.pick button.on { border-color: var(--accent); color: var(--accent); }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(30px); opacity: 0; } }

/* ---------- всплывашки ---------- */
#toasts {
  position: fixed; left: 50%; transform: translateX(-50%); z-index: 60;
  top: calc(56px + env(safe-area-inset-top));
  display: grid; gap: 8px; width: min(440px, calc(100% - 24px));
}
.toast {
  padding: 12px 14px; border-radius: 12px; background: #2d271f; border: 1px solid var(--accent);
  box-shadow: 0 10px 30px rgba(0,0,0,.5); font-size: 14px; animation: down .2s ease-out;
}
.toast.err { border-color: var(--danger); }
@keyframes down { from { transform: translateY(-16px); opacity: 0; } }

.conn { position: fixed; top: 0; left: 0; right: 0; z-index: 70; text-align: center; padding: 6px; font-size: 13px; background: var(--danger); color: #fff; }

/* ================= общий экран ================= */
body.screen-mode { font-size: clamp(14px, 1.05vw, 22px); overflow-x: hidden; }
.scr-wait { min-height: 100dvh; display: grid; place-content: center; text-align: center; gap: 12px; }
.scr-wait h1 { font-size: 8vw; color: var(--accent); }
.scr-wait p { color: var(--muted); font-size: 1.6vw; margin: 0; }

.scr-top { display: flex; align-items: center; gap: 2vw; padding: 1.2vw 2vw; }
.scr-top .brand { font-family: var(--head); color: var(--accent); font-size: 1.8em; }
.scr-theme { font-family: var(--head); color: var(--muted); font-size: 1.2em; }
.scr-stat { color: var(--muted); font-size: 1.15em; white-space: nowrap; }
.scr-stat b { color: var(--text); }
.scr-code { font-size: 1.15em; padding: .35em .8em; border: 1px solid var(--line); border-radius: .6em; color: var(--muted); white-space: nowrap; }
.scr-code b { color: var(--accent); font-family: var(--head); letter-spacing: .1em; }

.scr { height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
.scr-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 1.2vw; padding: 1.2vw 2vw 1.6vw; }
.scr-left { display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: 1.2vw; min-height: 0; }
.stage {
  background: var(--surface); border: 1px solid var(--line); border-radius: 1.2vw;
  padding: 2vw 2.4vw; min-height: 0; overflow: hidden;
  display: flex; flex-direction: column; justify-content: center; gap: 1.2vw;
}
.stage-kicker { text-transform: uppercase; letter-spacing: .12em; color: var(--accent); font-weight: 600; font-size: 1.15em; }
.stage-name { font-family: var(--head); font-size: 3.8vw; line-height: 1.05; }
.stage-name.out { color: var(--danger); font-size: 3.2vw; }
.stage-sub { font-size: 1.6em; color: var(--muted); }
.stage-card {
  border: 2px solid var(--accent); border-radius: 1vw; padding: 1.4vw 1.8vw;
  background: color-mix(in srgb, var(--accent) 9%, var(--surface2));
  animation: up .35s ease-out;
}
.stage-card.waiting { border-style: dashed; border-color: var(--line); background: var(--surface2); }
.stage-cat { text-transform: uppercase; letter-spacing: .1em; color: var(--accent); font-size: 1.1em; }
.stage-val { font-family: var(--head); font-size: 2.4vw; line-height: 1.15; margin-top: .4em; }
.stage-card.waiting .stage-val { font-family: var(--body); font-size: 1.5em; margin: 0; }
.stage-foot { display: flex; align-items: center; gap: 2vw; }
.timer.huge { font-size: 2.6vw; padding: .2em .6em; border-radius: .4em; min-width: 0; }
.stage-next { color: var(--muted); font-size: 1.3em; }
.stage-next b { color: var(--text); }
.vote-meter { position: relative; height: 3.2vw; border-radius: 1.6vw; background: var(--surface2); overflow: hidden; border: 1px solid var(--line); }
.vote-meter-fill { position: absolute; inset: 0 auto 0 0; background: var(--accent); transition: width .4s; }
.vote-meter span { position: relative; display: grid; place-items: center; height: 100%; font-family: var(--head); font-size: 1.5vw; mix-blend-mode: difference; color: #fff; }
.stage-split { display: grid; grid-template-columns: 1fr 1fr; gap: 2vw; align-items: start; }
.stage-cards { display: grid; gap: .55em; font-size: 1.05em; }
.stage-cards span { display: block; color: var(--faint); font-size: .75em; text-transform: uppercase; letter-spacing: .06em; }
.stage .result-row { font-size: 1.15em; }
.stage .result-row .who { font-size: .8em; }
.stage .bar-track { height: .45em; }
.scr-epilogue { display: grid; gap: .8vw; font-size: 1.05em; overflow: hidden; }
.scr-epilogue .verdict { font-size: 3.4vw; }
.scr-epilogue h3 { font-size: .85em; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin-top: .4vw; }
.scr-epilogue .stack { grid-template-columns: repeat(auto-fit, minmax(12vw, 1fr)); }
.scr-epilogue .small { font-size: .85em; }
.scr-epilogue .ep-threat .st { font-size: .8em; }
.scr-epilogue .chip { font-size: 1.1em; }
.scr-epilogue .stack.small, .scr-epilogue .faint.small.stack { grid-template-columns: 1fr 1fr; }

.scr-info { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2vw; }
.side-block { background: var(--surface); border: 1px solid var(--line); border-radius: 1vw; padding: 1vw 1.3vw; display: grid; gap: .45em; align-content: start; min-width: 0; }
.side-kicker { text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-size: .8em; font-weight: 600; }
.side-title { font-family: var(--head); color: var(--accent); font-size: 1.5em; line-height: 1.15; }
.side-text { color: var(--muted); font-size: .95em; }
.side-text.ok { color: var(--ok); }
.scr-info .threat { padding: .45em .7em; font-size: .95em; }

.tiles {
  display: grid; grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr)); grid-auto-rows: min-content;
  gap: .8vw; align-content: start; min-height: 0; overflow: hidden; font-size: calc(var(--tfs, 1) * 1em);
}
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: .9vw; padding: .8vw 1vw; display: grid; gap: .45em; align-content: start; min-width: 0; }
.tile.turn { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent) inset, 0 0 30px color-mix(in srgb, var(--accent) 25%, transparent); }
.tile.out { opacity: .38; }
.tile-head { display: flex; align-items: center; gap: .5em; font-weight: 700; font-size: 1.15em; min-width: 0; }
.tile-head .ellipsis { flex: 1; }
.tile-cards { display: grid; gap: .25em; font-size: .92em; }
.tile-cards div { display: flex; gap: .4em; min-width: 0; }
.tile-cards div span:first-child { flex: none; }
.tile .small { font-size: .85em; }
.tiles-out { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: .4em .8em; align-items: center; color: var(--faint); font-size: .95em; padding: .2em .2em 0; }
.tiles-out span { text-decoration: line-through; }
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-width: 0; }

.scr-lobby { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4vw; padding: 4vw; align-items: center; }
.scr-join { display: grid; justify-items: center; gap: 1.5vw; }
.scr-kicker { text-transform: uppercase; letter-spacing: .14em; color: var(--accent); font-weight: 700; font-size: 1.3em; }
.qr { width: min(30vw, 58vh); aspect-ratio: 1; background: #fff; border-radius: 1.4vw; padding: 1vw; }
.scr-url { font-size: 2.2vw; color: var(--muted); }
.scr-url b { color: var(--accent); font-family: var(--head); letter-spacing: .12em; }
.scr-tagline { font-family: var(--head); font-size: 2.8vw; line-height: 1.15; margin-top: .5vw; }
.scr-names { display: flex; flex-wrap: wrap; gap: .6vw; margin-top: 1vw; }
.scr-name { font-size: 1.5em; padding: .3em .8em; border-radius: 999px; background: var(--surface2); border: 1px solid var(--line); }
.scr-name.off { color: var(--faint); }
.scr-name.done { border-color: var(--ok); color: var(--ok); }
.scr-hint { margin-top: 3vh; color: var(--muted); font-size: 1.4em; }

@media (max-width: 800px) {
  body.screen-mode { font-size: 15px; }
  .scr { height: auto; overflow: visible; }
  .scr-grid, .scr-lobby, .stage-split, .scr-info, .scr-left { grid-template-columns: 1fr; }
  .tiles { --cols: 1 !important; }
  .stage-name { font-size: 34px; } .stage-val { font-size: 22px; } .timer.huge { font-size: 24px; }
  .qr { width: 70vw; } .scr-url, .scr-tagline { font-size: 22px; }
}
