/* Themes for the Darts tab. The structure is shared; each theme sets colours and sprite URLs.
   Pixel art lives in assets/<theme>/ at native size and is shown at --px screen pixels per art
   pixel (set by darts.js from the stage width; about 2.5 at the full 640px column). */
:root { --px: 3; }

/* ---- Saloon: a Wild West bar, the board on a plank wall, a cowboy throwing darts ---- */
body[data-theme="saloon"] {
  --ink: #15090a; --bg: #2a1710; --fg: #f3e2b4; --accent: #f0c050; --muted: #c9a46a; --line: #5a2f1a; --code-bg: #15090a;
  --title-font: 'Pixelify Sans', sans-serif; --body-font: 'VT323', monospace;
  --a-wall: url(assets/saloon/wall-tile.png); --a-scene: url(assets/saloon/scene-bg.png); --a-actor: url(assets/saloon/thrower.png);
  --a-dart: url(assets/saloon/dart.png); --a-sign: url(assets/saloon/sign-9slice.png); --a-panel: url(assets/saloon/panel-9slice.png);
  --a-button: url(assets/saloon/button-9slice.png); --a-button-active: url(assets/saloon/button-active-9slice.png); --a-input: url(assets/saloon/input-9slice.png);
  --a-mug: url(assets/saloon/mug.png); --a-bottle: url(assets/saloon/bottle.png);
  --star: '\2605'; --glow: none;
}
body[data-tab="darts"][data-theme="saloon"] { background: var(--bg) var(--a-wall) repeat; background-size: calc(var(--px) * 48px); color: var(--fg); }
body[data-tab="darts"][data-theme="saloon"] main { padding-top: 10px; }
body[data-tab="darts"][data-theme="saloon"] .px { image-rendering: pixelated; image-rendering: crisp-edges; }

/* Header: a hanging sign and the game toggle as a panel. */
body[data-tab="darts"][data-theme="saloon"] header { align-items: stretch; gap: 12px; margin-bottom: 6px; }
body[data-tab="darts"][data-theme="saloon"] .sign { position: relative; flex: 1; padding: 12px 18px 10px; border: calc(var(--px) * 12px) solid transparent;
  border-image: var(--a-sign) 12 fill stretch; border-image-width: calc(var(--px) * 12px); image-rendering: pixelated; margin-top: 8px; }
body[data-tab="darts"][data-theme="saloon"] .sign::before, body[data-tab="darts"][data-theme="saloon"] .sign::after { content: ''; position: absolute; top: calc(-8px - var(--px) * 12px); width: 3px; height: 8px; background: var(--ink); }
body[data-tab="darts"][data-theme="saloon"] .sign::before { left: 14%; } body[data-tab="darts"][data-theme="saloon"] .sign::after { right: 14%; }
body[data-tab="darts"][data-theme="saloon"] .sign h1 { font-family: var(--title-font); font-weight: 700; font-size: 34px; letter-spacing: 0.06em; color: var(--fg); margin: -6px 0 0;
  text-shadow: 2px 2px 0 var(--ink), var(--glow); display: flex; align-items: center; gap: 10px; }
body[data-tab="darts"][data-theme="saloon"] .sign h1::before, body[data-tab="darts"][data-theme="saloon"] .sign h1::after { content: var(--star); color: var(--accent); font-size: 22px; text-shadow: 1px 1px 0 var(--ink); }
body[data-tab="darts"][data-theme="saloon"] .sign .sub { font-family: var(--body-font); font-size: 20px; color: var(--accent); margin: 0; letter-spacing: 0.04em; text-transform: uppercase; }
body[data-tab="darts"][data-theme="saloon"] .views, body[data-tab="darts"][data-theme="saloon"] .themes { display: inline-flex; border-radius: 0; overflow: visible; align-self: flex-start; padding: 6px; gap: 6px;
  border: calc(var(--px) * 12px) solid transparent; border-image: var(--a-panel) 12 fill stretch; border-image-width: calc(var(--px) * 8px); }
body[data-tab="darts"][data-theme="saloon"] .views { margin-top: 8px; }
body[data-tab="darts"][data-theme="saloon"] .views button, body[data-tab="darts"][data-theme="saloon"] .themes button { font-family: var(--title-font); font-weight: 700; font-size: 14px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted);
  background: transparent; border: calc(var(--px) * 8px) solid transparent; border-image: var(--a-button) 8 fill stretch; border-image-width: calc(var(--px) * 4px); padding: 4px 8px; cursor: pointer; }
body[data-tab="darts"][data-theme="saloon"] .views button[aria-pressed="true"], body[data-tab="darts"][data-theme="saloon"] .themes button[aria-pressed="true"] { color: var(--ink); border-image-source: var(--a-button-active); }
body:not([data-tab="darts"]) .themes { display: none; }
body[data-theme="saloon"] #tab-darts .themes { display: flex; width: max-content; margin: 0 0 8px auto; padding: 3px; border-width: calc(var(--px) * 6px); border-image-width: calc(var(--px) * 6px); }
body[data-theme="saloon"] #tab-darts .themes button { font-size: 11px; padding: 2px 6px; border-width: calc(var(--px) * 4px); border-image-width: calc(var(--px) * 3px); }

