/* ============================================================================
   T.I.L.T. — Football Intelligence Terminal · CROX design system
   Precision-engineering spec-sheet language: cool canvas #E3E7EB, ink #1A1B1C,
   signal orange #FF5F14. Structure comes from 4px ink seams (grid/flex gaps
   over an ink background) rather than floating cards. Display type is Apfel
   Grotezk (uppercase, 500); body is Geist; data stays IBM Plex Mono.
   ========================================================================== */

@font-face {
  font-family: "Apfel Grotezk";
  src: url("https://framerusercontent.com/assets/KwK0fH9Qx1gAi2nY6HV637MnF0.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Apfel Grotezk";
  src: url("https://framerusercontent.com/assets/soAoqUg4XLlllNDBOZtgbSkDFLM.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
}

:root {
  /* canvas + surfaces */
  --bg0: #e3e7eb;
  --bg1: #e3e7eb;
  --bg2: #d8dde2;
  --bg3: #ccd2d8;
  --bg-hover: rgba(26, 27, 28, 0.05);

  /* ink + seams */
  --ink: #1a1b1c;
  --seam: 4px;

  /* lines */
  --line: rgba(26, 27, 28, 0.22);
  --line2: rgba(26, 27, 28, 0.38);
  --line-strong: #1a1b1c;
  --line-subtle: rgba(26, 27, 28, 0.1);

  /* text */
  --text: #1a1b1c;
  --text2: #3c3f44;
  --muted: #6c7076;
  --faint: #969ba1;

  /* signal orange */
  --acc: #ff5f14;
  --acc-bright: #ff5f14;
  --acc-dim: rgba(255, 95, 20, 0.12);
  --acc-line: rgba(255, 95, 20, 0.5);

  /* semantic status — tuned for the cool canvas */
  --pos: #1b7a4b;
  --pos-dim: rgba(27, 122, 75, 0.12);
  --neg: #c0341f;
  --neg-dim: rgba(192, 52, 31, 0.12);
  --warn: #9a6b12;
  --warn-dim: rgba(154, 107, 18, 0.12);
  --live: #ff5f14;

  --mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --sans: "Geist", system-ui, "Segoe UI", sans-serif;
  --display: "Apfel Grotezk", "Geist", system-ui, "Segoe UI", sans-serif;

  --header-h: 60px;
  --radius: 0px;
  --ease: cubic-bezier(.76, 0, .24, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --shadow-pop: 0 14px 40px rgba(0, 0, 0, 0.22);
}

/* ==========================================================================
   DARK THEME — html[data-theme="dark"] (topbar toggle, localStorage
   "tilt-theme"). Same seam architecture with the palette inverted: #1A1B1C
   canvas, #232527 tiles, #EEF1F4 ink — mirrors the login page. Only the
   variables flip; every component reads from them.
   ========================================================================== */
:root[data-theme="dark"] {
  /* canvas + surfaces */
  --bg0: #232527;
  --bg1: #232527;
  --bg2: #2a2d30;
  --bg3: #33373b;
  --bg-hover: rgba(255, 255, 255, 0.06);

  /* ink + seams */
  --ink: #1a1b1c;

  /* lines */
  --line: rgba(255, 255, 255, 0.14);
  --line2: rgba(255, 255, 255, 0.28);
  --line-strong: #eef1f4;
  --line-subtle: rgba(255, 255, 255, 0.08);

  /* text */
  --text: #eef1f4;
  --text2: #c8ccd1;
  --muted: #9aa0a7;
  --faint: #6d7278;

  /* signal orange unchanged; semantic colors brightened for the dark canvas */
  --acc-dim: rgba(255, 95, 20, 0.16);
  --acc-line: rgba(255, 95, 20, 0.55);

  --pos: #2fb569;
  --pos-dim: rgba(47, 181, 105, 0.16);
  --neg: #ff6b57;
  --neg-dim: rgba(255, 107, 87, 0.16);
  --warn: #d9a123;
  --warn-dim: rgba(217, 161, 35, 0.16);

  /* dark legibility: faint text carries small uppercase labels everywhere */
  --faint: #7e848c;
  --shadow-pop: 0 14px 40px rgba(0, 0, 0, 0.5);
}

/* light-on-dark adjustments for the few places that bake light-theme values */
:root[data-theme="dark"] ::selection { background: var(--acc); color: #1a1b1c; }
:root[data-theme="dark"] ::-webkit-scrollbar-thumb { background: #3d4248; border-color: var(--ink); }
:root[data-theme="dark"] .chart-tip b { color: var(--text); }
:root[data-theme="dark"] .toast { color: var(--text); }
:root[data-theme="dark"] .scale .track,
:root[data-theme="dark"] .boot-bar { background: rgba(255, 255, 255, 0.12); }
:root[data-theme="dark"] .boot-fill { background: var(--acc); }
:root[data-theme="dark"] .boot-skip { border-color: var(--line-strong); }
:root[data-theme="dark"] .boot-skip:hover { background: var(--acc); border-color: var(--acc); color: #1a1b1c; }

/* the light design marks selected/hover/active states by inverting to ink
   background + canvas text — both are near-black in dark, so every such
   state gets the signal-orange treatment or an elevated surface instead */
:root[data-theme="dark"] .primary-nav a.active,
:root[data-theme="dark"] .seg button.active,
:root[data-theme="dark"] .btn:hover,
:root[data-theme="dark"] .btn.primary,
:root[data-theme="dark"] .date-pager .dp-btn:hover,
:root[data-theme="dark"] .topbar > .icon-btn:hover,
:root[data-theme="dark"] .brand-toggle:hover,
:root[data-theme="dark"] .brand-toggle.open,
:root[data-theme="dark"] .mobile-menu a:hover,
:root[data-theme="dark"] .mobile-menu a.active {
  background: var(--acc);
  color: #1a1b1c;
}
:root[data-theme="dark"] .topbar > .icon-btn:hover kbd { color: #1a1b1c; border-color: #1a1b1c; }
:root[data-theme="dark"] .primary-nav a.active::after { background: #1a1b1c; }
:root[data-theme="dark"] .mobile-menu a.active { box-shadow: inset 3px 0 0 #1a1b1c; }
:root[data-theme="dark"] .mi-row.open .mi-main { background: var(--bg2); }
:root[data-theme="dark"] .mi-row.open .mi-main * { color: var(--text) !important; }
:root[data-theme="dark"] .mi-row.open .mi-expand { color: var(--text); }
:root[data-theme="dark"] .crox-curtain.on::after { color: var(--text); }

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font: 13px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; padding: 0; }
input, select { font: inherit; color: var(--text); }
::selection { background: var(--ink); color: var(--bg0); }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: var(--ink); border-radius: 0; border: 2px solid var(--bg0); }
::-webkit-scrollbar-track { background: transparent; }

#app {
  min-height: 100vh; display: flex; flex-direction: column;
  gap: var(--seam); background: var(--ink);
}

/* ==========================================================================
   HEADER / SHELL — a row of canvas tiles separated by ink seams
   ========================================================================== */
.topbar {
  display: flex; align-items: stretch; gap: var(--seam);
  padding: var(--seam); min-height: var(--header-h);
  background: var(--ink); border-bottom: none;
  position: sticky; top: 0; z-index: 60;
  user-select: none;
}
.topbar > * { background: var(--bg0); }
.topbar > .icon-btn, .topbar > .brand, .topbar > .live-status {
  display: flex; align-items: center;
}

.brand { gap: 10px; padding: 0 18px; flex: none; }
.brand .mark {
  font-family: var(--display); font-weight: 500; font-size: 19px;
  letter-spacing: 0.06em; color: var(--text); text-transform: uppercase;
}
.brand .mark b { color: var(--acc); font-weight: 500; }
.brand .tag {
  font-family: var(--mono); font-size: 8px; letter-spacing: 0.3em;
  color: var(--muted); text-transform: uppercase; padding-left: 12px;
  border-left: 1px solid var(--line);
}

.primary-nav { display: flex; gap: var(--seam); align-items: stretch; background: var(--ink); flex: none; }

/* league modules dropdown — lives inside the primary nav */
.league-menu { position: relative; display: flex; }
.league-menu #league-menu-btn {
  height: auto; align-self: stretch; border: none; padding: 0 16px;
  font-size: 11px; letter-spacing: 0.08em; font-weight: 600;
  color: var(--text2); background: var(--bg0); white-space: nowrap;
  transition: background .2s var(--ease-out), color .2s var(--ease-out);
}
.league-menu #league-menu-btn:hover,
.league-menu #league-menu-btn.open { background: var(--acc); color: var(--ink); }
.league-menu-list {
    position: absolute; top: calc(100% + var(--seam)); right: 0; left: auto;
    min-width: 300px; max-height: 62vh; overflow: auto;
    background: var(--bg0); border: 1px solid var(--line);
    box-shadow: var(--shadow-pop);
    z-index: 90; display: flex; flex-direction: column;
    }
.league-menu-list[hidden] { display: none; }
.league-menu-list a {
  display: flex; justify-content: space-between; align-items: center; gap: 14px;
  padding: 9px 14px; font-size: 12px; font-weight: 550; color: var(--text);
  border-bottom: 1px solid var(--line-subtle); white-space: nowrap;
}
.league-menu-list a:last-child { border-bottom: none; }
.league-menu-list a:hover { background: var(--bg-hover); color: var(--acc); }
.league-menu-list .lm-country { font-family: var(--mono); font-size: 9px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.league-menu-list .lm-loading { padding: 14px; font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em; color: var(--muted); text-transform: uppercase; }

.primary-nav a {
  display: flex; align-items: center; padding: 0 16px;
  background: var(--bg0);
  font-size: 10.5px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted); position: relative; white-space: nowrap;
  transition: color .2s var(--ease-out), background .2s var(--ease-out);
}
.primary-nav a:hover { color: var(--text); }
.primary-nav a.active { color: var(--bg0); background: var(--ink); }
.primary-nav a.active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0;
  height: 3px; background: var(--acc);
}
.topbar .spacer { flex: 1 1 auto; min-width: 8px; }

.live-status {
  display: flex; align-items: center; gap: 16px;
  padding: 0 18px;
  font-family: var(--mono); font-size: 10px; color: var(--text2);
}
.live-status .block { display: flex; flex-direction: column; gap: 1px; line-height: 1.3; }
.live-status .block .k { font-family: var(--sans); font-size: 8px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--faint); }
.live-status .block .v { display: flex; align-items: center; gap: 5px; }
.live-status .sep { width: 1px; height: 22px; background: var(--line); }

.icon-btn {
  display: flex; align-items: center; gap: 6px;
  height: 26px; padding: 0 10px;
  border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--text2); font-size: 10.5px; background: var(--bg1);
}
.icon-btn:hover { color: var(--text); border-color: var(--line-strong); }
.icon-btn kbd {
  font-family: var(--mono); font-size: 9px; color: var(--muted);
  border: 1px solid var(--line); border-radius: 2px; padding: 0 4px; background: var(--bg0);
}
.topbar > .icon-btn {
  height: auto; border: none; padding: 0 18px;
  font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text2); background: var(--bg0);
  transition: background .2s var(--ease-out), color .2s var(--ease-out);
}
.topbar > .icon-btn:hover { background: var(--ink); color: var(--bg0); }
.topbar > .icon-btn:hover kbd { color: var(--bg0); border-color: var(--bg0); }
.topbar > #sound-btn.on { background: var(--acc); color: var(--ink); }
.topbar > #lang-btn { letter-spacing: 0.08em; font-weight: 600; }
.topbar > #lang-btn:hover { background: var(--acc); color: var(--ink); }
.topbar > #theme-btn { letter-spacing: 0.08em; font-weight: 600; font-size: 9px; }
.topbar > #theme-btn:hover { background: var(--acc); color: var(--ink); }

/* ==========================================================================
   PAGE LAYOUT — every top-level block is a canvas tile on the ink grid
   ========================================================================== */
.page {
  padding: var(--seam); flex: 1;
  width: 100%; min-height: 0;
  display: flex; flex-direction: column; gap: var(--seam);
  background: var(--ink);
}
.page > * { background: var(--bg0); margin: 0 !important; min-width: 0; }

.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; padding: 16px 18px; }
.page-head .titles { min-width: 0; }
.page-head .titles h1 {
  margin: 0; font-family: var(--display); font-weight: 500;
  font-size: clamp(28px, 4vw, 54px); line-height: 0.98; letter-spacing: -0.01em;
  text-transform: uppercase; color: var(--text);
}
.page-head .titles h1 span {
  font-family: var(--mono); font-size: 0.24em; font-weight: 500; letter-spacing: 0.02em;
  text-transform: none; vertical-align: middle; color: var(--muted);
}
.page-head .titles .sub { margin-top: 8px; font-size: 12px; color: var(--text2); max-width: 880px; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: 9px; font-weight: 500; letter-spacing: 0.26em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 8px;
}
.eyebrow::before { content: ""; width: 26px; height: 1px; background: var(--acc); }

