/* generated from template.SHARED_CSS — 12b557dee0 */

/* ── Theme Variables ──────────────────────────────────── */
:root {
  --bg: #f0f2f5;
  --text: #222;
  --text-secondary: #666;
  --text-muted: #888;
  --bg-card: #fff;
  --shadow-card: 0 2px 12px rgba(0,0,0,0.08);
  --bg-header: #1a3c6d;
  --bg-ticker: #0d2347;
  --accent: #1a3c6d;
  --accent-hover: #2a5ca8;
  --accent-text: #90bcf5;
  --bg-th: #1a3c6d;
  --text-th: #fff;
  --border: #e8eaed;
  --bg-even: #f7f9fc;
  --bg-hover: #edf2fb;
  --bg-footer: #1a3c6d;
  --bg-filter: #eef1f7;
  --bg-input: #fff;
  --border-input: #ccc;
  --bg-dropdown: #fff;
  --bg-dropdown-header: #f8f9fc;
  --bg-ad: #f0f2f5;
  --bg-ad-bar: #e8edf5;
  --border-ad: #c8d4e8;
  --bg-cookie: #0d2347;
}
[data-theme="dark"] {
  --bg: #121620;
  --text: #d8dde6;
  --text-secondary: #9aa8b8;
  --text-muted: #6b7888;
  --bg-card: #1c2333;
  --shadow-card: 0 2px 12px rgba(0,0,0,0.35);
  --bg-header: #0f1c32;
  --bg-ticker: #080e1a;
  --accent: #5b9bd5;
  --accent-hover: #7bb3e8;
  --accent-text: #90bcf5;
  --bg-th: #162640;
  --text-th: #c8d8f0;
  --border: #283040;
  --bg-even: #19202e;
  --bg-hover: #222e44;
  --bg-footer: #0f1c32;
  --bg-filter: #19202e;
  --bg-input: #19202e;
  --border-input: #3a4560;
  --bg-dropdown: #1c2333;
  --bg-dropdown-header: #151b28;
  --bg-ad: #121620;
  --bg-ad-bar: #151b28;
  --border-ad: #283040;
  --bg-cookie: #080e1a;
}

