/* Убийци и помощници – design system + pages.
   Dark "bronze & parchment" theme built on the original frame / sword / heart artwork. */

@font-face { font-family: "Golos Text"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(/fonts/golos-text-cyrillic.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Golos Text"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(/fonts/golos-text-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Cormorant Garamond"; font-style: normal; font-weight: 600 700; font-display: swap;
  src: url(/fonts/cormorant-garamond-cyrillic.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Cormorant Garamond"; font-style: normal; font-weight: 600 700; font-display: swap;
  src: url(/fonts/cormorant-garamond-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  color-scheme: dark;
  --bg: #0d0b09;
  --bg-raise: #13100d;
  --surface: #1a1612;
  --surface-2: #221d17;
  --surface-3: #2c251d;
  --line: rgba(214, 178, 120, .15);
  --line-2: rgba(214, 178, 120, .30);
  --text: #f1e8d6;
  --text-2: #c4b79e;
  --text-3: #968a74;
  --gold: #d6b278;
  --gold-hi: #ecd096;
  --gold-lo: #a97f43;
  --on-gold: #1c140a;
  --gold-bg: rgba(214, 178, 120, .10);
  --blood: #c9483a;
  --blood-ink: #f08c7a;
  --blood-bg: rgba(201, 72, 58, .14);
  --olive: #93b450;
  --olive-ink: #bcd884;
  --olive-bg: rgba(147, 180, 80, .14);
  --radius: 16px;
  --radius-sm: 11px;
  --shadow: 0 18px 50px rgba(0, 0, 0, .5);
  --header-h: 60px;
  --font-display: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --font-ui: "Golos Text", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 64px); }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh;
  background:
    radial-gradient(900px 520px at 50% -140px, rgba(214, 178, 120, .10), transparent 70%),
    var(--bg);
  background-repeat: no-repeat;
  color: var(--text); font: 400 16px/1.5 var(--font-ui);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--gold-hi); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--gold-hi); outline-offset: 2px; }
[hidden] { display: none !important; }

.i { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--gold); color: var(--on-gold); padding: 10px 14px; border-radius: 10px; font-weight: 600; }
.skip-link:focus { top: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- type ---------- */
.display, .display-sm, .page-title { font-family: var(--font-display); font-weight: 700; line-height: 1.05; letter-spacing: .2px; margin: 0; color: var(--text); }
.display { font-size: clamp(36px, 10vw, 48px); }
.display-sm { font-size: 30px; }
.page-title { font-size: clamp(32px, 8.5vw, 42px); }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); margin: 0 0 8px; }
.lead { color: var(--text-2); font-size: 16px; margin: 10px 0 0; }
.muted { color: var(--text-3); }
.small { font-size: 14px; }
.num { font-variant-numeric: tabular-nums; }
.page-head { margin: 12px 0 22px; }
.page-head .lead { max-width: 46ch; }
.section-title { font-family: var(--font-display); font-weight: 700; font-size: 24px; margin: 30px 0 12px; }

