html,body{height:100%;overflow-x:hidden}
#stage{position:fixed;inset:0;z-index:0}#stage canvas{display:block}
#app{position:relative;z-index:1;min-height:100vh;min-height:100dvh;display:flex;flex-direction:column;pointer-events:none}
#app button,#app input,#app .panel,#app table{pointer-events:auto}
header,.screen{text-align:center;padding:0 16px}header h1{margin:12px 0 0;line-height:var(--lh-h1)}
body.in-battle header,body.in-battle footer{display:none}
.panel{background:var(--c-hud-bg);border:var(--border);border-radius:var(--radius);padding:12px 16px}
.card{max-width:360px;margin:12px auto;text-align:left;background:rgba(8,5,26,.25)}
#preview{height:150px}
.row{display:flex;gap:12px;justify-content:center;margin:12px 0;align-items:center}
.muted{color:var(--c-muted)}.small{font-size:14px}
.chip{border:1px solid var(--c-cyan);border-radius:12px;padding:2px 10px}
#code{font:700 18px var(--font);text-transform:uppercase;width:5em;text-align:center;min-height:48px;background:var(--c-panel);color:var(--c-text);border:var(--border);border-radius:4px}
.brow{display:flex;align-items:center;gap:8px}.brow span{width:6.5em}.brow i{display:block;height:8px;background:var(--c-cyan);box-shadow:var(--glow-cyan)}.brow b{width:1.5em}
.brow .track{flex:1;background:var(--c-panel-2);height:8px}
.code{font-size:36px;color:var(--c-yellow);text-shadow:var(--glow-yellow);letter-spacing:.1em}
#seats{list-style:none;padding:0;display:flex;gap:12px;justify-content:center}
#seats li{border:1px dashed var(--c-muted);padding:12px 16px;border-radius:4px;min-width:5em}
#seats li.you{border:2px solid var(--c-yellow);font-weight:700}#seats li .seat-you-tag{color:var(--c-yellow)}#seats li.bot{border:1px solid var(--c-cyan)}
.error{color:var(--c-enemy);min-height:1.4em;text-align:center;margin:0}
.error:not(:empty)::before{content:"⚠ "}
footer{margin-top:auto;padding:16px;text-align:center;font-size:14px;color:var(--c-muted)}
.overlay{position:fixed;inset:0;background:var(--c-bg);z-index:10;display:flex;align-items:center;justify-content:center;text-align:center}
.overlay[hidden]{display:none}
#battle{position:fixed;inset:0;pointer-events:none}
.hud{position:absolute}.tl{top:12px;left:12px}.tc{top:8px;left:50%;transform:translateX(-50%)}.tr{top:12px;right:12px}.bl{bottom:12px;left:12px;width:260px}.bc{bottom:12px;left:50%;transform:translateX(-50%);min-height:24px}.br{bottom:12px;right:12px;background:var(--c-hud-bg);border:var(--border)}
.bcc{top:35%;left:0;right:0;text-align:center;font-size:96px;font-weight:700;color:var(--c-yellow);text-shadow:var(--glow-yellow)}
.timer{font-size:var(--fs-timer);font-weight:700;color:var(--c-yellow);text-shadow:var(--glow-yellow)}
.timer.blink{animation:bl 1s steps(1) infinite}@keyframes bl{50%{opacity:.3}}
#mini{margin:0;padding:0 0 0 1.4em}#mini li{max-width:15em;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#nick{font:600 16px var(--font);width:11em;min-height:48px;padding:0 10px;background:var(--c-panel);color:var(--c-text);border:var(--border);border-radius:4px}
#rows td:nth-child(2),#seats li{max-width:14em;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}#mini li.me{background:var(--c-panel-2)}
.bar{height:10px;background:var(--c-panel-2);margin:4px 0}.bar i{display:block;height:100%;background:var(--c-hp);width:100%}
.cd{position:relative;width:120px;height:48px;border:1px solid var(--c-hud-edge);display:flex;align-items:center;justify-content:center;overflow:hidden;border-radius:4px}
.cd i{position:absolute;left:0;right:0;bottom:0;background:rgba(46,230,214,.45);height:0}.cd span{position:relative}
#cdr.ready{border-color:var(--c-yellow)}#cdr.is-illegal{animation:sh .25s}@keyframes sh{25%{transform:translateX(-4px)}75%{transform:translateX(4px)}}
@media (prefers-reduced-motion:reduce){.timer.blink,#cdr.is-illegal{animation:none}}
#results table{border-collapse:collapse;margin:12px auto;min-width:300px}#results td,#results th{padding:6px 12px;text-align:left}
tr.me{outline:3px solid var(--c-yellow);box-shadow:var(--glow-yellow)}
body.in-battle{cursor:crosshair}

/* touch controls (T-0035): shown only on devices with a touch screen */
.tbtn{display:none}
body.in-battle{overscroll-behavior:none}
body.in-battle,body.in-battle #stage,body.in-battle #battle{touch-action:none;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none;-webkit-tap-highlight-color:transparent}
body.in-battle{overflow:hidden;position:fixed;width:100%}
body.touch #battle:not([hidden]) .tbtn{display:flex;position:absolute;width:76px;height:76px;min-width:64px;min-height:64px;border-radius:50%;align-items:center;justify-content:center;pointer-events:auto;touch-action:none;overflow:hidden;font:700 14px var(--font);color:var(--c-text);background:var(--c-hud-bg);border:2px solid var(--c-hud-edge);padding:0;z-index:5}
body.touch .tabil{width:64px;height:64px;right:calc(118px + env(safe-area-inset-right));bottom:calc(130px + env(safe-area-inset-bottom))}
.tbtn.down{background:var(--c-panel-2)}.tbtn.ready{border-color:var(--c-yellow)}
.tbtn i{position:absolute;left:0;right:0;bottom:0;background:rgba(46,230,214,.45);height:0}.tbtn span{position:relative}
body.touch .hud.tl{top:calc(8px + env(safe-area-inset-top));left:calc(8px + env(safe-area-inset-left))}
body.touch .hud.tc{top:calc(6px + env(safe-area-inset-top))}
body.touch .hud.tr{top:calc(8px + env(safe-area-inset-top));right:calc(8px + env(safe-area-inset-right));font-size:12px;padding:4px 8px;max-width:34vw;overflow:hidden}
body.touch .hud.bl{bottom:calc(8px + env(safe-area-inset-bottom));left:calc(8px + env(safe-area-inset-left));width:min(170px,40vw);padding:6px 10px}
body.touch .hud.bl .row{display:none}
body.touch .hud.br{display:none}
body.touch .hud.bc{bottom:calc(70px + env(safe-area-inset-bottom));max-width:50vw}
body.touch .bcc{font-size:64px}
body.touch .timer{font-size:22px}
.hud.rot{display:none;top:calc(46px + env(safe-area-inset-top));left:50%;transform:translateX(-50%);font-size:13px;text-align:center;max-width:60vw}
@media (orientation:portrait){body.touch.in-battle .hud.rot{display:block}body.touch .hud.bl{bottom:calc(8px + env(safe-area-inset-bottom))}}

/* floating stick (T-0040) */
#stick{display:none}
body.touch #battle:not([hidden]) #stick{display:block;position:fixed;width:140px;height:140px;border-radius:50%;left:calc(16px + env(safe-area-inset-left));bottom:calc(16px + env(safe-area-inset-bottom));border:2px solid var(--c-hud-edge);background:var(--c-hud-bg);opacity:.55;pointer-events:none;z-index:4}
body.touch #stick.active{opacity:.85}
#stick i{position:absolute;left:50px;top:50px;width:40px;height:40px;border-radius:50%;background:rgba(46,230,214,.7);border:2px solid var(--c-hud-edge)}
body.touch .hud.bl{left:calc(172px + env(safe-area-inset-left))}
html,body{-webkit-touch-callout:none;-webkit-text-size-adjust:100%}
body.touch{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
/* T-0284 (OBS-0887): absolute in #app, not fixed: at the top of the page it sits where it did, and it scrolls away with the page instead of covering the garage («Try one» chips) */
.music{position:absolute;top:8px;right:8px;z-index:5;display:flex;gap:8px;align-items:center;font-size:14px}.music input[type=range]{width:90px}
body.in-battle .music{display:none}
@media (max-width:700px){.music{position:static;flex-wrap:wrap;justify-content:center;padding:8px 8px 0}}

/* controls hint (T-0042): desktop only; the battle copy fades after 5 s of fight */
.hud.bc2{bottom:96px;left:50%;transform:translateX(-50%);font-size:13px;text-align:center;white-space:nowrap}
body.touch .ctl-hint{display:none}
.hud.bc2.gone{display:none}

/* aiming stick (T-0044): floating, appears under the right thumb; radius 60 px */
#aimstick{display:none}
body.touch #battle:not([hidden]) #aimstick.active{display:block;position:fixed;width:120px;height:120px;border-radius:50%;border:2px solid var(--c-enemy);background:var(--c-hud-bg);opacity:.7;pointer-events:none;z-index:4}
#aimstick i{position:absolute;left:40px;top:40px;width:40px;height:40px;border-radius:50%;background:rgba(255,90,90,.7);border:2px solid var(--c-hud-edge)}
.touch-hint{display:none}
body.touch .touch-hint{display:block;left:calc(172px + env(safe-area-inset-left));transform:none;bottom:calc(132px + env(safe-area-inset-bottom));font-size:12px;width:min(300px,calc(100vw - 372px));white-space:normal;box-sizing:border-box}
body.touch .touch-hint.gone{display:none}

/* T-0068: visible area, no page shift, full screen button, home-screen hint */
:root{--vh:100dvh;--vw:100vw}
.fsbtn{pointer-events:auto}
#fs-battle{display:none}
body.touch #battle:not([hidden]) #fs-battle:not([hidden]){display:flex;position:absolute;top:calc(56px + env(safe-area-inset-top));left:calc(8px + env(safe-area-inset-left));width:auto;height:32px;min-width:0;min-height:0;border-radius:4px;padding:0 10px;font-size:12px;z-index:5}
#fs-battle:not([hidden]){display:flex}
.a2hs{position:fixed;left:50%;transform:translateX(-50%);bottom:calc(8px + env(safe-area-inset-bottom));z-index:8;display:flex;gap:8px;align-items:center;font-size:13px;max-width:min(560px,calc(100vw - 24px));padding:6px 10px;background:var(--c-hud-bg);border:var(--border);border-radius:var(--radius);pointer-events:auto}
.a2hs[hidden],body.in-battle .a2hs{display:none}
.a2hs .btn{min-height:32px;padding:0 10px;font-size:13px}
html.touch-root,body.touch{overscroll-behavior:none}
body.touch{position:fixed;inset:0;width:100%;height:var(--vh);overflow:hidden}
body.touch #stage{height:var(--vh);width:var(--vw)}
body.touch #app{height:var(--vh);min-height:0;overflow:hidden}
body.touch #battle{height:var(--vh);width:var(--vw)}
/* garage on a phone in landscape: two columns, nothing scrolls, nothing overlaps (T-0071): #home is flattened into the grid */
@media (max-height:520px) and (orientation:landscape){
  body.touch #app{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);grid-template-rows:auto auto auto auto auto minmax(0,1fr) auto auto;column-gap:8px;padding:0 calc(8px + env(safe-area-inset-right)) 0 calc(8px + env(safe-area-inset-left))}
  /* hotfix 21.11: rules that set `display` must not beat `[hidden]` and `body.in-battle header{display:none}` */
  body.touch:not(.in-battle) header{grid-column:1/3;grid-row:1;display:flex;gap:12px;align-items:baseline;justify-content:center;padding:0}
  body.touch header h1{font-size:20px;margin:2px 0}
  body.touch #home:not([hidden]){display:contents}
  body.touch #home>.muted:first-child,body.touch #home .ctl-hint,body.touch #home .glow{display:none}
  body.touch #home .card{grid-column:1;grid-row:2/8;align-self:start;margin:0;padding:4px 10px;max-width:none;width:100%;box-sizing:border-box;font-size:12px}
  body.touch #home .card p{margin:1px 0}
  body.touch #preview{height:40px}
  body.touch #home h2{font-size:15px;margin:1px 0}
  body.touch #home .card .btn{min-height:32px}
  body.touch #home .row{grid-column:2;margin:4px 0;flex-wrap:wrap;gap:6px}
  body.touch #home .row:nth-of-type(1){grid-row:2}
  body.touch #home .row:nth-of-type(2){grid-row:3}
  body.touch #home .btn{min-height:40px;font-size:13px;padding:0 8px;white-space:nowrap}
  body.touch #bars .brow{font-size:11px;gap:4px}
  body.touch #bars{display:grid;grid-template-columns:1fr 1fr;gap:0 8px}
  body.touch .music{position:static;grid-column:2;grid-row:4;justify-content:center;padding:0;font-size:12px;flex-wrap:wrap;gap:4px 8px}
  body.touch .music input[type=range]{width:70px}
  body.touch .a2hs:not([hidden]){position:static;transform:none;grid-column:2;grid-row:5;justify-self:stretch;max-width:none;padding:2px 8px;font-size:12px}
  body.touch .a2hs .btn{min-height:28px}
  body.touch .error{grid-column:1/3;grid-row:7;min-height:0}
  body.touch footer{grid-column:1/3;grid-row:8;padding:2px 0 calc(2px + env(safe-area-inset-bottom));font-size:11px}
  body.touch #lobby,body.touch #results{grid-column:1/3;grid-row:2/7;overflow:hidden;font-size:13px;padding:0}
  body.touch #lobby h2,body.touch #results h2{margin:2px 0;font-size:18px}
  body.touch #results table{margin:4px auto}body.touch #results td,body.touch #results th{padding:2px 10px}
}
/* T-0071: `[hidden]` must win over the touch button rule (full screen button was shown on iPhone, where there is no API) */
body.touch .tbtn[hidden],.fsbtn[hidden]{display:none!important}
/* in-battle menu (T-0038) */
.menubtn{top:8px;left:calc(50% + 48px);width:48px;height:48px;min-width:48px;min-height:48px;font:700 24px var(--font);color:var(--c-text);background:var(--c-hud-bg);border:var(--border);border-radius:var(--radius);pointer-events:auto;cursor:pointer;z-index:6;padding:0}
body.touch .menubtn{top:calc(4px + env(safe-area-inset-top))}
.menubtn:focus-visible,.menu button:focus-visible,.menu input:focus-visible{outline:3px solid var(--c-yellow);outline-offset:2px}
.menu{position:fixed;inset:0;z-index:20;background:rgba(8,5,26,.55);display:flex;align-items:center;justify-content:center;pointer-events:auto;touch-action:auto}
.menu[hidden]{display:none}
.menu-box{max-width:360px;width:calc(100% - 32px);max-height:92vh;max-height:92dvh;overflow:auto;text-align:center;background:rgba(8,5,26,.8)}
.menu-box h2{margin:4px 0 8px}
.menu-live{margin:0;color:var(--c-yellow);font-weight:700}
.menu-list{display:flex;flex-direction:column;gap:8px}
.menu-list .btn{min-height:48px}
.menu-sub{text-align:left;display:flex;flex-direction:column;gap:6px;padding:4px 8px;font-size:14px}
.menu-sub label{min-height:32px;display:flex;align-items:center;gap:8px}
.touch-help{display:none}body.touch .touch-help{display:block}body.touch .mouse-help{display:none}
.code2{color:var(--c-yellow);font-size:24px;letter-spacing:.1em}
@media (max-height:480px){.menu-box{padding:8px 12px}.menu-list{gap:4px}.menu-list .btn{min-height:44px}.menu-box h2{display:none}}

.connlost{position:absolute;inset:0;z-index:50;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:16px;background:#000a;color:#fff;font-size:22px;text-align:center}.connlost[hidden]{display:none}

/* replay (T-0077) */
.replay-bar{position:fixed;left:50%;bottom:12px;transform:translateX(-50%);display:flex;gap:8px;align-items:center;z-index:30;max-width:96vw}
.replay-bar input[type=range]{width:min(40vw,360px)}
body.replay .ctl-hint,body.replay .menubtn,body.replay .tabil,body.replay .touch-hint,body.replay .rot,body.replay .bl{display:none!important}

/* owner 24.11: «экран красным не мигает, когда мало хп». The gradient reached its full colour at 130 % of the corner distance, so the
   middle of an edge got 15 % of it: nothing to see. closest-side puts the full colour on the edges themselves (GAME-DESIGN §15.2:
   inner 60 % clear, the edge red), the corners stay red. */
#low-hp-vignette{position:fixed;inset:0;pointer-events:none;opacity:0;z-index:5;background:radial-gradient(ellipse closest-side at center,transparent 60%,#FF2A4D 100%);box-shadow:inset 0 0 0 0 transparent}
html[data-low-hp=static] #low-hp-vignette{box-shadow:inset 0 0 0 6px #FF2A4D}

#death-replay{position:fixed;inset:0;pointer-events:none;z-index:6}
#death-replay[hidden]{display:none}
#death-replay .dr-frame{position:absolute;inset:8px;border:2px solid #FF2A4D;border-radius:6px;color:#FF2A4D;font:700 14px/1 monospace;letter-spacing:.2em;padding:8px 12px}
#death-replay .dr-plate{position:absolute;left:50%;bottom:14%;transform:translateX(-50%);display:flex;gap:10px;align-items:center;padding:8px 16px;background:#000c;border:1px solid #FF2A4D;border-radius:8px;color:#fff;font:600 16px/1.2 system-ui,sans-serif}
#death-replay .dr-icon{display:inline-flex;color:#FF2A4D}

/* T-0127: garage on desktop — describe panel (DESIGN.md §14) */
.garage{display:grid;grid-template-columns:480px 616px;gap:24px;max-width:1120px;margin:8px auto;justify-content:center;align-items:start}
.garage .card{max-width:none;margin:0}
.garage:not(.has-gen){grid-template-columns:560px}
.garage .card #preview{height:150px}
.garage .card .brow{margin:4px 0;min-height:20px}
.garage .card h2{margin:4px 0}.garage .card p{margin:4px 0}
.garage:not(.has-gen) .card #preview{height:200px}
#textgen.textgen{text-align:left;border-top:2px solid var(--gen-panel-edge);box-shadow:0 -4px 14px rgba(255,63,208,.25),var(--glow-cyan);padding:var(--s4)}
#textgen[hidden]{display:none}
#textgen h2{font-size:var(--fs-h2);margin:0 0 var(--s2);text-shadow:0 0 10px rgba(255,63,208,.5)}
.gen-privacy{color:var(--c-muted);font-size:.85em;margin:var(--s2) 0 0}
.gen-hint{color:var(--c-muted);margin:0 0 var(--s3)}
.gen-row{display:flex;gap:var(--s3);align-items:stretch}
.gen-field{position:relative;flex:1;min-width:0}
#gen-text{appearance:none;-webkit-appearance:none;box-sizing:border-box;width:100%;height:var(--gen-field-h);background:var(--gen-field-bg);color:var(--c-text);font:18px var(--font);border:2px solid var(--gen-field-border);border-radius:var(--radius);padding:0 76px 0 var(--s4);caret-color:var(--c-yellow);outline:none}
#gen-text::placeholder{color:var(--c-muted);opacity:1}
#gen-text:focus{border-color:var(--gen-field-border-focus);box-shadow:var(--gen-field-glow-focus)}
#gen-text:focus-visible{outline:var(--focus);outline-offset:2px}
#gen-text:disabled,#gen-text:read-only{opacity:.7}
#gen-text.is-illegal{animation:gen-shake .25s}
#gen-text[data-state=refused]{border-color:var(--c-enemy)}
#gen-text.is-blocked,#gen-text:disabled.is-blocked{border-style:dashed;border-color:var(--c-enemy)}
.gen-count{position:absolute;right:var(--s3);top:50%;transform:translateY(-50%);color:var(--c-muted);font-size:16px;pointer-events:none}
.gen-count.is-warn{color:var(--c-yellow)}.gen-count.is-max{color:var(--c-enemy)}
#gen-go{height:var(--gen-field-h);min-width:160px;white-space:nowrap}
#gen-go:disabled{opacity:.45;box-shadow:none;cursor:not-allowed}
#gen-go.is-spinning #gen-go-label::before{content:"";display:inline-block;width:12px;height:12px;margin-right:6px;border:2px solid var(--c-ink);border-top-color:transparent;border-radius:50%;animation:gen-spin .8s linear infinite;vertical-align:-1px}
.gen-bar{height:3px;background:rgba(255,79,122,.25);margin-top:2px}.gen-bar i{display:block;height:100%;background:var(--c-enemy);width:100%}
.gen-chips{display:flex;flex-wrap:wrap;gap:var(--s2);align-items:center;margin:var(--s3) 0 var(--s2)}
.gen-chips[hidden]{display:none}
.gen-try{color:var(--c-muted)}
.gen-chips button{min-height:var(--gen-chip-h);background:var(--c-panel-2);color:var(--c-text);border:1px solid var(--c-cyan);border-radius:var(--radius);font:16px var(--font);padding:0 var(--s3);cursor:pointer}
.gen-chips button:hover,.gen-chips button:focus-visible,.gen-chips button[aria-pressed=true]{border-color:var(--c-yellow)}
.gen-chips button:focus-visible{outline:var(--focus);outline-offset:2px}
.gen-chips button b{margin-right:6px;color:var(--c-cyan)}
.gen-msg{min-height:24px;margin:var(--s2) 0;font-size:16px;color:var(--c-muted)}
.gen-msg[data-tone=refusal]{color:var(--c-enemy)}.gen-msg[data-tone=ok]{color:var(--c-hp)}.gen-msg[data-tone=info]{color:var(--c-text)}
.gen-result{background:var(--c-panel-2);padding:var(--s2) var(--s3);border-radius:var(--radius);font-size:16px}
.gen-result .gen-unused{color:var(--c-muted)}
/* owner 26.11: «Random car» stands beside «Create car» in the describe row */
.gen-row #gen-go{min-width:0;padding:0 14px}.gen-row #gen{height:var(--gen-field-h);min-height:var(--gen-field-h);width:auto;min-width:0;padding:0 14px;white-space:nowrap;margin:0}
.garage.has-gen #gen{background:transparent;color:var(--c-cyan);border:1px solid var(--c-cyan);box-shadow:none;min-height:48px}
.garage.has-gen.is-daily #gen{background:var(--c-magenta);color:var(--c-ink);border:0;box-shadow:var(--glow-magenta)}
.garage:not(.has-gen) #gen{min-height:56px;width:100%}
#preview.is-working{opacity:.5;outline:2px dashed var(--c-cyan);outline-offset:-4px}
#preview.is-ready{outline:2px solid var(--c-magenta);outline-offset:-4px}
@keyframes gen-shake{25%{transform:translateX(-6px)}75%{transform:translateX(6px)}}
@keyframes gen-spin{to{transform:rotate(360deg)}}
@keyframes gen-pulse{50%{box-shadow:0 0 18px var(--c-magenta)}}
@media (prefers-reduced-motion:reduce){#gen-text.is-illegal,#gen-go.is-spinning #gen-go-label::before,#preview.is-ready{animation:none}}
@media (max-width:1099px){.garage{grid-template-columns:minmax(0,560px)}}
@media (pointer:coarse) and (orientation:landscape) and (max-height:480px){.garage,.garage.has-gen{display:contents}body.touch #textgen{grid-column:1}}
.gen-count.is-max::after{content:" max"}
/* T-0190: opponent brief — weapon / ability icons and class label (tokens of «Neon vector») */
.ob{display:inline-flex;gap:4px;align-items:center;vertical-align:middle;color:var(--c-cyan)}.ob-a{color:var(--c-yellow)}.ob-l{font-size:.85em;opacity:.85;color:var(--c-text)}
#mini li{max-width:24em}/* owner 23.11: the car description is the last cell of the row (to the right), not a second row: the table stays low */
#rows td.desc{font-size:.9em;opacity:.9;width:30em;max-width:30em;white-space:normal;line-height:1.25}#rows .desc-in{display:flex;gap:10px;align-items:center}
/* T-0250 (DESIGN §14.8): nick in the car card, full screen with an icon and a first-visit hint, music pending, ranks */
.nickbox{margin:6px 0 10px}
.nick-lbl{display:block;font-size:14px;color:var(--c-muted);margin-bottom:4px}
.nick-row{display:flex;gap:8px;align-items:center}
#nick{font:600 18px var(--font);width:300px;max-width:100%;min-height:48px;padding:0 10px;background:var(--c-bg,var(--c-panel));color:var(--c-text);border:2px solid var(--c-cyan);border-radius:4px;appearance:none}
#nick:focus{border-color:var(--c-yellow);outline:none}
#nick::placeholder{font-style:italic;color:var(--c-muted);opacity:1}
#nick.is-illegal{border-color:var(--c-enemy,#ff4d6d)}
.nick-hint{margin:4px 0 0;color:var(--c-muted);font-size:13px}
.fswrap{position:relative;display:inline-flex}
.btn--fs{display:inline-flex;align-items:center;gap:10px;min-height:48px;padding:0 18px;font:700 18px var(--font);color:var(--c-text);background:var(--c-panel);border:2px solid var(--c-cyan);border-radius:4px;cursor:pointer}
.btn--fs:hover,.btn--fs:focus-visible{background:var(--c-panel-2)}
body[data-fullscreen=on] .btn--fs{border-color:var(--c-yellow)}
.fs-ico{display:inline-block;width:20px;height:20px;flex:none;background:
 linear-gradient(currentColor,currentColor) 0 0/7px 2.5px,linear-gradient(currentColor,currentColor) 0 0/2.5px 7px,
 linear-gradient(currentColor,currentColor) 100% 0/7px 2.5px,linear-gradient(currentColor,currentColor) 100% 0/2.5px 7px,
 linear-gradient(currentColor,currentColor) 0 100%/7px 2.5px,linear-gradient(currentColor,currentColor) 0 100%/2.5px 7px,
 linear-gradient(currentColor,currentColor) 100% 100%/7px 2.5px,linear-gradient(currentColor,currentColor) 100% 100%/2.5px 7px;background-repeat:no-repeat}
body[data-fullscreen=on] .fs-ico{transform:scale(.8);outline:2px dashed currentColor;outline-offset:-9px}
#fs-battle{display:inline-flex;align-items:center;gap:6px;min-height:44px;font-size:16px}
.fs-hint{position:absolute;top:calc(100% + 10px);right:0;width:240px;padding:8px 28px 8px 10px;background:var(--c-panel-2,var(--c-panel));border:2px solid var(--c-yellow);border-radius:4px;font-size:14px;line-height:1.3;color:var(--c-text);pointer-events:none;z-index:4}
.fs-hint::after{content:"";position:absolute;bottom:100%;right:40px;border:8px solid transparent;border-bottom-color:var(--c-yellow)}
@media (min-width:1480px){.fs-hint{top:50%;left:calc(100% + 12px);right:auto;width:228px;box-sizing:border-box;transform:translateY(-50%)}.fs-hint::after{bottom:auto;top:50%;right:100%;margin-top:-8px;border-color:transparent;border-right-color:var(--c-yellow)}}
.fs-hint[hidden]{display:none}
.fs-hint-x{position:absolute;top:2px;right:4px;pointer-events:auto;background:none;border:0;color:var(--c-muted);font-size:14px;cursor:pointer}
.music-pending{font-size:13px;color:var(--c-yellow);border:1px dashed var(--c-yellow);border-radius:4px;padding:2px 6px}
.music-pending[hidden]{display:none}
#music-on[data-state=pending]{outline:2px dashed var(--c-yellow);outline-offset:2px}
#mini{list-style:none;padding-left:0}
#mini li{display:flex;gap:6px;align-items:center}
#mini .rk{flex:none;min-width:1.8em;color:var(--c-muted);font-variant-numeric:tabular-nums}
#mini .nm{flex:0 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.battle-row{justify-content:center;margin:4px 0 10px}
/* owner 24.11: the stats help inside the car card */
/* owner 26.11: a small button and a window of the same look as «How to play», not text at the bottom of the card */
.stats-help-row{margin:4px 0 6px;text-align:left}
.stats-help-btn{position:relative;min-height:32px;padding:0 10px;background:transparent;border:1.5px solid var(--c-cyan);border-radius:var(--radius);color:var(--c-cyan);font:600 14px var(--font);cursor:pointer}
/* T-0482, DESIGN §33.5 item 3: tap box 44 px (32 + 6 + 6) without a bigger look; no layout change */
.stats-help-btn::after{content:"";position:absolute;left:0;right:0;top:-6px;bottom:-6px}
.stats-help-btn:hover,.stats-help-btn:focus-visible,.stats-help-btn[aria-expanded=true]{background:var(--c-cyan);color:var(--c-ink)}
#stats-help{position:absolute;top:var(--first-top,96px);left:50%;margin-left:-280px;width:560px;max-height:calc(100vh - 120px);overflow:auto;box-sizing:border-box;z-index:7;pointer-events:auto;padding:24px;
  text-align:left;background:var(--c-panel);border:2px solid var(--c-cyan);box-shadow:var(--glow-cyan);border-radius:var(--radius);font-size:15px;line-height:1.35;color:var(--c-text)}
#stats-help[hidden]{display:none}
#stats-help h2{margin:0 0 8px;font-size:var(--fs-h2);font-weight:700;line-height:28px;text-shadow:none}
#stats-help dl{display:grid;grid-template-columns:auto 1fr;gap:4px 14px;margin:8px 0}#stats-help dt{font-weight:700;color:var(--c-cyan)}#stats-help dd{margin:0}#stats-help p{margin:4px 0}#stats-help a{color:var(--c-cyan)}
.popup-x{position:absolute;top:6px;right:6px;width:44px;height:44px;padding:0;background:none;border:0;border-radius:var(--radius);color:var(--c-muted);font:400 20px var(--font);cursor:pointer}
@media (prefers-reduced-motion:no-preference){#stats-help:not([hidden]){animation:first-in .16s ease-out}}
/* owner 24.11: the list of open rooms in the garage */
.open-rooms{max-width:1120px;margin:8px auto;padding:8px 16px;text-align:left;display:flex;gap:16px;align-items:center;justify-content:space-between;flex-wrap:wrap}
.open-rooms .or-list{flex:1 1 420px;min-width:0}.open-rooms .or-code{flex:0 0 auto;margin:0}.open-rooms h3{margin:0 0 4px;font-size:16px}.open-rooms .hint{margin:0}
#open-rooms-list{list-style:none;margin:0;padding:0}#open-rooms-list li{display:flex;gap:12px;align-items:center;justify-content:space-between;padding:4px 0}
#open-rooms-list .btn{min-height:36px;padding:4px 14px}
/* owner 24.11: ready players in the lobby */
#seats li.ready{border-style:solid;border-color:var(--c-yellow);color:var(--c-yellow)}
/* T-0252: «Room so far» — the series table of a room by code, in the lobby and under the battle table */
table.series{border-collapse:collapse;margin:8px auto;font-size:.9em}table.series caption{caption-side:top;text-align:left;padding:4px 12px;color:var(--c-muted,inherit);font-weight:600}
table.series td,table.series th{padding:3px 12px;text-align:left}table.series tr.me td{font-weight:600;color:var(--c-yellow)}table.series tr.bots td{opacity:.7}
table.series td:first-child{max-width:14em;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
/* Operator 23.11 (alpha check at 1280×720): three overlaps found on the live address.
   1) the battle full-screen button stood unstyled over the score panel: it sits left of the timer now, in the HUD look
      (right of the menu button it touched the score table when a nick is long);
   2) the «REPLAY · Esc skips» label was drawn over the score panel: it is centred under the timer;
   3) the «Music: starts on first click» note pushed the sound row over the title: it hangs under the row. */
body:not(.touch) #fs-battle:not([hidden]){position:absolute;top:8px;right:calc(50% + 52px);height:48px;min-height:48px;padding:0 12px;font:700 14px var(--font);color:var(--c-text);background:var(--c-hud-bg);border:var(--border);border-radius:var(--radius);pointer-events:auto;cursor:pointer;z-index:6}
body.replay #fs-battle{display:none!important}
#death-replay .dr-frame{display:flex;justify-content:center;padding-top:66px}
@media (min-width:701px){body:not(.touch) .music-pending{position:absolute;top:100%;right:0;margin-top:4px;white-space:nowrap}}

/* ===== DESIGN §22 (owner 24.11, designer T-0283): achievements. Tokens --ach-* are in tokens.css. =====
   §22.1 badge: an inline SVG on the 24-unit grid, drawn with currentColor; the colour comes from the token of its key. */
.ach{position:relative;display:block;flex:none;width:var(--ach-badge);height:var(--ach-badge);line-height:0;color:var(--c-muted)}
.ach svg{display:block;width:100%;height:100%;overflow:visible}
.ach::after{content:"";position:absolute;inset:calc((var(--ach-badge) - var(--ach-badge-hit))/2)}/* tooltip area 28×28 */
.ach[data-ach=first_blood]{color:var(--ach-first)}.ach[data-ach=double_kill]{color:var(--ach-double)}.ach[data-ach=triple_kill]{color:var(--ach-triple)}.ach[data-ach=mad_streak]{color:var(--ach-mad)}
/* §22.2 the group stands 8 px right of the nick; the nick is cut at 150 px, the badges never shrink or wrap */
.achs{display:flex;flex:none;gap:var(--ach-gap);margin-left:8px}
#rows td.nm-cell{max-width:none;overflow:visible;white-space:nowrap}
#rows .nm-in{display:flex;align-items:center}
#rows .nm-line{display:block;flex:0 1 auto;min-width:0;max-width:150px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:700}
/* §22.6 badges pop in by turns: 0.4 s after the table, 80 ms between rows, 120 ms between badges; the slot is kept from the start */
#rows .ach{opacity:0;animation:ach-in .25s var(--ach-ease-in) calc(.4s + .08s*var(--r,0) + .12s*var(--i,0)) both}
@keyframes ach-in{from{opacity:0;scale:.6}to{opacity:1;scale:1}}
#rows tr:nth-child(2){--r:1}#rows tr:nth-child(3){--r:2}#rows tr:nth-child(4){--r:3}#rows tr:nth-child(5){--r:4}#rows tr:nth-child(6){--r:5}#rows tr:nth-child(7){--r:6}#rows tr:nth-child(8){--r:7}
#rows .ach:nth-child(2){--i:1}#rows .ach:nth-child(3){--i:2}#rows .ach:nth-child(4){--i:3}#rows .ach:nth-child(5){--i:4}
#rows.rm .ach{animation:none;opacity:1}
/* §22.3 six players and «Room so far» on one 1280×720 screen: the results screen starts with its own heading, rows are 44 px
   with 2-px gaps, the car cell holds two lines. The table is wider than the 848 px of the picture (operator 24.11): the
   car text is up to 140 characters and two lines of 380 px would cut most of it. */
body:not(.touch).on-results header{display:none}
body:not(.touch) #results h2{margin:32px 0 2px;font-size:var(--fs-h2);line-height:28px}
body:not(.touch) #results table[data-testid=results]{border-collapse:separate;border-spacing:0 2px;table-layout:fixed;width:min(1040px,100%);margin:0 auto;padding:0 2px}
body:not(.touch) #results table[data-testid=results] th{height:20px;line-height:20px;padding:0 12px;font-size:14px;color:var(--c-muted);font-weight:400}
#results table[data-testid=results] th{box-sizing:border-box}#results th.c-n{width:36px}#results th.c-nm{width:300px}#results th.c-k{width:60px}
body:not(.touch) #rows td{height:44px;padding:0 12px;background:var(--c-panel);box-sizing:border-box}
body:not(.touch) #rows td:first-child{border-radius:4px 0 0 4px}body:not(.touch) #rows td:last-child{border-radius:0 4px 4px 0}
body:not(.touch) #rows tr.me{outline:1px solid var(--c-yellow);outline-offset:-1px;box-shadow:none}body:not(.touch) #rows tr.me td{background:var(--c-panel-2)}
body:not(.touch) #rows td.desc{width:auto;max-width:none;font-size:14px;line-height:17px;opacity:1;color:var(--c-muted)}
body:not(.touch) #rows .desc-in{height:40px;overflow:hidden}
body:not(.touch) #rows .desc-t{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;line-clamp:2;overflow:hidden;text-align:left;min-width:0}
#rows .ob{flex:none}#rows .ob-l{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}/* the class label opens the car text already */
body:not(.touch) table.series{border-collapse:separate;border-spacing:0 2px;margin:4px auto 0;font-size:14px;padding:0 2px}
body:not(.touch) table.series caption{padding:0 12px;height:20px;line-height:20px}
body:not(.touch) table.series td,body:not(.touch) table.series th,body:not(.touch) #results table.series td,body:not(.touch) #results table.series th{padding:0 12px;height:22px;line-height:22px}
body:not(.touch) table.series tr.me{outline-width:1px;outline-offset:-1px;box-shadow:none}
body:not(.touch).on-results #results>.row{margin-top:10px}
/* §22.4 the plate of an own achievement: centred, top edge at y = 104, one at a time; size and letters grow with the key */
#ach-banner{--ach-c:var(--c-muted);--ab-w:320px;--ab-h:64px;--ab-fs:28px;--ach-glow:color-mix(in srgb,var(--ach-c) 30%,transparent);--ach-glow-hi:color-mix(in srgb,var(--ach-c) 60%,transparent);
  position:absolute;top:104px;left:0;right:0;margin:0 auto;z-index:6;pointer-events:none;box-sizing:border-box;width:var(--ab-w);height:var(--ab-h);padding:0 12px;
  display:flex;align-items:center;gap:12px;text-align:left;white-space:nowrap;background:var(--c-hud-bg);border:2px solid var(--ach-c);border-radius:4px}
#ach-banner[hidden]{display:none}
#ach-banner[data-head=first_blood]{--ach-c:var(--ach-first)}#ach-banner[data-head=double_kill]{--ach-c:var(--ach-double)}
#ach-banner[data-head=triple_kill]{--ach-c:var(--ach-triple);--ab-w:360px;--ab-h:72px;--ab-fs:32px}
#ach-banner[data-head=mad_streak]{--ach-c:var(--ach-mad);--ab-w:420px;--ab-h:84px;--ab-fs:40px}
.ab-badge{flex:none;display:block;width:calc(var(--ab-h)*.56);height:calc(var(--ab-h)*.56);color:var(--ach-c);line-height:0}.ab-badge svg{display:block;width:100%;height:100%}
.ab-txt{display:flex;flex-direction:column;justify-content:center;min-width:0}
.ab-name{font:700 var(--ab-fs)/1 var(--font);letter-spacing:.12em;text-transform:uppercase;color:var(--c-text)}
.ab-sub{display:flex;align-items:center;gap:6px;margin-top:3px;font:400 16px/1.15 var(--font);color:var(--c-muted)}
.ab-sub .ach{width:16px;height:16px}.ab-sub .ach::after{content:none}
.ab-ring{position:absolute;left:calc(12px + var(--ab-h)*.28);top:50%;box-sizing:border-box;width:40px;height:40px;margin:-20px 0 0 -20px;border:2px solid var(--ach-c);border-radius:50%;opacity:0}
/* frames: enter 0–0.30 s, flash 0.15–0.45 s, hold, exit from --ach-hold-end for --ach-exit; mad streak adds a glow pulse and a shake */
#ach-banner.show{animation:ach-enter var(--ach-enter) var(--ach-ease-in) both,ach-flash .3s ease-in-out .15s both,ach-exit var(--ach-exit) var(--ach-ease-out) var(--ach-hold-end) forwards}
#ach-banner.show[data-head=mad_streak]{animation:ach-enter var(--ach-enter) var(--ach-ease-in) both,ach-flash .3s ease-in-out .15s both,ach-pulse 1s linear .45s 1.55,ach-shake .25s step-end,ach-exit var(--ach-exit) var(--ach-ease-out) var(--ach-hold-end) forwards}
#ach-banner.show .ab-badge{animation:ach-bpop .3s ease-in-out .15s}
#ach-banner.show .ab-ring{animation:ach-ring .4s ease-out .15s}#ach-banner.show .ab-ring2{animation-delay:.27s}
#ach-banner.out{animation:none;opacity:0;transition:opacity .12s linear}
@keyframes ach-enter{from{opacity:0;scale:1.4}to{opacity:1;scale:1}}
@keyframes ach-flash{0%{box-shadow:0 0 0 0 transparent}50%{box-shadow:0 0 24px 0 var(--ach-glow-hi)}100%{box-shadow:0 0 8px 0 var(--ach-glow)}}
@keyframes ach-pulse{0%,100%{box-shadow:0 0 8px 0 var(--ach-glow)}50%{box-shadow:0 0 16px 0 var(--ach-glow)}}
@keyframes ach-shake{0%{translate:4px 0}25%{translate:-4px 0}50%{translate:3px 0}75%{translate:-2px 0}100%{translate:0 0}}
@keyframes ach-exit{to{opacity:0;translate:0 -12px}}
@keyframes ach-bpop{50%{scale:1.2}}
@keyframes ach-ring{from{opacity:.8;width:40px;height:40px;margin:-20px 0 0 -20px}to{opacity:0;width:128px;height:128px;margin:-64px 0 0 -64px}}
@keyframes ach-fade-in{from{opacity:0}to{opacity:1}}
@keyframes ach-fade-out{to{opacity:0}}
/* reduced motion (the system setting or the game's «Less motion»): a fade in 0.15 s, hold, a fade out 0.35 s; a fixed glow */
#ach-banner.rm{box-shadow:0 0 8px 0 var(--ach-glow)}
#ach-banner.rm.show,#ach-banner.rm.show[data-head=mad_streak]{animation:ach-fade-in .15s linear both,ach-fade-out .35s linear calc(var(--ach-hold-end) + .15s) forwards}
#ach-banner.rm.show .ab-badge{animation:none}#ach-banner.rm .ab-ring{display:none}
@media (prefers-reduced-motion:reduce){
  #rows .ach{animation:none;opacity:1}
  #ach-banner{box-shadow:0 0 8px 0 var(--ach-glow)}
  #ach-banner.show,#ach-banner.show[data-head=mad_streak]{animation:ach-fade-in .15s linear both,ach-fade-out .35s linear calc(var(--ach-hold-end) + .15s) forwards}
  #ach-banner.show .ab-badge{animation:none}#ach-banner .ab-ring{display:none}
}
/* §22.5 (owner 24.11: «Да, показывать»): what another car earned, a quiet line under the score table. 32 px high, 16 px
   text, at most two lines (the script removes the older one), no sound and no travel: it only fades in 0.15 s and out 0.35 s. */
#ach-feed{position:absolute;right:12px;top:150px;z-index:5;pointer-events:none;display:flex;flex-direction:column;align-items:flex-end;gap:4px}
#ach-feed[hidden]{display:none}
.af-line{--af-life:2s;box-sizing:border-box;height:32px;max-width:340px;padding:0 10px;display:flex;align-items:center;gap:6px;white-space:nowrap;background:var(--c-hud-bg);border:var(--border);border-radius:4px;font:400 16px/1 var(--font);color:var(--c-text);animation:ach-fade-in .15s linear both,ach-fade-out .35s linear calc(var(--af-life) - .35s) forwards}
.af-line .ach{width:16px;height:16px}.af-line .ach::after{content:none}
.af-nm{min-width:0;overflow:hidden;text-overflow:ellipsis}.af-sep{color:var(--c-muted)}.af-key{flex:none;font-weight:700;letter-spacing:.06em;text-transform:uppercase}
/* ===== DESIGN §24 (owner 24.11, designer T-0307): the «How to play» plaque over the garage, first visit only. =====
   560 × 300 at 96 px from the top, centred; not modal: no dimmed page. Tokens only. */
/* placed from the top of the page (#app is the positioned block): 96 px as in the picture, it scrolls with the page */
#first-plaque{position:absolute;top:var(--first-top,96px);left:50%;margin-left:-280px;width:560px;height:300px;box-sizing:border-box;z-index:7;pointer-events:auto;padding:24px;
  display:flex;flex-direction:column;text-align:left;background:var(--c-panel);border:2px solid var(--c-cyan);box-shadow:var(--glow-cyan);border-radius:var(--radius)}
#first-plaque[hidden]{display:none}
#first-plaque h2{margin:0;font-size:var(--fs-h2);font-weight:700;line-height:28px;color:var(--c-text);text-shadow:none}
#first-steps{list-style:none;margin:8px 0 0;padding:0}
#first-steps li{display:flex;align-items:center;gap:14px;height:36px;font-size:var(--fs-btn);color:var(--c-text);white-space:nowrap}
.first-n{flex:none;width:28px;height:28px;border-radius:50%;background:var(--c-yellow);color:var(--c-ink);font:800 18px/28px var(--font);text-align:center}
.first-garage{margin:6px 0 0;padding-top:12px;border-top:1px solid var(--c-muted);font:400 16px/20px var(--font);color:var(--c-text)}.first-garage strong{font-weight:700;color:var(--c-magenta)}
.first-row{margin-top:auto;display:flex;align-items:center;gap:16px}.first-row .btn{min-height:48px}
/* owner 26.11 («надо сделать начальное окно с правилами больше и упомянуть там кубки»): 760 wide, height by its text
   (≈ 430 px at 1280×720, never scrolls), 20-px steps, garage and cups side by side under them */
#first-plaque{width:760px;margin-left:-380px;height:auto;padding:24px 32px 20px}
#first-plaque h2{font-size:28px;line-height:34px}
#first-steps{margin-top:10px}#first-steps li{height:40px;font-size:20px}
.first-n{width:30px;height:30px;font-size:19px;line-height:30px}
.first-more{display:grid;grid-template-columns:1fr 1fr;gap:28px;margin:12px 0 0;padding-top:12px;border-top:1px solid var(--c-muted)}
.first-more .first-garage,.first-cups{margin:0;padding:0;border:0;font:400 17px/22px var(--font);color:var(--c-text)}
.first-cups strong{font-weight:700;color:var(--c-yellow)}
.first-cups-ico{float:left;margin:2px 10px 0 0;width:30px;height:30px}
body:not(:has(#cups-open:not([hidden]))) .first-cups{display:none}
body:not(:has(#cups-open:not([hidden]))) .first-more{grid-template-columns:1fr}
#first-plaque .first-row{margin-top:16px}
.first-esc{margin-left:auto;color:var(--c-muted);font-size:16px}
.first-rules{color:var(--c-cyan);font-size:16px;font-weight:700;text-decoration:underline;display:inline-flex;align-items:center;min-height:44px}
#first-close{position:absolute;top:6px;right:6px;width:44px;height:44px;min-width:44px;padding:0;background:none;border:0;border-radius:var(--radius);color:var(--c-muted);font:400 20px var(--font);cursor:pointer}
#first-plaque.is-in{animation:first-in .16s ease-out}
@keyframes first-in{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}
#first-plaque.rm{animation:none}
@media (prefers-reduced-motion:reduce){#first-plaque,#first-plaque.is-in{animation:none;transition:none}}
.first-live{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.first-links{justify-content:center;align-items:center;gap:16px}.first-open,.first-links a.btn{display:inline-flex;align-items:center;justify-content:center;min-height:44px;box-sizing:border-box;text-decoration:none}
body.touch #first-plaque,body.touch .first-open{display:none}

/* DESIGN §25: garage strip, passport card, release, hall of fame, copy by link (owner 24.11: no marks; cars look as before).
   The strip sits above the two blocks: the real car card is taller than the one in the picture, so under them it would
   be off the first screen (owner 26.11: «гараж сверху был гораздо лучше»; the T-0442 move under the blocks is undone).
   Tile sizes, borders and the four states are those of §25.4. */
:root{--g-tile-w:152px;--g-tile-h:84px;--g-draft-w:168px;--g-hall-w:136px;--g-gap:8px;--g-draft-bg:#1B0B2E;--g-err-bg:#2A0F1C;--g-new-s:.24s}
.gwrap{max-width:1120px;margin:4px auto 8px;text-align:left;pointer-events:auto}
.gwrap[hidden]{display:none}
.g-head{display:flex;justify-content:space-between;gap:16px;min-height:24px;align-items:flex-end}
.garage-intro{font-size:16px;color:var(--c-muted)}
/* owner 26.11 shot: with an empty garage the note and the intro wrapped into two lines under the «IN BATTLE» flag; the note says it for an empty garage */
.g-note:not([hidden])~.garage-intro{display:none}
/* the «IN BATTLE» flag stands 22 px above its tile: the strip row keeps that room under the head row so the flag never covers its text */
.gwrap>.g-row{margin-top:22px}#home>.gwrap{margin-bottom:0}#home>.gwrap+.garage{margin-top:4px} /* the nick field stays inside 720 (garage-nick.spec) */
@media (max-width:999px){.g-head{flex-wrap:wrap}}
.g-head .g-count{margin-left:auto}
.g-count{font-size:16px;font-weight:700;color:var(--c-text)}
.gstrip{display:flex;gap:var(--g-gap);align-items:stretch}
.g-cell{position:relative;flex:0 0 auto}
.g-cell--draft{margin-left:8px}
.g-flag{position:absolute;left:0;top:-22px;height:22px;line-height:22px;padding:0 8px;background:var(--c-yellow);color:var(--c-ink);font-size:14px;font-weight:800;border-radius:4px 4px 0 0;white-space:nowrap;z-index:1}
.g-tile{box-sizing:border-box;width:var(--g-tile-w);height:var(--g-tile-h);display:flex;align-items:center;gap:8px;padding:6px 8px;border-radius:4px;font:16px/1.25 var(--font);color:var(--c-text);text-align:left;background:var(--c-panel);border:1.5px solid var(--c-cyan);overflow:hidden}
button.g-tile{cursor:pointer}
.g-tile:focus-visible,.g-draft-pick:focus-visible,.g-draft-rel:focus-visible,.g-btn:focus-visible,.g-x:focus-visible,.g-hopen:focus-visible{outline:var(--focus);outline-offset:2px}
.g-tile.g-free{flex-direction:column;justify-content:center;gap:2px;background:none;border:2px dashed var(--c-muted);color:var(--c-muted)}
.g-tile.g-free b{font-size:18px;font-weight:700}
.g-tile[data-state=selected]{padding:3px 5px;background:var(--c-panel-2);border:4px solid var(--c-yellow);box-shadow:inset 0 0 0 3px var(--c-panel-2),inset 0 0 0 4px var(--c-yellow)}
.g-pic{flex:0 0 48px;width:48px;height:56px;display:flex;align-items:center;justify-content:center;overflow:hidden}
.g-pic canvas{max-width:100%;max-height:100%}
.g-txt{display:flex;flex-direction:column;min-width:0;flex:1 1 auto}
.g-name{font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.g-no{color:var(--c-muted);white-space:nowrap}
.g-ach{color:var(--c-text);font-weight:700;margin-left:6px}
.g-rec{white-space:nowrap;display:flex;justify-content:space-between}
.g-tile.g-draft{width:var(--g-draft-w);flex-direction:column;align-items:stretch;gap:0;padding:0;background:var(--g-draft-bg);border:2px dotted var(--c-magenta)}
.g-tile.g-draft[data-on="1"]{border-style:solid;border-width:4px;border-color:var(--c-yellow)}
.g-tile.g-draft.g-none{align-items:center;justify-content:center;background:none;border:2px dotted var(--c-muted);color:var(--c-muted)}
.g-draft-pick{flex:1 1 auto;min-height:0;display:flex;align-items:center;gap:6px;padding:2px 6px;background:none;border:0;color:var(--c-text);font:16px/1.2 var(--font);text-align:left;cursor:pointer;overflow:hidden}
.g-draft-pick .g-pic{flex-basis:36px;width:36px;height:34px}
.g-draft-w{color:var(--c-magenta);font-weight:800}
.arena-note{top:84px;left:0;right:0;text-align:center;font-size:20px;font-weight:700;color:var(--c-text);text-shadow:0 0 6px #000;pointer-events:none}
.arena-note[hidden]{display:none}
.bot-lvl{letter-spacing:-1px;color:var(--c-muted);font-size:12px;white-space:nowrap}
.g-draft-rel{flex:0 0 44px;height:44px;margin:0;border:0;border-top:1px solid var(--c-magenta);background:var(--c-magenta);color:var(--c-ink);font:700 16px var(--font);cursor:pointer}
.g-tile.g-hall{width:var(--g-hall-w);justify-content:center;font-weight:700;font-size:18px;text-align:center}
.g-lives{display:none}body.has-garage .g-lives{display:block}
.g-lives a{color:var(--c-cyan)}
.g-note{color:var(--c-text);font-weight:700;font-size:16px;white-space:nowrap}
.g-note[hidden]{display:none}
.results-passport{margin:8px auto 0;font-size:16px;font-weight:700;color:var(--c-yellow)}
.results-passport[hidden],#results-release[hidden]{display:none}
/* modals over the garage */
.gmodal{position:fixed;inset:0;z-index:30;display:flex;align-items:center;justify-content:center;background:rgba(5,3,15,.72);pointer-events:auto;text-align:left}
.gmodal[hidden]{display:none}
.g-box{position:relative;box-sizing:border-box;max-width:calc(100vw - 24px);max-height:calc(100vh - 24px);max-height:calc(100dvh - 24px);overflow:auto;padding:24px;background:var(--c-panel);border:2px solid var(--c-cyan);border-radius:4px;box-shadow:var(--glow-cyan);color:var(--c-text);font:16px/1.4 var(--font)}
.g-box h2{margin:0 0 8px;font-size:var(--fs-h2);line-height:28px;text-shadow:none}
.g-box h3{margin:12px 0 4px;font-size:18px;font-weight:700}
.g-box p{margin:4px 0}
.g-passport{width:900px;min-height:0}
.g-release{width:396px}
.g-hallbox{width:1000px;min-height:320px}
.g-copy{width:560px}
.g-copybroken{width:480px;background:var(--g-err-bg);border-color:var(--c-enemy);box-shadow:none}
.g-kicker{color:var(--c-muted);font-weight:700;margin:0 0 8px}
.g-x{position:absolute;top:8px;right:8px;width:56px;height:44px;background:var(--c-panel);border:1.5px solid var(--c-muted);border-radius:4px;color:var(--c-text);font:700 18px var(--font);cursor:pointer}
.g-cols{display:flex;gap:36px;align-items:flex-start}
.g-left{flex:0 0 380px;min-width:0}.g-right{flex:1 1 auto;min-width:0}
.g-pic--card{width:380px;height:220px;flex:none;background:var(--c-panel-2);border-radius:4px}
.g-pic--panel{width:100%;height:150px;flex:none;background:var(--c-panel-2);border-radius:4px;margin-bottom:8px}
.g-passport h2{font-size:36px;line-height:44px;margin:8px 0;overflow-wrap:anywhere}
.g-plate{display:inline-block;min-width:236px;height:52px;line-height:48px;box-sizing:border-box;padding:0 16px;border:2px solid var(--c-yellow);border-radius:4px;color:var(--c-yellow);font-size:28px;font-weight:800;text-align:center;font-variant-numeric:tabular-nums}
.g-muted{color:var(--c-muted)}
.g-desc{color:var(--c-muted);overflow-wrap:anywhere}
.g-warn,.g-err{color:var(--c-enemy);font-weight:700}
.g-err[hidden],.g-errbox[hidden],.g-confirm[hidden],.g-step[hidden]{display:none}
.g-stats{display:grid;grid-template-columns:1fr 1fr;gap:2px 16px;margin-top:8px}
.g-stat{display:flex;gap:6px;align-items:baseline;white-space:nowrap;color:var(--c-cyan)}
.g-stat b{color:var(--c-text);min-width:2ch;text-align:right}
.g-stat-n{flex:0 0 9ch}
.g-stat-b{letter-spacing:-1px;font-size:14px}.g-stat-b i{font-style:normal;opacity:.45}
.g-hist{margin:0}
.g-hrow{display:flex;justify-content:space-between;gap:16px;height:30px;align-items:center}
.g-hrow dt{color:var(--c-muted)}.g-hrow dd{margin:0;font-weight:700;font-variant-numeric:tabular-nums}
.g-achs{display:flex;flex-wrap:wrap;gap:4px 16px}
.g-actions{display:flex;flex-wrap:wrap;gap:12px;margin-top:16px}
.g-btn{min-height:48px;padding:0 24px;border-radius:4px;background:var(--c-panel);border:1.5px solid var(--c-cyan);color:var(--c-text);font:700 18px var(--font);cursor:pointer}
.g-btn[hidden]{display:none}
.g-btn:disabled{opacity:.45;cursor:default}
.g-btn--main{border-color:var(--c-yellow);border-width:2px}
.g-btn--main[data-on="1"]{background:var(--c-yellow);color:var(--c-ink);cursor:default}
.g-btn--yellow{background:var(--c-yellow);border-color:var(--c-yellow);color:var(--c-ink)}
.g-btn--danger{border-color:var(--c-enemy)}
.g-btn--sm{min-height:44px;padding:0 12px;font-size:16px}
.g-btn--off{border-style:dashed;border-color:var(--c-muted);color:var(--c-muted);cursor:default}
.g-confirm{margin-top:12px;padding:8px 12px;border:1.5px solid var(--c-enemy);border-radius:4px;background:var(--g-err-bg)}
.g-errbox{margin-top:12px;padding:12px;border:1.5px solid var(--c-enemy);border-radius:4px;background:var(--g-err-bg);color:var(--c-text)}
.g-label{display:block;margin-top:8px;color:var(--c-muted)}
.g-field{position:relative;margin:4px 0}
.g-field input{box-sizing:border-box;width:100%;height:52px;padding:0 64px 0 12px;background:var(--c-bg);border:1.5px solid var(--c-cyan);border-radius:4px;color:var(--c-text);font:700 18px var(--font)}
.g-field input:focus{outline:var(--focus);outline-offset:1px}
.g-counter{position:absolute;right:10px;top:15px;color:var(--c-muted)}
.g-choice{display:flex;flex-wrap:wrap;gap:8px;align-items:center;padding:8px 0;border-top:1px solid rgba(154,154,224,.3)}
.g-choice-t{flex:1 1 150px;min-width:0}
.g-choice .g-confirm{flex:1 1 100%;margin-top:0}
.g-hlist{display:grid;grid-template-columns:repeat(3,300px);gap:16px;margin-top:8px}
.g-hcard{box-sizing:border-box;border:1.5px solid var(--c-cyan);border-radius:4px;padding:8px;background:var(--c-panel)}
.g-hcard--pin{border:3px solid var(--c-yellow)}
.g-hopen{display:flex;gap:8px;align-items:center;width:100%;min-height:60px;background:none;border:0;color:var(--c-text);font:16px/1.25 var(--font);text-align:left;cursor:pointer;padding:0}
.g-hbtns{display:flex;gap:6px;margin-top:8px;flex-wrap:wrap}
.g-hbtns .g-btn{flex:1 1 auto;padding:0 6px}
.g-hcard .g-confirm{margin-top:8px}
@keyframes g-new{from{transform:translateY(24px);opacity:0}to{transform:none;opacity:1}}
@keyframes g-plate{0%,100%{box-shadow:0 0 0 0 var(--c-yellow)}50%{box-shadow:0 0 0 2px var(--c-yellow)}}
.g-passport.is-new{animation:g-new var(--g-new-s) ease-out 1}
.g-passport.is-new .g-plate{animation:g-plate var(--g-new-s) ease-out 1 var(--g-new-s)}
@media (prefers-reduced-motion:reduce){.g-passport.is-new,.g-passport.is-new .g-plate{animation:none}}
html[data-reduce=on] .g-passport.is-new,html[data-reduce=on] .g-passport.is-new .g-plate{animation:none}
@media (max-width:1140px){.gstrip{flex-wrap:wrap}.g-cols{flex-direction:column}.g-left{flex-basis:auto}.g-hlist{grid-template-columns:repeat(auto-fill,minmax(260px,1fr))}}
body.in-battle .gwrap,body.in-battle .gmodal{display:none}
/* DESIGN §25.2: the first screen makes room for the strip, so the nick field of the car card stays above the fold of 1280×720 */
body.has-garage:not(.touch) header p{margin:4px 0}
body.has-garage:not(.touch) #home>p.muted{margin:4px 0}
body.has-garage:not(.touch) .battle-row{margin:4px 0 6px}
body.has-garage:not(.touch) .open-rooms{margin:6px auto}

/* Cups (design/gdd/21-cups.md): working look of the daily run panel until the designer's view (T-0406) */
.daily-note{position:absolute;left:50%;top:56px;transform:translateX(-50%);padding:2px 10px;font-size:14px;font-weight:700;background:var(--c-hud-bg);border:var(--border);border-radius:var(--radius);color:var(--c-yellow);pointer-events:none}
.daily-note[data-scored="0"]{color:var(--c-text)}
.results-daily{font-weight:700;color:var(--c-yellow);max-width:1120px;margin:8px auto}
.results-daily[data-scored="0"]{color:var(--c-text)}
/* Cups page, Fighters tab (DESIGN.md §31.1–31.5, T-0416): a page of the garage screen at #cups, not a popup.
   cups-open sits left of the title (x 336–504): at x 716 of §31.1 it covered the end of «CLANKODROME» (title now 34 px, DESIGN.md §40). */
/* owner 26.11 («кнопка стоит не в тему, вообще непонятно, что там, мб нарисовать хоть кубок на ней»): «Cups» stands in the
   Play row after «Create room», with a cup drawn in the Neon-vector line and the line «Daily race · n left» under its name.
   T-0520 (owner 26.11: «передвинуть how to play в ту же строку, где основные кнопки … и выровнять»): «? How to play» leaves the
   header and stands in the Play row after «Cups», before «Full screen»: the row's 48-px height, its 12-px gap, the secondary style. */
.battle-row .row-help{min-height:48px;height:48px;padding:0 18px;white-space:nowrap}
.cups-open{display:inline-flex;align-items:center;gap:8px;min-height:48px;padding:0 12px 0 10px;background:var(--c-panel);border:2px solid var(--c-magenta);color:var(--c-text);box-shadow:var(--glow-magenta);text-align:left;cursor:pointer}
.cups-open:hover,.cups-open:focus-visible{background:var(--c-panel-2)}
.cups-open[hidden]{display:none}
.cups-ico{flex:none;fill:none;stroke:var(--c-yellow);stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;filter:drop-shadow(0 0 4px rgba(255,228,92,.7))}
.cups-lbl{display:flex;flex-direction:column;line-height:1.05}.cups-lbl b{font:700 18px var(--font)}
.cups-open-sub{font:600 14px var(--font);color:var(--c-yellow);white-space:nowrap}.cups-open-sub:empty{display:none}
.cups-what{margin:0 0 4px;font-size:16px;line-height:20px;color:var(--c-text)}
/* the cups page has its own «Back to garage»; the header button stayed in place over the Fighters tab when the page scrolled */
body:has(#cups:not([hidden])) .cups-open,body:has(#cups:not([hidden])) .row-help{display:none}
.cups-page{position:relative;max-width:1200px;margin:0 auto;padding:0 40px;text-align:left;box-sizing:border-box}
.cups-page[hidden]{display:none}
.cups-head{display:flex;align-items:baseline;gap:16px}.cups-h{margin:8px 0 4px;font-size:24px;letter-spacing:.08em;text-transform:uppercase}
.cups-tabs{display:flex;gap:8px;margin:4px 0 8px}
.cups-tab,.cups-sub{min-height:44px;min-width:120px;padding:0 16px;background:var(--c-panel);color:var(--c-text);border:1.5px solid var(--c-cyan);border-radius:6px;font:inherit;font-size:16px;cursor:pointer}
.cups-tab.is-on,.cups-sub.is-on{border:3px solid var(--c-yellow);color:var(--c-yellow);text-decoration:underline;text-underline-offset:4px;font-weight:700}
.cups-back{position:absolute;right:40px;top:8px;min-height:48px}
.cups-body{display:flex;gap:24px;align-items:flex-start}
/* translucent: the car of the day is drawn on the canvas under the page and must show through (review of T-0416) */
.daily-card{flex:0 0 420px;background:rgba(8,5,26,.25);border:1.5px solid var(--c-cyan);border-radius:8px;padding:10px 20px}
.daily-card h2{margin:0 0 6px;font-size:20px}.daily-card p{margin:3px 0}
.daily-car{height:120px;border-radius:6px;background:transparent;border:1px dashed rgba(42,230,214,.35)}
.daily-gear{font-weight:700;color:var(--c-yellow)}
.daily-attempts{font-size:24px;font-weight:800}.daily-attempts.is-spent{color:var(--c-muted)}
.daily-btns{gap:8px;justify-content:flex-start}.daily-btns .btn{min-height:48px;min-width:180px}
.is-dashed{border-style:dashed!important;opacity:.8}
.cups-practice-note{color:var(--c-yellow);font-weight:700}
.cups-note{border:1.5px dashed var(--c-cyan);border-radius:6px;padding:4px 8px}
.cups-board{flex:1 1 auto;min-width:0}
.cups-subtabs{display:flex;gap:8px;margin-bottom:8px}
.cups-period{margin:4px 0;color:var(--c-muted)}
.cups-t{width:100%;border-collapse:separate;border-spacing:0 2px;font-size:16px}
.cups-t th,.cups-t td{height:40px;padding:0 8px;text-align:right}.cups-t .c-nm{text-align:left}.cups-t .c-n{width:48px;text-align:center}
.cups-t tr.you td{font-weight:800;color:var(--c-yellow);border-top:3px solid var(--c-yellow);border-bottom:3px solid var(--c-yellow)}
.cups-t tr.you td:first-child{border-left:8px solid var(--c-yellow)}.cups-t tr.you td:last-child{border-right:3px solid var(--c-yellow)}
.cups-t tr.gap td{text-align:center;opacity:.7;height:24px}
.cups-place{display:inline-flex;align-items:center;justify-content:center;width:30px;height:30px;font-weight:800}
.cups-place--hexagon{clip-path:polygon(25% 3%,75% 3%,100% 50%,75% 97%,25% 97%,0 50%);background:var(--c-yellow);color:#0b0f1a}
.cups-place--square{border:2px solid var(--c-cyan)}
.cups-place--triangle{clip-path:polygon(50% 0,100% 100%,0 100%);background:var(--c-cyan);color:#0b0f1a;padding-top:8px;box-sizing:border-box}
.cups-review{color:var(--c-yellow)}
.cups-alert{border:2px solid var(--c-yellow);border-radius:6px;padding:6px 10px;margin:4px 0}
.cups-empty{border:1.5px dashed var(--c-cyan);border-radius:6px;padding:12px}.cups-none{color:var(--c-muted)}
.cups-result{position:fixed;left:50%;top:150px;transform:translateX(-50%);width:600px;box-sizing:border-box;background:var(--c-panel);border:2px solid var(--c-yellow);border-radius:10px;padding:16px 24px;z-index:30}
.cups-result p{margin:6px 0;font-size:18px}.cups-result b{float:right}
.cups-score{font-size:24px}.cups-score b{font-size:36px;font-weight:800}
/* Constructors tab (DESIGN.md §31.6 frame F, T-0478): night result card 420 px on the left, car ladder on the right. */
.league-result{flex:0 0 420px;box-sizing:border-box;background:rgba(8,5,26,.25);border:1.5px solid var(--c-cyan);border-radius:8px;padding:10px 16px}
.league-result h2,.car-ladder-box h2{margin:0 0 6px;font-size:20px}.league-result p{margin:3px 0}
.league-place{font-size:24px;font-weight:800;color:var(--c-yellow)}
.cups-t--cars .c-w{text-align:left;color:var(--c-muted)}.cups-t--league{table-layout:fixed}.cups-t--league .c-nm{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.cups-t--league .c-you{width:64px;white-space:nowrap}.cups-t--league th:nth-child(3){width:64px}.cups-t--league .c-n{width:44px}.cups-author{color:var(--c-muted)}.cups-t--cars tr.you .cups-author{color:inherit}
/* Car table tab (DESIGN.md §31.7 frame I, T-0489): sub-tabs, one table across the content area, rule line under it. */
.cups-t--table .c-nm{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:520px}.cups-t--table .c-you{width:64px;white-space:nowrap}
.cups-retuned{margin-left:8px;color:var(--c-muted);font-size:16px}.cups-t--cars tr.you .cups-retuned{color:inherit}
.cups-tag{display:inline-block;margin-left:8px;padding:0 8px;border:1.5px dashed var(--c-yellow);border-radius:4px;color:var(--c-yellow);font-size:16px;font-weight:400}
.cups-ok{border:2px solid var(--c-hp);border-radius:6px;padding:4px 8px;color:var(--c-hp)}
.cups-x{position:absolute;right:8px;top:8px;width:44px;height:44px;background:none;border:0;color:var(--c-text);font-size:20px;cursor:pointer}
.cups-result .row{justify-content:flex-start;gap:8px;margin-top:12px;clear:both}
/* DESIGN §30 (T-0423): sign-in entry in the garage strip, the window, the signed-in chip and its menu */
.g-row{display:flex;gap:var(--g-gap);align-items:center}.g-row>.gstrip{flex:1 1 auto;min-width:0}
.login-slot{position:relative;flex:0 0 auto}.login-slot:empty{display:none}
.login-open,.login-account{min-width:120px;min-height:44px;font-size:18px;font-weight:700;background:transparent;color:var(--c-text);border:2px solid var(--c-cyan)}
.login-account{background:var(--c-panel);border-color:var(--c-hp)}
.login-menu{position:absolute;right:0;bottom:calc(100% + 8px);width:240px;display:flex;flex-direction:column;gap:8px;padding:12px;background:var(--c-panel);border:2px solid var(--c-cyan);z-index:31;text-align:left}
.login-menu .btn{min-height:44px;background:transparent;border:2px solid var(--c-cyan);color:var(--c-text)}
.login-host{position:fixed;inset:0;z-index:32;display:flex;align-items:flex-start;justify-content:center;padding-top:110px;background:rgba(0,0,0,.55);text-align:left}.login-host[hidden]{display:none}
.login-dialog{position:relative;width:520px;max-width:calc(100vw - 32px);box-sizing:border-box;padding:24px;background:var(--c-panel);border:2px solid var(--c-cyan);box-shadow:var(--glow-cyan);border-radius:4px;display:flex;flex-direction:column;gap:10px}
.login-dialog h2{font-size:var(--fs-h2,24px);margin:0}.login-dialog p{margin:0;font-size:16px}
.login-close{position:absolute;top:8px;right:8px;width:44px;height:44px;background:transparent;border:0;color:var(--c-text);font-size:20px;cursor:pointer}
.login-dialog .btn,.login-dialog input{width:100%;min-height:48px;box-sizing:border-box}
.login-google{display:flex;align-items:center;justify-content:center;gap:10px;background:var(--c-text);color:var(--c-ink,#05030F);font-size:18px;font-weight:700;text-decoration:none}
.login-g{display:inline-flex;width:24px;height:24px;border:2px solid currentColor;border-radius:50%;align-items:center;justify-content:center;font-size:14px}
.login-or{text-align:center}
.login-dialog input{background:var(--c-bg);border:1.5px solid var(--c-muted);color:var(--c-text);font-size:16px;padding:0 12px}
.login-dialog input.login-bad{border:3px solid var(--c-enemy)}
.login-err-box{background:#2A0F1C;border:1.5px solid var(--c-enemy);padding:8px 10px;color:var(--c-text)}
.login-ok{color:var(--c-hp);font-size:18px;font-weight:700}
.login-rule{border:0;border-top:1px solid var(--c-muted);margin:4px 0;width:100%}
.login-legal a{color:var(--c-cyan);font-weight:700;text-decoration:underline;display:inline-flex;min-height:44px;align-items:center}
body.in-battle .login-host{display:none}
.login-pick{width:840px}.login-pick-cards{display:flex;gap:24px}.login-pick-card{flex:1;display:flex;flex-direction:column;gap:8px;padding:16px;border:2px solid var(--c-cyan);background:var(--c-panel-2,var(--c-panel))}
.login-delete{border-color:var(--c-enemy)!important}
.login-del{border-color:var(--c-enemy)}
.login-del-go{background:transparent;border:2px dashed var(--c-muted);color:var(--c-muted)}.login-del-go--on{background:#2A0F1C;border:3px solid var(--c-enemy);color:var(--c-text)}
.login-done{margin:0 8px 0 0;font-size:16px;color:var(--c-text)}
.login-out-here{max-width:240px;font-size:14px;line-height:1.25} /* T-0452: words carry it, no colour-only signal */
.login-pick-later{width:200px!important;background:transparent;border:2px solid var(--c-cyan);color:var(--c-text)}
@media (prefers-reduced-motion:no-preference){.login-dialog,.login-menu{animation:login-in .12s ease-out}}@keyframes login-in{from{opacity:0}to{opacity:1}}
/* T-0453: desktop challenge link page /c/<id> (DESIGN §32.3 frame B, §32.6 frame G); an overlay over the first screen, which stays as it is */
.ch-page{position:fixed;inset:0;z-index:40;background:var(--c-bg,#05030F);display:grid;grid-template-columns:560px 500px;grid-template-rows:auto 1fr;column-gap:60px;align-content:start;justify-content:center;padding:40px 80px;overflow:auto}
.ch-page[hidden]{display:none}
.ch-loading{grid-column:1/-1;margin:0} /* T-0488: the loading line before the read answers; the card replaces it */
.ch-title{grid-column:1/-1;font-size:32px;font-weight:700;margin:0 0 24px}
.ch-card{border:2px solid var(--c-cyan,#22E4FF);background:var(--c-panel,#0E0A24);padding:24px;min-height:420px;box-sizing:border-box}
.ch-name{font-size:36px;font-weight:700}
.ch-plate{display:inline-block;margin:12px 0;padding:10px 16px;border:2px solid currentColor;font-size:22px;font-weight:800}
.ch-author,.ch-muted{color:var(--c-muted,#9A96B8);font-size:16px}
.ch-kit{font-size:18px;margin-top:12px}
.ch-side{display:flex;flex-direction:column;gap:16px}
.ch-beat{width:500px;height:72px;font-size:24px;font-weight:800;background:var(--c-yellow,#FFE14D);color:#05030F;border:0;cursor:pointer}
.ch-beat:disabled{opacity:.6;cursor:default}
.ch-dead{grid-column:1/-1;justify-self:center;width:600px;min-height:340px;box-sizing:border-box;border:3px solid var(--c-enemy,#FF3B6B);background:var(--c-panel,#0E0A24);padding:32px;display:flex;flex-direction:column;gap:16px}
.ch-dead-head{font-size:24px;font-weight:700}
.ch-play{display:inline-flex;align-items:center;justify-content:center;width:300px;height:56px;background:var(--c-yellow,#FFE14D);color:#05030F;font-weight:800;text-decoration:none}
/* T-0475 (DESIGN §32.5 E1/E2, §32.6 on a phone; 390×844, margin 24, content 342): the phone view of /c/<id>; only inside .chp, the desktop rules above are untouched */
.ch-page:has(>.chp){display:block;padding:0}
.chp{box-sizing:border-box;width:100%;max-width:390px;margin:0 auto;padding:16px 24px 24px;display:flex;flex-direction:column;gap:12px;font-size:16px;-webkit-user-select:text;user-select:text}
.chp-head{font-size:24px;font-weight:800;letter-spacing:.04em}
.chp-card{box-sizing:border-box;border:1.5px solid var(--c-cyan,#22E4FF);background:var(--c-panel,#0E0A24);padding:16px 12px;display:flex;flex-direction:column;gap:6px}
.chp-name{font-size:28px;font-weight:700;overflow-wrap:anywhere}
.chp-plate{align-self:flex-start;margin:4px 0}
.chp-held{color:var(--c-yellow,#FFE14D);font-size:18px;font-weight:700}
.chp-replay{box-sizing:border-box;border:1.5px solid var(--c-muted,#8C86B5);background:var(--c-panel-2,#17123A);padding:12px;display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin-top:12px;position:relative;min-height:168px;overflow:hidden}
.chp-replay-mark{box-sizing:border-box;width:92px;height:92px;border:2px solid var(--c-text,#F2F0FF);border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:36px;position:relative;z-index:1;background:rgba(11,8,32,.55);color:var(--c-text,#F2F0FF);font-family:var(--font);cursor:pointer;padding:0}
/* T-0494 (§32.5): the clip plays on the block's muted panel, behind the control, chip and «watch full ▸» */
.chp-replay-screen{position:absolute;inset:0;pointer-events:none}
.chp-replay-canvas{display:block;width:100%;height:100%}
.chp-replay .chp-chip,.chp-replay .chp-desk{position:relative;z-index:1}
.chp-replay-mark:focus-visible{outline:var(--focus);outline-offset:2px}
.chp-chip{font-size:16px;font-weight:700}
.chp-line{font-weight:700;margin:8px 0 0}
.chp-replay-wait{margin:12px 0 0}
.chp-btn{box-sizing:border-box;display:flex;align-items:center;justify-content:center;width:100%;min-height:48px;padding:0 8px;font:700 16px var(--font);color:var(--c-text,#F2F0FF);background:transparent;border:1.5px solid var(--c-cyan,#22E4FF);border-radius:4px;text-decoration:none;cursor:pointer;text-align:center}
.chp-main{background:var(--c-yellow,#FFE14D);color:var(--c-ink,#05030F);border-color:var(--c-yellow,#FFE14D);font-size:18px}
.chp-btn[data-copied="1"]{border:3px solid var(--c-hp)}
.chp-btn:focus-visible,.chp-desk:focus-visible{outline:var(--focus);outline-offset:2px}
.chp-row{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.chp-row--full{grid-template-columns:1fr}
.chp-hint,.chp-type{margin:0}
.chp-short{margin:0;font-weight:700;overflow-wrap:anywhere}
.chp-desk{display:flex;align-items:center;min-height:44px;color:var(--c-cyan,#22E4FF);text-decoration:underline}
.chp-dead{width:auto;min-height:0;padding:20px}
.chp-foot{margin:8px 0 0}
.chp-sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
/* T-0468 (DESIGN §32.2 A1, A2): challenge button at the foot of the passport's right column (in flow, the left column is taller: nothing else moves) and the link window */
.g-chal-btn{margin-top:16px;min-width:236px}
/* T-0493 (DESIGN §31.6 frame H): the row «League» of the passport card, in the free space of the right column (no box moves) */
.g-league{box-sizing:border-box;width:100%;margin-top:8px;border-radius:4px}
.g-league p{margin:0;line-height:22px}
.g-league--in{padding:6px 12px;border:2px solid var(--c-cyan)}
.g-league .g-btn{display:block;width:100%;margin:2px 0}
.g-league-state{font-weight:700;color:var(--c-cyan)}
.g-league .g-league-reason{margin-top:4px;padding:6px 10px;border:1.5px solid var(--c-enemy);border-radius:4px;background:var(--g-err-bg);color:var(--c-text);font-size:14px;line-height:20px;font-weight:700}
.g-league-locked{margin-top:4px;padding:6px 10px;border:1.5px dashed var(--c-muted);border-radius:4px;color:var(--c-text);font-size:14px;line-height:20px;font-weight:700}
.g-league-notenough{margin-top:4px;padding:6px 10px;border:1.5px dashed var(--c-muted);border-radius:4px;font-size:14px;line-height:20px}
.g-league .g-league-notenough p{line-height:20px}
.g-league .g-league-notenough p:first-child{font-weight:700}
.g-chal{width:600px}
.g-chal-url{box-sizing:border-box;width:100%;height:52px;margin:12px 0 0;padding:0 12px;background:var(--c-panel-2);border:1.5px solid var(--c-cyan);border-radius:4px;color:var(--c-text);font:18px var(--font)}
.g-chal-url:focus-visible{outline:var(--focus);outline-offset:2px}
.g-chal-row .g-btn[data-copied="1"]{border:3px solid var(--c-hp)}
.g-chal-close{border:2px dashed var(--c-muted);color:var(--c-text)}
.g-sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
/* T-0469 (DESIGN §32.2): Share after «Close link» and the counters block at the foot of the passport's right column (in flow, appended: nothing existing moves) */
.g-chal-share{border:2px solid var(--c-cyan);color:var(--c-text);min-width:132px}
.g-chal-counters{box-sizing:border-box;width:436px;max-width:100%;margin-top:16px;padding:12px 16px;border:1.5px solid var(--c-cyan);border-radius:4px;background:var(--c-panel-2)}
.g-chal-counters h3{margin:0 0 4px}
.g-chal-counters p{margin:4px 0;font-size:16px}
/* T-0522: entry queue bar (DESIGN §34) — stands in the «Open rooms» box, which keeps its size; its content is hidden under the bar */
.open-rooms.is-queue{position:relative}
.open-rooms.is-queue>:not(.entry-queue-host){visibility:hidden}
.entry-queue-host:empty{display:none}
.entry-queue-host{position:absolute;inset:0;z-index:1}
.entry-queue{box-sizing:border-box;height:100%;display:flex;align-items:center;justify-content:space-between;gap:16px;padding:4px 16px;background:var(--c-panel-2);border:2px solid var(--c-yellow);border-radius:var(--radius);text-align:left;overflow:hidden}
.entry-queue--turn{border:3px solid var(--c-hp)}
.entry-queue--passed{border:2px dashed var(--c-orange)}
.entry-queue--full{border:2px solid var(--c-enemy)}
.entry-queue p{margin:0;font-size:16px;line-height:24px;color:var(--c-text)}
.entry-queue .eq-text{flex:1 1 auto;min-width:0}
.entry-queue .eq-row{display:flex;gap:20px;flex-wrap:wrap}
.entry-queue .eq-muted{color:var(--c-muted)}
.entry-queue .eq-pos{font-size:20px;font-weight:700;color:var(--c-yellow);font-variant-numeric:tabular-nums}
.entry-queue .eq-eta{font-size:18px;font-weight:700}
.entry-queue .eq-turn{font-size:24px;font-weight:700;color:var(--c-hp);line-height:32px}
.entry-queue .eq-title{font-size:20px;font-weight:700;line-height:32px}
.entry-queue .eq-ico{display:inline-block;width:28px;height:28px;margin-right:12px;line-height:28px;text-align:center;color:var(--c-enemy);border:2px solid var(--c-enemy);border-radius:4px;box-sizing:border-box;font-size:18px}
.entry-queue .eq-btns{display:flex;gap:16px;flex:0 0 auto}
.entry-queue .btn{min-height:48px;min-width:160px;font-size:18px}
.entry-queue .eq-leave{background:var(--c-bg);color:var(--c-text);border:2px solid var(--c-text)}
/* T-0569, DESIGN.md §37.2–§37.3: the version line and the drain line in one fixed box outside the page flow (nothing moves) */
.version-note{position:fixed;left:64px;top:8px;width:268px;max-height:112px;pointer-events:none;z-index:6;box-sizing:border-box;overflow:hidden;margin:0;background:var(--c-hud-bg);border:1px solid var(--c-hud-edge);border-left:3px solid var(--c-cyan);border-radius:4px;padding:8px 12px;font-size:16px;line-height:20px;font-weight:400;color:var(--c-text)}
.version-note.at-battle{left:12px;top:68px;width:296px;max-height:96px}
.version-note[hidden]{display:none}
/* T-0601: social links in the footer line, only when the config sets an address */
footer .social-links{pointer-events:auto}
footer .social-links a{color:inherit;margin-left:10px;text-decoration:underline;text-underline-offset:2px}
footer .social-links a:hover,footer .social-links a:focus-visible{color:var(--c-text,#fff)}
/* T-0609, DESIGN.md §38.1: the first-screen Feedback entry stands in the empty header band (24,24) 132×44; §38.3 dialog 560 wide at (360,96) */
.feedback-open{position:absolute;left:24px;top:24px;width:132px;height:44px;min-height:44px;box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:0 8px;background:var(--c-panel);border:2px solid var(--c-cyan);border-radius:4px;color:var(--c-text);font:700 16px var(--font);box-shadow:none;cursor:pointer;z-index:6}
.feedback-open:hover,.feedback-open:focus-visible{background:var(--c-panel-2)}
.feedback-ico{font-size:20px;line-height:1}
body:has(#cups:not([hidden])) .feedback-open{display:none}
#feedback-dialog{position:absolute;top:96px;left:50%;margin-left:-280px;width:560px;max-height:calc(100vh - 120px);overflow:auto;box-sizing:border-box;z-index:8;pointer-events:auto;padding:24px;background:var(--c-panel);border:2px solid var(--c-cyan);border-radius:4px;text-align:left}
#feedback-dialog[hidden]{display:none}
#feedback-dialog h2{margin:0 0 8px;font-size:24px;font-weight:700;line-height:28px;text-shadow:none}
#feedback-dialog .menu-sub{font-size:16px;padding:0}
#feedback-dialog textarea,#feedback-dialog input{font-size:16px;box-sizing:border-box;width:100%}
/* T-0658: The Tower tab of the cups page (DESIGN.md §39.2–39.4, §39.8) */
.tw{margin-top:12px}
.tw-head{display:flex;justify-content:space-between;align-items:baseline;gap:16px;min-height:48px}
.tw-head h2{margin:0;font-size:24px;font-weight:800}
.tw-body{display:grid;grid-template-columns:minmax(0,520px) minmax(0,1fr);gap:24px;margin-top:8px}
.tw-floors{display:flex;flex-direction:column;gap:2px}
.tw-floor{display:grid;grid-template-columns:44px 1fr auto auto;align-items:center;gap:12px;min-height:44px;padding:0 12px 0 0;background:var(--c-panel);color:var(--c-text);border:1.5px solid var(--c-hp);border-radius:6px;font:inherit;font-size:16px;text-align:left;cursor:pointer}
.tw-floor--current{border:3px solid var(--c-yellow);font-weight:700}
.tw-floor--locked{border:1.5px dashed var(--c-muted);color:var(--c-muted)}
.tw-floor.is-on{outline:3px solid var(--c-yellow);outline-offset:1px}
.tw-fn{font-size:24px;font-weight:800;text-align:center}
.tw-fcar{display:block;font-size:14px;font-weight:400;color:var(--c-muted)}
.tw-skel{border:1.5px dashed var(--c-muted);background:transparent;min-height:44px}
.tw-panel{display:flex;flex-direction:column;gap:8px}
.tw-ptitle{display:flex;justify-content:space-between;align-items:baseline}
.tw-ptitle h3{margin:0;font-size:24px;font-weight:800}
.tw-opps{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:9px}
.tw-opp{display:flex;flex-direction:column;gap:4px;min-height:156px;padding:8px;background:var(--c-panel);border:1.5px solid var(--c-cyan);border-radius:6px;font-size:16px}
.tw-opp.tw-skel{border-style:dashed;border-color:var(--c-muted)}
.tw-origin{font-size:14px;color:var(--c-muted)}
.tw-oname{font-weight:700;overflow-wrap:anywhere}
.tw-olevel{color:var(--c-yellow)}
.tw-picker{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.tw-pcar{display:flex;flex-direction:column;align-items:flex-start;gap:2px;min-height:88px;padding:8px;background:var(--c-panel);color:var(--c-text);border:1.5px solid var(--c-cyan);border-radius:6px;font:inherit;font-size:16px;text-align:left;cursor:pointer}
.tw-pcar.is-on{border:3px solid var(--c-yellow)}
.tw-pcar.is-dashed,.tw-car.is-dashed{border-style:dashed;color:var(--c-muted)}
.tw-carrow{display:flex;gap:16px;align-items:flex-start}
.tw-car{display:flex;flex-direction:column;justify-content:center;width:200px;min-height:80px;padding:8px;border:1.5px solid var(--c-cyan);border-radius:6px;box-sizing:border-box}
.tw-playrow{display:flex;gap:16px;align-items:center;flex-wrap:wrap}
.tw-playrow [data-testid="tower-play"]{min-width:320px;min-height:48px}
.tw-reason{margin:0}
.tw-error{border:2px solid var(--c-enemy);border-radius:6px;padding:12px;margin-top:12px}
.tw-closed,.tw-picker-empty{border:1.5px dashed var(--c-muted);border-radius:6px;padding:12px;margin-top:12px}
