:root {
  --bg: #000;
  --surface: #191919;
  --surface-2: #232323;
  --line: rgba(255, 255, 255, .12);
  --text: #fff;
  --muted: #999;
  --accent: #4a53ff;
  --danger: #ff5a5f;
  --sq-light: #e3e6ea;
  --sq-dark: #8a94a3;
  --font: -apple-system, "Helvetica Neue", "Segoe UI", system-ui, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; margin: 0; }
html, body { background: var(--bg); color: var(--text); font-family: var(--font); -webkit-font-smoothing: antialiased; }
body { min-height: 100dvh; -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }

.eyebrow { font-size: 13px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.pill {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 28px; border-radius: 300px;
  font-size: 15px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; text-decoration: none;
}
.pill-white { background: #fff; color: #000; }
.pill-accent { background: var(--accent); color: #fff; }
.pill-line { border: 1.5px solid var(--line); color: var(--text); }
.pill:disabled { opacity: .4; cursor: default; }
.pill[hidden] { display: none; }
.pill { transition: transform .12s, background .15s, border-color .15s, opacity .15s; }
.pill:not(:disabled):hover { filter: brightness(1.08); }
.pill:not(:disabled):active { transform: scale(.97); }
.pill:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pill-line:not(:disabled):hover { border-color: rgba(255, 255, 255, .35); }

/* ---------- Главная ---------- */
.home { max-width: 1200px; margin: 0 auto; padding: 56px 24px 40px; min-height: 100dvh; display: flex; flex-direction: column; }
.home h1 { font-size: clamp(52px, 13vw, 120px); font-weight: 400; line-height: .86; letter-spacing: -.04em; margin: 22px 0 26px; text-wrap: balance; }
.home h1 span { color: var(--muted); }
.home .lead { font-size: 19px; line-height: 1.4; color: #cfcfcf; max-width: 520px; margin-bottom: 36px; }
.bots { margin-top: 36px; display: flex; flex-direction: column; gap: 14px; }
.bots-row { display: flex; flex-wrap: wrap; gap: 10px; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 15px; margin-top: auto; padding-top: 56px; }
.fact { background: var(--surface); border-radius: 24px; padding: 24px; }
.fact b { display: block; font-size: 32px; font-weight: 400; letter-spacing: -.03em; margin-bottom: 6px; }
.fact span { font-size: 14px; color: var(--muted); line-height: 1.5; }
.credit { margin-top: 32px; font-size: 12px; color: #666; }

/* ---------- Партия ---------- */
.game { max-width: 560px; margin: 0 auto; padding: 12px 12px 28px; display: flex; flex-direction: column; gap: 10px; }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 4px 4px 2px; }
.topbar a { color: var(--muted); text-decoration: none; font-size: 14px; }
.watchers { font-size: 13px; color: var(--muted); }

.player { display: flex; align-items: center; gap: 12px; background: var(--surface); border-radius: 18px; padding: 10px 10px 10px 14px; }
.player .who { flex: 1; min-width: 0; }
.player .name { font-size: 16px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.player .sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #444; flex: none; }
.dot.on { background: #3ccf7a; }
.chip { width: 26px; height: 26px; border-radius: 50%; flex: none; border: 1.5px solid var(--line); }
.chip.w { background: #f2f2f2; }
.chip.b { background: #111; }
.clock {
  min-width: 112px; text-align: center; padding: 10px 14px; border-radius: 14px;
  background: var(--surface-2); color: var(--muted);
  font-size: 34px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1;
  transition: background .2s, color .2s;
}
.clock.run { background: var(--accent); color: #fff; }
.clock.low { color: var(--danger); }
.clock.run.low { background: var(--danger); color: #fff; }

.board-wrap { position: relative; }
.board {
  display: grid; grid-template-columns: repeat(8, 1fr); grid-template-rows: repeat(8, 1fr); aspect-ratio: 1; width: 100%;
  border-radius: 10px; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none;
}
.sq { position: relative; display: flex; align-items: center; justify-content: center; min-width: 0; min-height: 0; }
.sq.l { background: var(--sq-light); }
.sq.d { background: var(--sq-dark); }
.sq.last::before { content: ""; position: absolute; inset: 0; background: rgba(74, 83, 255, .32); }
.sq.sel::before { content: ""; position: absolute; inset: 0; background: rgba(74, 83, 255, .55); }
.sq.check::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle, rgba(255, 60, 60, .95) 0, rgba(255, 60, 60, .5) 35%, transparent 72%); }
.sq img { position: relative; z-index: 1; width: 92%; height: 92%; pointer-events: none; -webkit-user-drag: none; }
.sq.drag-src img { opacity: .3; }
.sq .hint { position: absolute; z-index: 2; width: 30%; height: 30%; border-radius: 50%; background: rgba(20, 24, 40, .28); pointer-events: none; }
.sq .hint.cap { width: 100%; height: 100%; border-radius: 0; background: radial-gradient(circle, transparent 62%, rgba(20, 24, 40, .3) 63%); }
.coord { position: absolute; z-index: 1; font-size: 11px; font-weight: 600; pointer-events: none; }
.coord.f { right: 3px; bottom: 1px; }
.coord.r { left: 3px; top: 2px; }
.sq.l .coord { color: var(--sq-dark); }
.sq.d .coord { color: var(--sq-light); }
.ghost { position: fixed; z-index: 50; pointer-events: none; transform: translate(-50%, -50%) scale(1.15); filter: drop-shadow(0 8px 10px rgba(0, 0, 0, .35)); }

.overlay {
  position: absolute; inset: 0; z-index: 10; border-radius: 10px;
  background: rgba(0, 0, 0, .78); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 14px; padding: 24px;
}
.overlay[hidden] { display: none; }
.overlay h2 { font-size: clamp(40px, 11vw, 64px); font-weight: 400; letter-spacing: -.04em; line-height: .9; }
.overlay p { color: #cfcfcf; font-size: 16px; line-height: 1.45; max-width: 340px; }
.overlay .row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.linkbox { width: 100%; max-width: 360px; background: var(--surface-2); border-radius: 12px; padding: 12px 14px; font-size: 14px; color: #ddd; word-break: break-all; }

.promo { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; width: 100%; max-width: 360px; }
.promo button { aspect-ratio: 1; border-radius: 16px; background: var(--sq-light); display: flex; align-items: center; justify-content: center; }
.promo img { width: 82%; }

.banner { background: var(--surface); border-radius: 14px; padding: 12px 14px; font-size: 15px; display: flex; align-items: center; gap: 10px; justify-content: space-between; }
.banner[hidden] { display: none; }
.banner.accent { background: var(--accent); }
.banner .row { display: flex; gap: 8px; }
.banner .pill { min-height: 36px; padding: 0 16px; font-size: 13px; }

.moves { display: flex; gap: 6px; overflow-x: auto; padding: 2px 2px 4px; scrollbar-width: none; min-height: 30px; }
.moves::-webkit-scrollbar { display: none; }
.moves span { flex: none; font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; padding: 4px 2px; }
.moves span.n { color: #555; }
.moves span.cur { color: var(--text); }

.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.actions[hidden] { display: none; }
.actions .pill { width: 100%; }
.actions .pill.confirm { border-color: var(--danger); color: var(--danger); }

.conn { text-align: center; font-size: 13px; color: var(--danger); }
.conn[hidden] { display: none; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---------- Общие блоки турнира ---------- */
.card { background: var(--surface); border-radius: 24px; padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.card p { color: #cfcfcf; line-height: 1.5; font-size: 15px; }
.card[hidden], section[hidden], form[hidden] { display: none; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
input {
  font: inherit; font-size: 16px; color: var(--text); background: var(--surface-2);
  border: 1.5px solid transparent; border-radius: 12px; padding: 12px 14px; width: 100%; min-width: 0;
}
input:focus { outline: none; border-color: var(--accent); }
.hint-text { font-size: 14px; color: var(--muted); min-height: 1em; }
.section-title { font-size: 24px; font-weight: 400; letter-spacing: -.03em; margin: 8px 0 12px; }
.small { min-height: 38px; padding: 0 18px; font-size: 13px; }

.rows { display: flex; flex-direction: column; gap: 6px; }
.rows > .row { display: flex; align-items: center; gap: 12px; background: var(--surface); border-radius: 14px; padding: 12px 14px; font-size: 15px; color: var(--text); text-decoration: none; }
.rows > .row.link:hover { background: var(--surface-2); }
.row .r-round { width: 22px; color: var(--muted); font-variant-numeric: tabular-nums; }
.row .r-opp { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row .r-opp small { display: block; width: 100%; color: var(--muted); font-size: 13px; }
.row .r-res { color: var(--muted); font-size: 14px; text-align: right; }
.row .r-res a { color: var(--text); margin-left: 6px; }
.row .r-res.win { color: #3ccf7a; }
.row .r-res.loss { color: var(--danger); }
.row .chip { width: 14px; height: 14px; border-width: 1px; display: inline-block; }
.vs { color: var(--muted); }

.table-wrap { overflow-x: auto; border-radius: 16px; background: var(--surface); }
.table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.table th { text-align: left; font-weight: 500; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 9px 12px; border-bottom: 1px solid rgba(255, 255, 255, .05); }
.table tr.me td { background: rgba(74, 83, 255, .22); }
.table tr.out td { color: #666; text-decoration: line-through; }
.table tr.gap td { color: #555; text-align: center; padding: 2px; }
.table tr.click { cursor: pointer; }
.table tr.click:hover td { background: var(--surface-2); }

/* ---------- Страница игрока ---------- */
.lobby { max-width: 620px; margin: 0 auto; padding: 40px 16px 48px; display: flex; flex-direction: column; gap: 18px; }
.lobby h1 { font-size: clamp(40px, 10vw, 64px); font-weight: 400; letter-spacing: -.04em; line-height: .95; text-wrap: balance; }
.lobby .lead { font-size: 17px; line-height: 1.45; color: #cfcfcf; }
.status { flex-direction: row; align-items: stretch; gap: 18px; flex-wrap: wrap; }
.status-main { flex: 1 1 260px; display: flex; flex-direction: column; gap: 10px; }
.status-text { font-size: 19px; line-height: 1.4; }
.status-actions:empty { display: none; }
.score { display: flex; gap: 10px; }
.score div { background: var(--surface-2); border-radius: 18px; padding: 14px 18px; min-width: 92px; display: flex; flex-direction: column; justify-content: center; }
.score b { font-size: 40px; font-weight: 400; letter-spacing: -.04em; line-height: 1; }
.score span { font-size: 13px; color: var(--muted); margin-top: 4px; }

/* ---------- Панель организатора ---------- */
.admin { max-width: 1200px; margin: 0 auto; padding: 20px 16px 48px; display: flex; flex-direction: column; gap: 18px; }
.admin-top { display: flex; align-items: center; justify-content: space-between; }
.brand { color: var(--text); text-decoration: none; font-weight: 600; letter-spacing: -.02em; font-size: 18px; }
.back { color: var(--muted); text-decoration: none; font-size: 14px; }
.login { max-width: 380px; margin: 10vh auto 0; width: 100%; }
.admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; align-items: start; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.fields.one { grid-template-columns: 1fr; }
.t-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.t-head h1 { font-size: clamp(36px, 7vw, 56px); font-weight: 400; letter-spacing: -.04em; line-height: .95; margin-top: 8px; }
.t-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.linkcard { flex-direction: row; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.linkcard .linkbox { max-width: none; margin-top: 8px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.stat { background: var(--surface); border-radius: 20px; padding: 18px 20px; }
.stat b { display: block; font-size: 36px; font-weight: 400; letter-spacing: -.04em; line-height: 1; }
.stat span { font-size: 13px; color: var(--muted); }
.stat.accent { background: var(--accent); }
.stat.accent span { color: rgba(255, 255, 255, .8); }
#toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--surface-2); color: var(--text); padding: 10px 16px; border-radius: 12px; }
#toast:empty { display: none; }
#listView:not([hidden]), #tView:not([hidden]), #groupBox:not([hidden]) { display: flex; flex-direction: column; gap: 18px; }
#groupBox .admin-grid > div { display: flex; flex-direction: column; gap: 10px; }
#cheatBox { display: flex; flex-direction: column; gap: 12px; }
.badge { flex: none; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; padding: 6px 10px; border-radius: 300px; background: var(--surface-2); color: var(--muted); }
.badge.high, .badge.dq { background: var(--danger); color: #fff; }
.badge.mid { background: #e8a33a; color: #000; }
.pb-head { display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; align-items: flex-start; }
.pb-head h3 { font-size: 28px; font-weight: 400; letter-spacing: -.03em; margin: 6px 0; }
.pill.danger { border-color: var(--danger); color: var(--danger); }

/* ---------- Разбор партии ---------- */
.replay { max-width: 1100px; margin: 0 auto; padding: 24px 16px 48px; display: flex; flex-direction: column; gap: 12px; }
.replay h1 { font-size: clamp(30px, 6vw, 48px); font-weight: 400; letter-spacing: -.04em; line-height: 1; }
.rp-grid { display: grid; grid-template-columns: minmax(0, 520px) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 760px) { .rp-grid { grid-template-columns: 1fr; } }
.rp-left { display: flex; flex-direction: column; gap: 10px; }
.rp-controls { display: flex; align-items: center; justify-content: center; gap: 8px; }
.rp-controls span { min-width: 70px; text-align: center; color: var(--muted); font-variant-numeric: tabular-nums; }
.rp-note { min-height: 3em; font-size: 15px; line-height: 1.45; color: #ddd; }
.rp-right { display: flex; flex-direction: column; gap: 10px; }
.rp-legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 13px; }
.rp-moves { display: grid; grid-template-columns: 34px 1fr 1fr; gap: 4px; max-height: 70vh; overflow-y: auto; background: var(--surface); border-radius: 16px; padding: 10px; }
.rp-moves .no { color: #555; font-size: 13px; align-self: center; text-align: right; padding-right: 4px; }
.mv, .m { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; padding: 6px 8px; border-radius: 8px; font-size: 14px; color: var(--text); text-align: left; }
.m { padding: 3px 8px; color: var(--muted); background: var(--surface); }
.mv small { color: #777; font-size: 11px; font-variant-numeric: tabular-nums; }
.mv.top, .m.top { background: rgba(74, 83, 255, .28); color: #fff; }
.mv.bad, .m.bad { background: rgba(255, 90, 95, .25); color: #fff; }
.mv.cur { outline: 2px solid #fff; }

/* ---------- Главная: вход по коду ---------- */
.home-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.code-login { margin-top: 36px; max-width: 560px; }
.code-row { display: flex; gap: 10px; }
.code-row input { text-transform: uppercase; letter-spacing: .08em; }
.code-big { font-size: 34px; letter-spacing: .12em; font-variant-numeric: tabular-nums; font-weight: 500; }
.credit a { color: #888; }
.doc h2 { margin-top: 16px; }
.doc p { color: #cfcfcf; line-height: 1.6; }

/* Вырез и «чёлка» iPhone, полоска жестов внизу */
body { padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }

.sub-title { font-size: 20px; font-weight: 400; letter-spacing: -.02em; margin-top: 10px; }

/* ---------- Добавлено по аудиту 24.10.2026: состояния, формы, панель, альбомная, печать ---------- */
textarea, select {
  font: inherit; font-size: 16px; color: var(--text); background: var(--surface-2);
  border: 1.5px solid transparent; border-radius: 12px; padding: 12px 14px; width: 100%; min-width: 0;
}
textarea { resize: vertical; line-height: 1.4; }
textarea:focus, select:focus { outline: none; border-color: var(--accent); }
label small { color: #8a8a8a; font-size: 12px; line-height: 1.35; }
.hint-text.err, .err { color: var(--danger); }
.hint-text.warn { color: #e8a33a; }
.hint-text:empty { display: none; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
code { font: 600 12px/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .04em; color: var(--muted); background: var(--surface-2); padding: 3px 6px; border-radius: 6px; vertical-align: middle; }
.tag { color: #e8a33a; }

/* Турнир: шапка, подвал, расписание, уведомление */
.lobby .topbar { margin: -16px 0 -4px; }
.lobby .topbar a { color: var(--muted); text-decoration: none; font-size: 14px; min-height: 44px; display: inline-flex; align-items: center; }
.foot { margin-top: 24px; font-size: 13px; color: var(--muted); }
.foot a { color: var(--muted); }
.card.info .status-text { font-size: 17px; }
.notice { background: rgba(232, 163, 58, .14); border-radius: 12px; padding: 10px 14px; color: #f0c070; }
.notice[hidden] { display: none; }
.table td small { color: var(--muted); font-size: 12px; }
.r-res a { color: var(--text); }

/* Партия: загрузка, нет связи, не найдена */
.game.loading .player, .game.loading .moves, .game.missing .player, .game.missing .moves, .game.missing .topbar .watchers { visibility: hidden; }
.overlay.offline { background: rgba(0, 0, 0, .86); }
.game.missing .board { opacity: .25; }

/* Альбомная ориентация телефона: доска по высоте слева, карточки и кнопки справа */
@media (orientation: landscape) and (max-height: 560px) {
  .game { max-width: none; display: grid; grid-template-columns: auto minmax(220px, 1fr); grid-template-rows: auto auto 1fr auto auto auto; column-gap: 14px; row-gap: 8px; padding: 8px 12px 10px; height: 100dvh; }
  .game .topbar { grid-column: 1 / -1; padding: 0 4px; }
  .game .board-wrap { grid-column: 1; grid-row: 2 / 7; height: calc(100dvh - 60px); width: calc(100dvh - 60px); max-width: 60vw; }
  .game .board { width: 100%; height: 100%; }
  .game #top { grid-column: 2; grid-row: 2; }
  .game #bottom { grid-column: 2; grid-row: 4; }
  .game .banner { grid-column: 2; grid-row: 3; }
  .game .moves { grid-column: 2; grid-row: 5; }
  .game .actions { grid-column: 2; grid-row: 6; }
  .game .conn { grid-column: 2; }
  .player { padding: 8px 8px 8px 12px; }
  .clock { font-size: 28px; min-width: 96px; padding: 8px 10px; }
}

/* Панель организатора */
.offline-bar { position: sticky; top: 0; z-index: 100; background: var(--danger); color: #fff; text-align: center; padding: 10px 16px; font-size: 14px; font-weight: 600; }
.offline-bar[hidden] { display: none; }
.updated { font-size: 12px; color: var(--muted); margin-left: auto; margin-right: 12px; }
.linkcard .grow { flex: 1 1 320px; min-width: 0; }
.fields input, .fields select { max-width: 260px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tab { font-size: 13px; font-weight: 600; padding: 8px 14px; border-radius: 300px; background: var(--surface); color: var(--muted); min-height: 36px; }
.tab.on { background: #fff; color: #000; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
input.mini { width: auto; max-width: 220px; padding: 8px 12px; font-size: 14px; }
.check { flex-direction: row; align-items: center; gap: 6px; font-size: 13px; white-space: nowrap; }
.check input { width: 16px; height: 16px; }
.rows.compact > .row { padding: 9px 12px; font-size: 14px; gap: 10px; }
.rows > .row.wrap { flex-wrap: wrap; }
.rows > .row.wrap .t-actions { width: 100%; }
.row .r-round.wide { width: auto; font-size: 12px; white-space: nowrap; }
.rows > .row.out { opacity: .55; }
.table tr.sel td { background: rgba(255, 255, 255, .08); }
.table tr.cut td { border-bottom: 2px solid var(--accent); }
.table tr[data-player] { cursor: pointer; }
.table td code { font-size: 11px; }
.addp { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.addp[hidden] { display: none; }
#tProgress { margin-top: 8px; }
@media (max-width: 640px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat b { font-size: 28px; }
  .t-head h1 { font-size: 30px; }
  .table th, .table td { padding: 8px 8px; font-size: 13px; }
  .table-wrap { -webkit-overflow-scrolling: touch; box-shadow: inset -24px 0 24px -24px rgba(0, 0, 0, .9); }
  .fields input, .fields select { max-width: none; }
  .admin .pill { font-size: 13px; padding: 0 16px; }
}

/* Печать: таблицы и правила — чёрным по белому */
@media print {
  html, body { background: #fff !important; color: #000 !important; }
  .pill, .topbar, .offline-bar, #toast, .conn, .foot, .tabs, input, textarea, select, .addp, #botsCard, .t-actions, .back { display: none !important; }
  .card, .stat, .table-wrap, .rows > .row { background: #fff !important; color: #000 !important; border: 1px solid #ccc !important; box-shadow: none; }
  .table th, .table td, .eyebrow, .hint-text, .stat span, .row .r-opp small { color: #000 !important; }
  .table tr.me td { background: #eee !important; }
  code { background: #eee; color: #000; }
  a { color: #000; text-decoration: none; }
}

.table td.who { white-space: nowrap; }
.rows > .row b, .rows > .row .r-opp { overflow-wrap: anywhere; }
@media print { .table-wrap { overflow: visible; } .table { font-size: 12px; } .admin-grid { display: block; } }

.check.big { align-items: flex-start; white-space: normal; font-size: 14px; color: var(--text); gap: 10px; }
.check.big input { margin-top: 3px; flex: none; }
.check.big small { display: block; width: 100%; }
.stats.cats .stat { background: var(--surface-2); }
.stats.cats:empty { display: none; }
#setPrizes[hidden] { display: none; }

/* ---------- Главная сайта (вариант А «Афиша»), 24.10.2026 ---------- */
.home { gap: 40px; padding-top: 40px; }
.home .hero { display: flex; flex-direction: column; gap: 22px; }
.home h1 { margin: 0; }
.home .lead { margin: 0; }
.eyebrow.v { color: var(--accent); }
.home .stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.home .stat { background: var(--surface); border-radius: 20px; padding: 18px 16px; min-width: 0; }
.home .stat b { display: block; font-size: clamp(19px, 5.4vw, 34px); font-weight: 600; letter-spacing: -.03em; line-height: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.home .stat span { display: block; font-size: 13px; color: var(--muted); margin-top: 8px; line-height: 1.3; }
.home .home-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.home .home-actions .pill { flex: 1 1 220px; }
.home .code-login { margin: 0; max-width: 640px; }
.home .resume { margin-top: 4px; }
.home .facts { margin-top: 0; padding-top: 0; }
.home .fact { opacity: 0; transform: translateY(14px); transition: opacity .5s, transform .5s; }
.home .fact.in, .home .org.in { opacity: 1; transform: none; }
.home .fact b { font-size: 26px; }
.home .org { opacity: 0; transform: translateY(14px); transition: opacity .5s, transform .5s; max-width: 760px; }
.home .org .links { display: flex; gap: 14px 22px; flex-wrap: wrap; }
.home .org .links a { color: var(--text); font-size: 15px; }
.home .train { display: flex; flex-direction: column; gap: 14px; }
.home .train .pill { flex: 0 1 auto; min-height: 44px; font-size: 13px; padding: 0 20px; }
.home .cats3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.credit { margin-top: 0; }
/* Эффект 09: стопка карточек — каждая прилипает и подъезжает под следующую */
.stack-cards { display: flex; flex-direction: column; gap: 14px; }
.scard { position: sticky; top: 16px; display: flex; gap: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 22px; opacity: 0; transform: translateY(18px); transition: opacity .5s, transform .5s; }
.scard.in { opacity: 1; transform: none; }
.scard:nth-child(2) { top: 28px; } .scard:nth-child(3) { top: 40px; } .scard:nth-child(4) { top: 52px; }
.scard i { flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--accent); color: #fff; font-style: normal; font-weight: 600; font-size: 15px; display: flex; align-items: center; justify-content: center; }
.scard b { display: block; font-size: 19px; font-weight: 600; letter-spacing: -.02em; margin-bottom: 6px; }
.scard p { color: #cfcfcf; font-size: 15px; line-height: 1.5; }
@media (min-width: 900px) {
  .home { padding-top: 64px; gap: 56px; }
  .home .hero { max-width: 820px; }
  .home .stats { max-width: 640px; }
  .home .home-actions .pill { flex: 0 1 auto; min-width: 240px; }
  .stack-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
  .scard { position: static; flex-direction: column; }
}
/* Сайт / приложение: один код, два лица */
body.native .site-only { display: none !important; }
body.site .app-only { display: none !important; }
body.native .home { gap: 28px; padding-top: 56px; }
body.native .app-hero { display: flex; flex-direction: column; gap: 22px; }
.doc .notice { display: block; }
@media (prefers-reduced-motion: reduce) { .scard, .home .fact, .home .org { opacity: 1; transform: none; } }
