/* ==========================================================================
   GMan Pools — Design System  ("Classic Broadcast")
   Navy + white, red accent, field-green touches. Condensed uppercase heads.
   Presentation only — no markup logic depends on this file.
   ========================================================================== */

:root {
    /* Brand palette */
    --navy-900: #081827;
    --navy-800: #0b2138;   /* primary brand / header */
    --navy-700: #12304d;
    --navy-600: #1c4066;
    --red-600:  #c8102e;   /* primary accent / CTAs */
    --red-700:  #a50d26;
    --green-600:#1e7a46;   /* field green / correct / over */
    --green-500:#1a9d54;
    --gold-500: #d9a400;   /* standings / winners */

    /* Neutrals */
    --ink:      #16202b;   /* body text */
    --ink-soft: #52616f;   /* muted text */
    --line:     #d7dee6;   /* borders */
    --line-soft:#e8edf2;
    --surface:  #ffffff;   /* cards */
    --surface-2:#f4f6f8;   /* subtle fills */
    --page-bg:  #eef2f6;   /* app background */

    /* Status */
    --ok-bg:  #e6f4ec;
    --no-bg:  #fdecee;

    /* Type */
    --font-display: 'Anton', 'Oswald', 'Arial Narrow', 'Helvetica Neue', Arial, sans-serif;
    --font-head: 'Oswald', 'Roboto Condensed', 'Arial Narrow', 'Helvetica Neue', Arial, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

    /* Spacing scale */
    --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
    --sp-5: 24px; --sp-6: 32px; --sp-7: 48px; --sp-8: 64px;

    /* Radius + shadow */
    --r-sm: 4px; --r-md: 8px; --r-lg: 14px; --r-pill: 999px;
    --shadow-sm: 0 1px 2px rgba(8,24,39,.08), 0 1px 3px rgba(8,24,39,.06);
    --shadow-md: 0 4px 12px rgba(8,24,39,.10), 0 2px 4px rgba(8,24,39,.06);
    --shadow-lg: 0 18px 40px rgba(8,24,39,.16);

    --maxw: 1180px;
}

