/*
 * Copyright © 2026 Averox. All Rights Reserved.
 * https://averox.com/
 */

/* Single Sightscreen green theme. --brand-* / --text-* come from brand.css.
   Text colour is chosen by surface (.surface-dark / .surface-light), never by
   brand green. */
:root {
  --bg: var(--brand-surface-dark, #0B3B27);
  --bg2: #0E4A32;
  --surface: var(--brand-surface-card, #E6EFE9);
  --surface2: var(--brand-surface-white, #FFFFFF);
  --text: var(--text-on-dark, #FFFFFF);
  --textDim: var(--text-on-dark-muted, #D4E6DB);
  --line: rgba(230, 242, 234, 0.18);
  --brand: var(--brand-primary);
  --brand2: var(--brand-secondary);
  --accent: var(--brand-accent);
  --sky: var(--brand-accent);
  --gold: var(--brand-secondary);
  --ok: #1CAA57;
  --warn: #E0A44A;
  --btn: var(--brand-on-primary, #FFFFFF);
  --grad: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-secondary) 90%);
  --grad2: linear-gradient(135deg, var(--brand-accent) 0%, var(--brand-primary) 100%);
  --glow: color-mix(in srgb, var(--brand-primary) 26%, transparent);
  --font: "Manrope", system-ui, sans-serif;
  --display: "Manrope", system-ui, sans-serif;
  --board: "Barlow Condensed", "Arial Narrow", Impact, sans-serif;
  --radius: 16px;
  --radius-lg: 22px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---- Surface text tokens (inherit; do not set literal text colours) ---- */
.surface-dark {
  color: var(--text-on-dark);
}
.surface-dark .muted,
.surface-dark .hero-lede,
.surface-dark .tv-kicker { color: var(--text-on-dark-body); }
.surface-dark .eyebrow,
.surface-dark h2,
.surface-dark label,
.surface-dark .wait { color: var(--text-on-dark-muted); }
.surface-dark a { color: var(--link-on-dark); text-decoration: underline; text-underline-offset: 2px; }
.surface-dark a.btn,
.surface-dark a.powered-by,
.surface-dark .btn { text-decoration: none; }
.surface-dark input::placeholder,
.surface-dark textarea::placeholder { color: var(--text-on-dark-muted); opacity: 1; }

.surface-light {
  color: var(--text-on-light);
}
.surface-light .muted,
.surface-light .hero-lede { color: var(--text-on-light-muted); }
.surface-light .eyebrow,
.surface-light h2,
.surface-light label { color: var(--text-on-light-muted); }
.surface-light a { color: var(--link-on-light); }
.surface-light a.btn { text-decoration: none; color: inherit; }
.surface-light .login-title,
.surface-light h1 { color: var(--text-on-light); }
.surface-light input::placeholder,
.surface-light textarea::placeholder { color: var(--text-on-light-muted); opacity: 1; }

* { box-sizing: border-box; }
html, body {
  margin: 0; min-height: 100%;
  background: var(--bg); color: var(--text-on-dark);
  font-family: var(--font);
}
body {
  background:
    radial-gradient(900px 420px at -10% -20%, color-mix(in srgb, var(--brand) 28%, transparent), transparent 60%),
    radial-gradient(700px 380px at 110% 0%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 55%),
    radial-gradient(640px 360px at 80% 110%, color-mix(in srgb, var(--sky) 16%, transparent), transparent 50%),
    var(--bg);
}
button, input, select, textarea { font-family: inherit; color: inherit; }
a { color: var(--link-on-dark); }

.app { width: 100%; max-width: none; margin: 0; padding: 22px 28px 64px; box-sizing: border-box; }

/* ---------- Login: full-bleed pavilion ---------- */
.login-page {
  position: relative;
  min-height: 100dvh;
  overflow: hidden;
  isolation: isolate;
}
.login-orbs { position: absolute; inset: 0; pointer-events: none; z-index: 0; }
.orb {
  position: absolute; border-radius: 50%; filter: blur(40px);
  animation: drift 18s ease-in-out infinite alternate;
}
.orb-a { width: 42vw; height: 42vw; max-width: 520px; max-height: 520px; left: -8%; top: -12%; background: color-mix(in srgb, var(--brand) 55%, transparent); }
.orb-b { width: 34vw; height: 34vw; max-width: 420px; max-height: 420px; right: -6%; top: 8%; background: color-mix(in srgb, var(--accent) 45%, transparent); animation-delay: -4s; }
.orb-c { width: 28vw; height: 28vw; max-width: 340px; max-height: 340px; left: 18%; bottom: -12%; background: color-mix(in srgb, var(--sky) 40%, transparent); animation-delay: -8s; }
.orb-d { width: 18vw; height: 18vw; max-width: 220px; max-height: 220px; right: 18%; bottom: 10%; background: color-mix(in srgb, var(--gold) 38%, transparent); animation-delay: -2s; }
@keyframes drift {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(4%, 6%) scale(1.08); }
}

.login-settings {
  position: absolute; top: 22px; right: 22px; z-index: 5;
  background: var(--brand-surface-card);
  color: var(--text-on-light);
}

.login-stage {
  position: relative; z-index: 1;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
}
.login-hero {
  position: relative;
  padding: 56px 48px 48px;
  display: flex; align-items: flex-end;
  overflow: hidden;
}
.pitch {
  position: absolute; inset: 12% 8% 10% 6%;
  border: 1.5px solid color-mix(in srgb, var(--gold) 35%, transparent);
  border-radius: 999px / 46%;
  opacity: 0.45;
  pointer-events: none;
}
.pitch::before, .pitch::after {
  content: ""; position: absolute; left: 50%; transform: translateX(-50%);
  width: 22%; height: 28%;
  border: 1.5px solid color-mix(in srgb, var(--sky) 50%, transparent);
  border-radius: 8px;
}
.pitch::before { top: 8%; }
.pitch::after { bottom: 8%; }
.hero-copy { position: relative; max-width: 520px; }
.hero-copy h1 {
  font-size: clamp(40px, 5.4vw, 64px);
  line-height: 1.05;
  margin: 10px 0 16px;
}
.hero-lede {
  font-size: 16px; line-height: 1.55;
  max-width: 38ch; margin: 0 0 22px;
}
/* color-pills removed — developer artefact (round 1e) */

.login-panel {
  display: grid; place-items: center;
  padding: 72px 40px 40px;
}
.login-card {
  width: min(440px, 100%);
  padding: 28px 26px 24px;
  /* Opaque card so on-light text stays readable (no green bleed-through). */
  background: var(--brand-surface-card);
  border: 1px solid color-mix(in srgb, var(--text-on-light) 12%, transparent);
  box-shadow:
    0 30px 80px color-mix(in srgb, var(--brand) 22%, transparent),
    inset 0 1px 0 rgba(255,255,255,.08);
  border-radius: 24px;
}
.login-title {
  font-family: var(--display);
  font-size: 32px; letter-spacing: 0; text-transform: none;
  margin: 6px 0 8px; font-weight: 400;
}
.login-card form { margin-top: 18px; }
.login-card label { margin-top: 12px; }
.login-card label:first-of-type { margin-top: 0; }
/* Dark inputs inside the light login card — placeholders use on-dark-muted. */
.login-card input,
.login-card select,
.login-card textarea {
  background: var(--bg2);
  color: var(--text-on-dark);
  border-color: color-mix(in srgb, var(--text-on-dark) 22%, transparent);
}
.login-card input::placeholder,
.login-card textarea::placeholder {
  color: var(--text-on-dark-muted);
  opacity: 1;
}
.btn-block { width: 100%; margin-top: 6px; padding: 14px 16px; font-size: 15px; }
.quick-accounts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.quick-accounts .chip { background: var(--bg2); }

.topbar { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.console-bar {
  padding: 14px 16px;
  background: var(--brand-surface-card);
  border: 1px solid color-mix(in srgb, var(--text-on-light) 12%, transparent);
  border-radius: 18px;
  color: var(--text-on-light);
}
.console-bar .eyebrow, .console-bar .muted { color: var(--text-on-light-muted); }
.console-bar h1 { color: var(--text-on-light); }
.console-bar .btn.ghost {
  color: var(--text-on-light);
  border-color: color-mix(in srgb, var(--text-on-light) 28%, transparent);
}
.console-bar .icon-btn {
  color: var(--text-on-light);
  background: var(--brand-surface-white);
  border-color: color-mix(in srgb, var(--text-on-light) 18%, transparent);
}
.topbar .actions { display: flex; gap: 8px; align-items: center; }
.mark {
  width: 48px; height: 48px; border-radius: 12px; flex-shrink: 0;
  background: var(--brand-primary);
  border: 1.5px solid color-mix(in srgb, var(--brand-primary) 70%, #fff);
  display: grid; place-items: center;
  font-family: var(--board); font-size: 18px; color: var(--brand-on-primary);
  box-shadow: 0 8px 24px var(--glow);
  overflow: hidden;
}
.mark-lg {
  width: 84px; height: 84px; font-size: 32px;
  margin-bottom: 18px; border-width: 2px; border-radius: 16px;
}
/* Square mark — do not crop the swoosh into a circle. */
.mark img { width: 100%; height: 100%; object-fit: contain; display: block; }
.eyebrow {
  font-size: 11px; letter-spacing: 2.2px; text-transform: uppercase;
  font-weight: 700;
}
.dls-report-lines {
  margin-top: 10px;
  display: grid;
  gap: 4px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--text);
}
.dls-report-result {
  margin-top: 12px;
  font-family: var(--display);
  font-size: 20px;
  line-height: 1.25;
  color: var(--text);
}
.dls-report-explain {
  margin-top: 8px;
}
h1 { font-family: var(--display); font-weight: 400; font-size: 28px; margin: 0; letter-spacing: 0.2px; }
h2 { font-size: 12px; letter-spacing: 1.8px; text-transform: uppercase; margin: 22px 0 10px; }
.muted { font-size: 13px; line-height: 1.45; }
.legal-foot { margin-top: 16px; text-align: center; }
.legal-foot a { text-decoration: underline; font-size: 13px; }
.grow { flex: 1; min-width: 0; }

.palette-bar { display: flex; gap: 6px; margin: 0 0 18px; }
.palette-bar span {
  height: 5px; flex: 1; border-radius: 99px;
}
.palette-bar span:nth-child(1) { background: var(--brand); }
.palette-bar span:nth-child(2) { background: var(--accent); }
.palette-bar span:nth-child(3) { background: var(--sky); }
.palette-bar span:nth-child(4) { background: var(--gold); }

.card {
  background: var(--brand-surface-card);
  border: 1px solid color-mix(in srgb, var(--text-on-light) 12%, transparent);
  border-radius: 18px;
  padding: 18px;
  margin-bottom: 12px;
  color: var(--text-on-light);
}
.card .muted, .card label, .card h2, .card .eyebrow { color: var(--text-on-light-muted); }
.card a { color: var(--link-on-light); }
.card .btn.ghost {
  color: var(--text-on-light);
  border-color: color-mix(in srgb, var(--text-on-light) 28%, transparent);
}
.card .score, .card .score.sm { color: var(--text-on-light); }
.card .live {
  color: var(--text-on-light);
  background: var(--brand-accent);
  border-radius: 99px;
  padding: 2px 8px;
}
.card .status-pill { color: var(--text-on-light-muted); }
.card .status-pill.live {
  background: var(--brand-accent);
  border-color: var(--brand-accent);
  color: var(--text-on-light);
}
.card input, .card select, .card textarea {
  background: var(--brand-surface-white);
  color: var(--text-on-light);
  border-color: color-mix(in srgb, var(--text-on-light) 18%, transparent);
}
.card input::placeholder { color: var(--text-on-light-muted); }
.create-card { padding: 20px; }
.create-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card.interactive { cursor: pointer; transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease; }
.card.interactive:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--brand) 55%, var(--line));
  box-shadow: 0 10px 28px var(--glow);
}

.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }

label { display: block; font-size: 11px; letter-spacing: 1.4px; text-transform: uppercase; margin: 0 0 6px; font-weight: 600; }
input, select, textarea {
  width: 100%; background: var(--bg2); color: var(--text-on-dark);
  border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px; font-size: 14px;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--glow); }