.crumb {
  font-family: var(--mono); font-size: 10px; color: var(--muted);
  display: flex; gap: 7px; align-items: center; padding: 9px 18px;
}
.crumb a:hover { color: var(--text2); }
.crumb .sep { color: var(--faint); }

.grid { display: grid; gap: var(--seam); min-width: 0; background: var(--ink); }
.grid > * { min-width: 0; background: var(--bg0); }
.grid.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.c6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.grid.c21 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.grid.c31 { grid-template-columns: minmax(0, 3fr) minmax(0, 1fr); }
.grid.c12 { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.grid.c14 { grid-template-columns: minmax(0, 1fr) minmax(0, 4fr); }

@media (max-width: 1280px) {
  .grid.c4, .grid.c6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1000px) {
  .grid.c2, .grid.c3, .grid.c4, .grid.c6, .grid.c21, .grid.c31, .grid.c12, .grid.c14 { grid-template-columns: minmax(0, 1fr); }
  .primary-nav { display: none; }
  .live-status .block.opt { display: none; }
}
@media (max-width: 1620px) {
  .brand .tag { display: none; }
  .primary-nav a { padding: 0 12px; font-size: 10px; letter-spacing: 0.12em; }
  .live-status { gap: 12px; padding: 0 14px; }
  .live-status .block.opt.ls-sync { display: none; }
  .live-status .sep.opt-hide { display: none; }
}

/* ==========================================================================
   PANELS — flat spec-sheet surfaces, separated by seams (not cards)
   ========================================================================== */
.panel {
  background: var(--bg0);
  border: none;
  border-radius: var(--radius);
  min-width: 0;
}
.panel > .panel-head {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 14px; border-bottom: 1px solid var(--ink);
}
.panel > .panel-head h2 {
  margin: 0; font-family: var(--sans); font-size: 9.5px; font-weight: 600; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--text); white-space: nowrap;
}
.panel > .panel-head .meta { font-family: var(--mono); font-size: 9.5px; color: var(--muted); }
.panel > .panel-head .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.panel > .panel-body { padding: 14px; }
.panel > .panel-body.flush { padding: 0; }
.panel.accent { box-shadow: inset 0 0 0 2px var(--acc); }