/* The stage: the scene with the board, the actor in front, and a projectile in flight. */
body[data-theme="saloon"] #tab-darts .stage { position: relative; width: 100%; aspect-ratio: 240 / 300; background: var(--a-scene) 0 0 / 100% 100% no-repeat; image-rendering: pixelated; overflow: hidden;
  border: calc(var(--px) * 1px) solid var(--ink); box-shadow: 0 0 0 calc(var(--px) * 1px) var(--line); }
body[data-theme="saloon"] #tab-darts .stage svg { position: absolute; overflow: visible; shape-rendering: crispEdges;
  /* board disc radius 70 art px centred at (120,128) in a 240x300 scene; the SVG's board radius is 215 of its 600 box */
  --d: calc(140 / 240 * 600 / 430 * 100%); width: var(--d); height: auto; left: calc(50% - var(--d) / 2); top: calc(128 / 300 * 100% - var(--d) * 0.4); }
body[data-theme="saloon"] #tab-darts .stage svg text { shape-rendering: auto; font-family: var(--body-font); }
body[data-theme="saloon"] #tab-darts .stage svg .axis { font-size: 27px; fill: var(--fg); paint-order: stroke; stroke: var(--ink); stroke-width: 4px; letter-spacing: 0.02em; }
body[data-theme="saloon"] #tab-darts .stage svg .tag { font-size: 24px; fill: var(--fg); paint-order: stroke; stroke: var(--ink); stroke-width: 4px; }
body[data-theme="saloon"] #tab-darts .stage svg .tag.ans { fill: var(--accent); }
body[data-theme="saloon"] #tab-darts .stage svg .sweep { transform-origin: 300px 300px; animation: sweep 5s linear infinite; }
@keyframes sweep { to { transform: rotate(360deg); } }
body[data-theme="saloon"] #tab-darts .actor { position: absolute; left: 0; bottom: 0; width: calc(var(--px) * 96px); height: calc(var(--px) * 110px);
  background: var(--a-actor) 0 0 / calc(var(--px) * 576px) calc(var(--px) * 110px) no-repeat; image-rendering: pixelated; pointer-events: none; }
body[data-theme="saloon"] #tab-darts .dart { position: absolute; left: 0; top: 0; width: calc(var(--px) * 16px); height: calc(var(--px) * 16px); background: var(--a-dart) 0 0 / 100% 100% no-repeat;
  image-rendering: pixelated; display: none; pointer-events: none; transform-origin: 50% 50%; }
#tab-darts .ping, #tab-darts .flash { position: absolute; border-radius: 50%; pointer-events: none; display: none; z-index: 2; will-change: transform, opacity; transform-origin: 50% 50%; }
body[data-theme="saloon"] #tab-darts .ping { border: calc(var(--px) * 1px) solid #6cf29b; box-shadow: 0 0 calc(var(--px) * 3px) #27a85e; }
body[data-theme="saloon"] #tab-darts .flash { background: #c8ffd9; box-shadow: 0 0 calc(var(--px) * 4px) #6cf29b; }
body[data-theme="saloon"] body[data-theme="saloon"] #tab-darts .stage.thunk svg { animation: thunk 180ms steps(2) 1; }
@keyframes thunk { 0% { transform: translate(0, 0); } 50% { transform: translate(1px, 2px); } 100% { transform: translate(0, 0); } }

/* The control panel under the stage. Sonar-only screens and the terminal prompt stay hidden here. */
body[data-theme="saloon"] .sonar-only, body[data-theme="saloon"] .prompt, body[data-theme="saloon"] #d-detail, body[data-theme="saloon"] .readout .brg { display: none; }
body[data-theme="saloon"] #tab-darts .panel { position: relative; margin-top: 10px; padding: 10px 14px 12px; border: calc(var(--px) * 12px) solid transparent;
  border-image: var(--a-panel) 12 fill stretch; border-image-width: calc(var(--px) * 8px); font-family: var(--body-font); font-size: 21px; color: var(--fg); }
body[data-theme="saloon"] #tab-darts .panel .legend { color: var(--accent); font-family: var(--title-font); font-size: 15px; letter-spacing: 0.06em; text-transform: uppercase; margin: 0 0 10px; }
body[data-theme="saloon"] #tab-darts .panel form { margin: 0 0 6px; gap: 10px; }
body[data-theme="saloon"] #tab-darts .panel input { font-family: var(--body-font); font-size: 24px; color: var(--fg); background: transparent; border: calc(var(--px) * 8px) solid transparent;
  border-image: var(--a-input) 8 fill stretch; border-image-width: calc(var(--px) * 3px); border-radius: 0; padding: 4px 8px; min-width: 0; text-shadow: var(--glow); }