input::placeholder, textarea::placeholder { color: var(--text-on-dark-muted); opacity: 1; }

.icon-btn {
  width: 42px; height: 42px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--bg2);
  color: var(--text-on-dark); cursor: pointer; display: grid; place-items: center;
}
.icon-btn:hover { border-color: var(--text-on-dark-muted); color: var(--text-on-dark); }
.icon-btn svg { width: 20px; height: 20px; }

.btn {
  appearance: none; border: 1px solid var(--line); background: var(--surface2);
  color: var(--text-on-light); border-radius: 12px; padding: 11px 16px; cursor: pointer; font-weight: 600;
}
/* Disabled: fade the whole control (≥60%), never recolour the label to green. */
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn.primary {
  /* Solid fill (not gradient) so fg/bg contrast is unambiguous and measurable. */
  background: var(--brand-primary); border: 0;
  color: var(--brand-on-primary); box-shadow: 0 8px 20px var(--glow);
}
.btn.primary:disabled { color: var(--brand-on-primary); opacity: 0.6; }
.btn.primary:hover:not(:disabled) { filter: brightness(1.07); transform: translateY(-1px); }
.btn.accent {
  background: var(--brand-accent); border: 0;
  color: var(--text-on-light); /* #0B2A1C on accent fill */
}
.btn.warn {
  border-color: var(--warn);
  color: var(--text-on-dark);
  background: color-mix(in srgb, var(--warn) 22%, var(--bg2));
}
.surface-light .btn.warn,
.card .btn.warn {
  color: var(--text-on-light);
  background: color-mix(in srgb, var(--warn) 18%, var(--brand-surface-white));
}
.btn.ok { border-color: var(--ok); color: var(--text-on-light); background: var(--ok); }
.btn.ghost {
  background: transparent; color: var(--text-on-dark);
  border-color: color-mix(in srgb, var(--text-on-dark) 35%, transparent);
}
.surface-light .btn.ghost { color: var(--text-on-light); border-color: color-mix(in srgb, var(--text-on-light) 28%, transparent); }
.pad { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.pad .btn { font-family: var(--board); font-size: 26px; padding: 16px 0; letter-spacing: 1px; }
.pad .btn.active, .chip.active {
  background: var(--brand); color: var(--brand-on-primary); border-color: var(--brand);
}
.chip.warn { border-color: var(--warn); color: var(--warn); cursor: default; }

.chip {
  border: 1px solid var(--line); background: transparent; color: inherit;
  border-radius: 999px; padding: 7px 12px; cursor: pointer; font-size: 12px; font-weight: 600;
}
.chip.accent {
  background: var(--brand-accent); border-color: var(--brand-accent);
  color: var(--text-on-light);
}
.score { font-family: var(--board); font-size: 56px; letter-spacing: 2px; color: var(--text-on-dark); line-height: 1; }
.score.sm { font-size: 28px; color: var(--text-on-dark); }
.live {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--text-on-light); background: var(--brand-accent);
  border-radius: 99px; padding: 3px 10px;
  font-size: 11px; letter-spacing: 1.6px; font-weight: 700;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-on-light); animation: pulse 1s ease-in-out infinite alternate; }
