:root {
    color-scheme: dark;
    --site-bg: #07101f;
    --site-surface: #0d1b31;
    --site-surface-2: #11233e;
    --site-line: rgba(148, 163, 184, .2);
    --site-text: #f7fafc;
    --site-muted: #a9b7ca;
    --site-blue: #4d8dff;
    --site-blue-strong: #2870f0;
    --site-gold: #f6c453;
    --site-radius: 18px;
    --site-shadow: 0 24px 70px rgba(0, 0, 0, .28);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 92px; }
body {
    margin: 0;
    background:
        radial-gradient(circle at 10% -10%, rgba(37, 99, 235, .22), transparent 34rem),
        radial-gradient(circle at 90% 12%, rgba(14, 165, 233, .1), transparent 28rem),
        var(--site-bg);
    color: var(--site-text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
a { color: #9bc2ff; }
button, input, select { font: inherit; }
button, .site-button { -webkit-tap-highlight-color: transparent; }

.site-shell { width: min(1180px, calc(100% - 40px)); margin-inline: auto; }
.site-nav {
    position: sticky;
    top: 0;
    z-index: 50;
    border-bottom: 1px solid var(--site-line);
    background: rgba(7, 16, 31, .88);
    backdrop-filter: blur(18px);
}
.site-nav-inner { min-height: 76px; display: flex; align-items: center; gap: 28px; }
.site-brand { display: inline-flex; align-items: center; flex: 0 1 auto; }
.site-brand img { display: block; width: min(270px, 48vw); height: auto; }
.site-nav-links { display: flex; align-items: center; gap: 24px; margin-left: auto; }
.site-nav-links a { color: #cbd6e5; font-weight: 700; text-decoration: none; }
.site-nav-links a:hover { color: white; }
.site-nav .site-button { margin-left: 4px; }

.site-button {
    display: inline-flex;
    min-height: 46px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 18px;
    border: 1px solid transparent;
    border-radius: 11px;
    background: linear-gradient(135deg, var(--site-blue), var(--site-blue-strong));
    box-shadow: 0 10px 28px rgba(37, 99, 235, .25);
    color: white;
    cursor: pointer;
    font-weight: 800;
    text-decoration: none;
    transition: transform .18s ease, filter .18s ease, border-color .18s ease;
}
.site-button:hover { color: white; filter: brightness(1.08); transform: translateY(-1px); }
.site-button.secondary { border-color: var(--site-line); background: rgba(15, 30, 53, .75); box-shadow: none; }
.site-eyebrow { color: #84b3ff; font-size: .8rem; font-weight: 900; letter-spacing: .13em; text-transform: uppercase; }
.site-muted { color: var(--site-muted); }

.landing-hero { padding: 92px 0 62px; overflow: hidden; }
.landing-hero-grid { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(340px, .88fr); align-items: center; gap: 64px; }
.landing-hero h1 { max-width: 800px; margin: 14px 0 20px; font-size: clamp(2.9rem, 6vw, 5.4rem); line-height: .97; letter-spacing: -.055em; }
.landing-hero h1 span { color: #75a9ff; }
.landing-hero-copy { max-width: 680px; color: #c4cfdd; font-size: clamp(1.08rem, 2vw, 1.3rem); }
.landing-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.landing-chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }
.landing-chip { padding: 7px 11px; border: 1px solid var(--site-line); border-radius: 999px; background: rgba(14, 29, 52, .72); color: #cdd7e4; font-size: .83rem; font-weight: 700; }

.result-card {
    position: relative;
    padding: 26px;
    border: 1px solid rgba(117, 169, 255, .34);
    border-radius: 24px;
    background: linear-gradient(155deg, rgba(27, 60, 105, .95), rgba(9, 23, 42, .98) 68%);
    box-shadow: var(--site-shadow);
    transform: rotate(1.5deg);
}
.result-card::before { content: ""; position: absolute; inset: 10px; border: 1px solid rgba(255,255,255,.07); border-radius: 17px; pointer-events: none; }
.result-card-top { display: flex; justify-content: space-between; gap: 18px; color: #b9c8da; font-size: .78rem; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.result-card h2 { margin: 38px 0 2px; font-size: clamp(1.8rem, 4vw, 2.8rem); line-height: 1; }
.result-card-subtitle { color: var(--site-gold); font-weight: 900; }
.result-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-top: 28px; }
.result-stat { padding: 13px 8px; border: 1px solid rgba(255,255,255,.1); border-radius: 12px; background: rgba(2, 8, 20, .32); text-align: center; }
.result-stat strong { display: block; font-size: 1.4rem; }
.result-stat span { color: #aebdd0; font-size: .69rem; font-weight: 800; text-transform: uppercase; }
.result-score { margin-top: 12px; padding: 15px; border-radius: 12px; background: rgba(246, 196, 83, .1); color: #ffe3a0; text-align: center; font-weight: 900; }

.site-section { padding: 76px 0; }
.site-section.tint { border-block: 1px solid rgba(148, 163, 184, .12); background: rgba(11, 24, 44, .55); }
.site-heading { max-width: 720px; margin-bottom: 34px; }
.site-heading h2 { margin: 8px 0 10px; font-size: clamp(2rem, 4vw, 3.1rem); line-height: 1.08; letter-spacing: -.035em; }
.site-heading p { margin: 0; color: var(--site-muted); font-size: 1.08rem; }
.feature-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.feature-card, .how-step, .format-card, .content-card {
    border: 1px solid var(--site-line);
    border-radius: var(--site-radius);
    background: linear-gradient(145deg, rgba(18, 38, 68, .86), rgba(10, 23, 42, .9));
    box-shadow: 0 14px 36px rgba(0,0,0,.12);
}
.feature-card { padding: 24px; }
.feature-icon { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 12px; background: rgba(77, 141, 255, .14); color: #9bc2ff; font-size: 1.25rem; font-weight: 900; }
.feature-card h3 { margin: 18px 0 6px; }
.feature-card p { margin: 0; color: var(--site-muted); }
.how-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; counter-reset: step; }
.how-step { padding: 22px; counter-increment: step; }
.how-step::before { content: counter(step); display: grid; width: 34px; height: 34px; place-items: center; border-radius: 50%; background: #367bec; color: white; font-weight: 900; }
.how-step h3 { margin: 16px 0 6px; }
.how-step p { margin: 0; color: var(--site-muted); }
.format-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.format-card { padding: 22px; }
.format-card strong { display: block; color: #9bc2ff; font-size: 1.15rem; }
.format-card span { color: var(--site-muted); }
.faq-list { display: grid; gap: 10px; }
.faq-list details { border: 1px solid var(--site-line); border-radius: 13px; background: rgba(13, 27, 49, .75); }
.faq-list summary { padding: 17px 19px; cursor: pointer; font-weight: 800; }
.faq-list details p { margin: 0; padding: 0 19px 18px; color: var(--site-muted); }
.final-cta { padding: 44px; border: 1px solid rgba(117,169,255,.3); border-radius: 24px; background: linear-gradient(135deg, #183867, #0c1c34); text-align: center; }
.final-cta h2 { margin: 0 0 8px; font-size: clamp(2rem, 4vw, 3rem); }
.final-cta p { margin: 0 auto 22px; color: #c2cede; }
.site-footer { padding: 34px 0; border-top: 1px solid var(--site-line); color: #8999ad; font-size: .9rem; }
.site-footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 18px; }
.site-footer-links { display: flex; flex-wrap: wrap; gap: 18px; }
.site-footer a, .link-button { color: #aebed2; }
.link-button { padding: 0; border: 0; background: none; cursor: pointer; text-decoration: underline; }

.policy-page main { width: min(880px, calc(100% - 40px)); margin: 0 auto; padding: 54px 0 80px; }
.content-card { padding: clamp(22px, 5vw, 42px); }
.content-card h1 { margin-top: 0; font-size: clamp(2rem, 4vw, 3rem); }
.content-card h2 { margin-top: 34px; line-height: 1.2; }
.content-card li { margin-bottom: 8px; }

.analytics-consent {
    position: fixed; right: 18px; bottom: 18px; z-index: 1000;
    width: min(440px, calc(100% - 36px)); padding: 18px;
    border: 1px solid rgba(148,163,184,.35); border-radius: 15px;
    background: rgba(9, 21, 39, .97); box-shadow: var(--site-shadow); color: #dbe5f1;
}
.analytics-consent strong { display: block; color: white; font-size: 1.05rem; }
.analytics-consent p { margin: 5px 0 14px; color: #aebdd0; font-size: .9rem; }
.analytics-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.analytics-actions button { min-height: 42px; padding: 9px 13px; border-radius: 9px; border: 1px solid transparent; background: #3479ed; color: white; cursor: pointer; font-weight: 800; }
.analytics-actions button.secondary { border-color: var(--site-line); background: #142640; }

/* Shared polish for the playable game. */
.game-page header { background: rgba(7, 16, 31, .92); backdrop-filter: blur(16px); }
.game-page header > div { max-width: 1500px; margin: 0 auto; }
.game-page .card { border-color: var(--site-line); border-radius: 16px; background: linear-gradient(145deg, rgba(20, 40, 70, .94), rgba(13, 27, 49, .96)); box-shadow: 0 12px 32px rgba(0,0,0,.13); }
.game-page input, .game-page select { min-height: 44px; border-radius: 10px; }
.game-page button { min-height: 42px; border-radius: 10px; font-weight: 750; transition: transform .15s ease, filter .15s ease; }
.game-page button:hover { filter: brightness(1.08); }
.game-page .table-wrapper, .game-page .recent-picks, .game-page .status { border-color: var(--site-line); border-radius: 12px; }
.game-page .modal-backdrop { background: rgba(1, 6, 15, .78); backdrop-filter: blur(8px); }
.game-page .modal { max-height: min(86vh, 820px); overflow-y: auto; border-color: rgba(148,163,184,.28); border-radius: 18px; background: #10213a; }
.game-page table th { position: sticky; top: 0; z-index: 1; background: #132641; }
.team-overview-trigger {
    padding: 1px 2px !important; min-height: 0 !important; border: 0 !important;
    border-radius: 4px !important; background: transparent !important;
    color: #a9c9ff !important; font-weight: 800; text-align: left;
    text-decoration: underline; text-decoration-color: rgba(147,197,253,.35);
    text-underline-offset: 3px;
}
.team-overview-trigger:hover, .team-overview-trigger:focus-visible { color: white !important; text-decoration-color: #93c5fd; }
.team-overview-popover {
    position: fixed; z-index: 1200; width: min(390px, calc(100vw - 24px));
    max-height: min(520px, 72vh); overflow: auto; padding: 16px;
    border: 1px solid rgba(148,163,184,.36); border-radius: 15px;
    background: rgba(8,20,38,.98); box-shadow: 0 22px 60px rgba(0,0,0,.48);
}
.team-overview-title { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 10px; font-size: 1.05rem; font-weight: 900; }
.team-overview-hint { color: #7f93ad; font-size: .72rem; font-weight: 600; }
.team-overview-player { display: grid; grid-template-columns: 46px minmax(0,1fr) auto; align-items: center; gap: 8px; padding: 7px 0; border-top: 1px solid rgba(148,163,184,.12); }
.team-overview-slot { color: #7faaf2; font-size: .7rem; font-weight: 900; }
.team-overview-player-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 750; }
.team-overview-meta { color: #91a3b9; font-size: .72rem; }
.team-overview-average { color: #e9f1fb; font-weight: 900; white-space: nowrap; }
.award-badge { display: inline-flex; align-items: center; margin-left: 4px; padding: 1px 5px; border: 1px solid rgba(250,204,21,.28); border-radius: 999px; background: rgba(250,204,21,.1); color: #fde68a; font-size: .67rem; font-weight: 900; vertical-align: middle; }
.award-badge.aa { border-color: rgba(96,165,250,.35); background: rgba(59,130,246,.13); color: #bfdbfe; }
.award-badge.rising { border-color: rgba(74,222,128,.35); background: rgba(34,197,94,.12); color: #bbf7d0; }

@media (max-width: 900px) {
    .site-nav-links a:not(.site-button) { display: none; }
    .landing-hero { padding-top: 64px; }
    .landing-hero-grid { grid-template-columns: 1fr; gap: 42px; }
    .result-card { width: min(580px, 100%); margin: auto; transform: none; }
    .feature-grid { grid-template-columns: 1fr 1fr; }
    .how-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 650px) {
    .site-shell { width: min(100% - 28px, 1180px); }
    .site-nav-inner { min-height: 66px; gap: 10px; }
    .site-brand img { width: min(205px, 48vw); }
    .site-nav .site-button { min-height: 42px; padding: 8px 12px; font-size: .88rem; }
    .landing-hero { padding: 50px 0 42px; }
    .landing-hero h1 { font-size: clamp(2.55rem, 13vw, 4rem); }
    .landing-actions { display: grid; grid-template-columns: 1fr; }
    .landing-actions .site-button { width: 100%; }
    .result-card { padding: 21px; }
    .result-card-top { font-size: .68rem; }
    .result-stats { gap: 6px; }
    .result-stat strong { font-size: 1.15rem; }
    .site-section { padding: 54px 0; }
    .feature-grid, .how-grid, .format-grid { grid-template-columns: 1fr; }
    .final-cta { padding: 30px 20px; }
    .site-footer-inner { align-items: flex-start; flex-direction: column; }
    .policy-page main { width: min(100% - 28px, 880px); padding-top: 30px; }

    .game-page header { padding: 11px 14px; }
    .game-page header > div { flex-wrap: nowrap !important; align-items: center !important; }
    .game-page header img { width: min(205px, 48vw) !important; }
    .game-page header > div > div { justify-content: flex-end; gap: 7px !important; }
    .game-page header a[href="/about"], .game-page header a[href="/privacy"], .game-page header span { display: none; }
    .game-page header button { min-height: 38px; padding: 8px 9px; font-size: 12px; }
    .game-page main {
        width: 100%;
        max-width: 100%;
        padding: 9px;
        overflow-x: hidden;
    }
    .game-page .card {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        padding: 11px;
        border-color: rgba(148, 163, 184, .2);
        border-radius: 14px;
        background: linear-gradient(145deg, rgba(20, 40, 70, .94), rgba(13, 27, 49, .96));
    }
    .game-page .top-card,
    .game-page #lobbyArea,
    .game-page #publicLobbyArea,
    .game-page #resultsArea,
    .game-page #gameplayArea,
    .game-page #gameplayArea > .card {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }
    .game-page .top-card { margin-bottom: 9px; }
    .game-page .layout { gap: 9px; }
    .game-page .top-row { align-items: flex-start; }
    .game-page #homeLobbyControls { width: 100%; }
    .game-page .game-loader { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
    .game-page .toolbar > input, .game-page .toolbar > select { flex: 1 1 100%; width: 100%; }
    .game-page .decision-header { align-items: flex-start; }
    .game-page .timer { font-size: 27px; }
    .game-page .recent-picks-list { height: 132px; max-height: 132px; }
    .game-page .recent-pick { grid-template-columns: 48px minmax(0, 1fr); gap: 4px 8px; }
    .game-page .recent-pick-player, .game-page .recent-pick-slot { grid-column: 2; }
    .game-page .recent-pick-player { white-space: normal; }
    .game-page .table-wrapper { max-height: 62vh; }
    .game-page .modal-backdrop { align-items: flex-end; padding: 0; }
    .game-page .modal { width: 100% !important; max-height: 88dvh; padding: 20px 16px calc(20px + env(safe-area-inset-bottom)); border-radius: 20px 20px 0 0; }
    .game-page .modal-actions { position: sticky; bottom: -20px; padding: 12px 0 4px; background: linear-gradient(transparent, #10213a 22%); }
    .game-page .modal-actions button { flex: 1 1 auto; }
    .team-overview-popover { left: 12px !important; right: 12px; bottom: 12px; top: auto !important; width: auto; max-height: 68dvh; border-radius: 18px; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { transition-duration: .01ms !important; }
}
