/* ASCII TRON — main stylesheet. Everything is text; the chrome is drawn with box characters. */
@font-face { font-family: 'JetBrains Mono'; src: url('/assets/fonts/JetBrainsMono-Regular.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'JetBrains Mono'; src: url('/assets/fonts/JetBrainsMono-Bold.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'JetBrains Mono'; src: url('/assets/fonts/JetBrainsMono-ExtraBold.woff2') format('woff2'); font-weight: 800; font-display: swap; }

/* ---------- themes ---------- */
:root, [data-theme="grid"] {
  --pri: #00eaff; --pri-rgb: 0, 234, 255;
  --sec: #ff9a1f; --sec-rgb: 255, 154, 31;
  --acc: #ff2bd6; --acc-rgb: 255, 43, 214;
  --bg: #02050a; --bg2: #041019;
  --txt: #d3f4ff; --dim: #4f8196; --faint: #16384a;
  --ok: #5dff7a; --bad: #ff3b5c; --warn: #ffe14d;
}
[data-theme="clu"]     { --pri: #ff9a1f; --pri-rgb: 255,154,31;  --sec: #ffd000; --sec-rgb: 255,208,0;  --acc: #ff3b3b; --acc-rgb: 255,59,59;  --bg: #0a0502; --bg2: #180b03; --txt: #ffe9d2; --dim: #9a6a3e; --faint: #3a220f; }
[data-theme="mcp"]     { --pri: #ff2a3d; --pri-rgb: 255,42,61;   --sec: #ff9a9a; --sec-rgb: 255,154,154; --acc: #ffd200; --acc-rgb: 255,210,0; --bg: #0a0204; --bg2: #19050a; --txt: #ffdfe2; --dim: #9a4650; --faint: #3a1219; }
[data-theme="encom"]   { --pri: #e8fbff; --pri-rgb: 232,251,255; --sec: #6fd6ff; --sec-rgb: 111,214,255; --acc: #b8a7ff; --acc-rgb: 184,167,255; --bg: #04060a; --bg2: #0b1119; --txt: #f4fdff; --dim: #7890a0; --faint: #1d2a36; }
[data-theme="synth"]   { --pri: #ff2bd6; --pri-rgb: 255,43,214;  --sec: #00eaff; --sec-rgb: 0,234,255;   --acc: #ffe14d; --acc-rgb: 255,225,77;  --bg: #0a0212; --bg2: #170527; --txt: #ffe2fa; --dim: #92558f; --faint: #33143f; }
[data-theme="phosphor"]{ --pri: #3dff7a; --pri-rgb: 61,255,122;  --sec: #b6ff3d; --sec-rgb: 182,255,61;  --acc: #00ffc8; --acc-rgb: 0,255,200;   --bg: #020a04; --bg2: #06180b; --txt: #d8ffe4; --dim: #4c8a5d; --faint: #123a1d; }
[data-theme="bit"]     { --pri: #ffe14d; --pri-rgb: 255,225,77;  --sec: #ff9a1f; --sec-rgb: 255,154,31;  --acc: #00eaff; --acc-rgb: 0,234,255;   --bg: #080702; --bg2: #171405; --txt: #fff8d6; --dim: #978a45; --faint: #37310f; }

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--txt); overflow: hidden; }
body {
  font-family: 'JetBrains Mono', ui-monospace, 'DejaVu Sans Mono', Menlo, Consolas, monospace;
  font-size: 14px; line-height: 1.35; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  -webkit-tap-highlight-color: transparent; user-select: none;
}
a { color: var(--pri); text-decoration: none; }
a:hover { text-shadow: 0 0 8px var(--pri); }
button, input, select, textarea { font: inherit; color: inherit; }
pre, code, kbd, samp { font-family: inherit; }
::selection { background: var(--pri); color: var(--bg); }
.glow { text-shadow: 0 0 6px rgba(var(--pri-rgb), .8), 0 0 18px rgba(var(--pri-rgb), .45); }
.c-pri { color: var(--pri); } .c-sec { color: var(--sec); } .c-acc { color: var(--acc); } .c-dim { color: var(--dim); } .c-ok { color: var(--ok); } .c-bad { color: var(--bad); } .c-warn { color: var(--warn); }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* scrollbars */
* { scrollbar-width: thin; scrollbar-color: rgba(var(--pri-rgb), .45) transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(var(--pri-rgb), .35); }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- layers ---------- */
#world, #fx { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; z-index: 0; }
#fx { z-index: 1; pointer-events: none; }
body.fx-on #world { visibility: hidden; }
body:not(.fx-on) #fx { display: none; }
#scan { position: fixed; inset: 0; z-index: 2; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(0,0,0,.18) 0 1px, transparent 1px 3px),
              radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,.55) 100%); }
body.fx-on #scan { background: none; }
#app { position: fixed; inset: 0; z-index: 3; overflow: hidden; }
#hud { position: fixed; inset: 0; z-index: 4; pointer-events: none; }
#overlay { position: fixed; inset: 0; z-index: 6; pointer-events: none; }
#overlay > * { pointer-events: auto; }
#banner { position: fixed; top: 0; left: 0; right: 0; z-index: 7; }
#bit { position: fixed; right: 12px; bottom: 10px; z-index: 8; }
#toasts { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 9; display: flex; flex-direction: column; gap: 6px; align-items: center; pointer-events: none; }
#boot { position: fixed; inset: 0; z-index: 20; pointer-events: none; }
#boot:empty { display: none; }
#boot > * { pointer-events: auto; }
body.in-game #banner { display: none; }

/* ---------- screens ---------- */
.screen { position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden; padding: 64px 16px 110px; animation: screenIn .35s ease-out; }
.screen.center { display: flex; flex-direction: column; align-items: center; justify-content: center; padding-top: 40px; }
.screen .wrap { max-width: 1180px; margin: 0 auto; }
.screen.dim-bg { background: radial-gradient(ellipse at center, rgba(0,0,0,.35), rgba(0,0,0,.72) 75%); }
@keyframes screenIn { from { opacity: 0; transform: translateY(8px) scale(.995); filter: blur(2px); } to { opacity: 1; transform: none; filter: none; } }

pre.fig { margin: 0; line-height: 1.02; white-space: pre; font-weight: 800; letter-spacing: 0; }
.title-fig { color: var(--pri); text-shadow: 0 0 6px rgba(var(--pri-rgb), .9), 0 0 24px rgba(var(--pri-rgb), .5), 0 0 60px rgba(var(--pri-rgb), .25); }
.title-fig.glitch { animation: glitch 6s infinite; }
@keyframes glitch {
  /* jitter only: no clip-path/filter, so the glowing logo is never cropped */
  0%, 88%, 92%, 95%, 97.5%, 100% { transform: none; opacity: 1; }
  89% { transform: translate(3px, 0) skewX(-8deg); }
  90% { transform: translate(-4px, 1px) skewX(4deg); opacity: .82; }
  91% { transform: translate(2px, -1px); }
  96% { transform: translate(-2px, 0) skewX(3deg); opacity: .9; }
}
.subtitle { color: var(--sec); letter-spacing: .25em; text-shadow: 0 0 8px rgba(var(--sec-rgb), .8); font-weight: 700; }
.caret::after { content: '█'; animation: blink 1s steps(2) infinite; margin-left: 2px; color: var(--pri); }
@keyframes blink { 50% { opacity: 0; } }

/* page headers */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 0 0 18px; }
.page-head .fig { color: var(--pri); }
.crumb { color: var(--dim); font-size: 12px; letter-spacing: .1em; }
.crumb b { color: var(--pri); }

/* ---------- main menu ---------- */
.menu { display: flex; flex-direction: column; align-items: center; margin-top: 2.5vh; }
.menu-item { position: relative; background: none; border: 0; padding: .1em 1.4em; cursor: pointer; color: var(--dim); transition: color .12s, transform .12s; outline: none; }
.menu-item pre { font-weight: 700; }
.menu-item::before, .menu-item::after { position: absolute; top: 50%; transform: translateY(-50%); opacity: 0; color: var(--sec); font-weight: 800; transition: opacity .1s; font-size: 1.4em; }
.menu-item::before { content: '▶'; left: 0; }
.menu-item::after { content: '◀'; right: 0; }
.menu-item.sel, .menu-item:hover, .menu-item:focus-visible { color: var(--pri); text-shadow: 0 0 8px rgba(var(--pri-rgb), .9), 0 0 22px rgba(var(--pri-rgb), .5); transform: scale(1.04); }
.menu-item.sel::before, .menu-item.sel::after { opacity: 1; animation: nudge .6s ease-in-out infinite alternate; }
@keyframes nudge { to { margin: 0 -4px; } }
.menu-foot { margin-top: 3vh; color: var(--dim); font-size: 12px; text-align: center; letter-spacing: .08em; }
.menu-foot b { color: var(--pri); }
.menu-hint { color: var(--dim); font-size: 11px; margin-top: 6px; opacity: .8; }
.kbd { display: inline-block; border: 1px solid rgba(var(--pri-rgb), .5); padding: 0 .4em; color: var(--pri); border-radius: 2px; font-size: .92em; line-height: 1.35; box-shadow: 0 0 6px rgba(var(--pri-rgb), .25) inset; }

/* ---------- ascii frame panels ---------- */
.panel { position: relative; padding: 1.6em 1.9em 1.4em; margin: 0 0 16px; }
.panel > .frame { position: absolute; inset: 0; margin: 0; pointer-events: none; color: rgba(var(--pri-rgb), .75); line-height: inherit; white-space: pre; overflow: hidden; text-shadow: 0 0 6px rgba(var(--pri-rgb), .45); }
.panel.bg > .frame { background: linear-gradient(180deg, rgba(var(--pri-rgb), .045), rgba(0,0,0,.35)); }
.panel.sec > .frame { color: rgba(var(--sec-rgb), .8); text-shadow: 0 0 6px rgba(var(--sec-rgb), .45); }
.panel.acc > .frame { color: rgba(var(--acc-rgb), .8); text-shadow: 0 0 6px rgba(var(--acc-rgb), .45); }
.panel > .content { position: relative; }
.panel h2, .panel h3 { margin: 0 0 .6em; font-size: 14px; letter-spacing: .14em; color: var(--sec); font-weight: 800; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 0 18px; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0 18px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

/* ---------- buttons & controls ---------- */
.btn { background: transparent; border: 0; padding: .35em .2em; cursor: pointer; color: var(--pri); font-weight: 700; letter-spacing: .06em; white-space: nowrap; text-shadow: 0 0 6px rgba(var(--pri-rgb), .6); outline: none; transition: color .1s, text-shadow .1s, transform .1s; }
.btn::before { content: '[ '; color: var(--dim); }
.btn::after { content: ' ]'; color: var(--dim); }
.btn:hover, .btn:focus-visible { color: #fff; text-shadow: 0 0 8px rgba(var(--pri-rgb), 1), 0 0 20px rgba(var(--pri-rgb), .7); }
.btn:hover::before, .btn:focus-visible::before { content: '▶ '; color: var(--sec); }
.btn:hover::after, .btn:focus-visible::after { content: ' ◀'; color: var(--sec); }
.btn:active { transform: scale(.97); }
.btn.big { font-size: 1.25em; padding: .5em .4em; }
.btn.sec { color: var(--sec); text-shadow: 0 0 6px rgba(var(--sec-rgb), .6); }
.btn.acc { color: var(--acc); text-shadow: 0 0 6px rgba(var(--acc-rgb), .6); }
.btn.bad { color: var(--bad); text-shadow: 0 0 6px rgba(255, 59, 92, .6); }
.btn.ghost { color: var(--dim); text-shadow: none; }
.btn[disabled] { opacity: .35; cursor: not-allowed; }
.btn.pulse { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { text-shadow: 0 0 14px rgba(var(--pri-rgb), 1), 0 0 36px rgba(var(--pri-rgb), .8); color: #fff; } }

.field { display: flex; align-items: center; gap: .8em; margin: .45em 0; flex-wrap: wrap; }
.field > label, .field > .lbl { min-width: 16ch; color: var(--dim); letter-spacing: .06em; }
.field > label::after, .field > .lbl::after { content: ' ..........'; color: var(--faint); }
.inp { background: rgba(0,0,0,.45); border: 0; border-bottom: 1px dashed rgba(var(--pri-rgb), .55); color: #fff; padding: .25em .4em; outline: none; min-width: 12ch; caret-color: var(--sec); }
.inp:focus { border-bottom: 1px solid var(--pri); box-shadow: 0 6px 12px -8px rgba(var(--pri-rgb), .8); }
textarea.inp { width: 100%; min-height: 8em; border: 1px dashed rgba(var(--pri-rgb), .45); resize: vertical; user-select: text; }
select.inp { appearance: none; padding-right: 1.4em; background-image: linear-gradient(45deg, transparent 50%, var(--pri) 50%), linear-gradient(135deg, var(--pri) 50%, transparent 50%); background-position: calc(100% - 10px) 55%, calc(100% - 5px) 55%; background-size: 5px 5px; background-repeat: no-repeat; }
select.inp option { background: var(--bg2); }
.cycle { display: inline-flex; align-items: center; gap: .3em; }
.cycle button { background: none; border: 0; color: var(--sec); cursor: pointer; font-weight: 800; padding: 0 .35em; }
.cycle button:hover { color: #fff; text-shadow: 0 0 8px var(--sec); }
.cycle .val { min-width: 14ch; text-align: center; color: #fff; text-shadow: 0 0 6px rgba(var(--pri-rgb), .7); }
.check { background: none; border: 0; color: var(--txt); cursor: pointer; padding: 0; }
.check .box { color: var(--pri); }
.check.on .box { color: var(--ok); text-shadow: 0 0 8px var(--ok); }
.slider { display: inline-flex; align-items: center; gap: .5em; cursor: pointer; touch-action: none; }
.slider .bar { color: var(--pri); letter-spacing: -.02em; text-shadow: 0 0 6px rgba(var(--pri-rgb), .7); }
.slider .bar i { font-style: normal; color: var(--faint); text-shadow: none; }
.slider .num { color: #fff; min-width: 4ch; text-align: right; }
.slider:focus-visible { outline: 1px dashed var(--sec); }

/* tables */
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; color: var(--sec); font-weight: 800; letter-spacing: .1em; font-size: 12px; padding: .4em .6em; border-bottom: 1px dashed rgba(var(--sec-rgb), .5); white-space: nowrap; }
.tbl td { padding: .45em .6em; border-bottom: 1px dotted rgba(var(--pri-rgb), .16); vertical-align: middle; }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: rgba(var(--pri-rgb), .07); color: #fff; }
.tbl tr.me td { background: rgba(var(--sec-rgb), .09); }
.num { text-align: right; font-variant-numeric: tabular-nums; }

.tabs { display: flex; gap: .2em; flex-wrap: wrap; margin-bottom: 10px; }
.tab { background: none; border: 0; cursor: pointer; color: var(--dim); padding: .3em .6em; letter-spacing: .08em; font-weight: 700; }
.tab.on { color: var(--bg); background: var(--pri); box-shadow: 0 0 14px rgba(var(--pri-rgb), .6); }
.tab:not(.on):hover { color: var(--pri); }

.tag { display: inline-block; padding: 0 .45em; border: 1px solid currentColor; font-size: 11px; letter-spacing: .08em; line-height: 1.5; }
.dot { display: inline-block; width: .8em; height: .8em; vertical-align: -.05em; box-shadow: 0 0 8px currentColor; background: currentColor; }

/* ---------- banner ---------- */
.bn { display: flex; justify-content: center; align-items: center; gap: 1em; padding: 6px 42px 6px 14px; font-size: 12px; letter-spacing: .08em; background: linear-gradient(90deg, transparent, rgba(var(--pri-rgb), .16), transparent); color: var(--txt); border-bottom: 1px dashed rgba(var(--pri-rgb), .45); position: relative; overflow: hidden; white-space: nowrap; }
.bn .bn-text { overflow: hidden; text-overflow: ellipsis; }
.bn.event { background: linear-gradient(90deg, transparent, rgba(var(--acc-rgb), .2), transparent); border-color: rgba(var(--acc-rgb), .6); }
.bn.warn { background: linear-gradient(90deg, transparent, rgba(255, 225, 77, .18), transparent); border-color: rgba(255, 225, 77, .6); color: var(--warn); }
.bn.glitch .bn-text { animation: glitch 3s infinite; }
.bn a { color: #fff; text-decoration: underline dotted; }
.bn .x { position: absolute; right: 8px; background: none; border: 0; color: var(--dim); cursor: pointer; }
.bn .x:hover { color: #fff; }

/* ---------- toasts ---------- */
.toast { background: rgba(2, 8, 14, .92); border: 1px solid rgba(var(--pri-rgb), .6); color: var(--txt); padding: .5em 1em; box-shadow: 0 0 18px rgba(var(--pri-rgb), .3); animation: toastIn .25s ease-out; max-width: 90vw; }
.toast.bad { border-color: var(--bad); box-shadow: 0 0 18px rgba(255, 59, 92, .35); }
.toast.ok { border-color: var(--ok); }
.toast::before { content: '» '; color: var(--sec); }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } }

/* ---------- modal ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(0, 3, 8, .72); backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 30; animation: fadeIn .2s; }
.modal { width: min(820px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: rgba(2, 8, 14, .96); }
@keyframes fadeIn { from { opacity: 0; } }

/* ---------- boot ---------- */
.boot { position: absolute; inset: 0; background: #000; color: var(--pri); padding: 6vh 6vw; font-size: 14px; cursor: pointer; display: flex; flex-direction: column; justify-content: flex-start; transition: opacity .45s, filter .45s; }
.boot pre { margin: 0; white-space: pre-wrap; text-shadow: 0 0 6px rgba(var(--pri-rgb), .8); }
.boot .ok { color: var(--ok); }
.boot .press { margin-top: 2em; color: #fff; font-weight: 800; letter-spacing: .2em; animation: blink 1.1s steps(2) infinite; }
.boot.gone { opacity: 0; filter: blur(6px) brightness(3); pointer-events: none; }

/* ---------- Bit assistant ---------- */
.bit-wrap { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.bit-say { max-width: min(360px, 70vw); background: rgba(2, 8, 14, .9); position: relative; padding: .7em 1em; font-size: 12.5px; line-height: 1.45; color: var(--txt); border: 1px solid rgba(var(--c, var(--pri-rgb)), .8); box-shadow: 0 0 16px rgba(var(--c, var(--pri-rgb)), .35); transform-origin: bottom right; animation: sayIn .22s ease-out; user-select: text; }
.bit-say::after { content: '╲'; position: absolute; right: 22px; bottom: -1.05em; color: rgba(var(--c, var(--pri-rgb)), .9); font-size: 14px; }
.bit-say .who { color: rgb(var(--c, var(--pri-rgb))); font-weight: 800; margin-right: .5em; }
.bit-say.out { animation: sayOut .25s ease-in forwards; }
@keyframes sayIn { from { opacity: 0; transform: scale(.7) translateY(8px); } }
@keyframes sayOut { to { opacity: 0; transform: scale(.85) translateY(6px); } }
.bit-body { cursor: pointer; line-height: .98; font-size: 12px; font-weight: 800; margin: 0; white-space: pre; color: rgb(var(--c, var(--pri-rgb))); text-shadow: 0 0 6px rgba(var(--c, var(--pri-rgb)), .95), 0 0 16px rgba(var(--c, var(--pri-rgb)), .6); transition: color .2s; background: radial-gradient(circle, rgba(var(--c, var(--pri-rgb)), .14), transparent 70%); padding: 4px; }
.bit-body:hover { filter: brightness(1.3); }
.bit-label { font-size: 9px; letter-spacing: .3em; color: var(--dim); text-align: center; width: 100%; }
body.in-game .bit-body { font-size: 10px; opacity: .85; }
body.in-game .bit-say { font-size: 11.5px; max-width: min(300px, 60vw); }

/* ---------- lobby ---------- */
.code-big { font-size: 28px; font-weight: 800; letter-spacing: .35em; color: var(--sec); text-shadow: 0 0 10px rgba(var(--sec-rgb), .9), 0 0 30px rgba(var(--sec-rgb), .4); }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 0 14px; }
.slot { min-height: 118px; }
.slot .nm { font-weight: 800; font-size: 15px; letter-spacing: .06em; }
.slot .meta { color: var(--dim); font-size: 12px; }
.slot .ava { font-weight: 800; font-size: 18px; margin-right: .4em; }
.slot.empty { opacity: .55; }
.slot.empty:hover { opacity: 1; }
.chat-log { height: 190px; overflow-y: auto; font-size: 12.5px; user-select: text; }
.chat-log .sys { color: var(--dim); font-style: italic; }
.ai-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 0 12px; }
.ai-card { cursor: pointer; }
.ai-card:hover .frame { color: var(--sec) !important; }
.ai-card.sel .frame { color: var(--ok) !important; text-shadow: 0 0 8px var(--ok) !important; }
.tier { color: var(--warn); letter-spacing: -.05em; }
.brainbar { color: var(--acc); letter-spacing: -.05em; }
.lobby-row td:first-child { font-weight: 800; }

/* ---------- scoreboard ---------- */
.thumb { display: block; width: 168px; height: 95px; image-rendering: auto; background: #000; box-shadow: 0 0 0 1px rgba(var(--pri-rgb), .35), 0 0 14px rgba(var(--pri-rgb), .15); }
.thumb.lg { width: 100%; height: auto; aspect-ratio: 16 / 9; }
.rank-1 td { color: var(--warn); }
.rank-2 td, .rank-3 td { color: #fff; }
.tagbig { font-size: 20px; font-weight: 800; letter-spacing: .18em; color: var(--acc); text-shadow: 0 0 10px rgba(var(--acc-rgb), .8); }
.share { display: flex; gap: .4em; flex-wrap: wrap; }

/* ---------- HUD ---------- */
.hud-tl, .hud-tr, .hud-bl, .hud-br, .hud-tc, .hud-bc { position: absolute; font-size: 12.5px; text-shadow: 0 0 6px rgba(0,0,0,.9); }
.hud-tl { top: 10px; left: 12px; }
.hud-tr { top: 10px; right: 12px; text-align: right; }
.hud-tc { top: 10px; left: 50%; transform: translateX(-50%); text-align: center; white-space: nowrap; }
.hud-bl { bottom: 12px; left: 12px; }
.hud-bc { bottom: 16px; left: 50%; transform: translateX(-50%); text-align: center; }
.hud-box { background: rgba(0, 4, 8, .55); padding: .45em .8em; border: 1px solid rgba(var(--pri-rgb), .35); box-shadow: 0 0 12px rgba(var(--pri-rgb), .12) inset; }
.hud-players div { white-space: pre; }
.hud-players .dead { opacity: .4; text-decoration: line-through; }
.hud-players .me { font-weight: 800; }
.hud-meter { white-space: pre; font-size: 14px; }
.hud-meter .full { text-shadow: 0 0 8px currentColor; }
.hud-feed { display: flex; flex-direction: column-reverse; gap: 2px; align-items: center; font-size: 12.5px; }
.hud-feed div { animation: toastIn .2s; background: rgba(0,0,0,.5); padding: 1px 8px; }
.hud-center { position: absolute; left: 50%; top: 40%; transform: translate(-50%, -50%); text-align: center; pointer-events: none; }
.hud-center .fig { color: #fff; text-shadow: 0 0 10px rgba(var(--pri-rgb), 1), 0 0 30px rgba(var(--pri-rgb), .7); }
.hud-center .sub { margin-top: .6em; color: var(--sec); letter-spacing: .25em; font-weight: 800; text-shadow: 0 0 8px rgba(var(--sec-rgb), .8); }
.hud-center.pop { animation: pop .35s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes pop { from { transform: translate(-50%, -50%) scale(1.8); opacity: 0; } }
.minimap { display: block; image-rendering: pixelated; border: 1px solid rgba(var(--pri-rgb), .4); background: rgba(0,0,0,.6); }
.warn-collapse { color: var(--bad); font-weight: 800; animation: blink .6s steps(2) infinite; }
.hud-debug { position: absolute; right: 12px; top: 190px; width: 330px; max-height: calc(100vh - 240px); overflow: hidden; font-size: 10.5px; line-height: 1.25; pointer-events: none; }
.hud-debug canvas { display: block; }
.touch-pad { position: absolute; inset: 0; pointer-events: auto; }
.touch-boost { position: absolute; right: 18px; bottom: 90px; width: 86px; height: 86px; border-radius: 50%; border: 2px solid rgba(var(--sec-rgb), .8); color: var(--sec); display: flex; align-items: center; justify-content: center; font-weight: 800; pointer-events: auto; background: rgba(0,0,0,.3); user-select: none; touch-action: none; }

/* escape menu */
.esc { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0, 2, 6, .72); backdrop-filter: blur(2px); z-index: 25; }
.esc .menu-item pre { font-size: 12px; }

/* results */
.results .tbl td { font-size: 13.5px; }
.tag-input { display: flex; gap: .5em; justify-content: center; margin: .6em 0; }
.tag-input input { width: 1.6em; font-size: 40px; font-weight: 800; text-align: center; background: rgba(0,0,0,.5); border: 0; border-bottom: 3px solid var(--acc); color: var(--acc); text-shadow: 0 0 12px rgba(var(--acc-rgb), .9); outline: none; text-transform: uppercase; caret-color: transparent; padding: 0; }
.tag-input input:focus { border-bottom-color: #fff; background: rgba(var(--acc-rgb), .12); animation: pulseB 1s infinite; }
@keyframes pulseB { 50% { border-bottom-color: var(--acc); } }

/* content pages */
.prose { max-width: 78ch; line-height: 1.65; user-select: text; }
.prose h1 { color: var(--pri); font-size: 18px; letter-spacing: .12em; margin: 0 0 .6em; }
.prose h2 { color: var(--sec); font-size: 15px; letter-spacing: .12em; margin: 1.6em 0 .5em; }
.prose h2::before { content: '## '; color: var(--dim); }
.prose ul { padding-left: 0; list-style: none; }
.prose li::before { content: '» '; color: var(--sec); }
.prose code { color: var(--acc); }
.prose strong { color: #fff; text-shadow: 0 0 6px rgba(var(--pri-rgb), .6); }
.legend { display: grid; grid-template-columns: 4ch 1fr; gap: .4em 1em; align-items: baseline; }
.legend .g { font-weight: 800; font-size: 18px; text-align: center; text-shadow: 0 0 8px currentColor; }
pre.diagram { margin: 0; line-height: 1.1; color: var(--txt); font-size: 13px; overflow-x: auto; }

.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch { background: none; border: 1px dashed var(--faint); cursor: pointer; padding: .5em .8em; text-align: left; min-width: 150px; }
.swatch.on { border: 1px solid var(--pri); box-shadow: 0 0 14px rgba(var(--pri-rgb), .5); }
.swatch .sw { display: inline-flex; gap: 2px; margin-right: .5em; }
.swatch .sw i { width: 12px; height: 12px; display: inline-block; }

.fps { position: fixed; left: 6px; bottom: 4px; z-index: 50; font-size: 10px; color: var(--dim); pointer-events: none; }

@media (max-width: 720px) {
  body { font-size: 13px; }
  .screen { padding: 56px 10px 120px; }
  .panel { padding: 1.4em 1.2em 1.2em; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .field > label, .field > .lbl { min-width: 12ch; }
  .thumb { width: 112px; height: 63px; }
  .hide-sm { display: none !important; }
  .hud-tl, .hud-tr { font-size: 11px; }
  .code-big { font-size: 22px; }
  #bit { right: 6px; bottom: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  .title-fig.glitch, .menu-item.sel::before, .menu-item.sel::after, .btn.pulse { animation: none !important; }
  .screen { animation: none; }
}
body.reduced .title-fig.glitch, body.reduced .btn.pulse { animation: none !important; }
body.in-game #app { display: none; }
body.in-game #scan { opacity: .6; }

/* main menu: soft dark vignette behind the splash so it reads over the live demo match */
.home-splash { background: radial-gradient(ellipse 46% 58% at 50% 50%, rgba(1,4,8,.78), rgba(1,4,8,.45) 55%, transparent 80%); }
.about-hero { display: block; width: 100%; height: auto; margin-bottom: 14px; box-shadow: 0 0 0 1px rgba(var(--pri-rgb), .35), 0 0 30px rgba(var(--pri-rgb), .15); }
@media (max-width: 720px) { .bit-body { font-size: 8.5px; } .bit-say { font-size: 11.5px; } }
