/* =========================================================
   LARPOFF — Splitscreen
   The whole viewport is the bar. --p (0–100) is the seam.
   ========================================================= */

:root {
  --inner-w: min(27vw, 420px);
  --coral: #F05D5E;
  --coral-deep: #D94A4C;
  --teal: #0F7173;
  --teal-hi: #3BA7A9;
  --ink: #272932;
  --ink-2: #1D1F26;
  --signal: #E7ECEF;
  --brass: #D8A47F;

  --display: 'Archivo', 'Arial Narrow', system-ui, sans-serif;
  --mono: 'Martian Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;

  --ticker-h: 40px;
  --gutter: clamp(16px, 3vw, 48px);
  --p: 50;
  --t: 0;           /* tension, 0–1, set by the seam engine */
  --mark-size: 18vw;

  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--signal);
  font-family: var(--display);
  font-stretch: 100%;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  overscroll-behavior: none;
}
button { font: inherit; color: inherit; }
a { color: inherit; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: fixed; top: 8px; left: 8px; z-index: 200; padding: 8px 12px;
  background: var(--signal); color: var(--ink); transform: translateY(-200%);
}
.skip:focus { transform: none; }

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

/* ---------- Stage & sides ---------- */

.stage {
  position: fixed;
  inset: 0 0 var(--ticker-h) 0;
  overflow: hidden;
  background: var(--ink);
  isolation: isolate;
}

.side {
  position: absolute;
  top: 0; bottom: 0;
  overflow: hidden;
}
.side-a {
  left: 0;
  width: calc(var(--p) * 1%);
  background: var(--coral);
  color: var(--ink);
}
.side-b {
  right: 0;
  width: calc((100 - var(--p)) * 1%);
  background: var(--teal);
  color: var(--signal);
}

.creature-wrap {
  position: absolute;
  top: calc(var(--mark-size) * 0.86 + 4vh);
  bottom: 5vh;
  display: grid;
  grid-template: 100% / 100%;
  place-items: center;
  pointer-events: none;
  z-index: 1;
}
.side-a .creature-wrap { left: 0; right: var(--inner-w); }
.side-b .creature-wrap { left: var(--inner-w); right: 0; }
.creature {
  height: 100%;
  width: auto;
  max-width: 86%;
  aspect-ratio: 1;
  overflow: visible;
}

.side-inner {
  position: absolute;
  bottom: 0;
  width: var(--inner-w);
  padding: 0 calc(var(--gutter) * 0.5 + 18px) 26px;
  max-height: calc(100% - var(--mark-size) * 0.86 - 4vh);
  display: flex;
  flex-direction: column;
  gap: 18px;
  z-index: 2;
}
.side-a .side-inner { right: 0; align-items: flex-end; text-align: right; }
.side-b .side-inner { left: 0; align-items: flex-start; text-align: left; }

/* ---------- Tags ---------- */

.tag { display: grid; gap: 4px; }
.tag-name {
  margin: 0;
  font-size: clamp(28px, 3.2vw, 46px);
  line-height: 0.92;
  font-weight: 850;
  font-stretch: 75%;
  letter-spacing: -0.01em;
}
.tag-wallet {
  margin: 0;
  font-family: var(--mono);
  font-size: 13px;
  font-stretch: 87.5%;
  letter-spacing: 0.02em;
}
.tag-meta {
  margin: 0;
  font-size: 15px;
  line-height: 1.35;
  max-width: 36ch;
  opacity: 0.82;
}

/* ---------- Telemetry ---------- */

.telemetry {
  margin: 0;
  width: 100%;
  display: grid;
}
.tele-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: 12px;
  padding: 9px 0 8px;
  border-top: 1px solid color-mix(in srgb, currentColor 22%, transparent);
  transition: background-color 0s;
}
.side-b .tele-row { grid-template-columns: auto 1fr; }
.side-b .tele-row dt { order: 2; text-align: right; }
.side-b .tele-row dd { order: 1; }
.side-a .tele-row dt { text-align: left; }

