/* EPL ELO Dashboard — minimal, dark theme. Premier League purple accent. */

/* ── SSA design system — shared token block (docs/DESIGN_SYSTEM.md §1).
   Copied verbatim; do not edit values here. ──────────────────────────────── */
:root {
  /* ── Surfaces ────────────────────────────────────────────────────────── */
  --bg:            #0b0f16;  /* page background                            */
  --bg-elev:       #161b22;  /* cards, nav bar, table headers              */
  --bg-row:        #1d2129;  /* table rows, inset panels                   */
  --border:        #2a2f3a;
  --border-subtle: #22262f;

  /* ── Text ────────────────────────────────────────────────────────────── */
  --text:          #e8eaef;  /* headings + body                            */
  --text-dim:      #9aa0aa;  /* secondary                                  */
  --text-muted:    #8b929d;  /* captions, timestamps, footnotes            */

  /* ── Brand / chrome ──────────────────────────────────────────────────── */
  --accent:        #58a6ff;  /* THE brand accent. All chrome.              */
  --accent-dim:    #2f6fd6;  /* hover + pressed FILLS ONLY — never text    */
  --text-disabled: #6b727d;  /* recessive but legible; NOT --text-muted */
  --accent-wash:   rgba(88, 166, 255, 0.14);  /* translucent accent fills */
  --accent-2:      #a78bfa;  /* secondary highlight (All-Access, badges)   */

  /* ── Data semantics — NEVER used for chrome ──────────────────────────── */
  --good:          #3fb950;  /* win, cover, +EV, positive delta            */
  --bad:           #f85149;  /* loss, no-cover, -EV, negative delta        */
  --warn:          #e6c26b;  /* push, stale data, caution                  */

  /* ── Type ────────────────────────────────────────────────────────────── */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI',
                 Roboto, sans-serif;
}

/* League identity — legal in charts, team badges and hero art only; never in
   nav, buttons or focus rules (DESIGN_SYSTEM.md §1 "Per-league tint"). */
:root { --league-tint: #7c3aed; }   /* EPL purple */

/* ── Repo-specific data colours ───────────────────────────────────────────
   These encode DATA meaning, so they sit outside the shared block. */
:root {
    --ucl: #3aa0ff;           /* Champions League band */
    --europe: #5fb87c;        /* Europe band */
    --releg: #e07b80;         /* Relegation band */
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text);
    font-family: var(--font-family);
    font-size: 14px; line-height: 1.5;
}
a { color: var(--text); text-decoration: none; }

/* ── Site nav (standardized across SSA portfolio) ────────────────────── */
.site-nav {
    background: var(--bg-elev); border-bottom: 1px solid var(--border);
    padding: 8px 20px; display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
}
.site-nav-brand { font-size: 14px; font-weight: 600; color: var(--text); letter-spacing: -0.3px; }
.site-nav-divider { width: 1px; height: 18px; background: var(--border); }
.site-nav-link { font-size: 13px; color: var(--text-dim); font-weight: 500; }
.site-nav-link:hover { color: var(--text); }
.site-nav-link.active { color: var(--accent); font-size: 15px; font-weight: 600; }
/* Nav-right (Pricing + Help) — mirrors soccer-hub/static/css/style.css. */
.nav-right { display: flex; align-items: center; gap: 16px; margin-left: auto; }
.nav-right-link { color: var(--text-dim); text-decoration: none; font-size: 13px; font-weight: 500; }
.nav-right-link:hover { color: var(--text); }

/* ── Sub-header (Level 2: leagues within Soccer) ─────────────
   Sits directly under the top sports row (.site-nav). Uses the page
   base background so it reads as a distinct, recessed second tier. */
.subsite-nav {
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 8px 20px; display: flex; gap: 20px; flex-wrap: wrap; align-items: center;
}
.subsite-nav-link { font-size: 13px; color: var(--text-dim); font-weight: 500; text-decoration: none; }
.subsite-nav-link:hover { color: var(--text); }
.subsite-nav-link.active { color: var(--accent); font-weight: 600; }

/* ── Header / season picker ──────────────────────────────── */
.hdr {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 24px; border-bottom: 1px solid var(--border);
}
.hdr-title { font-size: 18px; font-weight: 600; }
.hdr-meta { display: flex; align-items: center; gap: 12px; }
.hdr-meta label { font-size: 13px; color: var(--text-dim); }
select, input[type=number], input[type=text], button {
    background: var(--bg-elev); color: var(--text); border: 1px solid var(--border);
    padding: 6px 10px; border-radius: 4px; font-size: 13px; font-family: inherit;
}
select:focus, input:focus, button:focus { outline: 1px solid var(--accent); }
button { cursor: pointer; }
button:hover { background: var(--bg-row); }
button:disabled { opacity: 0.5; cursor: default; }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--bg); }
button.primary:hover { filter: brightness(1.12); }
.pill { font-size: 11px; padding: 2px 8px; border-radius: 10px; background: var(--bg-row); color: var(--text-dim); }