/* ---------- Reset / base ------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.55;
    color: var(--ink);
    /* Default "Broadcast" theme — the deep-blue stadium wash from the entrance
       page. Content lives in white cards, which read cleanly on top of it.
       The High-Contrast theme (html.theme-contrast) swaps to the flat eggshell. */
    background-color: var(--navy-900);
    background-image: radial-gradient(130% 100% at 50% 0%, #12304d 0%, #081827 60%);
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    background-size: cover;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* High-Contrast theme swaps the blue wash back to the flat eggshell.
   (On-page text colors for each theme live in the THEME OVERRIDES block at
   the end of this file, so they win over the base component rules.) */
html.theme-contrast body {
    background-color: var(--page-bg);
    background-image: none;
}
body.has-bg-image { background-color: var(--navy-900); }

img { max-width: 100%; height: auto; vertical-align: middle; }

a { color: var(--navy-700); text-decoration: none; }
a:hover { color: var(--red-600); text-decoration: underline; }

h1, h2, h3, h4, h5 {
    font-family: var(--font-head);
    font-weight: 700;
    line-height: 1.08;
    letter-spacing: .01em;
    text-transform: none;
    color: var(--navy-800);
    margin: 0 0 var(--sp-4);
}
/* Big broadcast headlines: Anton ships one weight, so ask for 400 —
   synthesized bold would distort the letterforms. */
h1, h2 {
    font-family: var(--font-display);
    font-weight: 400;
    letter-spacing: .025em;
}
h1 { font-size: clamp(28px, 4vw, 44px); }
h2 { font-size: clamp(22px, 3vw, 30px); }
h3 { font-size: clamp(18px, 2.4vw, 23px); }
h4 { font-size: 16px; letter-spacing: .04em; }

p { margin: 0 0 var(--sp-4); }

hr { border: none; border-top: 1px solid var(--line); margin: var(--sp-5) 0; }

/* ---------- Layout ------------------------------------------------------- */
.container {
    width: 100%;
    max-width: var(--maxw);
    margin-inline: auto;
    padding-inline: var(--sp-5);
}

.page {
    padding-block: var(--sp-6) var(--sp-8);
    min-height: 60vh;
}

.page-head { text-align: center; margin-bottom: var(--sp-6); }
.page-head .eyebrow {
    font-family: var(--font-head);
    text-transform: uppercase;
    letter-spacing: .18em;
    font-size: 13px;
    color: var(--red-600);
    font-weight: 600;
    margin-bottom: var(--sp-2);
}
.page-head h1 { margin-bottom: var(--sp-2); }
.page-head .sub { color: var(--ink-soft); font-size: 15px; margin: 0; }

/* ---------- Site header / nav ------------------------------------------- */
.site-header {
    background: linear-gradient(180deg, var(--navy-800), var(--navy-900));
    color: #fff;
    border-bottom: 3px solid var(--red-600);
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 50;
}
.site-header__bar {
    display: flex;
    align-items: center;
    gap: var(--sp-4);
    min-height: 68px;
    padding-block: var(--sp-2);
}
.brand {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-3);
    color: #fff;
    text-decoration: none;
}
.brand:hover { color: #fff; text-decoration: none; }
.brand__mark {
    width: 42px; height: 42px;
    border-radius: 50%;
    background: var(--red-600);
    display: grid; place-items: center;
    font-size: 22px;
    box-shadow: inset 0 0 0 2px rgba(255,255,255,.25);
    flex: none;
}
.brand__name {
    font-family: var(--font-display);
    text-transform: uppercase;
    font-weight: 400;
    font-size: 24px;
    letter-spacing: .06em;
    line-height: 1;
}
.brand__name small {
    display: block;
    font-family: var(--font-head);
    font-size: 11px;
    letter-spacing: .22em;
    color: #9fb6cc;
    font-weight: 500;
}
.site-nav { margin-left: auto; display: flex; align-items: center; gap: var(--sp-1); flex-wrap: wrap; }
.site-nav a {
    color: #cddae7;
    font-family: var(--font-head);
    text-transform: uppercase;
    letter-spacing: .06em;
    font-size: 14px;
    font-weight: 600;
    padding: var(--sp-2) var(--sp-3);
    border-radius: var(--r-sm);
    text-decoration: none;
    transition: background .15s, color .15s;
}
.site-nav a:hover, .site-nav a.is-active { color: #fff; background: rgba(255,255,255,.10); text-decoration: none; }
.site-nav a.is-active { box-shadow: inset 0 -2px 0 var(--red-600); }

/* ---------- Pool identity strip (image the old base showed) ------------- */
.pool-identity {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--sp-3);
    padding-block: var(--sp-5) 0;
}
.pool-identity img {
    max-height: 150px;
    width: auto;
    border-radius: var(--r-md);
}

/* ---------- Cards -------------------------------------------------------- */
.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-md);
    padding: var(--sp-6);
}
.card--tight { padding: var(--sp-5); }
.card--accent { border-top: 4px solid var(--red-600); }
.card__title {
    margin: 0 0 var(--sp-4);
    padding-bottom: var(--sp-3);
    border-bottom: 2px solid var(--line-soft);
}
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--sp-5);
}
.stack > * + * { margin-top: var(--sp-4); }

/* Center a card as a form panel */
.panel {
    max-width: 560px;
    margin-inline: auto;
}

/* ---------- Buttons ------------------------------------------------------ */
.btn, button, input[type="submit"], input[type="button"], input[type="reset"] {
    font-family: var(--font-head);
    text-transform: none;
    letter-spacing: .05em;
    font-weight: 600;
    font-size: 15px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-2);
    padding: 12px 20px;
    border: 1px solid transparent;
    border-radius: var(--r-sm);
    background: var(--navy-800);
    color: #fff;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s, box-shadow .15s, transform .05s;
    box-shadow: var(--shadow-sm);
}
.btn:hover, button:hover, input[type="submit"]:hover, input[type="button"]:hover, input[type="reset"]:hover {
    background: var(--navy-700); color: #fff; text-decoration: none;
}
.btn:active, button:active { transform: translateY(1px); }
.btn:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: 3px solid rgba(28,64,102,.35);
    outline-offset: 2px;
}