.tele-row dt {
  font-size: 15px;
  font-weight: 600;
  font-stretch: 87.5%;
}
.tele-row dd {
  margin: 0;
  display: grid;
  gap: 2px;
}
.tele-value {
  font-family: var(--mono);
  font-size: clamp(16px, 1.45vw, 21px);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.tele-sub {
  font-size: 13px;
  opacity: 0.78;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 30ch;
}
.side-a .tele-sub { justify-self: end; }

.tele-row.is-live { border-top-color: currentColor; }
.tele-row.is-live dt::before {
  content: '';
  display: inline-block;
  width: 7px; height: 7px;
  margin-right: 8px;
  background: var(--brass);
  vertical-align: 2px;
}
.side-b .tele-row.is-live dt::before { margin: 0 0 0 8px; float: right; margin-top: 6px; }

.tele-row.is-total .tele-value {
  font-family: var(--display);
  font-size: clamp(30px, 3vw, 44px);
  font-weight: 850;
  font-stretch: 70%;
  letter-spacing: -0.01em;
}

/* ---------- Buttons & notes ---------- */

.controls { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; }
.side-a .controls { justify-content: flex-end; }
.btn {
  appearance: none;
  border: 0;
  cursor: pointer;
  padding: 15px 22px 14px;
  font-size: 17px;
  font-weight: 750;
  font-stretch: 87.5%;
  background: var(--ink);
  color: var(--signal);
  border-radius: 2px;
  transition: transform 0.12s ease, background-color 0.12s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: 0.5; cursor: progress; transform: none; }
.btn-signal { background: var(--signal); color: var(--ink); }

/* The big search button */
.btn-search {
  padding: 18px 28px 16px;
  font-size: clamp(20px, 2vw, 30px);
  font-weight: 850;
  font-stretch: 75%;
  line-height: 1;
}
.btn-search.is-searching {
  cursor: progress;
  animation: searching 1.6s ease-in-out infinite;
}
.btn-search.is-searching::after {
  content: '';
  display: inline-block;
  width: 1.1em;
  text-align: left;
  animation: dots 1.4s steps(4, end) infinite;
}
.btn-search[disabled] { opacity: 1; }
@keyframes searching {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ink) 55%, transparent); }
  50% { box-shadow: 0 0 0 12px color-mix(in srgb, var(--ink) 0%, transparent); }
}
@keyframes dots {
  0% { content: ''; }
  25% { content: '.'; }
  50% { content: '..'; }
  75%, 100% { content: '...'; }
}
.btn-text {
  appearance: none;
  border: 0;
  background: none;
  padding: 6px 0;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}
.btn-text:hover { text-decoration-thickness: 2px; }
.note {
  flex-basis: 100%;
  margin: 0;
  font-size: 14px;
  line-height: 1.4;
  max-width: 40ch;
  opacity: 0.85;
}
.side-a .note { margin-left: auto; }
.note:empty { display: none; }
.note.is-error { opacity: 1; font-weight: 650; }

/* ---------- Views on side B ---------- */

.view { display: none; flex-direction: column; gap: 18px; width: 100%; }
body[data-channel="match"] .view-match { display: flex; }
body[data-channel="kol"] .view-kol { display: flex; }

body[data-channel="kol"] .side-b .side-inner { top: calc(var(--mark-size) * 0.86 + 3vh); justify-content: flex-end; padding-bottom: 92px; max-height: none; }
body[data-channel="kol"] #creature-b { opacity: 0; }

/* Paste any wallet (KOL channel) */
.versus { display: grid; gap: 8px; width: 100%; margin-top: 6px; }
.versus label { font-size: 15px; font-weight: 650; }
.versus-row { display: flex; gap: 8px; }
.versus input {
  flex: 1;
  min-width: 0;
  padding: 13px 14px 12px;
  border: 1px solid color-mix(in srgb, var(--signal) 45%, transparent);
  border-radius: 2px;
  background: color-mix(in srgb, var(--ink) 35%, transparent);
  color: var(--signal);
  font-family: var(--mono);
  font-size: 13px;
}
.versus input::placeholder { color: color-mix(in srgb, var(--signal) 55%, transparent); }
.versus input:focus-visible { outline: 2px solid var(--brass); outline-offset: 1px; }
.versus .btn { white-space: nowrap; }

/* Sound toggle in the dial */
.dial-sound {
  appearance: none;
  border: 0;
  border-left: 1px solid color-mix(in srgb, var(--signal) 30%, transparent);
  background: none;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}
.dial-sound[aria-pressed="false"] { opacity: 0.55; text-decoration: line-through; }