/* ---------- layout ---------- */
.container { width: 100%; max-width: 600px; margin: 0 auto; padding: 16px 16px 56px; }
.container--wide { max-width: 1240px; }
.center-page { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.stack { display: grid; gap: 12px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.spacer { flex: 1; }

/* ---------- header ---------- */
.app-header { position: sticky; top: 0; z-index: 50; height: var(--header-h); background: rgba(13, 11, 9, .84);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.app-header-inner { height: 100%; max-width: 600px; margin: 0 auto; padding: 0 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.app-header--admin .app-header-inner { max-width: 1240px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text); min-width: 0; }
.brand img { height: 26px; width: auto; }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 19px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tag { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--gold); border: 1px solid var(--line-2); border-radius: 999px; padding: 3px 10px; }
.admin-nav { display: flex; gap: 4px; }
@media (max-width: 400px) { .brand-name { display: none; } }
@media (max-width: 560px) { .admin-nav .btn span { display: none; } }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 0 20px;
  border-radius: 12px; border: 1px solid transparent; font-weight: 600; font-size: 16px; line-height: 1.2; text-decoration: none;
  cursor: pointer; transition: background-color .15s, border-color .15s, color .15s, transform .1s, box-shadow .15s; -webkit-tap-highlight-color: transparent; }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.btn-primary { background: linear-gradient(180deg, var(--gold-hi), var(--gold-lo)); color: var(--on-gold);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 8px 22px rgba(169, 127, 67, .22); }
.btn-primary:hover { background: linear-gradient(180deg, #f3dcab, #b88c4e); }
.btn-secondary { background: var(--surface-2); border-color: var(--line-2); color: var(--text); }
.btn-secondary:hover { background: var(--surface-3); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-danger { background: var(--blood); color: #fff; }
.btn-block { width: 100%; }
.btn-lg { min-height: 58px; font-size: 17px; border-radius: 14px; }
.btn-sm { min-height: 38px; padding: 0 12px; font-size: 14px; gap: 7px; border-radius: 10px; }
.btn-sm .i { width: 18px; height: 18px; }
.icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; flex: none; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); cursor: pointer; transition: background-color .15s, color .15s, border-color .15s; -webkit-tap-highlight-color: transparent; text-decoration: none; }
.icon-btn:hover { background: var(--surface-3); border-color: var(--line-2); }
.icon-btn.sm { width: 36px; height: 36px; border-radius: 10px; }
.icon-btn.sm .i { width: 18px; height: 18px; }
.icon-btn.danger:hover { color: var(--blood-ink); border-color: rgba(201, 72, 58, .5); }

/* ---------- cards / chips ---------- */
.card { background: linear-gradient(180deg, var(--surface), var(--bg-raise)); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.card + .card { margin-top: 12px; }
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 4px 11px; border-radius: 999px; font-size: 13px; font-weight: 600; border: 1px solid var(--line-2); color: var(--text-2); white-space: nowrap; }
.chip .i { width: 15px; height: 15px; }
.chip-live { color: var(--gold-hi); border-color: rgba(214, 178, 120, .45); background: var(--gold-bg); }
.chip-done { color: var(--olive-ink); border-color: rgba(147, 180, 80, .45); background: var(--olive-bg); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.chip-live .dot { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .25; } }

/* ---------- forms ---------- */
.field { display: grid; gap: 6px; align-content: start; }
.field-label { font-size: 14px; font-weight: 600; color: var(--text-2); }
.field-hint { font-size: 13px; color: var(--text-3); }
.field-error { font-size: 13px; color: var(--blood-ink); }
.input, .select { width: 100%; min-height: 50px; padding: 0 14px; border-radius: var(--radius-sm); border: 1px solid var(--line-2);
  background: var(--surface-2); color: var(--text); font-size: 16px; transition: border-color .15s, box-shadow .15s; }
.input::placeholder { color: var(--text-3); }
.select { appearance: none; -webkit-appearance: none; padding-right: 42px; text-overflow: ellipsis;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23d6b278' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; background-size: 18px; cursor: pointer; }
.select option { background: #221d17; color: var(--text); }
.select.is-empty { color: var(--text-3); }
.input:focus, .select:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(214, 178, 120, .18); }
.input[aria-invalid="true"], .select[aria-invalid="true"] { border-color: var(--blood); }
.input:disabled, .select:disabled { opacity: .6; cursor: default; }
.input-wrap { position: relative; }
.input-wrap .input { padding-right: 52px; }
.input-wrap .icon-btn { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; }
.search { position: relative; }
.search .i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.search .input { padding-left: 44px; min-height: 44px; }
.form-grid { display: grid; gap: 14px; }
@media (min-width: 520px) { .form-grid.two { grid-template-columns: 1fr 1fr; } .form-grid .span-2 { grid-column: 1 / -1; } }

.segmented { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; }
.seg { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg span { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text-2); font-weight: 600; transition: all .15s; }
.seg input:checked + span { border-color: var(--gold); background: var(--gold-bg); color: var(--gold-hi); }
.seg input:focus-visible + span { outline: 2px solid var(--gold-hi); outline-offset: 2px; }
.seg input:disabled + span { opacity: .6; }

/* ---------- dialogs ---------- */
dialog.modal { padding: 0; border: 0; background: transparent; color: var(--text); width: min(540px, calc(100% - 24px)); max-width: none; max-height: calc(100dvh - 24px); overflow: visible; }
dialog.modal::backdrop { background: rgba(5, 4, 3, .74); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
dialog.modal.is-fallback { position: fixed; inset: 0; margin: auto; z-index: 90; height: fit-content; }
.modal-box { background: var(--surface); border: 1px solid var(--line-2); border-radius: 20px; box-shadow: var(--shadow); max-height: calc(100dvh - 24px); overflow: auto; overscroll-behavior: contain; }
dialog.modal[open] .modal-box { animation: pop .18s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 18px 4px 22px; }
.modal-title { font-family: var(--font-display); font-weight: 700; font-size: 28px; line-height: 1.1; margin: 0; }
.modal-head .icon-btn { border-color: transparent; background: transparent; }
.modal-body { padding: 10px 22px 6px; color: var(--text-2); }
.modal-body > p { margin: 0 0 12px; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; padding: 16px 22px 22px; }
.modal-foot .btn { flex: 1 1 140px; }
.modal-icon { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; margin: 0 0 12px; background: var(--gold-bg); color: var(--gold-hi); }
.modal-icon .i { width: 26px; height: 26px; }
dialog.sheet { margin: auto auto 0; width: 100%; max-width: 600px; }
dialog.sheet .modal-box { border-radius: 22px 22px 0 0; border-bottom: 0; padding-bottom: env(safe-area-inset-bottom); }
dialog.sheet[open] .modal-box { animation: sheet .22s ease-out; }
@keyframes sheet { from { transform: translateY(40px); opacity: .4; } }
@media (min-width: 640px) { dialog.sheet { margin: auto; width: min(540px, calc(100% - 24px)); } dialog.sheet .modal-box { border-radius: 20px; border-bottom: 1px solid var(--line-2); } }

.nav-list { display: grid; gap: 6px; padding: 8px 14px 18px; }
.nav-link { display: flex; align-items: center; gap: 14px; padding: 12px; border-radius: 14px; text-decoration: none; color: var(--text); font-weight: 600; font-size: 17px; }
.nav-link:hover { background: var(--surface-2); }
.nav-link.is-active { background: var(--gold-bg); color: var(--gold-hi); }
.nav-ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-3); color: var(--gold); }
.nav-chev { margin-left: auto; color: var(--text-3); }

/* ---------- toasts / loading ---------- */
.toasts { position: fixed; left: 0; right: 0; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 200; display: grid; justify-items: center; gap: 8px; padding: 0 16px; pointer-events: none; }
.toast { max-width: 520px; width: fit-content; display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; border-radius: 14px; background: var(--surface-3);
  border: 1px solid var(--line-2); box-shadow: var(--shadow); color: var(--text); font-size: 15px; opacity: 0; transform: translateY(8px); transition: opacity .2s, transform .2s; pointer-events: auto; }
.toast.in { opacity: 1; transform: none; }
.toast .i { margin-top: 1px; color: var(--gold); }
.toast-error { border-color: rgba(201, 72, 58, .6); }
.toast-error .i { color: var(--blood-ink); }
.toast-ok .i { color: var(--olive-ink); }
.loading-overlay { position: fixed; inset: 0; z-index: 300; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  background: rgba(5, 4, 3, .78); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.loading-overlay.is-on { display: flex; }
.loading-text { font-size: 17px; font-weight: 600; color: var(--text); text-align: center; padding: 0 24px; }
.spinner { width: 46px; height: 46px; border-radius: 50%; border: 3px solid rgba(214, 178, 120, .2); border-top-color: var(--gold-hi); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- message page (wrong link etc.) ---------- */
.message-card { width: 100%; max-width: 420px; text-align: center; display: grid; gap: 14px; justify-items: center; }
.message-logo { width: 220px; height: auto; margin-bottom: 10px; opacity: .95; }
.message-card .lead { margin: 0 0 8px; }

/* ---------- home ---------- */
.hero { position: relative; width: min(100%, 330px); aspect-ratio: 968 / 1008; margin: 4px auto 0; }
.hero picture, .hero picture img { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-inner { position: absolute; inset: 17% 15% 21%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 4px; }
.hero-title { font-family: var(--font-display); font-weight: 700; line-height: .95; margin: 0; }
.hero-title .l1 { display: block; font-size: clamp(40px, 12.5vw, 50px); color: var(--text); }
.hero-title .l2 { display: block; font-size: clamp(27px, 8.4vw, 34px); color: var(--gold); margin-top: 4px; }
.hero-mark { width: 82%; margin-top: 14px; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .6)); }

.welcome { margin-top: 8px; text-align: center; padding: 22px 20px; }
.welcome-hello { font-family: var(--font-display); font-weight: 700; font-size: 28px; line-height: 1.1; margin: 0; }
.welcome-text { color: var(--text-2); margin: 8px auto 16px; max-width: 40ch; }
.welcome .chip { margin-bottom: 12px; }
.welcome-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 4px auto 16px; max-width: 440px; }
.mini-stat { min-width: 0; padding: 10px 6px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.mini-stat b { display: block; font-size: 22px; font-variant-numeric: tabular-nums; color: var(--gold-hi); line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-stat b.small { font-size: 16px; line-height: 1.65; }
.mini-stat b small { font-size: 15px; }
.mini-stat span { font-size: 12px; color: var(--text-3); text-transform: uppercase; letter-spacing: .08em; }
.welcome .btn + .btn { margin-top: 10px; }

.menu-list { display: grid; gap: 10px; margin-top: 12px; }
.menu-link { display: flex; align-items: center; gap: 14px; padding: 14px 14px 14px 14px; border-radius: var(--radius); border: 1px solid var(--line);
  background: var(--surface); color: var(--text); text-decoration: none; text-align: left; width: 100%; cursor: pointer; transition: border-color .15s, background-color .15s; }
.menu-link:hover { border-color: var(--line-2); background: var(--surface-2); }
.menu-ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-3); color: var(--gold); flex: none; }
.menu-txt { display: grid; gap: 1px; min-width: 0; }
.menu-txt b { font-size: 16px; font-weight: 600; }
.menu-txt small { font-size: 13px; color: var(--text-3); }
.menu-link > .i:last-child { margin-left: auto; color: var(--text-3); }

/* ---------- game ---------- */
.hud { position: sticky; top: var(--header-h); z-index: 40; background: rgba(13, 11, 9, .92); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.hud-inner { max-width: 600px; margin: 0 auto; padding: 8px 16px; display: flex; align-items: center; gap: 12px; }
.hud-item { display: flex; flex-direction: column; line-height: 1.15; }
.hud-label { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); }
.hud-value { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text); }
.hud-value.gold { color: var(--gold-hi); }
.hud .btn { margin-left: auto; }
.game-intro { color: var(--text-2); margin: 18px 0 14px; font-size: 15px; }
.game-intro b { color: var(--text); }

.statements { display: grid; gap: 12px; }
.st { position: relative; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(180deg, var(--surface), var(--bg-raise)); padding: 14px; transition: border-color .2s, background .2s; }
.st.is-new { animation: pop .2s ease-out; }
.st-head { display: flex; align-items: flex-start; gap: 12px; }
.st-num { flex: none; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-3); color: var(--gold); font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums; margin-top: 1px; }
.st-sentence { flex: 1; min-width: 0; font-size: 17px; font-weight: 600; line-height: 1.35; padding-top: 3px; overflow-wrap: anywhere; }
.st-sentence .ph { color: var(--text-3); font-weight: 500; }
.w-kill, .w-help { font-weight: 700; white-space: nowrap; }
.w-kill { color: var(--blood-ink); }
.w-help { color: var(--olive-ink); }
.w-kill .i, .w-help .i { width: 16px; height: 16px; vertical-align: -2px; margin-right: 4px; }
.st-fields { display: grid; gap: 10px; margin-top: 12px; }
.verb-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.verb-opt { position: relative; }
.verb-opt input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.verb-opt span { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; border-radius: var(--radius-sm); border: 1px solid var(--line-2);
  background: var(--surface-2); color: var(--text-2); font-weight: 600; transition: all .15s; }
.verb-opt.kill input:checked + span { border-color: var(--blood); background: var(--blood-bg); color: var(--blood-ink); }
.verb-opt.help input:checked + span { border-color: var(--olive); background: var(--olive-bg); color: var(--olive-ink); }
.verb-opt input:checked + span .i { fill: currentColor; fill-opacity: .18; }
.verb-opt input:focus-visible + span { outline: 2px solid var(--gold-hi); outline-offset: 2px; }
.st-error { display: none; gap: 10px; align-items: flex-start; margin-top: 12px; padding: 11px 12px; border-radius: 12px; background: var(--blood-bg); color: var(--blood-ink); font-size: 14px; line-height: 1.4; }
.st-error.show { display: flex; }
.st-error .i { margin-top: 1px; }
.st.is-invalid { border-color: rgba(201, 72, 58, .65); }
.st-result { display: none; }
.st-edit { display: none; }
.st-head .icon-btn + .icon-btn { margin-left: -4px; }
.st.collapsed { padding-top: 11px; padding-bottom: 11px; }
.st.collapsed .st-fields { display: none; }
.st.collapsed .st-edit { display: inline-grid; }
.st.collapsed .st-sentence { cursor: pointer; }

.st.done .st-fields, .st.done .st-remove, .st.done .st-edit { display: none; }
.st.done .st-result { display: inline-flex; margin-left: auto; }
.st.res-right { border-color: rgba(147, 180, 80, .6); background: linear-gradient(180deg, rgba(147, 180, 80, .12), var(--bg-raise)); }
.st.res-wrong { border-color: rgba(201, 72, 58, .6); background: linear-gradient(180deg, rgba(201, 72, 58, .12), var(--bg-raise)); }
.res-badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 13px; font-weight: 700; white-space: nowrap; }
.res-badge .i { width: 16px; height: 16px; stroke-width: 2.4; }
.res-right .res-badge, .res-badge.right { color: var(--olive-ink); background: var(--olive-bg); }
.res-wrong .res-badge, .res-badge.wrong { color: var(--blood-ink); background: var(--blood-bg); }
.res-zero .res-badge, .res-badge.zero { color: var(--text-2); background: var(--surface-3); }