/* ── Page nav ────────────────────────────────────────────── */
.page-nav { display: flex; gap: 4px; padding: 12px 24px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.page-nav-btn { background: transparent; border: 1px solid transparent; padding: 6px 14px; color: var(--text-dim); }
.page-nav-btn:hover { color: var(--text); }
.page-nav-btn.active { background: var(--bg-elev); border-color: var(--border); color: var(--text); }

/* ── Pages ───────────────────────────────────────────────── */
main { padding: 24px; max-width: 1280px; margin: 0 auto; }
.page { display: none; }
.page.active { display: block; }
.section-head {
    margin: 24px 0 12px; font-size: 13px; font-weight: 600;
    color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.04em;
}
.section-head:first-child { margin-top: 0; }
.subhead { color: var(--text-dim); font-size: 13px; margin: 0 0 16px; }
.toolbar { display: flex; gap: 16px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar label { font-size: 13px; color: var(--text-dim); }

/* ── Tables ──────────────────────────────────────────────── */
table {
    width: 100%; border-collapse: collapse; font-size: 12px;
    background: var(--bg-elev); border: 1px solid var(--border); border-radius: 6px; overflow: hidden;
}
thead th {
    background: var(--bg-row); color: var(--text-dim); text-align: left; padding: 10px 12px;
    font-weight: 600; border-bottom: 1px solid var(--border); white-space: nowrap;
}
tbody td { padding: 8px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--bg-row); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.dim, .dim { color: var(--text-dim); }
td.good, .good { color: var(--good); }
td.bad, .bad { color: var(--bad); }
td.strong, .strong { font-weight: 700; color: var(--text); }
.rank-1 { color: var(--accent); font-weight: 700; }

/* ── League-table qualification bands (left border accent) ─── */
tbody tr.band-ucl td:first-child { box-shadow: inset 3px 0 0 var(--ucl); }
tbody tr.band-europe td:first-child { box-shadow: inset 3px 0 0 var(--europe); }
tbody tr.band-releg td:first-child { box-shadow: inset 3px 0 0 var(--releg); }
.legend { margin-top: 12px; font-size: 12px; color: var(--text-dim); display: flex; gap: 18px; flex-wrap: wrap; align-items: center; }
.legend .key { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: middle; }
.legend .key-ucl { background: var(--ucl); }
.legend .key-europe { background: var(--europe); }
.legend .key-releg { background: var(--releg); }

/* ── Stat row (club summary + track headline) ─────────────── */
.stat-row {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px;
    margin-bottom: 20px;
}
.stat {
    background: var(--bg-elev); border: 1px solid var(--border); border-radius: 6px;
    padding: 14px 16px; display: flex; flex-direction: column; gap: 4px;
}
.stat-k { font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-dim); }
.stat-v { font-size: 22px; font-weight: 700; }

/* ── Admin ───────────────────────────────────────────────── */
.admin-section {
    background: var(--bg-elev); border: 1px solid var(--border); border-radius: 6px;
    padding: 16px; margin-bottom: 16px;
}
.admin-section h3 { margin: 0 0 12px; font-size: 14px; color: var(--text); }
.admin-actions { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.admin-locked {
    background: var(--bg-row); padding: 24px; border-radius: 6px;
    border: 1px dashed var(--border); text-align: center;
}

/* ── Toast / status ──────────────────────────────────────── */
.toast {
    position: fixed; bottom: 24px; right: 24px;
    background: var(--bg-elev); border: 1px solid var(--border);
    padding: 10px 14px; border-radius: 6px; font-size: 13px;
    transform: translateY(8px); opacity: 0; pointer-events: none;
    transition: transform 0.18s, opacity 0.18s; z-index: 10;
}
.toast.visible { transform: translateY(0); opacity: 1; }
.toast.err { border-color: var(--bad); color: var(--bad); }
.toast.ok { border-color: var(--good); color: var(--good); }

/* ── Misc ────────────────────────────────────────────────── */
.empty { padding: 48px; text-align: center; color: var(--text-dim); }
.spinner {
    display: inline-block; width: 14px; height: 14px;
    border: 2px solid var(--border); border-top-color: var(--accent);
    border-radius: 50%; animation: spin 0.8s linear infinite; vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Public coming-soon surface ──────────────────────────── */
.public-main { max-width: 920px; margin: 0 auto; padding: 32px 20px 64px; }
.public-hero { margin-bottom: 28px; }
.public-hero .kicker {
    font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-dim); margin: 0 0 10px;
}
.public-hero h1 { font-size: 30px; line-height: 1.15; margin: 0 0 12px; }
.public-lede { color: var(--text-dim); line-height: 1.6; font-size: 15px; max-width: 660px; margin: 0; }
.public-footer { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--border); }
.public-footer p { color: var(--text-dim); font-size: 12px; line-height: 1.6; margin: 0; }

/* ── Forecast — per-gameweek grid (2026/27+) ─────────────── */
/* Full-bleed: the forecast page escapes main's max-width cap so the wide 38-GW
   grid uses the whole viewport instead of overflowing a centred column. */
#page-forecast.active {
    width: 100vw;
    margin-left: calc(50% - 50vw);
    padding: 0 24px;
    box-sizing: border-box;
}
.fc-head h3 { margin: 0 0 4px; }
.fc-head .dim { line-height: 1.5; max-width: 820px; margin: 0 0 14px; color: var(--text-dim); }
/* The grid scrolls on both axes inside a bounded viewport: overflow-x keeps the
   horizontal scrollbar on the grid (not the page), overflow-y + max-height make
   the container the scroll ancestor so the sticky Club column (left:0) and GW
   headers (top:0) both stick. */