.roster {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  max-height: 46vh;
  overflow: auto;
  width: 100%;
  scrollbar-width: thin;
}
.roster-item {
  appearance: none;
  width: 100%;
  border: 0;
  border-top: 1px solid color-mix(in srgb, var(--signal) 25%, transparent);
  background: none;
  padding: 12px 0;
  display: grid;
  grid-template-columns: 40px 1fr auto;
  gap: 14px;
  align-items: center;
  text-align: left;
  cursor: pointer;
}
.roster-item:hover, .roster-item:focus-visible { background: color-mix(in srgb, var(--ink) 22%, transparent); }
.roster-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--ink);
  object-fit: cover;
  display: grid; place-items: center;
  font-family: var(--mono); font-size: 12px; color: var(--brass);
}
.roster-name { display: block; font-size: 22px; font-weight: 800; font-stretch: 75%; line-height: 1; }
.roster-meta { display: block; font-size: 13px; opacity: 0.8; margin-top: 4px; }
.roster-wallet { font-family: var(--mono); font-size: 12px; opacity: 0.85; }

/* ---------- Wordmark ---------- */

.mark {
  position: absolute;
  left: 0; right: 0;
  top: 1.2vh;
  height: calc(var(--mark-size) * 0.86);
  pointer-events: none;
  z-index: 3;
}
.mark-layer {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}
.mark-layer span {
  display: block;
  font-size: var(--mark-size);
  line-height: 0.86;
  font-weight: 900;
  font-stretch: calc(100% - var(--t) * 34%);
  letter-spacing: calc(-0.02em + var(--t) * 0.02em);
  white-space: nowrap;
}
.mark-a { color: var(--ink); clip-path: inset(0 calc(100% - var(--p) * 1%) 0 0); }
.mark-b { color: var(--signal); clip-path: inset(0 0 0 calc(var(--p) * 1%)); }

body[data-phase="verdict"] .mark { opacity: 0; }

/* ---------- Seam ---------- */

.seam {
  position: absolute;
  top: 0; bottom: 0;
  left: calc(var(--p) * 1%);
  width: 0;
  z-index: 20;
}
.seam-line {
  position: absolute;
  top: 0; bottom: 0;
  left: -1px;
  width: 2px;
  background: var(--signal);
}
.seam-handle {
  position: absolute;
  top: var(--handle-y);
  left: 0;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--ink);
  color: var(--brass);
  border: 1px solid color-mix(in srgb, var(--signal) 40%, transparent);
  border-radius: 2px;
  cursor: grab;
  touch-action: none;
  user-select: none;
}
.seam-handle:active { cursor: grabbing; }
.readout {
  font-family: var(--mono);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  min-width: 4.2ch;
}
.readout:first-child { text-align: right; }
.grip {
  width: 10px; height: 18px;
  background:
    linear-gradient(var(--signal), var(--signal)) 1px 0 / 2px 100% no-repeat,
    linear-gradient(var(--signal), var(--signal)) 7px 0 / 2px 100% no-repeat;
}

.seam { --handle-y: calc(var(--mark-size) * 0.86 + 1.2vh + 34px); }
.seam-hints { position: absolute; top: var(--handle-y); left: 0; pointer-events: none; }
.hint {
  position: absolute;
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.hint::before {
  content: '';
  position: absolute;
  width: 0; height: 0;
  border: 5px solid transparent;
}
.hint-left  { right: 92px; transform: translateY(-50%); color: var(--ink); padding-left: 14px; }
.hint-left::before  { left: 0; top: 50%; margin-top: -5px; border-right-color: currentColor; border-left-width: 0; }
.hint-right { left: 92px; transform: translateY(-50%); color: var(--signal); padding-right: 14px; }
.hint-right::before { right: 0; top: 50%; margin-top: -5px; border-left-color: currentColor; border-right-width: 0; }

body[data-phase="idle"] .seam:hover .hint,
body[data-phase="idle"] .seam.is-dragging .hint,
body[data-phase="idle"] .seam-handle:focus-visible ~ .seam-hints .hint { opacity: 0.9; }
body[data-channel="match"] .hint-left,
body[data-channel="kol"] .hint-right { display: none; }
.seam.will-switch .hint-right, .seam.will-switch .hint-left { opacity: 1; font-weight: 800; }

body:not([data-phase="idle"]) .seam-handle { cursor: default; }

/* ---------- On air, segments, scan ---------- */

.onair {
  position: absolute;
  top: 16px; left: 16px;
  z-index: 40;
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px 5px;
  background: var(--ink);
  color: var(--signal);
  font-family: var(--mono);
  font-size: 12px;
}
.presence {
  position: absolute;
  top: 16px; left: 16px;
  z-index: 40;
  margin: 0;
  display: flex; align-items: center; gap: 9px;
  padding: 7px 12px 6px;
  background: var(--ink);
  color: var(--signal);
  font-size: 14px;
  font-weight: 600;
}
.presence-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--teal-hi); animation: pulse 2s ease-in-out infinite; }
.presence.is-empty .presence-dot { background: color-mix(in srgb, var(--signal) 40%, transparent); animation: none; }
@keyframes pulse { 50% { opacity: 0.35; transform: scale(0.8); } }
body:not([data-phase="idle"]) .presence { display: none; }
.test-note {
  position: absolute;
  left: 50%;
  bottom: 6px;
  transform: translateX(-50%);
  z-index: 55;
  margin: 0;
  font-size: 11px;
  line-height: 1.3;
  white-space: nowrap;
  color: var(--signal);
  opacity: 0.7;
  pointer-events: none;
}
body[data-phase="verdict"][data-winner="a"] .test-note { color: var(--ink); }
.onair-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--coral); animation: blink 1s steps(2, jump-none) infinite; }
@keyframes blink { 50% { opacity: 0.2; } }