body[data-theme="saloon"] #tab-darts .panel input::placeholder { color: var(--muted); opacity: 0.8; }
body[data-theme="saloon"] #tab-darts .panel button.go, body[data-theme="saloon"] #tab-darts .panel form button, body[data-theme="saloon"] #tab-darts .panel .share button, body[data-theme="saloon"] #tab-darts .panel button.again {
  font-family: var(--title-font); font-weight: 700; font-size: 16px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); background: transparent;
  border: calc(var(--px) * 8px) solid transparent; border-image: var(--a-button) 8 fill stretch; border-image-width: calc(var(--px) * 4px); border-radius: 0; padding: 6px 14px; cursor: pointer; }
body[data-theme="saloon"] #tab-darts .panel button:active { color: var(--ink); border-image-source: var(--a-button-active); }
body[data-theme="saloon"] #tab-darts .panel .message { color: var(--accent); font-size: 20px; min-height: 1.2em; margin: 2px 0 6px; }
body[data-theme="saloon"] #tab-darts .panel .readout { font-size: 20px; margin: 4px 0; }
body[data-theme="saloon"] #tab-darts .panel .readout li { border-top: 1px solid var(--line); padding: 4px 0; }
body[data-theme="saloon"] #tab-darts .panel .readout .n { color: var(--muted); } body[data-theme="saloon"] #tab-darts .panel .readout .w { color: var(--fg); } body[data-theme="saloon"] #tab-darts .panel .readout .s { color: var(--accent); } body[data-theme="saloon"] #tab-darts .panel .readout .hint { color: var(--muted); }
body[data-theme="saloon"] #tab-darts .panel .result { font-family: var(--title-font); font-size: 20px; color: var(--accent); margin: 10px 0 6px; }
body[data-theme="saloon"] #tab-darts .panel .share code { font-family: var(--body-font); font-size: 20px; background: var(--code-bg); color: var(--fg); border-radius: 0; }
body[data-theme="saloon"] #tab-darts .panel details { color: var(--muted); font-size: 19px; margin-top: 14px; }
body[data-theme="saloon"] #tab-darts .panel summary { font-family: var(--title-font); font-size: 14px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
body[data-theme="saloon"] #tab-darts .panel summary::marker { color: var(--accent); }
body[data-theme="saloon"] #tab-darts .panel details p { margin: 6px 0; }
body[data-theme="saloon"] #tab-darts .panel .mug, body[data-theme="saloon"] #tab-darts .panel .bottle { position: absolute; pointer-events: none; image-rendering: pixelated; background-size: 100% 100%; background-repeat: no-repeat; }
body[data-theme="saloon"] #tab-darts .panel .mug { right: 24px; bottom: -4px; width: calc(var(--px) * 20px); height: calc(var(--px) * 26px); background-image: var(--a-mug); }
body[data-theme="saloon"] #tab-darts .panel .bottle { right: 0; bottom: 6px; width: calc(var(--px) * 12px); height: calc(var(--px) * 30px); background-image: var(--a-bottle); }
body[data-theme="saloon"] #tab-darts .panel b { color: var(--fg); }

@media (max-width: 480px) {
  body[data-tab="darts"][data-theme="saloon"] .sign h1 { font-size: 26px; }
  body[data-theme="saloon"] #tab-darts .panel { font-size: 19px; }
  body[data-theme="saloon"] #tab-darts .panel .mug, body[data-theme="saloon"] #tab-darts .panel .bottle { display: none; }
}


/* ============================================================================================
   Sonar: a full-screen submarine command console. Near-black panel, hairline bezels, flat dark
   glass with a deep vignette; only the trace and the typed word are bright. No sprites.
   ============================================================================================ */