/* ==========================================================================
   STATS — single intelligence strip
   ========================================================================== */
.stat-row {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: var(--seam); background: var(--ink); border: none; overflow: visible;
}
.stat-cell { padding: 14px 16px 13px; background: var(--bg0); min-width: 0; }
.stat-cell .lbl { font-size: 8.5px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); margin-bottom: 7px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-cell .val { font-family: var(--display); font-size: 30px; font-weight: 500; line-height: 1; letter-spacing: -0.01em; color: var(--text); font-variant-numeric: tabular-nums; }
.stat-cell .val small { font-family: var(--mono); font-size: 11px; color: var(--text2); font-weight: 500; }
.stat-cell .foot { margin-top: 6px; font-family: var(--mono); font-size: 9px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-cell.pos .val { color: var(--pos); }
.stat-cell.neg .val { color: var(--neg); }
.stat-cell.warn .val { color: var(--warn); }
.stat-cell.acc .val { color: var(--acc-bright); }

/* ==========================================================================
   TABLES
   ========================================================================== */
table.data { width: 100%; border-collapse: collapse; font-size: 11.5px; }
table.data th {
  font-size: 8.5px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted); text-align: left; padding: 8px 10px;
  border-bottom: 1px solid var(--ink); white-space: nowrap; position: sticky; top: 0;
  background: var(--bg0); z-index: 2;
}
table.data td { padding: 7px 10px; border-bottom: 1px solid var(--line-subtle); color: var(--text2); vertical-align: middle; }
table.data tr:last-child td { border-bottom: none; }
table.data tbody tr:hover td { background: var(--bg-hover); }
table.data td.num, table.data th.num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
table.data td.strong { color: var(--text); }
table.data .rowlink { cursor: pointer; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.t-pos { color: var(--pos); }
.t-neg { color: var(--neg); }
.t-warn { color: var(--warn); }
.t-acc { color: var(--acc-bright); }
.t-mut { color: var(--muted); }

/* ==========================================================================
   PILLS / TAGS / DOTS — restrained status glyphs
   ========================================================================== */
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 1px 6px; border-radius: 0;
  border: 1px solid var(--line2); background: var(--bg2);
  font-family: var(--mono); font-size: 9px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text2); white-space: nowrap; line-height: 1.7;
}
.pill.acc { color: var(--ink); border-color: var(--acc); background: var(--acc); }
.pill.pos { color: var(--pos); border-color: rgba(27, 122, 75, 0.35); background: var(--pos-dim); }
.pill.neg { color: var(--neg); border-color: rgba(192, 52, 31, 0.35); background: var(--neg-dim); }
.pill.warn { color: var(--warn); border-color: rgba(154, 107, 18, 0.35); background: var(--warn-dim); }
.pill.mut { color: var(--muted); }

.dot { display: inline-block; width: 5px; height: 5px; border-radius: 1px; background: var(--faint); flex: none; }
.dot.ok { background: var(--pos); }
.dot.warn { background: var(--warn); }
.dot.bad { background: var(--neg); }
.dot.live { background: var(--live); animation: pulse 1.6s ease-in-out infinite; }
.dot.acc { background: var(--acc-bright); }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }

.form-run { display: inline-flex; gap: 2px; }
.form-run i {
  font-style: normal; width: 14px; height: 14px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 0; border: 1px solid var(--line);
  font-family: var(--mono); font-size: 8.5px; font-weight: 600;
}
.form-run i.W { background: var(--pos-dim); color: var(--pos); border-color: rgba(27, 122, 75, 0.25); }
.form-run i.D { background: var(--bg2); color: var(--text2); border-color: var(--line2); }
.form-run i.L { background: var(--neg-dim); color: var(--neg); border-color: rgba(192, 52, 31, 0.25); }

