@font-face { font-family: "Chakra Petch"; font-weight: 500; font-display: swap; src: url("fonts/chakra-petch-500.woff2") format("woff2"); }
@font-face { font-family: "Chakra Petch"; font-weight: 600; font-display: swap; src: url("fonts/chakra-petch-600.woff2") format("woff2"); }
@font-face { font-family: "Chakra Petch"; font-weight: 700; font-display: swap; src: url("fonts/chakra-petch-700.woff2") format("woff2"); }
/* UI face: squared terminals that sit with Chakra Petch, open enough to read at 13px. */
@font-face { font-family: "Saira"; font-weight: 100 900; font-stretch: 87.5% 100%; font-display: swap; src: url("fonts/saira.woff2") format("woff2"); }
/* Data face: a narrow HUD mono for rates and counts. The single stretch value
   pins every use to the narrow cut; size-adjust matches the UI face's figures. */
@font-face { font-family: "Martian Mono"; font-weight: 100 800; font-stretch: 87.5%; size-adjust: 90%; font-display: swap; src: url("fonts/martian-mono.woff2") format("woff2"); }

:root {
  color-scheme: dark;
  --bg: #0b0d10;
  --surface: #12151a;
  --surface-2: #191d24;
  --line: #232a33;
  --line-strong: #353f4c;
  --text: #e8edf2;
  --muted: #8d98a7;
  /* Brand yellow is identity and the active selection; cyan scans (you, info,
     wins); red flags hostiles (losses, danger). */
  --brand: #f4e34f;
  --brand-ink: #14130a;
  --brand-text: #f4e34f;
  --scan: #4cf0e6;
  --scan-ink: #04201f;
  --wordmark-fg: #f4e34f;
  --wordmark-bg: transparent;
  --wordmark-pad: 0;
  --hostile: #ff5757;
  --info: var(--scan);
  --win: var(--scan);
  --loss: var(--hostile);
  --warn: #f2c14e;
  --danger: var(--hostile);
  --up: var(--scan);
  --down: var(--hostile);
  --focus: #f4e34f;
  --radius: 0;
  --cut: 7px;
  /* The game's four colors, bright enough to carry dark text. */
  --game-red: #e0484d;
  --game-blue: #3398e0;
  --game-green: #3cb46e;
  --game-yellow: #f2c230;
  --mono: "Martian Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --sans: "Saira", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  /* The simulator's own display face, bundled locally. */
  --display: "Chakra Petch", var(--sans);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.45;
  background: var(--bg);
  color: var(--text);
}

/* Light: the same world on bright glass. Yellow stays a fill (it has no
   contrast as text on white), so the wordmark and selection use it as a
   highlight block and --brand-text carries yellow meaning in type. */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: #eef1f4;
    --surface: #ffffff;
    --surface-2: #e5e9ee;
    --line: #d4dae1;
    --line-strong: #b7c0cb;
    --text: #11151a;
    --muted: #55606e;
    --brand: #f4e34f;
    --brand-ink: #14130a;
    --brand-text: #766500;
    --scan: #00808a;
    --scan-ink: #ffffff;
    --hostile: #cf2e2e;
    --warn: #8a6400;
    --focus: #11151a;
    --wordmark-fg: #11151a;
    --wordmark-bg: #f4e34f;
    --wordmark-pad: 0 5px;
  }
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #eef1f4;
  --surface: #ffffff;
  --surface-2: #e5e9ee;
  --line: #d4dae1;
  --line-strong: #b7c0cb;
  --text: #11151a;
  --muted: #55606e;
  --brand: #f4e34f;
  --brand-ink: #14130a;
  --brand-text: #766500;
  --scan: #00808a;
  --scan-ink: #ffffff;
  --hostile: #cf2e2e;
  --warn: #8a6400;
  --focus: #11151a;
  --wordmark-fg: #11151a;
  --wordmark-bg: #f4e34f;
  --wordmark-pad: 0 5px;
}
:root[data-theme="dark"] { color-scheme: dark; }

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  min-height: 100vh;
  font-family: var(--sans);
  accent-color: var(--scan);
  caret-color: var(--scan);
  scrollbar-color: var(--line-strong) var(--bg);
}
::selection { background: color-mix(in srgb, var(--brand) 38%, transparent); color: var(--text); }

a { color: inherit; }
h1, h2, h3, p { margin-top: 0; }
h1, h2 { font-family: var(--display); letter-spacing: 0; }
h2 { font-size: 18px; font-weight: 600; margin-bottom: 2px; }
h3 { font-size: 13px; font-weight: 600; color: var(--muted); margin: 20px 0 8px; }
code, .mono { font-family: var(--mono); font-size: 12px; }
small { font-size: 12px; }

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: 3px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  background: var(--brand);
  color: var(--brand-ink);
  padding: 8px 12px;
  z-index: 10;
}
.skip-link:focus { left: 8px; }

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ── Masthead & navigation ─────────────────────────────────── */

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.masthead__brand { display: flex; align-items: center; gap: 12px; }
.masthead__mark {
  width: 44px;
  height: 44px;
  image-rendering: pixelated;
  border-radius: 10px;
}
.wordmark {
  margin: 0;
  font-family: var(--display);
  font-size: 21px;
  font-weight: 700;
  line-height: 1;
  color: var(--text);
}
.wordmark span { color: var(--wordmark-fg); background: var(--wordmark-bg); padding: var(--wordmark-pad); }
.masthead__tag { margin: 0; color: var(--muted); font-size: 12px; }

.capture-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}
.capture-indicator::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--line-strong); }
.capture-indicator[data-state="capturing"] { color: var(--up); }
.capture-indicator[data-state="capturing"]::before { background: var(--up); }
.capture-indicator[data-state="error"],
.capture-indicator[data-state="paused"] { color: var(--danger); }

#app { padding: 0 24px 64px; max-width: 1480px; margin: 0 auto; }

.tabs {
  display: flex;
  gap: 2px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  margin: 0 -24px;
  padding: 0 24px;
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 3;
}
.tabs__tab {
  padding: 12px 14px 10px;
  text-decoration: none;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  font-weight: 600;
}
.tabs__tab:hover { color: var(--text); }
.tabs__tab--active { color: var(--text); border-bottom-color: var(--brand-text); }

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: flex-end;
  padding: 14px 0 6px;
}
.filter { display: grid; gap: 4px; font-size: 12px; color: var(--muted); }
.filter select, .filter input { min-width: 120px; max-width: 240px; }
.filter-summary { color: var(--muted); font-size: 12px; margin: 0 0 16px; }

