/* ==========================================================================
   Nocturne — the design system, then the app.
   --------------------------------------------------------------------------
   Everything above the "APP" banner is the design system as designed: tokens,
   base type, and the component classes (.btn, .input, .card, .tag, .dialog,
   .table…). Everything below it is this app's own furniture built from those
   tokens — never from raw hex. If you need a new colour or spacing step, add
   it to :root rather than inlining it.

   Inter is named first but never fetched: the wall runs on a LAN that may have
   no route to the internet, and a blocked webfont request is a visible stall
   on the console. Where Inter is installed it is used; elsewhere the system
   UI face stands in, which is what the stack is for.
   ========================================================================== */

:root {
  --color-bg: #161826;
  --color-surface: #232532;
  --color-text: #e9e9ed;
  --color-accent: #9184d9;
  --color-accent-2: #a7a1db;
  --color-divider: color-mix(in srgb, #e9e9ed 16%, transparent);

  /* Tonal ramps — generated in OKLCH on one shared lightness scale, so the
     same step of any role matches the others in visual value. */
  --color-neutral-100: #f3f5fe;
  --color-neutral-200: #e4e7f5;
  --color-neutral-300: #cfd3e5;
  --color-neutral-400: #b2b6ca;
  --color-neutral-500: #9397ab;
  --color-neutral-600: #75798c;
  --color-neutral-700: #595d6c;
  --color-neutral-800: #3f424d;
  --color-neutral-900: #292b31;

  --color-accent-100: #f5f4ff;
  --color-accent-200: #e7e5fe;
  --color-accent-300: #d2cefd;
  --color-accent-400: #b5abfc;
  --color-accent-500: #968ae0;
  --color-accent-600: #796cbf;
  --color-accent-700: #5d5294;
  --color-accent-800: #423a6a;
  --color-accent-900: #2b2741;

  --color-accent-2-100: #f5f4ff;
  --color-accent-2-800: #423e5d;

  /* Status. Not in the design's palette — the design never had to show a tile
     that dropped off the wall — so they're mixed to sit at the ramps' own
     lightness rather than borrowed from some other system. */
  --color-good: #57c98a;
  --color-bad: #e4564f;
  --color-warn: #e8c33f;

  /* LED panel. The substrate a tile is printed on and the colour an unlit
     pixel actually shows — a dark panel is never pure black in a lit room. */
  --led-substrate: #101120;
  --led-unlit: #1e2030;

  --font-heading: "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --font-heading-weight: 500;
  --font-body: "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --space-1: 2.8px;
  --space-2: 5.6px;
  --space-3: 8.4px;
  --space-4: 11.2px;
  --space-6: 16.8px;
  --space-8: 22.4px;

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 14px;

  /* Elevation — a hairline edge plus ambient darkness, derived from the ground. */
  --shadow-sm: 0 0 0 1px #3f424d;
  --shadow-md: 0 0 0 1px #595d6c, 0 6px 18px rgba(0, 0, 0, 0.55);
  --shadow-lg: 0 0 0 1px #9397ab, 0 16px 40px rgba(0, 0, 0, 0.65);
}

/* ---- base ---------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }

/* Every panel below sets `display` from a class, which outranks the UA's
   `[hidden] { display: none }` on specificity alone — so a hidden dialog would
   still lay out and eat clicks. Restate it once, decisively, and `hidden` can
   be trusted everywhere. */
[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  font-weight: 400;
  background: var(--color-bg);
  color: var(--color-text);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: var(--font-heading-weight);
  line-height: 1.12;
  letter-spacing: -0.015em;
  margin: 0 0 var(--space-2);
}
h1 { font-size: 42px; }
h2 { font-size: 32px; }
h3 { font-size: 25px; }
h4 { font-size: 20px; }
h5 { font-size: 16px; }
h6 { font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; }

p { margin: 0 0 var(--space-3); }
a { color: var(--color-accent); text-underline-offset: 3px; text-decoration: none; }
a:hover { color: var(--color-accent-300); }
img { display: block; max-width: 100%; }

.text-muted { color: color-mix(in srgb, var(--color-text) 55%, transparent); }
.mono { font-family: var(--font-mono); font-size: 11px; color: var(--color-neutral-500); }

:focus { outline: none; }
:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
::selection { background: color-mix(in srgb, var(--color-accent) 30%, transparent); }
::placeholder { color: var(--color-neutral-600); }

input, select, button, textarea { font-family: inherit; }

/* Rules fade to transparent at both ends instead of stopping cleanly — a
   Nocturne signature. The ramp is 48px an end, painted from the divider token.
   Freestanding rules fade; box outlines and in-control separators stay solid. */
.hr {
  height: 1px; border: 0; margin: var(--space-4) 0;
  background: linear-gradient(to right,
    transparent, var(--color-divider) 48px,
    var(--color-divider) calc(100% - 48px), transparent);
}

/* ---- buttons ------------------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  cursor: pointer; text-decoration: none;
  font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  font-size: 14px; line-height: 1.2; color: var(--color-text);
  background: transparent; border: 1px solid transparent;
  padding: var(--space-2) calc(var(--space-3) * 1.2);
  border-radius: var(--radius-md);
}
.btn svg { display: block; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary { color: var(--color-accent); border-color: var(--color-accent); }
.btn-primary:hover:not(:disabled) { background: color-mix(in srgb, var(--color-accent) 12%, transparent); }
.btn-primary:active:not(:disabled) { background: color-mix(in srgb, var(--color-accent) 22%, transparent); }
.btn-secondary { border-color: var(--color-divider); }
.btn-secondary:hover:not(:disabled) { background: color-mix(in srgb, var(--color-text) 7%, transparent); }
.btn-secondary:active:not(:disabled) { background: color-mix(in srgb, var(--color-text) 14%, transparent); }
.btn-ghost { color: var(--color-accent); padding-inline: var(--space-1); }
.btn-ghost:hover:not(:disabled) { background: color-mix(in srgb, var(--color-accent) 10%, transparent); }
.btn-ghost:active:not(:disabled) { background: color-mix(in srgb, var(--color-accent) 18%, transparent); }
.btn-danger { color: var(--color-bad); border-color: color-mix(in srgb, var(--color-bad) 55%, transparent); }
.btn-danger:hover:not(:disabled) { background: color-mix(in srgb, var(--color-bad) 14%, transparent); }
.btn-icon { width: 36px; height: 36px; padding: 0; }
.btn-block { width: 100%; margin-top: var(--space-2); }

/* ---- forms --------------------------------------------------------------- */

.field > label {
  display: block; font-size: 12px; margin-bottom: 5px;
  color: color-mix(in srgb, var(--color-text) 70%, transparent);
}
.input {
  width: 100%; min-height: 36px; padding: 6px 10px; font: inherit;
  font-size: 14px; color: var(--color-text); caret-color: var(--color-accent);
  background: var(--color-surface);
  border: 1px solid var(--color-divider); border-radius: var(--radius-md);
}
.input:hover { border-color: color-mix(in srgb, var(--color-text) 45%, transparent); }
.input:focus-visible { border-color: var(--color-accent); outline-offset: 0; }
select.input { cursor: pointer; }

input[type=range] {
  -webkit-appearance: none; appearance: none;
  height: 4px; border-radius: var(--radius-sm);
  background: var(--color-neutral-800); outline: none;
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 16px; height: 16px;
  border-radius: 50%; background: var(--color-accent); cursor: pointer;
}
input[type=range]::-moz-range-thumb {
  width: 16px; height: 16px; border: none;
  border-radius: 50%; background: var(--color-accent); cursor: pointer;
}
input[type=color] {
  -webkit-appearance: none; appearance: none;
  border: none; background: none; padding: 0; cursor: pointer;
}
input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
input[type=color]::-webkit-color-swatch {
  border: 1px solid var(--color-neutral-800); border-radius: var(--radius-md);
}
input[type=color]::-moz-color-swatch {
  border: 1px solid var(--color-neutral-800); border-radius: var(--radius-md);
}

/* ---- cards, tags, dialog ------------------------------------------------- */

.card {
  display: flex; flex-direction: column; gap: var(--space-2);
  padding: var(--space-3); border-radius: var(--radius-md); background: var(--color-surface);
}
.card-kicker { font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--color-accent); }
.card-title {
  font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  font-size: 17px; line-height: 1.2;
}
.card-body { margin: 0; font-size: 13px; opacity: 0.8; flex: 1; }
.elev-sm { box-shadow: var(--shadow-sm); }
.elev-md { box-shadow: var(--shadow-md); }
.elev-lg { box-shadow: var(--shadow-lg); }