/* ==========================================================================
   BUTTONS / INPUTS / FILTER BAR
   ========================================================================== */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 28px; padding: 0 13px; border-radius: var(--radius);
  border: 1px solid var(--ink); background: transparent; color: var(--text);
  font-size: 10px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase;
  transition: background .2s var(--ease-out), color .2s var(--ease-out);
}
.btn:hover { background: var(--ink); color: var(--bg0); border-color: var(--ink); }
.btn.primary { background: var(--ink); color: var(--bg0); border-color: var(--ink); }
.btn.primary:hover { background: var(--acc); border-color: var(--acc); color: var(--ink); }
.btn:disabled { opacity: 0.4; cursor: default; }
.btn.tiny { height: 22px; padding: 0 8px; font-size: 9.5px; }

.seg { display: inline-flex; border: 1px solid var(--ink); border-radius: var(--radius); overflow: hidden; background: var(--bg0); }
.seg button {
  padding: 5px 12px; font-size: 10.5px; font-weight: 500; letter-spacing: 0.06em;
  color: var(--muted); border-right: 1px solid var(--line); white-space: nowrap;
}
.seg button:last-child { border-right: none; }
.seg button:hover { color: var(--text); background: var(--bg-hover); }
.seg button.active { color: var(--bg0); background: var(--ink); box-shadow: none; }

.cmdbar {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  padding: 10px 14px;
  background: var(--bg0); border: none;
}
.cmdbar .search { display: flex; align-items: center; gap: 8px; flex: 1 1 260px; min-width: 200px; }
.cmdbar .search input {
  flex: 1; background: none; border: none; outline: none;
  font-size: 12px; color: var(--text); padding: 4px 0;
}
.cmdbar .search input::placeholder { color: var(--faint); }
.cmdbar .fgroup { display: flex; align-items: center; gap: 6px; }
.cmdbar label.f {
  font-size: 9px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); font-weight: 600;
}
.cmdbar select {
  background: var(--bg2); border: 1px solid var(--line2); border-radius: 0;
  font-size: 11px; padding: 3px 6px; color: var(--text); outline: none; max-width: 170px;
}
.cmdbar .count { font-family: var(--mono); font-size: 10px; color: var(--muted); }

.date-pager { display: flex; align-items: center; gap: 6px; }
.date-pager .dp-btn { width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--ink); border-radius: 0; color: var(--text); background: transparent; font-family: var(--mono); }
.date-pager .dp-btn:hover { background: var(--ink); color: var(--bg0); }
.date-pager input[type="date"] {
  background: var(--bg0); border: 1px solid var(--ink); border-radius: 0;
  color: var(--text); font-family: var(--mono); font-size: 11px; padding: 3px 6px; outline: none;
  color-scheme: light;
}

/* ==========================================================================
   MATCH INTELLIGENCE ROWS
   ========================================================================== */