/* Select2 (searchable "Кой?" / "Кого?") – themed like .select */
.st .select2-container { font-size: 16px; }
.select2-container--default .select2-selection--single { height: 50px; display: flex; align-items: center; border-radius: var(--radius-sm);
  border: 1px solid var(--line-2); background: var(--surface-2); transition: border-color .15s, box-shadow .15s; outline: none; }
.select2-container--default .select2-selection--single .select2-selection__rendered { color: var(--text); line-height: 1.3; padding: 0 44px 0 14px; }
.select2-container--default .select2-selection--single .select2-selection__placeholder { color: var(--text-3); }
.select2-container--default .select2-selection--single .select2-selection__arrow { top: 0; right: 12px; width: 20px; height: 100%; }
.select2-container--default .select2-selection--single .select2-selection__arrow b { border: 0; left: 0; top: 50%; width: 18px; height: 18px; margin: -9px 0 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23d6b278' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") center / 18px no-repeat;
  transition: transform .15s; }
.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b { border: 0; transform: rotate(180deg); }
.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--single { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(214, 178, 120, .18); }
.select2-container--default.select2-container--open.select2-container--below .select2-selection--single,
.select2-container--default.select2-container--open.select2-container--above .select2-selection--single { border-radius: var(--radius-sm); }
.select2-dropdown { background: var(--surface-2); border: 1px solid var(--gold); border-radius: 12px; color: var(--text); overflow: hidden; box-shadow: var(--shadow); }
.select2-container--open .select2-dropdown--below { border-top: 1px solid var(--gold); border-top-left-radius: 12px; border-top-right-radius: 12px; margin-top: 6px; }
.select2-container--open .select2-dropdown--above { border-bottom: 1px solid var(--gold); border-bottom-left-radius: 12px; border-bottom-right-radius: 12px; margin-top: -6px; }
.select2-search--dropdown { padding: 10px; }
.select2-container--default .select2-search--dropdown .select2-search__field { height: 44px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-2);
  background: var(--bg-raise); color: var(--text); font-size: 16px; outline: none; }
