/* Graveyard Shift - UI styles. System fonts only. Visual identity: industrial night shift, punch clock, sodium-lamp amber on near-black.
   Sizing: everything is in `em`; .ui sets font-size from the effective screen height so 720p..1440p scale together. */

:root {
  --bg: #050607;
  --ink: #e9e4d6;
  --ink-dim: #a9a597;
  --ink-faint: #6d6b63;
  --amber: #ffb02e;
  --amber-hi: #ffd27a;
  --amber-lo: #8a5a0c;
  --red: #ff4a3a;
  --red-lo: #5c140d;
  --green: #7ddc6b;
  --line: #2b2e32;
  --panel: rgba(11, 12, 13, 0.92);
  --paper: #e9e0c8;
  --paper-ink: #1b1812;
  --f-display: Bahnschrift, "DIN Alternate", "Arial Narrow", "Franklin Gothic Medium", "Helvetica Neue", "Liberation Sans Narrow", "Adwaita Sans", Arial, sans-serif;
  --f-body: system-ui, -apple-system, "Segoe UI", Roboto, "Adwaita Sans", Arial, sans-serif;
  --f-mono: "Cascadia Mono", "SF Mono", Consolas, "Adwaita Mono", "DejaVu Sans Mono", monospace;
  --u: calc(min(100vh, 56.25vw) / 100);
  --fs: clamp(12px, calc(var(--u) * 2), 30px);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); overflow: hidden; }
body { color: var(--ink); font: 400 16px/1.35 var(--f-body); -webkit-font-smoothing: antialiased; user-select: none; -webkit-user-select: none; }
canvas#game { position: fixed; inset: 0; width: 100%; height: 100%; display: block; background: #000; outline: none; }
button, input, select, textarea { font: inherit; color: inherit; }
input { user-select: text; -webkit-user-select: text; }
[hidden] { display: none !important; }

