/* =====================================================================
   SPADES LEAGUE — Tournament Management System
   Visual system: "Broadcast scoreboard / arena."  A bold, sellable league
   product — dark arena base, one confident electric-green accent, GOLD for
   champions, generous rounded surfaces with real depth (no hard boxes),
   athletic Archivo display type. Standings read like a live leaderboard.
   ===================================================================== */

:root {
  /* arena base */
  --bg-0: #080b10;
  --bg-1: #0c1118;
  --surface-1: #141b25;   /* card */
  --surface-2: #1b2531;   /* raised: inputs, slots */
  --surface-3: #243042;   /* hover, chips */
  --hair: rgba(255, 255, 255, 0.06);
  --hair-2: rgba(255, 255, 255, 0.10);

  /* ink */
  --text: #f4f7fb;
  --text-2: #b2bccb;
  --text-3: #79footnote; /* placeholder, overwritten below */
  --text-3: #7a8597;

  /* brand */
  --accent: #2fe07c;       /* electric league green */
  --accent-2: #18b561;
  --accent-soft: rgba(47, 224, 124, 0.14);
  --accent-ink: #05160c;
  --gold: #ffcf5d;         /* champion / #1 */
  --gold-2: #e3a92f;
  --gold-soft: rgba(255, 207, 93, 0.14);
  --silver: #d3dcea;
  --bronze: #e2a05f;
  --spur: #ff944d;         /* spur-of-the-moment */
  --spur-soft: rgba(255, 148, 77, 0.14);
  --danger: #ff5f63;       /* corrections / alerts */
  --danger-soft: rgba(255, 95, 99, 0.14);

  /* type */
  --font-display: "Archivo", "Arial Narrow", system-ui, sans-serif;
  --font-ui: "Hanken Grotesk", system-ui, -apple-system, sans-serif;
  --font-mono: "DM Mono", ui-monospace, SFMono-Regular, monospace;

  /* radii — generous, nothing square */
  --r-xl: 26px;
  --r-lg: 20px;
  --r-md: 14px;
  --r-sm: 11px;
  --r-pill: 999px;

  /* depth */
  --sh-1: 0 1px 0 rgba(255,255,255,.04) inset, 0 12px 26px -16px rgba(0,0,0,.8);
  --sh-2: 0 1px 0 rgba(255,255,255,.05) inset, 0 30px 60px -28px rgba(0,0,0,.85);
  --glow: 0 0 0 1px rgba(47,224,124,.35), 0 14px 40px -10px rgba(47,224,124,.35);
  --glow-gold: 0 0 0 1px rgba(255,207,93,.35), 0 14px 40px -12px rgba(255,207,93,.3);

  --gut: clamp(16px, 2.4vw, 30px);
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font-ui);
  color: var(--text);
  background-color: var(--bg-0);
  background-image:
    radial-gradient(115% 65% at 50% -12%, rgba(47, 224, 124, 0.10), transparent 56%),
    radial-gradient(90% 55% at 88% 0%, rgba(96, 132, 255, 0.06), transparent 60%),
    linear-gradient(180deg, var(--bg-1), var(--bg-0) 60%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.5;
}

/* display helpers */
.mono { font-family: var(--font-mono); font-feature-settings: "tnum" 1; }
.eyebrow {
  font-family: var(--font-ui);
  font-size: 11px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase;
  color: var(--text-3);
}
a { color: inherit; text-decoration: none; }
:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--bg-0), 0 0 0 4px var(--accent); border-radius: 8px; }

.app { position: relative; z-index: 1; min-height: 100%; display: flex; flex-direction: column; }

/* athletic display utility */
.display {
  font-family: var(--font-display);
  font-weight: 800;
  font-stretch: 112%;
  letter-spacing: -0.01em;
}

/* =====================================================================
   MASTHEAD
   ===================================================================== */
