/* ===== Cyberpunk: neon on near-black, angled panels, lit rows and segmented meters. =====
   The Google layer (Street View, the guess map and its size buttons, the review maps) comes from /static/maps.css
   and is never styled here. Scanlines only on the menu screens, which carry no maps. */
:root {
  --bg: #07070d; --bg-2: #0b0b15; --panel: #0e0e1a; --panel-2: #151527; --line: #2a2a44; --line-2: #3d3d62;
  --ink: #d6f7ff; --muted: #8e9bb6; --yellow: #fcee0a; --cyan: #02d7f2; --pink: #ff2a6d; --on-neon: #07070d;
  --display: "Oxanium", "Eurostile", "Trebuchet MS", Arial, sans-serif;
  --mono: "Share Tech Mono", "SFMono-Regular", Menlo, Consolas, monospace;
  --cut: 14px; --cut-s: 8px;
  --clip: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, var(--cut) 100%, 0 calc(100% - var(--cut)));
  --clip-s: polygon(0 0, calc(100% - var(--cut-s)) 0, 100% var(--cut-s), 100% 100%, var(--cut-s) 100%, 0 calc(100% - var(--cut-s)));
  --clip-bl: polygon(0 0, 100% 0, 100% 100%, var(--cut) 100%, 0 calc(100% - var(--cut)));
  --cyan-12: rgba(2, 215, 242, .12); --yellow-12: rgba(252, 238, 10, .12); --pink-14: rgba(255, 42, 109, .14);
  --hud: rgba(7, 7, 13, .86);
  /* fixed game colours; the light variants are for text on the dark panels */
  --team-a: #e53935; --team-b: #005aea; --team-c: #9501e5;
  --team-a-t: #ff7b73; --team-b-t: #6d9bff; --team-c-t: #d68afa;
  --out: #ff2a6d; --warn-red: #ff3b3b; --ok: #3dff9a;
  --highlight: #fcee0a; /* read by pinsHtml() for the BR guess pins */
  --accent: #02d7f2;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { font-family: var(--mono); font-size: 15px; line-height: 1.5; color: var(--ink); background: var(--bg); min-height: 100vh; }
a { color: var(--cyan); }
a:hover { color: var(--yellow); }
button, input { font-family: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4 { margin: 0; font-family: var(--display); font-weight: 800; line-height: 1.05; letter-spacing: .01em; color: var(--ink); }
h2 { font-size: 36px; }
h3 { font-size: 20px; margin: 22px 0 8px; color: var(--yellow); font-weight: 700; }
h4 { font-size: 20px; }
p { margin: 0 0 12px; max-width: 64ch; }
.muted { color: var(--muted); }
.error { border-left: 3px solid var(--pink); padding: 8px 12px; margin: 0 0 4px; background: var(--pink-14); color: var(--ink); }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--yellow); outline-offset: 2px; }
kbd { font-family: var(--mono); font-size: 14px; color: var(--yellow); background: var(--bg); border: 1px solid var(--line-2); padding: 1px 7px; }