/* Graphite: matte graphite panel, hairline bezels, flat glass, mid-green trace. */
body[data-theme="graphite"] {
  --ink: #06090a; --panel: #15171a; --panel2: #1b1e22; --bz: #2a2f35; --lbl: #6b7480; --head-fg: #aeb7bf;
  --g0: #06090a; --g1: #16412b; --g2: #3f8b63; --g3: #86d8a8; --g4: #c9f5db; --amber: #d9a441; --bull: #eafff2; --sweep-rgb: 63, 139, 99; --sweep-edge: #eafff2; --target: #4fc3ff;
  --font: 'VT323', monospace; --label-font: 'Share Tech Mono', monospace; --weight: 400; --clock-weight: 400;
  --glass: radial-gradient(ellipse at 50% 40%, #0c1611 0%, #090e0b 60%, #06090a 100%);
  --glass-shadow: inset 0 0 0 1px #0b0d10, inset 0 0 26px rgba(0, 0, 0, 0.65);
  --bezel-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 10px 30px rgba(0, 0, 0, 0.5);
  --status-box: 1px solid var(--bz); --status-bg: #090e0b; --head-border: 1px solid var(--bz); --head-bg: var(--panel2);
  background: #0d0f11; color: var(--g3); font-family: var(--font);
}
/* Abyss: near-black, the glass a deep well, thin light weights, only the trace and the word bright. */
body[data-theme="abyss"] {
  --ink: #020403; --panel: #050607; --panel2: #0a0c0e; --bz: #15191c; --lbl: #3d454c; --head-fg: #8b949e;
  --g0: #020403; --g1: #0e2017; --g2: #245c3f; --g3: #5fbf8a; --g4: #d6ffe6; --amber: #c9933a; --bull: #ffffff; --sweep-rgb: 36, 92, 63; --sweep-edge: #ffffff; --target: #5ccfff;
  --font: 'VT323', monospace; --label-font: 'Share Tech Mono', monospace; --weight: 400; --clock-weight: 400;
  --glass: radial-gradient(ellipse at 50% 45%, #07140d 0%, #040a07 55%, #020403 100%);
  --glass-shadow: inset 0 0 0 1px #0b0e10, inset 0 0 40px 10px rgba(0, 0, 0, 0.85);
  --bezel-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
  --status-box: 0; --status-bg: transparent; --head-border: 0; --head-bg: transparent;
  background: #030405; color: var(--g3); font-family: var(--font);
}
body[data-tab="darts"][data-family="console"] main { max-width: none; padding: 14px; height: 100vh; box-sizing: border-box; display: grid; gap: 14px; /* a fixed height: the fr rows split it and each screen scrolls inside */
  grid-template-columns: minmax(240px, 1fr) minmax(0, 2.4fr) minmax(330px, 1.1fr);
  grid-template-rows: auto auto auto minmax(0, 1fr) auto auto;
  grid-template-areas: "head head round" "category scope score" "timer scope axes" "log scope manual" "log scope settings" "command command command"; padding-bottom: 44px; }
body[data-tab="darts"][data-family="console"] header, body[data-family="console"] #tab-darts, body[data-family="console"] .panel { display: contents; }
body[data-family="console"] .actor, body[data-family="console"] .dart, body[data-family="console"] .mug, body[data-family="console"] .bottle { display: none !important; }
/* The terminal line between rounds: the result and the prompt to go on; a tap on it goes on too. */
body[data-family="console"] .blk-command .message { margin: 0; text-align: center; font-size: 24px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--g4); cursor: pointer; line-height: 1.3; outline: none; }
body[data-family="console"] .blk-command .message:empty { display: none; }
body[data-family="console"] .blk-command .note { margin: 6px 0 0; text-align: center; font-size: 17px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--amber); line-height: 1.2; }
body[data-family="console"] .blk-command .note:empty { display: none; }
body[data-family="console"] .stage.reverse svg { cursor: crosshair; }
body[data-family="console"] .stage.reverse::before { box-shadow: var(--glass-shadow), inset 0 0 50px 10px rgba(217, 164, 65, 0.12); }
body[data-family="console"] .cat-name.dim { color: var(--g2); }

/* A screen: a hairline bezel (the element), the glass behind the content (::before), a dim label on the bezel (::after). */
body[data-family="console"] .blk, body[data-family="console"] .stage, body[data-family="console"] .plate, body[data-family="console"] .roundplate {
  position: relative; border-radius: 3px; background: var(--panel); border: 1px solid var(--bz); box-shadow: var(--bezel-shadow);
  color: var(--g3); min-height: 0; min-width: 0; }
body[data-family="console"] .blk { padding: 34px 20px 18px; display: flex; flex-direction: column; gap: 6px; font-size: 18px; overflow: hidden; font-weight: var(--weight); }
body[data-family="console"] .blk > * { position: relative; z-index: 1; min-height: 0; margin: 0; }
body[data-family="console"] .blk > ol, body[data-family="console"] .blk > div, body[data-family="console"] .blk > details { overflow: auto; }
body[data-family="console"] .blk::before, body[data-family="console"] .stage::before, body[data-family="console"] .plate::before, body[data-family="console"] .roundplate::before { content: ''; position: absolute; inset: 24px 8px 8px; border-radius: 10px / 14px; z-index: 0; background: var(--glass); box-shadow: var(--glass-shadow); display: block; top: 24px; left: 8px; width: auto; height: auto; }
body[data-family="console"] .stage::before { inset: 8px; border-radius: 16px / 18px; }
body[data-family="console"] .plate::before, body[data-family="console"] .roundplate::before { inset: 6px; top: 6px; left: 6px; border-radius: 8px / 12px; }
body[data-family="console"] .plate > * { position: relative; z-index: 1; }
/* CRT: curved glass (a bulge from the gloss and the heavier corner vignette), scanlines over the content, a slow flicker. */
body[data-family="console"][data-crt="on"] .blk::before, body[data-family="console"][data-crt="on"] .stage::before, body[data-family="console"][data-crt="on"] .plate::before, body[data-family="console"][data-crt="on"] .roundplate::before {
  background: radial-gradient(ellipse 130% 60% at 50% -18%, rgba(255, 255, 255, 0.07) 0%, rgba(255, 255, 255, 0.015) 45%, transparent 62%), var(--glass);
  box-shadow: var(--glass-shadow), inset 0 0 60px 18px rgba(0, 0, 0, 0.55); }