.masthead {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: clamp(16px, 3vw, 40px);
  padding: 14px clamp(16px, 3vw, 34px);
  background: linear-gradient(180deg, rgba(20,27,37,.92), rgba(12,17,24,.86));
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--hair);
  position: sticky; top: 0; z-index: 30;
}
.brand { display: inline-flex; align-items: center; gap: 13px; }
.brand__emblem {
  display: grid; place-items: center;
  width: 46px; height: 46px; border-radius: 14px;
  color: var(--accent-ink);
  background: linear-gradient(155deg, var(--accent), var(--accent-2));
  box-shadow: var(--glow), inset 0 1px 1px rgba(255,255,255,.4);
}
.brand__emblem .pip { width: 27px; height: 27px; }
.brand__text { display: flex; flex-direction: column; line-height: 1; }
.brand__name {
  font-family: var(--font-display); font-weight: 900; font-stretch: 115%;
  font-size: 21px; letter-spacing: -0.01em; text-transform: uppercase; color: var(--text);
}
.brand__sub {
  font-family: var(--font-ui); font-size: 10px; font-weight: 700;
  letter-spacing: .24em; text-transform: uppercase; color: var(--accent); margin-top: 6px;
}

/* scoreboard ticker */
.ticker {
  display: flex; align-items: stretch; justify-self: center;
  background: rgba(8, 12, 18, .5);
  border: 1px solid var(--hair); border-radius: var(--r-md);
  overflow: hidden;
}
.ticker__cell { display: flex; flex-direction: column; gap: 4px; padding: 9px 18px; min-width: 0; }
.ticker__cell + .ticker__cell { border-left: 1px solid var(--hair); }
.ticker__k {
  font-family: var(--font-ui); font-size: 9px; font-weight: 700;
  letter-spacing: .16em; text-transform: uppercase; color: var(--text-3); white-space: nowrap;
}
.ticker__v { font-size: 14px; font-weight: 700; color: var(--text); white-space: nowrap; }
.ticker__v.mono { font-weight: 500; }
.livedot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent); margin-right: 8px; vertical-align: middle;
  box-shadow: 0 0 0 0 rgba(47,224,124,.6); animation: pulse 2.2s ease-out infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(47,224,124,.55); }
  70% { box-shadow: 0 0 0 8px rgba(47,224,124,0); }
  100% { box-shadow: 0 0 0 0 rgba(47,224,124,0); }
}

/* credential — segmented role toggle */
.credential { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.credential__label {
  font-family: var(--font-ui); font-size: 9px; font-weight: 700;
  letter-spacing: .2em; text-transform: uppercase; color: var(--text-3);
}
.credential__passes {
  display: inline-flex; gap: 3px; padding: 4px;
  background: rgba(8,12,18,.55); border: 1px solid var(--hair); border-radius: var(--r-pill);
}
.pass {
  appearance: none; cursor: pointer; font-family: var(--font-ui);
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  padding: 7px 14px; border-radius: var(--r-pill); border: 0;
  background: transparent; color: var(--text-2);
  transition: background .16s ease, color .16s ease, transform .12s ease;
}
.pass__role { font-size: 13px; font-weight: 800; letter-spacing: .01em; line-height: 1.1; }
.pass__hint { font-size: 9px; font-weight: 600; letter-spacing: .04em; color: var(--text-3); white-space: nowrap; }
.pass:hover { color: var(--text); }
.pass[aria-pressed="true"] {
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  color: var(--accent-ink);
  box-shadow: 0 6px 18px -8px rgba(47,224,124,.6);
}
.pass[aria-pressed="true"] .pass__hint { color: rgba(5,22,12,.7); }

/* =====================================================================
   TAB RAIL  (desktop sub-bar; mobile floating dock)
   ===================================================================== */
.tabrail {
  display: flex; gap: 4px; align-items: center;
  padding: 10px clamp(16px, 3vw, 34px);
  position: sticky; top: 74px; z-index: 20;
  background: linear-gradient(180deg, rgba(12,17,24,.9), rgba(8,11,16,.7));
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--hair);
  overflow-x: auto; scrollbar-width: none;
}
.tabrail::-webkit-scrollbar { display: none; }
.tab {
  appearance: none; cursor: pointer; font-family: var(--font-ui);
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px; border: 0; border-radius: var(--r-pill);
  background: transparent; color: var(--text-2);
  font-size: 13.5px; font-weight: 700; letter-spacing: .01em; white-space: nowrap;
  transition: background .15s ease, color .15s ease;
}
.tab__i { display: inline-grid; place-items: center; width: 15px; height: 15px; opacity: .85; font-size: 13px; }
.tab__i .pip { width: 14px; height: 14px; }
.tab:hover { color: var(--text); background: var(--surface-2); }
.tab[aria-selected="true"] {
  color: var(--accent-ink); background: linear-gradient(180deg, var(--accent), var(--accent-2));
  box-shadow: 0 6px 16px -8px rgba(47,224,124,.55);
}
.tab[aria-selected="true"] .tab__i { opacity: 1; }
.tab[hidden] { display: none; }