/* ── Reset / Base ─────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── Score Ticker ─────────────────────────────────────── */
.score-ticker-wrap {
    background: var(--bg-ticker);
    overflow: hidden;
    height: 28px;
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 101;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.score-ticker-label {
    background: #e8a020;
    color: #000;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0 10px;
    height: 100%;
    display: flex;
    align-items: center;
    white-space: nowrap;
    flex-shrink: 0;
    letter-spacing: 0.5px;
}
.score-ticker-track {
    display: flex;
    white-space: nowrap;
    animation: ticker-scroll 40s linear infinite;
    will-change: transform;
}
.score-ticker-track:hover { animation-play-state: paused; }
.score-ticker-item {
    color: #e0eaff;
    font-size: 0.75rem;
    padding: 0 20px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-right: 1px solid rgba(255,255,255,0.12);
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s;
}
.score-ticker-item:hover {
    background: rgba(255,255,255,0.08);
}
.score-ticker-item .t-win  { color: #7dd4a8; font-weight: 700; }
.score-ticker-item .t-lose { color: #a0b4cc; }
.score-ticker-item .t-score { font-weight: 600; }
.score-ticker-item .t-day  { color: #6a85a8; font-size: 0.68rem; }
.score-ticker-item .t-diff { color: #e8a020; font-weight: 700; font-size: 0.68rem; }
.score-ticker-item .t-po {
  background: #c0392b; color: #fff; font-weight: 800;
  font-size: 0.62rem; padding: 1px 5px; border-radius: 3px;
  letter-spacing: 0.5px;
}
@keyframes ticker-scroll {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* ── Site Header / Nav ────────────────────────────────── */
.site-header {
    background: var(--bg-header);
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
    position: sticky;
    top: 28px;   /* sits below the 28px ticker */
    z-index: 100;
}
.header-inner {
    max-width: 1400px;
    /* body is display:flex, so this container is a flex item whose min-width
       defaults to AUTO — its min-content (a 2000px DataTables scrollHead) forced it
       past the viewport to its 1400px cap and scrolled six desktop pages sideways.
       The exact grid/flex trap TRAPS.md documents. */
    min-width: 0;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 42px;
    flex-wrap: wrap;
}
.site-title {
    color: #fff;
    font-size: 1.25rem;
    font-weight: 700;
    text-decoration: none;
    letter-spacing: 0.5px;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
}
.site-logo { height: 50px; width: auto; border-radius: 6px; }
.site-title span { color: #90bcf5; }
/* ── Hamburger Menu (mobile only) ────────────────────── */
.hamburger-btn {
    display: none;
    background: none;
    border: none;
    color: #c8d8f0;
    font-size: 1.6rem;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 4px;
    transition: background 0.15s, color 0.15s;
    line-height: 1;
    flex-shrink: 0;
}
.hamburger-btn:hover { background: rgba(255,255,255,0.12); color: #fff; }

nav {
    display: flex; gap: 0; flex-wrap: wrap; align-items: center;
    margin: 0 6px 0 12px;   /* sit inline, between the logo and the right-side controls */
    margin-right: auto;     /* take the slack so 🔍 / theme / user stay flush right */
    padding: 0;
}
nav a {
    color: #c8d8f0;
    text-decoration: none;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.82rem;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}
nav a:hover  { background: rgba(255,255,255,0.12); color: #fff; }
nav a.active { background: rgba(255,255,255,0.18); color: #fff; font-weight: 600; }

/* ── Grouped dropdown nav ─────────────────────────────── */
.nav-group { position: relative; }
.nav-group-btn {
    color: #c8d8f0; background: none; border: 0; cursor: pointer;
    padding: 4px 8px; border-radius: 4px; font-size: 0.82rem; font-family: inherit;
    white-space: nowrap; display: inline-flex; align-items: center; gap: 4px;
    transition: background 0.15s, color 0.15s;
}
.nav-group-btn:hover { background: rgba(255,255,255,0.12); color: #fff; }
.nav-group.active > .nav-group-btn { background: rgba(255,255,255,0.18); color: #fff; font-weight: 600; }
.nav-caret { font-size: 0.6rem; opacity: 0.7; }
.nav-group-menu {
    display: none; position: absolute; top: 100%; left: 0; z-index: 200; min-width: 190px;
    background: #0f1c32; border: 1px solid rgba(255,255,255,0.12); border-radius: 8px;
    padding: 6px; box-shadow: 0 14px 34px rgba(0,0,0,0.45); margin-top: 2px;
}
.nav-group:hover > .nav-group-menu,
.nav-group:focus-within > .nav-group-menu,
.nav-group.open > .nav-group-menu { display: block; }
.nav-group-menu a { display: block; padding: 7px 12px; border-radius: 5px; }
.nav-group-menu a.nav-live { font-weight: 700; }
.nav-live-dot { color: #3ddc84; font-size: .7em; margin-left: 6px; vertical-align: middle; }

/* ── Collapsible page intros (mobile) ─────────────────── */
.page-intro-more { display: none; background: none; border: 0; color: var(--accent-text);
    font-weight: 600; font-size: 0.85rem; cursor: pointer; padding: 6px 2px; }
@media (max-width: 768px) {
    .page-intro.intro-collapsed { max-height: 4.7em; overflow: hidden; position: relative; }
    .page-intro.intro-collapsed::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0;
        height: 2.2em; background: linear-gradient(transparent, var(--bg-card)); }
    .page-intro-more { display: block; }
}

/* ── Page Container ───────────────────────────────────── */
.container {
    max-width: 1400px;
    /* Three interacting flex-item facts, each necessary:
       - body is display:flex, so this is a flex item;
       - margin: 0 auto DISABLES the default stretch, so the item sizes to content;
       - min-width defaults to auto, so "content" means min-content — a 2000px
         DataTables scrollHead pushed six desktop pages into horizontal scroll.
       width:100% + min-width:0 restores the classic centered container: full width,
       capped at 1400, content can never push it wider. */
    width: 100%;
    min-width: 0;
    margin: 0 auto;
    padding: 28px 24px;
    flex: 1;
}
.page-title {
    color: var(--accent);
    font-size: 1.7rem;
    font-weight: 700;
    margin-bottom: 4px;
}
.page-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 24px;
}

/* ── Cards ────────────────────────────────────────────── */
.card {
    background: var(--bg-card);
    border-radius: 10px;
    box-shadow: var(--shadow-card);
    padding: 24px;
    margin-bottom: 28px;
}

/* ── Tables ───────────────────────────────────────────── */
table { width: 100%; border-collapse: collapse; }
th, td {
    padding: 9px 10px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
td { text-align: right; }
th { text-align: center; }
/* Text columns — applied via DataTables className: 'dt-left' */
td.dt-left { text-align: left !important; }
/* Logo/image columns — centered */
td.dt-center { text-align: center !important; }
/* Suppress sort-column background highlight for scrollX tables.
   DataTables 1.13 + FixedColumns 4.x has a known head/body column-width
   desync bug that makes the highlight appear over the wrong column.
   The sort arrow on the header still indicates which column is active. */
/* DataTables' computed scroll region can exceed its card by ~50px (measured 1304px in a
   1256px card on five stats pages), pushing the PAGE into horizontal scroll at desktop.
   Contain the scroll to the widget — same rule as every other wide-table fix here. */
.dataTables_wrapper { max-width: 100%; }
/* NOTE: do NOT put overflow on .dataTables_scroll — it becomes the sticky
   scrollHead's containment and breaks viewport pinning (hunt54's "header on
   top of the top 2 rows" bug). The 1280px overflow this once patched is
   properly fixed by .container{width:100%;min-width:0} above. */
/* draft.html wraps its table in .table-responsive, which had NO overflow rule at all —
   a 1218px table simply widened the page to 1226px on a 390px phone. */
.table-responsive { overflow-x: auto; max-width: 100%; -webkit-overflow-scrolling: touch; }
.dataTables_scroll table.dataTable thead th.sorting_asc,
.dataTables_scroll table.dataTable thead th.sorting_desc {
    background-color: var(--bg-th) !important;
}
.dataTables_scroll table.dataTable tbody td.sorting_1,
.dataTables_scroll table.dataTable tbody td.sorting_2,
.dataTables_scroll table.dataTable tbody td.sorting_3 {
    background-color: inherit !important;
}
th {
    background: var(--bg-th);
    color: var(--text-th);
    font-weight: 600;
    font-size: 0.83rem;
    letter-spacing: 0.3px;
    padding: 10px 8px !important;
}
/* Stick the entire scrollHead div (not individual th elements).
   Sticky on th inside an overflow:hidden container causes offset bugs. */
.dataTables_scrollHead {
    position: sticky !important;
    top: 84px !important;   /* 28px ticker + 56px nav */
    z-index: 10;
}
/* The scrollBody thead is kept by DataTables for column width measurement.
   Collapse it completely so it doesn't create an invisible gap row. */
.dataTables_scrollBody thead {
    visibility: hidden;
}
.dataTables_scrollBody thead th {
    padding: 0 !important;
    height: 0 !important;
    line-height: 0 !important;
    border: none !important;
    font-size: 0 !important;
}
/* Override the filter-row rule (which has higher specificity) for the
   scrollBody clone — ensure filter cells are also zero-height there. */
.dataTables_scrollBody thead tr:nth-child(2) th {
    height: 0 !important;
    padding: 0 !important;
    line-height: 0 !important;
    border: none !important;
    font-size: 0 !important;
}
tr:nth-child(even) { background: var(--bg-even); }
tr:hover { background: var(--bg-hover); }

/* ── DataTable column-filter row (second <tr> in <thead>) ─ */
.dataTables_scrollHead thead tr:nth-child(2) th {
    background: var(--bg-filter) !important;
    color: var(--text) !important;
    padding: 4px 6px !important;
    font-weight: normal !important;
    font-size: 0.83rem !important;
    height: auto !important;
    width: auto !important;
    cursor: default;
    position: relative;
    z-index: 20;   /* paint above scrollHead so select options show in front */
}
/* Keep non-scoped rule for any other pages that don't use DataTables */
thead tr:nth-child(2) th {
    background: var(--bg-filter) !important;
    color: var(--text) !important;
    padding: 4px 6px !important;
    font-weight: normal !important;
    font-size: 0.83rem !important;
    height: auto !important;
    width: auto !important;
    cursor: default;
}
thead tr:nth-child(2) th select {
    width: 100%;
    font-size: 0.76rem;
    border: 1px solid var(--border-input);
    border-radius: 3px;
    padding: 2px 4px;
    background: var(--bg-input);
    color: var(--text);
    cursor: pointer;
}

/* ── DataTables FixedColumns — keep frozen cells styled ──── */
.dtfc-fixed-left                              { background: var(--bg-card); box-shadow: 3px 0 6px rgba(0,0,0,0.10); }
table.dataTable thead tr:first-child   .dtfc-fixed-left { background: var(--bg-th); }
table.dataTable thead tr:nth-child(2)  .dtfc-fixed-left { background: var(--bg-filter); }
tr:nth-child(even) .dtfc-fixed-left    { background: var(--bg-even); }
tr:hover           .dtfc-fixed-left    { background: var(--bg-hover); }

/* ── Team Logo ────────────────────────────────────────── */
.team-logo {
    width: 28px;
    height: 28px;
    object-fit: contain;
    vertical-align: middle;
    margin-right: 4px;
}

/* ── DataTables overrides ─────────────────────────────── */
.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
    border: 1px solid var(--border-input);
    border-radius: 4px;
    padding: 4px 8px;
    background: var(--bg-input);
    color: var(--text);
}
.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: var(--accent) !important;
    color: #fff !important;
    border-radius: 4px;
    border: none !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: var(--accent-hover) !important;
    color: #fff !important;
    border: none !important;
    border-radius: 4px;
}

/* ── Ad Slots (AdSense) ──────────────────────────────────
   Three "no ad" states are collapsed via CSS so the layout doesn't
   reserve dead space:
     1. body.no-ads          — paid users (set by showLoggedIn JS)
     2. body:not(.cookie-accepted) — visitor hasn't accepted cookies yet
     3. <ins data-ad-status="unfilled"> — AdSense ran the auction and
        nobody bid. Google sets this attribute synchronously after the
        auction so layout settles within a few hundred ms.
   Until a fill arrives the wrapper has 0 min-height so the chrome is
   invisible; once filled, AdSense expands the <ins> to its served size
   and the wrapper grows to match. */
.ad-slot {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.72rem;
}
.ad-slot .adsbygoogle { width: 100%; }
/* Ads must never widen the page. Before the consent flow became opt-out these
   containers were display:none for most visitors, so an over-wide unit was
   invisible; loading by default exposed 12px of horizontal scroll on a 390px
   screen (article pages, 2026-09-15). AdSense sizes its own <ins>/<iframe> from
   the slot, so clamp the wrappers and let the unit size down to fit. */
.ad-bar, .ad-bar-footer, .ad-in-article-wrap { max-width: 100%; overflow-x: clip; }
.ad-slot, .ad-slot .adsbygoogle, .ad-in-article-wrap .adsbygoogle,
.ad-bar ins, .ad-bar-footer ins { max-width: 100%; }
.ad-bar iframe, .ad-bar-footer iframe, .ad-in-article-wrap iframe { max-width: 100%; }
.ad-in-article-wrap { margin: 24px 0; text-align: center; }
.ad-in-article-wrap .adsbygoogle { display: block; text-align: center; }
.ad-slot-top {
    width: 100%;
    max-width: 728px;
    min-height: 0;
    margin: 0 auto 0;
}
.ad-slot-footer {
    width: 100%;
    max-width: 728px;
    min-height: 0;
    margin: 0 auto;
}
/* Pre-consent: hide all ad chrome until visitor clicks Accept. */
body:not(.cookie-accepted) .ad-bar,
body:not(.cookie-accepted) .ad-bar-footer,
body:not(.cookie-accepted) .ad-in-article-wrap { display: none; }
/* Unfilled auction: collapse the slot + its wrapper bar. */
ins.adsbygoogle[data-ad-status="unfilled"] { display: none !important; }
.ad-bar:has(ins.adsbygoogle[data-ad-status="unfilled"]),
.ad-bar-footer:has(ins.adsbygoogle[data-ad-status="unfilled"]),
.ad-in-article-wrap:has(ins.adsbygoogle[data-ad-status="unfilled"]) { display: none; }
.ad-bar {
    background: var(--bg-ad-bar);
    padding: 8px 24px;
    display: flex;
    justify-content: center;
    border-bottom: 1px solid var(--border);
}
.ad-bar-footer {
    background: var(--bg-ad-bar);
    padding: 8px 24px;
    display: flex;
    justify-content: center;
    border-top: 1px solid var(--border);
}
@media (max-width: 768px) {
    .ad-slot-top, .ad-slot-footer { max-width: 100%; }
    .ad-bar, .ad-bar-footer { padding: 6px 8px; }
}
@media (max-width: 480px) {
    .ad-slot-top, .ad-slot-footer { max-width: 320px; font-size: 0.65rem; }
    .ad-bar, .ad-bar-footer { padding: 4px 6px; }
}

/* ── Footer ───────────────────────────────────────────── */
.site-footer {
    background: var(--bg-footer);
    color: var(--accent-text);
    text-align: center;
    padding: 18px 24px;
    font-size: 0.85rem;
}
.site-footer .footer-brand {
    display: block;
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #f0c040;
    margin-bottom: 6px;
}
.site-footer a { color: #c8d8f0; text-decoration: none; }
.site-footer a:hover { color: #fff; }

/* ── User Menu (top-right) ────────────────────────────── */
.user-menu {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.user-menu-btn {
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.2);
    color: #c8d8f0;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 0.82rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background 0.15s;
    font-family: inherit;
}
.user-menu-btn:hover { background: rgba(255,255,255,0.2); color: #fff; }
.user-menu-btn.logged-in { color: #7dd4a8; border-color: rgba(125,212,168,0.3); }
.user-menu-btn .nav-team-logo {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: contain;
    background: #fff;
    padding: 2px;
}
.user-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 6px;
    background: var(--bg-dropdown);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    min-width: 240px;
    z-index: 200;
    overflow: hidden;
}
.user-dropdown.open { display: block; }
.user-dropdown-header {
    padding: 14px 16px;
    background: var(--bg-dropdown-header);
    border-bottom: 1px solid var(--border);
}
.user-dropdown-email { font-size: 0.82rem; color: #1a3c6d; font-weight: 600; }
.user-dropdown-tier { font-size: 0.72rem; color: #888; margin-top: 2px; }
.user-dropdown-item {
    display: block;
    width: 100%;
    padding: 10px 16px;
    font-size: 0.85rem;
    color: #333;
    text-decoration: none;
    border: none;
    background: none;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    transition: background 0.1s;
}
.user-dropdown-item { color: var(--text); }
.user-dropdown-item:hover { background: var(--bg-hover); }
.user-dropdown-item.danger { color: #d32f2f; }
.user-dropdown-item.danger:hover { background: #fef0f0; }
/* Login form in dropdown */
.login-form { padding: 14px 16px; }
.login-form input {
    width: 100%;
    padding: 8px 10px;
    margin-bottom: 8px;
    border: 1px solid var(--border-input);
    border-radius: 6px;
    font-size: 0.82rem;
    font-family: inherit;
    box-sizing: border-box;
    background: var(--bg-input);
    color: var(--text);
}
.login-form input:focus { border-color: var(--accent); outline: none; }
.login-form-btn {
    width: 100%;
    padding: 8px;
    background: #1a3c6d;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}
.login-form-btn:hover { background: #235291; }
.login-form-error { color: #d32f2f; font-size: 0.78rem; margin-bottom: 6px; display: none; }
.login-form-toggle { font-size: 0.75rem; color: #666; text-align: center; margin-top: 8px; }
.login-form-toggle a { color: #1a3c6d; cursor: pointer; font-weight: 600; text-decoration: none; }

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 768px) {
    .header-inner {
        height: auto;
        flex-wrap: wrap;
        padding: 10px 16px;
        gap: 0;
    }
    .hamburger-btn { display: block; min-height: 44px; min-width: 44px; }
    .site-title { flex: 1; }
    nav {
        display: none;
        flex-direction: column;
        width: 100%;
        order: 10;
        padding: 8px 0 4px;
        gap: 2px;
        border-top: 1px solid rgba(255,255,255,0.1);
        margin-top: 8px;
    }
    nav.nav-open {
        display: flex;
        /* MUST be nowrap. The nav inherits flex-wrap:wrap from the desktop bar, and this
           is a COLUMN with a max-height — so as soon as a group expands past that height,
           the overflow wraps into a SECOND COLUMN off to the right instead of scrolling.
           At 390px that put the Games submenu's right edge at 722px: tapping Games opened
           it exactly as the DOM reported, entirely off-screen. Reported as "clicking games
           doesn't put the dropdown" AND "weird sizing where you have to horizontally
           scroll" — one cause, both symptoms. overflow-y:auto below is what should absorb
           the extra height, and can't while wrapping is on.
           This only appears once a group is EXPANDED, which is why measuring the menu
           open-but-collapsed showed zero overflow and the bug survived testing. */
        flex-wrap: nowrap;
        width: 100%;
        box-sizing: border-box;
        overflow-x: hidden;
        /* Allow the menu to scroll within itself instead of growing the header
           (which would cause the page to scroll when the user swipes the menu). */
        max-height: calc(100vh - 130px);
        max-height: calc(100dvh - 130px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }
    /* Lock body scroll while nav is open so swipes stay inside the menu. */
    body.nav-locked { overflow: hidden; }
    nav a {
        font-size: 0.95rem;
        padding: 12px 14px;
        border-radius: 6px;
        min-height: 44px;
        display: flex;
        align-items: center;
    }
    nav a:hover { background: rgba(255,255,255,0.12); }
    /* mobile: groups are a tap-to-expand accordion (collapsed by default) */
    .nav-group { width: 100%; }
    .nav-group-btn {
        width: 100%; justify-content: space-between; font-size: 0.95rem;
        padding: 12px 14px; min-height: 44px;
    }
    .nav-group-menu {
        position: static; display: none; box-shadow: none; border: 0;
        background: rgba(0,0,0,0.18); border-radius: 6px;
        padding: 4px 0 4px 14px; min-width: 0; margin: 2px 0 2px 4px;
    }
    .nav-group.open > .nav-group-menu { display: block; }
    .nav-group-menu a { font-size: 0.92rem; }
    .nav-caret { display: inline-block; font-size: 0.8rem; transition: transform 0.15s; }
    .nav-group.open > .nav-group-btn .nav-caret { transform: rotate(180deg); }
    /* The page itself must never be wider than the phone. .container only capped its
       max-width at 1400px, so one wide table dragged the WHOLE page out with it —
       standings measured 1400px of scroll width on a 390px screen, and every heading and
       paragraph stretched with it. Cap it at the viewport and let the wide child scroll
       inside its own box instead. */
    .container { padding: 16px 12px; max-width: 100%; }
    .container, .card, .hero { max-width: 100%; box-sizing: border-box; }
    .site-header { top: 28px; }
    .dataTables_scrollHead { top: 84px !important; }
    .user-menu-btn span.email-text { display: none; }
    .user-menu-btn { padding: 10px 14px; min-height: 40px; }
    .cookie-btn { padding: 10px 18px; min-height: 40px; font-size: 0.88rem; }
    /* Disable FixedColumns sticky on mobile — causes overlap */
    .dtfc-fixed-left { position: static !important; box-shadow: none !important; }
    table.dataTable { font-size: 0.82rem; }
    table.dataTable th, table.dataTable td { padding: 6px 8px !important; }
    /* Make any plain table scroll horizontally instead of bursting layout.
       This was scoped to DIRECT children of .container/.card, so a table nested one div
       deeper — which is most of them — still burst the page. */
    table:not(.dataTable) {
        display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%;
    }
    /* Larger tap targets for DataTables paginate */
    .dataTables_paginate .paginate_button {
        padding: 8px 12px !important;
        min-height: 40px;
        line-height: 1.4 !important;
        margin: 0 2px !important;
    }
    /* Length + filter inputs — keep them stacking and full width */
    .dataTables_length, .dataTables_filter { float: none !important; text-align: left !important; margin-bottom: 8px; }
    .dataTables_filter input { width: 100% !important; max-width: 280px; padding: 8px 10px !important; min-height: 40px; }
    .dataTables_length select { padding: 8px 10px !important; min-height: 40px; }
}
@media (max-width: 600px) {
    .container { padding: 14px 10px; }
    .site-title { font-size: 1.05rem !important; }
    /* keep the header to one row: drop the "Analytics" wordmark (logo + NBN remain) */
    .site-title span { display: none; }
    .user-menu-btn { padding: 8px 12px; }
    .card { padding: 14px 12px; }
    /* Drop nowrap so DT cells can wrap rather than spawn an ocean of horizontal scroll */
    table.dataTable th, table.dataTable td { white-space: normal !important; }
    table.dataTable thead th { min-width: 0; }
}
@media (max-width: 480px) {
    .container { padding: 12px 8px; }
    table.dataTable { font-size: 0.78rem; }
    table.dataTable th, table.dataTable td { padding: 5px 6px !important; }
    .site-footer { font-size: 0.78rem; padding: 12px 12px; line-height: 1.5; }
    .site-footer .footer-brand { font-size: 1rem; }
    /* User dropdown — keep fully on-screen on small phones */
    .user-dropdown { right: 8px; left: 8px; min-width: 0; max-width: calc(100vw - 16px); }
    /* Make dropdown items easy to tap */
    .user-dropdown-item { padding: 12px 16px; font-size: 0.95rem; min-height: 44px; }
    .login-form input, .login-form-btn { padding: 10px 12px; font-size: 0.95rem; min-height: 42px; }
    /* Theme toggle bigger on phones */
    .theme-toggle { padding: 8px 10px; min-height: 38px; min-width: 38px; }
}

/* ── Cookie Consent Banner ───────────────────────────── */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-cookie);
    color: #e0eaff;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    font-size: 0.85rem;
    z-index: 9999;
    box-shadow: 0 -2px 12px rgba(0,0,0,0.3);
    flex-wrap: wrap;
}
.cookie-banner a { color: #90bcf5; text-decoration: underline; }
.cookie-banner a:hover { color: #fff; }

/* Mobile: one compact row instead of two.
   The banner is FIXED, so every pixel is permanently gone — at 14px padding with
   the buttons wrapping to a second row it stood 99px tall on a 664px phone, 15%
   of the viewport, on every page. Buttons keep a 40px tap target; only the copy,
   padding and font shrink.
   NOTE: this block must stay AFTER the base .cookie-banner rule above — an
   earlier @media block loses to it on source order at equal specificity, which
   is exactly how the first attempt silently did nothing. */
@media (max-width: 768px) {
    .cookie-banner {
        padding: 6px 10px; gap: 8px; font-size: 0.74rem;
        justify-content: space-between; text-align: left;
    }
    .cookie-banner .cookie-long { display: none; }   /* "for ads and analytics" */
    .cookie-banner a { white-space: nowrap; }
    .cookie-btn { padding: 8px 12px; min-height: 40px; font-size: 0.78rem; }
}
.cookie-btn {
    padding: 6px 18px;
    border: none;
    border-radius: 4px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}
.cookie-btn-accept { background: #7dd4a8; color: #0d2347; }
.cookie-btn-accept:hover { background: #5ec48e; }
.cookie-btn-decline { background: rgba(255,255,255,0.15); color: #c8d8f0; }
.cookie-btn-decline:hover { background: rgba(255,255,255,0.25); color: #fff; }
body.no-ads .ad-bar, body.no-ads .ad-bar-footer { display: none !important; }

/* ── DataTables column spacing fix ───────────────────── */
table.dataTable th,
table.dataTable td {
    white-space: nowrap;
    padding: 6px 8px !important;
    font-size: 0.82rem;
}
table.dataTable thead th {
    min-width: 54px;
}

/* ── Dark-mode toggle button ──────────────────────────── */
.theme-toggle {
    background: none;
    border: 1px solid rgba(255,255,255,0.2);
    color: #c8d8f0;
    border-radius: 6px;
    padding: 5px 8px;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    transition: background 0.15s;
    flex-shrink: 0;
}
/* ── Global player search ─────────────────────────────── */
.search-btn {
    background: none; border: 1px solid rgba(255,255,255,0.2); color: #c8d8f0;
    border-radius: 6px; padding: 5px 8px; cursor: pointer; font-size: 1rem; line-height: 1;
    transition: background 0.15s; flex-shrink: 0;
}
.search-btn:hover { background: rgba(255,255,255,0.12); color: #fff; }
.player-search-overlay {
    display: none; position: fixed; inset: 0; z-index: 1000;
    background: rgba(8,16,30,0.55); backdrop-filter: blur(2px);
    padding: 80px 16px 16px; justify-content: center; align-items: flex-start;
}
.player-search-overlay.open { display: flex; }
.player-search-box {
    width: 100%; max-width: 520px; background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 12px; box-shadow: 0 24px 60px rgba(0,0,0,0.5); padding: 14px; max-height: 70vh;
    display: flex; flex-direction: column;
}
#player-search-input {
    width: 100%; box-sizing: border-box; font-size: 1.05rem; padding: 12px 14px;
    border: 1px solid var(--border-input); border-radius: 9px; background: var(--bg-input); color: var(--text);
}
.player-search-results { overflow-y: auto; margin-top: 8px; }
.player-search-results a {
    display: flex; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: 8px;
    text-decoration: none; color: var(--text); font-size: 0.95rem;
}
.player-search-results a:hover, .player-search-results a.active { background: var(--bg-hover); }
.player-search-results .ps-sub { color: var(--text-muted); font-size: 0.8rem; }
.player-search-hint { color: var(--text-muted); font-size: 0.76rem; margin-top: 8px; text-align: center; }
.theme-toggle:hover { background: rgba(255,255,255,0.12); }

/* ── Dark-mode catch-all overrides ────────────────────── */
[data-theme="dark"] .dataTables_wrapper .dataTables_info,
[data-theme="dark"] .dataTables_wrapper .dataTables_paginate .paginate_button {
    color: var(--text-secondary) !important;
}
[data-theme="dark"] .dataTables_wrapper .dataTables_paginate .paginate_button.disabled {
    color: var(--text-muted) !important;
}
[data-theme="dark"] .dataTables_scroll table.dataTable thead th.sorting_asc,
[data-theme="dark"] .dataTables_scroll table.dataTable thead th.sorting_desc {
    background-color: var(--bg-th) !important;
}
[data-theme="dark"] .user-dropdown { background: var(--bg-card); border-color: var(--border); }
[data-theme="dark"] .user-dropdown-email { color: var(--accent-text); }
[data-theme="dark"] .user-dropdown-tier { color: var(--text-muted); }
[data-theme="dark"] .user-dropdown-item { color: var(--text); }
[data-theme="dark"] .user-dropdown-item:hover { background: rgba(255,255,255,0.06); }
[data-theme="dark"] .user-dropdown-item.danger { color: #ef5350; }
[data-theme="dark"] .login-overlay { background: rgba(0,0,0,0.7); }
[data-theme="dark"] .login-form { background: var(--bg-card); color: var(--text); }
[data-theme="dark"] .login-form h2 { color: var(--accent-text); }
[data-theme="dark"] .login-form input { background: var(--bg); color: var(--text); border-color: var(--border); }
[data-theme="dark"] .login-form-error { color: #ef5350; }
[data-theme="dark"] .login-form-toggle { color: var(--text-muted); }
[data-theme="dark"] .login-form-toggle a { color: var(--accent-text); }
[data-theme="dark"] a { color: var(--accent); }
[data-theme="dark"] .player-link { color: var(--accent-text); }
[data-theme="dark"] .team-link { color: var(--text-secondary); }
[data-theme="dark"] .team-link:hover { color: var(--accent); }
[data-theme="dark"] .site-footer a { color: #c8d8f0; }
[data-theme="dark"] .site-footer a:hover { color: #fff; }

/* ── Dark-mode: DataTables wrapper text (filter label, length label, info) ── */
[data-theme="dark"] .dataTables_wrapper .dataTables_filter,
[data-theme="dark"] .dataTables_wrapper .dataTables_length,
[data-theme="dark"] .dataTables_wrapper .dataTables_info {
    color: var(--text-secondary) !important;
}
[data-theme="dark"] .dataTables_wrapper .dataTables_length select {
    background: var(--bg-input);
    color: var(--text);
    border-color: var(--border-input);
}
[data-theme="dark"] .dataTables_wrapper .dataTables_filter input {
    background: var(--bg-input);
    color: var(--text);
    border-color: var(--border-input);
}
[data-theme="dark"] .dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: var(--accent) !important;
    color: #fff !important;
}
[data-theme="dark"] .dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: var(--accent-hover) !important;
    color: #fff !important;
}
/* DataTables empty row */
[data-theme="dark"] .dataTables_wrapper .dataTables_empty {
    color: var(--text-muted);
    background: var(--bg-card);
}

/* ── Dark-mode: Preset filter chips (player stats, etc.) ─────────────── */
[data-theme="dark"] .preset-chip {
    background: var(--bg-filter);
    border-color: var(--border);
    color: var(--accent-text);
}
[data-theme="dark"] .preset-chip:hover {
    background: var(--bg-hover);
    border-color: var(--accent);
}
[data-theme="dark"] .preset-chip.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}
[data-theme="dark"] .preset-chip code {
    color: var(--text-muted);
}
[data-theme="dark"] .chip-label {
    color: var(--text-muted) !important;
}

/* ── Dark-mode: Position filter buttons (depth chart, etc.) ──────────── */
[data-theme="dark"] .pos-filter-btn {
    background: var(--bg-filter);
    border-color: var(--border);
    color: var(--text);
}
[data-theme="dark"] .pos-filter-btn.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

/* ── Dark-mode: Filter bar elements ──────────────────────────────────── */
[data-theme="dark"] .filter-bar label {
    color: var(--text-muted) !important;
}
[data-theme="dark"] .filter-bar select,
[data-theme="dark"] .filter-bar input {
    background: var(--bg-input);
    color: var(--text);
    border-color: var(--border-input);
}

/* ── Dark-mode: Table text and row backgrounds ───────────────────────── */
[data-theme="dark"] table.dataTable tbody td {
    color: var(--text);
}
[data-theme="dark"] table.dataTable tbody td a.player-link {
    color: var(--accent-text);
}
[data-theme="dark"] table.dataTable tbody td a.team-link {
    color: var(--text-secondary);
}

/* ── Dark-mode: Available player list (depth chart, trade checker) ───── */
[data-theme="dark"] .available-player {
    border-bottom-color: var(--border);
}
[data-theme="dark"] .available-player:hover {
    background: var(--bg-hover);
}
[data-theme="dark"] .available-player .ap-name {
    color: var(--accent-text);
}
[data-theme="dark"] .available-player .ap-pos {
    color: var(--text-muted);
}
[data-theme="dark"] .available-filter input {
    background: var(--bg-input);
    color: var(--text);
    border-color: var(--border-input);
}

/* ── Dark-mode: Dropdown danger item hover ───────────────────────────── */
[data-theme="dark"] .user-dropdown-item.danger:hover {
    background: rgba(239,83,80,0.12);
}

/* ── Dark-mode: Login form button ────────────────────────────────────── */
[data-theme="dark"] .login-form-btn {
    background: var(--accent);
}
[data-theme="dark"] .login-form-btn:hover {
    background: var(--accent-hover);
}

/* ── Dark-mode: Column header filter row inputs ──────────────────────── */
[data-theme="dark"] thead tr:nth-child(2) {
    background: var(--bg-filter) !important;
}
[data-theme="dark"] thead tr:nth-child(2) input[type=number],
[data-theme="dark"] thead tr:nth-child(2) input[type=text],
[data-theme="dark"] thead tr:nth-child(2) select {
    background: var(--bg-input);
    color: var(--text);
    border-color: var(--border-input);
}

/* ── Dark-mode: DataTables alternating rows + FixedColumns ──────────── */
/* Exclude TC highlight cells so green/red colors show through */
[data-theme="dark"] table.dataTable tbody tr:nth-child(odd) td:not(.tc-cell-up):not(.tc-cell-dn):not(.tc-tot-up):not(.tc-tot-dn) { background: var(--bg-card) !important; color: var(--text) !important; }
[data-theme="dark"] table.dataTable tbody tr:nth-child(even) td:not(.tc-cell-up):not(.tc-cell-dn):not(.tc-tot-up):not(.tc-tot-dn) { background: var(--bg-even) !important; color: var(--text) !important; }
[data-theme="dark"] table.dataTable tbody tr:hover td:not(.tc-cell-up):not(.tc-cell-dn):not(.tc-tot-up):not(.tc-tot-dn) { background: var(--bg-hover) !important; }
/* TC improved/regressed row backgrounds also need exceptions */
[data-theme="dark"] table.dataTable tbody tr.tc-improved td:not(.tc-tot-up):not(.tc-tot-dn) { background: rgba(30,138,82,0.12) !important; }
[data-theme="dark"] table.dataTable tbody tr.tc-regressed td:not(.tc-tot-up):not(.tc-tot-dn) { background: rgba(200,16,46,0.12) !important; }
[data-theme="dark"] table.dataTable tbody tr:nth-child(odd) .dtfc-fixed-left { background: var(--bg-card) !important; }
[data-theme="dark"] table.dataTable tbody tr:nth-child(even) .dtfc-fixed-left { background: var(--bg-even) !important; }
[data-theme="dark"] table.dataTable tbody tr:hover .dtfc-fixed-left { background: var(--bg-hover) !important; }
[data-theme="dark"] table.dataTable thead th { background: var(--bg-th) !important; color: var(--text-th) !important; }

/* ── Dark-mode: Nav team logo white background ───────────────────────── */
[data-theme="dark"] .user-menu-btn .nav-team-logo {
    background: rgba(255,255,255,0.15);
}