.tag {
  display: inline-flex; align-items: center; font-size: 11px;
  letter-spacing: 0.02em; padding: 3px 10px;
  border-radius: calc(var(--radius-md) * 0.75);
}
.tag-accent { background: var(--color-accent-800); color: var(--color-accent-100); }
.tag-neutral { background: var(--color-neutral-800); color: var(--color-neutral-100); }
.tag-outline { border: 1px solid var(--color-accent); color: var(--color-accent); }

.dialog-backdrop {
  position: fixed; inset: 0; display: grid; place-items: center;
  padding: var(--space-4); z-index: 60;
  background: color-mix(in srgb, var(--color-neutral-900) 70%, transparent);
}
.dialog {
  width: min(440px, 100%); display: flex; flex-direction: column; gap: var(--space-3);
  padding: var(--space-4); border-radius: var(--radius-lg);
  background: var(--color-surface); box-shadow: var(--shadow-lg);
  max-height: 90vh; overflow-y: auto;
}
.dialog-title {
  font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  font-size: 20px;
}
.dialog-actions { display: flex; justify-content: flex-end; gap: var(--space-2); margin-top: var(--space-2); }

/* ==========================================================================
   APP — built from the tokens above.
   ========================================================================== */

/* ---- layout -------------------------------------------------------------- */