/* Mode: a checklist in a disclosure, closed it looks like the other dropdowns. */
.mode-filter { position: relative; display: block; padding: 0; margin: 0; border: 0; background: none; }
.mode-filter > summary { display: grid; gap: 4px; margin: 0; list-style: none; cursor: pointer; font-weight: 400; color: var(--muted); }
.mode-filter > summary::-webkit-details-marker { display: none; }
.mode-filter__value {
  min-width: 170px; max-width: 240px; padding: 7px 34px 7px 12px;
  font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background-color: var(--surface-2);
  background-image: linear-gradient(45deg, transparent 50%, var(--scan) 50%), linear-gradient(135deg, var(--scan) 50%, transparent 50%);
  background-repeat: no-repeat; background-size: 5px 5px, 5px 5px;
  background-position: calc(100% - 17px) 55%, calc(100% - 12px) 55%;
  clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, var(--cut) 100%, 0 calc(100% - var(--cut)));
  transition: background-color 120ms ease-out;
}
.mode-filter > summary:hover .mode-filter__value { background-color: var(--line); }
.mode-filter > summary:focus-visible { outline: none; }
.mode-filter > summary:focus-visible .mode-filter__value { box-shadow: inset 0 -2px 0 var(--scan); }
.mode-filter__menu {
  position: absolute; top: calc(100% + 4px); left: 0; z-index: 20; min-width: 230px;
  display: grid; gap: 2px; padding: 8px 0;
  background: var(--surface); border: 1px solid var(--line-strong); box-shadow: 0 14px 36px rgb(0 0 0 / 0.4);
}
.mode-filter__shortcuts { display: flex; gap: 6px; white-space: nowrap; padding: 0 10px 6px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.mode-filter__option { padding: 5px 14px; font-size: 14px; color: var(--text); cursor: pointer; white-space: nowrap; }
.mode-filter__option input { min-width: 0; width: auto; margin: 0; accent-color: var(--scan); }
.mode-filter__option:hover { background: color-mix(in srgb, var(--scan) 12%, var(--surface)); }
.mode-filter__divider { margin: 6px 0 0; padding: 6px 14px 2px; border-top: 1px solid var(--line); font: 600 10px var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }

/* Opponent matchups: presets expand into the same three-slot editor as custom trios. */
.legend-filter__value { min-width: 190px; max-width: 300px; }
.legend-filter[open] > summary .mode-filter__value { box-shadow: inset 0 -2px 0 var(--scan); }
.legend-filter__menu {
  width: min(460px, calc(100vw - 32px)); max-height: min(640px, calc(100vh - 110px)); padding: 0; z-index: 30;
  grid-template-rows: auto minmax(0, 1fr) auto; overflow: hidden;
}
.legend-filter__head { display: grid; gap: 2px; padding: 14px 16px 10px; border-bottom: 1px solid var(--line); }
.legend-filter__head strong { font: 600 15px var(--display); color: var(--text); }
.legend-filter__head small { color: var(--muted); line-height: 1.35; }
.legend-filter__search { width: calc(100% - 24px); max-width: none; margin: 10px 12px 0; }
.legend-filter__groups { min-height: 0; overflow-y: auto; padding: 4px 0; overscroll-behavior: contain; scrollbar-color: var(--line-strong) var(--surface); }
.legend-filter__group { border-bottom: 1px solid var(--line); }
.legend-filter__group:last-child { border-bottom: 0; }
.legend-filter__group > summary {
  display: grid; grid-template-columns: 9px 1fr auto; align-items: center; gap: 9px;
  padding: 8px 14px; list-style: none; cursor: pointer; color: var(--text); font-weight: 600;
}
.legend-filter__group > summary::-webkit-details-marker { display: none; }
.legend-filter__group > summary:hover { background: color-mix(in srgb, var(--scan) 8%, var(--surface)); }
.legend-filter__group > summary small { color: var(--muted); font: 500 11px var(--mono); }
.legend-filter__options { display: grid; padding: 0 0 5px; }
.legend-filter__option {
  display: grid; grid-template-columns: 16px 8px minmax(0, 1fr) auto; align-items: center; gap: 9px;
  min-height: 34px; padding: 5px 14px 5px 20px; color: var(--text); cursor: pointer;
}
.legend-filter__legend {
  width: 100%; grid-template-columns: 8px minmax(0, 1fr) auto; border: 0; text-align: left;
  font: inherit; background: transparent;
}
.legend-filter__option:hover { background: color-mix(in srgb, var(--scan) 10%, var(--surface)); }
.legend-filter__option.is-selected { background: color-mix(in srgb, var(--brand) 9%, var(--surface)); }
.legend-filter__option[hidden], .legend-filter__group[hidden] { display: none; }
.legend-filter__option input { width: 14px; min-width: 0; height: 14px; margin: 0; accent-color: var(--scan); }
.legend-filter__option input:disabled { opacity: 0.35; cursor: not-allowed; }
.legend-filter__swatch { width: 8px; height: 14px; background: var(--line-strong); }
.legend-filter__swatch--red { background: var(--game-red); }
.legend-filter__swatch--blue { background: var(--game-blue); }
.legend-filter__swatch--green { background: var(--game-green); }
.legend-filter__swatch--yellow { background: var(--game-yellow); }
.legend-filter__name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.legend-filter__set { max-width: 16ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.legend-filter__empty { margin: 0; padding: 18px 14px; color: var(--muted); }
.legend-filter__flex { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.legend-filter__flex > span { margin-right: 3px; color: var(--muted); font-size: 12px; }
.legend-filter__color {
  position: relative; border: 0; padding: 5px 8px 7px; color: var(--text); background: var(--surface); cursor: pointer;
  clip-path: polygon(0 0, calc(100% - 4px) 0, 100% 4px, 100% 100%, 4px 100%, 0 calc(100% - 4px));
}
.legend-filter__color::after { content: ""; position: absolute; inset: auto 0 0; height: 3px; background: var(--line-strong); }
.legend-filter__color--red::after { background: var(--game-red); }
.legend-filter__color--blue::after { background: var(--game-blue); }
.legend-filter__color--green::after { background: var(--game-green); }
.legend-filter__color--yellow::after { background: var(--game-yellow); }
.legend-filter__color:hover { background: var(--surface-2); }
.legend-filter__color.is-selected { color: var(--brand-ink); background: var(--brand); font-weight: 700; }
.legend-filter__color:disabled { opacity: 0.35; cursor: not-allowed; }
.legend-filter__actions { display: flex; justify-content: flex-end; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line-strong); background: var(--surface); }
.opponent-field-filter__menu {
  width: min(680px, calc(100vw - 32px));
  grid-template-rows: auto auto minmax(0, 1fr) auto;
}
.opponent-field-filter__toolbar { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.opponent-field-filter__toolbar .legend-filter__search { flex: 1; width: auto; margin: 0; }
.opponent-field-filter__list { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.opponent-field-filter__customs:empty { display: none; }
.opponent-field-filter__customs:not(:empty) { border-bottom: 1px solid var(--line-strong); }
.opponent-field-filter__clause { border-bottom: 1px solid var(--line); background: var(--surface); }
.opponent-field-filter__clause > summary {
  display: grid; grid-template-columns: 16px minmax(0, 1fr) auto 14px; align-items: center; gap: 9px;
  min-height: 40px; padding: 6px 12px; list-style: none; cursor: default;
}
.opponent-field-filter__clause > summary::-webkit-details-marker { display: none; }
.opponent-field-filter__clause > summary:hover { background: color-mix(in srgb, var(--scan) 8%, var(--surface)); }
.opponent-field-filter__clause.is-selected > summary { background: color-mix(in srgb, var(--scan) 9%, var(--surface)); }
.opponent-field-filter__clause.is-custom > summary { box-shadow: inset 3px 0 0 var(--brand); }
.opponent-field-filter__clause > summary input { width: 14px; min-width: 14px; height: 14px; margin: 0; accent-color: var(--scan); }
.opponent-field-filter__expand { display: grid; place-items: center; width: 24px; height: 24px; padding: 0; border: 0; color: var(--scan); font: 700 16px var(--mono); background: transparent; cursor: pointer; }
.opponent-field-filter__expand:hover, .opponent-field-filter__expand:focus-visible { color: var(--brand-ink); background: var(--brand); outline: none; }
.opponent-field-filter__clause-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.opponent-field-filter__clause > summary small { color: var(--muted); white-space: nowrap; }
.opponent-field-filter__clause-body { background: var(--surface-2); }
.opponent-field-filter__clause-body:empty { display: none; }
.opponent-field-filter__clause-body > .muted { margin: 0; padding: 10px 12px 0; font-size: 12px; }
.opponent-field-filter__clause-actions { display: flex; justify-content: flex-end; padding: 7px 10px; border-top: 1px solid var(--line); background: var(--surface-2); }
.opponent-field-filter__actions { align-items: center; justify-content: space-between; }
.opponent-field-filter__status { color: var(--muted); font-size: 12px; }
.legend-editor { display: grid; min-height: 0; }
.legend-editor__slots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--line); border-bottom: 1px solid var(--line); }
.legend-editor__slot { --slot-color: var(--line-strong); display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 2px; min-width: 0; padding-left: 8px; border-top: 2px solid var(--slot-color); background: var(--surface-2); }
.legend-editor__slot--red { --slot-color: var(--game-red); }
.legend-editor__slot--blue { --slot-color: var(--game-blue); }
.legend-editor__slot--green { --slot-color: var(--game-green); }
.legend-editor__slot--yellow { --slot-color: var(--game-yellow); }
.legend-editor__slot.is-active { box-shadow: inset 0 -3px 0 var(--scan); background: color-mix(in srgb, var(--scan) 8%, var(--surface-2)); }
.legend-editor__slot input { width: 14px; min-width: 14px; height: 14px; margin: 0; accent-color: var(--scan); }
.legend-editor__slot button { display: grid; grid-template-columns: 28px minmax(0, 1fr); align-items: center; gap: 8px; min-width: 0; padding: 6px 8px; border: 0; color: var(--text); text-align: left; background: transparent; cursor: pointer; }
.legend-editor__slot-art { width: 28px; height: 38px; object-fit: cover; object-position: center 18%; border: 1px solid color-mix(in srgb, var(--slot-color) 70%, var(--line)); clip-path: polygon(0 0, calc(100% - 4px) 0, 100% 4px, 100% 100%, 0 100%); }
.legend-editor__slot-mark { width: 28px; height: 30px; background: linear-gradient(135deg, color-mix(in srgb, var(--slot-color) 85%, white) 0 45%, var(--slot-color) 45% 100%); clip-path: polygon(0 0, calc(100% - 5px) 0, 100% 5px, 100% 100%, 5px 100%, 0 calc(100% - 5px)); }
.legend-editor__slot-copy { display: grid; gap: 2px; min-width: 0; }
.legend-editor__slot-copy small { color: var(--muted); font: 600 10px var(--mono); }
.legend-editor__slot-copy > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.legend-editor .legend-filter__groups { max-height: 230px; }
.opponent-field { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 18px; }
.opponent-field__summary { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; padding-bottom: 1px; }
.row-actions { display: flex; gap: 4px; }
@media (max-width: 720px) {
  .legend-filter__menu { position: fixed; inset: 86px 12px auto; width: auto; max-height: calc(100vh - 98px); }
  .legend-filter__set { display: none; }
  .opponent-field-filter__toolbar { align-items: stretch; flex-direction: column; }
  .legend-editor__slots { grid-template-columns: 1fr; }
  .legend-editor__slot { min-height: 48px; }
}

input, select, textarea {
  font: inherit;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  padding: 6px 8px;
}
textarea { resize: vertical; width: 100%; }
select[multiple] { padding: 4px; }

/* ── Layout ────────────────────────────────────────────────── */

.stack { display: grid; gap: 28px; }
.grid { display: grid; gap: 28px 40px; align-items: start; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1100px) {
  .grid--2, .grid--3 { grid-template-columns: minmax(0, 1fr); }
}
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.block { display: block; }
.muted { color: var(--muted); }
.link { color: var(--info); text-decoration: none; }
.link:hover { text-decoration: underline; }

/* Sections are separated by space and a hairline, not boxed. */
.panel {
  min-width: 0;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.panel__header { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 12px; }
.panel__subtitle { color: var(--muted); font-size: 12px; margin: 0; }
.panel__actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

.banner {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  padding: 10px 14px;
  border: 1px solid var(--info);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--info) 8%, transparent);
}
.pulse {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--up);
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: 0.3; } }