/* =====================================================================
   STAGE + shared
   ===================================================================== */
.stage { flex: 1; width: min(1200px, 100%); margin: 0 auto; padding: var(--gut) clamp(16px, 3vw, 34px) 72px; }
.stage:focus { outline: none; }

.view-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 4px 0 22px; flex-wrap: wrap; }
.view-head h1 {
  font-family: var(--font-display); font-weight: 900; font-stretch: 115%;
  font-size: clamp(26px, 4vw, 40px); line-height: .98; letter-spacing: -0.02em;
  margin: 6px 0 0; text-transform: uppercase; color: var(--text);
}
.view-head__meta { text-align: right; color: var(--text-2); font-size: 12.5px; }

/* card surface */
.paper {
  background: var(--surface-1);
  color: var(--text);
  border: 1px solid var(--hair);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-1);
}

/* flags — rounded enamel pins */
.flag {
  display: inline-block; width: 24px; height: 16px; border-radius: 4px; overflow: hidden; flex: 0 0 auto;
  box-shadow: 0 0 0 1px rgba(0,0,0,.4), inset 0 0 0 1px rgba(255,255,255,.14), 0 2px 4px rgba(0,0,0,.35);
}
.flag svg { display: block; width: 100%; height: 100%; }
.flag--lg { width: 36px; height: 24px; border-radius: 5px; }
.flag--xl { width: 50px; height: 33px; border-radius: 6px; }

.player { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.player__name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player__handle { font-family: var(--font-mono); font-size: 11px; color: var(--text-3); }

/* badges / pills */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-ui); font-size: 10px; font-weight: 800;
  letter-spacing: .12em; text-transform: uppercase; line-height: 1;
  padding: 6px 11px; border-radius: var(--r-pill);
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge--scheduled { color: var(--text-2); background: var(--surface-3); }
.badge--spur { color: var(--spur); background: var(--spur-soft); }
.badge--live { color: var(--accent); background: var(--accent-soft); }
.badge--live .dot { box-shadow: 0 0 0 0 rgba(47,224,124,.5); animation: pulse 2.2s ease-out infinite; }
.badge--awaiting { color: var(--danger); background: var(--danger-soft); }
.badge--done { color: var(--text-3); background: var(--surface-3); }
.on-felt { color: inherit; }

/* buttons */
.btn {
  appearance: none; cursor: pointer; font-family: var(--font-ui);
  font-size: 14px; font-weight: 800; letter-spacing: .01em;
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  padding: 13px 22px; border-radius: var(--r-pill); border: 0;
  background: var(--surface-3); color: var(--text);
  transition: transform .12s ease, box-shadow .16s ease, background .16s ease, opacity .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn--brass { /* primary CTA = electric accent */
  background: linear-gradient(180deg, var(--accent), var(--accent-2)); color: var(--accent-ink);
  box-shadow: var(--glow);
}
.btn--brass:hover { box-shadow: 0 0 0 1px rgba(47,224,124,.5), 0 18px 44px -10px rgba(47,224,124,.55); }
.btn--brass .pip { color: var(--accent-ink); }
.btn--ghost { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1px var(--hair-2); }
.btn--ghost:hover { background: var(--surface-2); }
.btn--danger { background: var(--danger-soft); color: var(--danger); box-shadow: inset 0 0 0 1px rgba(255,95,99,.4); }
.btn--sm { padding: 9px 15px; font-size: 12.5px; }
.btn[disabled] { opacity: .4; cursor: not-allowed; transform: none; box-shadow: none; }

/* =====================================================================
   FLOOR — lanes (no card grid)
   ===================================================================== */
.floor { display: flex; flex-direction: column; gap: clamp(22px, 3vw, 38px); }
.lane { display: flex; flex-direction: column; gap: 14px; }
.lane__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.lane__title { display: flex; align-items: baseline; gap: 12px; }
.lane__title h2 {
  font-family: var(--font-display); font-weight: 800; font-stretch: 110%;
  font-size: 15px; letter-spacing: .04em; text-transform: uppercase; margin: 0; color: var(--text);
}
.lane__count { font-family: var(--font-mono); font-size: 12px; color: var(--accent); }
.lane__link { font-family: var(--font-ui); font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); cursor: pointer; }
.lane__link:hover { color: var(--accent); }