@keyframes pulse { from { opacity: .35 } to { opacity: 1 } }

.crest {
  width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
  font-family: var(--board); font-size: 13px; color: #fff; letter-spacing: 0.4px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.18);
  flex-shrink: 0;
}
.status-pill {
  font-size: 10px; letter-spacing: 1.2px; text-transform: uppercase; font-weight: 700;
  border: 1px solid var(--line); border-radius: 99px; padding: 4px 8px;
}
.status-pill.live {
  border-color: var(--brand-accent); background: var(--brand-accent);
  color: var(--text-on-light);
}

.hidden { display: none !important; }
.err { color: var(--warn); font-size: 13px; min-height: 0; }
.err:empty { display: none; }
.ok-msg { color: var(--ok); font-size: 13px; min-height: 0; }
.ok-msg:empty { display: none; }

/* Compact scorer notice — same kicker/title/detail family as FOUR/SIX,
   without the full-screen celebration animation. */
.scorer-notice {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 16px;
  box-sizing: border-box;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.scorer-notice.show {
  visibility: visible;
  pointer-events: auto;
  animation: scorer-notice-hold 3.2s ease forwards;
}
.scorer-notice-veil {
  position: absolute;
  inset: 0;
  background: rgba(5, 5, 5, 0.55);
}
.scorer-notice-card {
  position: relative;
  width: min(520px, 92vw);
  max-height: min(70vh, 420px);
  overflow: auto;
  text-align: center;
  padding: 22px 22px 24px;
  border-radius: 22px;
  background: var(--bg2);
  color: var(--text-on-dark);
  border: 1px solid color-mix(in srgb, var(--text-on-dark) 22%, transparent);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}
.scorer-notice[data-kind="ok"] .scorer-notice-card {
  border-color: color-mix(in srgb, var(--ok) 45%, var(--line));
}
.scorer-notice-kicker {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 999px;
  border: 1.2px solid color-mix(in srgb, var(--text-on-dark) 35%, transparent);
  color: var(--text-on-dark-muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}
.scorer-notice[data-kind="ok"] .scorer-notice-kicker {
  border-color: color-mix(in srgb, var(--text-on-dark) 45%, transparent);
  color: var(--text-on-dark-body);
}
.scorer-notice-title {
  margin-top: 10px;
  font-family: var(--board);
  font-size: clamp(32px, 6vw, 52px);
  line-height: 0.95;
  letter-spacing: 0.04em;
  color: var(--text-on-dark);
}
.scorer-notice[data-kind="ok"] .scorer-notice-title { color: var(--ok); }
.scorer-notice-detail {
  margin-top: 10px;
  font-size: clamp(14px, 2.2vw, 17px);
  font-weight: 600;
  line-height: 1.4;
  color: var(--text);
}
@keyframes scorer-notice-hold {
  0% { opacity: 0; }
  8% { opacity: 1; }
  82% { opacity: 1; }
  100% { opacity: 0; }
}
.feed { font-size: 13px; color: color-mix(in srgb, var(--text) 82%, transparent); line-height: 1.5; }
.feed div { padding: 6px 0; border-bottom: 1px solid var(--line); }
.wagon { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }

.sheet-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.45);
  display: grid; place-items: end center; z-index: 40;
}
.sheet {
  width: min(520px, 100%); background: var(--brand-surface-card);
  border: 1px solid color-mix(in srgb, var(--text-on-light) 12%, transparent);
  border-radius: 20px 20px 0 0;
  padding: 16px 20px 28px;
  color: var(--text-on-light);
}
.sheet h1, .sheet .login-title { color: var(--text-on-light); }
.sheet .muted, .sheet label, .sheet .eyebrow { color: var(--text-on-light-muted); }
.sheet a { color: var(--link-on-light); }
.sheet-handle { width: 40px; height: 4px; border-radius: 4px; background: var(--line); margin: 0 auto 16px; }
.layout-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.layout-tile {
  border: 1px solid var(--line); border-radius: 14px; padding: 12px;
  background: var(--bg2); cursor: pointer; text-align: left; color: inherit;
}
.layout-tile.selected { border-color: var(--brand); box-shadow: 0 0 0 2px var(--glow); }

