/* webapp/static/style.css
   NLL Predictions picks ballot. Scoreboard / printed-game-program vernacular:
   condensed athletic display face for team names & headers, warm serif for
   body copy, a plain system sans for labels/clock/counter (tabular-nums
   keeps digits aligned without needing a monospace face). No webfonts
   loaded (deliberate: this page is meant to load fast on mobile data) - the
   condensed/serif character comes from real system font stacks.
*/

:root {
    --ink: #1b1f1c;
    --paper: #eff1ea;
    --paper-raised: #e4e7dc;
    --accent: #c97a12;
    --accent-ink: #1b1f1c;
    --accent-2: #3f6b4e;
    --line: rgba(27, 31, 28, 0.14);
    --muted: #5b6058;

    --font-display: "Roboto Condensed", "Arial Narrow", "Helvetica Neue", sans-serif;
    --font-body: Georgia, "Iowan Old Style", "Times New Roman", serif;
    --font-utility: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
    :root {
        --ink: #f3f1e9;
        --paper: #12161c;
        --paper-raised: #1b212b;
        --accent: #f2a93b;
        --accent-ink: #14181f;
        --accent-2: #6fbe8c;
        --line: rgba(243, 241, 233, 0.14);
        --muted: #9aa1ac;
    }
}
:root[data-theme="dark"] {
    --ink: #f3f1e9;
    --paper: #12161c;
    --paper-raised: #1b212b;
    --accent: #f2a93b;
    --accent-ink: #14181f;
    --accent-2: #6fbe8c;
    --line: rgba(243, 241, 233, 0.14);
    --muted: #9aa1ac;
}
:root[data-theme="light"] {
    --ink: #1b1f1c;
    --paper: #eff1ea;
    --paper-raised: #e4e7dc;
    --accent: #c97a12;
    --accent-ink: #1b1f1c;
    --accent-2: #3f6b4e;
    --line: rgba(27, 31, 28, 0.14);
    --muted: #5b6058;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.wrap {
    max-width: 560px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ---------- header ---------- */

.ballot-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--paper);
    border-bottom: 2px solid var(--accent);
    padding: 14px 16px 10px;
}

.eyebrow {
    font-family: var(--font-utility);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
}

.ballot-header h1 {
    font-family: var(--font-display);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.01em;
    font-size: clamp(1.6rem, 7vw, 2.1rem);
    margin: 2px 0 4px;
    text-wrap: balance;
}

.deadline {
    font-family: var(--font-utility);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent);
    font-variant-numeric: tabular-nums;
}

/* ---------- form sections ---------- */

main { padding: 4px 16px 24px; flex: 1; }

.field-group {
    padding: 18px 0;
    border-bottom: 1px solid var(--line);
}

.field-group label.field-label {
    display: block;
    font-family: var(--font-utility);
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 8px;
}

.field-group input[type="text"] {
    width: 100%;
    border: none;
    border-bottom: 2px solid var(--line);
    background: transparent;
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 1.05rem;
    padding: 6px 2px;
}

.field-group input[type="text"]:focus-visible {
    outline: none;
    border-bottom-color: var(--accent);
}

.date-heading {
    font-family: var(--font-display);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 0.95rem;
    color: var(--muted);
    margin: 22px 0 4px;
}

.date-heading:first-of-type { margin-top: 18px; }

/* ---------- matchup tile ---------- */

.game-card {
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.game-time {
    font-family: var(--font-utility);
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
}

.choice-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: stretch;
    gap: 8px;
}

.choice input[type="radio"] {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.choice label {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 56px;
    padding: 10px 8px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--paper-raised);
    color: var(--ink);
    font-family: var(--font-display);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.01em;
    font-size: 0.92rem;
    line-height: 1.15;
    cursor: pointer;
    transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease, transform 0.08s ease;
}

.choice input:checked + label {
    background: var(--accent);
    color: var(--accent-ink);
    border-color: var(--accent);
}

.choice input:focus-visible + label {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.choice label:active { transform: scale(0.97); }

@media (hover: hover) {
    .choice input:not(:checked) + label:hover { border-color: var(--accent); }
    button.submit:hover { filter: brightness(1.08); }
}

.vs {
    align-self: center;
    font-family: var(--font-utility);
    font-size: 0.72rem;
    color: var(--muted);
    letter-spacing: 0.04em;
}

@media (prefers-reduced-motion: reduce) {
    .choice label { transition: none; }
    .choice label:active { transform: none; }
}

/* ---------- sticky submit bar ---------- */

.submit-bar {
    position: sticky;
    bottom: 0;
    z-index: 10;
    background: var(--paper);
    border-top: 1px solid var(--line);
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.progress {
    font-family: var(--font-utility);
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.progress strong { color: var(--ink); }

button.submit {
    font-family: var(--font-display);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    font-size: 1rem;
    background: var(--accent);
    color: var(--accent-ink);
    border: none;
    border-radius: 999px;
    padding: 13px 26px;
    cursor: pointer;
    flex-shrink: 0;
}

button.submit:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }

/* ---------- results pages ---------- */

.site-nav {
    display: flex;
    gap: 16px;
    margin-top: 8px;
    font-family: var(--font-utility);
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.site-nav a { color: var(--muted); text-decoration: none; padding: 2px 0; border-bottom: 2px solid transparent; }
.site-nav a:hover { color: var(--ink); }
.site-nav a[aria-current="page"] { color: var(--accent); border-bottom-color: var(--accent); }
.site-nav a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.table-scroll { overflow-x: auto; margin-top: 14px; }

.results-table {
    width: 100%;
    border-collapse: collapse;
    font-variant-numeric: tabular-nums;
}

.results-table th {
    font-family: var(--font-utility);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    text-align: left;
    padding: 8px 8px;
    border-bottom: 2px solid var(--line);
    white-space: nowrap;
}

.results-table td { padding: 10px 8px; border-bottom: 1px solid var(--line); }
.results-table .num { text-align: right; white-space: nowrap; }
.results-table .rank { color: var(--muted); width: 2.5em; }
.results-table .leader .rank, .results-table .leader td:nth-child(2) { color: var(--accent); font-weight: 700; }
.results-table .of { color: var(--muted); font-size: 0.85em; }
.results-table .tb { color: var(--muted); font-size: 0.92em; }

.table-note { font-family: var(--font-utility); font-size: 0.78rem; color: var(--muted); margin: 10px 0 0; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

.chip {
    font-family: var(--font-display);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    font-size: 0.9rem;
    color: var(--ink);
    text-decoration: none;
    border: 1px solid var(--line);
    background: var(--paper-raised);
    border-radius: 10px;
    padding: 10px 14px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
}

.chip:hover { border-color: var(--accent); }
.chip.current { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.week-details { border-bottom: 1px solid var(--line); }
.week-details summary {
    cursor: pointer;
    list-style: none;
    padding: 14px 2px;
    min-height: 44px;
    font-family: var(--font-display);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}
.week-details summary::-webkit-details-marker { display: none; }
.week-details summary::before { content: "+"; display: inline-block; width: 1.2em; color: var(--accent); }
.week-details[open] summary::before { content: "\2212"; }
.week-details summary .of { font-family: var(--font-utility); font-weight: 600; text-transform: none; letter-spacing: 0; font-size: 0.8rem; color: var(--muted); }
.week-details summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.week-details .table-scroll { margin: 0 0 14px; }