/* hero "call to the table" */
.callboard {
  display: grid; grid-template-columns: auto 1fr auto; gap: clamp(18px, 3vw, 34px);
  align-items: center; padding: clamp(20px, 2.8vw, 30px);
  border-radius: var(--r-xl); color: var(--text);
  background:
    radial-gradient(120% 160% at 0% 0%, rgba(47,224,124,.10), transparent 45%),
    linear-gradient(180deg, var(--surface-2), var(--surface-1));
  border: 1px solid var(--hair); box-shadow: var(--sh-2);
  position: relative; overflow: hidden;
}
.callboard__table {
  display: grid; place-items: center; text-align: center;
  width: 104px; height: 104px; border-radius: var(--r-lg);
  background: linear-gradient(160deg, var(--gold), var(--gold-2));
  color: #2a1d02; box-shadow: var(--glow-gold), inset 0 1px 1px rgba(255,255,255,.5);
}
.callboard__table .k { font-family: var(--font-ui); font-size: 9px; font-weight: 800; letter-spacing: .2em; text-transform: uppercase; opacity: .8; }
.callboard__table .n { font-family: var(--font-display); font-weight: 900; font-stretch: 120%; font-size: 50px; line-height: .85; }
.callboard__body { min-width: 0; }
.callboard__row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.callboard__name {
  font-family: var(--font-display); font-weight: 900; font-stretch: 115%;
  font-size: clamp(26px, 4vw, 40px); line-height: 1; letter-spacing: -0.02em;
  text-transform: uppercase; margin: 10px 0 6px;
}
.callboard__meta { display: flex; gap: 22px; flex-wrap: wrap; color: var(--text-2); font-size: 13px; margin-top: 8px; }
.callboard__meta b { color: var(--text); font-weight: 800; }
.callboard__count { text-align: right; }
.countdown { font-family: var(--font-display); font-weight: 900; font-stretch: 110%; font-size: clamp(22px, 3vw, 30px); color: var(--accent); letter-spacing: -0.01em; }
.countdown__k { display: block; font-family: var(--font-ui); font-size: 10px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--text-3); margin-bottom: 6px; }