/* ---------- Scoring desk ---------- */
.desk-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.desk-title h1 { font-size: 26px; }
.desk-score {
  display: grid; grid-template-columns: 1.2fr 1fr; gap: 16px;
  background: var(--bg2);
  border: 1px solid color-mix(in srgb, var(--text-on-dark) 18%, transparent);
  border-radius: 22px; padding: 20px 22px; margin-bottom: 16px;
  box-shadow: 0 16px 40px var(--glow);
  color: var(--text-on-dark);
}
.score-wkts { color: var(--textDim); font-size: 0.62em; }
.desk-crease { display: grid; gap: 10px; align-content: center; }
.desk-slot {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px;
}
.desk-slot .who { min-width: 0; }
.desk-slot span { display: block; font-size: 10px; letter-spacing: 1.4px; text-transform: uppercase; color: var(--textDim); font-weight: 700; }
.desk-slot b { font-size: 15px; font-weight: 600; }
.desk-slot .fig { font-family: var(--board); font-size: 22px; color: var(--text-on-dark); white-space: nowrap; }
.desk-slot .fig span { color: var(--text-on-dark-muted); font-size: 0.7em; letter-spacing: 0; text-transform: none; font-weight: 400; }
.desk-swap {
  justify-self: center;
  min-width: 72px;
  padding: 6px 12px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.desk-swap:disabled { opacity: 0.4; cursor: not-allowed; }
.desk-on-field {
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
}
.desk-on-field > div:last-child {
  grid-column: 1 / -1;
}
.desk-swap-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-bottom: 6px;
}
.desk-swap-wrap .desk-swap {
  min-width: 44px;
  font-size: 20px;
  padding: 8px 10px;
}
label .desk-fig { float: right; font-style: normal; font-family: var(--board); font-size: 14px; color: var(--text-on-dark-body); letter-spacing: 0.4px; }
.desk-panel {
  background: var(--bg2);
  border: 1px solid var(--line); border-radius: 20px; padding: 16px 16px 18px; margin-bottom: 14px;
  color: var(--text-on-dark);
}
.desk-actions { margin-top: 16px; }
.pad .btn-four { color: var(--text-on-light); border-color: color-mix(in srgb, var(--text-on-light) 35%, var(--line)); }
.pad .btn-six { color: var(--text-on-light); border-color: color-mix(in srgb, var(--text-on-light) 35%, var(--line)); background: var(--brand-accent); }
.pad .btn.warn { background: color-mix(in srgb, var(--warn) 14%, var(--surface2)); color: var(--text-on-light); }