/* ------------------------------------------------------------------ preboot + boot error (index.html) */
#preboot { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: radial-gradient(ellipse at 50% 40%, #14110a 0%, #050607 70%); font-family: var(--f-display); }
.pb-center { width: min(86vw, 30em); text-align: center; font-size: var(--fs); }
.pb-mark { display: flex; flex-direction: column; align-items: center; line-height: 0.95; font: 800 3.4em/0.95 var(--f-display); letter-spacing: 0.12em; text-transform: uppercase; color: var(--amber); text-shadow: 0 0 0.9em rgba(255, 176, 46, 0.35); }
.pb-mark span:last-child { color: var(--ink); text-shadow: none; }
.pb-bar { margin: 2em auto 0.9em; height: 0.45em; width: 100%; background: #1a1b1c; position: relative; overflow: hidden; }
.pb-bar i { position: absolute; inset: 0 auto 0 0; width: 35%; background: repeating-linear-gradient(-45deg, var(--amber) 0 0.5em, #111 0.5em 1em); animation: pbslide 1.3s ease-in-out infinite; }
.pb-msg { color: var(--ink-dim); letter-spacing: 0.14em; text-transform: uppercase; font-size: 0.8em; }
@keyframes pbslide { 0% { transform: translateX(-100%); } 100% { transform: translateX(300%); } }

#boot-error { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: rgba(3, 3, 4, 0.94); padding: 1em; }
.be-panel { width: min(92vw, 40em); background: #101112; border: 1px solid #3a2a2a; padding: 0 0 1.5em; font-family: var(--f-body); box-shadow: 0 1em 4em #000; }
.be-haz { height: 0.9em; background: repeating-linear-gradient(-45deg, var(--red) 0 0.9em, #111 0.9em 1.8em); }
.be-panel h1 { margin: 1em 1.6em 0.3em; font: 800 1.9em var(--f-display); letter-spacing: 0.14em; color: var(--red); }
.be-panel p { margin: 0 1.6em 1em; color: var(--ink); font-size: 1.05em; }
.be-panel pre { margin: 0 1.6em 1.2em; padding: 0.8em; max-height: 14em; overflow: auto; background: #070808; color: #c9a9a0; font: 0.78em/1.4 var(--f-mono); white-space: pre-wrap; word-break: break-word; user-select: text; }
.be-panel button { margin-left: 1.6em; background: var(--amber); color: #14100a; border: 0; padding: 0.7em 1.6em; font: 800 0.95em var(--f-display); letter-spacing: 0.16em; cursor: pointer; }
.noscript { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; background: #000; color: var(--ink); }

/* ------------------------------------------------------------------ UI root + screens */
.ui { position: fixed; inset: 0; z-index: 10; font-size: var(--fs); font-family: var(--f-body); pointer-events: none; color: var(--ink); }
.screens { position: absolute; inset: 0; pointer-events: none; }
.over-scene .screens { background: radial-gradient(ellipse at 50% 45%, rgba(5, 6, 7, 0.38) 0%, rgba(3, 4, 5, 0.82) 100%); pointer-events: auto; }
.ui[data-screen="boot"] .screens, .ui[data-screen="disconnected"] .screens { background: rgba(3, 4, 5, 0.9); }
.screen { position: absolute; inset: 0; display: none; padding: 2.4em 3em; overflow: auto; }
.screen.active { display: flex; pointer-events: auto; }
.ui[data-screen="pause"] .s-pause { background: rgba(2, 3, 4, 0.62); align-items: center; justify-content: center; }

.haz { height: 0.7em; background: repeating-linear-gradient(-45deg, var(--amber) 0 0.7em, #0e0e0f 0.7em 1.4em); }
.haz-top { margin: 0; }

h1, h2, h3 { margin: 0; font-family: var(--f-display); font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; }
h2 { font-size: 1.5em; }
h3 { font-size: 0.8em; color: var(--amber); letter-spacing: 0.22em; margin: 0 0 0.6em; }

.wordmark { color: var(--amber); display: block; overflow: visible; }
.wordmark path { vector-effect: none; }

/* buttons */
.btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 0.6em; background: #15171a; border: 1px solid #3a3e43; color: var(--ink); padding: 0.62em 1.2em; cursor: pointer; font: 700 0.86em var(--f-display); letter-spacing: 0.16em; text-transform: uppercase; transition: background 0.12s, border-color 0.12s, color 0.12s, transform 0.08s; }
.btn:hover { background: #1f2226; border-color: var(--amber); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible, .link:focus-visible, .map-card:focus-visible, .clockin:focus-visible, .switch:focus-visible, .seg button:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
.btn.amber { background: var(--amber); color: #150f05; border-color: var(--amber); }
.btn.amber:hover { background: var(--amber-hi); border-color: var(--amber-hi); }
.btn.amber.warn { background: transparent; color: var(--amber); }
.btn.amber.warn:hover { background: rgba(255, 176, 46, 0.15); }
.btn.ghost { background: transparent; border-color: #3a3e43; color: var(--ink-dim); }
.btn.ghost:hover { color: var(--ink); }
.btn.danger { color: var(--red); }
.btn.danger:hover { border-color: var(--red); background: rgba(255, 74, 58, 0.1); }
.btn.big { padding: 0.9em 1.4em; font-size: 1em; width: 100%; }
.btn.small { padding: 0.45em 0.9em; font-size: 0.74em; }
.btn.ok { border-color: var(--green); color: var(--green); }
.btn.ready.on { background: rgba(125, 220, 107, 0.12); border-color: var(--green); color: var(--green); }
.btn[disabled] { opacity: 0.4; pointer-events: none; }
.link { background: none; border: 0; color: var(--ink-dim); cursor: pointer; font: 600 0.74em var(--f-display); letter-spacing: 0.18em; text-transform: uppercase; padding: 0.4em 0; }
.link b { color: var(--amber); }
.link:hover .link-hint { color: var(--ink); text-decoration: underline; }
.link-hint { color: var(--ink-faint); }

.panel { background: var(--panel); border: 1px solid var(--line); border-top: 0.3em solid var(--amber); padding: 1.4em 1.8em 1.6em; box-shadow: 0 1em 3em rgba(0, 0, 0, 0.6); margin: auto; width: min(100%, 34em); }
.panel.wide { width: min(100%, 46em); }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.2em; gap: 1em; }

.bar { position: relative; height: 0.55em; background: #17181a; overflow: hidden; border: 1px solid #2b2e32; }
.bar i { position: absolute; inset: 0; background: var(--amber); transform-origin: left; transition: transform 0.25s ease-out; }
.haz-bar i { background: repeating-linear-gradient(-45deg, var(--amber) 0 0.5em, #181818 0.5em 1em); }
.bar.indeterminate i { right: auto; width: 35%; transform: none; animation: pbslide 1.3s ease-in-out infinite; transition: none; background: repeating-linear-gradient(-45deg, var(--amber) 0 0.5em, #181818 0.5em 1em); }

.toast { position: absolute; top: 1.2em; left: 50%; transform: translate(-50%, -160%); max-width: min(92vw, 40em); background: #2a0d09; color: #ffd9d3; border: 1px solid var(--red); border-left: 0.5em solid var(--red); padding: 0.7em 1.2em; font-size: 0.9em; cursor: pointer; opacity: 0; transition: transform 0.25s, opacity 0.25s; z-index: 5; pointer-events: none; box-shadow: 0 0.5em 2em rgba(0, 0, 0, 0.6); }
.toast.on { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }

/* ------------------------------------------------------------------ boot */
.s-boot { align-items: center; justify-content: center; }
.boot-center { width: min(80vw, 28em); text-align: center; display: grid; gap: 1.4em; justify-items: center; }
.boot-center .bar { width: 100%; }
.boot-msg { color: var(--ink-dim); letter-spacing: 0.16em; text-transform: uppercase; font-size: 0.8em; }

/* ------------------------------------------------------------------ title: punch clock */
.s-title { align-items: center; justify-content: center; }
.title-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 21em; gap: 4.5em; align-items: center; width: min(100%, 62em); }
.brand { display: flex; flex-direction: column; gap: 0.35em; align-items: flex-start; filter: drop-shadow(0 0 1em rgba(255, 176, 46, 0.22)); }
.brand-2 { color: var(--ink); }
.haz-brand { width: 100%; max-width: 24em; margin-top: 0.6em; }
.tagline { margin: 0.6em 0 0; color: var(--ink-dim); letter-spacing: 0.16em; text-transform: uppercase; font: 600 0.8em var(--f-display); }

.timecard { position: relative; background: var(--paper); color: var(--paper-ink); padding: 1.2em 1.4em 1.4em; font-family: var(--f-mono); transform: rotate(1.2deg); box-shadow: 0 1.2em 3em rgba(0, 0, 0, 0.7), inset 0 0 0 1px rgba(0, 0, 0, 0.12); background-image: repeating-linear-gradient(0deg, transparent 0 1.55em, rgba(60, 40, 10, 0.09) 1.55em calc(1.55em + 1px)); animation: cardin 0.7s cubic-bezier(0.2, 1, 0.3, 1) both; clip-path: polygon(0 0, 100% 0, 100% calc(100% - 0.9em), calc(100% - 0.9em) 100%, 0 100%); }
.tc-slot { position: absolute; top: -0.5em; left: 12%; right: 12%; height: 0.9em; background: #0a0a0b; border-radius: 0 0 0.5em 0.5em; box-shadow: inset 0 -0.2em 0.4em rgba(255, 176, 46, 0.15); }
.tc-head { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 2px solid var(--paper-ink); padding-bottom: 0.4em; margin-bottom: 0.8em; }
.tc-title { font: 800 1.15em var(--f-display); letter-spacing: 0.26em; }
.tc-no { font-size: 0.72em; opacity: 0.7; }
.tc-clockrow { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 0.9em; }
.tc-time { font: 700 2.1em/1 var(--f-mono); letter-spacing: 0.04em; font-variant-numeric: tabular-nums; }
.tc-date { font-size: 0.72em; opacity: 0.7; letter-spacing: 0.1em; }
.tc-field { display: block; margin-bottom: 1em; }
.tc-label { display: block; font: 700 0.62em var(--f-display); letter-spacing: 0.24em; opacity: 0.7; margin-bottom: 0.2em; }
.tc-input { width: 100%; background: transparent; border: 0; border-bottom: 2px dotted var(--paper-ink); padding: 0.2em 0; font: 700 1.5em var(--f-mono); letter-spacing: 0.08em; text-transform: uppercase; color: #1d3a8a; outline: none; border-radius: 0; caret-color: #1d3a8a; }
.tc-input::placeholder { color: rgba(30, 24, 10, 0.28); }
.tc-input:focus { border-bottom-style: solid; border-bottom-color: #a1610a; }
.tc-rows { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5em; font-size: 0.7em; margin-bottom: 1.1em; }
.tc-rows div { border: 1px solid rgba(0, 0, 0, 0.35); padding: 0.35em 0.5em; display: flex; flex-direction: column; }
.tc-rows span { opacity: 0.55; font-size: 0.85em; letter-spacing: 0.14em; }
.tc-invite { margin-bottom: 0.9em; padding: 0.4em 0.6em; background: rgba(161, 97, 10, 0.16); border: 1px dashed #a1610a; font-size: 0.74em; display: flex; justify-content: space-between; letter-spacing: 0.1em; }
.tc-invite b { font-size: 1.2em; letter-spacing: 0.2em; }
.clockin { position: relative; width: 100%; display: flex; align-items: center; justify-content: center; gap: 0.7em; background: #0f0f10; color: var(--amber); border: 0; padding: 0.95em 1em; cursor: pointer; font: 800 1.05em var(--f-display); letter-spacing: 0.28em; overflow: hidden; transition: background 0.15s; }
.clockin::before, .clockin::after { content: ""; position: absolute; top: 0; bottom: 0; width: 0.9em; background: repeating-linear-gradient(-45deg, var(--amber) 0 0.45em, #0f0f10 0.45em 0.9em); }
.clockin::before { left: 0; } .clockin::after { right: 0; }
.clockin:hover { background: #1b1b1d; color: var(--amber-hi); }
.clockin-arrow { width: 0.6em; height: 0.6em; border: solid currentColor; border-width: 0.18em 0.18em 0 0; transform: rotate(45deg); }
.tc-stamp { position: absolute; right: 8%; bottom: 20%; padding: 0.3em 0.7em; border: 0.2em solid var(--red); color: var(--red); font: 800 1.35em var(--f-display); letter-spacing: 0.16em; transform: rotate(-9deg) scale(2); opacity: 0; mix-blend-mode: multiply; pointer-events: none; background: rgba(255, 255, 255, 0.0); }
.timecard.stamped .tc-stamp { animation: stamp 0.35s cubic-bezier(0.2, 1.3, 0.4, 1) forwards; }
@keyframes stamp { 0% { opacity: 0; transform: rotate(-9deg) scale(2.2); } 100% { opacity: 0.92; transform: rotate(-9deg) scale(1); } }
@keyframes cardin { from { opacity: 0; transform: translateY(-3em) rotate(-3deg); } to { opacity: 1; transform: rotate(1.2deg); } }

/* ------------------------------------------------------------------ menu */
.s-menu { flex-direction: column; justify-content: space-between; }
.menu-head { display: flex; align-items: center; justify-content: space-between; }
.menu-wm { height: 1.7em; width: auto; }
.menu-main { display: flex; align-items: flex-start; gap: 1.6em; margin: 0 0 0 6vw; min-height: 0; }
.menu-board { flex: none; margin: 0; width: min(100%, 27em); background: var(--panel); border: 1px solid var(--line); border-left: 0.35em solid var(--amber); box-shadow: 0 1em 3em rgba(0, 0, 0, 0.55); }
.mb-head { display: flex; justify-content: space-between; align-items: center; padding: 0.7em 1.1em; font: 800 0.74em var(--f-display); letter-spacing: 0.3em; color: var(--ink-dim); border-bottom: 1px solid var(--line); background: repeating-linear-gradient(90deg, rgba(255, 176, 46, 0.05) 0 0.4em, transparent 0.4em 0.8em); }
.mb-dots { width: 1.6em; height: 0.5em; background: radial-gradient(circle, var(--green) 0.18em, transparent 0.2em) 0 0 / 0.55em 0.5em; opacity: 0.8; }
.menu-list { display: flex; flex-direction: column; padding: 0.5em; gap: 0.35em; }
.menu-item { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 1em; padding: 0.8em 1em; cursor: pointer; border: 1px solid transparent; position: relative; }
.menu-item:hover, .menu-item:focus-visible { background: rgba(255, 176, 46, 0.09); border-color: rgba(255, 176, 46, 0.45); }
.menu-item:focus-visible { outline: 2px solid var(--amber); outline-offset: 1px; }
.mi-n { font: 700 0.8em var(--f-mono); color: var(--amber-lo); width: 1.6em; }
.menu-item:hover .mi-n, .menu-item:focus-visible .mi-n { color: var(--amber); }
.mi-t { display: flex; flex-direction: column; flex: 1; }
.mi-t b { font: 800 1.2em var(--f-display); letter-spacing: 0.16em; }
.mi-t small { color: var(--ink-faint); font-size: 0.78em; letter-spacing: 0.04em; }
.mi-arrow { width: 0.5em; height: 0.5em; border: solid var(--ink-faint); border-width: 0.16em 0.16em 0 0; transform: rotate(45deg); transition: transform 0.15s, border-color 0.15s; }
.menu-item:hover .mi-arrow, .menu-item:focus-visible .mi-arrow { border-color: var(--amber); transform: translateX(0.3em) rotate(45deg); }
.join-row { display: none; gap: 0.5em; padding: 0.2em 1em 0.8em 3.6em; }
.join-row.open { display: flex; }
.cb-btns { display: flex; gap: 0.5em; justify-content: center; flex-wrap: wrap; margin-top: 0.2em; }
.btn.priv.on { border-color: var(--red); color: var(--red); }
.cb-priv { margin-top: 0.7em; color: var(--ink-faint); font-size: 0.7em; line-height: 1.4; }
.code-input { flex: 1; min-width: 0; background: #08090a; border: 1px solid #3a3e43; padding: 0.5em 0.7em; font: 700 1.3em var(--f-mono); letter-spacing: 0.35em; text-transform: uppercase; color: var(--amber); outline: none; text-align: center; }
.code-input:focus { border-color: var(--amber); }
/* public lobby browser (right of the shift board) */
.room-board { flex: 0 1 36em; min-width: 0; max-height: 70vh; display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-left: 0.35em solid var(--green); box-shadow: 0 1em 3em rgba(0, 0, 0, 0.55); }
.rb-count { color: var(--green); }
.rb-list { display: flex; flex-direction: column; gap: 0.35em; padding: 0.5em; overflow-y: auto; min-height: 5em; }
.rb-empty { padding: 1.4em 1em; color: var(--ink-faint); font-size: 0.85em; text-align: center; line-height: 1.5; }
.rb-row { display: grid; grid-template-columns: 3.6em minmax(0, 1fr) auto auto; align-items: center; gap: 0.9em; padding: 0.55em 0.8em; background: rgba(255, 255, 255, 0.035); border-left: 0.25em solid var(--amber); }
.rb-row.playing { border-left-color: var(--red); }
.rb-row.full { opacity: 0.6; border-left-color: #3a3e43; }
.rb-code { font: 800 1.05em var(--f-mono); letter-spacing: 0.12em; color: var(--amber); }
.rb-who { min-width: 0; display: flex; flex-direction: column; }
.rb-host { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.rb-map { color: var(--ink-dim); font-size: 0.74em; letter-spacing: 0.12em; text-transform: uppercase; }
.rb-slots { display: flex; flex-direction: column; align-items: flex-end; gap: 0.2em; }
.rb-n { font: 800 0.95em var(--f-mono); }
.rb-pips { display: inline-flex; gap: 0.3em; }
.rb-pips i { width: 0.5em; height: 0.5em; background: #2b2e32; transform: rotate(45deg); }
.rb-pips i.on { background: var(--amber); }
.rb-state { color: var(--ink-faint); font: 700 0.62em var(--f-display); letter-spacing: 0.16em; }
.rb-row.playing .rb-state { color: var(--red); }
.menu-foot { display: flex; justify-content: space-between; color: var(--ink-faint); font: 600 0.68em var(--f-display); letter-spacing: 0.24em; }

/* ------------------------------------------------------------------ lobby */
.s-lobby { flex-direction: column; gap: 1.1em; padding: 1.6em 2.2em; overflow: hidden; }
.lb-head { display: flex; align-items: center; gap: 1.2em; }
.lb-head h2 { flex: 1; font-size: 1.7em; }
.lb-state { color: var(--ink-dim); font: 700 0.74em var(--f-display); letter-spacing: 0.22em; }
.lb-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: 19em minmax(0, 1fr) 19em; gap: 1.2em; }
.lb-col { min-height: 0; display: flex; flex-direction: column; gap: 0.9em; }
.lb-mid, .lb-right { background: var(--panel); border: 1px solid var(--line); padding: 1em 1.1em; }
.lb-mid { overflow-y: auto; }
.pn-head { font: 800 0.72em var(--f-display); letter-spacing: 0.28em; color: var(--amber); margin-bottom: 0.2em; }
.code-box { background: var(--panel); border: 1px solid var(--line); border-top: 0.3em solid var(--amber); padding: 0.9em 1em 1em; text-align: center; }
.cb-label { font: 700 0.66em var(--f-display); letter-spacing: 0.34em; color: var(--ink-dim); margin-bottom: 0.5em; }
.code-tiles { display: flex; gap: 0.3em; justify-content: center; margin-bottom: 0.8em; flex-wrap: wrap; }
.tile { display: inline-grid; place-items: center; width: 1.3em; height: 1.7em; background: linear-gradient(#17181a 49%, #0b0b0c 50%); border: 1px solid #34383d; color: var(--amber); font: 800 2.2em/1 var(--f-mono); text-shadow: 0 0 0.5em rgba(255, 176, 46, 0.5); animation: tilein 0.4s both; }
@keyframes tilein { from { transform: rotateX(90deg); opacity: 0; } to { transform: none; opacity: 1; } }
.lb-panel { background: var(--panel); border: 1px solid var(--line); padding: 0.9em 1em; }
.lb-players { display: flex; flex-direction: column; gap: 0.3em; margin-top: 0.5em; }
.pl { display: flex; align-items: center; gap: 0.6em; padding: 0.38em 0.6em; background: rgba(255, 255, 255, 0.035); border-left: 0.25em solid var(--pc); font-size: 0.9em; min-height: 2.1em; }
.pl-chip { width: 0.7em; height: 0.7em; background: var(--pc); flex: none; transform: rotate(45deg); }
.pl-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.pl.you .pl-name { color: var(--amber-hi); }
.pl.empty { opacity: 0.35; border-left-color: #2b2e32; background: transparent; border-bottom: 1px dashed #2b2e32; }
.pl.empty .pl-chip { background: #3a3e43; }
.pl.empty .pl-name { font-weight: 400; font-style: italic; }
.pl.offline { opacity: 0.6; }
.pl-ready { font: 800 0.66em var(--f-display); letter-spacing: 0.18em; color: var(--ink-faint); }
.pl.ready .pl-ready { color: var(--green); }
.badge { font: 800 0.6em var(--f-display); letter-spacing: 0.16em; padding: 0.2em 0.5em; border: 1px solid; }
.badge.host { color: var(--amber); border-color: var(--amber); }
.badge.off { color: var(--red); border-color: var(--red); animation: blink 1.2s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0.35; } }
.lb-actions { display: flex; flex-direction: column; gap: 0.5em; }
.lb-note { text-align: center; color: var(--ink-dim); font-size: 0.78em; }
.map-detail { display: grid; grid-template-columns: minmax(0, 17em) minmax(0, 1fr); gap: 1em; margin: 0.6em 0 0.4em; padding: 0.8em; background: #07080a; border: 1px solid var(--line); border-top: 0.2em solid var(--tc); }
.md-canvas { width: 100%; height: auto; aspect-ratio: 3 / 2; background: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.04), transparent 70%); }
.md-info { display: flex; flex-direction: column; gap: 0.3em; min-width: 0; }
.md-theme { font: 800 0.62em var(--f-display); letter-spacing: 0.26em; color: var(--tc); }
.md-name { font: 800 1.5em/1.1 var(--f-display); letter-spacing: 0.08em; text-transform: uppercase; }
.md-blurb { margin: 0.3em 0; color: var(--ink-dim); font-size: 0.85em; line-height: 1.45; }
.md-best { margin-top: auto; font: 700 0.74em var(--f-mono); color: var(--amber); }
.lb-hint { color: var(--ink-faint); font-size: 0.72em; letter-spacing: 0.06em; margin-bottom: 0.5em; }
.map-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(9.2em, 1fr)); gap: 0.6em; }
.map-card { all: unset; box-sizing: border-box; cursor: pointer; display: flex; flex-direction: column; gap: 0.3em; padding: 0.45em; background: #0b0c0e; border: 1px solid var(--line); border-top: 0.2em solid var(--tc); transition: border-color 0.12s, background 0.12s, transform 0.12s; }
.map-card canvas { width: 100%; height: auto; aspect-ratio: 11 / 7; background: #060708; }
.map-card:hover { background: #121417; transform: translateY(-1px); }
.map-card.locked { cursor: default; }
.map-card.locked:hover { transform: none; }
.map-card.selected { border-color: var(--amber); border-top-color: var(--amber); background: rgba(255, 176, 46, 0.1); box-shadow: 0 0 0 1px var(--amber), 0 0 1.2em rgba(255, 176, 46, 0.2); }
.mc-top { display: flex; justify-content: space-between; align-items: center; font: 700 0.58em var(--f-display); letter-spacing: 0.16em; color: var(--tc); }
.mc-best { color: var(--amber); font-family: var(--f-mono); }
.mc-name { font: 700 0.82em var(--f-display); letter-spacing: 0.08em; text-transform: uppercase; line-height: 1.15; }
.lb-right { display: flex; flex-direction: column; }
.lb-chat-log { flex: 1; min-height: 0; overflow-y: auto; font-size: 0.82em; line-height: 1.4; margin: 0.5em 0; padding-right: 0.3em; user-select: text; }
.lb-chat-log .cl { padding: 0.12em 0; word-break: break-word; }
.cl.sys { color: var(--ink-faint); font-style: italic; }
.cl b { font-weight: 700; }
.lb-chat-row { display: flex; gap: 0.5em; align-items: center; }
.chat-field, .chat-input { flex: 1; min-width: 0; background: #08090a; border: 1px solid #34383d; padding: 0.55em 0.7em; font-size: 0.86em; outline: none; color: var(--ink); }
.chat-field:focus { border-color: var(--amber); }

/* ------------------------------------------------------------------ loading */
.s-loading { align-items: center; justify-content: center; }
.load-center { width: min(80vw, 30em); text-align: center; display: grid; gap: 1.2em; justify-items: center; }
.load-center .bar { width: 100%; height: 0.7em; }
.load-text { font: 800 1.5em var(--f-display); letter-spacing: 0.18em; text-transform: uppercase; }
.load-tip { color: var(--ink-dim); font-size: 0.82em; max-width: 26em; min-height: 2.6em; }
.load-clock { position: relative; width: 4.2em; height: 4.2em; border: 0.2em solid var(--amber); border-radius: 50%; box-shadow: 0 0 1.4em rgba(255, 176, 46, 0.25); }
.load-clock::before { content: ""; position: absolute; inset: 0.3em; border-radius: 50%; background: repeating-conic-gradient(var(--ink-dim) 0 1deg, transparent 1deg 30deg); -webkit-mask: radial-gradient(circle, transparent 62%, #000 64%); mask: radial-gradient(circle, transparent 62%, #000 64%); }
.hand { position: absolute; left: 50%; bottom: 50%; width: 0.16em; background: var(--amber); transform-origin: bottom center; border-radius: 1em; }
.hand.h1 { height: 1.5em; animation: spin 2.4s linear infinite; }
.hand.h2 { height: 1em; animation: spin 28.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------------ pause / disconnected / game over */
.pause-panel { width: min(90vw, 24em); background: var(--panel); border: 1px solid var(--line); padding: 0 1.6em 1.6em; display: flex; flex-direction: column; gap: 0.6em; box-shadow: 0 1em 4em #000; }
.pause-panel .haz { margin: 0 -1.6em 1.2em; }
.pause-panel h2 { text-align: center; font-size: 1.8em; }
.pause-sub { margin: 0 0 0.8em; text-align: center; color: var(--ink-dim); font-size: 0.82em; }
.pause-note { color: #ffd9a0; background: rgba(255, 176, 46, 0.1); border-left: 0.3em solid var(--amber); padding: 0.5em 0.8em; font-size: 0.8em; }
.s-disc { align-items: center; justify-content: center; }
.disc-panel { width: min(90vw, 26em); background: var(--panel); border: 1px solid #4a2420; padding: 0 1.6em 1.6em; text-align: center; display: flex; flex-direction: column; gap: 0.8em; align-items: center; }
.disc-panel .haz { align-self: stretch; margin: 0 -1.6em 0.6em; background: repeating-linear-gradient(-45deg, var(--red) 0 0.7em, #0e0e0f 0.7em 1.4em); }
.disc-panel .bar { align-self: stretch; }
.disc-icon { width: 3.6em; height: 3.6em; color: var(--ink-dim); }
.disc-icon svg { width: 100%; height: 100%; }
.disc-text { color: var(--ink); }
.disc-attempt { color: var(--ink-faint); font: 600 0.8em var(--f-mono); min-height: 1.2em; }
.disc-actions { display: flex; gap: 0.6em; margin-top: 0.4em; }

.s-over { align-items: center; justify-content: center; }
.go-panel { width: min(96vw, 50em); max-height: 100%; overflow: auto; background: var(--panel); border: 1px solid var(--line); padding: 0 2em 1.8em; box-shadow: 0 1em 4em #000; display: flex; flex-direction: column; gap: 1em; }
.go-panel .haz { margin: 0 -2em; background: repeating-linear-gradient(-45deg, var(--red) 0 0.7em, #0e0e0f 0.7em 1.4em); }
.go-head { display: flex; flex-direction: column; margin-top: 0.4em; }
.go-label { font: 800 1.3em var(--f-display); letter-spacing: 0.3em; color: var(--red); }
.go-sub { color: var(--ink-dim); font-size: 0.82em; }
.go-round { display: grid; grid-template-columns: auto auto 1fr; align-items: end; gap: 1.2em; }
.go-r-label { font: 700 0.7em var(--f-display); letter-spacing: 0.3em; color: var(--ink-dim); padding-bottom: 1.2em; }
.go-digits { color: var(--ink); }
.go-tally { color: #cfc9b8; align-self: center; height: 2.6em; overflow: hidden; }
.go-tally svg { height: 100%; width: auto; max-width: 100%; }
.go-best { font: 600 0.86em var(--f-mono); color: var(--ink-dim); display: flex; gap: 0.8em; align-items: center; }
.go-best.record { color: var(--amber); }
.go-new { background: var(--amber); color: #120c03; padding: 0.15em 0.6em; font: 800 0.8em var(--f-display); letter-spacing: 0.2em; animation: blink 1s steps(2) 4; }
.go-table table, .bd-table { width: 100%; border-collapse: collapse; font-size: 0.9em; }
.go-table th, .bd-table th { text-align: right; font: 700 0.64em var(--f-display); letter-spacing: 0.22em; color: var(--ink-faint); padding: 0.4em 0.7em; border-bottom: 1px solid var(--line); }
.go-table th:first-child, .bd-table th:nth-child(2) { text-align: left; }
.go-table td, .bd-table td { padding: 0.55em 0.7em; border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
td.num { text-align: right; font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
td.nm { display: flex; align-items: center; gap: 0.6em; font-weight: 700; }
.tm-chip { display: inline-block; width: 0.55em; height: 0.55em; background: var(--pc); transform: rotate(45deg); flex: none; }
.go-actions { display: flex; gap: 0.8em; align-items: center; }
.go-actions .btn.big { width: auto; flex: 1; }
.go-wait { flex: 1; color: var(--ink-dim); font-size: 0.86em; font-style: italic; }

/* ------------------------------------------------------------------ settings / controls */
.s-settings, .s-controls { align-items: center; justify-content: center; }
.s-group { margin-bottom: 1.3em; }
.s-row { display: grid; grid-template-columns: 11em 1fr 3.6em; align-items: center; gap: 1em; padding: 0.55em 0; border-bottom: 1px solid rgba(255, 255, 255, 0.06); }
.s-label { font-size: 0.9em; }
.s-label small { display: block; color: var(--ink-faint); }
.s-val { font: 600 0.82em var(--f-mono); text-align: right; color: var(--amber); }
.s-row > :nth-child(2) { grid-column: 2 / 4; }
.s-row:has(output) > :nth-child(2) { grid-column: 2; }
input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 1.6em; background: transparent; cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track { height: 0.35em; background: #2a2d31; }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 0.7em; height: 1.3em; margin-top: -0.48em; background: var(--amber); border: 0; }
input[type="range"]::-moz-range-track { height: 0.35em; background: #2a2d31; }
input[type="range"]::-moz-range-thumb { width: 0.7em; height: 1.3em; background: var(--amber); border: 0; border-radius: 0; }
input[type="range"]:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
.switch { justify-self: end; grid-column: 3; width: 3em; height: 1.55em; background: #1c1e21; border: 1px solid #3a3e43; position: relative; cursor: pointer; padding: 0; }
.switch i { position: absolute; top: 0.18em; left: 0.18em; width: 1.1em; height: 1em; background: var(--ink-faint); transition: transform 0.15s, background 0.15s; }
.switch[aria-checked="true"] { border-color: var(--amber); }
.switch[aria-checked="true"] i { transform: translateX(1.4em); background: var(--amber); }
.s-row > .switch { grid-column: 3; }
.seg { display: flex; border: 1px solid #3a3e43; }
.seg button { flex: 1; background: #15171a; border: 0; border-right: 1px solid #3a3e43; padding: 0.5em 0.4em; cursor: pointer; font: 700 0.7em var(--f-display); letter-spacing: 0.12em; color: var(--ink-dim); }
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--amber); color: #140e04; }
.ctl-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.2em 2em; }
.ctl { display: flex; justify-content: space-between; align-items: center; gap: 1em; padding: 0.55em 0; border-bottom: 1px solid rgba(255, 255, 255, 0.06); font-size: 0.9em; }
.ctl-k { display: flex; gap: 0.3em; flex-wrap: wrap; justify-content: flex-end; }
kbd { font: 700 0.82em var(--f-mono); min-width: 1.9em; text-align: center; padding: 0.25em 0.55em; background: linear-gradient(#2a2d31, #1a1c1f); border: 1px solid #494d53; border-bottom-width: 0.2em; border-radius: 0.3em; color: var(--ink); }
.ctl-note { margin: 1.2em 0 0; color: var(--ink-faint); font-size: 0.8em; }

/* ====================================================================================================
   HUD
   ==================================================================================================== */
.hud { position: absolute; inset: 0; pointer-events: none; font-family: var(--f-display); text-transform: uppercase; --edge: 2.6em; --shadow: 0 0 0.35em #000, 0 0.08em 0.15em #000; }
.hud > * { position: absolute; }
.pop, .w-name, .w-alt, .zleft, .zl-n, .points-n, .w-clip, .w-res, .net, .announce-text, .d-title, .d-sub { paint-order: stroke fill; -webkit-text-stroke: 3px rgba(0, 0, 0, 0.5); }
.hud-shade { inset: 0; background: radial-gradient(ellipse 36% 42% at 0 100%, rgba(3, 4, 5, 0.88), transparent), radial-gradient(ellipse 34% 40% at 100% 100%, rgba(3, 4, 5, 0.88), transparent), radial-gradient(ellipse 30% 36% at 0 0, rgba(3, 4, 5, 0.55), transparent), radial-gradient(ellipse 28% 30% at 100% 0, rgba(3, 4, 5, 0.5), transparent); }
.hud-vig { inset: 0; opacity: 0; transition: opacity 0.2s; background: radial-gradient(ellipse at 50% 50%, transparent 38%, rgba(120, 0, 0, calc(0.25 + var(--sev, 0) * 0.55)) 78%, rgba(60, 0, 0, calc(0.55 + var(--sev, 0) * 0.4)) 110%); }
.hud-vig.on { opacity: 1; animation: heartbeat var(--beat, 1.2s) ease-in-out infinite; }
@keyframes heartbeat { 0%, 100% { filter: brightness(0.8); } 12% { filter: brightness(1.35); } 24% { filter: brightness(0.85); } 36% { filter: brightness(1.2); } 60% { filter: brightness(0.8); } }
.hud-flash { inset: 0; opacity: 0; background: radial-gradient(ellipse, rgba(255, 20, 0, 0.05) 30%, rgba(255, 20, 0, 0.55) 120%); }
.hud-downfx { inset: 0; opacity: 0; transition: opacity 0.6s; background: radial-gradient(ellipse at 50% 55%, rgba(30, 0, 0, 0.1) 20%, rgba(70, 0, 0, 0.7) 100%); backdrop-filter: grayscale(0.7) brightness(0.8); }
.hud-downfx.on { opacity: 1; }

.hud-dmg { left: 50%; top: 50%; width: 0; height: 0; }
.dmg-holder { left: 0; top: 0; width: 0; height: 0; position: absolute; }
.dmg-arc { position: absolute; left: calc(var(--u) * -19); top: calc(var(--u) * -19); width: calc(var(--u) * 38); height: calc(var(--u) * 38); color: #ff2a1a; opacity: 0; filter: drop-shadow(0 0 0.4em rgba(255, 30, 10, 0.8)); }
.dmg-arc svg { width: 100%; height: 100%; }

/* top-left */
.h-tl { left: var(--edge); top: calc(var(--edge) * 0.8); display: flex; flex-direction: column; gap: 0.8em; width: 15em; }
.round-box { display: grid; grid-template-columns: auto 1fr; grid-template-areas: "l n" "t t"; align-items: end; gap: 0.2em 0.7em; padding: 0.6em 0.8em 0.6em; background: linear-gradient(90deg, rgba(8, 8, 9, 0.7), rgba(8, 8, 9, 0)); border-left: 0.25em solid var(--amber); }
.round-label { grid-area: l; font: 800 0.7em var(--f-display); letter-spacing: 0.3em; color: var(--amber); align-self: start; writing-mode: vertical-rl; transform: rotate(180deg); }
.round-num { grid-area: n; color: var(--ink); filter: drop-shadow(0 0 0.25em #000); }
.round-num svg { color: var(--ink); height: 3.4em; width: auto; display: block; }
.round-tally { grid-area: t; color: #d8d2bf; opacity: 0.9; max-width: 14em; }
.round-tally svg { display: block; height: 1.3em; width: auto; max-width: 100%; filter: drop-shadow(0 0 0.2em #000); }
.zleft { display: flex; align-items: baseline; gap: 0.6em; padding-left: 0.9em; font-size: 0.78em; letter-spacing: 0.2em; text-shadow: var(--shadow); }
.zl-label { color: var(--ink-dim); }
.zl-n { font: 800 1.6em var(--f-mono); color: var(--ink); letter-spacing: 0; }
.team { display: flex; flex-direction: column; gap: 0.25em; padding-left: 0.4em; }
.tm { display: grid; grid-template-columns: 0.5em 1fr auto auto; gap: 0.6em; align-items: center; font-size: 0.8em; padding: 0.25em 0.7em 0.25em 0.4em; background: rgba(6, 7, 8, 0.55); border-left: 0.2em solid var(--pc); text-shadow: var(--shadow); }
.tm-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; letter-spacing: 0.08em; }
.tm-pts { font: 700 1em var(--f-mono); color: var(--amber-hi); }
.tm-ico { width: 1.1em; height: 1.1em; display: inline-block; }
.tm-ico svg { width: 100%; height: 100%; }
.tm.is-down { background: rgba(60, 8, 4, 0.7); animation: blink 1s steps(2) infinite; }
.tm.is-down .tm-ico, .tm.is-down .tm-pts { color: var(--red); }
.tm.is-dead { opacity: 0.5; filter: grayscale(0.8); }

/* top-centre */
.h-tc { left: 50%; top: 9%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 0.8em; width: 40em; }
.announce { opacity: 0; text-align: center; }
.announce.on { opacity: 1; }
.announce-text { font: 800 2.6em/1 var(--f-display); letter-spacing: 0.2em; color: var(--amber); text-shadow: 0 0 0.6em rgba(255, 176, 46, 0.45), var(--shadow); padding: 0.2em 0.6em; background: linear-gradient(90deg, transparent, rgba(6, 6, 7, 0.65) 20%, rgba(6, 6, 7, 0.65) 80%, transparent); }
.announce.k-bad .announce-text { color: var(--red); text-shadow: 0 0 0.6em rgba(255, 60, 40, 0.5), var(--shadow); }
.buffs { display: flex; gap: 0.6em; }
.buff { position: relative; display: grid; grid-template-columns: 1.7em auto; grid-template-areas: "i n" "i t" "b b"; column-gap: 0.5em; align-items: center; padding: 0.35em 0.7em 0.5em 0.5em; background: rgba(6, 7, 8, 0.7); border-bottom: 0.2em solid var(--pc); min-width: 8em; font-size: 0.78em; }
.bf-ic { grid-area: i; width: 1.7em; height: 1.7em; color: var(--pc); }
.bf-ic svg { width: 100%; height: 100%; }
.bf-name { grid-area: n; font: 800 0.9em var(--f-display); letter-spacing: 0.16em; line-height: 1; }
.bf-t { grid-area: t; font: 700 0.85em var(--f-mono); color: var(--pc); }
.bf-bar { grid-area: b; margin-top: 0.4em; height: 0.2em; background: rgba(255, 255, 255, 0.12); overflow: hidden; }
.bf-bar i { display: block; height: 100%; background: var(--pc); transform-origin: left; width: 100%; }
.buff.ending { animation: blink 0.5s steps(2) infinite; }

/* top-right */
.h-tr { right: var(--edge); top: calc(var(--edge) * 0.8); width: 20em; display: flex; flex-direction: column; align-items: flex-end; gap: 0.6em; }
.net { font: 700 0.7em var(--f-mono); letter-spacing: 0.08em; color: var(--ink-dim); text-shadow: var(--shadow); }
.net[data-q="good"] { color: #9be58b; } .net[data-q="ok"] { color: var(--amber); } .net[data-q="bad"] { color: var(--red); }
.feed { display: flex; flex-direction: column; align-items: flex-end; gap: 0.2em; }
.fd { font: 700 0.8em var(--f-display); letter-spacing: 0.1em; padding: 0.25em 0.7em; background: rgba(6, 7, 8, 0.6); border-right: 0.2em solid var(--amber); text-shadow: var(--shadow); max-width: 24em; }
.fd.k-down { border-right-color: var(--red); color: #ffb4aa; }
.fd.k-revive { border-right-color: var(--green); color: #c2f3b8; }

/* centre */
.h-center { left: 50%; top: 50%; width: 0; height: 0; }
.xh { position: absolute; left: 0; top: 0; --gap: 4px; transition: opacity 0.12s; }
.xh.hidden { opacity: 0; }
.xt { position: absolute; background: #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.75); }
.xt-n, .xt-s { width: 2px; height: calc(var(--u) * 1.1); left: -1px; }
.xt-n { top: calc(var(--gap) * -1 - var(--u) * 1.1); } .xt-s { top: var(--gap); }
.xt-e, .xt-w { height: 2px; width: calc(var(--u) * 1.1); top: -1px; }
.xt-w { left: calc(var(--gap) * -1 - var(--u) * 1.1); } .xt-e { left: var(--gap); }
.xdot { position: absolute; left: -1px; top: -1px; width: 2px; height: 2px; background: var(--amber); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.6); }
.ads .xdot { background: #ff3b2a; width: 3px; height: 3px; left: -1.5px; top: -1.5px; }
.xh.hidden .xdot { opacity: 1; }
.hm { position: absolute; left: 0; top: 0; width: calc(var(--u) * 3.6); height: calc(var(--u) * 3.6); transform: translate(-50%, -50%); opacity: 0; color: #fff; filter: drop-shadow(0 0 2px #000); }
.hm svg { width: 100%; height: 100%; }
.hm.kill { color: #ff3b2a; width: calc(var(--u) * 4.6); height: calc(var(--u) * 4.6); }
.hm.kill.head { color: var(--amber); width: calc(var(--u) * 5.4); height: calc(var(--u) * 5.4); filter: drop-shadow(0 0 6px rgba(255, 176, 46, 0.9)) drop-shadow(0 0 2px #000); }
.hm-ring { position: absolute; left: 0; top: 0; width: calc(var(--u) * 5); height: calc(var(--u) * 5); border: 2px solid var(--amber); border-radius: 50%; transform: translate(-50%, -50%); opacity: 0; }
.popups { position: absolute; left: calc(var(--u) * 3.5); top: calc(var(--u) * -1); display: flex; flex-direction: column; justify-content: flex-end; height: calc(var(--u) * 14); transform: translateY(-100%) translateY(calc(var(--u) * 12)); contain: layout; }
.pop { font: 800 1.35em/1.15 var(--f-mono); color: var(--amber-hi); text-shadow: 0 0 0.35em rgba(255, 176, 46, 0.5), var(--shadow); white-space: nowrap; }
.pop.neg { color: #ff8a7a; }
.stam { position: absolute; left: calc(var(--u) * -8); top: calc(var(--u) * -8); width: calc(var(--u) * 16); height: calc(var(--u) * 16); opacity: 0; transition: opacity 0.35s; }
.stam.show { opacity: 0.9; }
.stam svg { width: 100%; height: 100%; overflow: visible; }
.stam path { stroke: #fff; stroke-dasharray: 100; filter: drop-shadow(0 0 2px #000); }
.stam.low path { stroke: var(--red); }

/* prompt */
.prompt { left: 50%; top: 66%; transform: translate(-50%, 0); display: flex; align-items: center; gap: 0.8em; padding: 0.55em 1.1em 0.55em 0.7em; background: linear-gradient(90deg, rgba(6, 7, 8, 0.2), rgba(6, 7, 8, 0.8) 18%, rgba(6, 7, 8, 0.8) 82%, rgba(6, 7, 8, 0.2)); opacity: 0; transition: opacity 0.12s; border-bottom: 1px solid rgba(255, 176, 46, 0.4); }
.prompt.on { opacity: 1; }
.p-hold { font: 800 0.62em var(--f-display); letter-spacing: 0.22em; color: var(--ink-dim); }
.p-keyw { position: relative; width: 2.6em; height: 2.6em; flex: none; display: grid; place-items: center; }
.p-ring { position: absolute; inset: 0; width: 100%; height: 100%; color: var(--amber); }
.p-key { position: relative; display: grid; place-items: center; width: 1.7em; height: 1.7em; border: 2px solid var(--amber); background: rgba(255, 176, 46, 0.14); color: var(--amber-hi); font: 800 1.1em var(--f-mono); border-radius: 0.2em; }
.p-body { display: flex; flex-direction: column; }
.p-text { font: 800 1.25em var(--f-display); letter-spacing: 0.14em; text-shadow: var(--shadow); white-space: nowrap; }
.p-sub { font: 800 0.72em var(--f-display); letter-spacing: 0.24em; color: var(--red); }
.p-cost { font: 800 1.15em var(--f-mono); color: var(--amber-hi); padding: 0.1em 0.6em; border: 1px solid rgba(255, 176, 46, 0.6); background: rgba(255, 176, 46, 0.08); }
.prompt.denied { border-bottom-color: var(--red); }
.prompt.denied .p-key { border-color: var(--red); color: #ff9a8c; background: rgba(255, 74, 58, 0.14); }
.prompt.denied .p-text { color: #ffb4aa; }
.prompt.denied .p-cost { border-color: var(--red); color: #ff9a8c; }
.prompt.holding .p-key { background: rgba(255, 176, 46, 0.35); }

/* downed */
.downed { left: 50%; top: 58%; transform: translateX(-50%); display: none; flex-direction: column; align-items: center; gap: 0.5em; text-align: center; }
.downed.on { display: flex; }
.d-ringw { position: relative; width: 5.5em; height: 5.5em; color: var(--red); }
.d-ring { width: 100%; height: 100%; filter: drop-shadow(0 0 0.4em rgba(255, 40, 20, 0.6)); }
.d-icon { position: absolute; inset: 1.5em; color: var(--red); }
.d-icon svg { width: 100%; height: 100%; }
.downed.crit .d-ringw { animation: blink 0.5s steps(2) infinite; }
.d-title { font: 800 2.2em var(--f-display); letter-spacing: 0.22em; color: #ff6a58; text-shadow: var(--shadow); }
.d-sub { font: 700 0.8em var(--f-display); letter-spacing: 0.3em; color: var(--ink-dim); text-shadow: var(--shadow); }
.downed.reviving .d-ringw { color: var(--green); }
.d-rev { display: none; width: 18em; }
.d-rev.on { display: block; }
.d-rev-text { font: 800 0.9em var(--f-display); letter-spacing: 0.2em; color: var(--green); margin-bottom: 0.4em; text-shadow: var(--shadow); }
.d-rev-bar { height: 0.55em; background: rgba(255, 255, 255, 0.14); border: 1px solid rgba(255, 255, 255, 0.2); overflow: hidden; }
.d-rev-bar i { display: block; height: 100%; background: var(--green); transform-origin: left; transform: scaleX(0); }

.spec { left: 50%; bottom: 7%; transform: translateX(-50%); display: none; align-items: center; gap: 0.9em; padding: 0.5em 1.2em; background: rgba(6, 7, 8, 0.75); border-top: 0.2em solid var(--amber); }
.spec.on { display: flex; }
.spec-tag { font: 800 0.7em var(--f-display); letter-spacing: 0.3em; color: var(--amber); }
.spec-text { font: 700 1.1em var(--f-display); letter-spacing: 0.12em; }

/* bottom-left */
.h-bl { left: var(--edge); bottom: calc(var(--edge) * 0.8); width: 22em; display: flex; flex-direction: column; gap: 0.7em; align-items: flex-start; }
.perks { display: flex; gap: 0.4em; min-height: 2.4em; }
.perk { width: 2.4em; height: 2.4em; padding: 0.3em; color: var(--pc); background: rgba(6, 7, 8, 0.7); border: 1px solid color-mix(in srgb, var(--pc) 55%, transparent); border-bottom-width: 0.2em; }
.perk svg { width: 100%; height: 100%; }
.points { display: flex; align-items: baseline; gap: 0.6em; padding: 0.15em 1.2em 0.15em 0.9em; background: linear-gradient(90deg, rgba(8, 8, 9, 0.75), rgba(8, 8, 9, 0)); border-left: 0.25em solid var(--amber); }
.points-label { font: 800 0.62em var(--f-display); letter-spacing: 0.3em; color: var(--amber); writing-mode: vertical-rl; transform: rotate(180deg); align-self: center; }
.points-n { font: 800 3.1em/1 var(--f-mono); color: var(--ink); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; text-shadow: 0 0 0.4em rgba(255, 176, 46, 0.25), var(--shadow); }
.chat { width: 100%; order: -1; margin-bottom: 0.5em; text-transform: none; font-family: var(--f-body); }
.chat-log { max-height: 11em; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; font-size: 0.82em; line-height: 1.35; text-shadow: var(--shadow); }
.chat.open .chat-log { overflow-y: auto; background: rgba(6, 7, 8, 0.6); padding: 0.4em 0.6em; }
.chat .cl { padding: 0.08em 0; transition: opacity 0.8s; word-break: break-word; }
.chat .cl.old { opacity: 0; }
.chat.open .cl.old { opacity: 1; }
.chat-row { display: none; margin-top: 0.3em; pointer-events: auto; }
.chat.open .chat-row { display: flex; }
.chat-prompt { font: 800 0.66em var(--f-display); letter-spacing: 0.2em; color: var(--amber); background: rgba(6, 7, 8, 0.85); padding: 0.9em 0.7em; }
.chat.open .chat-input { background: rgba(6, 7, 8, 0.85); border-color: var(--amber); }

/* bottom-right */
.h-br { right: var(--edge); bottom: calc(var(--edge) * 0.8); display: flex; flex-direction: column; align-items: flex-end; gap: 0.35em; min-width: 12em; text-shadow: var(--shadow); }
.w-head { display: flex; align-items: center; gap: 0.7em; }
.w-name { font: 800 1.2em var(--f-display); letter-spacing: 0.2em; color: var(--ink-dim); }
.w-up { display: none; font: 800 0.55em var(--f-display); letter-spacing: 0.2em; padding: 0.2em 0.5em; color: #1a1205; background: var(--amber); }
.upgraded .w-up { display: inline-block; }
.upgraded .w-name { color: var(--amber-hi); }
.w-ammo { display: flex; align-items: baseline; gap: 0.35em; font-family: var(--f-mono); }
.w-clip { font: 800 4.2em/0.9 var(--f-mono); color: var(--ink); font-variant-numeric: tabular-nums; letter-spacing: -0.03em; }
.w-sep { font-size: 1.8em; color: var(--ink-faint); }
.w-res { font: 700 2em/1 var(--f-mono); color: var(--ink-dim); font-variant-numeric: tabular-nums; }
.low .w-clip { color: var(--amber); }
.dry .w-clip { color: var(--red); }
.w-cue { font: 800 1.05em var(--f-display); letter-spacing: 0.3em; color: var(--amber); opacity: 0; height: 1.2em; }
.w-cue.on { opacity: 1; animation: blink 0.8s steps(2) infinite; }
.w-cue.empty { color: var(--red); }
.w-alt { font: 600 0.72em var(--f-mono); color: var(--ink-faint); letter-spacing: 0.08em; }
.nades { display: flex; gap: 0.4em; min-height: 1.3em; color: #cfc9b8; }
.nade { width: 0.9em; height: 1.2em; display: inline-block; }
.nade svg { width: 100%; height: 100%; display: block; }

/* banner */
.banner { inset: 0; display: grid; place-items: center; pointer-events: none; }
.banner-in { position: relative; display: flex; flex-direction: column; align-items: center; gap: 0.5em; padding: 1.6em 5em; background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.78) 30%, rgba(0, 0, 0, 0) 72%); margin-top: -8%; }
.bn-word { color: var(--amber); filter: drop-shadow(0 0 0.4em rgba(255, 176, 46, 0.5)); }
.bn-digits { color: var(--ink); filter: drop-shadow(0 0 0.5em rgba(255, 255, 255, 0.25)); }
.bn-num svg { width: auto; }
.bn-tally { color: #d8d2bf; height: 1.8em; }
.bn-tally svg { height: 100%; width: auto; }
.bn-sub { font: 700 0.85em var(--f-display); letter-spacing: 0.4em; color: var(--ink-dim); }
.banner-in.crawler .bn-word { color: var(--red); filter: drop-shadow(0 0 0.5em rgba(255, 40, 20, 0.7)); animation: jitter 0.18s steps(2) infinite; }
.banner-in.crawler .bn-digits { color: #ffd9d2; }
.banner-in.crawler .bn-sub { color: #ff9a8c; }
.bn-haz { align-self: stretch; height: 0.7em; background: repeating-linear-gradient(-45deg, var(--red) 0 0.7em, #0c0c0d 0.7em 1.4em); }
@keyframes jitter { 0% { transform: translate(0, 0); } 50% { transform: translate(0.05em, -0.03em); } 100% { transform: translate(-0.05em, 0.03em); } }

/* scoreboard */
.board { left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(92%, 46em); display: none; background: rgba(8, 9, 10, 0.92); border: 1px solid var(--line); border-top: 0.3em solid var(--amber); padding: 0.8em 1.2em 1em; }
.board.on { display: block; }
.bd-head { display: flex; justify-content: space-between; font: 800 1.1em var(--f-display); letter-spacing: 0.3em; padding: 0 0.3em 0.6em; }
.bd-round { color: var(--amber); }
.bd-table td { font-size: 0.95em; }
.bd-table tr.you td { background: rgba(255, 176, 46, 0.1); }
.bd-table tr.dead td { opacity: 0.5; }
.bd-name { font-weight: 800; letter-spacing: 0.1em; }
.bd-state { text-align: right; font: 800 0.7em var(--f-display); letter-spacing: 0.2em; color: var(--green); }
.bd-state.s-down { color: var(--red); } .bd-state.s-dead { color: var(--ink-faint); }
.bd-ping { color: var(--ink-faint); font-size: 0.8em; }

/* ------------------------------------------------------------------ small screens / motion */
@media (max-width: 1100px) {
  .menu-main { flex-direction: column; margin-left: 0; width: 100%; }
  .room-board { flex: none; width: min(100%, 36em); max-height: 40vh; }
  .title-wrap { grid-template-columns: 1fr; gap: 1.6em; justify-items: center; }
  .brand { align-items: center; }
  .lb-grid { grid-template-columns: 16em minmax(0, 1fr) 14em; gap: 0.8em; }
}
@media (max-height: 640px) {
  .screen { padding: 1.2em 1.6em; }
  .tc-rows { display: none; }
  .timecard { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .hud-vig.on { animation: none; }
  .timecard { transform: none; }
}

/* the pause menu covers the middle of the screen: no crosshair or interaction prompt behind it */
.ui[data-screen="pause"] .xh, .ui[data-screen="pause"] .prompt { display: none; }