.btn--primary, input[type="submit"].btn--primary { background: var(--red-600); }
.btn--primary:hover { background: var(--red-700); }
.btn--green { background: var(--green-600); }
.btn--green:hover { background: var(--green-500); }
.btn--ghost {
    background: transparent;
    color: var(--navy-800);
    border-color: var(--line);
    box-shadow: none;
}
.btn--ghost:hover { background: var(--surface-2); color: var(--navy-800); }
.btn--sm { padding: 8px 14px; font-size: 13px; }
.btn--lg { padding: 15px 28px; font-size: 17px; }
.btn--block { display: flex; width: 100%; }

/* ---------- Forms -------------------------------------------------------- */
label { font-weight: 600; color: var(--ink); }

input[type="text"], input[type="email"], input[type="tel"], input[type="password"],
input[type="number"], input[type="search"], select, textarea {
    font-family: var(--font-body);
    font-size: 15px;
    color: var(--ink);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    padding: 10px 12px;
    width: 100%;
    transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
    border-color: var(--navy-600);
    box-shadow: 0 0 0 3px rgba(28,64,102,.14);
    outline: none;
}
textarea { resize: vertical; min-height: 72px; }
select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2352616f' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 34px;
    cursor: pointer;
}

/* The legacy template tags emit fixed inline widths (90/125px) that clip
   option text ("Divisional", pool names…). Let those selects size to their
   longest option instead; .select-shell (later in this sheet) still wins
   with full-width where a form is designed for it. */
select[style*="width"] { width: auto !important; max-width: 100%; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: var(--sp-4); }
.field label { font-family: var(--font-head); text-transform: uppercase; letter-spacing: .04em; font-size: 13px; color: var(--ink-soft); }
.field .hint { font-size: 13px; color: var(--ink-soft); }

.form-actions { display: flex; gap: var(--sp-3); flex-wrap: wrap; align-items: center; margin-top: var(--sp-5); }

/* ---------- Tables (base) ------------------------------------------------ */
.table-scroll { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--r-md); }

table { border-collapse: collapse; }