/* ---------- TV board ---------- */
/* White / on-dark-body on dark green; accent fill + on-light ink for chips. */
body.tv {
  --bg: var(--brand-surface-dark, #0B3B27);
  --bg2: #0E4A32;
  --surface: #0E4A32;
  --surface2: #124F36;
  --text: var(--text-on-dark);
  --textDim: var(--text-on-dark-muted);
  --line: rgba(255, 255, 255, 0.12);
  min-height: 100dvh; margin: 0; padding: 0;
  color: var(--text-on-dark);
  background:
    radial-gradient(900px 500px at 8% -10%, color-mix(in srgb, var(--brand) 30%, transparent), transparent 55%),
    radial-gradient(700px 420px at 100% 0%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 50%),
    radial-gradient(600px 400px at 70% 110%, color-mix(in srgb, var(--sky) 16%, transparent), transparent 50%),
    var(--bg);
}
.tv-orbs { display: none; }
.tv-top {
  display: flex; align-items: center; gap: 14px;
  padding: 18px 28px 8px;
}
.tv-kicker { font-size: 15px; color: var(--text-on-dark-body); }
.tv-board {
  padding: 8px 28px 32px;
  display: grid; gap: 16px;
  width: 100%;
  max-width: none;
  box-sizing: border-box;
}
.tv-fixture {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px;
  padding: 18px 20px;
  background: var(--bg2);
  border: 1px solid var(--line); border-radius: 22px;
}
.tv-team { display: flex; align-items: center; gap: 14px; }
.tv-team-r { justify-content: flex-end; text-align: right; }
.tv-team-name { font-family: var(--display); font-size: 28px; }
.tv-vs {
  font-family: var(--board); font-size: 22px; letter-spacing: 3px;
  color: var(--text-on-dark-muted);
}
.crest-lg { width: 56px; height: 56px; font-size: 18px; border-radius: 16px; }
.tv-scorecard {
  padding: 22px 24px 26px;
  background: var(--bg2);
  border: 1px solid color-mix(in srgb, var(--text-on-dark) 18%, transparent);
  border-radius: 26px;
  box-shadow: 0 24px 60px var(--glow);
}
.tv-flags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.tv-score-row { display: grid; grid-template-columns: 1.3fr 1fr; gap: 20px; align-items: end; }
.tv-big { font-size: clamp(72px, 11vw, 120px); color: var(--text-on-dark); }
.tv-big span { color: var(--text-on-dark-muted); font-size: 0.55em; }
.tv-bat-label { font-size: 15px; margin-bottom: 4px; }
.tv-meta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tv-meta-grid div {
  background: var(--bg2); border-radius: 14px; padding: 12px 14px; border: 1px solid var(--line);
}
.tv-meta-grid span { display: block; font-size: 11px; letter-spacing: 1.3px; text-transform: uppercase; color: var(--textDim); font-weight: 700; }
.tv-meta-grid b { font-size: 20px; font-weight: 600; }
.tv-waiting { padding: 28px 8px 12px; }
.tv-waiting-title { font-family: var(--display); font-size: 36px; margin: 8px 0; }
.tv-bottom { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; }
.tv-crease, .tv-over {
  background: var(--bg2);
  border: 1px solid var(--line); border-radius: 20px; padding: 16px 18px;
}
.tv-slot { padding: 10px 0; border-bottom: 1px solid var(--line); }
.tv-slot:last-of-type { border-bottom: 0; }
.tv-player { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.tv-player-name { font-size: 22px; font-weight: 600; }
.tv-player-name em { color: var(--text-on-dark-body); font-style: normal; }
.tv-player-fig { font-family: var(--board); font-size: 26px; color: var(--text-on-dark); }
.tv-player-fig span { color: var(--text-on-dark-muted); font-size: 0.7em; }
.wait { color: var(--text-on-dark-muted); font-weight: 500; }
.ball-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; min-height: 44px; }
.ball-chip {
  min-width: 42px; height: 42px; border-radius: 12px;
  display: grid; place-items: center;
  font-family: var(--board); font-size: 18px;
  background: var(--bg2); border: 1px solid var(--line);
  color: var(--text-on-dark);
}
.ball-chip.four {
  background: var(--brand-accent); border-color: var(--brand-accent);
  color: var(--text-on-light);
}
.ball-chip.six {
  background: var(--brand-accent); border-color: var(--brand-accent);
  color: var(--text-on-light);
}
.ball-chip.w { color: var(--warn); border-color: var(--warn); background: color-mix(in srgb, var(--warn) 16%, transparent); }
.ball-chip.ex { color: var(--text-on-dark); border-color: var(--text-on-dark-muted); }
.tv-result { margin: 14px 0 0; font-family: var(--display); font-size: 22px; color: var(--text-on-dark); }
.tv-powerplay, .tv-dls, .chip.powerplay, .status-pill.powerplay, .status-pill.dls {
  background: var(--brand-accent);
  border-color: var(--brand-accent);
  color: var(--text-on-light);
}
.tv-empty { min-height: 60dvh; display: grid; place-content: center; text-align: center; gap: 8px; }
.tv-empty h1 { font-size: 40px; }

.xi-list { display: grid; gap: 6px; max-height: 420px; overflow: auto; padding-right: 4px; }
.xi-player {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  border: 1px solid var(--line); background: var(--bg2); color: var(--text);
  border-radius: 12px; padding: 10px 12px; cursor: pointer; font-weight: 600;
}
.xi-player.on { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 12%, var(--bg2)); }
.xi-player.dim { opacity: 0.45; cursor: not-allowed; }
.xi-player:disabled { cursor: default; }
.xi-check { width: 1.4em; color: var(--text-on-dark-body); }
.xi-tag {
  font-size: 10px; letter-spacing: 1.2px; text-transform: uppercase;
  color: var(--textDim); font-weight: 700;
}
.xi-required {
  border: 1px solid color-mix(in srgb, var(--warn) 55%, var(--line));
  background: var(--bg2);
  border-radius: 12px; padding: 12px 14px; margin: 0 0 14px;
  color: var(--text-on-dark);
}
.xi-required strong { display: block; margin-bottom: 8px; letter-spacing: 0.4px; }
.xi-required p { margin: 8px 0 0; color: var(--text); }
.card.xi-gate { border-color: color-mix(in srgb, var(--warn) 60%, var(--line)); }
.xi-toggle {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; background: transparent; border: 0; color: inherit;
  cursor: pointer; padding: 0; text-align: left; font: inherit;
}
.xi-toggle-title {
  font-family: var(--display); font-size: 20px; font-weight: 600; letter-spacing: 0.2px;
}
.xi-summary { font-size: 12.5px; color: var(--textDim); font-weight: 600; text-align: right; }
.xi-body { margin-top: 14px; }
.card.xi-collapsed { padding-top: 14px; padding-bottom: 14px; }