.shell { max-width: 1180px; margin: 0 auto; padding: 28px 24px 64px; }
.shell.narrow { max-width: 620px; }

.topbar {
  display: flex; align-items: center; gap: 14px;
  max-width: 1180px; margin: 0 auto; padding: 18px 24px 0;
}
.brandmark {
  font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  font-size: 15px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--color-neutral-400);
}
.brandmark b { color: var(--color-accent); font-weight: var(--font-heading-weight); }
.topbar .spacer { flex: 1; }

/* The one surface every screen is built on. */
.surface {
  background: var(--color-surface); box-shadow: var(--shadow-sm);
  border-radius: var(--radius-lg); padding: 24px;
  display: flex; flex-direction: column; gap: 22px;
}
.surface + .surface { margin-top: 20px; }

.kicker {
  font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--color-neutral-600);
}
.note { font-size: 12px; color: var(--color-neutral-500); }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }

/* A section head: label, a rule that fades at both ends, then a status note. */
.section-head { display: flex; align-items: center; gap: 12px; }
.rule-fade {
  flex: 1; height: 1px;
  background: linear-gradient(90deg,
    transparent, var(--color-neutral-800) 48px,
    var(--color-neutral-800) calc(100% - 48px), transparent);
}

/* ---- connection dot ------------------------------------------------------ */

.blip {
  width: 7px; height: 7px; border-radius: 50%; flex: none;
  background: var(--color-neutral-600);
}
.blip.is-live { background: var(--color-accent); animation: blip 2.6s ease-in-out infinite; }
.blip.is-down { background: var(--color-bad); }
@keyframes blip { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
@media (prefers-reduced-motion: reduce) {
  .blip.is-live { animation: none; }
}

.conn { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--color-neutral-500); }

/* ---- LED art ------------------------------------------------------------- */
/* Frames are painted onto a 26x26 canvas — 8 pixels of 2px on a 3px pitch,
   inset 2px — so a preview reads as a physical panel rather than a swatch.
   `pixelated` keeps the pixel edges hard at any display size. */
.art {
  display: block; width: 100%; aspect-ratio: 1 / 1;
  image-rendering: pixelated;
  border-radius: var(--radius-sm);
  background: var(--led-substrate);
}

/* ---- console header ------------------------------------------------------ */