.data-table {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    overflow: hidden;
    font-size: 15px;
}
.data-table caption {
    caption-side: top;
    font-family: var(--font-head);
    text-transform: uppercase;
    letter-spacing: .04em;
    font-size: 20px;
    color: var(--navy-800);
    padding: var(--sp-3) 0 var(--sp-4);
}
.data-table th {
    background: var(--navy-800);
    color: #fff;
    font-family: var(--font-head);
    text-transform: uppercase;
    letter-spacing: .04em;
    font-weight: 600;
    font-size: 13px;
    padding: 12px 14px;
    text-align: center;
    white-space: nowrap;
    border-right: 1px solid rgba(255,255,255,.08);
}
.data-table thead th { position: sticky; top: 0; }
.data-table td {
    padding: 11px 14px;
    text-align: center;
    border-bottom: 1px solid var(--line-soft);
    border-right: 1px solid var(--line-soft);
}
.data-table tbody tr:nth-child(even) { background: var(--surface-2); }
.data-table tbody tr:hover { background: #eaf1f8; }
.data-table td:last-child, .data-table th:last-child { border-right: none; }

/* Standings emphasis */
.rank { font-family: var(--font-head); font-size: 18px; color: var(--navy-700); }
tr.is-leader { background: #fff9e6 !important; }
tr.is-leader .rank { color: var(--gold-500); }

/* ---------- Spread / matchup bits --------------------------------------- */
.team-logo { height: 44px; width: auto; }
.matchup { display: inline-flex; align-items: center; gap: var(--sp-2); }
.matchup .at { opacity: .55; font-size: 12px; }
.spread-badge {
    display: inline-block;
    font-family: var(--font-head);
    text-transform: uppercase;
    letter-spacing: .03em;
    font-weight: 600;
    font-size: 13px;
    background: var(--navy-800);
    color: #fff;
    padding: 4px 10px;
    border-radius: var(--r-pill);
    white-space: nowrap;
}

/* Yes/No pick toggle — wraps existing radios, values unchanged (Yes/No/O/U) */
.pick-option {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-head);
    text-transform: uppercase;
    letter-spacing: .03em;
    font-weight: 600;
    font-size: 14px;
    padding: 6px 12px;
    border: 1px solid var(--line);
    border-radius: var(--r-pill);
    cursor: pointer;
    user-select: none;
    background: #fff;
    transition: border-color .12s, background .12s, color .12s;
}
.pick-option:hover { border-color: var(--navy-600); }
.pick-option input { width: auto; margin: 0; accent-color: var(--red-600); }
.pick-option--yes:has(input:checked) { background: var(--ok-bg); border-color: var(--green-600); color: var(--green-600); }
.pick-option--no:has(input:checked)  { background: var(--no-bg); border-color: var(--red-600);  color: var(--red-600); }

/* ---------- Alerts / messages ------------------------------------------- */
.alert {
    border: 1px solid var(--line);
    border-left: 4px solid var(--navy-700);
    background: var(--surface);
    border-radius: var(--r-md);
    padding: var(--sp-4) var(--sp-5);
    box-shadow: var(--shadow-sm);
}
.alert--error { border-left-color: var(--red-600); background: var(--no-bg); }
.alert--ok    { border-left-color: var(--green-600); background: var(--ok-bg); }
.alert h3 { color: inherit; }

/* ---------- Utilities ---------------------------------------------------- */
.text-center { text-align: center; }
.text-muted { color: var(--ink-soft); }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.mt-4 { margin-top: var(--sp-4); } .mt-6 { margin-top: var(--sp-6); }
.flex { display: flex; gap: var(--sp-3); }
.flex-center { display: flex; align-items: center; justify-content: center; gap: var(--sp-3); flex-wrap: wrap; }
.flex-wrap { flex-wrap: wrap; }
.hide { display: none; }
.nowrap { white-space: nowrap; }

/* ---------- Footer ------------------------------------------------------- */
.site-footer {
    margin-top: var(--sp-8);
    background: var(--navy-900);
    color: #9fb6cc;
    border-top: 3px solid var(--red-600);
}
.site-footer__bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-4);
    padding-block: var(--sp-5);
    flex-wrap: wrap;
    font-size: 14px;
}
.site-footer a { color: #cddae7; }

/* Footer display/background toggles */
.footer-controls { display: inline-flex; align-items: center; gap: var(--sp-5); flex-wrap: wrap; }
.bg-toolbar { display: inline-flex; align-items: center; gap: 8px; }
.bg-toolbar label { color: #9fb6cc; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.bg-toolbar select { width: auto; min-width: 180px; padding: 6px 30px 6px 10px; font-size: 13px; }

/* ---------- Responsive --------------------------------------------------- */
@media (max-width: 760px) {
    .container { padding-inline: var(--sp-4); }
    .site-header__bar { flex-wrap: wrap; min-height: 0; }
    .site-nav { width: 100%; margin-left: 0; justify-content: flex-start; }
    .card { padding: var(--sp-5); }
    .brand__name { font-size: 20px; }
}

/* ---------- Legacy compatibility ----------------------------------------
   Keeps pages not yet reskinned (Round 2: totals, spreads, admin, errors,
   confirmations) tidy, and supports old class names some views/tags still
   emit. .data-table opts out so the polished tables keep their own styling. */
.center { margin-left: auto; margin-right: auto; }
.centered { text-align: center; }
.centered-table { margin-inline: auto; }

.page table:not(.data-table) {
    margin-inline: auto;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-sm);
    font-variant-numeric: tabular-nums;
    max-width: 100%;
}
.page table:not(.data-table) caption {
    font-family: var(--font-head);
    text-transform: uppercase;
    letter-spacing: .03em;
    color: var(--navy-800);
    padding: var(--sp-3);
}
.page table:not(.data-table) th,
.page table:not(.data-table) td {
    border: 1px solid var(--line-soft);
    padding: 9px 13px;
}
.page table:not(.data-table) th {
    background: var(--surface-2);
    font-family: var(--font-head);
    text-transform: uppercase;
    letter-spacing: .03em;
    font-size: 13px;
    color: var(--navy-800);
}

/* ---------- Flourishes (Round 3) -----------------------------------------
   Sleek select wrapper + game-day motion. All opt-in classes; the
   reduced-motion guard at the bottom stills everything for users who ask. */

/* Wrap a template-tag dropdown ("Pool: <select…>") in .select-shell:
   the loose "Pool:" text node inherits the shell's mini-label styling,
   while the select itself resets to body type. !important is needed to
   beat the inline width the template tags emit (markup untouched). */
.select-shell {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-family: var(--font-head);
    text-transform: uppercase;
    letter-spacing: .14em;
    font-size: 12px;
    font-weight: 600;
    color: var(--ink-soft);
}
.select-shell select {
    width: 100% !important;
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 500;
    letter-spacing: normal;
    text-transform: none;
    padding: 12px 38px 12px 14px;
    border-radius: var(--r-md);
}
.select-shell select:hover { border-color: var(--navy-600); }

/* Kickoff entrance: fade-and-rise, staggered by modifier */
@keyframes kickoff {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: none; }
}
.kickoff { animation: kickoff .55s cubic-bezier(.16,.84,.44,1) both; }
.kickoff--2 { animation-delay: .08s; }
.kickoff--3 { animation-delay: .16s; }
.kickoff--4 { animation-delay: .24s; }
.kickoff--5 { animation-delay: .32s; }