.avail-cols {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 12px;
}
.avail-team {
  font-size: 11px; letter-spacing: 1.2px; text-transform: uppercase;
  color: var(--textDim); font-weight: 700; margin: 8px 0 4px;
}
.avail-list { margin: 0; padding-left: 18px; }
.avail-list li { margin: 3px 0; font-weight: 600; font-size: 14px; }

.btn.nav-active {
  border-color: var(--text-on-dark-muted);
  color: var(--text-on-dark);
  background: color-mix(in srgb, var(--brand) 22%, transparent);
}
.tourney-card strong { font-size: 16px; }
.tourney-hero {
  background: var(--brand-surface-card);
  color: var(--text-on-light);
}
.table-wrap { overflow-x: auto; }
table.standings {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
table.standings th,
table.standings td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
table.standings th {
  color: var(--textDim);
  font-size: 11px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

@media (max-width: 960px) {
  .login-stage { grid-template-columns: 1fr; }
  .login-hero { min-height: 38dvh; padding: 72px 24px 28px; align-items: flex-end; }
  .hero-copy h1 { font-size: 40px; }
  .login-panel { padding: 8px 18px 40px; }
  .pitch { inset: 16% 10% 18% 10%; }
  .desk-score, .tv-score-row, .tv-bottom, .tv-fixture, .avail-cols { grid-template-columns: 1fr; }
  .tv-team-r { justify-content: flex-start; text-align: left; }
}
@media (max-width: 640px) {
  .score { font-size: 44px; }
  .tv-big { font-size: 64px; }
  .pad { grid-template-columns: repeat(4, 1fr); }
  h1 { font-size: 24px; }
  .mark-lg { width: 68px; height: 68px; font-size: 26px; }
  .tv-top, .tv-board { padding-left: 16px; padding-right: 16px; }
}

/* Product attribution — always the Sightscreen mark, never the club logo. */
.powered-by {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  letter-spacing: 0.02em;
  color: var(--textDim);
  opacity: 0.9;
}
.powered-by img {
  width: 16px;
  height: 16px;
  object-fit: contain;
}
.powered-by[hidden] { display: none !important; }
.powered-by-foot {
  display: flex;
  justify-content: center;
  padding: 12px 16px 20px;
}
.powered-by-tv {
  position: fixed;
  right: 12px;
  bottom: 10px;
  z-index: 40;
  padding: 4px 8px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  font-size: 11px;
  pointer-events: none;
  max-width: 40vw;
}
.powered-by-tv img { width: 14px; height: 14px; }
.powered-by a {
  color: inherit;
  text-decoration: none;
}
.powered-by a:hover { text-decoration: underline; }
@media (max-width: 1280px) {
  .powered-by-tv { right: 8px; bottom: 8px; font-size: 10px; }
}

/* ============================================================
   Pavilion polish — visual hierarchy without changing scoring UX.
   Keeps surface text tokens; brand greens stay on fills / accents.
   ============================================================ */

.app {
  max-width: 1180px;
  margin: 0 auto;
  padding: 20px 22px 72px;
  animation: desk-fade-in 0.45s var(--ease) both;
}
@keyframes desk-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.console-bar {
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  /* Opaque solid — gradient backgrounds break contrast sampling. */
  background: var(--brand-surface-card);
  border: 1px solid color-mix(in srgb, var(--text-on-light) 10%, transparent);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.55) inset;
}
.console-bar h1 {
  font-size: clamp(26px, 3vw, 32px);
  letter-spacing: -0.01em;
}
.console-bar .btn.ghost.nav-active,
.btn.nav-active {
  background: color-mix(in srgb, var(--brand-primary) 14%, var(--brand-surface-white));
  border-color: color-mix(in srgb, var(--brand-primary) 35%, transparent);
  color: var(--text-on-light);
  font-weight: 700;
}

.section-label {
  margin: 28px 0 12px;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-on-dark-muted);
  font-weight: 700;
}
.section-label:first-child { margin-top: 8px; }