body[data-family="console"][data-crt="on"] .blk .crt-lines, body[data-family="console"][data-crt="on"] .stage .crt-lines, body[data-family="console"][data-crt="on"] .plate .crt-lines, body[data-family="console"][data-crt="on"] .roundplate .crt-lines { display: block; }
body[data-family="console"] .crt-lines { display: none; position: absolute; inset: 24px 8px 8px; border-radius: 10px / 14px; z-index: 3; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.28) 0 1px, transparent 1px 3px), radial-gradient(ellipse at 50% 50%, transparent 55%, rgba(0, 0, 0, 0.35) 100%); }
body[data-family="console"] .stage .crt-lines { inset: 8px; border-radius: 16px / 18px; }
body[data-family="console"] .plate .crt-lines, body[data-family="console"] .roundplate .crt-lines { inset: 6px; border-radius: 8px / 12px; }
@keyframes flicker { 0%, 100% { opacity: 1; } 29% { opacity: 0.975; } 30% { opacity: 1; } 61% { opacity: 0.985; } 62% { opacity: 1; } 84% { opacity: 0.965; } 85% { opacity: 1; } }

body[data-family="console"] .blk::after { content: attr(data-title); position: absolute; top: 7px; left: 10px; font: 10px/1 var(--label-font); letter-spacing: 0.26em; text-transform: uppercase; color: var(--lbl); z-index: 1; }
body[data-family="console"] .blk-category { grid-area: category; } body[data-family="console"] .blk-timer { grid-area: timer; } body[data-family="console"] .blk-contacts { grid-area: log; }
body[data-family="console"] .blk-tally { grid-area: score; }
body[data-family="console"] .blk-settings { grid-area: settings; }
body[data-family="console"] .blk-axes { grid-area: axes; } body[data-family="console"] .blk-manual { grid-area: manual; }
body[data-family="console"] .blk-command, body[data-family="console"] .blk-score { grid-area: command; }
body[data-family="console"] .blk-score { display: none; } /* the result takes the terminal's place when the game is over */
body.d-over[data-family="console"] .blk-score { display: flex; } body.d-over[data-family="console"] .blk-command { display: none; }

/* Head strip: a flat bar with the game name, the day's line and, at the right, round and score. */
body[data-family="console"] .sign { display: contents; }
body[data-family="console"] .plate { grid-area: head; display: flex; align-items: center; gap: 24px; padding: 14px 26px; margin: 0; }