/* Breathing glow for the marquee CTA */
@keyframes glow-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(200,16,46,.45), var(--shadow-sm); }
    50%      { box-shadow: 0 0 22px 4px rgba(200,16,46,.42), var(--shadow-sm); }
}
.btn-glow { animation: glow-pulse 2.8s ease-in-out infinite; }

/* Snap the ball: brand football rocks when hovered */
@keyframes hike {
    0%   { transform: rotate(0); }
    30%  { transform: rotate(-14deg) translateY(-2px); }
    60%  { transform: rotate(10deg); }
    100% { transform: rotate(0); }
}
.brand:hover .brand__mark { animation: hike .7s ease; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-delay: 0s !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}

/* ---------- THEME OVERRIDES (must stay last) -----------------------------
   On-page headings/labels that sit directly on the page background. Placed at
   the end of the sheet so they override the base .page-head / h1 component
   rules above. The home page (.home-hero) intentionally sets no color of its
   own on these, so it inherits from here. */

/* Broadcast (default): light text on the deep-blue wash. */
.home-hero h1, .page-head h1 { color: #fff; text-shadow: 0 2px 22px rgba(0,0,0,.55); }
.home-hero p,  .page-head .sub { color: #c3d2e0; }
.home-hero .eyebrow, .page-head .eyebrow { color: #ff6b7a; }

/* High Contrast (opt-in): original dark-on-eggshell. */
html.theme-contrast .home-hero h1,
html.theme-contrast .page-head h1 { color: var(--navy-800); text-shadow: none; }
html.theme-contrast .home-hero p,
html.theme-contrast .page-head .sub { color: var(--ink-soft); }
html.theme-contrast .home-hero .eyebrow,
html.theme-contrast .page-head .eyebrow { color: var(--red-600); }

/* Field-photo background forces readable light text in either theme (last, so
   it beats both broadcast and contrast). */
body.has-bg-image .home-hero h1,
body.has-bg-image .page-head h1 { color: #fff; text-shadow: 0 2px 22px rgba(0,0,0,.65); }
body.has-bg-image .home-hero p,
body.has-bg-image .home-hero .eyebrow,
body.has-bg-image .page-head .sub,
body.has-bg-image .page-head .eyebrow { color: #eef3f8; text-shadow: 0 1px 12px rgba(0,0,0,.6); }