/* winners */
.winners { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.winner {
  display: flex; align-items: center; gap: 14px; padding: 16px;
  border-radius: var(--r-lg); background: var(--surface-1);
  border: 1px solid var(--hair); box-shadow: var(--sh-1);
}
.winner__rosette {
  display: grid; place-items: center; width: 40px; height: 40px; flex: 0 0 auto; border-radius: var(--r-md);
  color: #2a1d02; background: linear-gradient(160deg, var(--gold), var(--gold-2)); box-shadow: var(--glow-gold);
}
.winner__rosette .pip { width: 20px; height: 20px; }
.winner__body { min-width: 0; }
.winner__name { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 15px; }
.winner__name span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.winner__sub { font-family: var(--font-ui); font-size: 11px; font-weight: 600; color: var(--text-3); margin-top: 4px; text-transform: uppercase; letter-spacing: .04em; }
.winner__pts { margin-left: auto; font-family: var(--font-display); font-weight: 900; font-stretch: 110%; font-size: 20px; color: var(--gold); white-space: nowrap; }

/* TD queue */
.queue { display: flex; flex-direction: column; gap: 10px; }
.qstub {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 16px;
  padding: 14px 18px; border-radius: var(--r-lg);
  background: linear-gradient(180deg, rgba(255,95,99,.08), var(--surface-1));
  border: 1px solid rgba(255,95,99,.28); box-shadow: var(--sh-1);
}
.qstub__date { font-family: var(--font-mono); font-size: 12px; color: var(--danger); white-space: nowrap; }
.qstub__name { font-weight: 800; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qstub__name small { display: block; font-weight: 600; color: var(--text-3); font-family: var(--font-ui); font-size: 11px; letter-spacing: .02em; text-transform: uppercase; margin-top: 3px; }

/* leaderboard movers strip on the floor */
.movers { display: flex; flex-direction: column; gap: 8px; }
.mover {
  display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 14px;
  padding: 13px 18px; border-radius: var(--r-md); background: var(--surface-1); border: 1px solid var(--hair);
}
.mover__rank { font-family: var(--font-display); font-weight: 900; font-stretch: 110%; font-size: 16px; color: var(--text-3); width: 34px; }
.mover__pts { font-family: var(--font-mono); color: var(--text-2); }
.move { font-family: var(--font-ui); font-weight: 800; font-size: 12px; display: inline-flex; align-items: center; gap: 3px; min-width: 46px; justify-content: flex-end; }
.move--up { color: var(--accent); }
.move--down { color: var(--danger); }
.move--flat { color: var(--text-3); }

/* =====================================================================
   STANDINGS — broadcast leaderboard
   ===================================================================== */
.ledger { overflow: hidden; padding: 6px; }
.ledger__scroll { overflow-x: auto; }
table.ledger-table { width: 100%; border-collapse: separate; border-spacing: 0 6px; min-width: 640px; }
.ledger-table thead th {
  font-family: var(--font-ui); font-size: 10px; font-weight: 800;
  letter-spacing: .14em; text-transform: uppercase; color: var(--text-3);
  text-align: left; padding: 6px 16px 10px; white-space: nowrap; cursor: pointer; user-select: none;
}
.ledger-table thead th.num, .ledger-table tbody td.num { text-align: right; }
.ledger-table thead th[aria-sort] { color: var(--accent); }
.ledger-table thead th .arrow { margin-left: 4px; }
.ledger-table tbody td { padding: 13px 16px; background: var(--surface-1); vertical-align: middle; border-top: 1px solid var(--hair); border-bottom: 1px solid var(--hair); }
.ledger-table tbody td:first-child { border-left: 1px solid var(--hair); border-radius: var(--r-md) 0 0 var(--r-md); }
.ledger-table tbody td:last-child { border-right: 1px solid var(--hair); border-radius: 0 var(--r-md) var(--r-md) 0; }
.ledger-table tbody tr:hover td { background: var(--surface-2); }
.ledger-table tbody tr.is-top td { background: linear-gradient(180deg, rgba(255,207,93,.07), var(--surface-1)); }
.ledger-cell-player { min-width: 190px; }
.col-pts { font-family: var(--font-display); font-weight: 900; font-stretch: 110%; font-size: 19px; color: var(--accent); }
.col-num { font-family: var(--font-mono); color: var(--text-2); }

.rank-pip {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: var(--r-sm);
  font-family: var(--font-display); font-weight: 900; font-size: 15px; color: var(--text-2); background: var(--surface-3);
}
.rank-pip--medal { color: #2a1d02; background: linear-gradient(160deg, var(--gold), var(--gold-2)); box-shadow: var(--glow-gold); }
.rank-pip--medal.silver { color: #1a2230; background: linear-gradient(160deg, #fff, var(--silver)); box-shadow: 0 8px 22px -12px rgba(211,220,234,.5); }
.rank-pip--medal.bronze { color: #2a1606; background: linear-gradient(160deg, #f0c79b, var(--bronze)); box-shadow: 0 8px 22px -12px rgba(226,160,95,.5); }
.rank-pip .pip { width: 16px; height: 16px; }

.ledger-note {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 16px 18px; margin-top: 16px; border-radius: var(--r-lg);
  background: var(--surface-1); border: 1px solid var(--hair); color: var(--text-2); font-size: 12.5px;
}
.ledger-note .pip { width: 16px; height: 16px; color: var(--accent); flex: 0 0 auto; }
.ledger-note b { color: var(--text); font-weight: 800; }

/* =====================================================================
   SCHEDULE
   ===================================================================== */
.fixtures { display: flex; flex-direction: column; gap: 12px; }
.fixture { display: grid; grid-template-columns: 66px 1fr auto; gap: 18px; align-items: center; padding: 16px 18px; }
.datechip {
  text-align: center; line-height: 1; padding: 10px 0; border-radius: var(--r-md); background: var(--surface-2);
}
.datechip .mon { display: block; font-family: var(--font-ui); font-size: 10px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.datechip .day { display: block; font-family: var(--font-display); font-weight: 900; font-stretch: 110%; font-size: 30px; color: var(--text); margin-top: 2px; }
.fixture--spur .datechip .mon { color: var(--spur); }
.fixture--awaiting .datechip .mon { color: var(--danger); }
.fixture__body { min-width: 0; }
.fixture__name { font-family: var(--font-display); font-weight: 800; font-stretch: 108%; font-size: 18px; letter-spacing: -0.01em; color: var(--text); }
.fixture__sub { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 6px; color: var(--text-3); font-size: 12.5px; font-family: var(--font-mono); }
.fixture__right { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.section-label { font-family: var(--font-ui); font-size: 11px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--text-3); margin: 26px 2px 12px; }
.section-label:first-child { margin-top: 4px; }

/* =====================================================================
   RESULTS ARCHIVE
   ===================================================================== */
.archive { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.filed { padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.filed__top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.filed__date { font-family: var(--font-mono); font-size: 11px; letter-spacing: .06em; color: var(--text-3); text-transform: uppercase; }
.filed__name { font-family: var(--font-display); font-weight: 800; font-stretch: 108%; font-size: 19px; letter-spacing: -0.01em; color: var(--text); }
.placeline { display: flex; align-items: center; gap: 11px; padding: 9px 0; border-top: 1px solid var(--hair); }
.placeline:first-of-type { border-top: 0; }
.placeline__rank { font-family: var(--font-ui); font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); width: 66px; flex: 0 0 auto; }
.placeline__rank.win { color: var(--gold); }
.placeline__pts { margin-left: auto; font-family: var(--font-mono); color: var(--text-2); }
.filed__foot { display: flex; justify-content: space-between; gap: 8px; font-family: var(--font-mono); font-size: 10.5px; color: var(--text-3); border-top: 1px solid var(--hair); padding-top: 11px; }

.filters { display: inline-flex; gap: 4px; padding: 4px; border-radius: var(--r-pill); background: rgba(8,12,18,.55); border: 1px solid var(--hair); }
.filter { appearance: none; cursor: pointer; font-family: var(--font-ui); font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; padding: 8px 14px; border-radius: var(--r-pill); border: 0; background: transparent; color: var(--text-2); }
.filter[aria-pressed="true"] { background: linear-gradient(180deg, var(--accent), var(--accent-2)); color: var(--accent-ink); }

/* =====================================================================
   TD DESK — modern official score slip
   ===================================================================== */
.tddesk { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: clamp(16px, 2.6vw, 28px); align-items: start; }
.score-slip {
  position: relative; background: var(--surface-1); color: var(--text);
  border: 1px solid var(--hair); border-radius: var(--r-xl); box-shadow: var(--sh-2);
  padding: clamp(20px, 2.6vw, 30px); overflow: hidden;
}
.score-slip::before { /* accent header band */
  content: ""; position: absolute; inset: 0 0 auto 0; height: 5px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}
.slip__watermark { position: absolute; right: -16px; bottom: -20px; width: 200px; height: 200px; color: #fff; opacity: .03; pointer-events: none; }
.slip__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.slip__title { font-family: var(--font-display); font-weight: 900; font-stretch: 112%; font-size: 24px; letter-spacing: -0.01em; text-transform: uppercase; }
.slip__no { font-family: var(--font-mono); font-size: 11px; color: var(--text-3); letter-spacing: .06em; text-align: right; }

.field { display: flex; flex-direction: column; gap: 7px; margin-top: 18px; }
.field > label { font-family: var(--font-ui); font-size: 10.5px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

select.input, input.input {
  appearance: none; font-family: var(--font-ui); font-size: 14px; font-weight: 600; color: var(--text);
  padding: 13px 14px; border-radius: var(--r-md); border: 1px solid var(--hair-2);
  background: var(--surface-2); width: 100%;
}
select.input { background-image: linear-gradient(45deg, transparent 50%, var(--text-3) 50%), linear-gradient(135deg, var(--text-3) 50%, transparent 50%); background-position: calc(100% - 18px) 20px, calc(100% - 13px) 20px; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 32px; }
.input:focus-visible { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input[type="number"].input { font-family: var(--font-mono); }
option { color: #111; }

.slot { display: flex; align-items: center; gap: 13px; padding: 13px 15px; border-radius: var(--r-md); border: 1px solid var(--hair); background: var(--surface-2); }
.slot--win { border-color: rgba(255,207,93,.4); background: linear-gradient(180deg, rgba(255,207,93,.10), var(--surface-2)); }
.slot__rank { display: grid; place-items: center; width: 34px; height: 34px; border-radius: var(--r-sm); flex: 0 0 auto; font-family: var(--font-display); font-weight: 900; font-size: 13px; }
.slot--win .slot__rank { color: #2a1d02; background: linear-gradient(160deg, var(--gold), var(--gold-2)); }
.slot--run .slot__rank { color: var(--text-2); background: var(--surface-3); }
.slot select.input { border: 0; background: transparent; padding: 0; font-weight: 700; }
.slot__pts { margin-left: auto; font-family: var(--font-mono); font-size: 13px; color: var(--text-3); white-space: nowrap; }

.roster { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  appearance: none; cursor: pointer; font-family: var(--font-ui); font-size: 12.5px; font-weight: 700;
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 13px 7px 8px; border-radius: var(--r-pill);
  border: 1px solid var(--hair-2); background: var(--surface-2); color: var(--text-2);
  transition: background .12s ease, color .12s ease, border-color .12s ease;
}
.chip[aria-pressed="true"] { background: linear-gradient(180deg, var(--accent), var(--accent-2)); color: var(--accent-ink); border-color: transparent; }
.chip[disabled] { opacity: .9; cursor: default; }

.stamp {
  position: absolute; top: 64px; right: 28px;
  font-family: var(--font-display); font-weight: 900; font-stretch: 115%; font-size: 24px; letter-spacing: .04em;
  color: var(--accent); border: 3px solid var(--accent); border-radius: var(--r-md);
  padding: 6px 16px; transform: rotate(-9deg); opacity: 0; text-transform: uppercase; pointer-events: none;
}
.score-slip.is-recorded .stamp { animation: stampin .5s cubic-bezier(.2,1.3,.4,1) forwards; }
@keyframes stampin { 0% { opacity: 0; transform: rotate(-9deg) scale(2.2); } 60% { opacity: 1; } 100% { opacity: .95; transform: rotate(-9deg) scale(1); } }

.slip__actions { display: flex; gap: 10px; margin-top: 22px; align-items: center; flex-wrap: wrap; }

.preview { padding: clamp(18px, 2vw, 24px); position: sticky; top: 140px; }
.preview h3 { font-family: var(--font-display); font-weight: 800; font-stretch: 108%; font-size: 16px; text-transform: uppercase; letter-spacing: .02em; margin: 0 0 4px; }
.preview__sub { font-family: var(--font-mono); font-size: 11px; color: var(--text-3); margin-bottom: 14px; }
.preview__line { display: flex; align-items: center; gap: 11px; padding: 11px 0; border-bottom: 1px solid var(--hair); }
.preview__line:last-of-type { border-bottom: 0; }
.preview__who { display: flex; align-items: center; gap: 9px; min-width: 0; }
.preview__who .pip { width: 16px; height: 16px; color: var(--text-3); }
.preview__role { font-family: var(--font-ui); font-size: 9.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); }
.preview__math { margin-left: auto; font-family: var(--font-mono); font-size: 12px; color: var(--text-3); white-space: nowrap; }
.preview__math b { color: var(--accent); font-weight: 500; }
.preview__total { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--hair-2); font-family: var(--font-display); font-weight: 800; text-transform: uppercase; }
.preview__total b { font-stretch: 115%; font-size: 22px; color: var(--accent); }

/* gate */
.gate { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 14px; padding: clamp(38px, 6vw, 70px) 24px; color: var(--text-2); }
.gate__pip { width: 50px; height: 50px; color: var(--accent); }
.gate h2 { font-family: var(--font-display); font-weight: 900; font-stretch: 112%; text-transform: uppercase; color: var(--text); margin: 0; font-size: 22px; }
.gate p { max-width: 42ch; margin: 0; font-size: 13.5px; }
.gate b { color: var(--accent); }

/* =====================================================================
   RULEBOOK
   ===================================================================== */
.rulebook { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 380px); gap: clamp(16px, 2.6vw, 28px); align-items: start; }
.ratecard { padding: clamp(20px, 2.4vw, 28px); }
.notfinal { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; margin-bottom: 20px; border-radius: var(--r-md); background: var(--danger-soft); border: 1px solid rgba(255,95,99,.3); color: var(--text); font-size: 13px; }
.notfinal .pip { width: 18px; height: 18px; color: var(--danger); flex: 0 0 auto; margin-top: 1px; }
.notfinal b { color: var(--danger); }
.presets { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 22px; }
.rate-grid { display: grid; gap: 0; }
.rate-row { display: grid; grid-template-columns: auto 1fr 130px; align-items: center; gap: 16px; padding: 15px 0; border-bottom: 1px solid var(--hair); }
.rate-row:last-child { border-bottom: 0; }
.rate-row__pip { display: grid; place-items: center; width: 36px; height: 36px; border-radius: var(--r-sm); background: var(--surface-3); }
.rate-row__pip .pip { width: 17px; height: 17px; color: var(--text-2); }
.rate-row__pip .pip.red { color: var(--accent); }
.rate-row__label b { display: block; font-size: 15px; font-weight: 800; color: var(--text); }
.rate-row__label small { color: var(--text-3); font-size: 12px; }
.rate-row input.input { text-align: right; font-size: 16px; }

.rule-preview { padding: clamp(18px, 2vw, 24px); position: sticky; top: 140px; }
.rule-preview h3 { font-family: var(--font-display); font-weight: 800; font-stretch: 108%; font-size: 16px; text-transform: uppercase; margin: 0 0 14px; }

/* =====================================================================
   TOASTS / misc
   ===================================================================== */
.toasts { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 80; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 10px;
  font-size: 13.5px; font-weight: 700; padding: 14px 20px; border-radius: var(--r-pill);
  background: var(--surface-2); color: var(--text); border: 1px solid var(--hair-2);
  box-shadow: var(--sh-2); animation: toastin .3s ease, toastout .3s ease forwards 2.7s;
}
.toast .pip { width: 17px; height: 17px; color: var(--accent); }
@keyframes toastin { from { opacity: 0; transform: translateY(10px); } }
@keyframes toastout { to { opacity: 0; transform: translateY(8px); } }

.empty { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; padding: 42px 20px; color: var(--text-3); }
.empty .pip { width: 32px; height: 32px; opacity: .5; }

.ledgerfoot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 18px clamp(16px, 3vw, 34px); border-top: 1px solid var(--hair); color: var(--text-3); font-family: var(--font-mono); font-size: 11px; }
.ledgerfoot__note { color: var(--text-3); }

/* staggered entrance */
@media (prefers-reduced-motion: no-preference) {
  .reveal > * { opacity: 0; transform: translateY(10px); animation: rise .5s cubic-bezier(.2,.7,.2,1) forwards; }
  .reveal > *:nth-child(1) { animation-delay: .03s; }
  .reveal > *:nth-child(2) { animation-delay: .09s; }
  .reveal > *:nth-child(3) { animation-delay: .15s; }
  .reveal > *:nth-child(4) { animation-delay: .21s; }
  .reveal > *:nth-child(5) { animation-delay: .27s; }
  .reveal > *:nth-child(6) { animation-delay: .33s; }
  @keyframes rise { to { opacity: 1; transform: none; } }
}

/* =====================================================================
   RESPONSIVE
   ===================================================================== */
@media (max-width: 940px) {
  .masthead { grid-template-columns: auto auto; row-gap: 12px; }
  .ticker { grid-column: 1 / -1; order: 3; justify-self: stretch; justify-content: space-between; }
  .ticker__cell { flex: 1; }
  .tddesk, .rulebook { grid-template-columns: 1fr; }
  .preview, .rule-preview { position: static; }
}
@media (max-width: 680px) {
  .masthead { grid-template-columns: 1fr; gap: 12px; padding: 12px 16px; }
  .brand { justify-self: start; }
  .ticker { order: 2; flex-wrap: wrap; }
  .ticker__cell { flex: 1 1 42%; }
  .ticker__cell + .ticker__cell { border-left: 0; }
  .credential { order: 3; align-items: stretch; }
  .credential__label { text-align: left; }
  .credential__passes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 3px; }
  .pass { padding: 9px 4px; }
  .pass__hint { display: none; }

  .tabrail { position: fixed; top: auto; bottom: 0; left: 0; right: 0; border-top: 1px solid var(--hair); border-bottom: 0; padding: 8px 8px calc(8px + env(safe-area-inset-bottom, 0)); justify-content: space-between; box-shadow: 0 -14px 36px -22px #000; }
  .tab { flex-direction: column; gap: 3px; padding: 8px 6px; font-size: 10px; flex: 1; }
  .tab__t { letter-spacing: 0; }
  .stage { padding-bottom: 96px; }

  .callboard { grid-template-columns: auto 1fr; }
  .callboard__count { grid-column: 1 / -1; text-align: left; border-top: 1px solid var(--hair); padding-top: 14px; }
  .callboard__table { width: 78px; height: 78px; }
  .callboard__table .n { font-size: 34px; }
  .winners, .archive { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; }
  .view-head__meta { text-align: left; }
  .qstub { grid-template-columns: 1fr auto; row-gap: 6px; }
  .qstub__date { grid-row: 2; grid-column: 1 / -1; }
  .ledgerfoot { padding-bottom: 92px; }
}