.console-head {
  display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
  padding-bottom: 18px; border-bottom: 1px solid var(--color-neutral-800);
}
.room-id { display: flex; flex-direction: column; gap: 3px; min-width: 170px; }
.room-name {
  font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  font-size: 21px; letter-spacing: -0.01em;
}
.room-status {
  display: flex; align-items: center; gap: 7px;
  font-size: 12px; color: var(--color-neutral-500); font-variant-numeric: tabular-nums;
}
.wall-now { flex: 1; display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.wall-now-value { font-size: 14px; font-weight: 500; }

.blackout-btn {
  background: transparent; color: var(--color-neutral-300);
  border: 1px solid var(--color-neutral-700); border-radius: var(--radius-md);
  padding: 14px 20px; font-size: 12px; font-weight: 500;
  letter-spacing: 0.14em; text-transform: uppercase; cursor: pointer;
}
.blackout-btn:hover { border-color: var(--color-accent); color: var(--color-text); }
.blackout-btn.is-on {
  background: color-mix(in srgb, var(--color-accent) 22%, transparent);
  color: var(--color-accent-100); border-color: var(--color-accent);
}

/* ---- mode tabs ----------------------------------------------------------- */
/* The active tab merges into the panel below it by painting its own bottom
   border in the panel's colour and overlapping it by a pixel. */

.tabs-row { display: flex; align-items: flex-end; gap: 14px; }
.tabs { display: flex; gap: 4px; flex-shrink: 0; flex-wrap: wrap; }
.tab {
  display: flex; flex-direction: column; gap: 2px;
  background: transparent; border: 1px solid transparent;
  border-bottom-color: var(--color-neutral-800);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  padding: 10px 14px 12px; margin-bottom: -1px;
  cursor: pointer; text-align: left; white-space: nowrap;
}
.tab-label { font-size: 14px; font-weight: 500; color: var(--color-neutral-500); }
.tab-hint { font-size: 11px; color: var(--color-neutral-500); }
.tab:hover .tab-label { color: var(--color-neutral-300); }
.tab.is-on {
  background: var(--color-neutral-900);
  border-color: var(--color-neutral-800);
  border-bottom-color: var(--color-neutral-900);
}
.tab.is-on .tab-label { color: var(--color-text); }
.tab.is-on .tab-hint { color: var(--color-accent-300); }

.tabs-scores {
  flex: 1; min-width: 0; display: flex; gap: 14px; flex-wrap: wrap;
  justify-content: flex-end; padding-bottom: 12px; overflow: hidden;
}
.mini-score { display: flex; align-items: center; gap: 7px; }
.mini-score .swatch { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.mini-score .name { font-size: 12px; color: var(--color-neutral-400); }
.mini-score .value { font-size: 14px; font-weight: 500; font-variant-numeric: tabular-nums; }

.tabpanel {
  background: var(--color-neutral-900);
  border: 1px solid var(--color-neutral-800);
  border-radius: 0 var(--radius-md) var(--radius-md) var(--radius-md);
  padding: 18px;
}

/* ---- sprite pickers ------------------------------------------------------ */

.sprite-grid {
  display: grid; gap: 7px; align-content: start;
  grid-template-columns: repeat(auto-fill, minmax(46px, 1fr));
  max-height: 172px; overflow-y: auto;
}
.sprite-grid.dense {
  grid-template-columns: repeat(auto-fill, minmax(34px, 1fr));
  gap: 6px; max-height: 78px;
}
.sprite-opt {
  aspect-ratio: 1; background: none; padding: 5px; cursor: pointer;
  border: 1px solid var(--color-neutral-800); border-radius: var(--radius-md);
}
.sprite-opt:hover { border-color: var(--color-accent); }
.sprite-opt.is-on { border-color: var(--color-accent); }
.sprite-grid.dense .sprite-opt { padding: 3px; border-radius: var(--radius-sm); }

/* ---- chips (animations, orientations, presets) --------------------------- */

.chip {
  background: none; border: 1px solid var(--color-neutral-800);
  color: var(--color-neutral-300); border-radius: var(--radius-md);
  padding: 10px 12px; font-size: 13px; cursor: pointer;
  font-variant-numeric: tabular-nums;
}
.chip:hover { border-color: var(--color-accent); color: var(--color-text); }
.chip.is-on {
  background: color-mix(in srgb, var(--color-accent) 16%, transparent);
  border-color: var(--color-accent); color: var(--color-text);
}
.chip-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.chip-row { display: flex; gap: 6px; }
.chip-row .chip { flex: 1; padding: 9px 0; }

/* ---- countdown ----------------------------------------------------------- */

.clock-face {
  font-family: var(--font-heading); font-size: 52px; font-weight: 500;
  line-height: 0.95; letter-spacing: -0.03em; font-variant-numeric: tabular-nums;
}

/* ---- teams --------------------------------------------------------------- */

.team-grid { display: flex; gap: 8px; flex-wrap: wrap; }
.team-card {
  flex: 1; min-width: 190px; display: flex; align-items: center; gap: 10px;
  background: var(--color-surface); border: 1px solid var(--color-neutral-800);
  border-left: 3px solid var(--color-neutral-700);
  border-radius: var(--radius-md); padding: 11px 12px;
}
.team-card .who { display: flex; flex-direction: column; gap: 1px; flex: 1; min-width: 0; }
.team-card .name { font-size: 14px; font-weight: 500; text-transform: capitalize; }
.team-card .members { font-size: 11px; color: var(--color-neutral-500); }
.team-card .value {
  font-family: var(--font-heading); font-size: 22px; font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.team-card .nudge { display: flex; flex-direction: column; gap: 4px; }
.nudge button {
  width: 26px; height: 22px; background: none; cursor: pointer;
  border: 1px solid var(--color-neutral-800); color: var(--color-neutral-300);
  border-radius: var(--radius-sm); font-size: 13px; line-height: 1;
}
.nudge button:hover { border-color: var(--color-accent); color: var(--color-text); }

.winner-bar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--color-surface); border: 1px solid var(--color-neutral-800);
  border-radius: var(--radius-md); padding: 10px 12px;
}
.winner-bar .lead { display: flex; flex-direction: column; gap: 1px; width: 160px; }
.winner-bar .lead-name { font-size: 13px; font-weight: 500; }
.cap { text-transform: capitalize; }
.winner-art { width: 38px; height: 38px; flex-shrink: 0; }

/* ---- the room grid ------------------------------------------------------- */

.room-grid {
  display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
}
.room-tile {
  display: flex; flex-direction: column; gap: 8px; text-align: left;
  background: var(--color-neutral-900); border: 1px solid var(--color-neutral-800);
  border-top: 3px solid var(--color-neutral-800);
  border-radius: var(--radius-md); padding: 10px 9px; cursor: pointer;
}
.room-tile:hover { border-color: var(--color-accent); }
.room-tile.is-offline { opacity: 0.45; }
.room-tile .who { display: flex; align-items: center; gap: 6px; }
.room-tile .name {
  flex: 1; min-width: 0; font-size: 13px; color: var(--color-neutral-200);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.avatar {
  width: 19px; height: 19px; border-radius: 50%; flex-shrink: 0;
  background: var(--color-accent); color: var(--color-bg);
  font-size: 10px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}
.avatar.lg { width: 38px; height: 38px; font-size: 16px; }

/* ---- player view --------------------------------------------------------- */

.player-head {
  display: flex; align-items: center; gap: 11px; flex-wrap: wrap;
  padding-bottom: 16px; border-bottom: 1px solid var(--color-neutral-800);
}
.player-name { font-family: var(--font-heading); font-size: 18px; font-weight: 500; }
.team-pill {
  display: flex; align-items: center; gap: 7px;
  border: 1px solid var(--color-neutral-800); border-radius: 999px; padding: 5px 12px;
}
.team-pill .swatch { width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--color-neutral-600); }
.team-pill .name { font-size: 12px; color: var(--color-neutral-200); text-transform: capitalize; }
/* The pill doubles as the team picker — it looks like a badge and behaves like
   a select, so the player's team isn't a separate form row. */
.team-pill select {
  border: none; background: none; padding: 0 2px 0 0; cursor: pointer;
  font: inherit; font-size: 12px; color: var(--color-neutral-200); text-transform: capitalize;
}
.team-pill:hover { border-color: var(--color-accent); }

.player-body { display: flex; gap: 22px; align-items: flex-start; flex-wrap: wrap; }
/* The side column holds the panel itself and its two physical settings — it is
   a fixed 300px so the sprite pool beside it gets every spare pixel. */
.player-side { flex: 0 1 300px; min-width: 260px; display: flex; flex-direction: column; gap: 18px; }
.player-main { flex: 2 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }

.stage {
  background: var(--color-neutral-900); border: 1px solid var(--color-neutral-800);
  border-radius: var(--radius-lg); padding: 20px;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
}
.stage-art { width: 200px; max-width: 100%; transition: transform 0.2s; }
.stage-status { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--color-neutral-500); }

