/* Gridline UI: a field map and an orders sheet. Olive-black panels with corner registration marks, chalk text,
   one signal colour (yellow) for what you can act on, red only for danger, team blue/orange for sides.
   Light by design: no blur, no web fonts, numbers in tabular figures, the HUD fades what you don't need. */
:root {
  --ink: #0b0f0d;
  --fg: #e9ece4;
  --dim: rgba(233, 236, 228, 0.6);
  --faint: rgba(233, 236, 228, 0.32);
  --panel: rgba(11, 15, 13, 0.86);
  --panel-2: rgba(233, 236, 228, 0.05);
  --line: rgba(233, 236, 228, 0.16);
  --north: #4aa3ff;
  --south: #ff7a2e;
  --accent: #f2c14e;
  --danger: #ff4a3a;
  --good: #8fd28a;
  --font: "Bahnschrift", "DIN Alternate", "Barlow Condensed", "Roboto Condensed", "Arial Narrow", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  /* motion: everything that opens, closes or moves eases in and out, just long enough to see (the camera never cuts) */
  --ease: cubic-bezier(.45, 0, .55, 1);
  --t-fast: .14s;
  --t: .24s;
  --t-slow: .34s;
  --rise: 12px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--ink); color: var(--fg); font-family: var(--font); user-select: none; -webkit-user-select: none; touch-action: none; overscroll-behavior: none; font-variant-numeric: tabular-nums; }