.mi-row { border-bottom: 1px solid var(--line-subtle); }
.mi-row:last-child { border-bottom: none; }
.mi-main {
  display: grid;
  grid-template-columns: 112px minmax(280px, 2.4fr) repeat(3, minmax(72px, 1fr)) 28px;
  align-items: center; gap: 10px;
  padding: 9px 12px; cursor: pointer;
}
.mi-main:hover { background: var(--bg-hover); }
.mi-when { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mi-when .comp { font-size: 9px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mi-when .time { font-family: var(--mono); font-size: 11.5px; color: var(--text2); display: flex; align-items: center; gap: 6px; }
.mi-teams { display: flex; align-items: center; gap: 8px; min-width: 0; }
.mi-teams .side { display: flex; align-items: center; gap: 7px; flex: 1; min-width: 0; }
.mi-teams .side.away { justify-content: flex-start; }
.mi-teams img { width: 16px; height: 16px; object-fit: contain; flex: none; }
.mi-teams .name { font-size: 12px; font-weight: 550; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mi-teams .score { font-family: var(--mono); font-size: 12.5px; font-weight: 600; color: var(--text); padding: 0 2px; flex: none; }
.mi-teams .vs { font-size: 9px; color: var(--faint); letter-spacing: 0.1em; flex: none; }
.mi-cell { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mi-cell .k { font-size: 8px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint); white-space: nowrap; }
.mi-cell .v { font-family: var(--mono); font-size: 12px; font-weight: 550; color: var(--text2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.mi-cell .v.hero { font-size: 13.5px; color: var(--text); }
.mi-cell .v.pos { color: var(--pos); }
.mi-cell .v.neg { color: var(--neg); }
.mi-cell .v.warn { color: var(--warn); }
.mi-cell .v.acc { color: var(--acc-bright); }
.mi-expand { color: var(--faint); font-family: var(--mono); font-size: 11px; text-align: center; }
.mi-row.open .mi-expand { color: var(--text); }
.mi-detail { display: none; padding: 4px 12px 14px; background: var(--bg2); border-bottom: 1px solid var(--line-subtle); }
.mi-row.open .mi-detail { display: block; }
.mi-row.open .mi-main { background: var(--ink); }
.mi-row.open .mi-main * { color: var(--bg0) !important; }
.mi-row.open .mi-main .v.pos { color: #7fe0ad !important; }
.mi-row.open .mi-main .v.neg { color: #ff8a76 !important; }
.mi-row.open .mi-main .crest { filter: none; }
.mi-row.open .mi-expand { color: var(--bg0); }

@media (max-width: 1180px) {
  .mi-main { grid-template-columns: 90px minmax(200px, 1.6fr) repeat(3, minmax(70px, 1fr)) 28px; }
  .mi-cell.opt { display: none; }
}
@media (max-width: 760px) {
  .mi-main { grid-template-columns: 80px 1fr 28px; }
  .mi-cell { display: none; }
}

/* Matches feed carries extra optional cells (over 2.5 / over 3.5 cards,
   home corners over 5.5, total shots over 27.5 — each rendered only when
   that market's engine computed the date). The scoped rules mirror the base
   + media-query column layouts with the extra cell count — the container
   class opt-N (N = optional cells present) selects the variant. */
#match-feed.opt-1 .mi-main {
  grid-template-columns: 112px minmax(280px, 2.4fr) repeat(4, minmax(70px, 1fr)) 28px;
}
#match-feed.opt-2 .mi-main {
  grid-template-columns: 112px minmax(280px, 2.4fr) repeat(5, minmax(66px, 1fr)) 28px;
}
#match-feed.opt-3 .mi-main {
  grid-template-columns: 112px minmax(280px, 2.4fr) repeat(6, minmax(63px, 1fr)) 28px;
}
#match-feed.opt-4 .mi-main {
  grid-template-columns: 112px minmax(280px, 2.4fr) repeat(7, minmax(58px, 1fr)) 28px;
}
@media (max-width: 1180px) {
  #match-feed.opt-1 .mi-main, #match-feed.opt-2 .mi-main,
  #match-feed.opt-3 .mi-main, #match-feed.opt-4 .mi-main { grid-template-columns: 90px minmax(200px, 1.6fr) repeat(3, minmax(70px, 1fr)) 28px; }
}
@media (max-width: 760px) {
  #match-feed.opt-1 .mi-main, #match-feed.opt-2 .mi-main,
  #match-feed.opt-3 .mi-main, #match-feed.opt-4 .mi-main { grid-template-columns: 80px 1fr 28px; }
}

.mi-detail .cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: var(--seam); }

/* ==========================================================================
   SCALES / CONVERGENCE
   ========================================================================== */
.scale { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.scale .row1 { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.scale .name { font-size: 10.5px; color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scale .val { font-family: var(--mono); font-size: 10.5px; color: var(--text); font-variant-numeric: tabular-nums; }
.scale .track { height: 4px; border-radius: 0; background: rgba(26, 27, 28, 0.14); overflow: hidden; }
.scale .fill { height: 100%; background: var(--acc-bright); transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1); }
.scale .fill.pos { background: var(--pos); }
.scale .fill.warn { background: var(--warn); }
.scale .fill.neg { background: var(--neg); }
.scale .fill.mut { background: var(--muted); }

.convergence { display: flex; flex-direction: column; gap: 9px; }
.conv-item .top { display: flex; justify-content: space-between; margin-bottom: 4px; }
.conv-item .src { font-size: 11px; color: var(--text2); font-weight: 550; }
.conv-item .pct { font-family: var(--mono); font-size: 11px; color: var(--text); }

/* probability triplet */
.triplet { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: var(--seam); background: var(--ink); }
.triplet .t {
  background: var(--bg0); border: none; border-radius: 0;
  padding: 10px 10px; text-align: center;
}
.triplet .t.lead { background: var(--ink); }
.triplet .t .p { font-family: var(--display); font-size: 20px; font-weight: 500; color: var(--text); font-variant-numeric: tabular-nums; }
.triplet .t .l { font-size: 8px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); margin-top: 2px; }
.triplet .t.lead .p { color: var(--acc); }
.triplet .t.lead .l { color: rgba(227, 231, 235, 0.7); }

/* signal chips */
.signal-list { display: flex; flex-direction: column; gap: 5px; max-height: 420px; overflow: auto; }
.signal-item {
  display: flex; gap: 8px; font-size: 11.5px; color: var(--text2);
  padding: 4px 8px; border-left: 2px solid var(--ink);
  background: var(--bg2); border-radius: 0;
}

/* ==========================================================================
   KV LISTS
   ========================================================================== */
.kv { display: grid; grid-template-columns: auto 1fr; gap: 5px 16px; font-size: 11.5px; margin: 0; }
.kv dt { color: var(--muted); white-space: nowrap; }
.kv dd { margin: 0; font-family: var(--mono); text-align: right; color: var(--text2); font-size: 11px; font-variant-numeric: tabular-nums; }
.kv dd.pos { color: var(--pos); }
.kv dd.neg { color: var(--neg); }
.kv dd.warn { color: var(--warn); }

/* ==========================================================================
   EMPTY / ERROR / LOADING
   ========================================================================== */
.empty { padding: 26px 18px; text-align: center; color: var(--muted); }
.empty .glyph { font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.24em; color: var(--faint); text-transform: uppercase; margin-bottom: 8px; }
.empty .msg { font-size: 12px; color: var(--text2); max-width: 480px; margin: 0 auto; }
.empty .hint { font-size: 10.5px; color: var(--muted); margin-top: 6px; font-family: var(--mono); }

.loading-bar { height: 2px; background: var(--bg3); overflow: hidden; position: relative; }
.loading-bar::after {
  content: ""; position: absolute; inset: 0; width: 34%;
  background: var(--acc); animation: slide 1.1s ease-in-out infinite;
}
@keyframes slide { 0% { transform: translateX(-110%); } 100% { transform: translateX(320%); } }

.na { font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.08em; color: var(--faint); text-transform: uppercase; }

/* ==========================================================================
   EVENT STREAM
   ========================================================================== */
.evt { display: flex; gap: 9px; padding: 4px 0; border-bottom: 1px solid var(--line-subtle); font-size: 11.5px; align-items: baseline; }
.evt:last-child { border-bottom: none; }
.evt time { font-family: var(--mono); color: var(--muted); font-size: 10px; white-space: nowrap; }
.evt .src { font-family: var(--mono); font-size: 9px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text2); white-space: nowrap; min-width: 66px; }
.evt .msg { color: var(--text2); min-width: 0; overflow-wrap: anywhere; }
.evt.warn .msg { color: var(--warn); }
.evt.error .msg { color: var(--neg); }

/* ==========================================================================
   COMMAND PALETTE
   ========================================================================== */
.palette-mask {
  position: fixed; inset: 0; background: rgba(26, 27, 28, 0.82);
  z-index: 200; display: none; align-items: flex-start; justify-content: center; padding-top: 12vh;
}
.palette-mask.open { display: flex; }
.palette {
  width: min(660px, 92vw); background: var(--bg0); border: 1px solid var(--ink);
  border-radius: var(--radius); overflow: hidden;
}
.palette .p-input { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--ink); }
.palette .p-input .gt { color: var(--acc); font-family: var(--mono); }
.palette input { flex: 1; background: none; border: none; outline: none; font-size: 14px; color: var(--text); }
.palette .p-results { max-height: 46vh; overflow: auto; padding: 6px; }
.palette .p-group { font-size: 9px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--faint); padding: 8px 10px 3px; }
.palette .p-item { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 0; cursor: pointer; }
.palette .p-item:hover, .palette .p-item.sel { background: var(--bg2); }
.palette .p-item .t { font-size: 12.5px; color: var(--text); }
.palette .p-item .d { font-family: var(--mono); font-size: 10px; color: var(--muted); margin-left: auto; white-space: nowrap; }
.palette .p-item .kind {
  font-family: var(--mono); font-size: 8.5px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text2); border: 1px solid var(--line2); border-radius: 0; padding: 1px 5px; flex: none;
}
.palette .p-foot { display: flex; gap: 14px; padding: 8px 14px; border-top: 1px solid var(--line); font-family: var(--mono); font-size: 9.5px; color: var(--muted); }