/* ── Stats ─────────────────────────────────────────────────── */

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 44px;
}
.stat { display: grid; gap: 1px; align-content: start; }
.stat__label { font-size: 12px; color: var(--muted); }
.stat__value { font-family: var(--display); font-size: 28px; font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat__detail { color: var(--muted); }
.stats--compact { gap: 12px 32px; }
.stats--compact .stat__value { font-size: 19px; }
.stats--compact { margin-bottom: 8px; }

.big-rate .rate { font-size: 20px; }
.big-rate .rate__bar, .big-rate .diff__bar { width: 100%; }

/* ── Tables ────────────────────────────────────────────────── */

.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-stretch: 94%; }
.data-table th {
  text-align: left;
  font: 600 12.5px/1.2 var(--display);
  color: var(--muted);
  padding: 10px 10px 8px;
  border-bottom: 1px solid var(--line-strong);
  white-space: nowrap;
  vertical-align: bottom;
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--bg);
}
.data-table th[aria-sort] { color: var(--text); }
.data-table th[aria-sort] .sort-caret { color: var(--scan); }
.data-table th .sort:hover { color: var(--text); }
.data-table td { padding: 8px 10px; border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent); vertical-align: middle; }
/* Every figure in a table reads in the data face, so columns line up and never mix faces. */
.data-table td.num { font-family: var(--mono); font-size: 13px; letter-spacing: -0.01em; }
/* The sorted column carries a faint scan band down its length. */
.data-table td.is-sorted { background: color-mix(in srgb, var(--scan) 4%, transparent); }
.data-table td > [class] { vertical-align: middle; }
.opponent-chip__name { font-weight: 500; }
.opponent-chip--deck .opponent-chip__name { font-weight: 650; }
.opponent-chip__meta { font-weight: 400; color: var(--muted); }
.data-table tbody tr:last-child td { border-bottom-color: var(--line-strong); }
.data-table .num { text-align: right; }
.data-table th.num { text-align: right; }
.data-table tr.clickable { cursor: pointer; }
.data-table tr.clickable:hover td, .data-table tr.clickable:focus-visible td { background: var(--surface-2); }
.data-table--dense td { padding: 3px 8px; }
.sort { all: unset; cursor: pointer; }
.sort:focus-visible { outline: 2px solid var(--focus); }
.selected { font-weight: 700; color: var(--brand-text); }
.pager { display: flex; gap: 12px; align-items: center; justify-content: flex-end; padding-top: 10px; color: var(--muted); }

/* ── Rates & intervals ─────────────────────────────────────── */

.rate { display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono); white-space: nowrap; }
.rate__value { min-width: 48px; text-align: right; }
.rate__n { color: var(--muted); min-width: 44px; text-align: left; }
.rate--empty { color: var(--muted); }
.rate__bar, .diff__bar {
  position: relative;
  display: inline-block;
  width: 88px;
  height: 10px;
  background: var(--surface-2);
  border-radius: 2px;
}
.rate__ci { position: absolute; top: 3px; height: 4px; background: color-mix(in srgb, var(--info) 45%, transparent); border-radius: 2px; }
.rate__point { position: absolute; top: 0; width: 2px; height: 10px; margin-left: -1px; background: var(--text); }
.rate__ref { position: absolute; top: -2px; width: 1px; height: 14px; background: var(--line-strong); }

.diff { display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono); white-space: nowrap; }
.diff__value { min-width: 56px; text-align: right; }
.diff__zero { position: absolute; left: 50%; top: -2px; width: 1px; height: 14px; background: var(--line-strong); }
.diff__ci { position: absolute; top: 3px; height: 4px; border-radius: 2px; background: color-mix(in srgb, var(--muted) 50%, transparent); }
.diff__point { position: absolute; top: 0; width: 2px; height: 10px; margin-left: -1px; background: var(--text); }
.diff--up .diff__ci { background: color-mix(in srgb, var(--up) 60%, transparent); }
.diff--down .diff__ci { background: color-mix(in srgb, var(--down) 60%, transparent); }

/* ── Badges & chips ────────────────────────────────────────── */

.badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  background: color-mix(in srgb, currentColor 13%, transparent);
  vertical-align: middle;
}
.badge:first-child { margin-left: 0; }
.badge--win { color: var(--win); }
.badge--loss { color: var(--loss); }
.badge--info { color: var(--info); }
.badge--warn { color: var(--warn); }

.chips { display: inline-flex; flex-wrap: wrap; gap: 4px 12px; }
.chips--large .chip { font-size: 13px; padding: 4px 10px; }
.chip {
  font-size: 12px;
  padding: 1px 6px;
  border-radius: 3px;
  background: var(--surface-2);
}
.chip--in { color: var(--win); background: color-mix(in srgb, var(--win) 12%, transparent); }
.chip--out { color: var(--loss); background: color-mix(in srgb, var(--loss) 12%, transparent); }

/* ── Buttons & forms ───────────────────────────────────────── */

.button {
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  border-radius: 4px;
  padding: 7px 14px;
  border: 1px solid var(--brand);
  background: var(--brand);
  color: var(--brand-ink);
  text-decoration: none;
  display: inline-block;
}
.button:hover { filter: brightness(1.08); }
.button:disabled { opacity: 0.5; cursor: not-allowed; }
.button--ghost { background: transparent; color: var(--text); border-color: var(--line-strong); }
.button--danger { background: transparent; color: var(--danger); border-color: var(--danger); }
.button--small { padding: 3px 9px; font-size: 12px; }
.pager button { font: inherit; background: transparent; color: var(--text); border: 1px solid var(--line-strong); border-radius: 4px; padding: 4px 10px; cursor: pointer; }

.form { display: grid; gap: 12px; }
.form label { display: grid; gap: 4px; font-weight: 600; font-size: 12px; }
.form fieldset { border: 1px solid var(--line); border-radius: 4px; padding: 8px 12px; }
.form legend { font-size: 12px; color: var(--muted); }
.check { display: flex !important; flex-direction: row; gap: 8px; align-items: center; font-weight: 400 !important; }

.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.toolbar label { display: grid; gap: 4px; font-size: 12px; color: var(--muted); }
.toolbar select { max-width: 420px; }
.vs { color: var(--muted); padding-bottom: 8px; }

.danger-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }

/* ── Notes ─────────────────────────────────────────────────── */

.note { font-size: 12px; color: var(--muted); margin: 8px 0 0; max-width: 90ch; }
.note--warn { color: var(--warn); }
.caution { font-size: 12px; color: var(--muted); margin: 0; max-width: 100ch; }
.empty { padding: 28px; text-align: center; color: var(--muted); display: grid; gap: 8px; justify-items: center; }
.empty p { color: var(--text); margin: 0; font-weight: 600; }
.loading { padding: 40px 0; }

.list { margin: 0; padding-left: 18px; }
.list li { margin: 2px 0; }
.list--links { columns: 2; }
.steps li { margin-bottom: 8px; }
details summary { cursor: pointer; font-weight: 600; margin: 6px 0; }

/* ── Form strip, timeline, blocks ──────────────────────────── */

.form-strip { display: flex; flex-wrap: wrap; gap: 4px; list-style: none; padding: 0; margin: 0 0 12px; }
.form-strip__item {
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 3px;
  font: 700 12px var(--mono);
  cursor: pointer;
  color: #06121f;
}
.form-strip__item--win { background: var(--win); }
.form-strip__item--loss { background: var(--loss); }

.timeline { list-style: none; margin: 0; padding: 0; max-height: 640px; overflow-y: auto; }
.timeline__turn { margin: 12px 0 4px; }
.timeline ul { list-style: none; padding: 0; margin: 0; }
.timeline__event { padding: 3px 0 3px 10px; border-left: 2px solid var(--line); font-size: 13px; }
.timeline__event--self { border-left-color: var(--win); }
.timeline__event--opponent { border-left-color: var(--loss); }
.timeline__actor { display: inline-block; min-width: 46px; font: 600 11px var(--mono); color: var(--muted); text-transform: uppercase; }

.blocks { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 8px 0; }
.blocks__slot { display: grid; justify-items: center; min-width: 56px; padding: 6px 8px; border: 1px solid var(--line-strong); border-radius: 4px; font-family: var(--mono); }
.blocks__slot span { font-size: 16px; font-weight: 700; }
.blocks__slot small { color: var(--muted); }
.blocks__slot--completed { border-color: var(--up); }
.blocks__slot--mismatch { border-color: var(--warn); }
.blocks__slot--planned { border-style: dashed; }
.next-up { font-size: 14px; }

/* ── Charts ────────────────────────────────────────────────── */

.figure { margin: 8px 0 0; }
.chart { width: 100%; height: auto; display: block; }
.chart__grid { stroke: var(--line); stroke-width: 1; }
.chart__reference { stroke: var(--line-strong); stroke-dasharray: 4 4; }
.chart__tick, .chart__axis { fill: var(--muted); font: 11px var(--mono); }
.chart__line { fill: none; stroke: var(--info); stroke-width: 2; }
.chart__band { fill: color-mix(in srgb, var(--info) 16%, transparent); }
.chart__dot { fill: var(--info); }
.chart__series--1 .chart__line { stroke: var(--brand-text); }
.chart__series--1 .chart__dot { fill: var(--brand-text); }
.chart__series--1 .chart__band { fill: color-mix(in srgb, var(--brand) 16%, transparent); }
.chart__bar { fill: color-mix(in srgb, var(--info) 70%, transparent); }
.legend { display: flex; gap: 16px; font-size: 12px; color: var(--muted); }
.legend__item::before { content: ""; display: inline-block; width: 12px; height: 3px; margin-right: 6px; vertical-align: middle; background: var(--info); }
.legend__item--1::before { background: var(--brand-text); }

/* ── Dialogs & toasts ──────────────────────────────────────── */

.modal {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  padding: 20px;
  width: min(480px, calc(100vw - 32px));
}
.modal::backdrop { background: rgb(0 0 0 / 0.55); }
.modal__actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }

.toasts { position: fixed; bottom: 16px; right: 16px; display: grid; gap: 8px; z-index: 20; }
.toast { background: var(--surface-2); border: 1px solid color-mix(in srgb, var(--info) 55%, var(--line-strong)); padding: 10px 14px; border-radius: 4px; max-width: 420px; }
.toast--warn { border-color: color-mix(in srgb, var(--warn) 60%, var(--line-strong)); }
.toast--error { border-color: color-mix(in srgb, var(--danger) 60%, var(--line-strong)); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

@media (max-width: 720px) {
  #app { padding: 0 12px 48px; }
  .tabs { margin: 0 -12px; padding: 0 12px; }
  .masthead { padding: 12px; }
  .list--links { columns: 1; }
}

.data-table td:first-child { min-width: 170px; }

.card-ref { border-bottom: 1px dotted var(--line-strong); cursor: help; }
.card-preview {
  position: fixed;
  width: 236px;
  border-radius: 10px;
  box-shadow: 0 12px 32px rgb(0 0 0 / 0.45);
  pointer-events: none;
  opacity: 0;
  z-index: 30;
}
.card-preview--visible { opacity: 1; }
.card-detail { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 20px; align-items: start; }
.card-art { width: 100%; border-radius: 10px; }
@media (max-width: 720px) { .card-detail { grid-template-columns: minmax(0, 1fr); } .card-art { max-width: 240px; } }

/* ── Card art ──────────────────────────────────────────────── */

.card-ref { display: inline-flex; align-items: center; gap: 8px; border-bottom: 0; cursor: default; }
.card-ref__name { border-bottom: 1px dotted var(--line-strong); }
.card-thumb {
  flex: none;
  width: 34px;
  height: 26px;
  object-fit: cover;
  object-position: 50% 28%;
  border-radius: 3px;
  background: var(--surface-2);
  box-shadow: 0 0 0 1px var(--line);
}
.data-table--dense .card-thumb { width: 28px; height: 22px; }

.deck-grid { margin-top: 12px; border-top: 1px solid var(--line); }
.deck-tiles {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: 12px;
}
.deck-tiles--legends { grid-template-columns: repeat(auto-fill, minmax(150px, 180px)); }
.deck-tile { position: relative; display: grid; gap: 4px; }
.deck-tile img { width: 100%; aspect-ratio: 63 / 88; object-fit: cover; border-radius: 6px; background: var(--surface-2); }
.deck-tile__placeholder {
  display: grid;
  place-items: center;
  aspect-ratio: 63 / 88;
  padding: 8px;
  border-radius: 6px;
  border: 1px dashed var(--line-strong);
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}
.deck-tile__count {
  position: absolute;
  top: 6px;
  right: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgb(0 0 0 / 0.75);
  color: #fff;
  font: 700 12px var(--mono);
}
.deck-tile__name { font-size: 12px; line-height: 1.3; color: var(--muted); }

/* ── Deck view ─────────────────────────────────────────────── */

.deck-view { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 12px; }
.deck-view__bar { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.segmented { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 4px; overflow: hidden; }
.segmented button { font: inherit; font-weight: 600; background: transparent; color: var(--muted); border: 0; padding: 6px 14px; cursor: pointer; }
.segmented button.is-active { background: var(--surface-2); color: var(--text); }
.ram-summary { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12px; color: var(--muted); }
.ram { display: inline-block; min-width: 28px; text-align: center; padding: 1px 6px; border-radius: 3px; font: 700 11px var(--mono); border: 1px solid currentColor; }
.ram--red { color: #ff6b6b; }
.ram--blue { color: #4cc9f0; }
.ram--green { color: #7bdcb5; }
.ram--yellow { color: #f2c14e; }
.deck-grid { border-top: 0; margin-top: 0; }
.deck-tile__ram { order: 3; }
.deck-tile__name { order: 2; }

/* ── Decks & legend art ────────────────────────────────────── */

.legend-strip { display: inline-flex; gap: 2px; flex: none; }
.legend-strip img, .legend-strip__blank { object-fit: cover; object-position: 50% 22%; border-radius: 3px; background: var(--surface-2); box-shadow: 0 0 0 1px var(--line); }
.legend-strip--small img, .legend-strip--small .legend-strip__blank { width: 22px; height: 28px; }
.legend-strip--large img, .legend-strip--large .legend-strip__blank { width: 64px; height: 84px; border-radius: 6px; }
.opponent-chip { display: inline-flex; align-items: center; gap: 8px; }

.deck-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.deck-card { display: grid; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); text-decoration: none; color: inherit; min-width: 0; }
.deck-card:hover, .deck-card:focus-visible { border-color: var(--line-strong); background: var(--surface-2); }
.deck-card__head { display: flex; gap: 12px; align-items: center; min-width: 0; }
.deck-card__art { display: flex; gap: 3px; flex: none; }
.deck-card__art img { width: 30px; height: 42px; object-fit: cover; object-position: 50% 22%; border-radius: 3px; box-shadow: 0 0 0 1px var(--line); }
.deck-card__title { display: grid; gap: 2px; min-width: 0; }
.deck-card__name { font-size: 15px; line-height: 1.25; overflow-wrap: anywhere; }
.deck-card__sub { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.deck-card__stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.deck-card__stats > div { display: grid; gap: 2px; }
.deck-card__stats strong { font-size: 18px; white-space: nowrap; }
.deck-card__label { display: block; font-size: 12px; color: var(--muted); }
.deck-card__matchups .deck-card__label { display: inline; margin-right: 6px; }
.deck-card__bar { position: relative; height: 4px; border-radius: 2px; background: var(--surface-2); overflow: hidden; }
.deck-card__fill { position: absolute; inset: 0 auto 0 0; background: var(--info); border-radius: 2px; }
.deck-card__half { position: absolute; left: 50%; top: 0; bottom: 0; width: 1px; background: var(--line-strong); }
.deck-card__matchups { display: grid; gap: 2px; }
.deck-card__foot { font-size: 12px; }

.deck-header { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
.deck-header__art { display: flex; gap: 4px; }
.deck-header__art img { width: 64px; height: 88px; object-fit: cover; object-position: 50% 22%; border-radius: 6px; box-shadow: 0 0 0 1px var(--line); }
.deck-header__name { font-size: 24px; margin: 0; }
.deck-header__record { display: flex; gap: 8px; align-items: center; margin: 4px 0 0; }
.deck-header__version { margin-left: auto; display: grid; gap: 4px; font-size: 12px; color: var(--muted); }
.deck-header__version select { max-width: 360px; }
.deck-baseline { font-size: 13px; color: var(--muted); padding-bottom: 8px; }

.subtabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.subtabs__tab { padding: 8px 12px; text-decoration: none; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; }
.subtabs__tab:hover { color: var(--text); }
.subtabs__tab--active { color: var(--text); border-bottom-color: var(--info); }
.active-filter { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--info); border-radius: var(--radius); background: color-mix(in srgb, var(--info) 8%, transparent); }

/* Compact analysis tables: fit one screen, explain columns on hover. */
.has-tip { text-decoration: underline dotted var(--line-strong); text-underline-offset: 3px; cursor: help; }
.data-table--compact th { padding: 6px 8px; }
.data-table--compact td { padding: 6px 8px; }
.data-table--compact td:first-child { min-width: 150px; max-width: 220px; }
.data-table--compact .rate { gap: 5px; }
.data-table--compact .rate__value { min-width: 40px; }
.data-table--compact .rate__bar { width: 44px; }
.data-table--compact .rate__n { min-width: 30px; font-size: 11px; }
.data-table--compact .diff { gap: 5px; }
.data-table--compact .diff__value { min-width: 44px; }
.data-table--compact .diff__bar { width: 52px; }
.data-table--compact .card-thumb { width: 28px; height: 22px; }
.deck-header__changes { flex-basis: 100%; margin: 0; font-size: 13px; }
.deck-header__changes .deck-card__label { display: inline; margin-right: 8px; }

/* ── Card bars & trend cells ───────────────────────────────── */

.data-table--cards td { padding-top: 3px; padding-bottom: 3px; }
.data-table--cards td:first-child { min-width: 240px; max-width: 300px; }
.card-bar { display: grid; grid-template-columns: 30px minmax(0, 1fr) 26px; align-items: stretch; height: 30px; border-radius: 4px; overflow: hidden; background: #1a1f27; box-shadow: 0 0 0 1px var(--line); color: #fff; }
.card-bar__cost { display: grid; place-items: center; font: 700 15px var(--mono); background: #4a5260; }
.card-bar--red .card-bar__cost { background: #b3363a; }
.card-bar--blue .card-bar__cost { background: #1f7fb3; }
.card-bar--green .card-bar__cost { background: #2f8f5b; }
.card-bar--yellow .card-bar__cost { background: #b8952a; }
.card-bar__name {
  display: flex; align-items: center; padding: 0 10px; min-width: 0;
  font-weight: 700; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  text-shadow: 0 1px 2px rgb(0 0 0 / 0.9);
  /* Name on a solid lead-in, then the card's illustration band showing clearly on the right. */
  background: linear-gradient(90deg, #1a1f27 38%, rgb(26 31 39 / 0.35) 60%, rgb(26 31 39 / 0) 78%), var(--art, none) right 0 top 32% / 58% auto no-repeat, #1a1f27;
}
.card-bar__count { display: grid; place-items: center; font: 700 13px var(--mono); color: var(--brand); background: #0f1318; }
.card-bar__count--mixed { font-size: 10px; letter-spacing: -0.04em; }

.trend { display: inline-flex; align-items: baseline; gap: 4px; font: 600 13px var(--mono); white-space: nowrap; }
.trend__arrow { width: 7px; height: 7px; fill: currentColor; align-self: center; }
.trend__n { color: var(--muted); font-weight: 400; font-size: 10px; min-width: 18px; text-align: left; }
.trend--up { color: var(--up); }
.trend--down { color: var(--down); }
.trend--flat { color: var(--text); font-weight: 500; }
.trend--empty { color: var(--muted); }
/* Keep the card column compact; spare width goes to the stats. */
.data-table--cards td:first-child, .data-table--cards th:first-child { width: 250px; min-width: 250px; max-width: 250px; }
.data-table--cards .card-bar { width: 244px; }
.data-table--cards .card-bar__name { background: linear-gradient(90deg, #1a1f27 52%, rgb(26 31 39 / 0.4) 70%, rgb(26 31 39 / 0) 86%), var(--art, none) right 0 top 32% / 46% auto no-repeat, #1a1f27; }
/* The art starts under the solid lead-in (hiding its edge) and fades in gradually. */
.data-table--cards .card-bar__name {
  background:
    linear-gradient(90deg,
      #1a1f27 0%, #1a1f27 36%,
      rgb(26 31 39 / 0.9) 46%, rgb(26 31 39 / 0.72) 56%, rgb(26 31 39 / 0.5) 66%,
      rgb(26 31 39 / 0.3) 76%, rgb(26 31 39 / 0.14) 87%, rgb(26 31 39 / 0.04) 100%),
    var(--art, none) right 0 top 32% / 68% auto no-repeat,
    #1a1f27;
}

/* ── Expandable rows ───────────────────────────────────────── */
.data-table tr.is-expanded td { background: var(--surface-2); }
.data-table tr.detail-row > td { padding: 14px 16px 18px; background: var(--surface-2); border-bottom: 1px solid var(--line-strong); }
.card-detail-inline { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 20px; align-items: start; }
.card-detail-inline__art { width: 200px; border-radius: 10px; box-shadow: 0 8px 24px rgb(0 0 0 / 0.35); }
.card-detail-inline .stats { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
@media (max-width: 900px) { .card-detail-inline { grid-template-columns: minmax(0, 1fr); } .card-detail-inline__art { width: 160px; } }

/* Any table cell holding a card bar uses the same compact card column. */
td:has(> .card-bar) { width: 250px; min-width: 250px; max-width: 250px; padding-top: 3px; padding-bottom: 3px; }
td > .card-bar { width: 244px; }
td > .card-bar .card-bar__name {
  background:
    linear-gradient(90deg, #1a1f27 0%, #1a1f27 36%, rgb(26 31 39 / 0.9) 46%, rgb(26 31 39 / 0.72) 56%, rgb(26 31 39 / 0.5) 66%, rgb(26 31 39 / 0.3) 76%, rgb(26 31 39 / 0.14) 87%, rgb(26 31 39 / 0.04) 100%),
    var(--art, none) right 0 top 32% / 68% auto no-repeat, #1a1f27;
}

/* ── Testing groups ────────────────────────────────────────── */
.group-panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.group-panel[open] { border-color: var(--line-strong); }
.group-panel__summary { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 14px; cursor: pointer; list-style: none; }
.group-panel__summary::-webkit-details-marker { display: none; }
.group-panel__summary::before { content: "▸"; color: var(--muted); }
.group-panel[open] .group-panel__summary::before { content: "▾"; }
.group-panel__share { margin-left: auto; font-size: 13px; }
.group-panel__body { display: grid; gap: 16px; padding: 0 14px 14px; }
.invite-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.invite { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); }
.invite-code { font-size: 15px; letter-spacing: 0.12em; padding: 4px 8px; background: var(--surface-2); border-radius: 3px; }

/* Row actions stay out of the way until the row is hovered or focused. */
.row-action { opacity: 0; transition: opacity 120ms ease-out; }
tr:hover .row-action, tr:focus-within .row-action { opacity: 1; }
@media (hover: none) { .row-action { opacity: 1; } }

/* Secondary filters live behind a disclosure. */
.filters__more { align-self: end; }
.filters__count { margin-left: 4px; color: var(--brand-text); }

/* ------------------------------------------------------------------------
   Kiroshi Scan: the dashboard as an in-world optics readout. Flat charcoal,
   square geometry, 45° cut corners on anything you press or that labels a
   state, a short cyan scan tick opening every section, and corner brackets
   locking onto the card under inspection. Tables stay plain and dense.
   ------------------------------------------------------------------------ */
.cut, .button, .badge, .chip, .toast, .segmented, .deck-card, .form-strip__item, .blocks__slot, .pager button {
  clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, var(--cut) 100%, 0 calc(100% - var(--cut)));
}
.badge, .chip, .form-strip__item { --cut: 4px; }

/* Controls fill instead of outline, so the cut corner reads cleanly. */
.button { border: 0; font-family: var(--display); font-weight: 600; letter-spacing: 0.01em; padding: 7px 16px 7px 14px; }
.button--small { padding: 4px 11px 4px 10px; }
.button--ghost, .pager button { background: var(--surface-2); color: var(--text); border: 0; }
.button--ghost:hover, .pager button:hover { background: var(--line-strong); filter: none; }
.button--danger { background: color-mix(in srgb, var(--hostile) 14%, var(--surface-2)); color: var(--hostile); border: 0; }
.segmented { border: 0; background: var(--surface-2); }
.segmented button.is-active { background: var(--line-strong); color: var(--text); }
input, select, textarea { border-radius: 0; background: var(--surface); border-color: var(--line-strong); }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; border-color: var(--scan); box-shadow: 0 0 0 1px var(--scan); }
:focus-visible { outline-color: var(--focus); outline-offset: 2px; }

/* Section opener: a dim rule with a short bright scan tick at its origin. */
.panel { position: relative; }
.panel::before { content: ""; position: absolute; left: 0; top: -1px; width: 28px; height: 2px; background: var(--scan); }
.masthead { position: relative; }

.tabs__tab--active { border-bottom-color: var(--brand-text); }
.data-table tr.clickable:hover td, .data-table tr.clickable:focus-visible td { background: color-mix(in srgb, var(--scan) 6%, var(--surface)); }
.data-table tr.is-expanded td { background: color-mix(in srgb, var(--scan) 8%, var(--surface)); }
.data-table tr.detail-row > td { background: var(--surface); border-bottom: 1px solid var(--line-strong); }

/* The one authored moment: an expanded row scans open, top to bottom. */
@media (prefers-reduced-motion: no-preference) {
  .data-table tr.detail-row > td > * { animation: scan-open 260ms cubic-bezier(0.16, 1, 0.3, 1) both; }
}
@keyframes scan-open {
  from { clip-path: inset(0 0 100% 0); opacity: 0.4; }
  to { clip-path: inset(0 0 0 0); opacity: 1; }
}

/* Target lock: corner brackets around the card being inspected. */
.card-detail-inline__art, .card-art {
  border-radius: 8px;
  box-shadow: 0 10px 28px rgb(0 0 0 / 0.45);
}
.card-detail-inline > :first-child, .card-detail > :first-child { position: relative; }
.card-detail-inline__art { margin: 8px; }
.card-detail-inline { position: relative; }
.card-detail-inline::before {
  content: ""; position: absolute; left: 0; top: 0; width: 216px; aspect-ratio: 216 / 295; pointer-events: none;
  --b: 14px; --t: 2px;
  background:
    linear-gradient(var(--scan), var(--scan)) left top / var(--b) var(--t) no-repeat,
    linear-gradient(var(--scan), var(--scan)) left top / var(--t) var(--b) no-repeat,
    linear-gradient(var(--scan), var(--scan)) right top / var(--b) var(--t) no-repeat,
    linear-gradient(var(--scan), var(--scan)) right top / var(--t) var(--b) no-repeat,
    linear-gradient(var(--scan), var(--scan)) left bottom / var(--b) var(--t) no-repeat,
    linear-gradient(var(--scan), var(--scan)) left bottom / var(--t) var(--b) no-repeat,
    linear-gradient(var(--scan), var(--scan)) right bottom / var(--b) var(--t) no-repeat,
    linear-gradient(var(--scan), var(--scan)) right bottom / var(--t) var(--b) no-repeat;
}
@media (max-width: 900px) { .card-detail-inline::before { width: 176px; } }

/* Results: wins solid cyan, losses hostile red on a dark plate, letters kept. */
.form-strip__item { width: 24px; height: 24px; font-family: var(--display); }
.form-strip__item--win { background: var(--scan); color: var(--scan-ink); }
.form-strip__item--loss { background: color-mix(in srgb, var(--hostile) 22%, var(--surface-2)); color: var(--hostile); }
.badge--win { color: var(--scan); }
.badge--loss { color: var(--hostile); }

.deck-card { border: 0; background: var(--surface); }
.deck-card:hover, .deck-card:focus-visible { background: var(--surface-2); }
.legend-strip img, .legend-strip__blank, .deck-card__art img { border-radius: 0; }
.masthead__mark { border-radius: 0; }
.rate__ci { background: color-mix(in srgb, var(--scan) 40%, transparent); border-radius: 0; }
.rate__bar, .diff__bar { border-radius: 0; }
.toast { border: 0; background: var(--surface-2); }
.toast--warn { background: color-mix(in srgb, var(--warn) 14%, var(--surface-2)); }
.toast--error { background: color-mix(in srgb, var(--hostile) 14%, var(--surface-2)); }
.card-detail-inline { grid-template-columns: 216px minmax(0, 1fr); }
@media (max-width: 900px) { .card-detail-inline { grid-template-columns: minmax(0, 1fr); } }

/* Theme switch in the masthead. */
.masthead__end { display: flex; align-items: center; gap: 18px; }
.theme-switch button { padding: 4px 10px; font-size: 12px; }

/* --- Highlight discipline (critique 2026-09-25) ---
   Status reads as a square pip plus colored text, not a tinted pill. Only
   results get a plate, matching the form strip. Callouts are plain lines. */
.badge { background: none; padding: 0; clip-path: none; display: inline-flex; align-items: center; gap: 5px; font-weight: 600; }
.badge::before { content: ""; width: 5px; height: 5px; background: currentColor; flex: none; }
.badge--neutral { color: var(--muted); }
.badge--win, .badge--loss {
  padding: 1px 7px; font-family: var(--display);
  clip-path: polygon(0 0, calc(100% - 4px) 0, 100% 4px, 100% 100%, 4px 100%, 0 calc(100% - 4px));
}
.badge--win::before, .badge--loss::before { content: none; }
.badge--win { background: var(--scan); color: var(--scan-ink); }
.badge--loss { background: color-mix(in srgb, var(--hostile) 22%, var(--surface-2)); color: var(--hostile); }

.banner, .active-filter { border: 0; background: none; padding: 0 0 10px; border-bottom: 1px solid var(--line); border-radius: 0; }

/* RAM tags: filled in the game color with a cut corner, not outlined. */
.ram { border: 0; background: currentColor; clip-path: polygon(0 0, calc(100% - 4px) 0, 100% 4px, 100% 100%, 4px 100%, 0 calc(100% - 4px)); }
.ram { -webkit-text-fill-color: #0b0d10; }

/* Current selection: a yellow target pip, not recolored bold text. */
.selected { color: var(--text); font-weight: 600; display: inline-flex; align-items: center; gap: 7px; }
.selected::before { content: ""; width: 6px; height: 6px; background: var(--brand); flex: none; }

/* Link affordances are drawn, not typed: a chevron for in-app, a tilted one for external. */
.link[href]::after { content: ""; display: inline-block; width: 5px; height: 5px; margin-left: 6px; border-top: 1.5px solid currentColor; border-right: 1.5px solid currentColor; transform: translateY(-1px) rotate(45deg); }
.link[target="_blank"]::after {
  width: 9px; height: 9px; border: 0; transform: none; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M3 1h6v6M9 1 1.5 8.5' fill='none' stroke='black' stroke-width='1.6'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M3 1h6v6M9 1 1.5 8.5' fill='none' stroke='black' stroke-width='1.6'/%3E%3C/svg%3E") center / contain no-repeat;
}
/* Sort direction: a drawn caret beside the active column. */
.sort-caret { display: inline-block; width: 0; height: 0; margin-left: 5px; vertical-align: middle; border-left: 4px solid transparent; border-right: 4px solid transparent; }
.sort-caret--desc { border-top: 5px solid currentColor; }
.sort-caret--asc { border-bottom: 5px solid currentColor; }

/* --- Dropdowns ---
   Closed: a filled control with the cut corner and a cyan chevron, the same
   family as buttons. Open (Chrome 135+): a styled picker list; elsewhere the
   browser's list shows under the styled control. */
select:not([multiple]) {
  -webkit-appearance: none;
  appearance: none;
  border: 0;
  background-color: var(--surface-2);
  background-image:
    linear-gradient(45deg, transparent 50%, var(--scan) 50%),
    linear-gradient(135deg, var(--scan) 50%, transparent 50%);
  background-repeat: no-repeat;
  background-size: 5px 5px, 5px 5px;
  background-position: calc(100% - 17px) 55%, calc(100% - 12px) 55%;
  padding: 7px 34px 7px 12px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, var(--cut) 100%, 0 calc(100% - var(--cut)));
  transition: background-color 120ms ease-out;
}
select:not([multiple]):hover { background-color: var(--line); }
select:not([multiple]):focus-visible { outline: none; border: 0; box-shadow: inset 0 -2px 0 var(--scan); }
option, optgroup { background: var(--surface); color: var(--text); }

@supports (appearance: base-select) {
  select:not([multiple]), ::picker(select) { appearance: base-select; }
  select:not([multiple]) {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-right: 12px;
    background-image: none;
  }
  select:not([multiple])::picker-icon {
    content: "";
    width: 8px;
    height: 5px;
    background: var(--scan);
    clip-path: polygon(0 0, 100% 0, 50% 100%);
    transition: rotate 160ms cubic-bezier(0.16, 1, 0.3, 1);
  }
  select:not([multiple]):open::picker-icon { rotate: 180deg; }
  select:not([multiple]):open { background-color: var(--line); box-shadow: inset 0 -2px 0 var(--scan); }
  ::picker(select) {
    border: 1px solid var(--line-strong);
    background: var(--surface);
    padding: 4px 0;
    margin-block: 4px;
    max-height: min(420px, 60vh);
    box-shadow: 0 14px 36px rgb(0 0 0 / 0.4);
  }
  select option {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 7px 16px 7px 12px;
    font-weight: 400;
    white-space: nowrap;
  }
  select option:hover, select option:focus-visible { background: color-mix(in srgb, var(--scan) 12%, var(--surface)); outline: none; }
  select option:checked { font-weight: 600; }
  /* The chosen option carries the same yellow pip as any current selection. */
  select option::checkmark { content: ""; width: 6px; height: 6px; background: var(--brand); order: -1; }
  select optgroup { padding-top: 4px; font-size: 12px; font-weight: 600; color: var(--muted); }
  select optgroup option { font-size: 14px; color: var(--text); }
}

/* One-time notice: a plain line under a hairline, not a tinted box. */
.notice { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 24px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.notice p { margin: 0; max-width: 80ch; }

/* Group deck focus: combo chips toggle; chosen ones take the selection yellow. */
.focus { display: grid; gap: 10px; justify-items: start; margin-bottom: 18px; }
.focus h3 { margin: 0; }
.focus__picker { display: grid; gap: 8px; }
.focus__picker[hidden] { display: none; }
.focus__chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.combo-chip {
  position: relative; font: 700 13px var(--display); letter-spacing: 0.04em; padding: 5px 12px; border: 0; cursor: pointer;
  color: var(--text); background: var(--surface-2);
  clip-path: polygon(0 0, calc(100% - 5px) 0, 100% 5px, 100% 100%, 5px 100%, 0 calc(100% - 5px));
  isolation: isolate;
}
/* Unselected: neutral chip with the combo's colors as a strip; selected: fully filled.
   Same color values either way, so YYG and YYR show the identical yellow. */
.combo-chip::before { content: ""; position: absolute; inset: auto 0 0 0; height: 4px; z-index: -1; background: var(--combo); transition: height 140ms ease-out; }
.combo-chip:hover::before { height: 7px; }
.combo-chip.is-on { color: #0b0d10; }
.combo-chip.is-on::before { height: 100%; }
/* Color swatch beside each combo in the Add combo list. */
.combo-option::before { content: ""; width: 26px; height: 10px; flex: none; background: var(--combo); }
.focus__add { padding-top: 5px; padding-bottom: 5px; font-size: 13px; }

/* --- Cloud page --- */
.settings { display: grid; gap: 12px; margin-bottom: 12px; }
.setting { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; }
.setting__text { display: grid; gap: 1px; }
/* Switch: a cut-corner track whose knob slides; on = scan cyan. */
.switch {
  -webkit-appearance: none; appearance: none; flex: none; position: relative; margin: 1px 0 0;
  width: 34px; height: 18px; background: var(--line-strong); cursor: pointer;
  clip-path: polygon(0 0, calc(100% - 5px) 0, 100% 5px, 100% 100%, 5px 100%, 0 calc(100% - 5px));
  transition: background-color 140ms ease-out;
}
.switch::before { content: ""; position: absolute; top: 3px; left: 3px; width: 12px; height: 12px; background: var(--muted); transition: transform 160ms cubic-bezier(0.16, 1, 0.3, 1); }
.switch:checked { background: var(--scan); }
.switch:checked::before { transform: translateX(16px); background: var(--scan-ink); }
.switch:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.inline-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.inline-form input { min-width: 200px; }
.group-forms:not(:empty) { margin-bottom: 14px; }

.group-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.group { border-bottom: 1px solid var(--line); }
.group__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px; padding: 12px 0; }
.group__title { display: grid; gap: 2px; }
.group__title strong { font-family: var(--display); font-size: 16px; font-weight: 600; }
.group__controls { display: flex; align-items: center; gap: 18px; }
.group__controls .setting { align-items: center; }
.group__body { padding: 4px 0 18px; }
.group__body[hidden] { display: none; }
.group.is-open .group__head { padding-bottom: 8px; }
.group__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px 40px; align-items: start; }
@media (max-width: 860px) { .group__grid { grid-template-columns: minmax(0, 1fr); } }
.group__members { display: grid; gap: 10px; align-content: start; }
.group__members h3 { margin: 0; }
.group__footer { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; margin-top: 18px; padding-top: 12px; border-top: 1px dashed transparent; }

.member-list { list-style: none; margin: 0; padding: 0; }
.member { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.member__name { flex: 1 1 auto; }
.member__actions:empty { display: none; }
.invite-code-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.member__name { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.member__name strong { font-weight: 600; }
.account-actions { margin-top: 8px; padding-top: 16px; border-top: 1px solid var(--line); }

/* --- Polish pass (2026-09-26) ---
   Larger type, tables that hug their numbers, and game visuals (Legend art or
   color blocks) wherever a deck or an opponent is named. */
:root { font-size: 15px; }
small, .badge { font-size: 12.5px; }
h2 { font-size: 20px; }
h3 { font-size: 14px; }
.note, .caution, .panel__subtitle, .filter-summary { font-size: 13px; }
.filter { font-size: 12.5px; }
.tabs__tab { font-size: 15px; padding: 14px 16px 12px; }
.subtabs__tab { font-size: 14.5px; padding: 10px 14px; }
.deck-header__name { font-size: 28px; }
.panel { padding-top: 20px; }
.panel__header { margin-bottom: 14px; }

/* Stat readout: hairline dividers between the numbers, never boxes. */
.stats { gap: 16px 28px; }
.stats > .stat + .stat { padding-left: 28px; border-left: 1px solid var(--line); }
.stat__label { font-size: 13px; }
.stat__value { font-size: 32px; }
.stats--compact { gap: 12px 32px; }
.stats--compact > .stat + .stat { padding-left: 0; border-left: 0; }
.stats--compact .stat__value { font-size: 20px; }
.stat .form-strip { margin: 7px 0 0; gap: 3px; }
.stat .form-strip__item { width: 18px; height: 18px; font-size: 10px; --cut: 3px; }

/* Tables: grow columns take the spare width, the rest hug their content. */
.data-table td { font-size: 14px; padding: 9px 12px; }
.data-table th { font-size: 12.5px; padding: 8px 12px; }
.data-table--dense td { padding: 4px 8px; }
.data-table--compact td, .data-table--compact th { padding: 6px 8px; }
.data-table--cards td { padding-top: 3px; padding-bottom: 3px; }
.data-table:not(.data-table--cards) .shrink { width: 1%; white-space: nowrap; }
.data-table:not(.data-table--cards) .num.shrink { padding-left: 22px; }
.data-table .grow { min-width: 180px; }

/* Deck and opponent chips: art or color blocks, then the name. */
.opponent-chip { gap: 10px; min-width: 0; }
.opponent-chip__name { min-width: 0; }
.data-table--games .opponent-chip__name { display: inline-block; max-width: 34ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }
.chip-line { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.chip-line .badge { margin-left: 0; }
.pips { display: inline-flex; gap: 2px; flex: none; }
.pip { display: grid; place-items: center; width: 22px; height: 28px; font: 700 12px var(--display); color: #0b0d10; }
.pip--R { background: var(--game-red); }
.pip--B { background: var(--game-blue); }
.pip--G { background: var(--game-green); }
.pip--Y { background: var(--game-yellow); }
.pip--unknown { background: var(--surface-2); color: var(--muted); box-shadow: inset 0 0 0 1px var(--line-strong); }
.legend-strip__blank { box-shadow: inset 0 0 0 1px var(--line-strong); }

.versus { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin: 0 0 16px; font-size: 15px; font-weight: 600; }
.versus .legend-strip img, .versus .legend-strip__blank, .versus .pip { width: 30px; height: 40px; }
.versus__vs { font-family: var(--display); color: var(--muted); font-weight: 500; }

.pair { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.pair__plus { color: var(--muted); font-family: var(--mono); }

/* Charts: labelled bars, readable ticks. */
.chart__tick, .chart__axis { font-size: 12px; }
.chart__bar { fill: color-mix(in srgb, var(--scan) 62%, transparent); }
.chart__value { fill: var(--text); font: 600 12px var(--mono); }

/* Forms: actions keep their natural size instead of stretching across the grid. */
.form > .button, .form > button { justify-self: start; }
.danger-grid { gap: 24px; align-items: start; }
.setting__text > span { font-size: 14.5px; font-weight: 600; }
.group__title strong { font-size: 17px; }
/* A chip fills its cell as a flex row so art and name share one center line. */
.data-table td > .opponent-chip { display: flex; }
.timeline { max-height: 900px; }
.list:has(.card-ref) { list-style: none; padding-left: 0; display: grid; gap: 6px; }

/* Navigation in the display face. */
.tabs__tab, .subtabs__tab { font-family: var(--display); font-weight: 600; letter-spacing: 0.01em; }

/* Recent-games previews fit their column: names shorten instead of scrolling. */
.data-table--recent { table-layout: auto; }
.data-table--recent .grow { max-width: 0; min-width: 0; width: 50%; }
.data-table--recent .opponent-chip { display: flex; }
/* Narrow table: the deck name needs the room more than its portraits do. */
.data-table--recent .opponent-chip--deck .legend-strip { display: none; }
.data-table--recent .opponent-chip__name { max-width: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.data-table--recent td:first-child, .data-table--recent th:first-child { min-width: 0; padding-right: 0; }
.result-pip { display: inline-grid; place-items: center; cursor: inherit; }

/* Card names in the match timeline: hover for the card, click for stats. */
.card-mention { color: inherit; text-decoration: underline dotted var(--line-strong); text-underline-offset: 3px; cursor: pointer; }
.card-mention--own { color: var(--scan); text-decoration-color: color-mix(in srgb, var(--scan) 50%, transparent); font-weight: 600; }
.card-mention:hover { text-decoration-style: solid; }
span.card-mention { cursor: help; }

/* Starting hand, inline under your keep or mulligan line in Setup. */
.starting-hand { display: grid; gap: 6px; margin: 6px 0 4px; }
.hand { display: flex; align-items: center; gap: 10px; }
.hand__label { min-width: 96px; font-size: 12px; color: var(--muted); }
.hand__cards { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.hand__cards a { display: block; text-decoration: none; }
.hand__cards img, .hand__placeholder { display: block; width: 40px; aspect-ratio: 63 / 88; object-fit: cover; border-radius: 3px; background: var(--surface-2); }
.hand__placeholder { display: grid; place-items: center; padding: 2px; font-size: 8px; line-height: 1.1; text-align: center; color: var(--muted); overflow: hidden; box-shadow: inset 0 0 0 1px var(--line-strong); }
.hand__cards a:hover img, .hand__cards a:focus-visible img { outline: 2px solid var(--scan); outline-offset: 1px; }
.hand--replaced .hand__cards img { opacity: 0.5; filter: grayscale(0.6); }
.hand--replaced .hand__cards a:hover img { opacity: 1; filter: none; }

/* Held: one tag per copy, turns plus how it left the hand. */
.held { display: inline-flex; flex-wrap: nowrap; justify-content: flex-end; gap: 3px; }
.held__copy { display: inline-flex; align-items: baseline; gap: 2px; padding: 1px 5px; font: 600 13px var(--mono); background: var(--surface-2); color: var(--text); }
.held__copy small { font-size: 10px; font-weight: 700; }
.held__copy--played small { color: var(--scan); }
.held__copy--sold small { color: var(--brand-text); }
.held__copy--discarded small { color: var(--hostile); }
.held__copy--unused, .held__copy--moved { color: var(--muted); }

/* Tooltip: quick, flat, cut corner. Replaces the browser's slow native title. */
.tip {
  position: fixed; left: 0; top: 0; z-index: 40; max-width: 320px; padding: 7px 11px;
  font-size: 12.5px; line-height: 1.4; color: var(--text); background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--line-strong);
  clip-path: polygon(0 0, calc(100% - 6px) 0, 100% 6px, 100% 100%, 6px 100%, 0 calc(100% - 6px));
  pointer-events: none; opacity: 0; transition: opacity 80ms ease-out;
}
.tip--visible { opacity: 1; }

/* Readout labels: a small scan square before each stat label and sub-heading,
   the same filled pip as status badges. Headings keep the panel tick instead. */
.stat__label, h3 { display: flex; align-items: center; gap: 7px; }
.stat__label::before, h3::before { content: ""; width: 5px; height: 5px; flex: none; background: var(--scan); }

/* Gig dice at the end of each timeline turn: outline shape = die type. */
.gig-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; margin: 6px 0 2px 10px; padding: 6px 10px; border-top: 1px solid var(--line); background: var(--surface-2); }
.gig-strip__label { font: 600 10px var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.gig-strip__side { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 3px; }
.gig-strip__who { font: 600 11px var(--mono); color: var(--muted); text-transform: uppercase; }
.gig-strip__side { --side: var(--scan); }
.gig-strip__side--rival { --side: var(--hostile); }
/* Street Cred: the side's dice total, a quiet colored numeral after a thin side tick. */
.street-cred { display: inline-flex; align-items: baseline; gap: 3px; margin: 0 6px 0 0; padding-left: 6px; border-left: 2px solid color-mix(in srgb, var(--side) 60%, transparent); cursor: default; }
.street-cred__label { font: 600 9px var(--mono); letter-spacing: 0.06em; color: var(--muted); }
.street-cred__value { font: 700 13px/1 var(--display); color: color-mix(in srgb, var(--side) 85%, var(--text)); font-variant-numeric: tabular-nums; }
.die { display: inline-grid; width: 24px; height: 24px; cursor: default; }
.die svg { width: 100%; height: 100%; overflow: visible; }
.die__edge { fill: none; stroke-width: 1.3; stroke-linejoin: round; transition: fill 120ms ease; }
.die--self .die__edge { stroke: color-mix(in srgb, var(--scan) 70%, transparent); }
.die--rival .die__edge { stroke: color-mix(in srgb, var(--hostile) 70%, transparent); }
.die--stolen .die__edge { stroke-dasharray: 2.5 2; }
.die__value { fill: var(--text); font: 700 9px var(--mono); text-anchor: middle; dominant-baseline: central; }
.die:hover .die__edge { fill: color-mix(in srgb, currentColor 12%, transparent); }
.die--self:hover { color: var(--scan); }
.die--rival:hover { color: var(--hostile); }
@media (prefers-reduced-motion: reduce) { .die__edge { transition: none; } }