.select2-container--default .select2-search--dropdown .select2-search__field:focus { border-color: var(--gold); }
.select2-container--default .select2-results > .select2-results__options { max-height: min(320px, 46vh); overscroll-behavior: contain; }
.select2-results__option { padding: 11px 14px; font-size: 16px; line-height: 1.3; }
.select2-container--default .select2-results__option--selected { background: var(--surface-3); color: var(--gold-hi); font-weight: 600; }
.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable { background: var(--gold-bg); color: var(--gold-hi); }
.select2-results__message { color: var(--text-3); }
.st.done .select2-container, .st.collapsed .select2-container { display: none; }

.add-statement { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 58px; margin-top: 12px; border-radius: var(--radius);
  border: 1.5px dashed var(--line-2); background: transparent; color: var(--gold-hi); font-weight: 600; font-size: 16px; cursor: pointer; transition: background-color .15s, border-color .15s; }
.add-statement:hover { background: var(--gold-bg); border-color: var(--gold); }
.finish { margin-top: 30px; }
.finish-ornament { display: flex; align-items: center; gap: 12px; color: var(--gold); margin-bottom: 14px; }
.finish-ornament::before, .finish-ornament::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--line-2)); }
.finish-ornament::after { background: linear-gradient(270deg, transparent, var(--line-2)); }
.finish-ornament .i { width: 22px; height: 22px; }
.finish-ornament .i.k { color: var(--blood-ink); }
.finish-ornament .i.h { color: var(--olive-ink); }
.finish-note { text-align: center; color: var(--text-3); font-size: 14px; margin: 10px 0 0; }