/* ===== Screens ===== */
.screen { display: none; min-height: 100vh; }
.screen.active { display: block; }
.screen:not(#game-screen).active { display: grid; align-content: center; justify-items: center; padding: 28px 20px 48px; position: relative; }
.screen:not(#game-screen).active > * { width: 100%; }
#start-screen.screen.active, #history-screen.screen.active, #review-screen.screen.active { align-content: start; }
#start-screen.screen.active { padding-top: clamp(20px, 5vh, 64px); }
@media (max-width: 600px) { .screen:not(#game-screen).active { padding: 16px 16px 40px; } }
.screen.menu.active { background: var(--bg); }

/* ===== Panels (angled corners) ===== */
/* every clipped box gets its border colour back on the cut edges: a 45° line through each clipped corner */
.panel, .sheet, .modal, .mode-row, .btn, .team-row, .choice-btn, .hp-bar {
  --cs: var(--cut); --edge: var(--line);
  background-image:
    linear-gradient(225deg, transparent calc(var(--cs) * .7071 - .5px), var(--edge) calc(var(--cs) * .7071 - .5px) calc(var(--cs) * .7071 + 1px), transparent calc(var(--cs) * .7071 + 1px)),
    linear-gradient(45deg, transparent calc(var(--cs) * .7071 - .5px), var(--edge) calc(var(--cs) * .7071 - .5px) calc(var(--cs) * .7071 + 1px), transparent calc(var(--cs) * .7071 + 1px));
  background-origin: border-box;
}
.panel, .sheet, .modal { background-color: var(--panel); border: 1px solid var(--line); clip-path: var(--clip); position: relative; min-width: 0; }
.btn, .team-row, .choice-btn, .hp-bar { --cs: var(--cut-s); }
.hd {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 5px 14px 5px 12px;
  font-family: var(--display); font-weight: 700; font-size: 13px; letter-spacing: .06em; line-height: 1.3;
  color: var(--on-neon); background: var(--cyan);
}
.hd.y { background: var(--yellow); }
.hd.p { background: var(--pink); }
.hd > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hd > span:last-child:not(:first-child) { padding-right: 6px; }

/* ===== Buttons ===== */
.btn {
  --edge: var(--cyan);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 20px; border: 1px solid var(--cyan);
  background-color: transparent; color: var(--cyan); font-family: var(--display); font-weight: 700; font-size: 17px; line-height: 1.1;
  text-decoration: none; letter-spacing: .03em; clip-path: var(--clip-s); text-align: center;
}
.btn:hover { background-color: var(--cyan-12); color: var(--cyan); }
.btn.primary { --edge: var(--yellow); background-color: var(--yellow); border-color: var(--yellow); color: var(--on-neon); }
.btn.primary:hover { --edge: #fff36a; background-color: #fff36a; border-color: #fff36a; color: var(--on-neon); }
.btn.big { width: 100%; padding: 16px 22px; font-size: 21px; letter-spacing: .05em; }
.btn.small { padding: 6px 12px; font-size: 14px; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: default; }
.btn:focus-visible, .chip:focus-visible, .mode-row:focus-visible, .toggle:focus-visible { outline-offset: -4px; }
.actions { display: flex; gap: 12px; margin-top: 22px; flex-wrap: wrap; }
.actions .btn.big { flex: 1; }
.actions.row .btn { flex: 1; min-width: 150px; }
.link { background: none; border: none; color: var(--cyan); text-decoration: underline; text-underline-offset: 3px; padding: 0; font: inherit; }
.link:hover { color: var(--yellow); }
.back { margin: 18px 0 0; }

/* ===== Chips, toggles, meters ===== */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  padding: 6px 12px; border: 1px solid var(--line-2); background: transparent; color: var(--muted);
  font-family: var(--mono); font-size: 15px; line-height: 1.2;
}
.chip:hover { color: var(--ink); border-color: var(--cyan); }
.chip[aria-pressed="true"] { background: var(--cyan); border-color: var(--cyan); color: var(--on-neon); }
.chip:disabled { opacity: .4; cursor: not-allowed; border-color: var(--line); color: var(--muted); }
.toggle {
  position: relative; display: inline-flex; align-items: center; gap: 10px; padding: 5px 12px 5px 6px; border: 1px solid var(--line-2);
  background: transparent; color: var(--muted); font-family: var(--mono); font-size: 15px; line-height: 1.2;
}
.toggle .sw { width: 38px; height: 18px; background: var(--line); position: relative; flex: none; transform: skewX(-18deg); }
.toggle .sw i { position: absolute; top: 3px; left: 3px; width: 14px; height: 12px; background: var(--muted); transition: transform .18s; }
.toggle .state { font-family: var(--display); font-weight: 700; font-size: 14px; min-width: 2.2em; }
.toggle[aria-pressed="true"] { border-color: var(--yellow); color: var(--ink); }
.toggle[aria-pressed="true"] .sw { background: var(--yellow-12); box-shadow: inset 0 0 0 1px var(--yellow); }
.toggle[aria-pressed="true"] .sw i { transform: translateX(18px); background: var(--yellow); }
.toggle[aria-pressed="true"] .state { color: var(--yellow); }
.meter { position: relative; display: flex; align-items: center; gap: 14px; min-height: 30px; }
.meter .segs { display: flex; gap: 3px; flex: 1; min-width: 0; height: 18px; pointer-events: none; }
.meter .segs i { flex: 1 1 0; min-width: 4px; max-width: 14px; height: 100%; background: var(--line); transform: skewX(-20deg); }
.meter .segs i.on { background: var(--cyan); }
/* the real slider sits on top of the segments, invisible but focusable and draggable */
.meter input[type=range] { position: absolute; left: 0; top: 0; bottom: 0; width: calc(100% - 92px); margin: 0; opacity: 0; cursor: pointer; }
.meter output { flex: 0 0 78px; text-align: right; font-family: var(--display); font-weight: 700; font-size: 20px; color: var(--yellow); line-height: 1; font-variant-numeric: tabular-nums; }
.meter:focus-within .segs { outline: 2px solid var(--yellow); outline-offset: 4px; }
.meter.off .segs i.on { background: var(--line-2); box-shadow: none; }
.meter.off output { color: var(--muted); }
/* the time slider's blink stops (0.5 s, 1 s) read differently from round times */
.meter output.blink { color: var(--pink); }
/* the split time control: a short blink meter, a gap, then round times; the part not in force is dimmed */
.time-split .tpart { position: relative; display: flex; align-items: center; flex: 1; min-width: 0; align-self: stretch; }
.time-split .tpart:has(> .ts-blink) { flex: 0 0 18%; min-width: 40px; margin-right: 12px; }
.time-split .tpart:has(> .ts-blink) .segs i { max-width: none; }
.time-split .tpart:has(> .ts-blink) .segs i.on { background: var(--pink); }
.time-split .tpart input[type=range] { width: 100%; }
.time-split .tpart:has(> input:not([data-active])) .segs { opacity: .35; }
.meter.time-split:focus-within .segs { outline: none; }
.time-split .tpart:focus-within .segs { outline: 2px solid var(--yellow); outline-offset: 4px; }
output.blink::after { content: "blink"; display: block; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; line-height: 1.3; }
.meter.off input { cursor: default; }
input[type=text] {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line-2); background: #05050b; color: var(--ink);
  font-family: var(--mono); font-size: 16px;
}
input[type=text]:focus { border-color: var(--cyan); outline: none; box-shadow: 0 0 0 1px var(--cyan); }
input[type=text]::placeholder { color: #6f7b95; }

/* ===== Start ===== */
.console { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 32px; max-width: 1180px; margin: 0 auto; position: relative; z-index: 6; }
@media (max-width: 900px) { .console { grid-template-columns: minmax(0, 1fr); gap: 24px; } }
.title {
  font-size: clamp(46px, 7vw, 92px); line-height: .92; font-weight: 800; letter-spacing: .01em;
}
.brand .lede { color: var(--cyan); margin: 16px 0 22px; font-size: 16px; max-width: 46ch; }
.modes { display: grid; gap: 10px; }
.mode-row {
  display: grid; gap: 2px; text-align: left; padding: 13px 18px 13px 20px; color: var(--ink);
  background-color: var(--panel); border: 1px solid var(--line); clip-path: var(--clip);
  position: relative;
}
.mode-row::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--line-2); }
.mode-row b { font-family: var(--display); font-weight: 700; font-size: 20px; line-height: 1.15; letter-spacing: .02em; }
.mode-row small { color: var(--muted); font-size: 14px; }
.mode-row:hover { border-color: var(--line-2); --edge: var(--line-2); }
.mode-row:hover::before { background: var(--cyan); }
.mode-row[aria-pressed="true"] {
  border-color: var(--yellow); --edge: var(--yellow);
  background-color: color-mix(in srgb, var(--yellow) 9%, var(--panel));
}
.mode-row[aria-pressed="true"]::before { background: var(--yellow); }
.mode-row[aria-pressed="true"] b { color: var(--yellow); }
.mode-row[aria-pressed="true"] small { color: var(--ink); }
.setup { display: grid; gap: 14px; align-content: start; }
.deck .rows { display: grid; gap: 12px; padding: 14px 16px 18px; }
.kv { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 12px; align-items: center; min-height: 34px; }
.kv.ghost { visibility: hidden; }
.kv > .lbl { color: var(--muted); font-size: 14px; }
.kv .ctl { min-width: 0; display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; }
.kv .ctl > .meter { flex: 1 1 220px; }
.kv.region-slot { align-items: start; }
.kv.region-slot > .lbl { padding-top: 8px; }
.region-box { display: grid !important; grid-template-rows: auto minmax(0, 1fr); align-items: stretch !important; gap: 6px; height: 168px; }
.region-box.world { grid-template-rows: 1fr; align-items: center; border: 1px dashed var(--line); padding: 10px 12px; }
.region-box .note { margin: 0; color: var(--muted); font-size: 14px; }
.region-box .filter { padding: 6px 10px; font-size: 14px; color: var(--cyan); }
.region-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); align-content: start; gap: 2px; overflow-y: auto; min-height: 0; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.region-list button { text-align: left; background: transparent; border: 0; border-left: 2px solid var(--line); color: var(--muted); font-size: 14px; padding: 4px 8px; line-height: 1.3; }
.region-list button:hover { color: var(--ink); border-left-color: var(--cyan); }
.region-list button[aria-pressed="true"] { color: var(--on-neon); background: var(--cyan); border-left-color: var(--yellow); }
.region-list .none { color: var(--muted); font-size: 14px; padding: 4px 2px; grid-column: 1 / -1; }
.cta { margin-top: 0; }
.setup .foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 22px; margin: 0; font-size: 15px; }
.foot .matches-link { padding: 9px 16px; font-size: 15px; }
@media (max-width: 520px) {
  .kv { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .kv.region-slot > .lbl { padding-top: 0; }
  .deck .rows { padding: 12px; }
}

/* ===== Sheets (results, lobbies, listings) ===== */
.sheet { color: var(--ink); max-width: 960px; margin: 0 auto; overflow: hidden; animation: sheet-in .4s cubic-bezier(.2, .8, .2, 1) both; z-index: 6; }
.sheet { border-top: 2px solid var(--yellow); }
/* sheets that open with a map: only the bottom-left corner is cut, so the map keeps its corners */
#solo-result-sheet, #solo-summary-sheet, #rr-sheet { clip-path: var(--clip-bl); --edge: transparent; background-image: linear-gradient(45deg, transparent calc(var(--cut) * .7071 - .5px), var(--line) calc(var(--cut) * .7071 - .5px) calc(var(--cut) * .7071 + 1px), transparent calc(var(--cut) * .7071 + 1px)); }
.sheet.narrow { max-width: 540px; }
#join-screen .sheet.narrow { max-width: 700px; } /* room for the six-wide avatar picker */
.sheet.wide { max-width: 1180px; }
.sheet .inner { padding: 22px 26px 26px; }
.sheet > .inner:has(> .hd), .sheet > .inner:has(> .pad) { padding: 0; }
.sheet .pad { padding: 20px 26px 26px; }
@media (max-width: 600px) { .sheet .inner, .sheet .pad { padding: 16px 16px 20px; } }
.sheet .head { display: flex; align-items: baseline; justify-content: space-between; gap: 6px 16px; flex-wrap: wrap; margin-bottom: 10px; }
.sheet .kicker, .kicker { font-size: 14px; color: var(--muted); }
.sheet .lead { font-size: 16px; color: var(--muted); margin: 6px 0 14px; }
.msg { margin-top: 10px; }
.sheet-map { width: 100%; height: 400px; background: #dfe6ea; }
.sheet-map.tall { height: clamp(380px, 62vh, 720px); }
@media (max-width: 600px) { .sheet-map, .sheet-map.tall { height: 260px; } }
@keyframes sheet-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.pause-line { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--yellow); width: 100%; transition: width linear; }
.band { margin: 0 0 14px; padding: 12px 16px; background: var(--pink-14); border-left: 3px solid var(--pink); color: var(--ink); }
.band .band-title { font-family: var(--display); font-weight: 800; font-size: 22px; line-height: 1.15; color: var(--pink); }
.band small { display: block; font-size: 15px; margin-top: 4px; }
.band-choice { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.band-choice .btn { flex: 1; min-width: 150px; }
.headline-sub { font-size: 15px; margin: -2px 0 12px; }
.next-line { margin-top: 16px; font-family: var(--display); font-weight: 700; font-size: 17px; color: var(--cyan); }
.join-grid, .lobby-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(200px, 250px); gap: 24px; align-items: start; margin-top: 8px; }
@media (max-width: 700px) { .join-grid, .lobby-grid { grid-template-columns: minmax(0, 1fr); } }
/* the avatar picker needs six 48 px buttons side by side */
@media (min-width: 701px) { .join-grid { grid-template-columns: minmax(328px, 1fr) minmax(200px, 260px); } }
.join-grid .actions { margin-top: 12px; }
.params { margin: 0; display: grid; border-left: 2px solid var(--cyan); padding-left: 14px; }
.params > div { padding: 5px 0; border-bottom: 1px solid var(--line); }
.params dt { font-size: 13px; color: var(--muted); }
.params dd { margin: 0; font-family: var(--display); font-weight: 600; font-size: 16px; }
.params dd.mode { color: var(--yellow); }
.person { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.person .pname { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.person .ok { color: var(--yellow); font-weight: 700; }
.avatar {
  display: inline-flex; width: 28px; height: 28px; align-items: center; justify-content: center; flex: none; vertical-align: middle;
  background: var(--c); color: #fff; font-family: var(--display); font-weight: 800; font-size: 15px; text-shadow: 0 1px 2px rgba(0, 0, 0, .7);
  clip-path: polygon(0 0, calc(100% - 6px) 0, 100% 6px, 100% 100%, 0 100%);
}
.avatar.sm { width: 28px; height: 28px; font-size: 12px; }
/* a player's chosen avatar: the round picture inside the player's colour */
.avatar.has-img { width: 28px; height: 28px; padding: 2px; border-radius: 50%; clip-path: none; text-shadow: none; }
.rr .avatar { width: 24px; height: 24px; font-size: 12px; }
.avatar.has-img img { display: block; width: 100%; height: 100%; border-radius: 50%; }
.you { display: inline-block; background: var(--yellow); color: var(--on-neon); font-family: var(--display); font-weight: 700; font-size: 11px; line-height: 1.4; padding: 0 6px; margin-left: 6px; vertical-align: middle; }

.big-num { font-family: var(--display); font-weight: 800; font-size: clamp(64px, 11vw, 128px); line-height: .9; color: var(--yellow); font-variant-numeric: tabular-nums; }
.big-num small { font-size: .26em; font-weight: 600; margin-left: 8px; color: var(--muted); }
.score-block { display: flex; align-items: flex-end; gap: 10px 22px; flex-wrap: wrap; margin: 4px 0 12px; }
.score-block .sub { font-size: 16px; color: var(--muted); padding-bottom: 10px; }
.score-block .sub b { color: var(--cyan); font-weight: 400; }
.result-sheet .big-num { font-size: clamp(56px, 8vw, 96px); }
.result-sheet .actions { margin-top: 14px; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 12px; }
.badge { display: inline-block; padding: 3px 9px; border: 1px solid var(--line-2); font-size: 13px; color: var(--ink); line-height: 1.3; }

/* segmented score bars */
.meterbar { position: relative; height: 16px; background: var(--line); }
.meterbar .fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--c, var(--cyan)); transition: width .8s cubic-bezier(.2, .8, .2, 1); }
/* segment gaps painted over track and fill */
.meterbar::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(90deg, transparent 0 calc(5% - 2px), var(--gap, var(--panel)) calc(5% - 2px) 5%); }
.table tr.me .meterbar { --gap: #0f1f2c; }
.meterbar.a { --c: var(--team-a); } .meterbar.b { --c: var(--team-b); } .meterbar.c { --c: var(--team-c); }
.bar-row { display: grid; grid-template-columns: minmax(80px, 150px) minmax(0, 1fr) auto; gap: 12px; align-items: center; margin: 7px 0; }
.bar-row .name { font-family: var(--display); font-weight: 600; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-row .val { font-family: var(--display); font-weight: 800; font-size: 20px; min-width: 64px; text-align: right; line-height: 1; color: var(--yellow); font-variant-numeric: tabular-nums; }
.bar-row .val small { font-family: var(--mono); font-weight: 400; font-size: 12px; color: var(--muted); display: block; margin-top: 2px; }
.bar-row.dim { opacity: .5; }
.table .bar-row { margin: 0; grid-template-columns: minmax(60px, 1fr) auto; }
.table .bar-row .name { display: none; }

/* health bars: the value sits inside the fill, or just outside it when the fill is too narrow */
.hp-row { display: grid; grid-template-columns: minmax(90px, 170px) minmax(0, 1fr) 70px; --p: 0%; gap: 12px; align-items: center; margin: 8px 0; }
.hp-row .name { font-family: var(--display); font-weight: 700; font-size: 18px; line-height: 1.1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hp-row .name small { display: block; font-family: var(--mono); font-weight: 400; font-size: 12px; color: var(--muted); min-height: 16px; margin-top: 3px; }
.hp-row .tmult { display: inline-block; padding: 0 8px; line-height: 24px; border: 1px solid var(--cyan); color: var(--cyan); font-family: var(--display); font-size: 15px; font-weight: 700; transition: background .3s, color .3s; }
.hp-row .tmult.up, .hp-row .tmult.flying, .hp-row .tmult.armed { background: var(--yellow); border-color: var(--yellow); color: var(--on-neon); }
.hp-bar { height: 34px; background-color: var(--bg); border: 1px solid var(--line); position: relative; clip-path: var(--clip-s); }
.hp-bar .fill { height: 100%; transition: width .7s ease; }
.hp-bar.a .fill { background: var(--team-a); } .hp-bar.b .fill { background: var(--team-b); } .hp-bar.c .fill { background: var(--team-c); }
.hp-bar .hp-val { position: absolute; top: 50%; left: calc(var(--p) - 10px); transform: translate(-100%, -50%); color: #fff; white-space: nowrap;
  font-family: var(--display); font-weight: 800; font-size: 19px; text-shadow: 0 1px 2px rgba(0, 0, 0, .6); transition: left .7s ease; font-variant-numeric: tabular-nums; }
.hp-row.narrow .hp-val { left: calc(var(--p) + 8px); transform: translate(0, -50%); color: var(--ink); }
.hp-row .mcell { display: flex; justify-content: flex-end; align-items: center; }
.hp-row .tmult.gone { display: none; }
.hp-row .tmult { white-space: nowrap; }
.hp-row .tmult.up { animation: tmult-pop .4s ease; }
@keyframes tmult-pop { 50% { transform: scale(1.35); } }
.hp-row .dmg.hit { animation: dmg-hit .35s ease; }
@keyframes dmg-hit { 0% { transform: scale(1.5); } 40% { transform: translateX(-4px) scale(1.15); } 70% { transform: translateX(3px); } }
.hp-row .dmg { display: none; text-align: right; font-family: var(--display); font-weight: 800; font-size: 18px; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; transition: opacity .3s ease; }
.hp-row .dmg.show { display: inline-block; }
@media (max-width: 600px) { .hp-row { grid-template-columns: minmax(70px, 110px) minmax(0, 1fr) 58px; gap: 8px; } .hp-bar .hp-val { font-size: 15px; } .hp-row .name { font-size: 16px; } .hp-row .dmg { font-size: 15px; } }
.hp-row.dead { opacity: .45; }

/* tables */
.table { width: 100%; border-collapse: collapse; margin: 10px 0; }
.table th, .table td { padding: 8px 8px; text-align: left; border-bottom: 1px solid var(--line); font-size: 15px; vertical-align: middle; }
.table th { font-weight: 400; color: var(--muted); font-size: 13px; }
.table th.r, .table td.r, .table td.num { text-align: right; }
.table tr.me td { background: var(--cyan-12); }
.table tr.me td:first-child { box-shadow: inset 3px 0 0 var(--cyan); }
.table tr.elim td { color: var(--pink); }
.table tr.dim td { opacity: .5; }
.table td.num { font-family: var(--display); font-weight: 700; font-size: 19px; color: var(--yellow); font-variant-numeric: tabular-nums; }
.table td.num.rank { text-align: left; color: var(--muted); width: 36px; }
.table.compact th, .table.compact td { padding: 5px 8px; }
.table.compact td.num { font-size: 18px; }
.out-tag { font-family: var(--display); font-weight: 700; font-size: 12px; color: var(--on-neon); background: var(--pink); padding: 0 6px; }
.t-a { color: var(--team-a-t); } .t-b { color: var(--team-b-t); } .t-c { color: var(--team-c-t); }
.teamdot { display: inline-block; width: 10px; height: 10px; margin-right: 8px; vertical-align: middle; transform: skewX(-15deg); flex: none; }
.teamdot.a { background: var(--team-a); } .teamdot.b { background: var(--team-b); } .teamdot.c { background: var(--team-c); }
.winner-line { font-family: var(--display); font-weight: 800; font-size: 28px; line-height: 1.1; margin: 8px 0 8px; color: var(--yellow); }
.winner-line.big { font-size: clamp(30px, 5vw, 48px); }
.winner-line.draw { color: var(--ink); }

/* team totals */
.team-totals { display: grid; gap: 8px; margin: 10px 0 14px; }
.team-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 10px 16px 10px 18px; background-color: var(--panel-2); border: 1px solid var(--line); position: relative; clip-path: var(--clip-s); }
.team-row::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--muted); }
.team-row.a::before { background: var(--team-a); } .team-row.b::before { background: var(--team-b); } .team-row.c::before { background: var(--team-c); }
.team-row .tn { font-family: var(--display); font-weight: 700; font-size: 22px; line-height: 1.1; min-width: 0; }
.team-row .tn small { display: block; font-family: var(--mono); font-weight: 400; font-size: 13px; color: var(--muted); margin-top: 2px; }
.team-row .tv { font-family: var(--display); font-weight: 800; font-size: 34px; line-height: 1; color: var(--ink); font-variant-numeric: tabular-nums; }
.team-row.winner { border-color: var(--yellow); --edge: var(--yellow); background-color: color-mix(in srgb, var(--yellow) 12%, var(--panel-2)); }
.team-row.winner .tv { color: var(--yellow); }
.team-row.dead { opacity: .5; }
.team-row.mine { box-shadow: inset 0 0 0 1px var(--cyan); }