.slider-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.slider-value { font-size: 12px; font-variant-numeric: tabular-nums; }

.orient-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; }
.orient {
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  padding: 10px 0 8px;
}
/* A little panel with a thick top edge — turn it and you can see which way up
   the tile will be. */
.orient .glyph {
  width: 22px; height: 22px; border: 1px solid currentColor;
  border-top-width: 5px; border-radius: 3px;
}
.orient .label { font-size: 11px; font-variant-numeric: tabular-nums; }

/* ---- the 8x8 drawing pad -------------------------------------------------- */

.pad-row { display: flex; gap: 14px; flex-wrap: wrap; }
.pad {
  width: 190px; height: 190px; display: grid;
  grid-template-columns: repeat(8, 1fr); grid-template-rows: repeat(8, 1fr);
  gap: 3px; padding: 7px; touch-action: none;
  background: var(--led-substrate);
  border: 1px solid var(--color-neutral-800); border-radius: var(--radius-md);
}
.pad-cell { background: var(--led-unlit); border-radius: 1px; cursor: crosshair; }
.pad-side { flex: 1; min-width: 170px; display: flex; flex-direction: column; gap: 8px; }
/* Where each page hangs its own name/save controls on the shared pad. */
.pad-extra { display: flex; flex-direction: column; gap: 8px; }
.pad-extra .btn-block { margin-top: 0; }
.swatch-row { display: flex; gap: 5px; flex-wrap: wrap; }
.swatch-btn {
  width: 22px; height: 22px; padding: 0; cursor: pointer;
  border: 1px solid var(--color-neutral-800); border-radius: var(--radius-sm);
}
.swatch-btn.is-on { border-color: var(--color-text); }
.swatch-btn.erase {
  background: repeating-linear-gradient(45deg,
    var(--color-neutral-800), var(--color-neutral-800) 4px,
    var(--color-neutral-900) 4px, var(--color-neutral-900) 8px);
}