.segment {
  position: absolute;
  left: 0; right: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 45;
  background: var(--ink);
  color: var(--signal);
  padding: clamp(14px, 2vw, 26px) var(--gutter);
  display: grid;
  grid-template-columns: minmax(80px, 10%) minmax(0, auto) minmax(22ch, 1fr);
  align-items: end;
  gap: 8px clamp(16px, 3vw, 40px);
}
.segment[hidden] { display: none; }
.segment.is-in { animation: segin 0.55s cubic-bezier(.2, .8, .2, 1) both; }
.segment.is-out { animation: segout 0.4s cubic-bezier(.4, 0, .6, 1) both; }
@keyframes segin {
  from { clip-path: inset(50% 0 50% 0); opacity: 0.6; }
  to   { clip-path: inset(0 0 0 0); opacity: 1; }
}
@keyframes segout {
  from { clip-path: inset(0 0 0 0); opacity: 1; }
  to   { clip-path: inset(50% 0 50% 0); opacity: 0; }
}
.segment.is-in .segment-title, .segment.is-in .segment-desc { animation: rise 0.6s 0.12s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes rise {
  from { transform: translateY(14px); opacity: 0; }
  to   { transform: none; opacity: 1; }
}
.segment-count { margin: 0 0 0.6em; font-family: var(--mono); font-size: 13px; color: var(--brass); }
.segment-title {
  margin: 0;
  font-size: clamp(64px, 11vw, 190px);
  line-height: 0.8;
  font-weight: 900;
  font-stretch: 62%;
  letter-spacing: -0.01em;
}
.segment-desc { margin: 0 0 0.4em; font-size: clamp(16px, 1.5vw, 22px); line-height: 1.3; }
@media (min-width: 1000px) {
  .segment-desc { white-space: nowrap; }
}
.segment-title.is-long { font-size: clamp(48px, 7vw, 124px); white-space: nowrap; }

.scan {
  position: absolute;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  z-index: 42;
  background: var(--ink);
  color: var(--brass);
  font-family: var(--mono);
  font-size: 12px;
  padding: 8px 12px;
  white-space: nowrap;
}
.scan[hidden] { display: none; }

/* ---------- Shatter & shake ---------- */

.shatter { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 30; }

.stage.shake { animation: shake 0.6s cubic-bezier(.36,.07,.19,.97); }
@keyframes shake {
  15%, 85% { transform: translate(-2px, 0); }
  30%, 70% { transform: translate(4px, -1px); }
  45%, 55% { transform: translate(-5px, 1px); }
}

/* ---------- Verdict ---------- */

.verdict {
  position: absolute;
  inset: 0;
  z-index: 50;
  display: grid;
  grid-template-rows: auto 1fr;
  align-content: start;
  padding: 3vh 0 0;
  color: var(--ink);
}
.verdict[hidden] { display: none; }
.verdict[data-winner="b"] { color: var(--signal); }
.verdict-word {
  margin: 0;
  font-size: 20vw;
  line-height: 0.8;
  font-weight: 900;
  font-stretch: 62%;
  white-space: nowrap;
  text-align: center;
  letter-spacing: -0.01em;
}
.verdict-word span { display: inline-block; }
.verdict-word .verdict-pre {
  display: block;
  font-size: 0.3em;
  line-height: 1;
  margin-bottom: 0.05em;
  font-stretch: 75%;
  letter-spacing: 0.01em;
}
.verdict-word.is-in { animation: slamin 0.34s cubic-bezier(.2,1.6,.4,1) both; }
@keyframes slamin {
  from { transform: scale(1.35); opacity: 0; }
  to   { transform: none; opacity: 1; }
}
.verdict-body {
  width: min(680px, calc(100% - 2 * var(--gutter)));
  margin: clamp(18px, 4vh, 44px) auto 0;
  display: grid;
  gap: 20px;
  align-content: start;
}
.verdict-line { margin: 0; font-size: clamp(20px, 2vw, 28px); line-height: 1.25; font-weight: 650; font-stretch: 87.5%; }
.verdict-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--mono);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.verdict-table th, .verdict-table td {
  padding: 8px 0;
  border-top: 1px solid color-mix(in srgb, currentColor 25%, transparent);
  text-align: right;
  font-weight: 400;
}
.verdict-table th:first-child, .verdict-table td:first-child { text-align: left; font-family: var(--display); font-size: 15px; font-weight: 600; }
.verdict-table thead th { font-family: var(--display); font-size: 14px; font-weight: 700; border-top: 0; }
.verdict-table .is-total td { font-weight: 700; border-top-color: currentColor; }
.verdict-actions { display: flex; flex-wrap: wrap; gap: 12px 22px; align-items: center; }
.verdict[data-winner="b"] .btn { background: var(--signal); color: var(--ink); }