/* ==========================================================================
   MISC
   ========================================================================== */
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 10.5px; color: var(--text2); }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 0; margin-right: 5px; vertical-align: -1px; }

.section-title { display: flex; align-items: center; gap: 12px; padding: 10px 18px; }
.section-title h3 { margin: 0; font-size: 9.5px; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; color: var(--text); }
.section-title .rule { flex: 1; height: 1px; background: var(--ink); }
.section-title .meta { font-family: var(--mono); font-size: 10px; color: var(--muted); }

.crest { width: 17px; height: 17px; object-fit: contain; flex: none; }
.crest.lg { width: 30px; height: 30px; }

.split-bar { display: flex; height: 5px; overflow: hidden; background: rgba(26, 27, 28, 0.12); }
.split-bar i { height: 100%; }

.team-badge-line { display: flex; align-items: center; gap: 9px; min-width: 0; }
.team-badge-line .nm { font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.chart-wrap { position: relative; min-width: 0; }
.chart-wrap svg { display: block; width: 100%; }
.chart-tip {
  position: fixed; z-index: 300; pointer-events: none;
  background: var(--ink); border: none; border-radius: 0;
  padding: 7px 10px; font-family: var(--mono); font-size: 10.5px; color: rgba(227, 231, 235, 0.8);
  white-space: nowrap;
}
.chart-tip b { color: var(--bg0); }

.hero-pick { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.hero-pick .sel {
  font-family: var(--display); font-size: 36px; font-weight: 500; color: var(--text);
  letter-spacing: 0.01em; line-height: 1; text-transform: uppercase;
}
.hero-pick .kpis { display: flex; gap: 26px; flex-wrap: wrap; }
.hero-pick .kpi .k { font-size: 8.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); margin-bottom: 3px; }
.hero-pick .kpi .v { font-family: var(--mono); font-size: 15px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }

.note { font-size: 11px; color: var(--muted); line-height: 1.55; }
.note b { color: var(--text2); }

.toast-wrap { position: fixed; bottom: 18px; right: 18px; z-index: 400; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--ink); border: none; border-left: 3px solid var(--acc);
  border-radius: 0; padding: 10px 14px; font-size: 12px; color: var(--bg0);
  max-width: 380px;
  animation: toast-in 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}
.toast.err { border-left-color: var(--neg); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.num-flash { animation: numflash 0.9s ease-out; }
@keyframes numflash { 0% { color: var(--acc-bright); } 100% { } }

/* ==========================================================================
   LAUNCH OVERLAY — warms the full database before the terminal opens
   ========================================================================== */
.boot-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: var(--bg0);
  display: flex; align-items: center; justify-content: center;
}
.boot-box { width: min(560px, 92vw); text-align: center; user-select: none; }
.boot-brand { font-family: var(--display); font-size: 42px; font-weight: 500; letter-spacing: 0.1em; color: var(--text); text-transform: uppercase; }
.boot-brand b { color: var(--acc); font-weight: 500; }
.boot-tag { margin-top: 8px; font-family: var(--mono); font-size: 9px; letter-spacing: 0.38em; color: var(--muted); }
.boot-bar {
  margin: 28px auto 12px; width: 100%; height: 4px;
  background: rgba(26, 27, 28, 0.15); overflow: hidden;
}
.boot-fill {
  height: 100%; width: 0%;
  background: var(--ink);
  transition: width 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.boot-count { margin-top: 12px; font-family: var(--mono); font-size: 10.5px; color: var(--text2); letter-spacing: 0.14em; text-transform: uppercase; }
.boot-task { margin-top: 4px; font-family: var(--mono); font-size: 10px; color: var(--muted); min-height: 16px; }
.boot-log {
  margin: 16px auto 0; width: min(420px, 80vw); min-height: 96px; text-align: left;
  font-family: var(--mono); font-size: 9.5px; color: var(--faint);
  display: flex; flex-direction: column; gap: 2px;
}
.boot-log .ok { color: var(--text2); }
.boot-log .fail { color: var(--warn); }
.boot-skip {
  margin-top: 18px; height: 28px; padding: 0 14px;
  border: 1px solid var(--ink); border-radius: var(--radius);
  color: var(--text); font-size: 10px; background: none; text-transform: uppercase; letter-spacing: 0.12em;
}
.boot-skip:hover { background: var(--ink); color: var(--bg0); }

@media print { .topbar, .cmdbar { display: none; } }

/* ==========================================================================
   MOBILE MENU — dropdown from the brand (below 1000px)
   ========================================================================== */
.brand-toggle {
  display: none;
  align-items: center; justify-content: center;
  width: 46px; flex: none;
  color: var(--text);
}
.brand-toggle span { font-size: 14px; line-height: 1; }
.brand-toggle:hover { background: var(--ink); color: var(--bg0); }
.brand-toggle.open { background: var(--ink); color: var(--bg0); }

.mobile-menu {
  display: none;
  position: fixed;
  top: var(--header-h); left: 0;
  z-index: 55;
  width: min(320px, 84vw);
  max-height: calc(100vh - var(--header-h));
  overflow: auto;
  background: var(--bg0);
  border: none;
  padding: var(--seam);
  gap: var(--seam);
  flex-direction: column;
}
.mobile-menu.open { display: flex; }
.mobile-menu a {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 13px 16px;
  font-size: 11px; font-weight: 550; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text2);
  border: none;
}
.mobile-menu a:hover { background: var(--ink); color: var(--bg0); }
.mobile-menu a.active { background: var(--ink); color: var(--bg0); box-shadow: inset 3px 0 0 var(--acc); }
.mobile-menu a .mm-arrow { color: var(--faint); font-size: 11px; }

@media (max-width: 1000px) {
  .brand-toggle { display: inline-flex; }
}

/* ============================================================================
   CROX LAYER — seam grid, telemetry band, reactive dot field, rolling numbers,
   animated diagonal lines and a draggable wireframe. Presentational only.
   ========================================================================== */