/* rankings */
.standings { list-style: none; padding: 0; margin: 6px 0 0; counter-reset: rank; }
.standings li { display: flex; align-items: center; gap: 10px; padding: 9px 4px; border-bottom: 1px solid var(--line); font-size: 16px; }
.standings li::before { counter-increment: rank; content: counter(rank); font-family: var(--display); font-weight: 800; font-size: 24px; width: 40px; line-height: 1; color: var(--muted); font-variant-numeric: tabular-nums; }
.standings li.first { font-size: 19px; }
.standings li.first::before { color: var(--yellow); }
.standings li.me { background: var(--cyan-12); box-shadow: inset 3px 0 0 var(--cyan); }
.standings.plain li::before { content: none; }
.standings li .note { margin-left: auto; font-size: 13px; color: var(--muted); text-align: right; }
.standings li.elim { color: var(--pink); }
.player-list { list-style: none; padding: 0; margin: 8px 0; }
.player-list li { padding: 6px 0; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.wait-line { font-size: 14px; color: var(--muted); margin: 10px 0 0; }

/* lobby */
.teams { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 14px 0; }
@media (max-width: 640px) { .teams { grid-template-columns: minmax(0, 1fr); } }
.team-col { padding: 10px 12px 12px; background: var(--panel-2); border: 1px solid var(--line); border-top: 3px solid var(--muted); min-height: 130px; display: grid; align-content: start; gap: 8px; }
.team-col.a { border-top-color: var(--team-a); } .team-col.b { border-top-color: var(--team-b); } .team-col.c { border-top-color: var(--team-c); }
.team-col.mine { box-shadow: inset 0 0 0 1px var(--cyan); }
.team-col h4 { font-size: 19px; }
.team-col .btn { justify-self: start; }
.team-col ul { list-style: none; padding: 0; margin: 0; }
.team-col li { padding: 3px 0; font-size: 15px; }
.team-col li.disc { color: var(--muted); }
.share { display: flex; gap: 8px; margin: 4px 0; }
.share input { flex: 1; min-width: 0; font-size: 14px; color: var(--cyan); }
.lobby-status { font-family: var(--display); font-weight: 700; font-size: 18px; margin: 12px 0 0; color: var(--cyan); }
.people-grid { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 0; }
.pchip { display: inline-flex; align-items: center; background: var(--panel-2); border: 1px solid var(--line); padding: 4px 10px 4px 5px; max-width: 100%; }
.pchip.me { border-color: var(--cyan); box-shadow: inset 0 0 0 1px var(--cyan); }
.pchip .host-mark { font-size: 12px; color: var(--muted); margin-left: 8px; }
.lobby-foot { margin-top: 18px; display: grid; gap: 10px; }
.countdown-row { display: flex; gap: 10px; align-items: stretch; flex-wrap: wrap; }
.countdown-row .btn { align-self: center; flex: 0 0 auto; }
.countdown-bar { flex: 1; display: flex; align-items: center; justify-content: center; gap: 10px; background: var(--bg); border-left: 3px solid var(--cyan); font-family: var(--display); font-weight: 700; font-size: 16px; padding: 6px 14px; }
.countdown-bar .cd-label, .countdown-bar .cd-unit { white-space: nowrap; }
.countdown-bar .cd-num { font-size: 48px; line-height: 1; min-width: 2ch; text-align: center; font-variant-numeric: tabular-nums; color: var(--cyan); animation: cdpulse 1s ease-out infinite; }
.countdown-bar.soon { border-left-color: var(--yellow); }
.countdown-bar.soon .cd-num { color: var(--yellow); }

/* listing */
.mrow { border-top: 1px solid var(--line); padding: 16px 0 20px; }
.mrow:first-of-type { border-top: none; }
.mrow .mhead { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; margin-bottom: 4px; }
.mrow .host { font-family: var(--display); font-weight: 800; font-size: 24px; line-height: 1.1; }
.tag { display: inline-block; padding: 2px 9px; background: var(--cyan); color: var(--on-neon); font-family: var(--display); font-weight: 700; font-size: 13px; line-height: 1.4; }
.tag.quiet { background: transparent; border: 1px solid var(--line-2); color: var(--muted); font-family: var(--mono); font-weight: 400; }
.mrow .teams { margin: 10px 0 0; }
.mrow .team-col, .mrow .brlist { cursor: pointer; min-height: 80px; }
.mrow .team-col:hover, .mrow .brlist:hover { background: var(--cyan-12); }
.mrow.full .team-col, .mrow.full .brlist { cursor: default; opacity: .6; }
.mrow .brlist { padding: 10px 12px; background: var(--panel-2); border: 1px solid var(--line); margin-top: 10px; }
.mrow .brlist b { font-family: var(--display); font-size: 18px; color: var(--yellow); }
.mrow .brlist .player-list li { border: none; padding: 3px 0; }

/* round by round */
.rounds-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin: 6px 0 12px; }
.rounds-grid.wide { grid-template-columns: minmax(0, 1fr); }
.rounds-grid.wide .rr { align-items: flex-start; }
.rounds-grid.wide .rr .nm { white-space: normal; }
.rcard { background: var(--panel-2); border: 1px solid var(--line); padding: 8px 10px 10px; display: grid; gap: 6px; align-content: start; min-width: 0; }
.rcard.void { opacity: .7; }
.rcard .rtitle { font-family: var(--display); font-weight: 700; font-size: 15px; color: var(--cyan); }
.sheet-map.mini { height: 150px; margin: 0; }
.rrows { display: grid; gap: 3px; }
.rr { display: flex; align-items: center; gap: 6px; font-size: 13px; min-width: 0; }
.rr .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rr .v { font-family: var(--display); font-weight: 700; font-size: 14px; color: var(--yellow); font-variant-numeric: tabular-nums; }
.rr.out .nm { text-decoration: line-through; color: var(--muted); }
.attempts { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.attempt { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; padding: 1px 7px; border: 1px solid var(--line); font-size: 12px; color: var(--muted); text-decoration: none; }
.attempt.ok { color: var(--ok); border-color: rgba(61, 255, 154, .35); } .attempt.no { color: var(--pink); border-color: rgba(255, 42, 109, .35); } .attempt.life { color: var(--ink); }

/* BR winner */
#br-trophy { position: relative; height: 150px; display: flex; align-items: center; justify-content: center; overflow: hidden; margin-bottom: 6px;
  background: repeating-linear-gradient(-45deg, rgba(252, 238, 10, .08) 0 10px, transparent 10px 20px); }