.results { text-align: center; margin: 18px 0 16px; padding: 26px 20px; }
.results .eyebrow { margin-bottom: 2px; }
.score-big { font-family: var(--font-display); font-weight: 700; font-size: 84px; line-height: 1; color: var(--gold-hi); font-variant-numeric: tabular-nums; }
.score-sub { color: var(--text-2); margin-top: 2px; }
.results-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 18px 0; }
.results-note { text-align: left; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; font-size: 15px; margin: 0 0 16px; }
.results-note p { margin: 0 0 8px; }
.results-note p:last-child { margin: 0; color: var(--text); font-weight: 600; }

/* ---------- stat tiles ---------- */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 720px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat { padding: 14px 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.stat-label { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); }
.stat-value { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.25; }
.stat-value.gold { color: var(--gold-hi); }
.stat-value.olive { color: var(--olive-ink); }
.stat-value.blood { color: var(--blood-ink); }

/* ---------- answers ---------- */
.answer-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.answer { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-top: 1px solid var(--line); }
.answer:first-child { border-top: 0; }
.answer-ic { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.answer-ic .i { width: 18px; height: 18px; stroke-width: 2.4; }
.answer.right .answer-ic { background: var(--olive-bg); color: var(--olive-ink); }
.answer.wrong .answer-ic { background: var(--blood-bg); color: var(--blood-ink); }
.answer.zero .answer-ic { background: var(--surface-3); color: var(--text-2); }
.answer-text { flex: 1; min-width: 0; font-weight: 600; overflow-wrap: anywhere; }
.answer-pts { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text-3); }
.answer.right .answer-pts { color: var(--olive-ink); }
.answer.wrong .answer-pts { color: var(--blood-ink); }