body[data-family="console"] .sign h1 { font: 26px/1 var(--font); letter-spacing: 0.32em; text-transform: uppercase; color: var(--g4); text-shadow: 0 0 10px rgba(95, 191, 138, 0.35); margin: 0; display: flex; align-items: center; gap: 12px; }
body[data-family="console"] .sign h1::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--g3); box-shadow: 0 0 8px var(--g3); animation: blink 2.4s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0.35; } }
body[data-family="console"] .sign .sub { font: 17px/1.4 var(--font); letter-spacing: 0.12em; text-transform: uppercase; color: var(--g3); margin: 0; }
body[data-family="console"] .roundplate { grid-area: round; margin: 0; padding: 14px 20px; display: flex; align-items: center; justify-content: center; text-align: center; font-size: 30px; line-height: 1.05; letter-spacing: 0.12em; text-transform: uppercase; color: #ffffff; text-shadow: 0 0 12px rgba(134, 216, 168, 0.6), 0 0 2px #fff; white-space: nowrap; }
body[data-family="console"] .roundplate > span { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 2px; }
body[data-family="console"] .roundplate b { font-weight: normal; display: block; }
body[data-family="console"] .roundplate b:first-child { font-size: 0.62em; letter-spacing: 0.2em; color: var(--g3); text-shadow: none; }
body[data-family="console"] .roundplate .crt-lines { z-index: 3; }
/* Countdown in its last seconds: the Timer screen's content flashes red. */
body.urgent[data-family="console"] .clock, body.urgent[data-family="console"] .clock-label { color: #ff4a3d; text-shadow: 0 0 12px rgba(255, 74, 61, 0.6); animation: urgent 0.5s steps(1) infinite; }
@keyframes urgent { 50% { opacity: 0.25; } }
body.urgent[data-family="console"] .blk::before, body.urgent[data-family="console"] .stage::before, body.urgent[data-family="console"] .plate::before, body.urgent[data-family="console"] .roundplate::before,
body.urgent[data-family="console"] .blk-command::before { animation: danger 0.7s ease-in-out infinite alternate; }
@keyframes danger { from { box-shadow: var(--glass-shadow), inset 0 0 30px 4px rgba(255, 60, 40, 0.08); } to { box-shadow: var(--glass-shadow), inset 0 0 90px 30px rgba(255, 60, 40, 0.5); } }
body.urgent[data-family="console"] .blk, body.urgent[data-family="console"] .roundplate, body.urgent[data-family="console"] .plate { color: #ff8a7a; text-shadow: 0 0 6px rgba(255, 74, 61, 0.45); }
body.urgent[data-family="console"] .blk::after { color: #c9533f; }
body.urgent[data-family="console"] .stage svg { filter: drop-shadow(0 0 6px rgba(255, 74, 61, 0.55)); animation: dangerText 0.7s ease-in-out infinite alternate; }
body.urgent[data-family="console"] #d-guess { color: #ffb0a4; text-shadow: 0 0 8px rgba(255, 74, 61, 0.6); }
body.urgent[data-family="console"] .cursor { background: #ff6a5a; box-shadow: 0 0 8px #ff4a3d; }
body.urgent[data-family="console"]::after { content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 50; background: radial-gradient(ellipse at 50% 50%, transparent 45%, rgba(255, 50, 30, 0.35) 100%); animation: dangerText 0.7s ease-in-out infinite alternate; }
@keyframes dangerText { from { opacity: 0.35; } to { opacity: 1; } }
body[data-family="console"] .readout .missed .w, body[data-family="console"] .readout .missed .brg { color: #c9933a; }

/* The scope: flat glass; the SVG draws the round display, bearing ring and corner readouts. */
body[data-family="console"] .stage { grid-area: scope; width: 100%; height: 100%; margin: 0; overflow: hidden; }
body[data-family="console"] .stage svg { position: absolute; inset: 8px; width: calc(100% - 16px); height: calc(100% - 16px); z-index: 2; shape-rendering: geometricPrecision; }
body[data-family="console"] .stage svg text { font-family: var(--font); }
body[data-family="console"] .stage svg .bearing, body[data-family="console"] .stage svg .corner { font-family: var(--label-font); }
body[data-family="console"] .stage svg .axis { font-size: 26px; fill: var(--g4); letter-spacing: 0.14em; text-transform: uppercase; paint-order: stroke; stroke: var(--g0); stroke-width: 5px; }
body[data-family="console"] .stage svg .tag { font-size: 22px; fill: var(--g4); letter-spacing: 0.08em; text-transform: uppercase; paint-order: stroke; stroke: var(--g0); stroke-width: 5px; }
body[data-family="console"] .stage svg .tag.ans { fill: var(--amber); }
body[data-family="console"] .stage svg .bearing { font-size: 14px; fill: var(--g2); letter-spacing: 0.08em; }
body[data-family="console"] .stage svg .corner { font-size: 14px; fill: var(--g2); letter-spacing: 0.14em; text-transform: uppercase; }
body[data-family="console"] .stage .sweep { position: absolute; border-radius: 50%; pointer-events: none; z-index: 3; will-change: transform;
  background: conic-gradient(from -58deg at 50% 50%, transparent 0deg, rgba(var(--sweep-rgb), 0.03) 8deg, rgba(var(--sweep-rgb), 0.4) 55deg, var(--sweep-edge) 57deg, transparent 58deg);
  animation: sweep 6s linear infinite; }
body[data-family="console"][data-sweep="off"] .stage .sweep { display: none; }
body[data-family="console"] .stage .tpulse { position: absolute; display: none; border-radius: 50%; border: 2px solid var(--target); pointer-events: none; z-index: 3; will-change: transform, opacity; animation: tpulse 2.2s ease-out infinite; }
@keyframes tpulse { 0% { transform: scale(0.1); opacity: 0.9; } 70% { opacity: 0.25; } 100% { transform: scale(1); opacity: 0; } }
body[data-family="console"] .stage svg .target.live .dot { filter: drop-shadow(0 0 5px rgba(79, 195, 255, 0.9)); }
body[data-family="console"] .ping { border: 1.5px solid var(--g3); box-shadow: 0 0 12px var(--g2); z-index: 4; }
body[data-family="console"] .flash { background: var(--bull); box-shadow: 0 0 18px var(--g3); z-index: 4; }
body[data-family="console"] .stage.thunk svg { animation: none; }

/* Comparison switches (Spectrum / Darts, Saloon / Sonar): not part of the design, pinned bottom-left. */
body[data-family="console"] .views, body[data-family="console"] .themes { position: fixed; bottom: 8px; display: flex; gap: 4px; padding: 4px; margin: 0; border: 0; border-radius: 3px; background: rgba(0, 0, 0, 0.4); opacity: 0.5; z-index: 10; transition: opacity 0.2s; }
body[data-family="console"] .views:hover, body[data-family="console"] .themes:hover { opacity: 1; }
body[data-family="console"] .views { left: 14px; } body[data-family="console"] .themes { left: 196px; }
body[data-family="console"] button { font-family: var(--label-font); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: #8b949e; background: #0f1316; border: 1px solid #2a3036; border-radius: 2px; padding: 5px 9px; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; }
body[data-family="console"] button::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #2a3138; flex: none; }
body[data-family="console"] button:hover { color: var(--g4); }
body[data-family="console"] button[aria-pressed="true"], body[data-family="console"] button.again, body[data-family="console"] .share button { color: var(--g4); }
body[data-family="console"] button[aria-pressed="true"]::before, body[data-family="console"] button.again::before, body[data-family="console"] .share button::before { background: var(--g3); box-shadow: 0 0 6px var(--g3); }

/* The terminal: one centred line under the scope, nothing else on it. Enter pings; Enter again moves on. */
body[data-family="console"] .blk-command { padding: 22px 30px; justify-content: center; min-height: 96px; }
body[data-family="console"] .blk-command::before { inset: 8px; }
body[data-family="console"] .blk-command::after { display: none; }
body[data-family="console"] form { display: flex; justify-content: center; margin: 0; }
body[data-family="console"] #d-guess { width: 100%; max-width: 760px; min-width: 0; background: transparent; border: 0; border-radius: 0; color: var(--g4); font: var(--weight) 44px/1.2 var(--font); text-align: center; text-transform: uppercase; letter-spacing: 0.18em; padding: 6px 0; caret-color: var(--g3); outline: none; text-shadow: 0 0 10px rgba(95, 191, 138, 0.5); }
body[data-family="console"] #d-guess::placeholder { color: var(--g2); text-shadow: none; text-transform: uppercase; letter-spacing: 0.18em; }
body[data-family="console"] #d-guess { caret-color: transparent; }
body[data-family="console"] form { position: relative; }
body[data-family="console"] .cursor { position: absolute; height: 3px; background: var(--g4); box-shadow: 0 0 8px var(--g3); animation: caret 1s steps(1) infinite; pointer-events: none; }
body[data-family="console"] .cursor.empty { background: var(--g3); }
@keyframes caret { 50% { opacity: 0; } }

/* Log: every round, done / tracking / standby, with the status line above. */
body[data-family="console"] .logstatus { font-size: 16px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--amber); min-height: 1.3em; margin: 0 0 6px; }
body[data-family="console"] .logstatus:empty { display: none; }
body[data-family="console"] .readout { list-style: none; margin: 0; padding: 0; font-size: 17px; text-transform: uppercase; letter-spacing: 0.06em; }
body[data-family="console"] .readout li { display: grid; grid-template-columns: 2em 1fr auto; gap: 2px 10px; padding: 7px 0; border-top: 1px solid var(--g1); align-items: baseline; }
body[data-family="console"] .readout li:first-child { border-top: 0; }
body[data-family="console"] .readout .n { color: var(--g2); } body[data-family="console"] .readout .w { color: var(--g4); font-weight: normal; letter-spacing: 0.1em; }
body[data-family="console"] .readout .s { color: var(--g4); text-align: right; min-width: 0; }
body[data-family="console"] .readout .done .s::after { content: ' pts'; color: var(--g2); }
body[data-family="console"] .readout .brg { grid-column: 2; color: var(--g2); font-size: 14px; letter-spacing: 0.08em; }
body[data-family="console"] .readout .hint { grid-column: 2 / -1; color: var(--g3); font-size: 14px; letter-spacing: 0.04em; }
body[data-family="console"] .readout .cur .w { color: var(--g3); } body[data-family="console"] .readout .cur .n { color: var(--g3); }

/* Timer, axis charts, manual, result. */
body[data-family="console"] .blk-timer { padding: 30px 20px 16px; align-items: center; justify-content: center; }
body[data-family="console"] .timer { display: flex; justify-content: center; align-items: center; width: 100%; }
body[data-family="console"] .clock { font-size: 52px; font-weight: var(--clock-weight); letter-spacing: 0.06em; color: var(--g4); font-variant-numeric: tabular-nums; line-height: 1; text-shadow: 0 0 10px rgba(95, 191, 138, 0.35); }
body[data-family="console"] .clock-label { font: 11px/1 var(--label-font); letter-spacing: 0.22em; text-transform: uppercase; color: var(--g2); }
body[data-family="console"] .times { list-style: none; margin: 8px 0 0; padding: 0; font-size: 15px; text-transform: uppercase; letter-spacing: 0.06em; }
body[data-family="console"] .times li { display: grid; grid-template-columns: 2em 1fr auto; gap: 8px; padding: 3px 0; border-top: 1px solid var(--g1); }
body[data-family="console"] .times li:first-child { border-top: 0; }
body[data-family="console"] .times .n { color: var(--g2); } body[data-family="console"] .times .w { color: var(--g3); } body[data-family="console"] .times .t { color: var(--g4); font-variant-numeric: tabular-nums; }
body[data-family="console"] #d-axes { width: 100%; height: auto; display: block; overflow: visible; }
body[data-family="console"] .blk-category { padding: 30px 20px 14px; justify-content: center; min-height: 120px; }
body[data-family="console"] .category { text-transform: uppercase; text-align: center; }
body[data-family="console"] .cat-name { font-size: 52px; line-height: 1; letter-spacing: 0.18em; color: #ffffff; text-shadow: 0 0 14px rgba(134, 216, 168, 0.7), 0 0 2px #fff; }
body[data-family="console"] .cat-name.dim { color: var(--g2); text-shadow: none; font-size: 36px; }
body[data-family="console"] .cat-round { text-align: center; font: 11px/1 var(--label-font); letter-spacing: 0.24em; text-transform: uppercase; color: var(--g3); margin-bottom: 8px; overflow: visible !important; }
body[data-family="console"] .blk-timer .timer, body[data-family="console"] .blk-tally > div { overflow: visible !important; }
/* Score: one big number. */
body[data-family="console"] .blk-tally { align-items: center; justify-content: center; text-align: center; padding: 30px 20px 16px; }
body[data-family="console"] .score-big { font-size: 64px; line-height: 1; letter-spacing: 0.06em; color: #ffffff; text-shadow: 0 0 16px rgba(134, 216, 168, 0.7), 0 0 2px #fff; font-variant-numeric: tabular-nums; }
body[data-family="console"] .score-sub { font: 11px/1 var(--label-font); letter-spacing: 0.22em; text-transform: uppercase; color: var(--g2); margin-top: 8px; }
body[data-family="console"] .settings { display: flex; flex-direction: column; gap: 6px; font-size: 17px; text-transform: uppercase; letter-spacing: 0.08em; }
body[data-family="console"] .settings label { display: flex; align-items: center; gap: 10px; cursor: pointer; color: var(--g3); }
body[data-family="console"] .settings input { appearance: none; flex: none; width: 12px; height: 12px; padding: 0; border: 1px solid var(--g2); border-radius: 2px; margin: 0; background: transparent; cursor: pointer; }
body[data-family="console"] .settings input:checked { background: var(--g3); box-shadow: 0 0 8px var(--g3); border-color: var(--g3); }
body[data-family="console"] .blk-settings { padding: 30px 20px 14px; }
body[data-family="console"] .blk-score .result { font-size: 28px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--g4); margin: 0 0 8px; text-align: center; }
body[data-family="console"] .share { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: center; }
body[data-family="console"] .share code { font-family: var(--font); font-size: 18px; background: var(--g0); color: var(--g3); padding: 8px 10px; border: 1px solid var(--g1); }
body[data-family="console"] #d-reveal-wrap .legend { margin: 10px 0 4px; font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--g2); }
body[data-family="console"] #d-reveal li { grid-template-columns: 2em 1fr; font-size: 12px; }
body[data-family="console"] #d-reveal .hint { grid-column: 2; }
body[data-family="console"] .blk-manual { padding: 26px 20px 12px; }
body[data-family="console"] details { font-size: 16px; color: var(--g3); margin: 0; line-height: 1.4; }
body[data-family="console"] summary { color: var(--g4); letter-spacing: 0.14em; text-transform: uppercase; cursor: pointer; font-size: 15px; }
body[data-family="console"] details p { margin: 8px 0 0; }

@media (max-width: 960px) {
  body[data-tab="darts"][data-family="console"] main { grid-template-columns: 1fr 1fr; grid-template-rows: none; height: auto; min-height: 100vh; gap: 12px; padding: 12px;
    grid-template-areas: "head round" "timer score" "category category" "scope scope" "command command" "log log" "axes axes" "manual manual" "settings settings"; padding-bottom: 120px; }
  /* The name plate and the round/score screen share the top row, each on two lines. */
  body[data-family="console"] .plate { flex-direction: column; align-items: flex-start; gap: 6px; padding: 12px 16px; }
  body[data-family="console"] .roundplate { font-size: 22px; padding: 10px 12px; }
  body[data-family="console"] .plate h1 { font-size: 20px; letter-spacing: 0.28em; }
  body[data-family="console"] .plate .sub { font-size: 13px; letter-spacing: 0.04em; }
  body[data-family="console"] .blk-timer, body[data-family="console"] .blk-tally { min-height: 0 !important; }
  body[data-family="console"] .blk-tally { padding: 24px 16px 10px; position: sticky; top: 6px; z-index: 20; }
  body[data-family="console"] .score-big { font-size: 34px; margin-top: 2px; }
  body[data-family="console"] .score-sub { display: none; }
  /* The timer pins under the header as the page scrolls, as one short line. */
  body[data-family="console"] .blk-timer { position: sticky; top: 6px; z-index: 20; padding: 24px 16px 10px; }
  body[data-family="console"] .blk-timer .clock { font-size: 30px; }
  body[data-family="console"] .blk-timer .clock-label { font-size: 10px; white-space: nowrap; }
  /* The word input is a short chin fixed to the bottom of the screen. */
  body[data-family="console"] .blk-command { position: fixed; left: 0; right: 0; bottom: 0; padding: 14px 18px calc(14px + env(safe-area-inset-bottom)); z-index: 30; min-height: 0; border-radius: 0; border-left: 0; border-right: 0; border-bottom: 0; box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.5); }
  body[data-family="console"] .blk-command::before { inset: 6px 6px 0; border-radius: 8px 8px 0 0; }
  body[data-family="console"] .blk-command .crt-lines { inset: 6px 6px 0; border-radius: 8px 8px 0 0; }
  body[data-family="console"] #d-guess { font-size: 28px; padding: 2px 0; }
  body[data-family="console"] .blk-timer, body[data-family="console"] .blk-command, body[data-family="console"] .blk-category { min-height: 0 !important; }
  body[data-family="console"] .blk-category { padding: 26px 16px 12px; min-height: 0; } body[data-family="console"] .cat-name { font-size: 36px; }
  body[data-family="console"] .blk-axes { min-height: 420px; }
  body[data-family="console"] .stage { width: 100%; height: auto; aspect-ratio: 1; margin: 0; }
  body[data-family="console"] .blk { min-height: 130px; }
  body[data-family="console"] #d-guess { font-size: 34px; }
  body[data-family="console"] .views, body[data-family="console"] .themes { background: rgba(8, 11, 14, 0.92); opacity: 0.9; }
}
