/* Tokens from design/tokens.css v2 (dark default, fourth delivery). Layout and
   components ported from design/screens and design/parts. */
:root, [data-theme=dark] {
  --c-bg: #0f1113;
  --c-plate: #1a1d20;
  --c-plate2: #2b303a;
  --c-bezel: #3b424d;
  --c-ink: #ebe6dc;
  --c-muted: #9aa0a8;
  --c-faint: #59606a;
  --c-red: #d62828;
  --c-amber: #ffb703;
  --c-green: #2de0b8;
  --c-needle: #f4f1ea;
  --c-lock: #7b8490;
  --c-warn: #ffb703;
  --c-copper: #e07a5f;
  --c-cyan: #00f5d4;
  --c-teal: #05b292;
  --c-neon: #ff8c42;
  --c-paper: #e8dfc8;
  --c-paper_ink: #1c1d1f;
  --c-brass: #b8863f;
  /* v2 materials, used by the controls: machined steel, rubber, ivory, copper */
  --m-steel: linear-gradient(180deg, #6b7480, #3b424d 50%, #23272e);
  --m-rubber: linear-gradient(180deg, #3a4048, #15181b);
  --m-ivory: linear-gradient(180deg, #efe9da, #bdb6a6);
  --m-copper: linear-gradient(135deg, #f3a58c, #e07a5f 55%, #8e4330);
  --card-bg: linear-gradient(180deg, #2a2f37 0%, #1b1e22 60%);
  --card-border: 1.5px solid #4a525d;
  --rivet: radial-gradient(circle at 35% 35%, #8d949e, #2b3038 75%);
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--c-bg);
  color: var(--c-ink);
  font-family: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
}
.mono { font-family: "IBM Plex Mono", ui-monospace, Consolas, monospace; }
.muted { color: var(--c-muted); }
button { font: inherit; color: inherit; }
input { font: inherit; }

#app { height: 100%; height: 100dvh; display: flex; flex-direction: column; }
.view { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 12px; gap: 10px; }
.view.page { padding: 20px; gap: 16px; overflow-y: auto; }
.centre { flex: 1; display: flex; align-items: center; justify-content: center; text-align: center; }

.eyebrow { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--c-muted); }

/* The lockup. Landing and invite only: the console has no room to spend on a
   logo, and the mission is not the moment to look at one. The mark carries its
   own dark plate, so it sits on any background the page ever has. */
.brand { display: flex; align-items: center; gap: 10px; }
.brand img { width: 30px; height: 30px; display: block; flex-shrink: 0; }
.brand b { font-size: 21px; font-weight: 600; letter-spacing: -.01em; color: var(--c-ink); }
.brand b i { font-style: normal; color: var(--c-amber); }

/* The invite page is a phone page; on a computer a full-width form reads as
   an empty screen, so keep it a column. The start page has its own sheet,
   start.css. */
.view.page.landing { width: 100%; max-width: 760px; margin: 0 auto; }

h1 { margin: 0; font-size: 28px; font-weight: 600; line-height: 1.15; }
p { margin: 0; }
label.field { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--c-muted); }
input.text {
  width: 100%; height: 48px; flex-shrink: 0; padding: 0 12px; border-radius: 10px;
  background: var(--c-plate); border: 1px solid var(--c-bezel); color: var(--c-ink); font-size: 17px;
}
input.code { letter-spacing: .3em; text-transform: uppercase; font-size: 24px; text-align: center; }
.row { display: flex; gap: 10px; align-items: center; }
.row > * { flex: 1; }
.or { text-align: center; font-size: 13px; color: var(--c-muted); }
.spacer { flex: 1; }

/* flex-shrink: 0 on everything with a fixed height in a `page` view. Without
   it, a view whose content exceeds the screen compresses its own controls
   instead of scrolling — which silently takes buttons below the 44px touch
   target the design requires. The lobby crossed that line when the room
   visibility row was added. */
.btn {
  width: 100%; height: 52px; flex-shrink: 0; border-radius: 12px; border: 1px solid var(--c-bezel);
  background: var(--c-plate2); color: var(--c-ink); font-size: 17px; font-weight: 600; cursor: pointer;
  touch-action: manipulation;
}
.btn.primary { background: var(--c-green); color: #0c0e10; border-color: var(--c-green); }
.btn.ghost { background: transparent; height: 44px; font-weight: 500; color: var(--c-muted); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.small { width: auto; height: 40px; padding: 0 14px; font-size: 14px; }

/* lobby */
.code-head { display: flex; justify-content: space-between; align-items: baseline; }
.code-big { font-size: 28px; letter-spacing: .18em; }
.share { font-size: 13px; color: var(--c-muted); overflow-wrap: anywhere; }
.share b { color: var(--c-ink); font-weight: 500; }
/* The invite under the room code (E1-07, D-048): the QR code at two thirds of
   the screen's width, capped at 300 px, or the link instead. A code reads from
   about ten times its width (the 10:1 rule), so on a phone it is about 4 cm,
   good to about 40 cm across a table, at 6 px a module; a 92 px thumbnail was
   good to about 12 cm. Dark on light paper inside its four-module quiet zone,
   never inverted, so any phone camera reads it. */
.invite { display: flex; flex-direction: column; align-items: center; gap: 8px; flex-shrink: 0; }
.invite.link { align-items: stretch; }
.qr-face {
  width: min(66.7vw, 300px); aspect-ratio: 1; flex-shrink: 0; padding: 0; border: 0; border-radius: 12px; overflow: hidden;
  background: #f4f1ea; cursor: zoom-in; touch-action: manipulation; box-shadow: 0 10px 28px rgba(0, 0, 0, .4);
}
.qr-face svg, .qr-card svg { display: block; width: 100%; height: 100%; }
.qr-face:focus-visible { outline: 3px solid var(--c-ink); outline-offset: 3px; }
.invite .share { text-align: center; }
.linkbox {
  padding: 12px 14px; border-radius: 12px; background: var(--c-plate); border: 1px solid var(--c-bezel);
  font-size: 15px; line-height: 1.4; overflow-wrap: anywhere; user-select: all; -webkit-user-select: all;
}
.invite .linkish {
  align-self: center; min-height: 44px; padding: 10px 12px; background: none; border: 0; font: inherit; font-size: 14px;
  color: var(--c-green); text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}
.invite-full { flex-shrink: 0; text-align: left; }
.qr-big { display: flex; flex-direction: column; align-items: center; gap: 14px; width: min(100%, 420px); }
.qr-card { width: min(80vw, 58vh, 400px); aspect-ratio: 1; border-radius: 14px; overflow: hidden; background: #f4f1ea; box-shadow: 0 20px 50px rgba(0, 0, 0, .5); }
.qr-big .btn { width: auto; min-width: 160px; padding: 0 24px; }
.players { display: flex; flex-direction: column; gap: 8px; }
.prow {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; flex-shrink: 0;
  background: var(--c-plate); border: 1px solid var(--c-bezel); border-radius: 12px;
}
.prow .name { flex: 1; min-width: 0; }
.prow .name > div:first-child { font-size: 16px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prow .name > div:last-child { font-size: 12px; color: var(--c-muted); }
.prow.away { opacity: .55; }
.prow.open .name > div:first-child { color: var(--c-faint); font-weight: 400; }
.swatch { width: 34px; height: 34px; border-radius: 8px; flex-shrink: 0; }
.swatch.open { border: 1.5px dashed var(--c-faint); }
.state { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--c-muted); }
.state::before { content: ""; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--c-muted); }
.state.ready { color: var(--c-green); font-weight: 600; }
.state.ready::before { background: var(--c-green); border-color: var(--c-green); }
.state.empty::before { display: none; }
.preset { display: flex; gap: 8px; }
.preset button {
  flex: 1; height: 40px; border-radius: 10px; border: 1px solid var(--c-bezel);
  background: var(--c-plate); color: var(--c-muted); font-size: 14px; cursor: pointer; text-transform: capitalize;
}
.preset button.on { color: var(--c-ink); border-color: var(--c-green); background: var(--c-plate2); }
.hint { font-size: 13px; color: var(--c-muted); text-align: center; }

/* a checkbox row: room visibility, on the landing page and in the lobby */
label.check {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; min-height: 48px; flex-shrink: 0;
  background: var(--c-plate); border: 1px solid var(--c-bezel); border-radius: 12px;
  font-size: 15px; cursor: pointer; user-select: none; -webkit-user-select: none;
}
label.check input { width: 22px; height: 22px; margin: 0; flex-shrink: 0; accent-color: var(--c-green); }

/* the list of public rooms on the landing page */
.rooms { display: flex; flex-direction: column; gap: 8px; }
.rooms .eyebrow { margin-top: 2px; }
.rooms .none { font-size: 13px; color: var(--c-muted); }
.roomrow {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; flex-shrink: 0;
  padding: 11px 14px; min-height: 56px; border-radius: 12px; cursor: pointer;
  background: var(--c-plate); border: 1px solid var(--c-bezel); color: var(--c-ink);
  touch-action: manipulation;
}
.roomrow:hover, .roomrow:focus { border-color: var(--c-green); outline: none; }
.rr-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rr-host { font-size: 16px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rr-sub { font-size: 12px; color: var(--c-muted); }
.rr-code { font-size: 18px; letter-spacing: .14em; color: var(--c-muted); flex-shrink: 0; }

/* the copy button, while it is confirming */
.btn.ok { border-color: var(--c-green); color: var(--c-green); }

/* skins: card plate and bezel per seat, behaviour identical (D-004).
   v2 (screens/10): graphite, cobalt, moss, rust; rust has copper rivets. */
.skin-0 { --card-bg: linear-gradient(180deg, #2a2f37 0%, #1b1e22 60%); --card-border: 1.5px solid #4a525d; }
.skin-1 { --card-bg: linear-gradient(180deg, #22304a 0%, #151c2a 60%); --card-border: 3px double #45659e; }
.skin-2 { --card-bg: linear-gradient(180deg, #26342a 0%, #182019 60%); --card-border: 4px solid #5b7d52; }
.skin-3 { --card-bg: linear-gradient(180deg, #36251e 0%, #241915 60%); --card-border: 2px solid #8e5641; --rivet: radial-gradient(circle at 35% 35%, #c08a70, #8e5641 70%); }
.swatch.skin-0, .swatch.skin-1, .swatch.skin-2, .swatch.skin-3 { background: var(--card-bg); border: var(--card-border); }

/* console */
.console { padding: 12px; }
.console .grid { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 10px; }
.gauges, .controls { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
/* v2 divider: a copper and a cyan wire run together, cross at a spark in the
   middle, and carry on swapped. The crossing is a fixed 94 px drawing; the
   wires either side stretch. */
.divider {
  height: 14px; flex-shrink: 0;
  --wc: rgba(0, 245, 212, .75); --wk: rgba(224, 122, 95, .75); --half: calc(50% - 47px);
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 94 14'%3E%3Cdefs%3E%3Cfilter id='g' x='-80%25' y='-80%25' width='260%25' height='260%25'%3E%3CfeGaussianBlur stdDeviation='4'/%3E%3C/filter%3E%3C/defs%3E%3Cpath d='M0 7 C26.8 7 33.6 2 47 2 C60.4 2 67.2 12 94 12' fill='none' stroke='%23e07a5f' stroke-width='2' opacity='.75'/%3E%3Cpath d='M0 7 C26.8 7 33.6 12 47 12 C60.4 12 67.2 2 94 2' fill='none' stroke='%2300f5d4' stroke-width='2' opacity='.75'/%3E%3Ccircle cx='47' cy='7' r='7' fill='%2300f5d4' opacity='.35' filter='url(%23g)'/%3E%3Cpath d='M47 1 L48.3 5.7 L53 7 L48.3 8.3 L47 13 L45.7 8.3 L41 7 L45.7 5.7 Z' fill='%23ebe6dc'/%3E%3C/svg%3E") center / 94px 14px no-repeat,
    linear-gradient(var(--wc), var(--wc)) left 0 top 6px / var(--half) 2px no-repeat,
    linear-gradient(var(--wk), var(--wk)) left 0 top 6px / var(--half) 2px no-repeat,
    linear-gradient(var(--wc), var(--wc)) right 0 top 1px / var(--half) 2px no-repeat,
    linear-gradient(var(--wk), var(--wk)) right 0 top 11px / var(--half) 2px no-repeat;
}
.card { background: var(--card-bg); border: var(--card-border); border-radius: 10px; min-height: 0; min-width: 0; position: relative; }
/* Four rivets, one per corner (v2). */
.card:not(.empty)::after {
  content: ""; position: absolute; inset: 5px; pointer-events: none;
  background: var(--rivet) left top / 6px 6px no-repeat, var(--rivet) right top / 6px 6px no-repeat,
    var(--rivet) left bottom / 6px 6px no-repeat, var(--rivet) right bottom / 6px 6px no-repeat;
  -webkit-mask: radial-gradient(circle 3px at 3px 3px, #000 98%, transparent) left top / 6px 6px no-repeat,
    radial-gradient(circle 3px at 3px 3px, #000 98%, transparent) right top / 6px 6px no-repeat,
    radial-gradient(circle 3px at 3px 3px, #000 98%, transparent) left bottom / 6px 6px no-repeat,
    radial-gradient(circle 3px at 3px 3px, #000 98%, transparent) right bottom / 6px 6px no-repeat;
  mask: radial-gradient(circle 3px at 3px 3px, #000 98%, transparent) left top / 6px 6px no-repeat,
    radial-gradient(circle 3px at 3px 3px, #000 98%, transparent) right top / 6px 6px no-repeat,
    radial-gradient(circle 3px at 3px 3px, #000 98%, transparent) left bottom / 6px 6px no-repeat,
    radial-gradient(circle 3px at 3px 3px, #000 98%, transparent) right bottom / 6px 6px no-repeat;
}
.card.empty { border-style: dashed; border-width: 1.5px; border-color: var(--c-faint); background: transparent; opacity: .5; }

.gauge { display: flex; align-items: center; justify-content: center; overflow: hidden; padding: 4px; }
.gauge svg { width: 100%; height: 100%; display: block; }
@keyframes cpulse { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
@keyframes cshake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-1.5px); } 75% { transform: translateX(1.5px); } }
.st-amber .pulse { animation: cpulse 1.4s ease-in-out infinite; }
.st-red .shake { animation: cshake .18s linear infinite; }
@media (prefers-reduced-motion: reduce) { .pulse, .shake { animation: none !important; } }

.ctl { display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 10px; user-select: none; -webkit-user-select: none; }
.plate {
  width: 44px; height: 44px; border-radius: 8px; flex-shrink: 0;
  background: #0b0d0f; border: 1.2px solid #6b7480; display: flex; align-items: center; justify-content: center;
  color: var(--c-ink);
}
.plate svg { width: 28px; height: 28px; display: block; }
.widget { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: center; }

/* Pilot lamp, top right of every control (v2): lit = the panel has power. */
.pilot {
  position: absolute; top: 12px; right: 12px; width: 8.4px; height: 8.4px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle at 35% 35%, #fff 0 14%, var(--c-cyan) 24%); border: 1.2px solid #0b0d0f;
  box-shadow: 0 0 7px 2px rgba(0, 245, 212, .45);
}
/* Dead (v2): the breaker is out. Dim and desaturated, a dashed outline, the
   pilot lamp dark. The game has no breaker yet; the parts bench uses this. */
.card.dead { border-style: dashed; }
.card.dead > :not(.pilot) { filter: grayscale(1); opacity: .32; pointer-events: none; }
.card.dead .pilot { background: #23272e; box-shadow: none; }

/* Covers (D-051): a plain plate over a pair still to come in a warm-up, and
   over a slot no pair uses. A placeholder until the design workstream draws
   the worn replacement cover (brief 05). Never words or a glyph, and nothing
   from the alarm language: no zone colours, no hatching or dots, no pulse. */
.card.covered > :not(.cover), .card.bay > :not(.cover) { visibility: hidden; }
.card.bay { border-color: transparent; }
.cover {
  position: absolute; inset: -1px; z-index: 3; border-radius: inherit;
  background:
    radial-gradient(120% 90% at 28% 18%, rgba(255, 255, 255, .05), transparent 60%),
    radial-gradient(70% 55% at 82% 88%, rgba(0, 0, 0, .28), transparent 70%),
    linear-gradient(172deg, #3a3f46, #2c3036 55%, #24282d);
  border: 1px solid #4a515b;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07), inset 0 -2px 6px rgba(0, 0, 0, .35), 0 2px 6px rgba(0, 0, 0, .35);
}
/* Four screws, one per corner. They back out one after another before the
   plate comes off, clockwise from the top left. */
.cover i {
  position: absolute; width: 11px; height: 11px; border-radius: 50%;
  background: linear-gradient(35deg, transparent 43%, #2a2f35 43% 57%, transparent 57%),
    radial-gradient(circle at 35% 30%, #c9ced6, #7b838e 45%, #3d434b 80%);
  box-shadow: 0 1px 1.5px rgba(0, 0, 0, .6), inset 0 -1px 1px rgba(0, 0, 0, .4);
  transition: transform .45s ease-out, box-shadow .45s ease-out;
}
.cover i:nth-child(1) { left: 9px; top: 9px; }
.cover i:nth-child(2) { right: 9px; top: 9px; }
.cover i:nth-child(3) { right: 9px; bottom: 9px; }
.cover i:nth-child(4) { left: 9px; bottom: 9px; }
.cover.loosening i { transform: scale(1.35) rotate(-300deg); box-shadow: 0 4px 5px rgba(0, 0, 0, .55); }
.cover.loosening i:nth-child(2) { transition-delay: .6s; }
.cover.loosening i:nth-child(3) { transition-delay: 1.2s; }
.cover.loosening i:nth-child(4) { transition-delay: 1.8s; }
.cover.off { animation: cover-off .35s ease-in forwards; pointer-events: none; }
@keyframes cover-off { to { transform: translateY(16px) rotate(-3deg); opacity: 0; } }
/* On arrival both halves of the pair ring once, on two phones at once. */
.gauge .gring { transform-box: fill-box; transform-origin: center; }
.card.ring .gring { animation: gauge-ring 1.1s ease-out 1; }
@keyframes gauge-ring { 0% { opacity: .95; transform: scale(1); } 100% { opacity: 0; transform: scale(1.7); } }
.card.ring .plate { animation: plate-ring 1.1s ease-out 1; }
@keyframes plate-ring { 0% { box-shadow: 0 0 0 0 rgba(235, 230, 220, .9); } 100% { box-shadow: 0 0 0 14px rgba(235, 230, 220, 0); } }
/* The last pair is in and the round is on: every lamp flashes once. */
.lamps-flash .pilot { animation: lamp-flash 1.1s ease-out 1; }
@keyframes lamp-flash { 25% { filter: brightness(1.9); box-shadow: 0 0 14px 5px rgba(0, 245, 212, .8); } }
@media (prefers-reduced-motion: reduce) {
  .cover i { transition: none; }
  .cover.off { animation: none; opacity: 0; }
  .card.ring .gring, .card.ring .plate, .lamps-flash .pilot { animation: none; }
}

/* C-01 toggle: a rubber-lined slot, a steel knob; on = copper. */
.tg {
  width: 88px; height: 44px; border-radius: 22px; border: 1.4px solid #454c57; background: #08090a;
  position: relative; cursor: pointer; padding: 0; flex-shrink: 0; touch-action: manipulation;
}
.tg::before { content: ""; position: absolute; inset: 2.6px; border-radius: 18px; background: #15181b; transition: background .15s ease; }
.tg-knob {
  position: absolute; top: 4.6px; left: 6.6px; width: 32px; height: 32px; border-radius: 50%;
  background: radial-gradient(circle closest-side, #2b3038 0, #15181b 54%, transparent 57%), var(--m-steel);
  border: 1.4px solid #0b0d0f; transition: left .15s ease;
}
.tg-mark { position: absolute; top: 13.4px; left: 57.4px; width: 14.4px; height: 14.4px; border-radius: 50%; border: 2.4px solid #59606a; box-sizing: border-box; background: transparent; }
.tg[aria-pressed="true"]::before { background: rgba(224, 122, 95, .85); }
.tg[aria-pressed="true"] .tg-knob { left: 46.6px; }
.tg[aria-pressed="true"] .tg-mark { left: 19.1px; top: 14.6px; width: 3px; height: 12px; border-radius: 1.5px; border: 0; background: #0b0d0f; }

/* C-02 knob: three position dots, a black ring of ticks, a steel knob with a
   rubber face and a copper pointer.
   touch-action: none, not manipulation: the knob is turned with a horizontal
   drag, and the browser must not decide halfway through that the gesture was
   really a scroll. */
.knob { width: 88px; height: 88px; border-radius: 50%; border: 0; background: transparent; position: relative; cursor: pointer; padding: 0; flex-shrink: 0; touch-action: none; }
.knob::before {
  content: ""; position: absolute; left: 50%; top: 50%; width: 62px; height: 62px; margin: -31px 0 0 -31px; border-radius: 50%;
  background: repeating-conic-gradient(from -0.9deg, #454c57 0 1.8deg, #08090a 1.8deg 11.25deg);
}
.knob .tick { position: absolute; left: 50%; top: 50%; width: 6.8px; height: 6.8px; border-radius: 50%; margin: -3.4px 0 0 -3.4px; background: #59606a; }
.knob .t0 { transform: rotate(-60deg) translateY(-40px); } .knob .t1 { transform: translateY(-40px); } .knob .t2 { transform: rotate(60deg) translateY(-40px); }
.knob .tick.on { background: var(--c-ink); }
.knob .dial {
  position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px 0 0 -26px; border-radius: 50%;
  background: radial-gradient(circle closest-side, #3a4048 0, #15181b 68%, transparent 70%), var(--m-steel); border: 1px solid #0b0d0f;
}
.knob .pointer { position: absolute; left: 50%; top: 50%; width: 4px; height: 22px; margin-left: -2px; margin-top: -22px; border-radius: 2px; transform-origin: 2px 22px; background: var(--c-copper); transition: transform .12s ease; }
/* Held: a copper ring lights round the knob, so a finger that has hold of it
   can tell. The pointer must track the thumb with no easing, or a drag feels
   like it is lagging behind the hand. */
.knob.held::before { box-shadow: 0 0 0 2.2px var(--c-copper), 0 0 10px 2px rgba(224, 122, 95, .45); }
.knob.held .pointer { transition: none; }

/* C-03 slider: a slot with a scale above and below, a rubber thumb with grip
   lines and an ink centre line; held = copper. */
.sl { width: 96px; height: 56px; position: relative; display: flex; align-items: center; flex-shrink: 0; }
.sl::before, .sl::after {
  content: ""; position: absolute; left: 3px; right: 3px; height: 4px; pointer-events: none;
  background: repeating-linear-gradient(90deg, #59606a 0 1.4px, transparent 1.4px 11.1px);
}
.sl::before { top: 7px; } .sl::after { bottom: 7px; }
.sl-mark { position: absolute; left: 50%; width: 1.4px; height: 8px; margin-left: -.7px; background: var(--c-ink); z-index: 1; }
.sl-mark.top { top: 3px; } .sl-mark.bottom { bottom: 3px; }
input[type=range].csl { -webkit-appearance: none; appearance: none; width: 100%; height: 44px; background: transparent; margin: 0; touch-action: pan-x; position: relative; z-index: 2; }
input[type=range].csl::-webkit-slider-runnable-track { height: 7px; border-radius: 3.5px; background: #08090a; border: 1px solid #2c3138; }
input[type=range].csl::-webkit-slider-thumb {
  -webkit-appearance: none; width: 22px; height: 40px; margin-top: -17.5px; border-radius: 4px; border: 1px solid #555d69;
  background: linear-gradient(var(--c-ink), var(--c-ink)) center / 18px 2px no-repeat,
    repeating-linear-gradient(180deg, transparent 0 9px, #555d69 9px 10.2px, transparent 10.2px 15px) center / 14px 100% no-repeat, var(--m-rubber);
}
input[type=range].csl:active::-webkit-slider-thumb { box-shadow: 0 0 0 3px var(--c-copper), 0 0 10px 2px rgba(224, 122, 95, .45); }
input[type=range].csl::-moz-range-track { height: 7px; border-radius: 3.5px; background: #08090a; border: 1px solid #2c3138; }
input[type=range].csl::-moz-range-thumb {
  width: 20px; height: 38px; border-radius: 4px; border: 1px solid #555d69;
  background: linear-gradient(var(--c-ink), var(--c-ink)) center / 18px 2px no-repeat, var(--m-rubber);
}
input[type=range].csl:active::-moz-range-thumb { box-shadow: 0 0 0 3px var(--c-copper); }

/* C-05 button: a copper bezel, a rubber ring, an ivory cap; pressed = the cap
   sinks and a copper ring lights. */
.pb {
  width: 62px; height: 62px; border-radius: 50%; border: 1.2px solid #5a2a1c; background: var(--m-copper);
  box-shadow: 0 3px 0 1px #08090a; cursor: pointer; padding: 0; flex-shrink: 0; touch-action: manipulation;
  display: flex; align-items: center; justify-content: center;
}
.pb-disc {
  display: block; width: 42px; height: 42px; border-radius: 50%; border: 1.2px solid #0b0d0f;
  background: radial-gradient(ellipse 8px 4px at 14px 11px, rgba(255, 255, 255, .45), transparent), var(--m-ivory);
  box-shadow: 0 0 0 4px #15181b; transition: transform .08s ease, background .2s ease;
}
.pb:active { box-shadow: 0 3px 0 1px #08090a, 0 0 0 4px var(--c-copper), 0 0 12px 3px rgba(224, 122, 95, .45); }
.pb:active .pb-disc { transform: translateY(3px); background: #bdb6a6; }
.pb.cooldown .pb-disc { background: #59606a; }

/* debrief */
.stat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.stat { background: var(--c-plate); border: 1px solid var(--c-bezel); border-radius: 12px; padding: 14px; }
.stat .k { font-size: 12px; color: var(--c-muted); }
.stat .v { font-size: 34px; line-height: 1.1; }
.stat .sub { margin-top: 8px; font-size: 12px; color: var(--c-muted); }
.bar { margin-top: 8px; height: 8px; border-radius: 4px; background: #0c0e10; overflow: hidden; }
.bar > div { height: 100%; border-radius: 4px; background: var(--c-green); }
.bar.failed > div { background: var(--c-red); }
.stars { display: flex; gap: 6px; justify-content: center; padding: 6px 0; }
.stars svg { width: 28px; height: 28px; color: var(--c-faint); }
.stars svg.on { color: var(--c-amber); }
table.stats { border-collapse: collapse; width: 100%; }
table.stats td { padding: 9px 0; border-bottom: 1px solid var(--c-bezel); font-size: 14px; }
table.stats td:first-child { color: var(--c-muted); }
table.stats td:last-child { text-align: right; }
table.stats td svg { width: 20px; height: 20px; vertical-align: middle; color: var(--c-ink); margin-left: 6px; }

/* overlays */
#overlay {
  position: fixed; inset: 0; background: rgba(16, 18, 20, .92); display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 12px; z-index: 50; text-align: center; padding: 24px;
}
#overlay[hidden] { display: none; }
#overlay .big { font-size: 96px; line-height: 1; }
#overlay .msg { font-size: 16px; color: var(--c-muted); }
#toast {
  position: fixed; top: 12px; left: 12px; right: 12px; z-index: 60; padding: 12px 14px; border-radius: 10px;
  background: var(--c-plate2); border: 1px solid var(--c-amber); color: var(--c-ink); font-size: 14px; text-align: center;
}
#toast[hidden] { display: none; }