/* ---------- hiscores ---------- */
.me-card { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; border-color: rgba(214, 178, 120, .4); background: linear-gradient(135deg, rgba(214, 178, 120, .14), var(--surface)); }
.me-place { flex: none; width: 66px; height: 66px; border-radius: 18px; display: grid; place-items: center; background: var(--surface-3); border: 1px solid var(--line-2); }
.me-place b { font-family: var(--font-display); font-size: 36px; line-height: 1; color: var(--gold-hi); }
.me-txt { flex: 1; min-width: 0; }
.me-txt h2 { margin: 0; font-size: 17px; }
.me-txt p { margin: 2px 0 0; color: var(--text-2); font-size: 14px; }
.board { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.board-row { display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 12px; padding: 12px 14px; border-top: 1px solid var(--line); scroll-margin-top: calc(var(--header-h) + 80px); }
.board-row:first-child { border-top: 0; }
.place { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 15px; background: var(--surface-3); color: var(--text-2); font-variant-numeric: tabular-nums; }
.place.p1 { background: linear-gradient(180deg, #f1d38f, #b58744); color: #241805; }
.place.p2 { background: linear-gradient(180deg, #e3e3e8, #8e909a); color: #1b1c20; }
.place.p3 { background: linear-gradient(180deg, #dfa06a, #8b5532); color: #22120a; }
.who { min-width: 0; }
.who-name { font-weight: 600; display: flex; align-items: center; gap: 8px; overflow-wrap: anywhere; }
.who-meta { font-size: 13px; color: var(--text-3); }
.pts { text-align: right; }
.pts b { display: block; font-size: 19px; font-variant-numeric: tabular-nums; color: var(--gold-hi); line-height: 1.2; }
.pts span { font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.board-row.is-me { background: rgba(214, 178, 120, .12); box-shadow: inset 3px 0 0 var(--gold); }
.me-tag { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--on-gold); background: var(--gold); border-radius: 999px; padding: 2px 8px; }
.board-row.flash { animation: flash 1.6s ease-out; }
@keyframes flash { 0%, 30% { background: rgba(214, 178, 120, .32); } }
.empty { text-align: center; color: var(--text-3); padding: 34px 16px; }

/* ---------- instructions ---------- */
.video { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line-2); background: #000; box-shadow: var(--shadow); }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.rules { counter-reset: r; list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.rules > li { counter-increment: r; position: relative; padding-left: 42px; color: var(--text-2); }
.rules > li::before { content: counter(r); position: absolute; left: 0; top: -2px; width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center;
  background: var(--surface-3); color: var(--gold); font-weight: 700; font-size: 14px; }
.rules strong { color: var(--text); }
.rules ul { margin: 8px 0 0; padding-left: 18px; display: grid; gap: 4px; }
.rules ul li::marker { color: var(--gold); }
.rules .w-who { color: var(--text); font-weight: 700; }
.rules-card { margin-top: 16px; }
.cta-row { display: grid; gap: 10px; margin-top: 20px; }

/* ---------- admin ---------- */
.admin-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 18px 0 18px; }
.admin-head .page-title { font-size: 38px; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 18px 0 12px; }
.toolbar .search { flex: 1 1 260px; }
.filters { display: flex; gap: 6px; flex-wrap: wrap; }
.filter { min-height: 38px; padding: 0 13px; border-radius: 999px; border: 1px solid var(--line-2); background: transparent; color: var(--text-2); font-weight: 600; font-size: 14px; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; }
.filter b { font-weight: 700; color: var(--text-3); font-variant-numeric: tabular-nums; }
.filter.is-on { background: var(--gold-bg); border-color: var(--gold); color: var(--gold-hi); }
.filter.is-on b { color: var(--gold); }
.table-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.table-scroll { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 15px; }
.data th { text-align: left; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); padding: 12px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--bg-raise); }
.data th.r, .data td.r { text-align: right; }
.sort { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.sort:focus-visible { outline: 2px solid var(--gold-hi); outline-offset: 2px; border-radius: 4px; }
.sort::after { content: "↕"; opacity: .35; font-size: 12px; }
.sort[data-dir="asc"]::after { content: "↑"; opacity: 1; color: var(--gold); }
.sort[data-dir="desc"]::after { content: "↓"; opacity: 1; color: var(--gold); }
.data td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.data tbody tr:last-child td { border-bottom: 0; }
.data tbody tr:hover { background: rgba(255, 255, 255, .02); }
.cell-player b { display: block; font-weight: 600; }
.cell-player b.noname { color: var(--text-3); font-style: italic; font-weight: 500; }
.cell-player span { font-size: 13px; color: var(--text-3); }
.cell-date { font-size: 13px; color: var(--text-2); white-space: nowrap; }
.cell-score { font-weight: 700; font-variant-numeric: tabular-nums; }
.cell-time { font-variant-numeric: tabular-nums; color: var(--text-2); white-space: nowrap; }
.actions { display: flex; gap: 6px; justify-content: flex-end; }
.no-results { padding: 30px 16px; text-align: center; color: var(--text-3); }
@media (max-width: 860px) {
  table.data, .data tbody, .data tr, .data td { display: block; }
  .data thead { display: none; }
  .data tr { padding: 14px 16px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; }
  .data tbody tr:last-child { border-bottom: 0; }
  .data td { padding: 0; border: 0; }
  .data td[data-label]::before { content: attr(data-label); display: block; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); margin-bottom: 2px; }
  .data td.cell-player { grid-column: 1 / -1; }
  .data td.cell-id { display: none; }
  .data td.r { text-align: left; }
  .data td.cell-actions { grid-column: 1 / -1; margin-top: 4px; }
  .actions { justify-content: flex-start; flex-wrap: wrap; }
}
.qr-box { display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center; gap: 12px; text-align: center; }
.qr-canvas { width: 240px; height: 240px; border-radius: 14px; background: #fff; padding: 14px; image-rendering: pixelated; }
.qr-name { font-weight: 700; color: var(--text); font-size: 18px; }
.link-box { width: 100%; min-width: 0; display: flex; gap: 8px; align-items: center; padding: 6px 6px 6px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line-2); }
.link-box code { flex: 1; min-width: 0; font-size: 13px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; }
.guid-line { font-size: 13px; color: var(--text-3); overflow-wrap: anywhere; }

/* ---------- login ---------- */
.auth-card { width: 100%; max-width: 400px; padding: 30px 24px 26px; text-align: center; }
.auth-card .message-logo { margin: 0 auto 18px; width: 200px; }
.auth-card form { display: grid; gap: 14px; margin-top: 22px; text-align: left; }
.alert { display: flex; gap: 10px; align-items: center; padding: 11px 14px; border-radius: 12px; background: var(--blood-bg); color: var(--blood-ink); font-size: 15px; border: 1px solid rgba(201, 72, 58, .35); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
