:root {
  color-scheme: dark;
  --bg: #000;
  --s1: #141414;
  --s2: #1f1f1f;
  --line: #2a2a2a;
  --text: #ececec;
  --muted: #9b9b9b;
  --red: #ff0000;
  --red-text: #ff4d4d;
  --ok: #46c873;
  --gray-mark: #77756f;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --ease-io: cubic-bezier(.65, 0, .35, 1);
  --spring: cubic-bezier(.34, 1.4, .64, 1);
  --head-h: 64px;
  --nav-h: 60px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--head-h) + 56px); }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.55 var(--font); -webkit-font-smoothing: antialiased; padding-bottom: calc(var(--nav-h) + var(--safe-b)); }
button, input, textarea { font: inherit; color: inherit; }
button { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .9em; color: #d0d0d0; }
code.tex { color: #d0d0d0; }
.katex { white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
[hidden] { display: none !important; }
.skip { position: absolute; left: -999px; top: 8px; background: #fff; color: #000; padding: 8px 12px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }

/* ---------- шапка и навигация ---------- */
.top { position: sticky; top: 0; z-index: 20; background: #000; border-bottom: 1px solid var(--line); }
.top-in { max-width: 860px; margin: 0 auto; height: var(--head-h); padding: 0 16px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.streak-btn { width: 46px; height: 46px; padding: 0; border: 0; background: none; border-radius: 12px; cursor: pointer; flex: none; transition: transform .2s var(--ease); }
.streak-btn:hover { transform: scale(1.06); }
.streak-btn:active { transform: scale(.96); }
.brand-txt { display: flex; flex-direction: column; min-width: 0; }
.brand-name { font-weight: 700; font-size: 18px; letter-spacing: -.01em; line-height: 1.2; }
.brand-txt small { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-top { display: none; gap: 4px; }
.nav-top a, .nav-bottom a { color: var(--muted); text-decoration: none; font-weight: 500; display: flex; align-items: center; gap: 7px; transition: color .2s; }
.nav-top a { padding: 8px 12px; border-radius: 999px; font-size: 15px; }
.nav-top a:hover, .nav-bottom a:hover { color: var(--text); }
.nav-top a[aria-current], .nav-bottom a[aria-current] { color: var(--text); }
.nav-top a[aria-current] { background: var(--s2); }
.nav-top a[aria-current]::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--red); }
.nav-bottom { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; background: #000; border-top: 1px solid var(--line); height: calc(var(--nav-h) + var(--safe-b)); padding-bottom: var(--safe-b); }
.nav-bottom a { flex: 1; flex-direction: column; justify-content: center; gap: 5px; font-size: 12.5px; }
.nav-bottom a::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: transparent; transition: background .2s, transform .3s var(--spring); transform: scale(.4); }
.nav-bottom a[aria-current]::before { background: var(--red); transform: scale(1); }
@media (min-width: 760px) {
  .nav-top { display: flex; }
  .nav-bottom { display: none; }
  body { padding-bottom: 0; }
}

.wrap { max-width: 760px; margin: 0 auto; padding: 24px 16px 64px; }
.warn { max-width: 760px; margin: 12px auto 0; padding: 10px 16px; color: var(--muted); font-size: 14px; border-left: 2px solid var(--red); }
.page-head h1 { font-size: clamp(30px, 7vw, 42px); line-height: 1.08; letter-spacing: -.025em; margin: 8px 0 12px; font-weight: 700; }
.lead { color: var(--muted); margin: 0 0 28px; max-width: 36em; }
.note-line { color: var(--muted); font-size: 14px; margin: 14px 0; }
.empty { border: 1px dashed var(--line); border-radius: 12px; padding: 20px; margin: 8px 0 20px; }
.empty h2 { margin: 0 0 6px; font-size: 18px; }
.empty p { margin: 0; color: var(--muted); }

/* появление разделов */
main > section:not([hidden]) { animation: viewIn .45s var(--ease); }
@keyframes viewIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- кнопки, списки ---------- */
.btn { padding: 14px 18px; border-radius: 12px; font-size: 16px; font-weight: 600; cursor: pointer; border: 1px solid var(--line); background: none; transition: background-color .2s, border-color .2s, transform .15s var(--ease); }
.btn:active { transform: scale(.98); }
.btn.primary { background: #f0f0f0; color: #000; border-color: #f0f0f0; }
.btn.primary:hover { background: #fff; }
.btn.ghost:hover { border-color: #555; }
.btn.big { width: 100%; margin-top: 24px; padding: 16px; font-size: 17px; }
.btn:disabled { opacity: .5; cursor: default; }
.link { background: none; border: 0; padding: 0; color: var(--red-text); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; font-size: 15px; }
.actions { display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.actions .btn { flex: 1 1 150px; }
.chev { width: 9px; height: 16px; }
.marathon { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 16px; text-align: left; background: var(--s1); border: 1px solid var(--line); border-left: 3px solid var(--red); border-radius: 12px; padding: 18px 18px 18px 16px; cursor: pointer; transition: border-color .2s; }
.marathon:hover { border-color: #444; border-left-color: var(--red); }
.row-title { display: block; font-size: 18px; font-weight: 600; line-height: 1.3; }
.row-desc { display: block; color: var(--muted); font-size: 14px; margin-top: 2px; }
.row-end { display: flex; align-items: center; gap: 10px; color: var(--muted); font-variant-numeric: tabular-nums; flex: none; transition: color .2s; }
.list-h { font-size: 15px; font-weight: 600; color: var(--muted); margin: 36px 0 8px; }
.row { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 16px; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line); padding: 16px 2px; cursor: pointer; }
.row:hover .row-end, .marathon:hover .row-end { color: var(--text); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.chip { flex: none; background: none; border: 1px solid var(--line); color: var(--muted); border-radius: 999px; padding: 7px 13px; font-size: 14px; cursor: pointer; display: flex; align-items: center; gap: 7px; white-space: nowrap; transition: color .2s, border-color .2s; }
.chip.on { color: var(--text); border-color: #555; }
.chip.on::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--red); }

/* ---------- вопрос ---------- */
.qtop { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.back { background: none; border: 0; color: var(--muted); padding: 8px 8px 8px 0; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; font-size: 15px; }
.back:hover { color: var(--text); }
.counter { color: var(--muted); font-size: 15px; font-variant-numeric: tabular-nums; }
.bar { height: 3px; background: var(--line); border-radius: 2px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--red); transition: width .5s var(--ease); }
.qmeta { color: var(--muted); font-size: 14px; margin: 22px 0 6px; }
.qtext { font-size: 21px; line-height: 1.5; margin: 0 0 22px; overflow-x: auto; overflow-y: hidden; padding: 2px 0; }
.qtext.fresh { animation: qIn .45s var(--ease); }
@keyframes qIn { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }
.qtext .katex { font-size: 1.12em; }
.opts { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 600px) { .opts { grid-template-columns: 1fr 1fr; } .opt { font-size: 20px; } }
.opt { display: flex; align-items: center; gap: 12px; text-align: left; background: var(--s1); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; min-height: 66px; font-size: 18px; cursor: pointer; overflow-x: auto; transition: border-color .25s var(--ease), background-color .25s var(--ease), opacity .3s, transform .15s var(--ease); }
.opts.fresh .opt { animation: optIn .5s var(--ease) backwards; }
.opt:nth-child(2) { animation-delay: .04s; } .opt:nth-child(3) { animation-delay: .08s; } .opt:nth-child(4) { animation-delay: .12s; }
@keyframes optIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.opt:active:not(:disabled) { transform: scale(.985); }
.opt .k { flex: none; width: 1.1em; color: #6f6f6f; font-size: 13px; }
.opt .ov { min-width: 0; }
@media (pointer: coarse) { .opt .k { display: none; } }
.opt:hover:not(:disabled) { border-color: #555; }
.opt:disabled { cursor: default; }
.opt.correct { border-color: var(--ok); background: rgba(70, 200, 115, .1); }
.opt.wrong { border-color: var(--red); background: rgba(255, 0, 0, .1); }
.opt.dim { opacity: .45; }
.verdict { min-height: 24px; margin: 14px 0 0; font-weight: 600; }
.verdict.ok { color: var(--ok); } .verdict.bad { color: var(--red-text); } .verdict.skip { color: var(--muted); font-weight: 500; }
.expl { margin: 12px 0 0; background: var(--s1); border-left: 2px solid var(--red); padding: 14px 16px; line-height: 1.85; animation: viewIn .4s var(--ease); }
.expl p { margin: 6px 0 0; }
.expl-ans { font-weight: 600; }
.expl-links { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 10px; }
.report-link { color: var(--muted); font-size: 14px; margin-top: 10px; }
.expl-links .report-link { margin-top: 0; }
.score { font-size: 64px; font-weight: 700; letter-spacing: -.03em; line-height: 1; margin: 20px 0 8px; font-variant-numeric: tabular-nums; }
.score span { font-size: 26px; color: var(--muted); font-weight: 500; letter-spacing: 0; margin-left: 8px; }
.bd { margin: 24px 0 8px; }
.bd-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.bd-row b { font-weight: 500; } .bd-row span { color: var(--muted); }
.bd-bar { grid-column: 1 / -1; height: 3px; background: var(--line); border-radius: 2px; overflow: hidden; }
.bd-bar i { display: block; height: 100%; background: var(--text); }

/* ---------- генератор ---------- */
.modes { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 600px) { .modes { grid-template-columns: 1fr 1fr; } }
.mode { text-align: left; background: var(--s1); border: 1px solid var(--line); border-radius: 12px; padding: 16px; cursor: pointer; display: flex; flex-direction: column; gap: 6px; transition: border-color .25s var(--ease); }
.mode.on { border-color: #f0f0f0; }
.mode-name { font-size: 19px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.mode.on .mode-name::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--red); }
.mode-desc { color: var(--muted); font-size: 14px; }
.mode-best { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.eg-top { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; flex-wrap: wrap; }
.eg-top .link { margin-left: auto; color: var(--muted); font-size: 14px; }
.eg-score { font-variant-numeric: tabular-nums; color: var(--muted); }
.eg-score b { color: var(--text); font-size: 20px; display: inline-block; }
.eg-lvl { color: var(--muted); font-size: 14px; }
.lives { display: flex; gap: 6px; }
.lives i { width: 12px; height: 12px; border-radius: 50%; background: var(--line); transition: background .3s, transform .4s var(--spring); }
.lives i.on { background: var(--red); }
.timer i { background: var(--text); width: 100%; }
.ans-row { display: flex; gap: 10px; }
.ans { flex: 1; min-width: 0; background: var(--s1); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; font-size: 20px; outline: none; transition: border-color .2s; }
.ans:focus { border-color: #777; }
.ans.correct { border-color: var(--ok); } .ans.wrong { border-color: var(--red); }
.keys { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; }
.key { min-width: 44px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--s1); cursor: pointer; font-size: 17px; transition: border-color .2s, transform .1s; }
.key:active { transform: scale(.95); }
.preview { min-height: 30px; margin-top: 10px; font-size: 15px; }
.preview .err { color: var(--red-text); }

/* ---------- теория ---------- */
.subnav { position: sticky; top: var(--head-h); z-index: 15; background: #000; border-bottom: 1px solid var(--line); }
.subnav-in { max-width: 760px; margin: 0 auto; display: flex; gap: 6px; overflow-x: auto; padding: 10px 16px; scrollbar-width: none; }
.subnav-in::-webkit-scrollbar { display: none; }
.tsec { scroll-margin-top: calc(var(--head-h) + 60px); margin-bottom: 56px; }
.tsec h2 { font-size: 28px; line-height: 1.15; letter-spacing: -.02em; margin: 8px 0 12px; font-weight: 700; }
.tsec h3 { font-size: 18px; font-weight: 600; margin: 28px 0 8px; }
.tsec p, .tsec li { line-height: 1.75; max-width: 40em; }
.tsec ul, .tsec ol { padding-left: 1.2em; }
.tsec li { margin: 6px 0; }
.note { border-left: 2px solid var(--red); padding: 2px 0 2px 14px; margin: 18px 0; }
.katex-display { margin: 16px 0; overflow-x: auto; overflow-y: hidden; padding: 4px 0; }
.dg { display: grid; grid-template-columns: 1fr; column-gap: 24px; margin: 12px 0; }
@media (min-width: 600px) { .dg { grid-template-columns: 1fr 1fr; } }
.dg > div { padding: 10px 2px; border-bottom: 1px solid var(--line); overflow-x: auto; overflow-y: hidden; }
.tw { overflow-x: auto; margin: 12px 0; }
.tbl { border-collapse: collapse; width: 100%; min-width: 340px; }
.tbl th, .tbl td { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: center; white-space: nowrap; }
.tbl th { color: var(--muted); font-weight: 500; font-size: 14px; }
.tbl td:first-child, .tbl th:first-child { text-align: left; }
.uc { display: grid; grid-template-columns: 1fr; gap: 16px; align-items: center; margin: 16px 0 8px; }
@media (min-width: 660px) { .uc { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); } }
.uc-fig svg { display: block; width: 100%; max-width: 400px; margin: 0 auto; touch-action: manipulation; }
.ax { stroke: #3a3a3a; } .cir { fill: none; stroke: #5a5a5a; stroke-width: 1.5; }
.proj { stroke: #6a6a6a; stroke-dasharray: 4 4; } .sg { stroke: #ececec; stroke-width: 3; stroke-linecap: round; }
.rad { stroke: #ececec; stroke-width: 1.5; } .arc { fill: none; stroke: var(--red); stroke-width: 2; }
.pt { cursor: pointer; } .pt .hit { fill: transparent; } .pt .dot { fill: #8a8a8a; } .pt:hover .dot { fill: #fff; }
.pt:focus { outline: none; } .pt:focus-visible .hit { stroke: #fff; stroke-width: 1.5; }
.lbl { fill: #9b9b9b; font: 12px var(--font); } .lbl.on { fill: #fff; font-weight: 600; }
.slbl { fill: #ececec; font: 11px var(--font); } .reddot { fill: var(--red); pointer-events: none; }
.uc-angle { font-size: 22px; display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.uc-angle .muted { font-size: 15px; }
.uc-vals { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 14px 0; }
.uc-vals > div { background: var(--s1); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; min-height: 76px; }
.uc-vals .lb { display: block; color: var(--muted); font-size: 13px; margin-bottom: 4px; }
.uc-vals .vl { font-size: 19px; } .uc-vals .nd { font-size: 15px; color: var(--muted); }
.uc-step { display: flex; gap: 8px; } .uc-step .btn { flex: 1 1 0; padding: 11px 12px; font-size: 15px; font-weight: 500; }

/* ---------- графики ---------- */
.g-card { border-top: 1px solid var(--line); padding: 24px 0 32px; }
.g-card h2 { font-size: 22px; margin: 0 0 6px; letter-spacing: -.01em; }
.g-card canvas { display: block; width: 100%; margin: 12px 0; touch-action: none; border-radius: 10px; background: #070707; }
.g-legend { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.g-chip { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; cursor: pointer; font-size: 15px; }
.g-chip input { accent-color: #f0f0f0; margin: 0; }
.g-chip i { width: 18px; height: 0; border-top: 2px var(--d) var(--c); }
.g-ctl { display: flex; flex-direction: column; gap: 6px; margin: 6px 0; }
.g-ctl label { color: var(--muted); font-size: 14px; }
.g-ctl input[type=range] { width: 100%; accent-color: var(--red); height: 28px; }
.g-check { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; margin: 8px 0; cursor: pointer; }
.g-check input { accent-color: var(--red); width: 18px; height: 18px; }
.g-read { font-size: 15px; line-height: 1.9; margin: 8px 0 0; min-height: 2em; }

/* ---------- рейтинг ---------- */
.lb { list-style: none; margin: 0 0 16px; padding: 0; }
.lb-row { display: grid; grid-template-columns: 30px 40px 1fr auto auto; align-items: center; gap: 12px; padding: 10px 4px; border-bottom: 1px solid var(--line); }
.lb-row.me { background: var(--s1); border-radius: 10px; }
.lb-rank { color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; }
.lb-row:nth-child(-n+3) .lb-rank { color: var(--red-text); font-weight: 700; }
.ava { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: var(--s2); }
.ava-i { display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 600; color: var(--muted); }
.lb-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.lb-name small { display: block; color: var(--muted); font-weight: 400; font-size: 12.5px; }
.lb-streak { color: var(--muted); font-size: 13px; white-space: nowrap; }
.lb-score { font-weight: 700; font-variant-numeric: tabular-nums; min-width: 56px; text-align: right; }

/* ---------- знак серии ---------- */
.mark-svg { display: block; width: 100%; height: 100%; overflow: visible; }
.mark-svg .tile { fill: #000; }
.mark-svg .stick { fill: var(--gray-mark); transition: fill .7s var(--ease); transform-box: view-box; transform-origin: 0 0; }
.mark-svg[data-pose="bang"] .stick { fill: #fff; }
.mark-svg .dot { fill: var(--gray-mark); transition: fill .5s var(--ease); }
.mark-svg[data-pose="bang"][data-done="1"] .dot { fill: var(--red); }
.mark-svg [data-r="dg"], .mark-svg .fl, .mark-svg .ring-g { transform-box: view-box; transform-origin: 0 0; }
.mark-svg .dsq { transform-box: fill-box; transform-origin: 50% 50%; }
.mark-svg .ring-g circle { transform-box: fill-box; transform-origin: 50% 50%; }
.mark-svg .markg { transform-box: view-box; transform-origin: 320px 512px; }
.mark-svg .bnum { fill: #fff; font-family: var(--font); transform-box: fill-box; transform-origin: 50% 50%; }
.mark-svg .num { fill: #000; font-family: var(--font); transform-box: fill-box; transform-origin: 50% 50%; transition: fill .6s; }
.mark-svg[data-stage="4"] .num, .mark-svg[data-stage="5"] .num { fill: #fff; }
.mark-svg .core { opacity: 0; transform-box: fill-box; transform-origin: 50% 70%; transition: opacity .6s var(--ease); }
.mark-svg[data-stage="4"] .core, .mark-svg[data-stage="5"] .core { opacity: 1; }
.mark-svg .f-side, .mark-svg .f-top { opacity: 0; transition: opacity .6s var(--ease); }
.mark-svg[data-stage="3"] .f-side, .mark-svg[data-stage="4"] .f-side, .mark-svg[data-stage="5"] .f-side, .mark-svg[data-stage="5"] .f-top { opacity: 1; }
.mark-svg .wrap-b { transform-box: fill-box; transform-origin: 50% 100%; }
.mark-svg .flc { transition: filter .8s var(--ease), opacity .8s var(--ease); }
.mark-svg[data-pose="fire"][data-lit="0"] .flc, .mark-svg[data-pose="lost"] .flc { filter: grayscale(1) brightness(.8); opacity: .62; }
.mark-svg .ly { transform-box: fill-box; transform-origin: 50% 100%; }
@keyframes fk1 { 0%, 100% { transform: scale(1, 1) skewX(0); } 30% { transform: scale(1.035, 1.055) skewX(-2.5deg); } 60% { transform: scale(.975, .965) skewX(1.8deg); } }
@keyframes fk2 { 0%, 100% { transform: scale(1, 1) skewX(0); } 40% { transform: scale(1.03, .955) skewX(1.8deg); } 70% { transform: scale(.975, 1.04) skewX(-1.8deg); } }
.mark-svg .a1 { animation: fk1 1.6s ease-in-out infinite; }
.mark-svg .a2 { animation: fk2 1.25s ease-in-out infinite; }
.mark-svg .a3 { animation: fk1 1.1s ease-in-out infinite reverse; }
.mark-svg .a4 { animation: fk2 1.4s ease-in-out infinite reverse; }
.mark-svg .a5 { animation: fk2 1s ease-in-out infinite; }
.mark-svg .a6 { animation: fk1 1.3s ease-in-out infinite reverse; }

/* полноэкранная анимация */
.fx { position: fixed; inset: 0; z-index: 60; background: #000; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 24px; opacity: 0; transition: opacity .45s var(--ease); text-align: center; }
.fx.show { opacity: 1; }
.fx-mark { width: min(72vw, 340px); height: min(72vw, 340px); }
.fx-mark .tile { fill: transparent; }
.fx-title, .fx-text, .fx-btn { opacity: 0; transform: translateY(14px); transition: opacity .5s var(--ease), transform .6s var(--ease); }
.fx.texts .fx-title, .fx.texts .fx-text, .fx.texts .fx-btn { opacity: 1; transform: none; }
.fx.texts .fx-text { transition-delay: .08s; } .fx.texts .fx-btn { transition-delay: .16s; }
.fx-title { margin: 8px 0 0; font-size: 28px; letter-spacing: -.02em; min-height: 1.2em; }
.fx-text { margin: 0; color: var(--muted); max-width: 26em; min-height: 3em; }
.fx-btn { min-width: 200px; }

/* шторка (меню серии, сообщение об ошибке) */
.sheet-bd { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, .7); display: flex; align-items: flex-end; justify-content: center; opacity: 0; transition: opacity .3s var(--ease); }
.sheet-bd.show { opacity: 1; }
.sheet { width: 100%; max-width: 560px; max-height: 88vh; overflow-y: auto; background: var(--s1); border: 1px solid var(--line); border-bottom: 0; border-radius: 20px 20px 0 0; padding: 18px 20px calc(24px + var(--safe-b)); transform: translateY(40px); transition: transform .45s var(--ease); }
.sheet-bd.show .sheet { transform: none; }
@media (min-width: 760px) {
  .sheet-bd { align-items: center; }
  .sheet { border-radius: 20px; border-bottom: 1px solid var(--line); transform: translateY(16px) scale(.98); }
}
.sheet-head { display: flex; align-items: center; justify-content: space-between; }
.sheet-head h2 { margin: 0; font-size: 20px; }
.sheet-close { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: none; cursor: pointer; color: var(--muted); }
.sheet h3 { font-size: 15px; color: var(--muted); font-weight: 600; margin: 22px 0 8px; }
.sh-top { display: flex; align-items: center; gap: 16px; margin: 12px 0 18px; }
.sh-mark { width: 104px; height: 104px; flex: none; }
.sh-big { font-size: 30px; font-weight: 700; letter-spacing: -.02em; }
.sh-prog-row { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 15px; margin-bottom: 8px; }
.sh-prog .bar { height: 8px; border-radius: 4px; }
.sh-rules { margin: 0; padding-left: 1.1em; color: var(--text); font-size: 15px; }
.sh-rules li { margin: 6px 0; line-height: 1.55; }
.sh-stages { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.sh-st { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; opacity: .45; transition: opacity .3s; }
.sh-st.on { opacity: 1; }
.sh-mini { width: 54px; height: 54px; }
.sh-st b { font-size: 15px; }
.sh-st span { font-size: 11.5px; color: var(--muted); line-height: 1.25; }
.sh-debug { display: flex; flex-wrap: wrap; gap: 6px; }
.sh-debug .btn { flex: 1 1 140px; padding: 9px 10px; font-size: 14px; font-weight: 500; }
.sheet.small textarea { width: 100%; background: #0b0b0b; border: 1px solid var(--line); border-radius: 10px; padding: 12px; resize: vertical; margin-top: 6px; }
.rp-label { font-size: 14px; color: var(--muted); }
.rp-q { font-size: 14px; word-break: break-word; }

/* уведомление */
.toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + var(--safe-b) + 14px); transform: translate(-50%, 16px); background: #f0f0f0; color: #000; font-weight: 600; padding: 12px 18px; border-radius: 12px; z-index: 70; opacity: 0; transition: opacity .3s var(--ease), transform .4s var(--ease); max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (min-width: 760px) { .toast { bottom: 24px; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

/* ---------- профиль ---------- */
.top-right { display: flex; align-items: center; gap: 10px; }
.acct-btn { width: 38px; height: 38px; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: none; cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--muted); flex: none; transition: border-color .2s, transform .2s var(--ease); }
.acct-btn:hover { border-color: #555; transform: scale(1.05); }
.ava svg { width: 60%; height: 60%; }
.ava-sm { width: 36px; height: 36px; font-size: 13px; }
.ava-lg { width: 64px; height: 64px; font-size: 22px; flex: none; }
.acct-user { display: flex; align-items: center; gap: 14px; margin: 12px 0 4px; }
.acct-name { font-size: 20px; font-weight: 700; }
.tg-login { min-height: 48px; margin: 12px 0; }
.err { color: var(--red-text); }
.switch { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; margin: 6px 0 14px; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .sw { flex: none; width: 46px; height: 28px; border-radius: 999px; background: var(--line); position: relative; transition: background .25s var(--ease); margin-top: 2px; }
.switch .sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .3s var(--spring); }
.switch input:checked + .sw { background: var(--red); }
.switch input:checked + .sw::after { transform: translateX(18px); }
.switch input:focus-visible + .sw { outline: 2px solid #fff; outline-offset: 2px; }
.switch small { display: block; color: var(--muted); font-size: 13px; }

/* ---------- заморозки ---------- */
.sh-freeze { margin-top: 18px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; }
.sh-freeze-row { display: flex; justify-content: space-between; align-items: center; font-weight: 600; }
.sh-freeze p { margin: 8px 0 12px; }
.sh-freeze .btn { width: 100%; }
.sh-why { margin: 0 !important; color: var(--muted); }
.flakes { display: flex; gap: 6px; }
.flakes i { width: 12px; height: 12px; border-radius: 3px; transform: rotate(45deg); border: 1.5px solid #fff; background: transparent; }
.flakes i.on { background: #fff; }
.bar.frost i { background: #e8e8e8; }
.mark-svg[data-pose="fire"][data-frozen="1"] .flc { filter: grayscale(1) brightness(1.6) contrast(.9); opacity: .95; }
.mark-svg[data-pose="bang"][data-frozen="1"] .dot { fill: #e8e8e8; }

/* полноэкранное окно: несколько кнопок */
.fx-actions { display: flex; flex-direction: column; gap: 10px; width: min(100%, 320px); opacity: 0; transform: translateY(14px); transition: opacity .5s var(--ease), transform .6s var(--ease); pointer-events: none; }
.fx.texts .fx-actions { opacity: 1; transform: none; transition-delay: .16s; pointer-events: auto; }

/* ---------- дуэль ---------- */
.duel-entry { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 14px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; color: var(--text); text-decoration: none; transition: border-color .2s; }
.duel-entry:hover { border-color: #555; }
.duel-code { color: var(--text); letter-spacing: .12em; font-size: 1.1em; }
.duel-vs { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; margin: 12px 0 8px; }
.duel-vs .vs { color: var(--muted); font-weight: 700; }
.duel-slot { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 18px 10px; border: 1px solid var(--line); border-radius: 14px; transition: border-color .3s var(--ease); }
.duel-slot .ava { width: 56px; height: 56px; font-size: 20px; }
.duel-slot b { font-size: 16px; overflow: hidden; text-overflow: ellipsis; max-width: 100%; white-space: nowrap; }
.duel-slot span:last-child { color: var(--muted); font-size: 13px; }
.duel-slot.ready { border-color: var(--ok); }
.duel-slot.ready span:last-child { color: var(--ok); }
.empty-slot { border-style: dashed; }
.pulse { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: .5; } 50% { opacity: 1; } }
.duel-center { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 60px 0; }
.duel-spinner { width: 36px; height: 36px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--red); animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.duel-banner { color: var(--red-text); font-size: 14px; margin: 0 0 10px; }
.duel-board { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; margin-bottom: 10px; }
.duel-pl { display: flex; align-items: center; gap: 10px; min-width: 0; }
.duel-pl.right { justify-content: flex-end; text-align: right; }
.duel-pl .ava { width: 40px; height: 40px; flex: none; }
.duel-pl small { display: block; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 110px; }
.duel-pl b { display: inline-block; font-size: 26px; font-variant-numeric: tabular-nums; line-height: 1.1; }
.duel-clock { text-align: center; }
.duel-clock b { display: block; font-size: 30px; font-variant-numeric: tabular-nums; line-height: 1; }
.duel-clock small { color: var(--muted); font-size: 12px; }
.duel-bar { height: 4px; margin-bottom: 8px; }
.duel-bar i { transition: none; }
.duel-count { font-size: 96px; font-weight: 800; text-align: center; padding: 40px 0; letter-spacing: -.04em; }
.duel-q .qtext { margin-top: 18px; }
.duel-end { text-align: center; padding-top: 12px; }
.duel-end h1 { font-size: clamp(40px, 10vw, 56px); margin: 10px 0 18px; letter-spacing: -.03em; }
.duel-end.win h1 { color: #fff; }
.duel-end.lose h1 { color: var(--muted); }
.duel-final { display: flex; justify-content: center; align-items: center; gap: 22px; margin-bottom: 14px; }
.duel-final > div { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.duel-final .ava { width: 56px; height: 56px; font-size: 20px; }
.duel-final b { font-size: 44px; font-variant-numeric: tabular-nums; line-height: 1; }
.duel-final small { color: var(--muted); max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.duel-final > span { font-size: 36px; color: var(--muted); }
.duel-end.win .duel-final > div:first-child b { color: var(--red-text); }

/* ---------- статистика ---------- */
.st-sum { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 18px 0 8px; }
.st-sum div { background: var(--s1); border-radius: 12px; padding: 14px; }
.st-sum b { display: block; font-size: 26px; font-variant-numeric: tabular-nums; }
.st-sum span { color: var(--muted); font-size: 13px; }
.st-worst { margin: 0; padding-left: 1.4em; }
.st-worst li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.st-worst li { display: list-item; }
.st-worst li > span { display: inline-block; width: calc(100% - 60px); }
.st-worst li > b { float: right; color: var(--red-text); }
.st-worst small, .st-name small { display: block; color: var(--muted); font-size: 12.5px; }
.st-topic { border-bottom: 1px solid var(--line); }
.st-row { width: 100%; display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(60px, 1fr) 48px; align-items: center; gap: 12px; padding: 12px 2px; background: none; border: 0; text-align: left; cursor: pointer; }
.st-row b { text-align: right; font-variant-numeric: tabular-nums; }
.st-row.sub { cursor: default; padding-left: 14px; font-size: 14.5px; }
.st-bar { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; }
.st-bar i { display: block; height: 100%; background: var(--red); }
.st-kinds { display: none; padding-bottom: 8px; }
.st-topic.open .st-kinds { display: block; animation: viewIn .35s var(--ease); }
.acct-admin { display: block; text-align: center; text-decoration: none; margin: 10px 0; }

/* ---------- совместный огонёк ---------- */
.brand { position: relative; }
.pair-badge { position: absolute; left: 30px; top: 28px; width: 22px; height: 22px; border-radius: 50%; border: 2px solid #000; overflow: hidden; pointer-events: none; animation: viewIn .4s var(--ease); }
.pair-badge .ava { width: 100%; height: 100%; font-size: 9px; }
.seg2 { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; background: #0b0b0b; border: 1px solid var(--line); border-radius: 12px; padding: 4px; margin-bottom: 12px; }
.seg2 button { border: 0; background: none; border-radius: 9px; padding: 10px; color: var(--muted); cursor: pointer; font-weight: 600; transition: background .2s, color .2s; display: flex; align-items: center; justify-content: center; gap: 7px; }
.seg2 button.on { background: var(--s2); color: var(--text); }
.seg2 button.on::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--red); }
.pair-form { animation: viewIn .35s var(--ease); }
.pair-form .ans { font-size: 17px; }
.pair-card { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.pair-avas { display: flex; flex: none; }
.pair-avas .ava { width: 40px; height: 40px; border: 2px solid var(--s1); }
.pair-avas .ava + .ava { margin-left: -12px; }
.pair-today { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.pair-today > div { background: #0b0b0b; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.pair-today > div.ok { border-color: var(--ok); }
.pair-today span { display: block; color: var(--muted); font-size: 13px; }
.pair-today b { font-size: 16px; }
.pair-leave { color: var(--muted); font-size: 14px; }
.fx-people { display: flex; align-items: center; gap: 14px; margin-bottom: 8px; }
.ava-xl { width: 84px; height: 84px; font-size: 28px; }
.fx-plus { font-size: 30px; color: var(--red-text); font-weight: 700; }
.pair-poke { width: 100%; margin-bottom: 10px; }

/* ---------- админка ---------- */
.adm-tabs { margin-bottom: 18px; }
.adm-grid { display: grid; grid-template-columns: 1fr; gap: 12px; margin: 14px 0 6px; }
@media (min-width: 600px) { .adm-grid { grid-template-columns: 1fr 1fr; } }
.adm-f { display: flex; flex-direction: column; gap: 6px; }
.adm-f span { font-size: 14px; color: var(--muted); }
.adm-f small { color: var(--muted); font-size: 12.5px; }
.adm-f .ans { font-size: 17px; color-scheme: dark; }
.btn.danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn.danger:hover { background: #e00000; }
/* В Telegram «Назад» — системная кнопка, свою прячем */
.in-telegram .back { visibility: hidden; }

/* ---------- объявления ---------- */
.goal-wrap { max-width: 760px; margin: 10px auto 0; padding: 0 16px; }
.goal { width: 100%; display: flex; align-items: center; gap: 10px; text-align: left; background: var(--s1); border: 1px solid var(--line); border-left: 3px solid var(--red); border-radius: 12px; padding: 11px 14px; cursor: pointer; font-size: 15px; transition: border-color .2s; }
.goal:hover { border-color: #444; border-left-color: var(--red); }
.goal-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--red); flex: none; animation: pulse 1.6s ease-in-out infinite; }
.goal-txt { min-width: 0; }
.post { padding: 14px 0; border-bottom: 1px solid var(--line); }
.post h3 { margin: 6px 0 4px; font-size: 18px; color: var(--text); }
.post p { margin: 6px 0; line-height: 1.6; }
.post-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.post-goal { color: var(--red-text); font-weight: 600; }
.tag { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.goal-tag { border-color: var(--red); color: var(--red-text); }
.new-tag { background: #f0f0f0; color: #000; border-color: #f0f0f0; }
.post-text { width: 100%; background: #0b0b0b; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; resize: vertical; font-size: 16px; }
.adm-post { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.acct-news { width: 100%; margin: 6px 0 4px; }
