:root {
  /* light, high-contrast "graph-paper" theme */
  --bg:         #EEF1F4;   /* page behind the device */
  --surface:    #FFFFFF;   /* cards / panels */
  --surface-2:  #F6F8FB;   /* subtle off-white */
  --grid-line:  #E5EAF0;   /* graph-paper lines */
  --line:       #D2DAE3;   /* borders */
  --line-2:     #B6C2CF;   /* stronger borders */

  --txt:        #1E293B;   /* primary text (dark slate) */
  --txt-dim:    #708097;   /* muted labels */

  /* team + system accents (base = fill, -ink = readable text on white) */
  --red:        #F43F5E;  --red-ink:   #E11D48;
  --blue:       #06B6D4;  --blue-ink:  #0E7490;
  --amber:      #F59E0B;  --amber-ink: #B45309;
  --green:      #22C55E;  --green-ink: #15803D;
  --purple:     #8B5CF6;

  --red-wash:   #FFE9ED;
  --blue-wash:  #E2F7FB;
  --amber-wash: #FEF3DD;

  --shadow-sm: 0 1px 2px rgba(30,41,59,.06), 0 1px 3px rgba(30,41,59,.08);
  --shadow-md: 0 4px 14px rgba(30,41,59,.10);
  font-size: 16px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--txt);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}
body { display: flex; align-items: center; justify-content: center; }

/* CRT overlays: only visible in the dark theme */
.scanlines, .crt-flicker { display: none; position: fixed; inset: 0; pointer-events: none; }
[data-theme="dark"] .scanlines {
  display: block; z-index: 9000; mix-blend-mode: multiply; opacity: .5;
  background: repeating-linear-gradient(to bottom,
    rgba(0,0,0,0) 0, rgba(0,0,0,0) 2px, rgba(0,0,0,.18) 3px, rgba(0,0,0,.18) 3px);
}
[data-theme="dark"] .crt-flicker {
  display: block; z-index: 9001;
  background: rgba(6,182,212,.012); animation: flicker 6s infinite steps(60);
}
@keyframes flicker { 0%,97%,100%{opacity:1} 98%{opacity:.85} 99%{opacity:.95} }

/* ---------- Floating theme toggle ---------- */
.theme-toggle {
  position: absolute; bottom: 14px; right: 14px; z-index: 9600;
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--surface); border: 1.5px solid var(--line-2); color: var(--txt);
  font-size: 16px; cursor: pointer; box-shadow: var(--shadow-md);
  display: flex; align-items: center; justify-content: center;
}
.theme-toggle:active { transform: scale(.94); }

/* ---------- Device shell ---------- */
.device {
  position: relative;
  width: 100%;
  max-width: 440px;
  height: 100dvh;
  max-height: 940px;
  background: var(--surface);
  /* faint graph-paper grid, like the reference */
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 22px 22px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
@media (min-width: 460px) { .device { border-radius: 20px; } }

/* ---------- Views ---------- */
.view { display: none; flex-direction: column; height: 100%; }
.view.is-active { display: flex; }

.screen-scroll {
  flex: 1; overflow-y: auto; padding: 14px;
  display: flex; flex-direction: column; gap: 14px;
  scrollbar-width: thin; scrollbar-color: var(--line) transparent;
}
.screen-scroll::-webkit-scrollbar { width: 6px; }
.screen-scroll::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }

/* ============== LOGIN ============== */
.view--login { justify-content: center; padding: 26px; }
.login-stack { display: flex; flex-direction: column; gap: 22px; }
.logo-art {
  color: var(--blue-ink);
  font-size: 13px; line-height: 1.25;
}
.logo-sub {
  margin-top: 10px; color: var(--amber-ink); font-weight: 700;
  font-size: 11px; letter-spacing: 3px;
}
.boot-log {
  min-height: 92px; font-size: 11px; line-height: 1.7;
  color: var(--green-ink); font-weight: 500;
  border-left: 3px solid var(--green); padding-left: 10px;
  white-space: pre-wrap; background: #F2FBF5; border-radius: 0 6px 6px 0; padding: 8px 10px;
}
.login-form { display: flex; flex-direction: column; gap: 12px; }
.field-label { font-size: 10px; letter-spacing: 2px; color: var(--txt-dim); font-weight: 700; }
.passcode-input {
  background: var(--surface-2); border: 1.5px solid var(--line-2);
  color: var(--txt); font-family: inherit; font-size: 17px; font-weight: 700;
  letter-spacing: 1px; text-align: center; text-transform: lowercase;
  padding: 13px 10px; border-radius: 10px; outline: none; caret-color: var(--blue);
}
.passcode-input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-wash); }
.passcode-input::placeholder { color: #B4BECA; font-weight: 500; opacity: 1; }
.login-hint { display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  font-size: 10px; color: var(--txt-dim); }
.chip {
  background: var(--surface); border: 1px solid var(--line-2); color: var(--blue-ink);
  font-family: inherit; font-size: 10px; padding: 5px 9px; border-radius: 20px;
  cursor: pointer; letter-spacing: 1px; font-weight: 700;
}
.chip:active { background: var(--blue-wash); }
.chip--admin { color: var(--amber-ink); border-color: #F0CF8E; }
.login-error { color: var(--red-ink); font-size: 11px; font-weight: 700; min-height: 14px; }

/* ============== Buttons ============== */
.btn {
  position: relative; font-family: inherit; font-weight: 700; font-size: 13px;
  letter-spacing: 2px; padding: 14px; border-radius: 10px; cursor: pointer;
  border: 1.5px solid var(--line-2); background: var(--surface); color: var(--txt);
  box-shadow: var(--shadow-sm); transition: transform .05s ease, box-shadow .15s;
}
.btn:active { transform: translateY(1px); }
.btn--primary { border-color: var(--blue); color: #fff; background: var(--blue); }
.btn--primary:hover { box-shadow: 0 4px 14px rgba(6,182,212,.35); }
.btn--ghost { color: var(--blue-ink); }
.btn--ghost:hover { border-color: var(--blue); }
.btn--danger { border-color: var(--red); color: var(--red-ink); }
.btn--danger:hover { background: var(--red-wash); }
.btn-glow { display: none; }

/* ============== Topbar ============== */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.topbar--admin { border-bottom: 2px solid var(--amber); }
.topbar-left { display: flex; align-items: center; gap: 8px; }
.topbar-title { font-weight: 800; letter-spacing: 2px; font-size: 14px; }
.dot { width: 8px; height: 8px; border-radius: 50%; }
.dot--live { background: var(--green); box-shadow: 0 0 0 3px #DCFCE7; animation: pulse 1.6s infinite; }
.dot--admin { background: var(--amber); box-shadow: 0 0 0 3px var(--amber-wash); }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.35} }
.topbar-timer { text-align: center; line-height: 1.1; }
.timer-label { display: block; font-size: 8px; letter-spacing: 2px; color: var(--txt-dim); font-weight: 700; }
.timer-value { font-size: 20px; font-weight: 800; color: var(--amber-ink);
  font-variant-numeric: tabular-nums; }
.timer-value.is-low { color: var(--red-ink); }
.icon-btn { background: var(--surface); border: 1px solid var(--line-2); color: var(--txt-dim);
  width: 32px; height: 32px; border-radius: 8px; cursor: pointer; font-size: 15px; }
.icon-btn:hover { color: var(--red-ink); border-color: var(--red); }

/* ============== Identity ============== */
.identity-bar {
  display: flex; align-items: center; gap: 10px; padding: 8px 14px;
  background: var(--surface-2); border-bottom: 1px solid var(--line); font-size: 11px;
}
.identity-label { color: var(--txt-dim); letter-spacing: 1px; font-weight: 700; }
.identity-name { font-weight: 700; color: var(--txt); }
.identity-team { margin-left: auto; font-weight: 700; letter-spacing: 1px; font-size: 11px; }
.team--unknown { color: var(--txt-dim); }
.team--red  { color: var(--red-ink); }
.team--blue { color: var(--blue-ink); }

/* ============== Grid ============== */
.grid-frame { border: 1px solid var(--line); border-radius: 14px; background: var(--surface);
  padding: 12px; box-shadow: var(--shadow-sm); }
.grid-frame-head { display: flex; justify-content: space-between; font-size: 10px;
  letter-spacing: 1px; color: var(--txt-dim); margin-bottom: 10px; font-weight: 700; }
.grid-size { color: var(--blue-ink); }
.grid-head-right { display: flex; align-items: center; gap: 9px; }
.fleet-toggle { font-family: inherit; font-size: 10px; font-weight: 800; letter-spacing: .5px;
  text-transform: uppercase; color: var(--txt-dim); background: var(--surface-2);
  border: 1px solid var(--line-2); border-radius: 6px; padding: 3px 8px; cursor: pointer; }
.fleet-toggle.is-active { color: var(--green-ink); border-color: var(--green); background: #F0FDF4; }
.grid-wrap { display: grid; gap: 5px; }
/* own-team ship overlay (the "my fleet" toggle) */
.cell.is-myship--red  { box-shadow: inset 0 0 0 2.5px var(--red),  var(--shadow-sm); }
.cell.is-myship--blue { box-shadow: inset 0 0 0 2.5px var(--blue), var(--shadow-sm); }
.cell {
  position: relative; aspect-ratio: 1; background: var(--surface-2);
  border: 1.5px solid var(--line); border-radius: 8px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; font-weight: 800; color: var(--txt-dim);
  box-shadow: var(--shadow-sm);
  transition: background .12s, border-color .12s, transform .08s;
  -webkit-tap-highlight-color: transparent; user-select: none;
}
.cell .coord-lbl { position: absolute; top: 3px; left: 4px; font-size: 7px; color: #AEB9C6; font-weight: 700; }
.cell:hover { border-color: var(--blue); transform: translateY(-1px); }
.cell.is-miss { color: var(--txt-dim); background: var(--surface); }
.cell.is-hit  { color: #334155; background: #FFF3F4; border-color: #F7C7CF; }
/* hit tiles are coloured by the owning ship's team */
.cell.is-hit--red  { color: var(--red);  background: var(--red-wash);  border-color: var(--red); }
.cell.is-hit--blue { color: var(--blue-ink); background: #E0F7FB; border-color: var(--blue); }
.cell.is-bomb {
  border-color: var(--red); color: var(--red-ink);
  background: var(--red-wash); animation: blink 1s steps(2) infinite;
}
.cell.is-defend {
  border-color: var(--blue); color: var(--blue-ink);
  background: var(--blue-wash);
}
@keyframes blink { 0%,100%{box-shadow:0 0 0 3px rgba(244,63,94,.25)} 50%{box-shadow:var(--shadow-sm)} }
.cell .vote-mark { position: absolute; font-size: 18px; line-height: 1; }
.cell.is-bomb .vote-mark { color: var(--red); }
.cell.is-defend .vote-mark { color: var(--blue-ink); }

/* ============== Mode toggle ============== */
.mode-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mode-btn {
  font-family: inherit; font-weight: 800; font-size: 15px; letter-spacing: 2px;
  padding: 16px; border-radius: 14px; cursor: pointer; color: var(--txt-dim);
  background: var(--surface); border: 1.5px solid var(--line-2);
  box-shadow: var(--shadow-sm); transition: all .12s;
}
.mode-btn:active { transform: translateY(2px); }
.mode-ico { display: block; font-size: 18px; margin-bottom: 2px; }
.mode-btn--bomb.is-active { color: #fff; background: var(--red); border-color: var(--red); box-shadow: 0 4px 14px rgba(244,63,94,.35); }
.mode-btn--defend.is-active { color: #fff; background: var(--blue); border-color: var(--blue); box-shadow: 0 4px 14px rgba(6,182,212,.35); }

.vote-status { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.vote-pill { display: flex; flex-direction: column; gap: 2px; padding: 9px 13px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface); font-size: 10px;
  color: var(--txt-dim); font-weight: 700; box-shadow: var(--shadow-sm); }
.vote-pill strong { font-size: 18px; }
.vote-pill--bomb strong { color: var(--red-ink); }
.vote-pill--defend strong { color: var(--blue-ink); }

/* ============== Panels ============== */
.panel { border: 1px solid var(--line); border-radius: 14px; background: var(--surface);
  padding: 13px; box-shadow: var(--shadow-sm); }
.panel-head { font-size: 11px; letter-spacing: 1px; color: var(--txt); font-weight: 800;
  margin-bottom: 8px; display: flex; justify-content: space-between; align-items: center; cursor: default; }
.panel-sub { font-size: 9px; color: var(--txt-dim); font-weight: 600; letter-spacing: 1px; }
.logline { font-size: 11px; line-height: 1.95; color: var(--txt); }
.logline b { color: #000; }
.logline--sys { color: var(--green-ink); font-weight: 500; }
.hit-txt { color: var(--amber-ink) !important; }
.tag { font-size: 9px; padding: 2px 6px; border-radius: 5px; font-weight: 800; margin-right: 4px; }
.tag--red { background: var(--red-wash); color: var(--red-ink); }
.tag--blue { background: var(--blue-wash); color: var(--blue-ink); }

.panel--nerd summary { list-style: none; }
.panel--nerd summary::-webkit-details-marker { display: none; }
.nerd-body { display: flex; flex-direction: column; gap: 7px; padding-top: 8px; border-top: 1px dashed var(--line); margin-top: 4px; }
.nerd-row { display: flex; justify-content: space-between; font-size: 11px; color: var(--txt); }
.nerd-hint { font-size: 10px; color: var(--amber-ink); margin-top: 2px; font-weight: 600; }
.t-red { color: var(--red-ink); } .t-blue { color: var(--blue-ink); } .t-green { color: var(--green-ink); }

/* ============== Score ============== */
.score-board { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  gap: 10px; border: 1px solid var(--line); border-radius: 14px; padding: 14px; background: var(--surface); box-shadow: var(--shadow-sm); }
.score { text-align: center; }
.score-team { display: block; font-size: 9px; letter-spacing: 1px; color: var(--txt-dim); font-weight: 700; }
.score-val { font-size: 30px; font-weight: 800; font-variant-numeric: tabular-nums; }
.score--red .score-val { color: var(--red-ink); }
.score--blue .score-val { color: var(--blue-ink); }
.score-vs { font-size: 10px; color: var(--txt-dim); font-weight: 700; }

.fleet-status { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fleet { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px;
  font-size: 9px; color: var(--txt-dim); font-weight: 700; padding: 9px 11px; border: 1px solid var(--line);
  border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-sm); }
.hull-bar { height: 7px; background: #EAEFF4; border-radius: 4px; overflow: hidden; }
.hull-bar i { display: block; height: 100%; border-radius: 4px; }
.fleet--red .hull-bar i { background: var(--red); }
.fleet--blue .hull-bar i { background: var(--blue); }
.fleet-pct { font-weight: 800; color: var(--txt); }

/* ============== Admin ============== */
.admin-tabs { display: grid; grid-template-columns: repeat(4,1fr); border-bottom: 1px solid var(--line); background: var(--surface); }
.admin-tab { font-family: inherit; font-size: 11px; letter-spacing: 1px; font-weight: 800;
  padding: 13px 6px; background: transparent; color: var(--txt-dim); border: none; cursor: pointer; border-bottom: 2px solid transparent; }
.admin-tab.is-active { color: var(--amber-ink); border-bottom-color: var(--amber); }
.admin-pane { display: none; flex-direction: column; gap: 14px; }
.admin-pane.is-active { display: flex; }
.admin-textarea { width: 100%; min-height: 110px; resize: vertical; background: var(--surface-2);
  border: 1.5px solid var(--line-2); color: var(--txt); font-family: inherit; font-size: 13px;
  padding: 10px; border-radius: 10px; outline: none; }
.admin-textarea:focus { border-color: var(--amber); box-shadow: 0 0 0 3px var(--amber-wash); }
.roster { display: flex; flex-direction: column; gap: 6px; }
.roster-item { display: flex; justify-content: space-between; align-items: center;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); font-size: 12px; }
.roster-name { font-weight: 700; }
.roster-token { color: var(--blue-ink); letter-spacing: 1px; font-size: 12px; font-weight: 700; }
.roster-team { width: 9px; height: 9px; border-radius: 50%; margin-left: 8px; background: var(--line-2); }
/* team color is only shown when the reveal switch is on */
.roster.reveal .roster-team--red  { background: var(--red); }
.roster.reveal .roster-team--blue { background: var(--blue); }

/* reveal switch */
.reveal-row { display: flex; align-items: center; gap: 10px; padding: 2px 2px 11px; margin-bottom: 9px; border-bottom: 1px dashed var(--line); }
.switch { position: relative; display: inline-flex; cursor: pointer; flex: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-track { width: 38px; height: 22px; border-radius: 22px; background: var(--line-2);
  transition: background .15s; display: inline-block; position: relative; }
.switch-thumb { position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; box-shadow: var(--shadow-sm); transition: transform .15s; }
.switch input:checked + .switch-track { background: var(--amber); }
.switch input:checked + .switch-track .switch-thumb { transform: translateX(16px); }

/* end-game button: armed (awaiting confirm) state */
.btn--danger.is-armed { background: var(--red); color: #fff; border-color: var(--red); }

/* resolve log → share */
.resolve-log { display: flex; flex-direction: column; gap: 6px; }
.resolve-empty { font-size: 12px; color: var(--green-ink); font-weight: 500; padding: 4px 2px; }
.resolve-item { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.resolve-head { font-size: 11px; font-weight: 800; letter-spacing: .5px; color: var(--txt); }
.resolve-detail { font-size: 11px; font-weight: 700; color: var(--txt-dim); margin-top: 2px; }
.btn-share { flex: none; font-family: inherit; font-size: 11px; font-weight: 800; letter-spacing: .5px;
  color: #fff; background: #25D366; border: none; border-radius: 8px; padding: 7px 12px; cursor: pointer; }
.btn-share:hover { filter: brightness(.95); }

/* danger zone (clear all) */
.panel--danger { border-color: var(--red); background: var(--red-wash); }
.panel-head--danger { color: var(--red-ink); }
.danger-note { font-size: 11px; line-height: 1.5; color: var(--red-ink); margin: 4px 0 10px; }

/* admin live vote status */
.status-refresh { float: right; background: var(--surface-2); border: 1px solid var(--line-2);
  color: var(--txt-dim); border-radius: 7px; width: 22px; height: 22px; cursor: pointer;
  font-size: 13px; line-height: 1; padding: 0; }
.status-refresh:hover { color: var(--amber-ink); border-color: var(--amber); }
.vote-detail { margin-top: 10px; border-top: 1px dashed var(--line); padding-top: 8px; }
.vote-detail summary { cursor: pointer; font-size: 11px; font-weight: 700; color: var(--txt-dim);
  letter-spacing: .5px; list-style: none; }
.vote-detail summary::-webkit-details-marker { display: none; }
.vote-breakdown { margin-top: 8px; display: flex; flex-direction: column; gap: 4px; }
.vote-row { display: flex; justify-content: space-between; align-items: center;
  font-size: 12px; padding: 4px 2px; }
.vote-name { font-weight: 700; }
.vote-yes { color: var(--green-ink); font-weight: 600; }
.vote-no  { color: var(--txt-dim); font-weight: 600; }
.vote-group { margin-bottom: 8px; }
.vote-group-head { font-size: 10px; font-weight: 800; letter-spacing: 1px; color: var(--txt-dim);
  padding: 4px 2px; border-bottom: 1px solid var(--line); margin-bottom: 2px; }
.vote-group--red  .vote-group-head { color: var(--red-ink); }
.vote-group--blue .vote-group-head { color: var(--blue-ink); }

/* game history */
.history-list { display: flex; flex-direction: column; gap: 8px; }
.history-item { border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); padding: 10px 12px; }
.history-item--live { border-color: var(--green); background: #F0FDF4; }
.history-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.history-date { font-size: 11px; color: var(--txt-dim); font-weight: 700; letter-spacing: .5px; }
.history-badge { font-size: 9px; font-weight: 800; letter-spacing: 1px; padding: 2px 7px; border-radius: 20px;
  background: var(--line-2); color: var(--txt-dim); }
.history-badge--live { background: var(--green); color: #fff; }
.history-score { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 800; }
.history-vs { color: var(--txt-dim); font-weight: 600; }
.history-win { margin-left: auto; font-size: 12px; font-weight: 800; }
.switch input:focus-visible + .switch-track { box-shadow: 0 0 0 3px var(--amber-wash); }
.reveal-label { font-size: 11px; font-weight: 700; color: var(--txt); }
.reveal-warn { margin-left: auto; font-size: 9px; font-weight: 700; color: var(--txt-dim); letter-spacing: .3px; }
.reveal-warn.is-on { color: var(--amber-ink); }
.cfg-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; margin-bottom: 10px; font-size: 12px; }
.cfg-input { background: var(--surface-2); border: 1.5px solid var(--line-2); color: var(--txt);
  font-family: inherit; font-size: 13px; padding: 8px 10px; border-radius: 8px; width: 120px; text-align: right; outline: none; }
.cfg-input:focus { border-color: var(--amber); box-shadow: 0 0 0 3px var(--amber-wash); }
.admin-timer { text-align: center; margin: 4px 0 14px; }
.admin-timer .timer-value { font-size: 40px; }
.control-grid { display: flex; flex-direction: column; gap: 10px; }

/* ============== Toast ============== */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 30px);
  background: var(--surface); border: 1.5px solid var(--blue); color: var(--blue-ink);
  padding: 11px 18px; border-radius: 10px; font-size: 12px; letter-spacing: 1px; font-weight: 700;
  box-shadow: var(--shadow-md); opacity: 0; pointer-events: none; transition: all .25s; z-index: 9500; max-width: 90%;
}
.toast.is-show { opacity: 1; transform: translate(-50%, 0); }
.toast.toast--red { border-color: var(--red); color: var(--red-ink); }
.toast.toast--amber { border-color: var(--amber); color: var(--amber-ink); }

/* ================================================================== *
 *  DARK THEME — retro cyberpunk radar terminal (design-doc §4.1)
 *  Activated by data-theme="dark" on <html>.
 * ================================================================== */
[data-theme="dark"] {
  --bg:         #0F172A;
  --surface:    #16213C;
  --surface-2:  #111A2E;
  --grid-line:  #1B2740;
  --line:       #273349;
  --line-2:     #34435E;

  --txt:        #CBD5E1;
  --txt-dim:    #7689A1;

  --red:   #F43F5E;  --red-ink:   #FB7185;
  --blue:  #06B6D4;  --blue-ink:  #38D6EC;
  --amber: #F59E0B;  --amber-ink: #FBBF24;
  --green: #22C55E;  --green-ink: #4ADE80;
  --purple:#A78BFA;

  --red-wash:   rgba(244,63,94,.16);
  --blue-wash:  rgba(6,182,212,.16);
  --amber-wash: rgba(245,158,11,.16);

  --shadow-sm: 0 1px 2px rgba(0,0,0,.40);
  --shadow-md: 0 12px 34px rgba(0,0,0,.55);
}

[data-theme="dark"] body {
  background:
    radial-gradient(circle at 50% 0%, rgba(6,182,212,.07), transparent 60%),
    radial-gradient(circle at 50% 100%, rgba(244,63,94,.06), transparent 55%),
    var(--bg);
}
[data-theme="dark"] .device { box-shadow: 0 0 0 1px rgba(6,182,212,.08), 0 30px 80px rgba(0,0,0,.6); }

[data-theme="dark"] .boot-log { background: rgba(34,197,94,.06); }
[data-theme="dark"] .cell .coord-lbl { color: rgba(118,137,161,.5); }
[data-theme="dark"] .cell.is-miss { background: var(--surface-2); }
[data-theme="dark"] .cell.is-hit {
  background: rgba(245,158,11,.08); border-color: rgba(245,158,11,.35); color: var(--amber-ink);
}
[data-theme="dark"] .cell.is-hit--red {
  background: rgba(244,63,94,.14); border-color: rgba(244,63,94,.6); color: var(--red);
}
[data-theme="dark"] .cell.is-hit--blue {
  background: rgba(6,182,212,.14); border-color: rgba(6,182,212,.6); color: var(--blue);
}
[data-theme="dark"] .dot--live  { box-shadow: 0 0 7px rgba(34,197,94,.7); }
[data-theme="dark"] .dot--admin { box-shadow: 0 0 7px rgba(245,158,11,.6); }
[data-theme="dark"] .team--red     { border-color: rgba(244,63,94,.4); }
[data-theme="dark"] .team--blue    { border-color: rgba(6,182,212,.4); }
[data-theme="dark"] .team--unknown { background: rgba(100,116,139,.15); }
[data-theme="dark"] .chip--admin   { border-color: rgba(245,158,11,.4); }
[data-theme="dark"] .hull-bar      { background: #0B1426; }
[data-theme="dark"] .logline b     { color: #fff; }
[data-theme="dark"] .roster-item   { background: var(--surface-2); }