/* --- telemetry band (dot field + wireframe + diagonal stripes) ---------- */
.crox-band {
  position: relative; overflow: hidden;
  background: var(--bg0);
  min-height: 112px;
  display: flex; align-items: stretch;
}
.crox-band .crox-dots {
  position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0;
  pointer-events: none;
}
.crox-band-main {
  position: relative; z-index: 2;
  display: flex; flex-direction: column; justify-content: center; gap: 8px;
  padding: 20px 24px;
}
.crox-band-eyebrow {
  font-family: var(--mono); font-size: 9px; letter-spacing: 0.3em; text-transform: uppercase;
  color: var(--muted);
}
.crox-band-title {
  font-family: var(--display); font-weight: 500; text-transform: uppercase;
  font-size: clamp(22px, 3vw, 40px); line-height: 0.98; letter-spacing: -0.01em;
  color: var(--text); max-width: 22ch;
}
.crox-band-side {
  position: relative; z-index: 2; margin-left: auto;
  display: flex; align-items: center; padding: 0 22px;
}
.crox-wire { width: 108px; height: 108px; cursor: grab; touch-action: none; }
.crox-wire:active { cursor: grabbing; }
.crox-band-stripes {
  position: absolute; left: 0; right: 0; bottom: 0; height: 8px; z-index: 3;
  background-image: repeating-linear-gradient(115deg, var(--ink) 0 2px, transparent 2px 9px);
  opacity: 0.55;
  animation: crox-stripes 1.6s linear infinite;
}
@keyframes crox-stripes { to { background-position: 40px 0; } }

