/* Арена — в духе TheCapitol.pn: светло-серое поле с гранями, тушь, золото, ромбы, скошенные чёрные плашки.
   Мелкий текст не меньше 12px и контрастом ≥ 4.5:1; золото — заливкой под белым или тёмным текстом, не мелким шрифтом. */
:root {
  color-scheme: light;
  --bg: #D8D8D5;
  --panel: rgba(233, 233, 230, .88);
  --panel-2: #E4E4E1;
  --ink: #232322;
  --mute: #52524D;
  --rule: #B3B3AE;
  --gold: #8C7541;            /* заливка под белым текстом */
  --gold-l: #B49D67;          /* декор */
  --gold-ink: #6A5626;        /* золото мелким текстом */
  --black: #232323;
  --bad: #8E2A1C;
  --ok: #2F5A3A;
  --font: "Exo 2", "Segoe UI", system-ui, sans-serif;
  --side: 248px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 400 16px/1.55 var(--font); color: var(--ink);
       background: var(--bg) url(facets.svg) center top / cover; }
@media (min-width: 1000px) and (hover: hover) { body { background-attachment: fixed; } }
a { color: var(--ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--gold-ink); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--black); color: #fff; padding: 8px 14px; z-index: 10; }
.skip:focus { left: 8px; }
.emblem { width: 40px; height: 40px; display: block; }
.muted { color: var(--mute); }
.small { font-size: 13px; }
.gold { color: var(--gold-ink); }

/* ── подписи и заголовки ─────────────────────────────────────────────────────── */
.lbl { display: block; font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--mute); }
.lbl.strong { color: var(--ink); }
.caps { font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--mute); line-height: 1.6; max-width: 64ch; }
.lead { font-size: 18px; line-height: 1.6; max-width: 62ch; margin: 14px 0 0; }
.rule-label { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 10px 0 12px;
              font-size: 13px; font-weight: 700; font-style: italic; letter-spacing: .1em; text-transform: uppercase; }
.rule-label::before, .rule-label::after { content: ""; width: 56px; height: 1px; background: var(--ink); }
.rule-label.left { justify-content: flex-start; }
.rule-label.left::before { display: none; }
.plate { display: inline-block; margin: 0; background: var(--black); transform: skewX(-12deg); padding: 6px 28px 4px; max-width: 100%; }
.plate > span { display: block; transform: skewX(12deg); color: #DCDCD8; font: 800 italic clamp(30px, 4.6vw, 58px)/1.02 var(--font);
                text-transform: uppercase; letter-spacing: .01em; overflow-wrap: anywhere; }
.slam { font: 800 italic clamp(28px, 3.4vw, 40px)/1.05 var(--font); text-transform: uppercase; margin: 0; }
h2 { font: 700 20px/1.2 var(--font); text-transform: uppercase; letter-spacing: .04em; margin: 0 0 16px; }
h3 { margin: 0; }

/* ── каркас: боковая колонка + страница ─────────────────────────────────────── */
body.with-side { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 30px 26px 24px; display: flex; flex-direction: column; gap: 22px;
        border-right: 1px solid var(--rule); background: rgba(221, 221, 218, .72); }
.brand { display: flex; gap: 12px; align-items: center; text-decoration: none; }
.brand b { display: block; font-size: 15px; letter-spacing: .12em; text-transform: uppercase; }
.brand small { display: block; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--mute); line-height: 1.4; margin-top: 2px; }
.nav { display: flex; flex-direction: column; border-top: 1px solid var(--rule); }
.nav a { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--rule); text-decoration: none;
         font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--mute); }
.nav a.sub { padding-left: 4px; text-transform: none; letter-spacing: 0; font-size: 15px; color: var(--ink); }
.nav a.sub.off { color: var(--mute); }
.nav a i { font-weight: 800; font-size: 13px; width: 26px; color: var(--mute); }
.nav a.on { color: var(--gold-ink); font-weight: 700; box-shadow: inset 3px 0 0 var(--gold); padding-left: 12px; }
.nav a.on i { color: var(--gold-ink); }
.nav .dot { width: 8px; height: 8px; background: var(--gold); transform: rotate(45deg); margin-left: auto; flex: none; }
.page { min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }
main { flex: 1; padding: 28px clamp(16px, 4vw, 56px) 56px; max-width: 1280px; width: 100%; margin: 0 auto; }
body.bare main { max-width: 1180px; padding-top: 48px; }

.foot { display: flex; flex-wrap: wrap; gap: 8px 32px; padding: 20px clamp(16px, 4vw, 56px); border-top: 1px solid var(--rule);
        font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--mute); }
.foot .motto em { font-style: italic; font-weight: 700; color: var(--gold-ink); }