.match-stack {
  display: grid;
  gap: 10px;
}

.card {
  border-radius: var(--radius-lg);
  padding: 18px 18px 16px;
  background: var(--brand-surface-card);
  transition: transform 0.2s var(--ease), border-color 0.2s var(--ease),
    box-shadow 0.2s var(--ease);
}
.card.interactive:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--brand-primary) 28%, transparent);
  box-shadow: 0 14px 36px color-mix(in srgb, var(--brand-primary) 16%, transparent);
}
.card.interactive:active { transform: translateY(0); }

.match-tile {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px 16px;
  align-items: center;
  min-height: 76px;
}
.match-tile-crests {
  display: flex;
  align-items: center;
  gap: 8px;
}
.match-tile-vs {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-on-light-muted);
  font-weight: 700;
}
.match-tile-copy strong {
  display: block;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-on-light);
}
.match-tile-score {
  margin-top: 4px;
  font-family: var(--board);
  font-size: 18px;
  letter-spacing: 0.04em;
  color: var(--text-on-light);
}
.match-tile-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}
.crest {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  font-size: 14px;
}

.empty-state {
  border: 1px dashed color-mix(in srgb, var(--text-on-dark) 22%, transparent);
  border-radius: var(--radius-lg);
  padding: 28px 22px;
  text-align: center;
  background: var(--bg2);
  color: var(--text-on-dark);
}
.empty-title {
  margin: 0 0 6px;
  font-family: var(--display);
  font-size: 22px;
  font-weight: 400;
  color: var(--text-on-dark);
}
.empty-state .muted {
  margin: 0;
  color: var(--text-on-dark-body);
  max-width: 36ch;
  margin-inline: auto;
}

/* Create fixture form — quieter labels, white fields */
#create-wrap.card,
.card#create-wrap {
  padding: 20px;
}
.card .grid {
  gap: 14px;
}
.card label {
  letter-spacing: 0.12em;
}
.card input,
.card select,
.card textarea {
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--text-on-light) 14%, transparent);
  background: var(--brand-surface-white);
  color: var(--text-on-light);
  padding: 12px 12px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.card input:focus,
.card select:focus,
.card textarea:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-primary) 18%, transparent);
}