canvas#gl, canvas#overlay { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; }
#glWrap { position: fixed; inset: 0; }   /* (moved as one by the lobby's push: the canvas's own transform is the render scale) */
canvas#overlay { pointer-events: none; }
/* the poster (early.js fades it in once loaded; main.js posterOut fades it away over the title's first frame drawn) */
#poster { position: fixed; inset: 0; width: 100vw; height: 100vh; object-fit: cover; pointer-events: none; opacity: 0; transition: opacity .6s ease-out; }
#poster.in { opacity: 1; }
#poster.out { opacity: 0; transition: opacity 1.4s ease-in-out; }
html.poster #menu .panel { opacity: 0; pointer-events: none; }   /* (the menu panel waits while the poster shows; the title stays) */
#menu .panel { transition: opacity 1.4s ease-in-out, translate var(--t-slow) var(--ease); }
/* the loading line (html.loading: early.js after 2 s without the title's first frame; main.js names the step in its span) */
#loading { position: fixed; left: calc(7vw + var(--safe-l)); bottom: calc(6vh + var(--safe-b)); z-index: 2; width: min(260px, 60vw); display: flex; flex-direction: column; gap: 10px; color: var(--dim); font-size: 11px; letter-spacing: .3em; text-transform: uppercase; pointer-events: none; opacity: 0; visibility: hidden; transition: opacity .6s, visibility 0s .6s; }
#loading i { display: block; height: 2px; background: var(--line); position: relative; overflow: hidden; }
#loading i::after { content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 35%; background: var(--fg); opacity: .7; animation: loadSweep 1.6s ease-in-out infinite; }
#loading span::after { content: "…"; }
html.loading #loading { opacity: 1; visibility: visible; transition: opacity .6s; }
@keyframes loadSweep { from { transform: translateX(-100%); } to { transform: translateX(286%); } }
@media (prefers-reduced-motion: reduce) { #loading i::after { animation: none; width: 100%; opacity: .35; } }
@media (max-width: 720px) { #loading { left: 50%; transform: translateX(-50%); align-items: center; text-align: center; } #loading i { align-self: stretch; } }
[hidden] { display: none !important; }
button { font-family: inherit; cursor: pointer; }

/* ---------- shared pieces ---------- */
.panel { background: var(--panel); border: 1px solid var(--line); padding: 22px; border-radius: 2px; }
/* registration marks: an L in each corner, like the corners of a printed map sheet */
.reg { position: relative; --m: 10px; --c: rgba(242, 193, 78, .85);
  background-image:
    linear-gradient(var(--c), var(--c)), linear-gradient(var(--c), var(--c)), linear-gradient(var(--c), var(--c)), linear-gradient(var(--c), var(--c)),
    linear-gradient(var(--c), var(--c)), linear-gradient(var(--c), var(--c)), linear-gradient(var(--c), var(--c)), linear-gradient(var(--c), var(--c));
  background-repeat: no-repeat;
  background-size: var(--m) 2px, 2px var(--m), var(--m) 2px, 2px var(--m), var(--m) 2px, 2px var(--m), var(--m) 2px, 2px var(--m);
  background-position: -1px -1px, -1px -1px, calc(100% + 1px) -1px, calc(100% + 1px) -1px, -1px calc(100% + 1px), -1px calc(100% + 1px), calc(100% + 1px) calc(100% + 1px), calc(100% + 1px) calc(100% + 1px);
  background-color: var(--panel); }
.sect { font-size: 10px; letter-spacing: .3em; text-transform: uppercase; color: var(--faint); margin: 14px 0 6px; display: flex; align-items: center; gap: 8px; }
.sect::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.primary { background: var(--accent); color: #14100a; border: 0; font-weight: 700; letter-spacing: .2em; padding: 14px 24px; font-size: 16px; border-radius: 2px; transition: transform .08s, filter var(--t-fast) var(--ease), outline-color var(--t-fast) var(--ease); display: inline-flex; align-items: center; justify-content: center; gap: 12px; }
.primary:hover { filter: brightness(1.08); }
.primary:active { transform: scale(0.98); }
.primary:disabled { filter: grayscale(1) brightness(.7); cursor: default; }
.primary kbd { background: rgba(20, 16, 10, .14); border-color: rgba(20, 16, 10, .35); color: #14100a; }
.ghost { background: transparent; color: var(--fg); border: 1px solid var(--line); padding: 9px 14px; letter-spacing: .12em; border-radius: 2px; font-size: 12px; text-transform: uppercase; }
.ghost:hover { border-color: var(--fg); }
.hint { color: var(--dim); font-size: 12px; line-height: 1.5; letter-spacing: .03em; margin: 12px 0 0; }
/* key caps: one look everywhere (prompts, pause sheet, deploy, coach lines) */
kbd { display: inline-block; min-width: 1.7em; padding: 1px 6px; border: 1px solid rgba(233, 236, 228, .55); border-bottom-width: 2px; border-radius: 3px; font: 700 .82em/1.45 var(--font); letter-spacing: .04em; text-align: center; color: var(--fg); background: rgba(0, 0, 0, .35); text-transform: none; vertical-align: 1px; }
/* gamepad buttons: rounded caps; face buttons (A B X Y / ✕ ○ □ △) are circles */
kbd.pad { border-radius: 8px; border-bottom-width: 1px; padding: 1px 7px; }
kbd.pad.face { border-radius: 50%; min-width: 1.75em; height: 1.75em; padding: 0; line-height: 1.6em; }

/* ---------- title ---------- */
#menu { position: fixed; inset: 0; display: flex; align-items: center; justify-content: space-between; padding: 6vh 7vw; background: linear-gradient(90deg, rgba(8, 11, 9, .9) 0%, rgba(8, 11, 9, .45) 55%, rgba(8, 11, 9, .1) 100%); gap: 32px; }
#contours { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
#menu .brand, #menu .panel { position: relative; }
#menu .brand .logo { font-size: clamp(52px, 10vw, 132px); line-height: .86; letter-spacing: .02em; font-weight: 300; }
#menu .brand .logo b { font-weight: 800; color: var(--accent); display: block; position: relative; }
#menu .brand .logo b::before { content: ""; position: absolute; left: -4vw; right: -1vw; top: 52%; height: 2px; background: var(--accent); opacity: .5; }
#menu .brand .tag { margin-top: 20px; color: var(--dim); letter-spacing: .42em; font-size: 13px; }
#mapLine { margin-top: 10px; font: 12px/1.6 var(--mono); color: var(--faint); letter-spacing: .06em; }
#menu .panel { width: min(360px, 90vw); display: flex; flex-direction: column; gap: 14px; max-height: 92vh; overflow-x: hidden; overflow-y: auto; touch-action: pan-y; overscroll-behavior-x: none; }
/* a list scrolls one way only: Safari sizes a select to its longest option and won't let it shrink in a flex column,
   which pushed the open settings wider than the panel and let it pan sideways on an iPhone */
#menu .panel > *, #settings label, #settings select, .benchRow > * { min-width: 0; max-width: 100%; }
#menu label, #settings label { display: flex; flex-direction: column; gap: 6px; font-size: 11px; letter-spacing: .16em; color: var(--dim); text-transform: uppercase; }
#menu label.row, #settings label.row { flex-direction: row; align-items: center; text-transform: none; letter-spacing: .04em; font-size: 13px; }
#menu input[type=text], #menu input:not([type]), #settings select { background: rgba(0, 0, 0, .35); color: var(--fg); border: 1px solid var(--line); padding: 11px 12px; font: inherit; font-size: 18px; letter-spacing: .04em; border-radius: 2px; outline: none; }
#menu input:focus, #settings select:focus { border-color: var(--accent); }
#settings input[type=range] { accent-color: var(--accent); }
#settings { text-align: left; border-top: 1px solid var(--line); padding-top: 10px; flex-shrink: 0; }   /* (flex-shrink 0: unfolding, it grows the scrolling panel instead of being squeezed into it) */
#settings > label + label { margin-top: 12px; }
#settings .sect { margin-top: 16px; }
#autoInfo { font-size: 12px; color: var(--dim); letter-spacing: .03em; line-height: 1.4; }   /* what Auto chose: "60 fps · 1412×653 · limited by the CPU" */
#autoInfo:empty, #preferRow[hidden], #fsRow[hidden], #installNote[hidden] { display: none; }
#installNote { font-size: 11px; color: var(--faint); letter-spacing: .04em; text-align: center; }
#pause #settings summary { display: none; }
#pause #settings { border-top: 0; padding-top: 0; }
#settings summary { cursor: pointer; letter-spacing: .16em; font-size: 12px; color: var(--dim); text-transform: uppercase; }
#menuMsg { min-height: 1.2em; font-size: 13px; color: var(--accent); }
.padOnly { display: none !important; }
body.pad .padOnly { display: flex !important; }
#padLegend { gap: 16px; justify-content: center; font-size: 12px; letter-spacing: .1em; color: var(--dim); }
#padLegend span { display: inline-flex; gap: 5px; align-items: center; }
/* the desktop app with no server picked yet (electron/: its own page host, nothing to play on): the title offers only joining one */
html.appHome #menu .panel > :not(#play, #joinServer, #menuMsg, #serverInfo) { display: none; }
html.appHome #menuMsg:empty { display: none; }
#serverInfo { font-size: 12px; color: var(--dim); letter-spacing: .06em; }
#settings .val { color: var(--fg); letter-spacing: .06em; text-transform: none; }
#settings select { font-size: 15px; padding: 8px 10px; }
@media (max-width: 720px) { #menu { flex-direction: column; justify-content: center; padding: 4vh 5vw; } #menu .brand { text-align: center; } #menu .brand .logo b::before { left: 0; right: 0; } }

/* ---------- HUD ---------- */
#hud { position: fixed; inset: 0; pointer-events: none; text-shadow: 0 1px 2px rgba(0, 0, 0, .6); }
#tickets { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 12px; }
#tickets .t { display: flex; align-items: center; gap: 10px; font-size: 22px; font-weight: 700; min-width: 150px; }
#tickets .t0 { color: var(--north); justify-content: flex-end; }
#tickets .t1 { color: var(--south); }
#tickets .bar { width: 96px; height: 4px; background: rgba(255, 255, 255, .14); position: relative; overflow: hidden; }
#tickets .bar i { position: absolute; top: 0; bottom: 0; background: currentColor; transition: width .4s; }
#tickets .t0 .bar i { right: 0; }
#tickets .t1 .bar i { left: 0; }
/* which side you're on: team names under the scores, yours marked YOU and underlined */
#tickets .t { position: relative; }
#tickets .tn { position: absolute; top: 100%; margin-top: 3px; font-size: 10px; letter-spacing: .16em; opacity: .7; white-space: nowrap; }
/* a match's series (rounds won, first to N) under the ticket bar */
#series { position: absolute; top: 50px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 8px; font: 700 10px var(--font); letter-spacing: .2em; color: var(--dim); white-space: nowrap; }
#series[hidden] { display: none; }
#series .pips { display: flex; gap: 3px; } #series .pips i { width: 8px; height: 8px; border: 1.5px solid currentColor; border-radius: 50%; }
#series .pips i.on { background: currentColor; }
#series .p0 { color: var(--north); } #series .p1 { color: var(--south); }
/* medals (MEDALS in constants.js, drawn by medals.js): the toast drops its medal in with a light sweeping across it
   and a slow glow behind; ribbon bars on the scoreboard; medals hung on the round-end card */
#medalToast { position: absolute; top: 72px; left: 50%; transform: translate(-50%, -10px); display: flex; align-items: center; gap: 14px; padding: 10px 20px 10px 14px; background: linear-gradient(90deg, rgba(20, 23, 26, .92), rgba(20, 23, 26, .78)); border: 1px solid rgba(242, 193, 78, .45); box-shadow: 0 0 0 1px rgba(0, 0, 0, .4), 0 6px 24px rgba(0, 0, 0, .45); opacity: 0; transition: opacity .25s, transform .35s cubic-bezier(.2, 1.4, .4, 1); pointer-events: none; white-space: nowrap; overflow: hidden; }
#medalToast.on { opacity: 1; transform: translate(-50%, 0); }
#medalToast .art { position: relative; width: 50px; height: 72px; flex: none; }
#medalToast.on .art .medal { animation: medalDrop .6s cubic-bezier(.2, 1.3, .4, 1) both; transform-origin: 50% 0; }
#medalToast.on .sheen { animation: medalSheen 1.1s .45s ease-in-out both; }
#medalToast .glow { position: absolute; left: 6px; top: 50%; width: 90px; height: 90px; margin-top: -45px; background: repeating-conic-gradient(rgba(242, 193, 78, .22) 0 8deg, transparent 8deg 22deg); border-radius: 50%; -webkit-mask: radial-gradient(circle, #000 20%, transparent 70%); mask: radial-gradient(circle, #000 20%, transparent 70%); animation: medalGlow 6s linear infinite; }
#medalToast small { display: block; font-size: 10px; letter-spacing: .3em; color: var(--accent); }
#medalToast b { display: block; font-size: 19px; letter-spacing: .16em; text-shadow: 0 1px 0 rgba(0, 0, 0, .6); }
#medalToast span { display: block; font-size: 11px; color: var(--dim); letter-spacing: .08em; }
@keyframes medalDrop { 0% { transform: translateY(-34px) rotate(-14deg) scale(1.25); opacity: 0; } 55% { opacity: 1; } 75% { transform: translateY(2px) rotate(4deg) scale(1); } 100% { transform: none; } }
@keyframes medalSheen { from { transform: skewX(-20deg) translateX(0); } to { transform: skewX(-20deg) translateX(130px); } }
@keyframes medalGlow { to { transform: rotate(360deg); } }
.rbar { display: block; filter: drop-shadow(0 1px 0 rgba(0, 0, 0, .5)); }
.rib { display: inline-block; margin-right: 2px; vertical-align: middle; }
#scoreboard td.medals { white-space: nowrap; max-width: 180px; overflow: hidden; }
#scoreboard td.medals .rib { margin-right: 1px; }
#roundEnd .mine { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
#roundEnd .mine .nums { display: grid; grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); gap: 6px 10px; }
#roundEnd .mine .nums small { display: block; font-size: 9px; letter-spacing: .18em; color: var(--dim); }
#roundEnd .mine .nums b { font-size: 18px; }
#roundEnd .mine .medals { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 14px; margin-top: 12px; }
#roundEnd .mine .medals .m { display: flex; flex-direction: column; align-items: center; gap: 3px; width: 92px; font-size: 10px; letter-spacing: .12em; }
#roundEnd .mine .medals .m .medal { filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .5)); }
#roundEnd .mine .medals .m b { text-align: center; line-height: 1.2; }
#roundEnd .mine + .next, #roundEnd .mine + .vote { margin-top: 16px; }
#roundEnd .mine .medals.none { font-size: 11px; letter-spacing: .2em; color: var(--dim); }
#roundEnd .series { margin-top: 10px; font: 700 13px var(--font); letter-spacing: .24em; color: var(--dim); }
#roundEnd .series b { font-size: 20px; margin: 0 6px; } #roundEnd .series .n { color: var(--north); } #roundEnd .series .s { color: var(--south); }
#roundEnd.match .res { font-size: 52px; }
/* the next-map vote on the round-end card */
#roundEnd .vote .opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 6px; margin-top: 10px; }
#roundEnd .vote button { position: relative; overflow: hidden; display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: var(--panel-2); border: 1px solid var(--line); color: var(--fg); font: 700 12px var(--font); letter-spacing: .08em; text-align: left; }
#roundEnd .vote button span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#roundEnd .vote button b { font-size: 15px; }
#roundEnd .vote button i { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--accent); transition: width .3s; }
#roundEnd .vote button.mine { border-color: var(--accent); background: rgba(242, 193, 78, .12); }
#roundEnd .vote button.won { border-color: var(--accent); color: var(--accent); }
#roundEnd .vote button[disabled] { cursor: default; }
#roundEnd .vote button[disabled]:not(.won) { opacity: .55; }
#tickets .t0 .tn { right: 0; }
#tickets .t1 .tn { left: 0; }
#tickets .t.mine .tn { opacity: 1; }
#tickets .t.mine .tn::after { content: ' \00B7  YOU'; color: var(--fg); }
#tickets .t.mine .num { box-shadow: inset 0 -2px 0 currentColor; }
/* your team, by your health: a swatch in its colour and its name */
#teamChip { position: absolute; left: calc(24px + var(--safe-l)); bottom: calc(60px + var(--safe-b)); display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; letter-spacing: .16em; text-shadow: 0 1px 3px rgba(0, 0, 0, .9); }
#teamChip::before { content: ''; width: 10px; height: 10px; background: currentColor; box-shadow: 0 0 0 1px rgba(0, 0, 0, .5); }
#flagrow { display: flex; gap: 5px; }
#flagrow .flag { width: 28px; height: 28px; border: 2px solid #ddd; display: grid; place-items: center; font-weight: 800; font-size: 14px; border-radius: 2px; position: relative; }
#flagrow .flag.hot { animation: hot 1s ease-in-out infinite; }
#flagrow .flag.here::after { content: ""; position: absolute; left: 50%; bottom: -8px; width: 0; height: 0; transform: translateX(-50%); border: 4px solid transparent; border-top: 0; border-bottom-color: var(--accent); }
@keyframes hot { 50% { box-shadow: 0 0 0 3px rgba(242, 193, 78, .35); } }
/* M: the minimap opens out into a bigger round map of the ground around you, north up (the game keeps running
   underneath). It grows from the minimap: .open scales the disc up from the minimap's size and place. */
#bigmap { position: absolute; inset: 0; background: rgba(6, 8, 10, 0); pointer-events: none; z-index: 5; transition: background var(--t) var(--ease); }
#bigmap.open { background: rgba(6, 8, 10, .3); }
/* a slight blur behind the open map, on desktops only (backdrop blur is too dear on phones; see CLAUDE.md) */
@media (pointer: fine) { #bigmap.open { backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); } }
#bigmap .sheet { position: absolute; left: calc(16px + var(--safe-l)); top: 14px;
  transform-origin: 0 0; transform: scale(var(--from, .2)); opacity: .4; transition: transform var(--t) var(--ease), opacity var(--t-fast) var(--ease); }
#bigmap.open .sheet { transform: none; opacity: .9; }   /* the world shows through, just */
#bigmap canvas { display: block; width: min(80vh, 72vw); height: min(80vh, 72vw); border-radius: 10px; }
#bigmap .foot { display: flex; justify-content: center; gap: 18px; margin-top: 8px; text-shadow: 0 1px 2px #000; font: 600 11px var(--mono); letter-spacing: .08em; color: var(--dim); }
#minimap { position: absolute; left: calc(16px + var(--safe-l)); top: 14px; width: 150px; height: 150px; opacity: .9; }
#killfeed { position: absolute; right: calc(12px + var(--safe-r)); top: 36px; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; font-size: 13px; }
#killfeed div { background: rgba(0, 0, 0, .34); padding: 3px 9px; transition: opacity .8s; letter-spacing: .03em; }
#killfeed div.me { background: rgba(242, 193, 78, .2); border-left: 2px solid var(--accent); }
#killfeed .w { color: var(--dim); font-size: 11px; }
#killfeed .fade { opacity: 0; }

/* a magnified scope aimed through (the DMR: main.js G.scoped): the world in a round window, dark round it, a fine crosshair
   thickening toward the edge, a small red centre */
#scope { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle at 50% 50%, transparent 0, transparent 38vmin, rgba(0, 0, 0, .7) 39vmin, #000 40.5vmin); }
#scope i { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); background: rgba(0, 0, 0, .9); }
#scope .h { width: 78vmin; height: 1px; background: linear-gradient(90deg, #000 0 30%, rgba(0, 0, 0, .9) 30% 70%, #000 70%); box-shadow: 0 0 0 .5px rgba(0, 0, 0, .4); }
#scope .v { width: 1px; height: 78vmin; background: linear-gradient(180deg, #000 0 30%, rgba(0, 0, 0, .9) 30% 70%, #000 70%); }
#scope .c { width: 3px; height: 3px; border-radius: 50%; background: #ff3a24; box-shadow: 0 0 3px rgba(255, 60, 30, .8); }
#crosshair { --gap: 8px; position: absolute; left: 50%; top: 50%; width: 0; height: 0; transition: opacity .12s; }
#crosshair i { position: absolute; background: rgba(255, 255, 255, .92); box-shadow: 0 0 2px rgba(0, 0, 0, .8); }
#crosshair .l, #crosshair .r { width: 9px; height: 2px; top: -1px; }
#crosshair .t, #crosshair .b { width: 2px; height: 9px; left: -1px; }
#crosshair .l { right: var(--gap); } #crosshair .r { left: var(--gap); }
#crosshair .t { bottom: var(--gap); } #crosshair .b { top: var(--gap); }
#crosshair .dot { width: 2px; height: 2px; left: -1px; top: -1px; }
#hitmarker { position: absolute; left: 50%; top: 50%; opacity: 0; }
#hitmarker i { position: absolute; width: 11px; height: 2px; background: #fff; box-shadow: 0 0 3px rgba(0,0,0,.6); }
#hitmarker i:nth-child(1) { transform: translate(-16px, -12px) rotate(45deg); }
#hitmarker i:nth-child(2) { transform: translate(5px, -12px) rotate(-45deg); }
#hitmarker i:nth-child(3) { transform: translate(-16px, 10px) rotate(-45deg); }
#hitmarker i:nth-child(4) { transform: translate(5px, 10px) rotate(45deg); }
#hitmarker.head i { background: var(--accent); }
#hitmarker.kill i { background: var(--danger); width: 15px; }
#hitmarker.blast i { height: 3px; width: 14px; }
#hitmarker.kill.blast i { width: 17px; }

/* past the combat area's line (shared/skirt.js): danger red, the seconds left large */
#bounds { position: absolute; top: 22%; left: 50%; transform: translateX(-50%); text-align: center; padding: 12px 26px 10px; --c: rgba(255, 74, 58, .9); background-color: rgba(20, 8, 6, .55); color: var(--danger); pointer-events: none; }
#bounds .t { font-size: 13px; letter-spacing: .3em; font-weight: 700; }
#bounds .n { font-size: 54px; line-height: 1.05; font-variant-numeric: tabular-nums; font-weight: 700; }
#bounds .s { font-size: 11px; letter-spacing: .16em; color: rgba(255, 220, 210, .75); text-transform: uppercase; }
#capture { position: absolute; top: 58px; left: 50%; transform: translateX(-50%); text-align: center; width: 240px; }
#capture .label { font-size: 12px; letter-spacing: .26em; margin-bottom: 5px; }
#capture .bar { height: 5px; background: rgba(255, 255, 255, .14); }
#capture .bar i { display: block; height: 100%; width: 0; transition: width .2s; }
/* the one prompt line: what you can do right now, key first */
#prompt { position: absolute; left: 50%; bottom: calc(50% + 34px); transform: translateX(-50%); display: flex; gap: 14px; align-items: center; font-size: 13px; letter-spacing: .14em; text-transform: uppercase; white-space: nowrap; background: rgba(0, 0, 0, .38); padding: 5px 12px; border-left: 2px solid var(--accent); }
#prompt:empty { display: none; }
#prompt.veh { bottom: calc(22px + var(--safe-b)); }
#prompt .a { display: inline-flex; gap: 7px; align-items: center; }
#prompt .a.known { opacity: .7; }
#prompt .info { color: var(--dim); letter-spacing: .12em; }
#reloadHint { position: absolute; top: calc(50% + 44px); left: 50%; transform: translateX(-50%); font-size: 12px; letter-spacing: .24em; color: var(--accent); white-space: nowrap; }
#coach { position: absolute; left: 50%; bottom: calc(96px + var(--safe-b)); transform: translateX(-50%); font-size: 12px; letter-spacing: .1em; color: var(--dim); display: flex; gap: 16px; white-space: nowrap; transition: opacity .6s; }
#coach.off { opacity: 0; }
#notice { position: absolute; top: 30%; left: 50%; transform: translate(-50%, 8px); font-size: 20px; letter-spacing: .24em; font-weight: 700; opacity: 0; transition: opacity .2s, transform .25s; white-space: nowrap; }
#notice.on { opacity: 1; transform: translate(-50%, 0); }

/* vitals: thin bar + number, and the weapon block; both fade back while nothing changes */
#health, #ammo { transition: opacity .5s; }
#health.idle, #ammo.idle { opacity: .62; }
#health { position: absolute; left: calc(14px + var(--safe-l)); bottom: calc(12px + var(--safe-b)); padding: 6px 46px 6px 10px; background: linear-gradient(to right, rgba(6, 9, 7, .62), rgba(6, 9, 7, .38) 60%, rgba(6, 9, 7, 0)); text-shadow: 0 1px 3px rgba(0, 0, 0, .9); display: flex; align-items: center; gap: 10px; font-size: 30px; font-weight: 700; }
#health .bar { width: 150px; height: 4px; background: rgba(255, 255, 255, .15); }
#health .bar i { display: block; height: 100%; background: var(--fg); transition: width .2s; }
#health.low { color: var(--danger); }
/* help arriving (E.AID): a short line each above the health, fading; the bar flashes green while it heals */
#aidFeed { position: absolute; left: calc(14px + var(--safe-l)); bottom: calc(86px + var(--safe-b)); align-items: flex-start; display: flex; flex-direction: column; gap: 3px; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; pointer-events: none; text-shadow: 0 1px 3px rgba(0, 0, 0, .9); }
#aidFeed div { transition: opacity .6s, transform .3s; white-space: nowrap; padding: 2px 34px 2px 8px; background: linear-gradient(to right, rgba(6, 9, 7, .6), rgba(6, 9, 7, 0)); }
#aidFeed div.new { opacity: 0; transform: translateY(6px); }
#aidFeed div.gone { opacity: 0; }
#aidFeed b { font-weight: 700; margin-right: .5em; }
#health.healed .bar i { background: var(--good) !important; box-shadow: 0 0 8px rgba(143, 210, 138, .8); }
#health.healed span { color: var(--good); }
#ammo .kit { font-size: 11px; letter-spacing: .16em; color: var(--good); margin-top: 2px; }
#ammo .kit.wait { color: var(--dim); }
/* an engineer at work: the vehicle's state while the tools are out */
#repair { position: absolute; left: 50%; bottom: calc(50% - 92px); transform: translateX(-50%); text-align: center; min-width: 240px; white-space: nowrap; }
#repair .label { font-size: 12px; letter-spacing: .26em; margin-bottom: 5px; }
#repair .bar { height: 5px; background: rgba(255, 255, 255, .14); }
#repair .bar i { display: block; height: 100%; width: 0; background: var(--good); transition: width .2s; }
#ammo { position: absolute; right: calc(14px + var(--safe-r)); bottom: calc(10px + var(--safe-b)); text-align: right; padding: 8px 10px 6px 46px; background: linear-gradient(to left, rgba(6, 9, 7, .62), rgba(6, 9, 7, .38) 60%, rgba(6, 9, 7, 0)); text-shadow: 0 1px 3px rgba(0, 0, 0, .9); }
#ammo .wname { font-size: 12px; font-weight: 700; letter-spacing: .24em; color: rgba(233, 236, 228, .88); text-transform: uppercase; }
#ammo .count { font-weight: 700; }
#ammo .mag { font-size: 42px; }
#ammo .res { font-size: 20px; color: rgba(233, 236, 228, .8); margin-left: 6px; }
#ammo .nades { font-size: 13px; color: var(--accent); letter-spacing: .3em; }
#ammo.low .mag { color: var(--danger); }
#chat { position: absolute; left: calc(16px + var(--safe-l)); bottom: 84px; width: min(420px, 60vw); font-size: 13px; }
#chat .log div { padding: 2px 0; transition: opacity 1s; }
#chat .log .fade { opacity: 0; }
#chat input { pointer-events: auto; width: 100%; margin-top: 6px; background: rgba(0, 0, 0, .55); color: #fff; border: 1px solid var(--line); padding: 8px; font: inherit; outline: none; }
/* typing: the chat comes forward (a firmer box, the log fully up) and the world behind it softens a little */
body.chatting #chat input { background: rgba(8, 10, 9, .82); border-color: rgba(242, 193, 78, .7); box-shadow: 0 0 0 1px rgba(242, 193, 78, .25), 0 4px 18px rgba(0, 0, 0, .45); }
body.chatting #chat .log div { opacity: 1 !important; text-shadow: 0 1px 2px #000; }
body.chatting #chat .log { background: linear-gradient(to top, rgba(6, 8, 10, .5), rgba(6, 8, 10, 0)); padding: 6px 8px 2px; margin: 0 -8px; }
#gl { transition: filter .18s; }
body.chatting #gl { filter: brightness(.88); }
@media (pointer: fine) { body.chatting #gl { filter: blur(1.2px) brightness(.88); } }
#netinfo { position: absolute; right: calc(12px + var(--safe-r)); top: 6px; font: 600 12px/1.3 var(--font); letter-spacing: .06em; color: rgba(233, 236, 228, .9); background: rgba(8, 11, 9, .62); padding: 3px 9px; border-radius: 2px; text-shadow: none; font-variant-numeric: tabular-nums; }
#netinfo:empty { display: none; }

/* ---------- vehicles ---------- */
#vehHud { position: absolute; right: calc(14px + var(--safe-r)); bottom: calc(10px + var(--safe-b)); width: 290px; text-align: right; padding: 8px 10px 8px 46px; background: linear-gradient(to left, rgba(6, 9, 7, .62), rgba(6, 9, 7, .38) 60%, rgba(6, 9, 7, 0)); text-shadow: 0 1px 3px rgba(0, 0, 0, .9); }
#vehHud .vname { font-size: 12px; font-weight: 700; letter-spacing: .3em; color: rgba(233, 236, 228, .88); }
#vehHud .hp { height: 6px; background: rgba(255, 255, 255, .15); margin: 6px 0 10px; }
#vehHud .hp i { display: block; height: 100%; margin-left: auto; transition: width .2s; }
#vehHud .fuel { display: flex; align-items: center; gap: 8px; margin: -4px 0 10px; font-size: 10px; letter-spacing: .25em; color: var(--dim); }
#vehHud .fuel[hidden] { display: none; }
#vehHud .fuel b { flex: 1; height: 4px; background: rgba(255, 255, 255, .12); }
#vehHud .fuel b i { display: block; height: 100%; margin-left: auto; transition: width .3s; }
#vehHud .wrow { display: flex; justify-content: space-between; align-items: baseline; font-weight: 700; }
#vehHud .wname { font-size: 12px; letter-spacing: .2em; color: rgba(233, 236, 228, .85); font-weight: 600; }
#vehHud .ammo { font-size: 22px; }
#vehHud .wbar { height: 4px; background: rgba(255, 255, 255, .12); margin-top: 6px; }
#vehHud .wbar i { display: block; height: 100%; }
#vehHud .seats { margin-top: 8px; display: flex; gap: 4px; justify-content: flex-end; font-size: 11px; letter-spacing: .1em; }
#vehHud .seats span { border: 1px solid var(--line); padding: 2px 6px; color: var(--dim); }
#vehHud .seats span.me { border-color: var(--accent); color: var(--accent); }
#vehHud .seats span.taken { color: var(--fg); }

/* ---------- overlays ---------- */
#pause { position: fixed; inset: 0; display: grid; place-items: center; background: rgba(5, 7, 6, .62); }
#pause .panel.small { width: min(460px, 94vw); max-height: 92vh; display: flex; flex-direction: column; gap: 12px; text-align: center; }
#pause .tabs { display: flex; border-bottom: 1px solid var(--line); }
#pause .tabs button { flex: 1; background: none; border: 0; border-bottom: 2px solid transparent; color: var(--dim); padding: 8px; font-size: 12px; letter-spacing: .24em; text-transform: uppercase; }
#pause .tabs button.on { color: var(--fg); border-bottom-color: var(--accent); }
#pause .tab { overflow-x: hidden; overflow-y: auto; touch-action: pan-y; overscroll-behavior-x: none; max-height: 52vh; text-align: left; }   /* (vertical only, as #menu .panel) */
#controlsSheet .grp { margin-bottom: 4px; }
#controlsSheet .row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 4px 0; font-size: 13px; border-bottom: 1px solid rgba(233, 236, 228, .06); }
#controlsSheet .row span:first-child { color: var(--dim); }
#controlsSheet .keys { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
#pause h2, #deploy h2, #lobby h2 { margin: 0; letter-spacing: .38em; font-size: 18px; font-weight: 700; }

#deploy, #lobby { position: fixed; inset: 0; background: radial-gradient(ellipse at center, transparent 55%, rgba(5, 7, 6, .45)); }
#deploy .panel, #lobby .panel { position: absolute; right: calc(16px + var(--safe-r, 0px)); top: 50%; transform: translateY(-50%); width: min(330px, 38vw); max-height: 94vh; max-height: 94dvh; overflow: auto; overscroll-behavior: contain; touch-action: pan-y; text-align: left; display: flex; flex-direction: column; }
@media (orientation: portrait) { #deploy .panel, #lobby .panel { right: 50%; top: auto; bottom: 12px; transform: translateX(50%); width: min(440px, 94vw); max-height: 54vh; padding: 16px; } #deploy .sect { margin: 9px 0 5px; } #spawnList { height: 17vh; } #classRole { min-height: 0; } }
#deploy header, #lobby header { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
#sheetName, #lobbySheet { font: 11px/1.4 var(--mono); color: var(--faint); letter-spacing: .08em; margin-bottom: 4px; }
#teamTag { letter-spacing: .3em; font-weight: 700; flex: 1; }
#deployMap, #lobbyMap { position: absolute; inset: 0; width: 100%; height: 100%; cursor: crosshair; }
#deploy .info, #lobby .info { margin: 10px 0; letter-spacing: .1em; color: var(--dim); font-size: 13px; text-align: center; }
.squadRow { display: flex; align-items: center; gap: 8px; margin: 10px 0; }
.squadRow label { color: var(--dim); font-size: 12px; }
.squadRow select { flex: 1; min-width: 0; color: var(--fg); background: var(--panel-2); border: 1px solid var(--line); padding: 5px; }
#classPick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
#classPick button { background: var(--panel-2); border: 1px solid var(--line); color: var(--fg); padding: 9px 2px; font: 700 11px/1.2 var(--font); letter-spacing: .14em; border-radius: 2px; }
#classPick button.on { border-color: var(--accent); background: rgba(242, 193, 78, .13); color: var(--accent); }
#classRole { margin: 7px 0 0; font-size: 12px; color: var(--dim); line-height: 1.45; min-height: 2.9em; }
#classRole b { color: var(--fg); font-weight: 700; letter-spacing: .08em; }
/* the primary weapon for the class (PRIMARIES, LOADOUTS): three choices, its handling below */
#weaponPick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
#weaponPick button { background: var(--panel-2); border: 1px solid var(--line); color: var(--fg); padding: 7px 2px 6px; font: 700 11px/1.2 var(--font); letter-spacing: .12em; border-radius: 2px; }
#weaponPick button small { display: block; font-weight: 400; letter-spacing: .06em; color: var(--dim); font-size: 9.5px; margin-top: 2px; text-transform: uppercase; }
#weaponPick button.on { border-color: var(--accent); background: rgba(242, 193, 78, .13); color: var(--accent); }
#attPick { display: grid; grid-template-columns: auto repeat(3, 1fr); gap: 3px 4px; margin-top: 6px; align-items: center; }
#attPick label { color: var(--dim); font-size: 9.5px; letter-spacing: .12em; text-transform: uppercase; padding-right: 4px; }
#attPick button { background: var(--panel-2); border: 1px solid var(--line); color: var(--fg); padding: 4px 2px; font: 600 10px/1.2 var(--font); letter-spacing: .06em; border-radius: 2px; }
#attPick button.on { border-color: var(--accent); background: rgba(242, 193, 78, .13); color: var(--accent); }
#attPick .fixed { grid-column: span 3; color: var(--dim); font-size: 10px; }
#weaponRole { margin: 6px 0 0; font-size: 11.5px; color: var(--dim); line-height: 1.4; min-height: 1.4em; }
#spawnList { display: flex; flex-direction: column; gap: 3px; height: clamp(150px, 26vh, 260px); overflow: auto; }   /* (a steady height: spawn points come and go as flags change hands, and the panel below mustn't jump) */
#spawnList button { display: flex; align-items: center; gap: 10px; background: var(--panel-2); border: 1px solid transparent; color: var(--fg); padding: 6px 9px; font: 13px var(--font); letter-spacing: .06em; text-align: left; border-radius: 2px; }
#spawnList button .sym { width: 20px; height: 20px; display: grid; place-items: center; font-weight: 800; font-size: 11px; border: 2px solid currentColor; border-radius: 2px; flex: none; }
#spawnList button .sym.mate { border-radius: 50%; border-width: 1px; }
#spawnList button .ref { margin-left: auto; color: var(--faint); font: 11px var(--mono); }
#spawnList button.on { border-color: var(--accent); background: rgba(242, 193, 78, .1); }
#deployBtn { margin-top: 2px; }
/* the match lobby (phase 2): the players waiting and the commander's START in place of the spawn points and DEPLOY */
#deploy.waiting .spawnSect, #deploy.waiting #spawnList, #deploy.waiting #spectateBtn, #deploy.waiting #requestRevive { display: none; }
#waitBox .teams { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; height: clamp(150px, 26vh, 260px); overflow: auto; align-content: start; }
#waitBox .count { float: right; color: var(--faint); letter-spacing: .1em; }
#waitBox .col { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
#waitBox .col h3 { margin: 0 0 2px; font-size: 11px; letter-spacing: .3em; font-weight: 700; }
#waitBox .col .pl { background: var(--panel-2); padding: 5px 8px; font-size: 13px; letter-spacing: .04em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-radius: 2px; }
#waitBox .col .pl.me { outline: 1px solid var(--accent); }
#waitBox .col .pl small { color: var(--accent); margin-left: 4px; }
#waitBox .col .none { color: var(--faint); font-size: 12px; padding: 5px 0; }
#deploy.waiting .info.go { color: var(--accent); font-size: 18px; font-weight: 700; letter-spacing: .3em; }
@media (orientation: portrait) { #waitBox .teams { height: 17vh; } }
@media (orientation: landscape) and (max-height: 500px) { #waitBox:not([hidden]) { flex: 1 1 0; min-height: 90px; display: flex; flex-direction: column; } #waitBox .teams { height: auto; flex: 1 1 0; } }
/* the deploy panel: the spawn points first (the choice made every time), then class, then squad; the screen's own
   buttons in one compact row under the title */
#deploy .dacts { display: flex; gap: 6px; margin: 10px 0 2px; }
#deploy .dacts button { flex: 1; min-width: 0; padding: 6px 4px; font-size: 11px; letter-spacing: .1em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#requestRevive { margin-top: 6px; }
#spawnList button { min-height: 34px; flex: none; }   /* (many points scroll; they never squash) */
/* the lobby (public/js/lobby.js): the deploy screen's layout, a list of matches in place of the spawn points */
#lobbyMap { cursor: default; }
/* the match overview: outside the combat line blurred a little (hud.drawLobby clips it); touch devices get a light shade, no backdrop blur */
#lobbyBlur { position: absolute; inset: 0; pointer-events: none; background: rgba(6, 8, 10, .18); opacity: 0; }
@media (pointer: fine) { #lobbyBlur { background: rgba(6, 8, 10, .08); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); } }
/* switching the watched match: the old view (#lobbySwap, captured) is pushed out by the new one (main.js pushLobby) */
#lobbySwap { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
#lobbySwap[hidden] { display: none; }
.pushing { transition: transform .85s cubic-bezier(.65, 0, .35, 1); }
#matchList button.loading .mtag::after { content: ' · LOADING'; color: var(--accent); animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: .35; } }
#lobbyCount { flex: 1; color: var(--dim); font: 11px var(--mono); letter-spacing: .06em; }
#matchList { display: flex; flex-direction: column; gap: 3px; max-height: 34vh; overflow: auto; margin: 10px 0 8px; }
#matchList button { display: grid; grid-template-columns: 1fr auto; gap: 1px 10px; background: var(--panel-2); border: 1px solid transparent; color: var(--fg); padding: 7px 9px; font: 13px var(--font); letter-spacing: .04em; text-align: left; border-radius: 2px; }
#matchList button.on { border-color: var(--accent); background: rgba(242, 193, 78, .1); }
#matchList button.full { opacity: .6; }
#matchList .mname small.cmd { font-weight: 400; color: var(--accent); font-size: 11px; }
#matchList .mname { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#matchList .mtag { color: var(--dim); font: 11px var(--mono); text-align: right; }
#matchList .mmap { color: var(--faint); font: 11px var(--mono); letter-spacing: .06em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#matchList .mscore { font: 11px var(--mono); text-align: right; }
#matchList .mscore .n { color: #4aa3ff; font-style: normal; } #matchList .mscore .s { color: #ff7a2e; font-style: normal; }
#matchList .none { color: var(--dim); font-size: 13px; margin: 6px 0; }
.codeRow { display: flex; align-items: center; gap: 8px; margin: 4px 0 8px; }
.codeRow label { color: var(--dim); font-size: 12px; flex: 1; }
.codeRow input { width: 6.5em; font: 700 15px var(--mono); letter-spacing: .3em; text-transform: uppercase; color: var(--fg); background: var(--panel-2); border: 1px solid var(--line); padding: 5px 8px; }
#createMatch { margin: 2px 0 6px; }
#matchRules .sect .by { float: right; color: var(--faint); letter-spacing: .1em; font-weight: 400; }
#matchRules .form { display: flex; flex-direction: column; gap: 8px; margin: 4px 0 8px; }
#matchRules label { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 12px; color: var(--dim); }
#matchRules select, #mrSeed { color: var(--fg); background: var(--panel-2); border: 1px solid var(--line); padding: 4px; min-width: 0; }
#matchRules select:disabled, #matchRules input:disabled { opacity: .6; }
#mrMapList .maps { display: flex; flex-direction: column; gap: 2px; max-height: 20vh; overflow: auto; }
#mrMapList label.row { justify-content: flex-start; color: var(--fg); }
#mrMapList small { color: var(--faint); }
.seedRow { display: flex; gap: 8px; margin-top: 6px; } .seedRow input { width: 7em; }
#lobbyInfo.bad { color: var(--danger); }
/* the match commander: the offer of command, and the pause menu's Match tab */
#offer { position: fixed; top: 86px; left: 50%; transform: translateX(-50%); text-align: center; padding: 14px 22px; min-width: min(380px, 92vw); z-index: 30; }
#offer .by { font-size: 10px; letter-spacing: .36em; color: var(--accent); }
#offer .why { margin: 6px 0 10px; font-size: 14px; }
#offer .acts { display: flex; gap: 8px; justify-content: center; }
#offer .left { margin-top: 8px; font: 11px var(--mono); color: var(--dim); }
#matchSheet .note { font-size: 12px; color: var(--dim); margin: 0 0 6px; }
#matchSheet .mrow { display: flex; align-items: center; gap: 8px; margin: 5px 0; }
#matchSheet .mrow label { width: 5.5em; font-size: 12px; color: var(--dim); }
#matchSheet .mrow select, #matchSheet .mrow input[type=range] { flex: 1; min-width: 0; color: var(--fg); background: var(--panel-2); border: 1px solid var(--line); padding: 4px; }
#matchSheet .mrow.end { justify-content: flex-end; margin-top: 12px; }
#mcName { flex: 1; font: 12px var(--mono); color: var(--fg); letter-spacing: .06em; }
#mcPlayers { display: flex; flex-direction: column; gap: 2px; }
#mcPlayers .pl { display: flex; align-items: center; gap: 6px; padding: 3px 0; border-bottom: 1px solid rgba(233, 236, 228, .06); font-size: 13px; }
#mcPlayers .pl .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#mcPlayers .pl button { padding: 2px 7px; font-size: 11px; }
#mcPlayers .pl small { color: var(--faint); }
button.danger { color: var(--danger); border-color: rgba(255, 74, 58, .5); }
#matchLine { display: flex; align-items: center; gap: 8px; font: 11px/1.4 var(--mono); color: var(--dim); letter-spacing: .08em; margin-bottom: 6px; }
#matchLine[hidden] { display: none; }
#matchLine .what { flex: 1; } #matchLine b { color: var(--accent); letter-spacing: .25em; }
#copyCode { padding: 2px 8px; font-size: 11px; }
/* the deploy button never scrolls out of reach: it sticks to the bottom of the panel (dvh: the height the phone's
   browser bars actually leave, where vh would reach behind them) */
#deploy .panel #deployBtn, #lobby .panel #lobbyJoin { position: sticky; bottom: 0; z-index: 1; box-shadow: 0 -10px 14px var(--panel); flex: none; }
/* a phone on its side: little height - compact the panel so it all fits */
@media (orientation: landscape) and (max-height: 500px) {
  #deploy .panel, #lobby .panel { top: calc(6px + env(safe-area-inset-top, 0px)); bottom: calc(6px + var(--safe-b, 0px)); transform: none; max-height: none; width: min(380px, 46vw); padding: 10px 12px; }
  #deploy #sheetName, #deploy #classRole, #deploy #weaponRole, #lobby #lobbySheet { display: none; }
  #deploy h2, #lobby h2 { font-size: 15px; }
  #deploy .sect { margin: 6px 0 4px; }
  #deploy .info, #lobby .info { margin: 5px 0; font-size: 12px; }
  #matchList { max-height: none; flex: 1 1 auto; min-height: 44px; }
  #spawnList { height: auto; max-height: none; flex: 1 1 0; min-height: 76px; overflow: auto; }   /* (two rows at least: the rest of the panel's height goes to it) */
  #deploy .dacts { margin: 6px 0 0; } #deploy .dacts button { padding: 4px; font-size: 10px; }
  #deploy .squadRow { margin: 6px 0 2px; }
  #matchLine { margin-bottom: 2px; }
  #classPick button, #weaponPick button { padding-top: 6px; padding-bottom: 6px; }
}
#watchBar { position: fixed; left: 50%; bottom: calc(5vh + var(--safe-b, 0px)); transform: translateX(-50%); text-align: center; padding: 10px 22px 12px; background: rgba(8, 11, 9, .7); border-top: 2px solid var(--accent, #f2c14e); min-width: 240px; }
#watchBar .by { font-size: 10px; letter-spacing: .36em; color: var(--dim); }
#watchBar .acts { display: flex; gap: 8px; justify-content: center; align-items: stretch; }
#watchBar .acts .ghost { min-width: 64px; white-space: nowrap; }
#watchBar .who { font-size: 20px; font-weight: 800; letter-spacing: .08em; margin: 2px 0 8px; }
#deathCard { position: fixed; left: 50%; bottom: 13vh; transform: translateX(-50%); text-align: center; padding: 12px 26px; background: rgba(8, 11, 9, .7); border-top: 2px solid var(--danger); min-width: 260px; }
#deathCard .by { font-size: 10px; letter-spacing: .36em; color: var(--dim); }
#deathCard .who { font-size: 26px; font-weight: 800; letter-spacing: .08em; margin: 2px 0; }
#deathCard .how { font-size: 12px; letter-spacing: .16em; color: var(--dim); }
#scoreboard { position: fixed; top: 10vh; left: 50%; transform: translateX(-50%); display: flex; flex-wrap: wrap; gap: 12px 18px; background: var(--panel); border: 1px solid var(--line); padding: 18px; width: max-content; max-width: 96vw; max-height: 86vh; overflow-y: auto; box-sizing: border-box;
  /* a row's height: what's left of the screen under the headings shared by the bigger team's rows (--rows, hud.js), 25 px at most */
  --rh: clamp(12px, calc((86vh - 136px) / var(--rows, 16)), 25px); }
#scoreboard .sum { flex-basis: 100%; letter-spacing: .26em; font-size: 13px; color: var(--fg); }
#scoreboard .sum small { font-size: 11px; letter-spacing: .2em; }
#scoreboard h3 em { font-style: normal; font-size: 11px; font-weight: 400; letter-spacing: .15em; color: var(--dim); align-self: center; margin: 0 auto 0 12px; }
#scoreboard .col { min-width: 330px; }
#scoreboard h3 { margin: 0 0 8px; letter-spacing: .26em; display: flex; justify-content: space-between; }
#scoreboard table { width: 100%; border-collapse: collapse; font-size: 14px; }
#scoreboard th { text-align: left; color: var(--dim); font-weight: 400; font-size: 11px; letter-spacing: .15em; padding: 4px; }
#scoreboard td { padding: 0 4px; height: calc(var(--rh) - 1px); line-height: 1; font-size: clamp(9px, calc(var(--rh) * .56), 14px); border-top: 1px solid rgba(255, 255, 255, .06); white-space: nowrap; }
#scoreboard tr.me td { background: rgba(242, 193, 78, .14); }
#scoreboard small { color: var(--dim); font-size: 10px; }
#scoreboard td small { font-size: .72em; }
#roundEnd { position: fixed; top: 22%; left: 50%; transform: translateX(-50%); text-align: center; padding: 26px 34px; min-width: min(560px, 92vw); }
#roundEnd .res { font-size: 60px; font-weight: 800; letter-spacing: .14em; line-height: 1; }
#roundEnd.win .res { color: var(--accent); }
#roundEnd.lose .res { color: var(--danger); }
#roundEnd .sub { margin-top: 8px; letter-spacing: .24em; font-size: 13px; color: var(--dim); }
#roundEnd .hl { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 22px 0 16px; }
#roundEnd .hl div { background: var(--panel-2); padding: 10px 8px; }
#roundEnd .hl small { display: block; font-size: 10px; letter-spacing: .26em; color: var(--faint); }
#roundEnd .hl b { display: block; font-size: 17px; margin: 4px 0 2px; letter-spacing: .04em; }
#roundEnd .hl span { font-size: 12px; color: var(--dim); }
#roundEnd .next { font-size: 13px; letter-spacing: .2em; }
#roundEnd .next b { color: var(--fg); font-weight: 700; }
#conn { position: fixed; top: 0; left: 0; right: 0; background: rgba(160, 30, 20, .85); text-align: center; padding: 8px; letter-spacing: .12em; font-size: 14px; z-index: 10; }
#fatal { position: fixed; inset: 0; display: grid; place-items: center; background: rgba(5, 7, 6, .88); z-index: 20; }
#fatal .panel { width: min(420px, 92vw); display: flex; flex-direction: column; gap: 14px; text-align: center; }
#fatal p { margin: 0; line-height: 1.5; }
/* the benchmark (Settings > Benchmark): a small corner box while it runs (over as little of the view as it can), the results in the middle after */
.benchRow { display: flex; gap: 8px; }
.benchRow select { flex: 1; width: 0; }   /* (width 0: the flex share sets it, not the longest option) */
#benchBox { position: fixed; inset: 0; display: grid; place-items: center; background: rgba(5, 7, 6, .82); z-index: 19; }
#benchBox .panel { width: min(560px, 94vw); max-height: 90vh; overflow: auto; display: flex; flex-direction: column; gap: 12px; }
#benchBox h2 { margin: 0; letter-spacing: .38em; font-size: 18px; font-weight: 700; }
#benchBox p { margin: 0; color: var(--dim); font-size: 12px; letter-spacing: .08em; }
#benchBox table { width: 100%; border-collapse: collapse; font-size: 12px; font-variant-numeric: tabular-nums; }
#benchBox th { text-align: left; color: var(--dim); font-weight: 400; letter-spacing: .12em; text-transform: uppercase; font-size: 10px; padding: 4px 6px; border-bottom: 1px solid var(--line); }
#benchBox td { padding: 4px 6px; border-bottom: 1px solid rgba(255, 255, 255, .05); }
#benchBox tr.flat td { color: var(--dim); }
#benchBox .benchBtns { display: flex; gap: 8px; justify-content: flex-end; }
#benchBox.running { inset: auto auto 16px 16px; background: none; place-items: start; }
#benchBox.running .panel { width: auto; padding: 10px 14px; gap: 6px; }
#benchBox.running h2 { font-size: 11px; }
#benchBox.running #benchOut { display: none; }
#unlockHint { position: fixed; left: 50%; top: 58%; transform: translateX(-50%); padding: 8px 16px; background: rgba(5, 7, 6, .62); border: 1px solid var(--line); color: var(--fg); font-size: 13px; letter-spacing: .08em; white-space: nowrap; pointer-events: none; }
body.dead #crosshair, body.dead #minimap, body.dead #health, body.dead #ammo, body.dead #overlay, body.dead #reloadHint, body.dead #prompt, body.dead #hitmarker, body.dead #vehHud, body.dead #coach, body.dead #repair { visibility: hidden; }
#perf { position: fixed; left: 8px; top: 180px; margin: 0; padding: 6px 8px; background: rgba(0, 0, 0, .62); color: #cfe8c8; font: 11px/1.45 var(--mono); pointer-events: none; z-index: 50; white-space: pre; }
@media (max-width: 720px) { #perf { right: 8px; top: 120px; font-size: 9px; white-space: pre-wrap; } }   /* ?perf on a phone */
#killBanner { opacity: 0; position: absolute; left: 50%; top: 62%; transform: translateX(-50%); text-align: center; pointer-events: none; font-weight: 800; letter-spacing: .14em; text-shadow: 0 1px 3px rgba(0, 0, 0, .8); transition: opacity .4s; }
#killBanner .main { font-size: 14px; color: #fff; }
#killBanner .sub { font-size: 11px; color: var(--accent); margin-top: 3px; }

/* ---------- touch controls ---------- */
#touch { display: none; }
#touch.on { display: block; }
#touch.on.pad { display: none; }   /* a controller in use (a touch brings the overlay back) */
body:has(#menu:not([hidden])) #touch, body:has(#deploy:not([hidden])) #touch, body:has(#lobby:not([hidden])) #touch { display: none; }
#touch .stick { position: fixed; width: 120px; height: 120px; margin: -60px 0 0 -60px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .25); background: rgba(255, 255, 255, .05); opacity: 0; pointer-events: none; transition: opacity .1s; }
#touch .stick.on { opacity: 1; }
#touch .knob { position: absolute; left: 35px; top: 35px; width: 50px; height: 50px; border-radius: 50%; background: rgba(255, 255, 255, .35); }
#touch button { position: fixed; width: 62px; height: 62px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .3); background: rgba(0, 0, 0, .25); color: #fff; font-size: 12px; font-weight: 700; letter-spacing: .05em; touch-action: none; }
#touch button.down { background: rgba(242, 193, 78, .45); }
#touch button.latched { background: rgba(242, 193, 78, .3); border-color: rgba(242, 193, 78, .9); }
#touch .b-fire { right: calc(40px + var(--safe-r)); bottom: calc(110px + var(--safe-b)); width: 86px; height: 86px; font-size: 14px; }
#touch .b-ads { right: calc(140px + var(--safe-r)); bottom: calc(150px + var(--safe-b)); }
#touch .b-jump { right: calc(40px + var(--safe-r)); bottom: calc(24px + var(--safe-b)); }
#touch .b-crouch { right: calc(116px + var(--safe-r)); bottom: calc(40px + var(--safe-b)); }
#touch .b-reload { right: calc(196px + var(--safe-r)); bottom: calc(26px + var(--safe-b)); width: 48px; height: 48px; }
#touch .b-nade { right: calc(252px + var(--safe-r)); bottom: calc(26px + var(--safe-b)); width: 48px; height: 48px; }
#touch .b-weapon { right: calc(308px + var(--safe-r)); bottom: calc(26px + var(--safe-b)); width: 48px; height: 48px; }
#touch .b-use { right: calc(364px + var(--safe-r)); bottom: calc(26px + var(--safe-b)); width: 48px; height: 48px; }
#touch .b-kit { display: none; right: calc(196px + var(--safe-r)); bottom: calc(84px + var(--safe-b)); width: 48px; height: 48px; border-color: rgba(143, 210, 138, .6); }   /* a medic's first aid kit (input.gadget) */
#touch.gadget:not(.veh) .b-kit { display: block; }
#touch .b-kit.cooling { opacity: .4; }
@media (pointer: coarse) {
  #minimap { width: 112px; height: 112px; }
  #health { font-size: 22px; } #health .bar { width: 100px; }
  #aidFeed { bottom: calc(150px + var(--safe-b)); font-size: 10px; }   /* above the ammo block */
  #teamChip { bottom: calc(48px + var(--safe-b)); font-size: 10px; }
  #ammo { right: auto; left: calc(14px + var(--safe-l)); bottom: calc(66px + var(--safe-b)); text-align: left; padding: 4px 30px 4px 10px; background: linear-gradient(to right, rgba(6, 9, 7, .5), transparent); } #ammo .mag { font-size: 26px; } #ammo .wname { font-size: 10px; }   /* above the health block, clear of the button rows */
  #teamChip { display: none; }
  #killfeed { font-size: 11px; top: 32px; }
  #netinfo { font-size: 11px; padding: 2px 7px; } #killfeed div:nth-child(n+4) { display: none; }
  #notice { font-size: 15px; }
  #tickets .t { min-width: 100px; font-size: 18px; } #tickets .bar { width: 54px; }
  #chat { display: none; }
  #coach { top: calc(64px + var(--safe-t, 0px)); bottom: auto; font-size: 11px; gap: 12px; }   /* clear of the buttons */
  #vehHud { top: 130px; bottom: auto; width: 200px; }
  #prompt kbd, #coach kbd { font-size: 10px; letter-spacing: .06em; }   /* the touch button's own label (input.label) */
  body:not(.pad) .primary kbd { display: none; }   /* (a controller on a phone: its buttons shown) */
}

/* the game's own pointer in menus opened while the mouse stays captured (no pointer-lock banners on resume) */
#vcursor { position: fixed; left: 0; top: 0; width: 18px; height: 24px; margin: -1px 0 0 -1px; pointer-events: none; z-index: 100;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 24'%3E%3Cpath d='M1 1v19l5-5 3.5 7.5 3-1.4L9 13.8h7z' fill='%23e9ece4' stroke='%230b0f0d' stroke-width='1.4' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat; will-change: transform; }
/* a controller in use (body.pad, set in main.js padCaps): no mouse pointer, the browser's or the game's; moving the mouse brings it back */
body.pad, body.pad * { cursor: none !important; }
body.pad #vcursor { display: none; }
/* a browser only redraws a still pointer when what's under it changes: a cover over the page while the pad is in use
   (desktop only) hides it at once; the first mouse move ends pad mode and takes the cover away */
#padShield { display: none; }
@media (pointer: fine) { body.pad #padShield { display: block; position: fixed; inset: 0; z-index: 1000; cursor: none; background: transparent; } }
/* gamepad focus in menus: the control the pad's A button would press */
.pfocus { outline: 2px solid var(--accent); outline-offset: -2px; }   /* inside the edge: scrolling lists clip anything outside */
.primary.pfocus { outline-color: var(--fg); }
/* fields keep their own outline off (#menu input, #settings select): the pad's highlight must still show */
input.pfocus, select.pfocus { outline: 2px solid var(--accent) !important; outline-offset: 2px; border-color: var(--accent) !important; }
label:has(> .pfocus) { color: var(--fg) !important; }
.ghost.vhover { border-color: var(--fg); }
.primary.vhover { filter: brightness(1.08); }
#pause .tabs button.vhover { color: var(--fg); }
#settings label.vhover { color: var(--fg); }

#touch .b-menu { left: calc(16px + var(--safe-l)); top: 136px; width: 40px; height: 40px; font-size: 13px; letter-spacing: 0; }   /* under the minimap: the pause menu and its settings */
body:has(#pause:not([hidden])) #touch { display: none; }
body.camAway #touch { display: none; }   /* spectating, or the camera flying between screens */
#touch .b-light { left: calc(16px + var(--safe-l)); top: 184px; width: 40px; height: 40px; font-size: 9px; letter-spacing: 0; }
#touch.veh .b-light { display: none; }   /* in a vehicle F switches seat: the swap button does that */
#touch .b-map { left: calc(16px + var(--safe-l)); top: 14px; width: 112px; height: 112px; border-radius: 8px; border: 0; background: none; }   /* over the minimap: tap for the big map */
#touch .b-score { left: 50%; top: 4px; margin-left: -120px; width: 240px; height: 44px; border-radius: 0; border: 0; background: none; }   /* over the tickets: tap for the scoreboard */
#touch .b-map.down, #touch .b-score.down { background: none; }
@media (orientation: portrait) and (pointer: coarse) {   /* the controls are laid out for landscape */
  body:has(#touch.on):not(:has(#menu:not([hidden]))) #rotate { display: grid; }
}
#rotate { display: none; position: fixed; inset: 0; z-index: 30; place-items: center; background: rgba(5, 7, 6, .92); color: var(--fg); font-size: 15px; letter-spacing: .2em; text-align: center; padding: 24px; }
#touch .b-ping, #touch .b-aid { width: 48px; height: 48px; bottom: calc(94px + var(--safe-b)); }
#touch .b-ping { right: calc(212px + var(--safe-r)); }
#touch .b-aid { right: calc(268px + var(--safe-r)); }

/* the ping wheel (B held: main.js pingWheel): six callouts round the crosshair, the one the aim points at lit */
#pingWheel { position: fixed; left: 50%; top: 50%; width: 0; height: 0; z-index: 30; pointer-events: none; }
#pingWheel .hub { position: absolute; left: -26px; top: -26px; width: 52px; height: 52px; border-radius: 50%; border: 1px solid var(--line); background: rgba(16, 19, 16, .72);
  display: grid; place-items: center; color: var(--dim); font: 700 9px/1 var(--font); letter-spacing: .2em; }
#pingWheel .slice { position: absolute; width: 112px; margin-left: -56px; margin-top: -16px; text-align: center; }
#pingWheel .slice span { display: inline-block; padding: 7px 9px; border: 1px solid var(--line); border-radius: 2px; background: rgba(16, 19, 16, .78); color: var(--fg);
  font: 700 10.5px/1.1 var(--font); letter-spacing: .1em; text-transform: uppercase; }
#pingWheel .slice.on span { border-color: var(--accent); color: var(--accent); background: rgba(242, 193, 78, .16); }
#pingWheel .slice.off span { opacity: .4; }
#pingWheel .s0 { left: 0; top: -104px; } #pingWheel .s1 { left: 92px; top: -52px; } #pingWheel .s2 { left: 92px; top: 52px; }
#pingWheel .s3 { left: 0; top: 104px; } #pingWheel .s4 { left: -92px; top: 52px; } #pingWheel .s5 { left: -92px; top: -52px; }

/* ---------- motion ----------
   Panels and overlays come and go with `hidden` (display: none): the transition on `display` (allow-discrete) keeps
   one shown until its fade out ends, and @starting-style gives the fade in where to start from. Each says how it
   arrives: --mo-x / --mo-y (moved from), --mo-s (scaled from), --mo-t (how long). The offsets use `translate` and
   `scale`, which add to the `transform` the panels are placed with. Browsers without discrete transitions (Firefox)
   still fade in and hide at once. Overlays only: anything in a panel's flow fades in but leaves at once (a sibling
   kept for its fade out would hold its place). */
#menu, #hud, #pause, #deploy, #lobby, #offer, #watchBar, #deathCard, #scoreboard, #roundEnd, #conn, #fatal, #benchBox,
#pingWheel, #unlockHint, #capture, #repair, #bounds, #vehHud, #series, #waitBox, #matchRules, #mrMapList, #requestRevive,
#matchLine, #pause .tab, #roundEnd .vote {
  transition: opacity var(--mo-t, var(--t)) var(--ease), translate var(--mo-t, var(--t)) var(--ease), scale var(--mo-t, var(--t)) var(--ease),
    display var(--mo-t, var(--t)) allow-discrete;
}
#menu[hidden], #hud[hidden], #pause[hidden], #deploy[hidden], #lobby[hidden], #offer[hidden], #watchBar[hidden], #deathCard[hidden],
#scoreboard[hidden], #roundEnd[hidden], #conn[hidden], #fatal[hidden], #benchBox[hidden], #pingWheel[hidden], #unlockHint[hidden],
#capture[hidden], #repair[hidden], #bounds[hidden], #vehHud[hidden], #series[hidden] {
  opacity: 0; translate: var(--mo-x, 0) var(--mo-y, 0); scale: var(--mo-s, 1); pointer-events: none !important;
}
/* in a panel's flow: in only */
#waitBox, #matchRules, #mrMapList, #requestRevive, #matchLine, #pause .tab, #roundEnd .vote { transition-property: opacity, translate; }
@starting-style {
  #menu:not([hidden]), #hud:not([hidden]), #pause:not([hidden]), #deploy:not([hidden]), #lobby:not([hidden]), #offer:not([hidden]),
  #watchBar:not([hidden]), #deathCard:not([hidden]), #scoreboard:not([hidden]), #roundEnd:not([hidden]), #conn:not([hidden]),
  #fatal:not([hidden]), #benchBox:not([hidden]), #pingWheel:not([hidden]), #unlockHint:not([hidden]), #capture:not([hidden]),
  #repair:not([hidden]), #bounds:not([hidden]), #vehHud:not([hidden]), #series:not([hidden]), #waitBox:not([hidden]),
  #matchRules:not([hidden]), #mrMapList:not([hidden]), #requestRevive:not([hidden]), #matchLine:not([hidden]),
  #pause .tab:not([hidden]), #roundEnd .vote {
    opacity: 0; translate: var(--mo-x, 0) var(--mo-y, 0); scale: var(--mo-s, 1);
  }
}
/* where each comes from */
#menu { --mo-t: var(--t-slow); }
#offer { --mo-y: calc(-1 * var(--rise)); }
#conn { --mo-y: -100%; }
#watchBar, #deathCard, #unlockHint { --mo-y: var(--rise); }
#scoreboard { --mo-y: calc(-.5 * var(--rise)); --mo-t: var(--t-fast); }   /* held on Tab: quick */
#roundEnd { --mo-s: .96; --mo-t: var(--t-slow); }
#pingWheel { --mo-s: .85; --mo-t: var(--t-fast); }
#capture, #series { --mo-y: calc(-.5 * var(--rise)); }
#repair, #bounds { --mo-s: .96; --mo-t: var(--t-fast); }
#vehHud { --mo-x: var(--rise); }
#waitBox, #matchRules, #mrMapList, #requestRevive, #matchLine, #pause .tab, #roundEnd .vote { --mo-x: 0; --mo-y: calc(.5 * var(--rise)); --mo-s: 1; --mo-t: var(--t); }   /* (their own: the vars inherit) */
/* full-screen layers: the backdrop fades, the panel on it moves */
#pause .panel, #fatal .panel, #benchBox .panel, #deploy .panel, #lobby .panel {
  transition: translate var(--t) var(--ease), scale var(--t) var(--ease);
}
#deploy .panel, #lobby .panel { --mo-x: calc(2 * var(--rise)); --mo-s: 1; }
#pause .panel, #fatal .panel, #benchBox .panel { --mo-y: var(--rise); --mo-s: .98; }
#pause[hidden] .panel, #fatal[hidden] .panel, #benchBox[hidden] .panel, #deploy[hidden] .panel, #lobby[hidden] .panel,
#menu[hidden] .panel { translate: var(--mo-x, 0) var(--mo-y, 0); scale: var(--mo-s, 1); }
#menu .panel { --mo-x: calc(2 * var(--rise)); }
@starting-style {
  #pause:not([hidden]) .panel, #fatal:not([hidden]) .panel, #benchBox:not([hidden]) .panel, #deploy:not([hidden]) .panel,
  #lobby:not([hidden]) .panel, #menu:not([hidden]) .panel { translate: var(--mo-x, 0) var(--mo-y, 0); scale: var(--mo-s, 1); }
}
/* controls: picks, hovers, tabs and the pad's focus ease over instead of snapping */
button, select, input, summary, #settings label {
  transition: background-color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease),
    outline-color var(--t-fast) var(--ease), opacity var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
#touch button { transition: none; }   /* a thumb on a button wants it lit now */
@media (prefers-reduced-motion: reduce) {
  :root { --rise: 0px; }   /* fades stay (Windows asks for this whenever animation effects are off): nothing slides or grows */
  #roundEnd, #pingWheel, #repair, #bounds, #pause .panel, #fatal .panel, #benchBox .panel { --mo-s: 1; }
  #conn { --mo-y: 0; }
}