/* --- reveal on route change -------------------------------------------- */
#page.reveal > * { animation: crox-up 0.5s var(--ease-out) both; }
#page.reveal > *:nth-child(1) { animation-delay: 0.02s; }
#page.reveal > *:nth-child(2) { animation-delay: 0.06s; }
#page.reveal > *:nth-child(3) { animation-delay: 0.1s; }
#page.reveal > *:nth-child(4) { animation-delay: 0.14s; }
#page.reveal > *:nth-child(5) { animation-delay: 0.18s; }
#page.reveal > *:nth-child(6) { animation-delay: 0.22s; }
#page.reveal > *:nth-child(n + 7) { animation-delay: 0.26s; }
@keyframes crox-up { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* --- curtain transition ------------------------------------------------- */
.crox-curtain {
  position: fixed; inset: 0; z-index: 9998; background: var(--ink);
  transform: translateY(100%); pointer-events: none;
  display: flex; align-items: center; justify-content: center;
}
.crox-curtain.on::after {
  content: "· · ·"; color: var(--bg0); font-family: var(--display);
  font-weight: 500; letter-spacing: 0.3em; font-size: 14px; opacity: 0.85;
}
.crox-curtain.on::before {
  content: ""; position: absolute; left: 50%; top: 50%; width: 42px; height: 3px;
  transform: translate(-50%, 34px); background: var(--acc);
}

@media (prefers-reduced-motion: reduce) {
  #page.reveal > * { animation: none; }
  .crox-band-stripes { animation: none; }
}
@media (max-width: 1000px) {
  .crox-band { min-height: 96px; }
  .crox-band-title { font-size: clamp(20px, 7vw, 32px); max-width: none; }
  .crox-wire { width: 76px; height: 76px; }
}
@media (max-width: 640px) {
  .crox-band-side { display: none; }
}

/* --- session + account management --------------------------------------- */
.user-chip {
  display: flex; align-items: center; gap: 8px; height: 30px; padding: 0 8px;
  border: 1px solid var(--line); background: var(--bg2); font-family: var(--mono); font-size: 10px;
}
.user-chip[hidden] { display: none !important; }
.u-name { max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text2); }
.u-logout { color: var(--acc); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.u-logout:hover { text-decoration: underline; }

/* user dropdown — account chip opens the settings panel (far right) */
.user-menu { position: relative; display: flex; }
.user-chip { cursor: pointer; }
.user-chip .um-dot { width: 7px; height: 7px; background: var(--acc); flex: none; }
.user-chip .u-caret { font-size: 8px; color: var(--muted); line-height: 1; }
.user-chip.open { border-color: var(--acc); }
.user-panel {
  position: absolute; right: 0; top: calc(100% + 6px);
  width: 248px; z-index: 90;
  background: var(--bg0); border: 1px solid var(--line);
  box-shadow: var(--shadow-pop);
  padding: 12px;
}
.user-panel[hidden] { display: none !important; }
.up-head { display: flex; flex-direction: column; gap: 2px; padding-bottom: 10px; margin-bottom: 10px; border-bottom: 1px solid var(--line-subtle); }
.up-name { font: 600 12px var(--mono); color: var(--text); }
.up-sub { font: 10px var(--mono); color: var(--muted); letter-spacing: .06em; }
.up-title { font: 600 9px var(--mono); letter-spacing: .18em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.up-form { display: grid; gap: 8px; }
.up-form label { display: grid; gap: 4px; font: 9px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.up-form input {
  width: 100%; padding: 8px 9px; border: 1px solid var(--line); background: var(--bg1);
  color: var(--text); font: 11px var(--mono); outline: none;
}
.up-form input:focus { border-color: var(--acc); }
.up-note { min-height: 14px; font: 10px var(--mono); }
.up-note.ok { color: var(--pos); }
.up-note.bad { color: var(--neg); }
.up-save, .up-action {
  width: 100%; padding: 9px; text-align: center;
  background: var(--acc); color: #171717; border: none; cursor: pointer;
  font: 700 10px var(--mono); letter-spacing: .1em; text-transform: uppercase;
  text-decoration: none; display: flex; align-items: center; justify-content: center;
}
.up-save:hover, .up-action:hover { filter: brightness(1.08); }
.up-action { margin-top: 8px; background: var(--bg2); color: var(--text); border: 1px solid var(--line); }
.up-action[hidden] { display: none !important; }
.up-logout { margin-top: 8px; background: var(--bg2); color: var(--neg); border: 1px solid var(--line); }

.acct-form { display: grid; gap: 10px; }
.acct-form label { display: grid; gap: 5px; color: var(--muted); font: 10px/1.3 var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.acct-form input, .acct-form select {
  width: 100%; padding: 9px 10px; border: 1px solid var(--line); background: var(--bg0);
  color: var(--text); font: 12px var(--mono); outline: none;
}
.acct-form input:focus, .acct-form select:focus { border-color: var(--acc); }
.acct-form button {
  justify-self: start; margin-top: 4px; padding: 9px 14px; background: var(--acc); color: #171717;
  font: 700 10px var(--mono); letter-spacing: .1em; text-transform: uppercase;
}
.acct-action { color: var(--acc); font: 10px var(--mono); text-transform: uppercase; margin-right: 8px; }
.acct-action.negative { color: var(--neg); }
.acct-action:hover { text-decoration: underline; }

.rights-fieldset { border: 1px solid var(--line); padding: 10px; margin: 4px 0 0; }
.rights-fieldset legend { color: var(--muted); font: 10px/1.3 var(--mono); letter-spacing: .1em; text-transform: uppercase; padding: 0 6px; }
.rights-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 6px 12px; }
.rights-item { display: flex; align-items: center; gap: 7px; color: var(--text2); font: 11px var(--mono); letter-spacing: 0; text-transform: none; }
.rights-item input { width: auto; margin: 0; accent-color: var(--acc); }

@media (max-width: 900px) {
  .u-name { display: none; }
}

/* welcome strip — first-visit quick tour on the overview (dismissible) */
.welcome-strip {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 16px;
  background: var(--bg0);
  border: 1px solid var(--acc-line);
}
.welcome-strip .ws-text { flex: 1; min-width: 0; font-size: 12px; line-height: 1.6; color: var(--text2); }
.welcome-strip .ws-text b { color: var(--text); display: block; margin-bottom: 2px; }
.welcome-strip .ws-close {
  flex: none; width: 26px; height: 26px; display: flex; align-items: center; justify-content: center;
  color: var(--muted); border: 1px solid var(--line); background: transparent;
  font-size: 11px; cursor: pointer;
}
.welcome-strip .ws-close:hover { color: var(--acc); border-color: var(--acc); }


/* ==========================================================================
   UI QUALITY PASS — keyboard focus, sticky tables, skeletons, hover guards,
   mobile league access. Pure presentation: no behavior contracts change.
   ========================================================================== */

/* keyboard navigation — visible focus without mouse-click noise */
:focus-visible { outline: 2px solid var(--acc); outline-offset: 1px; }
.primary-nav a:focus-visible,
.league-menu-list a:focus-visible { outline-offset: -2px; }

/* data tables: aligned digits everywhere */
.data td { font-variant-numeric: tabular-nums; }

/* sticky headers, scoped to scrollable table containers (.tbl-scroll) */
.tbl-scroll .data thead th {
  position: sticky; top: -1px; z-index: 5;
  background: var(--bg0);
  box-shadow: 0 1px 0 var(--line);
}

/* skeleton shimmer — shape-matched loading states */
.skeleton {
  background: linear-gradient(90deg, var(--bg2) 25%, var(--bg3) 37%, var(--bg2) 63%);
  background-size: 400% 100%;
  animation: skeleton-shimmer 1.3s ease-in-out infinite;
  border-radius: 2px;
}
.skl-line { height: 11px; margin: 9px 14px; }
.skl-line.w60 { width: 60%; } .skl-line.w80 { width: 80%; } .skl-line.w40 { width: 40%; }
.skl-block { height: 120px; margin: 12px 14px; }
@keyframes skeleton-shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
@media (prefers-reduced-motion: reduce) { .skeleton { animation: none; } }

/* match intelligence detail — deliberate open instead of a snap */
@keyframes mi-detail-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.mi-row.open .mi-detail { animation: mi-detail-in .18s var(--ease-out); }
@media (prefers-reduced-motion: reduce) { .mi-row.open .mi-detail { animation: none; } }

/* sticky KPI strip (scoped to pages that opt in with .kpi-sticky wrapper) */
.kpi-sticky { position: sticky; top: var(--header-h); z-index: 40; background: var(--ink); padding-bottom: var(--seam); }

/* hover effects are a pointer luxury — touch taps must not stick highlighted */
@media (hover: none) {
  .mi-main:hover { background: none; }
  .league-menu-list a:hover { background: none; color: var(--text); }
  .primary-nav a:hover { background: none; color: var(--text); }
}

/* league access on touch layouts: a compact dropdown instance in the topbar */
.league-menu.mobile-only { display: none; }
@media (max-width: 1000px) {
  .league-menu.mobile-only { display: flex; }
}

/* league module switcher — small-screen navigation between granted leagues */
.lg-select-wrap { display: none; }
@media (max-width: 1000px) { .lg-select-wrap { display: block; } }
.lg-select-wrap select {
  width: 100%; padding: 10px 12px; background: var(--bg0); color: var(--text);
  border: 1px solid var(--line); font: 12px var(--sans);
}

/* empty-state icons */
.empty svg.eicon { width: 30px; height: 30px; stroke: var(--faint); fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; margin-bottom: 4px; }
.empty svg.eicon.spin { animation: eicon-spin 1.6s linear infinite; transform-origin: center; }
@keyframes eicon-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .empty svg.eicon.spin { animation: none; } }

/* chart entrance — the line draws itself (charts.js sets the dash offset) */
.chart-wrap svg path[data-draw] { transition: stroke-dashoffset .9s cubic-bezier(.22, 1, .36, 1); }
@media (prefers-reduced-motion: reduce) { .chart-wrap svg path[data-draw] { transition: none; } }

/* league hero — the competition crest, big and centered above the page */
.league-hero { display: flex; justify-content: center; align-items: center; padding: 14px 0 4px; }
.league-hero .league-logo {
  max-height: 150px; max-width: min(460px, 82vw); object-fit: contain;
  filter: drop-shadow(0 10px 26px rgba(0, 0, 0, 0.18));
}
:root[data-theme="dark"] .league-hero {
  background: var(--bg1);
  border: 1px solid var(--line-subtle);
  padding: 18px;
}
:root[data-theme="dark"] .league-hero .league-logo {
  filter: drop-shadow(0 10px 26px rgba(0, 0, 0, 0.5)) brightness(1.06);
}

/* ==========================================================================
   MOBILE PASS — small-screen refinements
   Data tables scroll horizontally inside their panels on phones instead of
   blowing out the grid; headers and paddings tighten for one-hand use.
   ========================================================================== */
@media (max-width: 760px) {
  table.data { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .panel-head { flex-wrap: wrap; row-gap: 6px; }
  .page-head { padding: 12px 14px; }
  .page-head .actions { width: 100%; }
  .page-head .actions .btn { flex: 1; justify-content: center; }
  .login-body { padding: 20px 16px 16px; }
  .login-head .head-note { display: none; }
}