/* Live desk */
.desk-head {
  margin-bottom: 18px;
  padding: 4px 2px 0;
}
.desk-title h1 {
  font-size: clamp(24px, 3.2vw, 34px);
  letter-spacing: -0.015em;
}
.desk-score {
  border-radius: var(--radius-lg);
  padding: 22px 24px 24px;
  background: var(--bg2);
  border: 1px solid color-mix(in srgb, var(--text-on-dark) 14%, transparent);
  box-shadow: 0 18px 40px color-mix(in srgb, #000 28%, transparent);
}
.desk-score .score {
  font-size: clamp(64px, 9vw, 88px);
  letter-spacing: 0.02em;
  margin: 4px 0 8px;
}
.desk-score-main .muted {
  color: var(--text-on-dark-body);
}
.desk-crease {
  gap: 12px;
}
.desk-slot {
  border-radius: 14px;
  padding: 12px 14px;
  background: color-mix(in srgb, #08281B 40%, var(--bg));
  border: 1px solid color-mix(in srgb, var(--text-on-dark) 14%, transparent);
}
.desk-slot b {
  font-size: 16px;
  font-weight: 700;
}
.desk-swap {
  border-radius: 999px !important;
  min-width: 52px;
  font-weight: 700;
}

.desk-panel {
  border-radius: var(--radius-lg);
  padding: 20px 18px 22px;
  background: var(--bg2);
  border: 1px solid color-mix(in srgb, var(--text-on-dark) 14%, transparent);
}
.desk-panel h2 {
  margin-top: 18px;
  color: var(--text-on-dark-muted);
}
.desk-panel h2:first-child { margin-top: 0; }

.pad {
  gap: 10px;
}
.pad .btn {
  border-radius: 14px;
  font-size: 28px;
  padding: 18px 0;
  background: var(--brand-surface-white);
  color: var(--text-on-light);
  border: 1px solid color-mix(in srgb, var(--text-on-light) 12%, transparent);
  transition: transform 0.15s var(--ease), filter 0.15s ease;
}
.pad .btn:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.03);
}
.pad .btn-four {
  background: color-mix(in srgb, var(--brand-accent) 55%, var(--brand-surface-white));
  color: var(--text-on-light);
  border-color: transparent;
}
.pad .btn-six {
  background: var(--brand-accent);
  color: var(--text-on-light);
  border-color: transparent;
}
.pad .btn.warn {
  background: #F3E6D0;
  color: var(--text-on-light);
  border-color: color-mix(in srgb, var(--warn) 40%, transparent);
}

.chip {
  border-radius: 12px;
  padding: 9px 14px;
  background: color-mix(in srgb, var(--text-on-dark) 6%, transparent);
  border: 1px solid color-mix(in srgb, var(--text-on-dark) 22%, transparent);
  color: var(--text-on-dark);
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.chip:hover {
  border-color: color-mix(in srgb, var(--text-on-dark) 40%, transparent);
}
.chip.active {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: var(--brand-on-primary);
}
.chip.warn {
  color: var(--text-on-dark);
  border-color: color-mix(in srgb, var(--warn) 55%, transparent);
  background: color-mix(in srgb, var(--warn) 18%, transparent);
}

.wagon {
  gap: 8px;
}
.wagon .chip {
  min-height: 44px;
  justify-content: center;
  display: inline-flex;
  align-items: center;
  background: color-mix(in srgb, var(--brand-surface-white) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--text-on-dark) 28%, transparent);
  color: var(--text-on-dark-body);
  font-weight: 600;
  letter-spacing: 0.02em;
}
.wagon .chip.active {
  background: var(--brand-accent);
  border-color: var(--brand-accent);
  color: var(--text-on-light);
}

.desk-actions .btn,
.row.desk-actions .btn {
  border-radius: 12px;
}
.feed {
  background: var(--brand-surface-card);
  color: var(--text-on-light);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  border: 1px solid color-mix(in srgb, var(--text-on-light) 10%, transparent);
}
.feed div {
  border-bottom-color: color-mix(in srgb, var(--text-on-light) 10%, transparent);
  color: var(--text-on-light);
}

/* Playing XI */
.xi-player {
  border-radius: 14px;
  padding: 12px 14px;
  background: color-mix(in srgb, var(--brand-surface-white) 7%, var(--bg2));
  border: 1px solid color-mix(in srgb, var(--text-on-dark) 16%, transparent);
  color: var(--text-on-dark);
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s var(--ease);
}
.xi-player:hover:not(:disabled):not(.dim) {
  transform: translateX(2px);
  border-color: color-mix(in srgb, var(--text-on-dark) 32%, transparent);
}
.xi-player.on {
  background: color-mix(in srgb, var(--brand-accent) 22%, var(--bg2));
  border-color: var(--brand-accent);
  color: var(--text-on-dark);
}
.xi-required {
  border-radius: 14px;
  border-style: solid;
  border-color: color-mix(in srgb, var(--warn) 45%, transparent);
  background: color-mix(in srgb, var(--warn) 12%, var(--bg2));
}

/* Login polish */
.login-card {
  animation: desk-fade-in 0.5s var(--ease) 0.05s both;
}
.login-card input:-webkit-autofill,
.login-card input:-webkit-autofill:hover,
.login-card input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text-on-dark);
  caret-color: var(--text-on-dark);
  transition: background-color 9999s ease-out;
  box-shadow: 0 0 0 1000px var(--bg2) inset;
}
.hero-copy h1 {
  font-size: clamp(40px, 5.5vw, 56px);
  line-height: 1.05;
  letter-spacing: -0.02em;
}
.btn.primary {
  border-radius: 14px;
  letter-spacing: 0.01em;
}
.btn.primary:hover:not(:disabled) {
  transform: translateY(-2px);
}

@media (max-width: 720px) {
  .match-tile {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .match-tile-badges { justify-content: flex-start; }
  .app { padding: 14px 14px 56px; }
}