/* ── кнопки, штампы, ромбы ───────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 44px; padding: 10px 20px;
       font: 700 14px/1.1 var(--font); letter-spacing: .1em; text-transform: uppercase; text-decoration: none; cursor: pointer;
       background: var(--black); color: #fff; border: 1px solid var(--black); }
.btn:hover { background: #000; color: #fff; }
.btn.gold { background: var(--gold); border-color: var(--gold); color: #fff; }
.btn.gold:hover { background: #75612F; color: #fff; }
.btn.gold::after { content: "⟶"; font-weight: 400; }
.btn.line { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn.line:hover { background: var(--ink); color: #fff; }
.btn.small { min-height: 36px; padding: 7px 12px; font-size: 12px; }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .6; cursor: progress; }

.stamp { display: inline-block; padding: 3px 8px 2px; border: 1px solid var(--mute); font-size: 12px; font-weight: 700; letter-spacing: .08em;
         text-transform: uppercase; color: var(--mute); white-space: nowrap; }
.stamp.ok { border-color: var(--ok); color: var(--ok); }
.stamp.bad { border-color: var(--bad); color: var(--bad); }
.stamp.ink { background: var(--black); border-color: var(--black); color: #fff; }
.stamp.gold { background: var(--gold); border-color: var(--gold); color: #fff; }
.stamp.wait { border-style: dashed; animation: blink 1.6s ease-in-out infinite; }
.stamp.big { font-size: 15px; padding: 8px 14px 7px; }
@keyframes blink { 50% { opacity: .45; } }

.dia { position: relative; width: 64px; height: 64px; display: grid; place-items: center; flex: none; }
.dia::before { content: ""; position: absolute; inset: 10px; border: 1px solid #8F8F8A; transform: rotate(45deg); }
.dia.on::before { background: var(--gold); border-color: var(--gold); }
.dia i { position: relative; font: 800 italic 18px var(--font); }
.dia.on i { color: #fff; }

/* ── главная: эфир ───────────────────────────────────────────────────────────── */
.stage { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 24px; align-items: center; }
.stage.quiet { grid-template-columns: 1fr; padding: 40px 0 10px; }
.stage-main { display: flex; flex-direction: column; align-items: center; text-align: center; min-width: 0; }
.stage-main .emblem { width: 46px; height: 46px; }
.stage-main .caps { margin: 14px auto 0; }
.flame { position: relative; width: min(500px, 100%); margin-top: 4px; }
.flame .huge { position: absolute; left: -30%; right: -30%; top: 35%; text-align: center; font: 800 italic clamp(84px, 11vw, 168px)/1 var(--font);
               color: #F6F6F3; text-shadow: 0 2px 18px rgba(43, 35, 22, .45); font-variant-numeric: tabular-nums; pointer-events: none; }
.flame .tag { position: absolute; left: 0; right: 0; top: 66%; text-align: center; font-size: 13px; font-weight: 700; letter-spacing: .14em;
              text-transform: uppercase; color: #F6F6F3; text-shadow: 0 1px 6px rgba(43, 35, 22, .6); }
.dia-btn { position: absolute; left: 50%; top: 76%; transform: translateX(-50%); width: 132px; height: 132px; display: grid; place-items: center;
           text-decoration: none; }
.dia-btn::before { content: ""; position: absolute; inset: 8px; border: 1px solid var(--black); transform: rotate(45deg); opacity: .7; transition: inset .2s; }
.dia-btn::after { content: ""; position: absolute; inset: 22px; background: var(--black); transform: rotate(45deg); transition: background .2s; }
.dia-btn span { position: relative; z-index: 1; color: #fff; font: 700 13px/1.25 var(--font); letter-spacing: .1em; text-transform: uppercase; text-align: center; }
.dia-btn:hover::before { inset: 2px; }
.dia-btn:hover::after { background: var(--gold); }

.gold-dia { position: relative; aspect-ratio: 27 / 46; width: 100%; max-width: 290px; justify-self: end; display: grid; place-items: center; color: #fff; }
.gold-dia::before { content: ""; position: absolute; inset: -12px -6px; border: 1px solid #A3A39E; clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
.gold-dia::after { content: ""; position: absolute; inset: 0; background: var(--gold); clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
.gold-dia .in { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 0 30px; }
.gold-dia .emblem { width: 30px; height: 30px; }
.gold-dia .k { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.gold-dia .big { font-size: 25px; line-height: 1.15; font-weight: 500; }
.gold-dia .mid { font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.gold-dia hr { width: 120px; border: 0; border-top: 1px solid rgba(255, 255, 255, .55); margin: 4px 0; }
.trail { display: block; margin-top: 4px; }

/* ── испытание ───────────────────────────────────────────────────────────────── */
.lab-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 24px 40px; }
.lab-head > div:first-child { min-width: 0; flex: 1 1 520px; }
.clock { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; text-align: right; }
.clock .digits { display: flex; gap: 6px; }
.clock .seg { background: var(--black); color: #fff; min-width: 64px; padding: 8px 8px 6px; text-align: center; }
.clock .seg b { display: block; font: 700 32px/1 var(--font); font-variant-numeric: tabular-nums; }
.clock .seg small { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: #C9C9C4; }
.clock .note { font-size: 13px; color: var(--mute); line-height: 1.45; }

.facts { margin: 26px 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); background: var(--panel); }
.facts > div { padding: 16px 20px 18px; border-left: 1px solid var(--rule); }
.facts > div:first-child { border-left: 0; }
.facts dt { font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--mute); }
.facts dd { margin: 4px 0 2px; font: 300 36px/1.05 var(--font); font-variant-numeric: tabular-nums; }
.facts dd small { font-size: 16px; color: var(--mute); }
.facts dd.gold { color: var(--gold-ink); font-weight: 500; }
.facts span { font-size: 13px; color: var(--mute); }

.notice { margin: 22px 0 0; padding: 14px 18px; border-left: 4px solid var(--ink); background: var(--panel-2); font-size: 16px; }
.notice.ok { border-color: var(--gold); }
.notice.warn { border-color: var(--gold-l); }
.notice.bad { border-color: var(--bad); color: var(--bad); }

.grid2 { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 20px; margin-top: 22px; align-items: start; }
.col { display: grid; gap: 20px; }
.sheet { background: var(--panel); padding: 22px 24px 24px; }
.sheet h2 .no { display: block; font-size: 12px; letter-spacing: .14em; color: var(--mute); font-weight: 600; margin-bottom: 4px; }

.slot { position: relative; display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 2px 12px; padding: 14px 16px; margin-bottom: 10px;
        border: 1px dashed #8F8F8A; background: rgba(255, 255, 255, .35); cursor: pointer; transition: background .15s, border-color .15s; }
.slot:hover, .slot.over { border-color: var(--ink); background: rgba(255, 255, 255, .6); }
.slot:focus-within { outline: 3px solid var(--gold); outline-offset: 2px; }
.slot .n { grid-row: span 4; font: 800 italic 20px var(--font); color: var(--mute); }
.slot .t { font-weight: 700; font-size: 16px; }
.slot .req { color: var(--bad); }
.slot .h { font-size: 13px; color: var(--mute); }
.slot .picked { font-size: 14px; color: var(--mute); margin-top: 4px; }
.slot input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.slot.filled { border-style: solid; border-color: var(--gold); background: color-mix(in srgb, var(--gold-l) 12%, transparent); }
.slot.filled .n { color: var(--gold-ink); }
.slot.filled .picked { color: var(--ink); font-weight: 600; }
.slot.filled .picked::before { content: "✓ "; color: var(--gold-ink); }
.slot.error { border-style: solid; border-color: var(--bad); }
.slot.error .picked { color: var(--bad); font-weight: 600; }
.submit-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin-top: 16px; }
.submit-row .muted { font-size: 14px; max-width: 40ch; }

.decree { margin: 0 0 18px; padding: 0; list-style: none; counter-reset: d; }
.decree li { counter-increment: d; position: relative; padding: 8px 0 8px 34px; border-bottom: 1px solid var(--rule); font-size: 15px; }
.decree li::before { content: counter(d, upper-roman); position: absolute; left: 0; top: 8px; font: 800 italic 14px var(--font); color: var(--mute); }
.decree li.no::before { content: "×"; color: var(--bad); font-size: 18px; top: 4px; }

.scale { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; margin-bottom: 10px; }
.scale > div { display: flex; flex-direction: column; align-items: center; padding: 6px 2px; background: var(--panel-2); font-variant-numeric: tabular-nums; }
.scale > div span:first-child { font: 800 italic 18px var(--font); }
.scale > div span:last-child { font-size: 12px; color: var(--mute); }
.scale > div.got { background: #CFC6AE; }
.scale > div.me { background: var(--gold); color: #fff; }
.scale > div.me span:last-child { color: #fff; }

.fields { display: grid; gap: 8px; margin-bottom: 10px; }
.fields > div { display: grid; grid-template-columns: 104px minmax(0, 1fr) 46px; gap: 10px; align-items: center; font-size: 14px; }
.fields i { height: 4px; background: #C3C3BE; }
.fields b { display: block; height: 4px; background: var(--ink); }
.fields em { font-style: normal; text-align: right; font-variant-numeric: tabular-nums; }
.fields .weak span, .fields .weak em { color: var(--gold-ink); font-weight: 700; }
.fields .weak b { background: var(--gold); }

.journal { margin-top: 48px; }
.journal .slam { margin-bottom: 16px; }
.ledger-wrap { overflow-x: auto; background: var(--panel); }
.ledger { width: 100%; border-collapse: collapse; font-size: 15px; }
.ledger th { text-align: left; font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--mute);
             padding: 12px 14px; border-bottom: 2px solid var(--ink); white-space: nowrap; }
.ledger td { padding: 11px 14px; border-bottom: 1px solid var(--rule); vertical-align: top; }
.ledger .num { text-align: right; font-variant-numeric: tabular-nums; }
.ledger tr.best td, .ledger tr.me td { background: color-mix(in srgb, var(--gold-l) 16%, transparent); }
.ledger tr.me td:first-child, .ledger tr.best td:first-child { box-shadow: inset 3px 0 0 var(--gold); }
.score-big { font-size: 17px; font-weight: 600; }
.place-col { font: 800 italic 18px var(--font); }
details summary { cursor: pointer; color: var(--gold-ink); font-size: 14px; }
details pre { margin: 8px 0 0; font: 13px/1.5 ui-monospace, Menlo, monospace; background: var(--panel-2); padding: 10px; }

/* ── табло ───────────────────────────────────────────────────────────────────── */
.podium { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 28px 0 20px; align-items: end; }
.podium .p { background: var(--panel); padding: 18px 16px 20px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; }
.podium .p.first { padding-top: 30px; padding-bottom: 30px; border-top: 3px solid var(--gold); }
.podium .p.me { box-shadow: inset 0 0 0 2px var(--gold); }
.podium .val { font: 800 italic clamp(26px, 3vw, 40px)/1.1 var(--font); font-variant-numeric: tabular-nums; }
.podium .first .val { color: var(--gold-ink); }
.podium .name { font-weight: 700; font-size: 16px; }
.podium .sub { font-size: 13px; color: var(--mute); }

/* ── вход и ошибки ───────────────────────────────────────────────────────────── */
/* ── пульт ───────────────────────────────────────────────────────────────────── */
.console { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin-top: 26px; }
.unit { background: var(--panel); padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 10px; }
.unit-top { display: flex; justify-content: space-between; align-items: center; }
.unit-top .dia { margin: -8px 0 -8px -10px; }
.unit h3 { font: 800 italic 20px/1.15 var(--font); text-transform: uppercase; }
.unit .stats { font-size: 14px; color: var(--mute); }
.unit form { display: grid; gap: 10px; }
.check { display: flex; gap: 10px; align-items: center; font-size: 15px; }
.check input { width: 18px; height: 18px; accent-color: var(--gold); }
.unit-links { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── узкие экраны ────────────────────────────────────────────────────────────── */
@media (max-width: 1199px) {
  .stage { grid-template-columns: 1fr; }
  .gold-dia { justify-self: center; aspect-ratio: auto; max-width: 520px; }
  .gold-dia::before { display: none; }
  .gold-dia::after { clip-path: none; }
  .gold-dia .in { padding: 22px 24px; }
  .grid2 { grid-template-columns: 1fr; }
}
@media (max-width: 999px) {
  body.with-side { display: block; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 12px 20px; padding: 14px 16px;
          border-right: 0; border-bottom: 1px solid var(--rule); }
  .nav { flex-direction: row; flex-wrap: wrap; border-top: 0; gap: 0 16px; flex: 1 1 100%; }
  .nav a { border-bottom: 0; padding: 6px 0; }
  .nav a.on { box-shadow: inset 0 -2px 0 var(--gold); padding-left: 0; }
  .who { flex: 1 1 100%; flex-direction: row; gap: 12px; align-items: baseline; margin: 0; padding: 0; border: 0; }
  .clock { align-items: flex-start; text-align: left; }
}
@media (max-width: 560px) {
  .flame .huge { font-size: 76px; }
  .dia-btn { width: 112px; height: 112px; }
  .podium { grid-template-columns: 1fr; }
  .clock .seg { min-width: 54px; }
  .clock .seg b { font-size: 26px; }
  .facts > div { border-left: 0; border-top: 1px solid var(--rule); padding: 12px 14px 14px; }
  .facts dd { font-size: 28px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .stars { display: none; }
}

/* ── каркас, упрощённый ──────────────────────────────────────────────────────── */
.who { margin-top: auto; display: flex; flex-direction: column; gap: 2px; padding-top: 14px; border-top: 1px solid var(--rule); font-size: 14px; }
.who span { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--mute); }
.who b { font-weight: 700; }
.who a { font-size: 14px; color: var(--mute); margin-top: 4px; }

/* ── список испытаний на главной ─────────────────────────────────────────────── */
.season { margin-top: 40px; }
.season .slam .gold { color: var(--gold-ink); }
.trials { list-style: none; margin: 22px 0 0; padding: 0; border-top: 2px solid var(--ink); }
.trials li { border-bottom: 1px solid var(--rule); }
.trials a { display: grid; grid-template-columns: 64px minmax(0, 1fr) 190px 150px; gap: 8px 20px; align-items: center; padding: 10px 12px 10px 0;
            text-decoration: none; transition: background .2s, padding .2s; }
.trials a:hover { background: rgba(233, 233, 230, .7); padding-left: 10px; color: var(--ink); }
.trials .t b { display: block; font: 800 italic 21px/1.15 var(--font); text-transform: uppercase; }
.trials small { display: block; font-size: 14px; color: var(--mute); }
.trials .w { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.trials .s { text-align: right; }
.trials .s b { font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.trials li:not(.live) .t b { color: #4A4A45; }

.review { margin-top: 48px; }
.review .slam { margin-bottom: 16px; }
.review .grid2 { margin-top: 0; }

/* ── анимации ─────────────────────────────────────────────────────────────────── */
/* пламя: осколки слетаются в пламя, блик пробегает, внешние осколки плавают; курсор чуть сдвигает слои */
.flame-static { display: block; width: 100%; height: auto; transition: opacity .2s; }
.flame-cv { position: absolute; left: -25%; top: -25%; pointer-events: none; }
.flame.live .flame-static { opacity: 0; }
.flame .huge, .flame .tag { animation: rise .9s cubic-bezier(.2, .8, .2, 1) 1.1s both; }
.flame .tag { animation-delay: 1.4s; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }
.dia-btn { animation: dia-rise .7s ease-out 1.7s both; }
@keyframes dia-rise { from { opacity: 0; transform: translateX(-50%) translateY(18px); } }
.dia-btn::before { animation: breathe 3.2s ease-in-out 2.6s infinite; }
@keyframes breathe { 50% { inset: 0; opacity: .35; } }

/* плашка выезжает: сначала чёрная полоса, потом слово */
.plate.reveal { animation: wipe .7s cubic-bezier(.7, 0, .2, 1) .1s both; }
.plate.reveal > span { animation: span-rise .6s cubic-bezier(.2, .8, .2, 1) .55s both; }
@keyframes span-rise { from { opacity: 0; transform: skewX(12deg) translateY(16px); } }
@keyframes wipe { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
.stage-main > .emblem, .reap-center > .rule-label, .stage-main > .rule-label { animation: rise .6s ease-out both; }
.stage-main > .caps, .reap-center > .caps { animation: rise .6s ease-out .7s both; }
.gold-dia { animation: dia-in 1s cubic-bezier(.2, .8, .2, 1) .9s both; }
@keyframes dia-in { from { opacity: 0; transform: translateY(24px) scale(.94); } }

/* созвездия на заднем плане эфира */
.stage, .reaping-screen { position: relative; }
.stars { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }
.stage > :not(.stars):not(.smoke), .reaping-screen > :not(.stars):not(.smoke) { position: relative; z-index: 1; }

/* ── Жатва: экран входа ──────────────────────────────────────────────────────── */
body.reap main { max-width: none; padding: 0; }
body.reap .foot { display: none; }
.reaping-screen { min-height: 100vh; display: grid; grid-template-rows: auto 1fr auto; grid-template-columns: 1fr 1fr; padding: 20px 32px; overflow: hidden; }
.corner { display: flex; gap: 12px; align-items: center; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--mute); }
.corner b { color: var(--ink); }
.corner .emblem { width: 34px; height: 34px; color: var(--ink); }
.corner.tl span b { display: block; font-size: 15px; letter-spacing: .12em; }
.corner.tl small { display: block; font-size: 12px; line-height: 1.4; }
.corner.tr { justify-self: end; align-self: start; border: 1px solid var(--rule); padding: 6px 12px; }
.corner.bl { align-self: end; }
.corner.br { justify-self: end; align-self: end; text-align: right; line-height: 1.35; }
.corner.br .emblem { width: 26px; height: 26px; color: var(--mute); }
.reap-center { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 0 0 8px; }
.huge-plate > span { font-size: clamp(52px, min(9vw, 11vh), 120px); }
.reap-center .caps { margin: 14px auto 0; max-width: 56ch; }
.reap-center .flame { width: min(440px, 92vw, calc((100vh - 300px) * .93)); min-width: 260px; margin-top: 4px; }
.slip-line { position: absolute; left: -20%; right: -20%; top: 37%; display: flex; flex-direction: column; align-items: center; gap: 6px;
             animation: rise .8s ease-out 1.3s both; }
.lbl-w { font-size: 13px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: #F6F6F3; text-shadow: 0 1px 6px rgba(43, 35, 22, .7); }
.slip-line .name { font: 800 italic clamp(38px, 5.4vw, 66px)/1.05 var(--font); color: #F6F6F3; text-shadow: 0 2px 18px rgba(43, 35, 22, .55); min-height: 1.1em; }
.slip-line .caret { display: inline-block; width: 4px; height: .9em; background: #F6F6F3; vertical-align: -.08em; margin-left: 4px; animation: blink 1s steps(1) infinite; }
.wide-dia { width: 150px; height: 150px; top: 72%; }
.wide-dia span { font-size: 12px; }
.reap-center .hint { margin: 18px 0 0; font-size: 15px; color: var(--mute); max-width: 48ch; animation: rise .6s ease-out 2s both; }
.dev-panel { max-width: 420px; margin: 0 auto 40px; background: var(--panel); padding: 12px 18px; }
.dev-panel summary { cursor: pointer; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--mute); }
.dev-panel form { display: grid; gap: 12px; margin-top: 12px; }
.field { display: grid; gap: 6px; font-size: 14px; font-weight: 600; }
.field input { font: 16px var(--font); padding: 10px 12px; border: 1px solid var(--ink); background: #fff; color: var(--ink); min-height: 44px; }
.reaping.err { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 40px; align-items: center; min-height: 50vh; }
.big-dia { width: 220px; height: 220px; justify-self: center; }
.big-dia::before { inset: 34px; background: var(--black); border-color: var(--black); }
.big-dia i { color: #fff; font-size: 44px; }

@media (max-width: 999px) {
  .trials a { grid-template-columns: 56px minmax(0, 1fr); }
  .trials .w, .trials .s { grid-column: 2; text-align: left; flex-direction: row; align-items: center; gap: 10px; }
  .reaping-screen { padding: 16px; }
  .corner.tr, .corner.bl, .corner.br { display: none; }
  .reaping.err { grid-template-columns: 1fr; }
}
.stage-main > .caps, .reap-center > .caps, .reap-center > .hint, .flame .huge, .flame .tag, .slip-line, .dia-btn { position: relative; z-index: 2; }
.flame .huge, .flame .tag, .slip-line, .dia-btn { position: absolute; }

/* ── цвета испытаний: у каждого свой оттенок (см. app/themes.py) ───────────────── */
.trials li { box-shadow: inset 4px 0 0 var(--gold); }
.trials a { padding-left: 14px; }
.trials a:hover { padding-left: 22px; }
.trials .dia::before { border-color: var(--gold); border-width: 2px; }
.trials .t b { color: var(--gold-ink); }
.trials li:not(.live) .t b { color: var(--gold-ink); opacity: .75; }
.nav a.sub i { color: var(--gold-ink); }
.unit { border-top: 4px solid var(--gold); }
.unit .dia::before { border-color: var(--gold); }
.lab-head .rule-label, .stage .rule-label { color: var(--gold-ink); }
.lab-head .rule-label::after, .stage .rule-label::before, .stage .rule-label::after { background: var(--gold); }
.plate { box-shadow: 8px 8px 0 var(--gold); }
.sheet h2 .no { color: var(--gold-ink); }
.ledger th { border-bottom-color: var(--gold); }

/* шапка испытания — сплошная полоса цвета испытания, как страницы «Героев дистриктов» */
.lab-head.band { position: relative; overflow: hidden; background: var(--gold); color: #fff; padding: 26px 30px 28px; margin: -8px 0 0;
                 isolation: isolate; }
.lab-head.band::before { content: ""; position: absolute; inset: 0; z-index: -1; opacity: .18; mix-blend-mode: multiply;
                         background: url(facets.svg) center / cover; }
.band-flame { position: absolute; right: 18%; top: -30%; height: 170%; width: auto; opacity: .28; z-index: -1; mix-blend-mode: luminosity;
              pointer-events: none; }
.lab-head.band .rule-label, .lab-head.band .lead, .lab-head.band .clock .note, .lab-head.band .lbl { color: #fff; }
.lab-head.band .rule-label::after { background: #fff; }
.lab-head.band .plate { box-shadow: 8px 8px 0 rgba(0, 0, 0, .28); }
.lab-head.band .stamp { border-color: #fff; color: #fff; }
.lab-head.band .btn.gold { background: #fff; color: var(--gold-ink); border-color: #fff; }
.lab-head.band .btn.line { color: #fff; border-color: #fff; }
.lab-head.band .btn.line:hover { background: #fff; color: var(--gold-ink); }
.lab-head.band a { color: #fff; }
.facts { margin-top: 0; border-top: 0; }

/* ── отчёты распорядителя ─────────────────────────────────────────────────────── */
.plag-link { display: grid; gap: 2px; padding: 10px 12px; background: var(--panel-2); text-decoration: none; border-left: 3px solid var(--gold); }
.plag-link b { font-size: 14px; text-transform: uppercase; letter-spacing: .06em; }
.plag-link span { font-size: 13px; color: var(--mute); }
.pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; margin-top: 20px; }
.code-col h2 small { font-size: 13px; text-transform: none; letter-spacing: 0; }
pre.code { margin: 0; font: 13px/1.5 ui-monospace, Menlo, monospace; overflow-x: auto; background: var(--panel-2); padding: 10px 0; max-height: 80vh; }
pre.code span { display: block; padding: 0 12px 0 0; white-space: pre; }
pre.code span.hit { background: color-mix(in srgb, var(--gold-l) 32%, transparent); box-shadow: inset 3px 0 0 var(--gold); }
pre.code i { display: inline-block; width: 44px; padding-right: 10px; text-align: right; color: var(--mute); font-style: normal; user-select: none; }
@media (max-width: 999px) { .pair { grid-template-columns: 1fr; } }

/* ── задание: «технический паспорт» испытания ───────────────────────────────────── */
.task-box { margin-top: 18px; background: var(--panel); }
.task-box > summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: baseline;
                      padding: 18px 28px; border-left: 4px solid var(--gold); }
.task-box > summary::-webkit-details-marker { display: none; }
.task-box > summary span { font: 800 italic 22px/1.1 var(--font); text-transform: uppercase; }
.task-box > summary small { font-size: 13px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--gold-ink); }
.task-box:not([open]) .open-l, .task-box[open] .closed-l { display: none; }
.tk { padding: 4px 28px 34px; }
.tk-hero { padding: 18px 0 26px; border-bottom: 2px solid var(--ink); }
.tk-title { font: 800 italic clamp(24px, 2.6vw, 34px)/1.1 var(--font); text-transform: uppercase; color: var(--gold-ink); max-width: 30ch; }
.tk-deadline { display: inline-flex; align-items: stretch; margin: 16px 0 6px; font-weight: 600; }
.tk-deadline span { background: var(--black); color: #fff; padding: 6px 12px; font-size: 12px; letter-spacing: .12em; text-transform: uppercase;
                    display: flex; align-items: center; }
.tk-deadline { border: 1px solid var(--black); }
.tk-deadline > :not(span), .tk-deadline { font-size: 15px; }
.tk-deadline { padding-right: 12px; gap: 12px; align-items: center; }
.tk-hero p { margin: 14px 0 0; max-width: 70ch; font-size: 16px; line-height: 1.65; }
.tk-hero p.tk-lead { font-size: 20px; line-height: 1.5; font-weight: 500; }
.tk-sec { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 12px 32px; padding: 26px 0; border-bottom: 1px solid var(--rule); }
.tk-head { display: flex; gap: 12px; align-items: baseline; align-self: start; position: sticky; top: 16px; }
.tk-head i { font: 800 italic 15px var(--font); color: var(--gold-ink); min-width: 26px; }
.tk-head h3 { margin: 0; font: 700 15px/1.3 var(--font); text-transform: uppercase; letter-spacing: .08em; }
.tk-body { display: grid; gap: 14px; min-width: 0; max-width: 820px; }
.tk-body > p { margin: 0; font-size: 16px; line-height: 1.6; }
.tk-body > .btn { justify-self: start; }

.tk-files { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.tk-file { background: var(--panel-2); padding: 12px 14px 14px; border-top: 2px solid var(--gold); display: grid; gap: 6px; align-content: start; }
.tk-file .names { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.tk-file .names a, .tk-file .names span { font: 600 14px ui-monospace, Menlo, monospace; overflow-wrap: anywhere; }
.tk-file .names a { color: var(--gold-ink); }
.tk-file .names small { font-size: 12px; color: var(--mute); margin-right: 6px; }
.tk-file .desc { font-size: 14px; line-height: 1.45; }

.tk-fields { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.tk-fields li { display: grid; grid-template-columns: 44px auto minmax(0, 1fr); gap: 4px 12px; align-items: center; padding: 2px 0; }
.tk-fields .dia { width: 44px; height: 44px; }
.tk-fields .dia::before { inset: 8px; border-color: var(--gold); }
.tk-fields .dia i { font-size: 14px; color: var(--gold-ink); }
.tk-fields code { font: 600 14px ui-monospace, Menlo, monospace; background: var(--panel-2); padding: 2px 8px; }
.tk-fields span:last-child { font-size: 15px; }

.tk-example { margin: 0; background: var(--panel-2); border-left: 4px solid var(--gold); padding: 12px 16px 14px; }
.tk-example figcaption { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--gold-ink); margin-bottom: 6px; }
.tk-example p { margin: 4px 0 0; font-size: 15px; }
.tk-example p + p { font: 600 14px ui-monospace, Menlo, monospace; }
.tk-example pre { margin: 0; font: 14px/1.55 ui-monospace, Menlo, monospace; white-space: pre-wrap; }

.tk-callout { padding: 12px 16px; font-size: 15px; line-height: 1.55; }
.tk-callout.warn { background: rgba(142, 42, 28, .08); border-left: 4px solid var(--bad); }
.tk-callout.warn b { display: block; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--bad); margin-bottom: 4px; }
.tk-callout.note { background: color-mix(in srgb, var(--gold-l) 16%, transparent); border-left: 4px solid var(--gold); }

.tk-dodont { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tk-dodont > div { background: var(--panel-2); padding: 12px 16px 14px; border-top: 3px solid var(--gold); }
.tk-dodont > .dont { border-top-color: var(--bad); }
.tk-dodont b { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; }
.tk-dodont ul { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.tk-dodont li { position: relative; padding-left: 22px; font-size: 14px; line-height: 1.45; }
.tk-dodont .do li::before { content: "✓"; position: absolute; left: 0; color: var(--gold-ink); font-weight: 800; }
.tk-dodont .dont li::before { content: "×"; position: absolute; left: 2px; top: -2px; color: var(--bad); font-weight: 800; font-size: 18px; }

.tk-list, .tk-checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.tk-list li, .tk-checks li { position: relative; padding: 9px 0 9px 30px; border-bottom: 1px solid var(--rule); font-size: 15px; line-height: 1.5; }
.tk-list li::before { content: ""; position: absolute; left: 6px; top: 16px; width: 8px; height: 8px; background: var(--gold); transform: rotate(45deg); }
.tk-list li.ban::before { content: "×"; background: none; transform: none; width: auto; height: auto; top: 4px; left: 4px; color: var(--bad); font: 800 20px var(--font); }
.tk-list li.ban { font-weight: 500; }
.tk-list li.sub { padding-left: 46px; }
.tk-list li.sub::before { left: 24px; width: 6px; height: 6px; background: none; border: 1px solid var(--gold-ink); }
.tk-list li.info::before { content: "→"; background: none; transform: none; width: auto; height: auto; top: 8px; left: 4px; color: var(--gold-ink); font-weight: 700; }
.tk-checks li::before { content: "✓"; position: absolute; left: 4px; top: 7px; width: 18px; height: 18px; display: grid; place-items: center;
                        background: var(--gold); color: #fff; font-size: 12px; font-weight: 800; }

.tk-scale { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 3px; }
.tk-scale .cell { background: var(--panel-2); padding: 10px 4px 8px; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.tk-scale .cell b { font: 800 italic 22px/1 var(--font); }
.tk-scale .cell span { font-size: 12px; color: var(--mute); line-height: 1.25; font-variant-numeric: tabular-nums; }
.tk-scale .cell.p10, .tk-scale .cell.p9 { background: color-mix(in srgb, var(--gold-l) 28%, transparent); }
.tk-scale .cell.p0 { background: rgba(142, 42, 28, .08); }
.tk-scale .cell.me { background: var(--gold); color: #fff; }
.tk-scale .cell.me span { color: #fff; }

.tk-closing { margin: 30px auto 0; max-width: 60ch; text-align: center; display: grid; justify-items: center; gap: 10px; }
.tk-closing .emblem { width: 38px; height: 38px; color: var(--gold-ink); }
.tk-closing p { margin: 0; font: 600 italic 20px/1.45 var(--font); }

@media (max-width: 999px) {
  .tk { padding: 4px 16px 26px; }
  .tk-sec { grid-template-columns: 1fr; }
  .tk-head { position: static; }
  .tk-dodont { grid-template-columns: 1fr; }
  .tk-scale { grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); }
}
textarea.ann { width: 100%; font: 14px/1.5 ui-monospace, Menlo, monospace; padding: 14px; border: 1px solid var(--rule); background: #fff; resize: vertical; }

/* ── цветной дым шашек (картинки — tools/make_smoke.py) ─────────────────────────
   Обёртка <i> поднимает столб при появлении, картинка внутри медленно клубится — две анимации не спорят за transform. */
.page { overflow-x: clip; }
.smoke { position: absolute; inset: 0; pointer-events: none; z-index: 0; }
.smoke .p { position: absolute; bottom: 0; display: block; transform-origin: 50% 100%;
            animation: smoke-rise 2.6s cubic-bezier(.16, .8, .24, 1) both; }
.smoke img { display: block; height: 100%; width: auto; max-width: none; transform-origin: 50% 90%;
             animation: smoke-billow 16s ease-in-out infinite alternate; }
.smoke .p:nth-child(2n) img { animation-duration: 21s; animation-direction: alternate-reverse; }
.smoke .p:nth-child(3n) img { animation-duration: 18s; }
@keyframes smoke-rise { from { opacity: 0; transform: translateY(38%) scale(.72); } 35% { opacity: 1; } }
@keyframes smoke-billow {
  0%   { transform: translateX(0) scale(1, 1) rotate(0deg); }
  50%  { transform: translateX(14px) scale(1.04, 1.07) rotate(1.2deg); }
  100% { transform: translateX(-10px) scale(1.02, 1.03) rotate(-1deg); }
}

/* Жатва: шашки по низу экрана, середина под заголовком и пламенем — реже и бледнее */
.reaping-screen > :not(.stars):not(.smoke) { position: relative; z-index: 1; }
.smoke-reap .p { height: min(92vh, 980px); bottom: -12vh; }
.smoke-reap .p1 { left: -7%; }
.smoke-reap .p2 { left: 9%; height: min(74vh, 800px); animation-delay: .25s; }
.smoke-reap .p3 { left: 40%; height: min(46vh, 520px); opacity: .55; animation-delay: .6s; }
.smoke-reap .p4 { right: 10%; height: min(80vh, 860px); animation-delay: .15s; }
.smoke-reap .p5 { right: -6%; animation-delay: .4s; }
.smoke-reap .p6 { left: 24%; height: min(38vh, 420px); opacity: .7; animation-delay: .8s; }
.smoke-reap .p3, .smoke-reap .p6 { z-index: -1; }

/* Главная: по столбу с краёв эфира */
.stage > :not(.stars):not(.smoke) { position: relative; z-index: 1; }
.smoke-stage .p { height: 115%; bottom: -18%; opacity: .9; }
.smoke-stage .p1 { left: -9%; }
.smoke-stage .p2 { right: -7%; animation-delay: .3s; }

/* Шапка испытания и табло: два столба за часами, справа, уходят за край страницы */
.lab-head.band > div:not(.smoke) { position: relative; z-index: 1; }
.smoke-band .p { height: 460px; bottom: -200px; opacity: .9; }
.smoke-band .p1 { right: 0; }
.smoke-band .p2 { right: 170px; height: 400px; bottom: -190px; opacity: .7; animation-delay: .3s; }

/* Взрыв шашек: девять столбов вырываются снизу вразнобой, за ~2,5 с стеной закрывают экран, потом стена светлеет,
   быстро уходит вверх и гаснет, без размытия (~2 с). Ставится на заставку входа и после отправки попытки; arena.js убирает его по окончании. */
.smoke-burst { position: fixed; z-index: 50; animation: burst-fade .5s ease-in 1.55s forwards; }
.smoke-burst .p { height: 112vh; bottom: -8vh; width: 24vw; animation: burst-erupt 1.25s cubic-bezier(.12, .75, .25, 1) both; }
.smoke-burst img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 0; }
.smoke-burst .p1 { left: -6%;  animation-delay: 0.21s; }
.smoke-burst .p2 { left: 5%;   animation-delay: 0.03s; height: 120vh; }
.smoke-burst .p3 { left: 16%;  animation-delay: 0.33s; }
.smoke-burst .p4 { left: 27%;  animation-delay: 0.12s;  height: 118vh; }
.smoke-burst .p5 { left: 39%;  animation-delay: 0.42s; }
.smoke-burst .p6 { left: 50%;  animation-delay: 0.00s;   height: 122vh; }
.smoke-burst .p7 { left: 61%;  animation-delay: 0.27s; }
.smoke-burst .p8 { left: 72%;  animation-delay: 0.07s; height: 118vh; }
.smoke-burst .p9 { left: 84%;  animation-delay: 0.36s; }
.smoke-burst .p:nth-child(even) { z-index: 1; }      /* розовые поверх янтарных, как на афише */
@keyframes burst-erupt {
  0%   { opacity: 0; transform: translateY(4%) scale(.22, .06); }
  12%  { opacity: 1; }
  100% { opacity: 1; transform: none; }
}
@keyframes burst-fade {
  0%   { opacity: 1; transform: none; }
  100% { opacity: 0; transform: translateY(-6%); visibility: hidden; }
}

@media (max-width: 720px) {
  .smoke-reap .p2, .smoke-reap .p6, .smoke-stage .p1 { display: none; }
  .smoke-reap .p { height: 62vh; }
  .smoke-band .p { height: 340px; bottom: -150px; } .smoke-band .p1 { right: -40px; } .smoke-band .p2 { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .smoke-burst { display: none; }
}

/* пока на входе стоит стена дыма, анимации экрана ждут (arena.js снимает класс, когда стена начинает рассеиваться) */
body.intro-hold .reaping-screen, body.intro-hold .reaping-screen * { animation-play-state: paused !important; }
body.intro-hold .flame-static { opacity: 0; }