.fc-scroll {
    overflow: auto; max-height: calc(100vh - 150px);
    border: 1px solid var(--border); border-radius: 8px;
}
.fc-grid {
    border-collapse: separate; border-spacing: 0; font-size: 12px; min-width: 100%;
    overflow: visible; border: 0; border-radius: 0;
}
.fc-grid th, .fc-grid td {
    border-bottom: 1px solid var(--border); padding: 5px 6px;
    text-align: center; white-space: nowrap;
}
.fc-grid thead th {
    position: sticky; top: 0; z-index: 3;
    background: var(--bg-elev); color: var(--text-dim);
    font-weight: 600; text-transform: uppercase; font-size: 10px;
}
/* sticky Club column (header + body) */
.fc-team-head, .fc-team {
    position: sticky; left: 0; z-index: 2;
    text-align: left !important; padding-left: 10px !important;
    background: var(--bg-elev);
}
.fc-team-head { z-index: 4; min-width: 150px; }
.fc-team { min-width: 150px; background: var(--bg); }
.fc-team .team-name { font-weight: 600; vertical-align: middle; }
.fc-grid tbody tr:hover .fc-team { background: var(--bg-elev); }
.fc-grid tbody tr:hover td { background: var(--bg-elev); }

.fc-wk { min-width: 46px; }
.fc-cell { min-width: 46px; line-height: 1.15; }
.fc-cell.fc-byewk { background: var(--bg); }
.fc-opp { font-size: 9px; color: var(--text-dim); letter-spacing: .02em; }
.fc-wp { font-weight: 700; font-size: 12px; }
.fc-cell.fc-w .fc-wp { color: var(--good); }
.fc-cell.fc-l .fc-wp { color: var(--bad); }

/* numeric/outcome columns on the right */
.fc-num { text-align: right; font-variant-numeric: tabular-nums; min-width: 50px; }
.fc-sep { border-left: 2px solid var(--border); }
/* Title-odds cell: green wash proportional to the probability. */
.fc-prob { background: rgba(63, 185, 80, calc(var(--p, 0) * 0.5)); padding: 1px 5px; border-radius: 4px; }

/* per-game win-probability heatmap. The dog alphas are lower than the fav ones
   on purpose: a played loss renders its score in var(--bad) ON this wash, and
   --bad has far less headroom than --good, so .22 measured 3.66:1. */
.wp-strong-fav { background: rgba(63, 185, 80, 0.22); }
.wp-light-fav  { background: rgba(63, 185, 80, 0.10); }
.wp-coinflip   { background: transparent; }
.wp-light-dog  { background: rgba(248, 81, 73, 0.05); }
.wp-strong-dog { background: rgba(248, 81, 73, 0.10); }

/* ── Mobile ──────────────────────────────────────────────── */
@media (max-width: 600px) {
    .public-main { padding: 22px 14px 48px; }
    .public-hero h1 { font-size: 24px; }
    .site-nav { gap: 14px; padding: 8px 14px; }
    main { padding: 16px; }
}

/* ── Site footer — the legal footer block (DESIGN_SYSTEM.md §3, 2026-08-13).
   Byte-identical markup on every SSA page; CSS copied verbatim from apex
   tokens.css. Chrome tokens only — no data colours here. */
.site-footer {
  text-align: center;
  padding: 40px 20px 28px;
  margin-top: auto;
  border-top: 1px solid var(--border-subtle);
}
.site-footer p { margin: 0 auto 8px; max-width: 760px; }
.site-footer-legal {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.6;
}
.site-footer-links {
  color: var(--text-muted);
  font-size: 12.5px;
  padding-top: 4px;
}
.site-footer a { color: var(--accent); text-decoration: none; }
.site-footer a:hover { color: var(--text); }
.site-footer-copy { color: var(--text-muted); font-size: 12px; padding-top: 2px; }
