/* TABLETOP arena HUD: big, TV-readable at couch distance (1920x1080 target). Arenas retheme via the variables. */
:root {
  --bg: #14111f; --ink: #fff6e6; --muted: #e8d9c2; --panel: rgba(24, 16, 30, 0.9); --line: #8a6a3e; --accent: #f0c66e; --accent-ink: #1a1020;
  --edge: #1a1020; --shadow: #3a1830; --glow: rgba(255, 120, 60, 0.55); --danger: #ff5a3c; --safe: #7cf0a0; --warn: #ffd36a;
  --wipe-a: #5b2a7a; --wipe-b: #2b1240; --wipe-c: #12081c;
}
/* arenas draw their own sky; the overlay keeps its dark panels in every scheme for contrast on a TV */
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --bg: #14111f; } }
:root[data-theme="dark"] { --bg: #14111f; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--ink);
  font: 600 22px/1.3 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; user-select: none; -webkit-user-select: none; }
#stage { position: fixed; inset: 0; }
canvas { display: block; }
.ov { position: fixed; pointer-events: none; z-index: 5; }
#timer { top: 2.2vh; left: 50%; transform: translateX(-50%); font: 900 clamp(34px, 4.4vw, 84px)/1 system-ui, sans-serif;
  text-shadow: 0 4px 0 var(--edge), 0 0 18px rgba(0,0,0,0.6); letter-spacing: 0.02em; }
#timer.warn { color: var(--warn); }
#tag { top: 2.6vh; left: 2vw; padding: 8px 18px; border-radius: 14px; background: var(--panel); border: 3px solid var(--accent);
  font: 900 clamp(18px, 1.6vw, 32px)/1.1 system-ui, sans-serif; letter-spacing: 0.04em; display: none; max-width: 40vw; }
#tag small { display: block; font-weight: 700; font-size: 0.62em; color: var(--muted); letter-spacing: 0.02em; }
#banner { inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding-top: 11vh; text-align: center; }
#banner .big { font: 900 clamp(48px, 7.4vw, 150px)/1 system-ui, sans-serif; color: #fff3d4; letter-spacing: 0.02em;
  text-shadow: 0 7px 0 var(--shadow), 0 0 40px var(--glow); transform: scale(0.6); opacity: 0; transition: transform 0.35s cubic-bezier(.2,1.6,.4,1), opacity 0.2s; }
#banner .sub { margin-top: 2.2vh; font: 800 clamp(22px, 2.2vw, 44px)/1.2 system-ui, sans-serif; color: var(--ink); padding: 10px 26px; border-radius: 16px;
  background: var(--panel); border: 3px solid var(--accent); opacity: 0; transition: opacity 0.25s; }
#banner.on .big { transform: scale(1); opacity: 1; }
#banner.on .sub.has { opacity: 1; }
#banner .sub:empty { display: none; }
#chips { bottom: 2.4vh; left: 50%; transform: translateX(-50%); display: flex; gap: 1.2vw; }
.chip { min-width: clamp(120px, 9vw, 190px); padding: 8px 16px 9px; border-radius: 16px; border: 4px solid var(--edge); color: #fff;
  font: 900 clamp(20px, 1.7vw, 34px)/1.05 system-ui, sans-serif; text-align: center; box-shadow: 0 5px 0 rgba(0,0,0,0.45); transition: filter 0.3s, opacity 0.3s;
  text-shadow: 0 2px 0 rgba(0,0,0,0.35); }
.chip small { display: block; font: 800 0.55em/1.2 system-ui, sans-serif; opacity: 0.95; letter-spacing: 0.04em; }
.chip.out { filter: grayscale(0.85) brightness(0.55); opacity: 0.8; }
#wipe { inset: 0; z-index: 8; background: radial-gradient(circle at 50% 50%, var(--wipe-a) 0%, var(--wipe-b) 60%, var(--wipe-c) 100%);
  clip-path: circle(0% at 50% 50%); display: flex; align-items: center; justify-content: center; }
#wipe span { font: 900 clamp(40px, 6vw, 120px)/1 Georgia, "Times New Roman", serif; color: var(--accent); letter-spacing: 0.12em; text-shadow: 0 6px 0 var(--wipe-c); }
#results { inset: 0; z-index: 7; display: none; align-items: center; justify-content: center; background: rgba(10, 6, 16, 0.55); pointer-events: auto; }
#results .card { min-width: min(92vw, 980px); padding: 3.4vh 3vw 3vh; border-radius: 28px; background: var(--panel); border: 5px solid var(--accent); box-shadow: 0 16px 60px rgba(0,0,0,0.6); }
#results h1 { margin: 0 0 2.4vh; text-align: center; font: 900 clamp(40px, 4.8vw, 96px)/1 system-ui, sans-serif; color: #fff3d4; text-shadow: 0 5px 0 var(--shadow); }
#results .row { display: grid; grid-template-columns: 4.2em 1fr auto; align-items: center; gap: 1.2vw; padding: 1.1vh 1.4vw; margin: 1vh 0; border-radius: 18px; background: rgba(255,255,255,0.06);
  font: 900 clamp(24px, 2.4vw, 48px)/1.1 system-ui, sans-serif; }