/* ---------- Ticker ---------- */

.ticker {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: var(--ticker-h);
  background: var(--ink);
  border-top: 2px solid var(--signal);
  overflow: hidden;
  z-index: 60;
}
.ticker-track {
  display: flex;
  align-items: center;
  gap: 44px;
  height: 100%;
  width: max-content;
  padding-left: 100%;
  font-family: var(--mono);
  font-size: 12px;
  white-space: nowrap;
  animation: crawl 60s linear infinite;
}
.ticker:hover .ticker-track { animation-play-state: paused; }
.ticker-track.is-static { animation: none; padding-left: var(--gutter); }
@keyframes crawl { to { transform: translateX(-100%); } }
.ticker-item { text-decoration: none; display: inline-flex; gap: 8px; }
.ticker-item b { color: var(--brass); font-weight: 600; }
.ticker-item:hover { color: var(--brass); }
.ticker-item .w { color: var(--signal); }

/* ---------- Dial ---------- */

/* Channel tabs: bottom-right corner */
.dial {
  position: fixed;
  bottom: calc(var(--ticker-h) + 12px);
  right: 14px;
  z-index: 70;
  display: flex;
  align-items: stretch;
  background: var(--ink);
  color: var(--signal);
  border: 1px solid color-mix(in srgb, var(--signal) 30%, transparent);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
}
.dial-buttons { display: flex; }
.dial-buttons button {
  appearance: none;
  border: 0;
  background: none;
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 11px 16px 10px;
  font-size: 15px;
  font-weight: 700;
  font-stretch: 87.5%;
  white-space: nowrap;
  cursor: pointer;
  opacity: 0.75;
  transition: opacity 0.15s ease, background-color 0.15s ease;
}
.dial-buttons button + button { border-left: 1px solid color-mix(in srgb, var(--signal) 18%, transparent); }
.dial-buttons button:hover { opacity: 1; background: color-mix(in srgb, var(--signal) 8%, transparent); }
.dial-buttons button[aria-pressed="true"] { opacity: 1; background: var(--signal); color: var(--ink); }

/* ---------- Leaderboard ---------- */

.board {
  position: fixed;
  inset: 0 0 var(--ticker-h) 0;
  z-index: 65;
  background: var(--ink);
  color: var(--signal);
  overflow: auto;
  transform: translateY(-100%);
  visibility: hidden;
  transition: transform 0.5s cubic-bezier(.7, 0, .2, 1), visibility 0s 0.5s;
  padding-bottom: 96px;
  overscroll-behavior: contain;
}
body.board-open .board { transform: none; visibility: visible; transition: transform 0.5s cubic-bezier(.7, 0, .2, 1); }
.board-head {
  position: sticky; top: 0; z-index: 2;
  display: flex; justify-content: space-between; align-items: end; gap: 20px;
  padding: 26px var(--gutter) 18px;
  background: var(--ink);
  border-bottom: 2px solid var(--signal);
}
.board-head h2 { margin: 0; font-size: clamp(48px, 7vw, 112px); line-height: 0.82; font-weight: 900; font-stretch: 62%; }
.board-head p { margin: 10px 0 0; font-size: 15px; opacity: 0.8; }
#board-count { font-family: var(--mono); font-size: 12px; color: var(--brass); margin-left: 6px; }