/* ---- standings ----------------------------------------------------------- */

.standings { display: flex; flex-direction: column; gap: 8px; padding-top: 16px; border-top: 1px solid var(--color-neutral-800); }
.standing { display: flex; align-items: center; gap: 10px; }
.standing .swatch { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.standing .name { flex: 1; font-size: 13px; color: var(--color-neutral-300); text-transform: capitalize; }
.standing .value { font-size: 14px; font-weight: 500; font-variant-numeric: tabular-nums; }

/* ---- claim flow ---------------------------------------------------------- */

.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 12px; }
.pick {
  display: flex; flex-direction: column; gap: 8px; text-align: center; cursor: pointer;
  background: var(--color-neutral-900); border: 1px solid var(--color-neutral-800);
  border-radius: var(--radius-md); padding: 10px;
}
.pick:hover { border-color: var(--color-accent); }
.pick.is-on { border-color: var(--color-accent); box-shadow: 0 0 0 1px var(--color-accent); }
/* A hint, not an action — the sprite above it is what actually identifies the
   panel, so this stays quiet enough not to compete with it. */
.pick-hint { font-size: 11px; padding: 2px; align-self: center; }

.steps { display: flex; align-items: center; gap: 8px; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--color-neutral-600); }
.step.is-on { color: var(--color-accent); }

/* ---- login page ---------------------------------------------------------- */

.login { max-width: 400px; margin: 14vh auto; padding: 0 24px; text-align: center; }
.login .logo {
  font-family: var(--font-heading); font-size: 30px; font-weight: 500;
  letter-spacing: 0.06em; color: var(--color-accent);
}
.login .tag-line { color: var(--color-neutral-500); margin: 6px 0 30px; font-size: 14px; }
.login .actions { display: flex; flex-direction: column; gap: 10px; }
.login .actions .btn { width: 100%; padding: 13px 16px; font-size: 15px; }
.btn-discord {
  background: #5865f2; color: #fff; border-color: #5865f2;
}
.btn-discord:hover:not(:disabled) { background: #6b78f5; border-color: #6b78f5; }
.login .op { margin-top: 30px; }
.login .op a { color: var(--color-neutral-500); font-size: 13px; }
.login .op a:hover { color: var(--color-text); }

/* ---- toast --------------------------------------------------------------- */

.toast {
  position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%);
  background: var(--color-surface); color: var(--color-text);
  border: 1px solid var(--color-neutral-700); box-shadow: var(--shadow-md);
  padding: 10px 16px; border-radius: var(--radius-md);
  font-size: 14px; opacity: 0; transition: opacity 0.2s;
  pointer-events: none; z-index: 100;
}
.toast.show { opacity: 1; }
.toast.err { border-color: var(--color-bad); color: #ffb3bd; }

/* ---- narrow screens ------------------------------------------------------ */

@media (max-width: 720px) {
  .shell { padding: 20px 14px 48px; }
  .topbar { padding: 14px 14px 0; }
  .surface { padding: 16px; gap: 18px; }
  .tabs-row { flex-direction: column; align-items: stretch; }
  .tabs-scores { justify-content: flex-start; padding-bottom: 0; }
  .tabpanel { border-radius: var(--radius-md); }
  .clock-face { font-size: 40px; }
  .player-side { width: auto; }
}