#results .pl { font-size: 0.9em; color: var(--accent); }
#results .nm { display: flex; align-items: center; gap: 0.6em; }
#results .dot { width: 1.1em; height: 1.1em; border-radius: 50%; border: 4px solid var(--edge); flex: none; }
#results .st { font-size: 0.7em; color: var(--muted); }
#results .row.win { background: rgba(124, 240, 160, 0.16); outline: 3px solid rgba(124, 240, 160, 0.6); }
#results .row.win .st { color: var(--safe); }
#again { display: block; margin: 3vh auto 0; padding: 14px 40px; border-radius: 18px; border: 4px solid var(--edge); background: var(--accent); color: var(--accent-ink); cursor: pointer;
  font: 900 clamp(26px, 2.4vw, 46px)/1 system-ui, sans-serif; box-shadow: 0 6px 0 rgba(0,0,0,0.4); }
#again:focus-visible { outline: 5px solid #fff; outline-offset: 4px; }
#help { inset: 0; z-index: 9; display: none; align-items: center; justify-content: center; background: rgba(10, 6, 16, 0.6); }
#help .card { max-width: min(92vw, 1100px); padding: 3.4vh 3vw; border-radius: 28px; background: var(--panel); border: 5px solid var(--accent);
  font: 700 clamp(20px, 1.8vw, 36px)/1.45 system-ui, sans-serif; }
#help h2 { margin: 0 0 1.4vh; font: 900 1.5em/1 system-ui, sans-serif; color: var(--accent); }
#help p { margin: 0.6em 0; }
kbd { font: 800 0.85em/1 ui-monospace, monospace; background: rgba(0,0,0,0.35); border: 2px solid var(--line); border-bottom-width: 4px; border-radius: 8px; padding: 2px 9px; color: var(--ink); white-space: nowrap; }
#hint { right: 1.6vw; bottom: 2.6vh; font: 700 clamp(14px, 1vw, 20px)/1 system-ui, sans-serif; color: rgba(255, 246, 230, 0.7); text-shadow: 0 2px 4px rgba(0,0,0,0.6); }
#fps { left: 1vw; bottom: 1vh; font: 700 13px/1 ui-monospace, monospace; color: rgba(255,255,255,0.55); text-shadow: 0 1px 2px #000; }
#loading { inset: 0; z-index: 10; display: flex; align-items: center; justify-content: center; background: var(--bg); font: 900 clamp(28px, 3vw, 60px)/1 system-ui, sans-serif; color: var(--accent); }
@media (max-width: 700px) { #chips { gap: 8px; } .chip { min-width: 0; padding: 6px 10px; } #tag { max-width: 60vw; } }
#snd { left: 50%; bottom: 13vh; transform: translateX(-50%); display: none; padding: 0.6em 1.2em; border-radius: 999px; background: var(--panel); color: #fff3d4; font: 700 clamp(14px, 1.4vw, 24px)/1.2 system-ui, sans-serif; border: 3px solid var(--accent); }
#bench { inset: 0; z-index: 8; display: none; align-items: center; justify-content: center; background: rgba(10, 6, 16, 0.7); }
#bench .card { width: min(92vw, 1100px); padding: 3.4vh 3vw 3vh; border-radius: 28px; background: var(--panel); border: 5px solid var(--accent); color: #fff3d4; font: 600 clamp(15px, 1.5vw, 26px)/1.35 system-ui, sans-serif; }
#bench h1 { margin: 0 0 2vh; font: 900 clamp(32px, 3.6vw, 64px)/1 system-ui, sans-serif; }
#bench .brow { display: grid; gap: 0.3em; padding: 1.2vh 1.4vw; margin: 1vh 0; border-radius: 18px; background: rgba(255,255,255,0.07); }
#bench .brow span, #bench .gpu { opacity: 0.75; font-size: 0.8em; }
#bench .go { margin: 2vh 0 0; color: var(--accent); }
#results .match:empty { display: none; }
#results .match { margin-top: 2.4vh; padding-top: 1.8vh; border-top: 3px solid rgba(255,255,255,0.12); }
#results .mh { font: 800 clamp(16px, 1.6vw, 30px)/1 system-ui, sans-serif; color: #fff3d4; margin-bottom: 1.4vh; text-align: center; }
#results .mh small { color: var(--muted); font-weight: 700; margin-left: 0.6em; }
#results .mrow { display: flex; gap: 1.2vw; justify-content: center; flex-wrap: wrap; }
#results .mchip { display: flex; align-items: center; gap: 0.5em; padding: 0.9vh 1.2vw; border-radius: 16px; background: rgba(255,255,255,0.06); font: 800 clamp(16px, 1.6vw, 30px)/1 system-ui, sans-serif; color: #fff3d4; }
#results .mchip b { font-size: 1.3em; margin-left: 0.2em; }
#results .mchip small { color: var(--safe); font-size: 0.7em; min-width: 2em; }
#results .mchip.lead { outline: 3px solid var(--accent); }