.board-cols, .board-row {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 110px 110px 120px;
  gap: 16px;
  align-items: center;
  padding: 0 var(--gutter);
}
.board-cols { padding-top: 14px; padding-bottom: 10px; font-size: 13px; font-weight: 650; opacity: 0.7; }
.board-cols span:nth-child(n + 3), .board-row > :nth-child(n + 3) { text-align: right; }
.board-list { list-style: none; margin: 0; padding: 0; }
.board-row {
  min-height: 68px;
  border-bottom: 1px solid color-mix(in srgb, var(--signal) 13%, transparent);
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 15px;
}
.board-pos { font-family: var(--display); font-size: 30px; font-weight: 900; font-stretch: 62%; color: var(--brass); }
.board-row:nth-child(1) .board-pos { font-size: 40px; }
.board-wallet { display: flex; align-items: center; gap: 14px; min-width: 0; }
.board-avatar {
  width: 46px; height: 46px; flex: none;
  border-radius: 50%;
  background: var(--teal);
  display: grid; place-items: center;
  overflow: hidden;
}
.board-row.is-you .board-avatar { background: var(--coral); }
.board-avatar svg { width: 118%; height: 118%; }
.board-addr { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-you {
  font-family: var(--display); font-size: 13px; font-weight: 750;
  padding: 3px 8px 2px; background: var(--coral); color: var(--ink);
}
.board-wins { font-family: var(--display); font-size: 30px; font-weight: 900; font-stretch: 70%; }
.board-row.is-you { background: color-mix(in srgb, var(--coral) 16%, transparent); }
.board-me {
  position: sticky; bottom: 0;
  background: var(--ink-2);
  border-top: 2px solid var(--coral);
}
.board-me .board-row { border-bottom: 0; }
.board-empty { padding: 40px var(--gutter); font-size: 18px; max-width: 46ch; line-height: 1.4; }

@media (max-width: 820px) and (orientation: portrait) {
  .board-cols { display: none; }
  .board-row { grid-template-columns: 44px minmax(0, 1fr) 64px; padding: 10px 16px; }
  .board-row > :nth-child(4), .board-row > :nth-child(5) { display: none; }
  .board-pos { font-size: 24px; }
  .board-wins { font-size: 24px; }
  .board-avatar { width: 36px; height: 36px; }
}

/* ---------- Grain & scanlines ---------- */

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 150;
  background-image:
    repeating-linear-gradient(to bottom, rgba(0,0,0,0.07) 0 1px, transparent 1px 3px),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");
  opacity: 0.18;
  mix-blend-mode: overlay;
  animation: grain 0.6s steps(3) infinite;
}
@keyframes grain {
  0% { background-position: 0 0, 0 0; }
  33% { background-position: 0 1px, -40px 30px; }
  66% { background-position: 0 2px, 50px -20px; }
}

/* ---------- Portrait / phones: the seam turns horizontal ---------- */