.trophy { font-size: 96px; line-height: 1; animation: trophy-in 1.2s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes trophy-in { from { transform: scale(.3) translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ===== Game screen ===== */
#game-screen { position: fixed; inset: 0; overflow: hidden; background: #000; }
#game-screen.active { display: block; }
/* dim and freeze: a veil above Street View and the guess map, leaving the Google layer itself untouched */
#game-screen::before { content: ""; position: absolute; inset: 0; z-index: 35; background: rgba(7, 7, 13, .86); opacity: 0; pointer-events: none; transition: opacity .5s ease; }
#game-screen.dim::before { opacity: 1; pointer-events: auto; }
#game-screen.frozen::before { pointer-events: auto; }
#game-screen.warn::after { content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 5; animation: vignette .7s ease-in-out infinite alternate; }
@keyframes vignette { from { box-shadow: inset 0 0 60px 10px rgba(255, 59, 59, .25); } to { box-shadow: inset 0 0 140px 40px rgba(255, 59, 59, .85); } }

/* the one HUD chip: clock and round, top-left */
#timer-pill {
  position: absolute; top: 12px; left: 12px; z-index: 37; pointer-events: none; display: flex; align-items: baseline; gap: 10px;
  background: var(--hud); border-left: 3px solid var(--yellow); padding: 5px 12px 6px 10px; white-space: nowrap;
}
#timer-text { order: 1; font-family: var(--display); font-weight: 800; font-size: 24px; line-height: 1.05; color: var(--yellow); font-variant-numeric: tabular-nums; min-width: 2.6em; }
#round-caption { order: 2; font-family: var(--mono); font-size: 13px; color: var(--cyan); }
#game-screen.warn #timer-pill { border-left-color: var(--warn-red); animation: chip-warn .7s ease-in-out infinite alternate; }
#game-screen.warn #timer-text, #game-screen.warn #round-caption { color: #fff; }
@keyframes chip-warn { from { background: var(--hud); } to { background: rgba(170, 20, 30, .92); } }

/* compass: dark strip, cyan underline, yellow north and needle */
#compass { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); z-index: 10; pointer-events: none; width: 320px; }
#game-screen.br-countries #compass { top: 46px; }
#compass-window, .rp-compass .compass-window { width: 320px; height: 28px; background: rgba(7, 7, 13, .82); border-bottom: 2px solid var(--cyan); overflow: hidden; position: relative; }
#compass-strip { position: absolute; left: 50%; top: 0; height: 28px; display: flex; white-space: nowrap; will-change: transform; }
#compass-strip span, .rp-compass .compass-strip span { width: 40px; flex: 0 0 40px; text-align: center; line-height: 28px; font-family: var(--display); font-weight: 700; font-size: 13px; color: var(--cyan); }
#compass-strip span.n, .rp-compass .compass-strip span.n { color: var(--yellow); }
#compass-needle, .rp-compass .compass-needle { width: 0; height: 0; margin: 2px auto 0; border-left: 6px solid transparent; border-right: 6px solid transparent; border-top: 8px solid var(--yellow); font-size: 0; line-height: 0; color: transparent; overflow: hidden; }

#br-circles { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); z-index: 10; pointer-events: none; display: flex; gap: 5px; }
#br-circles .slot { width: 24px; height: 24px; border: 1px solid var(--cyan); background: var(--hud); transform: skewX(-12deg); display: inline-flex; align-items: center; justify-content: center; font-family: var(--display); font-weight: 800; font-size: 12px; color: #fff; }
#br-circles .slot.taken { border-color: transparent; animation: pop .3s ease; }
@keyframes pop { 0% { transform: skewX(-12deg) scale(.4); } 70% { transform: skewX(-12deg) scale(1.2); } 100% { transform: skewX(-12deg) scale(1); } }

#shortcuts-hint { position: absolute; left: 12px; bottom: 30px; z-index: 10; pointer-events: none; font-family: var(--mono); font-size: 12px; color: var(--ink); background: var(--hud); border-left: 2px solid var(--cyan); padding: 2px 8px; white-space: pre; }

/* battle royale panels: compact, top right */
#br-topright { position: absolute; top: 10px; right: 10px; z-index: 10; pointer-events: none; width: 240px; max-width: 42vw; display: grid; gap: 6px; }
#br-leaderboard, #br-shared { background: var(--hud); border-left: 3px solid var(--cyan); padding: 6px 9px; font-size: 13px; color: var(--ink); }
#br-shared:not(:has(> :not([hidden]))) { display: none; }
#br-leaderboard:empty { display: none; }
.lb-row { display: flex; align-items: center; gap: 6px; padding: 2px 0; min-width: 0; }
.lb-row.me { background: var(--cyan-12); box-shadow: inset 2px 0 0 var(--cyan); margin: 0 -5px; padding: 2px 5px; }
.lb-row .rank { width: 18px; font-family: var(--display); font-weight: 700; color: var(--muted); }
.lb-row .dot { width: 9px; height: 9px; flex: none; transform: skewX(-15deg); }
.lb-row .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-row .dist { font-family: var(--display); font-weight: 700; font-size: 13px; color: var(--yellow); white-space: nowrap; }
.lb-row .dist.none { font-family: var(--mono); font-weight: 400; font-size: 11px; color: var(--muted); }
.lb-row.out .nm { text-decoration: line-through; opacity: .6; }
.lb-row .lock { font-size: 11px; }
.pins { display: inline-flex; gap: 2px; }
.pins .pin { width: 8px; height: 11px; display: inline-block; }
.pins .pin.used { opacity: .25; filter: grayscale(1); }
#br-quiet { text-align: center; font-family: var(--display); font-weight: 700; font-size: 15px; padding: 1px 0 4px; color: var(--yellow); }
#br-flags { display: flex; flex-wrap: wrap; gap: 3px; margin-bottom: 4px; }
#br-flags .flag { background: rgba(255, 255, 255, .08); padding: 0 4px; font-size: 15px; }
#br-flags .flag .cnt { font-size: 10px; color: var(--muted); margin-left: 2px; }
#br-flags .flag.blink { animation: blinkred .3s ease 2; }
@keyframes blinkred { 50% { background: var(--pink); } }

#continent-overlay { position: absolute; inset: 0; z-index: 36; background: rgba(7, 7, 13, .72); display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; }
#continent-map { width: min(80vw, 700px); height: min(60vh, 450px); overflow: hidden; border: 1px solid var(--cyan); }
#continent-name { font-family: var(--display); font-weight: 800; font-size: clamp(32px, 6vw, 52px); margin-top: 12px; color: var(--yellow); }

/* the submit row under the guess map */
#submit-row { display: flex; }
#submit-guess, #finish-guess { flex: 1; height: 52px; border: none; font-family: var(--display); font-weight: 800; font-size: 19px; letter-spacing: .04em; color: var(--on-neon); background: var(--yellow); }
#submit-guess:hover:not(:disabled) { background: #fff36a; }
#submit-guess:disabled { background: #1a1a2c; color: var(--muted); cursor: default; }
#submit-guess[data-state="locked"], #game-screen.locked #submit-guess:disabled { background: var(--cyan); color: var(--on-neon); }
#finish-guess { flex: 0 0 34%; background: var(--bg); color: var(--cyan); border-left: 1px solid var(--line); }
#finish-guess:disabled { opacity: .5; }
#game-screen.br-distance #submit-guess { font-size: 16px; white-space: nowrap; }
#lifelines { display: flex; gap: 4px; padding: 4px; background: var(--bg); }
#lifelines .lifeline { flex: 1; text-align: center; font-family: var(--display); font-weight: 700; font-size: 15px; padding: 5px 4px; border: 1px solid var(--cyan); background: transparent; color: var(--cyan); }
#lifelines .lifeline.used { opacity: .4; text-decoration: line-through; }
#lifelines .lifeline:disabled { opacity: .45; cursor: default; }
#country-search-wrap { position: relative; padding: 4px; background: var(--bg); }
#country-search { padding: 8px 10px; font-size: 15px; }
#country-suggest { position: absolute; left: 4px; right: 4px; top: 100%; z-index: 5; list-style: none; margin: 0; padding: 0; background: var(--bg); border: 1px solid var(--cyan); max-height: 180px; overflow-y: auto; color: var(--ink); }
#country-suggest li { padding: 6px 10px; cursor: pointer; }
#country-suggest li:hover, #country-suggest li.hl { background: var(--cyan); color: var(--on-neon); }
#br-readout { padding: 5px 8px; background: var(--bg); font-family: var(--display); font-weight: 700; font-size: 16px; text-align: center; color: var(--yellow); }

#loading-overlay { position: absolute; inset: 0; z-index: 40; background: rgba(7, 7, 13, .95); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; font-family: var(--display); font-weight: 700; font-size: 22px; color: var(--ink); }
.spinner { width: 44px; height: 44px; border: 3px solid var(--line); border-top-color: var(--cyan); border-right-color: var(--yellow); animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
#touch-divider, #touch-buttons { display: none; }

/* pre-round countdown on the dimmed panorama */
#round-countdown { position: absolute; inset: 0; z-index: 45; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; }
#round-countdown .num { font-family: var(--display); font-weight: 800; font-size: min(56vh, 56vw); line-height: 1; color: var(--yellow); text-shadow: 0 4px 0 rgba(7, 7, 13, .6); animation: cdpulse 1s ease-out infinite; font-variant-numeric: tabular-nums; }
#round-countdown .num.go { color: var(--cyan); text-shadow: 0 4px 0 rgba(7, 7, 13, .6); }
#round-countdown .lbl { font-family: var(--display); font-weight: 700; font-size: clamp(18px, 3vw, 28px); color: var(--ink); margin-top: 4px; background: var(--hud); padding: 2px 14px; }
@keyframes cdpulse { 0% { transform: scale(1.1); } 100% { transform: scale(1); } }

/* ===== Banners and toasts ===== */
#banners { position: fixed; left: 0; right: 0; top: 0; z-index: 60; pointer-events: none; }
.banner {
  position: absolute; left: 50%; transform: translateX(-50%); padding: 7px 18px 7px 14px; max-width: calc(100vw - 24px);
  background: rgba(7, 7, 13, .94); border-left: 4px solid var(--c, var(--cyan)); color: var(--c, var(--cyan));
  font-family: var(--display); font-weight: 700; font-size: 19px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; animation: slidein .3s ease;
}
@keyframes slidein { from { opacity: 0; transform: translate(-50%, -16px); } to { opacity: 1; transform: translate(-50%, 0); } }
.banner.green, .banner.okgreen, .banner.mult-green { --c: var(--ok); }
.banner.red, .banner.mult-red { --c: #ff5c8a; }
.banner.orange, .banner.amber, .banner.mult-orange { --c: #ffb23d; }
.banner.pulse { animation: slidein .3s ease, bpulse .5s ease-in-out infinite alternate; }
@keyframes bpulse { from { transform: translateX(-50%) scale(1); } to { transform: translateX(-50%) scale(1.06); } }
#toasts { position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%); z-index: 70; display: flex; flex-direction: column; gap: 6px; pointer-events: none; max-width: calc(100vw - 24px); }
.toast { background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-left: 3px solid var(--yellow); padding: 7px 14px; animation: slidein .3s; }

/* ===== Modals ===== */
.modal-backdrop { position: fixed; inset: 0; z-index: 80; background: rgba(7, 7, 13, .78); display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal { color: var(--ink); padding: 0 24px 22px; width: 100%; max-width: 560px; max-height: 92vh; max-height: 92dvh; overflow-y: auto; border-top: 3px solid var(--yellow); }
.modal.wide { max-width: 880px; }
.modal .modal-title { margin: 18px 0 10px; font-size: 26px; color: var(--yellow); }
.modal .modal-actions { display: flex; gap: 12px; margin-top: 20px; flex-wrap: wrap; }
.modal .modal-actions .btn { flex: 1; min-width: 120px; }
.modal-lead, .modal-note { color: var(--muted); }
.modal-map { width: 100%; height: 260px; background: #dfe6ea; margin: 10px 0; }
.choice { display: flex; gap: 10px; flex-wrap: wrap; }
.choice-btn { flex: 1; min-width: 140px; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 16px 10px; border: 1px solid var(--cyan); --edge: var(--cyan); background-color: transparent; color: var(--ink); font-family: var(--display); font-weight: 700; font-size: 18px; clip-path: var(--clip-s); }
.choice-btn .flag { font-size: 38px; }
.choice-btn:hover { background-color: var(--cyan-12); }
.modal pre { background: var(--bg); padding: 10px; overflow-x: auto; font-size: 13px; }
.keys { border-collapse: collapse; }
.keys td { padding: 5px 8px; border-bottom: 1px solid var(--line); }

/* full-screen lobby countdown (BR) */
#countdown-overlay { position: fixed; inset: 0; z-index: 90; background: rgba(7, 7, 13, .94); display: flex; flex-direction: column; align-items: center; justify-content: center; }
#countdown-number { font-family: var(--display); font-weight: 800; font-size: min(56vh, 56vw); line-height: 1; color: var(--ink); animation: cdpulse 1s ease-out infinite; font-variant-numeric: tabular-nums; }
#countdown-number.u1 { color: #f7f3a0; } #countdown-number.u2 { color: #faf060; } #countdown-number.u3 { color: var(--yellow); }
#countdown-label { font-family: var(--display); font-weight: 700; font-size: clamp(18px, 3vw, 28px); color: var(--cyan); margin-top: 12px; }

/* ===== Match history ===== */
.history-list { display: grid; margin-top: 6px; }
.history-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 16px; align-items: center; padding: 14px 12px 14px 14px; border-top: 1px solid var(--line); color: var(--ink); text-decoration: none; position: relative; }
.history-row:first-child { border-top: none; }
.history-row:hover, .history-row:focus-visible { background: var(--cyan-12); outline: none; box-shadow: inset 3px 0 0 var(--yellow); color: var(--ink); }
.history-result { font-family: var(--display); font-weight: 800; font-size: 24px; line-height: 1.1; }
.history-row.abandoned .history-result { color: var(--muted); }
.history-meta { display: flex; gap: 6px 12px; align-items: center; justify-content: flex-end; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.history-words { grid-column: 1 / -1; font-size: 13px; color: var(--muted); }
.history-players { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 14px; }
@media (max-width: 600px) { .history-row { grid-template-columns: minmax(0, 1fr); } .history-meta { justify-content: flex-start; } .history-result { font-size: 21px; } }

/* ===== Match review: a video editor around the shared replay panel ===== */
#review-screen .sheet { overflow: visible; }
.review-kicker { margin: 0 0 12px; font-size: 14px; }
.review-strip { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.review-top { align-items: flex-start; flex-wrap: wrap; gap: 10px 16px; }
.review-when { margin: 4px 0 0; }
.review-links { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.review-links .btn { text-decoration: none; }
.review-grid { --review-rail-w: 256px; --review-gap: 16px; }
.review-rail { padding: 0 0 4px; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.review-rail .hd { position: sticky; top: 0; z-index: 2; flex: 0 0 auto; }
.review-round { display: grid; gap: 5px; padding: 9px 12px 10px 14px; background: transparent; border: 0; border-bottom: 1px solid var(--line); color: var(--ink); font-family: var(--mono); font-size: 14px; position: relative; }
.review-round .rl { display: flex; align-items: center; gap: 8px; min-width: 0; }
.review-round .rt { font-family: var(--display); font-weight: 700; font-size: 16px; }
.review-round .flag { font-size: 17px; line-height: 1; }
.review-round .win { margin-left: auto; display: inline-flex; }
.review-round .win .teamdot { margin: 0; width: 12px; height: 12px; }
.review-round:hover { background: var(--cyan-12); }
.review-round.void .rt { color: var(--muted); }
.review-round[aria-current="true"] { background: var(--cyan); color: var(--on-neon); box-shadow: inset 4px 0 0 var(--yellow); }
.review-round[aria-current="true"] .review-indicator b, .review-round[aria-current="true"] .tmult-mini { color: var(--on-neon); }
.review-indicator { display: grid; gap: 4px; min-width: 0; }
.review-indicator b { font-family: var(--display); font-weight: 700; font-size: 14px; line-height: 1; font-variant-numeric: tabular-nums; color: var(--yellow); }
.review-indicator.totals, .review-indicator.br { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.review-indicator .tot { display: inline-flex; align-items: center; }
.review-indicator .tot.wide { display: flex; justify-content: space-between; gap: 8px; width: 100%; }
.review-indicator .tot .nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.review-indicator .flag { font-size: 18px; line-height: 1; }
.review-indicator .outs { display: inline-flex; gap: 3px; }
.review-indicator .outs .avatar { box-shadow: inset 0 0 0 2px var(--pink); }
.hp-mini .bar { height: 6px; background: var(--line); }
.hp-mini.a .bar i { background: var(--team-a); } .hp-mini.b .bar i { background: var(--team-b); } .hp-mini.c .bar i { background: var(--team-c); }
.hp-mini.dead { opacity: .45; }
.hp-mini .tmult-mini { color: var(--cyan); opacity: 1; font-family: var(--display); }
.review-round[aria-current="true"] .hp-mini .bar { background: rgba(7, 7, 13, .35); }
.review-round[aria-current="true"] .hp-mini .bar i { box-shadow: inset 0 0 0 1px var(--on-neon); }
.rail-scores { background: var(--bg-2); border-left: 3px solid var(--yellow); border-bottom: 1px solid var(--line); }
.rail-score { padding: 6px 10px; border-bottom: 1px solid var(--line); font-size: 13px; }
.rail-score:last-child { border-bottom: none; }
.rail-score .who i { border-radius: 0 !important; transform: skewX(-15deg); }
.rail-score .res { font-family: var(--display); font-weight: 700; font-size: 15px; color: var(--yellow); }
.rail-score .det { color: var(--muted); font-size: 12px; }
.rail-score .attempt { font-size: 11px; }
.rail-score.me { background: var(--cyan-12); }
.rail-score.out .pname { text-decoration: line-through; color: var(--muted); }
@media (max-width: 959px) {
  .review-rail .rail-hd { display: none; }
  .review-rail { gap: 0; }
  .review-round { border-bottom: 0; border-right: 1px solid var(--line); min-width: 176px; }
  .rail-scores { border-bottom: 0; border-right: 1px solid var(--line); }
}

.editor { overflow: visible; }
.editor > .hd { flex-wrap: wrap; }
.editor .rtitle { font-size: 14px; }
.editor .hd-link { color: var(--on-neon); font-family: var(--display); font-weight: 700; font-size: 13px; text-decoration: underline; text-underline-offset: 2px; white-space: nowrap; }
.editor .hd-link:hover { color: var(--on-neon); text-decoration-thickness: 2px; }
.editor-meta { display: flex; flex-wrap: wrap; gap: 4px 16px; padding: 8px 14px; border-bottom: 1px solid var(--line); font-size: 14px; }
.rp-frame { padding: 0 0 4px; }
.rp { display: grid; gap: 0; }
/* toolbar: the two views as a segmented control, the player chips as track buttons */
.rp-top { padding: 8px 12px; border-bottom: 1px solid var(--line); background: var(--bg-2); }
.rp-tabs { gap: 0; }
.rp-tab { padding: 6px 14px; background: transparent; border: 1px solid var(--line-2); color: var(--muted); font-family: var(--display); font-weight: 700; font-size: 14px; }
.rp-tab + .rp-tab { border-left: 0; }
.rp-tab:hover { color: var(--ink); }
.rp-tab[aria-pressed="true"] { background: var(--yellow); border-color: var(--yellow); color: var(--on-neon); }
.rp-who { padding: 4px 10px; background: transparent; border: 1px solid var(--line-2); color: var(--ink); font-family: var(--mono); font-size: 13px; }
.rp-who i { border-radius: 0 !important; transform: skewX(-15deg); }
.rp-who:hover { border-color: var(--cyan); }
.rp-who[aria-pressed="true"] { background: var(--cyan); border-color: var(--cyan); color: var(--on-neon); }
.rp-location, .rp-stage { background: #000; }
.rp-location { border-bottom: 1px solid var(--line); }
.rp[data-view="replay"] .rp-top { border-bottom: 0; }
.rp-stage { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.rp-stage.touch .rp-divider { background: rgba(255, 255, 255, .55); }
.rp-submit { height: 34px; line-height: 34px; padding: 0 8px; background: var(--yellow); color: var(--on-neon); font-family: var(--display); font-weight: 800; font-size: clamp(11px, 1.2vw, 15px); }
.rp-timer, .rp-badge, .rp-note { background: var(--hud); font-family: var(--display); font-weight: 700; padding: 2px 10px; font-variant-numeric: tabular-nums; }
.rp-timer { color: var(--yellow); font-size: clamp(13px, 1.8vw, 22px); border-left: 3px solid var(--yellow); }
.rp-timer.warn { color: #fff; background: rgba(170, 20, 30, .92); border-left-color: var(--warn-red); }
.rp-badge { font-size: 12px; border-left: 3px solid var(--pink); color: var(--pink); }
.rp-note { font-size: 12px; color: var(--yellow); }
.rp-loading { background: rgba(7, 7, 13, .9); color: var(--ink); font-family: var(--display); font-weight: 700; font-size: 18px; }
.rp .rp-bigplay { background: var(--yellow); color: var(--on-neon); border-radius: 0; clip-path: var(--clip); }
/* transport bar */
.rp-bar { padding: 8px 12px; background: var(--bg-2); gap: 10px; }
.rp-icon { background: transparent; border: 1px solid var(--cyan); color: var(--cyan); }
.rp-icon:hover, .rp-cog[aria-expanded="true"] { background: var(--cyan-12); }
.rp-play { background: var(--cyan); color: var(--on-neon); }
.rp-play:hover { background: #5fe6f7; }
.rp-progress { color: var(--ink); }
.rp-progress:focus-visible { outline-offset: 4px; }
.rp-fill { background: linear-gradient(90deg, rgba(2, 215, 242, .5), var(--cyan)); }
.rp-knob { background: var(--pink); }
.rp-marker { background: var(--ink); opacity: .9; }
.rp-marker.pin { background: var(--yellow); }
.rp-marker.lock, .rp-marker.finish { background: var(--yellow); }
.rp-marker.guess { background: var(--yellow); color: var(--on-neon); font-family: var(--display); font-weight: 800; }
.rp-marker.lifeline { background: var(--cyan); }
.rp-marker.eliminated { background: var(--pink); }
.rp-marker.hidden-span { background: repeating-linear-gradient(135deg, var(--pink) 0 3px, transparent 3px 6px); opacity: 1; }
.rp-time { font-family: var(--mono); font-size: 15px; color: var(--yellow); }
.rp-activity { background: var(--line); height: 6px; }
.rp-activity i.on { background: var(--cyan); opacity: .7; }
.rp-activity i.span { background: repeating-linear-gradient(135deg, var(--pink) 0 3px, transparent 3px 6px); }
.rp-status { color: var(--muted); font-size: 13px; min-height: 1.4em; padding: 6px 12px 2px; font-variant-numeric: tabular-nums; }
.rp-menu { background: var(--panel); border: 1px solid var(--cyan); border-top: 3px solid var(--yellow); box-shadow: 0 10px 30px rgba(0, 0, 0, .7); }
.rp-menu-label { font-family: var(--display); font-weight: 700; font-size: 14px; color: var(--muted); }
.rp-speeds .chip { font-size: 13px; padding: 4px 9px; }
.rp-answer { position: relative; padding: 5px 12px 5px 54px; border: 1px solid var(--line-2); background: transparent; color: var(--ink); font-family: var(--mono); font-size: 14px; }
.rp-answer::before { content: ""; position: absolute; left: 10px; top: 50%; width: 34px; height: 16px; margin-top: -8px; background: var(--line); transform: skewX(-18deg); }
.rp-answer::after { content: ""; position: absolute; left: 13px; top: 50%; width: 12px; height: 10px; margin-top: -5px; background: var(--muted); transition: transform .18s; }
.rp-answer[aria-pressed="true"] { border-color: var(--yellow); }
.rp-answer[aria-pressed="true"]::before { background: var(--yellow-12); box-shadow: inset 0 0 0 1px var(--yellow); }
.rp-answer[aria-pressed="true"]::after { transform: translateX(16px); background: var(--yellow); }

/* ===== Narrow windows (non-touch) ===== */
@media (max-width: 700px) {
  #timer-pill { top: 8px; left: 8px; }
  #compass, #compass-window { width: 200px; }
  #compass { top: 52px; }
  #game-screen.br-countries #compass { top: 84px; }
  #br-circles { top: 52px; }
  /* BR panels go under the compass on a phone-width window */
  #br-topright { top: 98px; width: 190px; right: 8px; }
  #game-screen.br-countries #br-topright { top: 130px; }
  #shortcuts-hint { display: none; }
}
/* tablets: the chip moves under the touch toolbar row (touch.css puts it at 62px) */
body.touch #timer-pill { left: 8px; }

@media (prefers-reduced-motion: reduce) {
  .sheet, .trophy, .banner, .banner.pulse, .toast, #round-countdown .num, #countdown-number, .countdown-bar .cd-num,
  #game-screen.warn::after, #game-screen.warn #timer-pill, #br-circles .slot.taken, #br-flags .flag.blink { animation: none; }
  .toggle .sw i, .rp-answer::after, .hp-bar .fill, .hp-bar .hp-val, .meterbar .fill, .hp-row .dmg, #game-screen::before { transition: none; }
}
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* single column: the setup sits below the mode rows, so rows that do not apply simply leave */
@media (max-width: 900px) { .kv.ghost { display: none; } }

/* ---------- avatar picker (join screen, listing join, lobby) ---------- */
.avatar-pick { margin: 12px 0; min-width: 0; }
.avatar-pick-label { font-size: 13px; margin-bottom: 8px; opacity: .85; }
.avatar-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 48px)); gap: 8px; max-width: 328px; }
.avatar-opt { width: 100%; height: auto; aspect-ratio: 1; padding: 3px; border: 0; border-radius: 50%; background: transparent; cursor: pointer; }
.avatar-opt img { display: block; width: 100%; height: 100%; border-radius: 50%; }
.avatar-opt.none span { display: grid; place-items: center; width: 100%; height: 100%; border-radius: 50%; background: var(--muted); color: #fff; font-weight: 700; font-size: 15px; }
.avatar-opt[aria-checked="true"] { box-shadow: 0 0 0 3px var(--yellow); }
.avatar-opt:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.avatar-change { margin: 10px 0; }

/* live spectating: the row of players to watch (static/watch.css) */
#game-screen { --watch-bg: var(--panel); --watch-text: var(--ink); --watch-on: var(--cyan); --watch-on-text: var(--on-neon); --watch-line: var(--line-2); --watch-radius: 0; }