@media (max-width: 820px) and (orientation: portrait) {
  :root { --ticker-h: 34px; }

  .side-a, .side-b { left: 0; right: 0; width: auto; }
  .side-a { top: 0; bottom: auto; height: calc(var(--p) * 1%); }
  .side-b { top: auto; bottom: 0; height: calc((100 - var(--p)) * 1%); }

  .seam { top: calc(var(--p) * 1%); bottom: auto; left: 0; right: 0; width: auto; height: 0; }
  .seam-line { top: -1px; bottom: auto; left: 0; right: 0; width: auto; height: 2px; }
  .seam-handle { top: calc(var(--mark-size) * 0.43 + 8px); left: auto; right: 12px; transform: none; padding: 5px 8px; }
  .readout { font-size: 11px; }
  .seam-hints { display: none; }

  .mark {
    top: calc(var(--p) * 1%);
    height: calc(var(--mark-size) * 0.86);
    transform: translateY(-50%);
  }
  .mark-layer { align-items: center; }
  .mark-a { clip-path: inset(0 0 50% 0); }
  .mark-b { clip-path: inset(50% 0 0 0); }

  .creature-wrap { top: auto; bottom: auto; height: 38%; }
  .side-a .creature-wrap { top: 64px; }
  .side-b .creature-wrap { bottom: 12px; }

  .side-inner { width: 100%; padding: 0 16px; gap: 10px; }
  .side-a .side-inner { bottom: calc(var(--mark-size) * 0.62 + 6px); right: 0; }
  .side-b .side-inner { top: calc(var(--mark-size) * 0.62 + 6px); bottom: auto; }
  .side-a .creature-wrap, .side-b .creature-wrap { left: auto; right: 0; width: 42%; }
  :root { --inner-w: 100%; }
  .side-a .side-inner, .side-b .side-inner { align-items: flex-start; text-align: left; padding-right: 44%; }
  .side-a .controls { justify-content: flex-start; }
  .side-a .note { margin-left: 0; }
  .side-a .creature-wrap { top: 12px; }

  .tag-name { font-size: 26px; }
  .tag-meta { font-size: 13px; }
  .telemetry { grid-template-columns: 1fr 1fr; column-gap: 12px; }
  .tele-row, .side-b .tele-row { grid-template-columns: 1fr; gap: 0; padding: 5px 0; }
  .side-b .tele-row dt, .side-a .tele-row dt { order: 0; text-align: left; font-size: 12px; }
  .side-b .tele-row dd { order: 1; }
  .side-a .tele-sub { justify-self: start; }
  .tele-sub { display: none; }
  .tele-row.is-total { grid-column: 1 / -1; }
  .tele-row.is-total .tele-value { font-size: 26px; }
  .tele-value { font-size: 14px; }
  .btn { padding: 12px 16px 11px; font-size: 15px; }
  .note { font-size: 13px; }

  body[data-channel="kol"] .side-b .side-inner { top: calc(var(--mark-size) * 0.5 + 6px); padding-right: 16px; }
  .roster { max-height: 34vh; }

  .segment { grid-template-columns: 1fr; gap: 6px; }
  .segment-count, .segment-desc { margin: 0; }

  .dial { bottom: calc(var(--ticker-h) + 8px); right: 8px; }
  .dial-buttons button { padding: 9px 10px 8px; font-size: 13px; gap: 0; }
  .dial-sound { padding: 0 9px; }

  .verdict-body { margin-top: 18px; }
  body[data-phase="verdict"] :is(.side-a, .side-b) .creature-wrap { width: 36vw; top: 62%; }
}

/* Short landscape screens: shrink the side furniture */
@media (max-height: 760px) and (orientation: landscape) {
  .tele-sub { display: none; }
  .tele-row { padding: 6px 0 5px; }
  .tag-meta { display: none; }
  .side-inner { gap: 12px; padding-bottom: 18px; }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  .grain, .ticker-track, .onair-dot, .presence-dot, .btn-search, .btn-search::after { animation: none !important; }
  .board, body.board-open .board { transition: none; }
  .ticker-track { padding-left: var(--gutter); }
  .stage.shake, .segment.is-in, .segment.is-out, .segment-title, .segment-desc, .verdict-word.is-in { animation: none !important; }
}

/* ---------- Phase overrides ---------- */

/* While a match is on air or showing its verdict, side B always shows the opponent. */
body:is([data-phase="live"], [data-phase="verdict"]) .view-kol { display: none; }
body:is([data-phase="live"], [data-phase="verdict"]) .view-match { display: flex; }
body:is([data-phase="live"], [data-phase="verdict"]) #creature-b { opacity: 1; }
body:is([data-phase="live"], [data-phase="verdict"])[data-channel="kol"] .side-b .side-inner { top: auto; }
body:is([data-phase="live"], [data-phase="verdict"]) .controls { visibility: hidden; }
body[data-phase="loading"] .controls .btn,
body[data-phase="loading"] .controls .btn-text { visibility: hidden; }

/* Verdict: the winner owns the screen. Its creature gloats bottom corner, telemetry clears out. */
body[data-phase="verdict"] .side-inner,
body[data-phase="verdict"] .seam { visibility: hidden; }
body[data-phase="verdict"] :is(.side-a, .side-b) .creature-wrap {
  top: 48%;
  bottom: 2vh;
  left: auto;
  right: 3vw;
  width: 24vw;
}


