/* ============================================================
   PitchPicks — Design System
   Dark sportsbook theme. Mobile-first.
   ============================================================ */

/* ---------- Tokens ---------- */
:root {
    --bg:           #0a0e17;
    --bg-elevated:  #131827;
    --bg-card:      #131827;
    --bg-hover:     #1a2236;
    --border:       #1f2937;
    --border-light: #2a3447;

    --text:         #e8eaed;
    --text-dim:     #9aa0a6;
    --text-muted:   #6b7280;

    --accent:       #00d97e;   /* green / win */
    --accent-dark:  #00b96b;
    --danger:       #e63946;   /* red / loss */
    --warning:      #f59e0b;
    --gold:         #ffd700;   /* VIP */
    --purple:       #b76eff;   /* VVIP */
    --info:         #3b82f6;

    --radius-sm: 6px;
    --radius:    10px;
    --radius-lg: 14px;

    --shadow-sm: 0 1px 2px rgba(0,0,0,.3);
    --shadow:    0 4px 12px rgba(0,0,0,.4);
    --shadow-lg: 0 10px 30px rgba(0,0,0,.5);

    --container: 1200px;
    --header-h:  64px;

    --t-fast: 120ms ease;
    --t:      200ms ease;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 15px;
    line-height: 1.55;
    color: var(--text);
    background: var(--bg);
    background-image:
        radial-gradient(circle at 20% 0%, rgba(0,217,126,.04) 0%, transparent 50%),
        radial-gradient(circle at 80% 100%, rgba(183,110,255,.03) 0%, transparent 50%);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; transition: color var(--t-fast); }
a:hover { color: var(--accent-dark); }
button { font-family: inherit; cursor: pointer; }
h1, h2, h3, h4, h5 { margin: 0 0 .6em; font-weight: 700; line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
h2 { font-size: clamp(1.4rem, 3vw, 1.875rem); }
h3 { font-size: 1.25rem; }
h4 { font-size: 1rem; color: var(--text); }
p  { margin: 0 0 1em; }

/* ---------- Layout ---------- */
.container {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 16px;
}
.site-main { padding: 24px 0 64px; min-height: calc(100vh - var(--header-h) - 200px); }

/* ---------- Header ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(10,14,23,.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}
.header-inner {
    display: flex;
    align-items: center;
    height: var(--header-h);
    gap: 16px;
}
.brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 800;
    font-size: 1.15rem;
    color: var(--text);
    letter-spacing: -.02em;
}
.brand:hover { color: var(--text); }
.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 32px; height: 32px;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    border-radius: 8px;
    font-size: 1.1rem;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}
.main-nav > a {
    color: var(--text-dim);
    font-weight: 500;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    transition: color var(--t-fast), background var(--t-fast);
}
.main-nav > a:hover { color: var(--text); background: var(--bg-hover); }
.main-nav > a.active { color: var(--accent); }
.main-nav .nav-admin { color: var(--gold); }
.main-nav .nav-admin:hover { color: var(--gold); }

.nav-user, .nav-auth {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 8px;
    padding-left: 12px;
    border-left: 1px solid var(--border);
}
.nav-greeting {
    font-size: .875rem;
    color: var(--text-dim);
    padding: 0 4px;
}

.nav-toggle {
    display: none;
    width: 40px; height: 40px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-left: auto;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
}
.nav-toggle span {
    display: block;
    width: 18px; height: 2px;
    background: var(--text);
    border-radius: 2px;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    font-weight: 600;
    font-size: .9rem;
    line-height: 1;
    transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast), transform var(--t-fast);
    cursor: pointer;
    white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-sm  { padding: 7px 12px; font-size: .85rem; }
.btn-lg  { padding: 14px 24px; font-size: 1rem; }
.btn-block { width: 100%; }

.btn-primary {
    background: var(--accent);
    color: #00170c;
    border-color: var(--accent);
}
.btn-primary:hover { background: var(--accent-dark); color: #00170c; border-color: var(--accent-dark); }

.btn-secondary {
    background: var(--bg-hover);
    color: var(--text);
    border-color: var(--border-light);
}
.btn-secondary:hover { background: var(--border-light); color: var(--text); }

.btn-ghost {
    background: transparent;
    color: var(--text);
    border-color: var(--border-light);
}
.btn-ghost:hover { background: var(--bg-hover); color: var(--text); }

.btn-danger {
    background: var(--danger);
    color: #fff;
    border-color: var(--danger);
}
.btn-danger:hover { background: #c92e3a; border-color: #c92e3a; color: #fff; }

.btn-gold {
    background: linear-gradient(135deg, var(--gold), #e6c200);
    color: #2a1f00;
    border: none;
}
.btn-gold:hover { color: #2a1f00; filter: brightness(1.05); }

.btn-vvip {
    background: linear-gradient(135deg, var(--purple), #8e4de8);
    color: #fff;
    border: none;
}
.btn-vvip:hover { color: #fff; filter: brightness(1.08); }

/* ---------- Forms ---------- */
.form-group { margin-bottom: 16px; }
.form-label {
    display: block;
    margin-bottom: 6px;
    font-size: .875rem;
    font-weight: 500;
    color: var(--text-dim);
}
.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: .95rem;
    transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(0,217,126,.15);
}
.form-textarea { resize: vertical; min-height: 100px; }
.form-help { font-size: .8rem; color: var(--text-muted); margin-top: 4px; }
.form-error { color: var(--danger); font-size: .85rem; margin-top: 4px; }

.checkbox-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: .9rem;
    color: var(--text-dim);
    line-height: 1.45;
}
.checkbox-row input[type="checkbox"] {
    margin-top: 3px;
    flex: 0 0 auto;
    accent-color: var(--accent);
    width: 16px; height: 16px;
    cursor: pointer;
}
.checkbox-row a { color: var(--accent); }

.auth-card {
    max-width: 420px;
    margin: 40px auto;
    padding: 32px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}
.auth-card h1 { text-align: center; margin-bottom: 8px; }
.auth-card .auth-sub { text-align: center; color: var(--text-dim); margin-bottom: 24px; }
.auth-card .auth-foot { text-align: center; margin-top: 16px; color: var(--text-dim); font-size: .9rem; }

/* ---------- Cards ---------- */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 18px;
}
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.card-title { margin: 0; font-size: 1.125rem; }

/* ---------- Section header ---------- */
.section {
    margin: 32px 0;
}
.section-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}
.section-head h2 { margin: 0; }
.section-head .more { font-size: .9rem; color: var(--text-dim); }
.section-head .more:hover { color: var(--accent); }

/* ---------- Hero ---------- */
.hero {
    position: relative;
    padding: 48px 28px;
    margin: 0 0 32px;
    border-radius: var(--radius-lg);
    background:
        radial-gradient(ellipse at top right, rgba(0,217,126,.15), transparent 60%),
        radial-gradient(ellipse at bottom left, rgba(183,110,255,.10), transparent 60%),
        linear-gradient(135deg, #0e1422 0%, #161d33 100%);
    border: 1px solid var(--border);
    overflow: hidden;
}
.hero h1 { margin-bottom: 12px; }
.hero p  { color: var(--text-dim); font-size: 1.05rem; margin-bottom: 20px; max-width: 580px; }
.hero-cta { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- Tip card ---------- */
.tip-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    transition: border-color var(--t), transform var(--t);
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.tip-card:hover { border-color: var(--border-light); transform: translateY(-2px); }

.tip-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: .8rem;
    color: var(--text-dim);
}
.tip-league { display: inline-flex; align-items: center; gap: 6px; }
.tip-time { font-variant-numeric: tabular-nums; }

.tip-teams {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 8px;
    align-items: center;
    text-align: center;
}
.tip-team { font-weight: 600; font-size: 1rem; }
.tip-vs { color: var(--text-muted); font-size: .8rem; }

.tip-prediction {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 12px;
    background: rgba(0,217,126,.06);
    border: 1px solid rgba(0,217,126,.2);
    border-radius: var(--radius-sm);
    font-size: .9rem;
}
.tip-prediction strong { color: var(--accent); }
.tip-odds {
    background: var(--bg);
    border: 1px solid var(--border-light);
    border-radius: 4px;
    padding: 2px 8px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.tip-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: .85rem;
    color: var(--text-dim);
}

/* ---------- Locked tip ---------- */
.tip-locked {
    position: relative;
    overflow: hidden;
}
.tip-locked .tip-prediction {
    filter: blur(6px);
    user-select: none;
    pointer-events: none;
}
.tip-lock-overlay {
    margin-top: 8px;
    padding: 12px;
    text-align: center;
    background: rgba(255,215,0,.06);
    border: 1px dashed rgba(255,215,0,.3);
    border-radius: var(--radius-sm);
    font-size: .85rem;
    color: var(--text);
}
.tip-lock-overlay .lock-icon { font-size: 1.2rem; margin-right: 6px; }

/* ---------- Badges ---------- */
.badge, .tier-badge, .status-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    line-height: 1.4;
}
.tier-free   { background: rgba(154,160,166,.15); color: var(--text-dim); border: 1px solid rgba(154,160,166,.25); }
.tier-expert { background: rgba(59,130,246,.15);  color: #60a5fa;        border: 1px solid rgba(59,130,246,.3); }
.tier-vip    { background: rgba(255,215,0,.12);   color: var(--gold);    border: 1px solid rgba(255,215,0,.35); }
.tier-vvip   { background: rgba(183,110,255,.15); color: var(--purple);  border: 1px solid rgba(183,110,255,.35); }

.status-pending { background: rgba(245,158,11,.12); color: var(--warning); border: 1px solid rgba(245,158,11,.3); }
.status-won     { background: rgba(0,217,126,.12); color: var(--accent);  border: 1px solid rgba(0,217,126,.3); }
.status-lost    { background: rgba(230,57,70,.12); color: var(--danger);  border: 1px solid rgba(230,57,70,.3); }
.status-void    { background: rgba(154,160,166,.12); color: var(--text-dim); border: 1px solid rgba(154,160,166,.25); }

/* ---------- Grid ---------- */
.grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px,1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px,1fr)); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px,1fr)); gap: 16px; }

/* ---------- Stat tile ---------- */
.stat {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
}
.stat-label { font-size: .8rem; color: var(--text-dim); margin-bottom: 4px; text-transform: uppercase; letter-spacing: .03em; }
.stat-value { font-size: 1.5rem; font-weight: 700; }

/* ---------- Results strip ---------- */
.results-strip {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 8px;
    scrollbar-width: thin;
}
.result-pill {
    flex: 0 0 auto;
    padding: 8px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: .85rem;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.result-pill.won  { border-color: rgba(0,217,126,.3); }
.result-pill.lost { border-color: rgba(230,57,70,.3); }

/* ---------- Flash messages ---------- */
.flash {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    border: 1px solid transparent;
    font-size: .9rem;
}
.flash-success { background: rgba(0,217,126,.1);  border-color: rgba(0,217,126,.35); color: var(--accent); }
.flash-error   { background: rgba(230,57,70,.1);  border-color: rgba(230,57,70,.35); color: var(--danger); }
.flash-info    { background: rgba(59,130,246,.1); border-color: rgba(59,130,246,.35); color: #93c5fd; }

/* ---------- Pagination ---------- */
.pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin: 32px 0 0;
    flex-wrap: wrap;
}
.pagination a, .pagination span {
    display: inline-grid;
    place-items: center;
    min-width: 36px; height: 36px;
    padding: 0 12px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    color: var(--text-dim);
    font-size: .9rem;
}
.pagination a:hover { background: var(--bg-hover); color: var(--text); }
.pagination .current { background: var(--accent); color: #00170c; border-color: var(--accent); font-weight: 700; }
.pagination .disabled { opacity: .4; pointer-events: none; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: .9rem;
}
.table th, .table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--border); }
.table th { background: var(--bg); color: var(--text-dim); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; }
.table tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: var(--bg-hover); }

/* ---------- Filter bar ---------- */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: end;
    padding: 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 20px;
}
.filter-bar .form-group { margin: 0; flex: 1 1 140px; }

/* ---------- Article (legal pages) ---------- */
.article {
    max-width: 760px;
    margin: 24px auto;
    padding: 32px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}
.article h1 { margin-bottom: 8px; }
.article .article-meta { color: var(--text-dim); font-size: .85rem; margin-bottom: 24px; }
.article h2 { margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--border); }
.article h2:first-of-type { margin-top: 24px; padding-top: 0; border-top: none; }
.article h3 { margin-top: 24px; color: var(--accent); }
.article ul, .article ol { padding-left: 22px; margin: 0 0 1em; }
.article li { margin-bottom: 6px; }
.article strong { color: var(--text); }

.callout {
    padding: 16px;
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--warning);
    background: rgba(245,158,11,.08);
    margin: 20px 0;
}
.callout.danger { border-left-color: var(--danger); background: rgba(230,57,70,.08); }
.callout.info   { border-left-color: var(--info);   background: rgba(59,130,246,.08); }

/* ---------- Footer ---------- */
.site-footer {
    margin-top: 64px;
    padding: 40px 0 24px;
    background: #070a12;
    border-top: 1px solid var(--border);
    color: var(--text-dim);
    font-size: .9rem;
}
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 32px;
    margin-bottom: 28px;
}
.footer-col h4 { color: var(--text); font-size: .9rem; margin-bottom: 12px; text-transform: uppercase; letter-spacing: .04em; }
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { margin-bottom: 8px; }
.footer-col a { color: var(--text-dim); }
.footer-col a:hover { color: var(--accent); }
.footer-tagline { color: var(--text-dim); margin: 8px 0 12px; max-width: 320px; }
.brand-footer { font-size: 1.05rem; color: var(--text); }

.age-badge {
    display: inline-grid;
    place-items: center;
    width: 38px; height: 38px;
    border: 2px solid var(--gold);
    color: var(--gold);
    border-radius: 50%;
    font-weight: 700;
    font-size: .85rem;
}

.footer-disclaimer {
    padding-top: 20px;
    border-top: 1px solid var(--border);
    font-size: .82rem;
    color: var(--text-muted);
}
.footer-disclaimer p { margin: 0 0 6px; }
.footer-disclaimer strong { color: var(--text-dim); }
.footer-copy { margin-top: 12px !important; }

/* ---------- Age gate ---------- */
.age-gate[hidden] { display: none !important; }
.age-gate {
    position: fixed; inset: 0;
    background: rgba(5,8,15,.95);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: grid;
    place-items: center;
    padding: 16px;
}
.age-gate-card {
    max-width: 420px;
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
    text-align: center;
    box-shadow: var(--shadow-lg);
}
.age-gate-badge {
    display: inline-grid;
    place-items: center;
    width: 60px; height: 60px;
    background: var(--gold);
    color: #2a1f00;
    border-radius: 50%;
    font-weight: 800;
    font-size: 1.3rem;
    margin-bottom: 12px;
}
.age-gate-card h2 { margin-bottom: 8px; }
.age-gate-card p { color: var(--text-dim); font-size: .92rem; }
.age-gate-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
    margin: 20px 0 12px;
}
.age-gate-fineprint { font-size: .8rem; color: var(--text-muted); margin-top: 12px; }

/* ---------- Utilities ---------- */
.text-center { text-align: center; }
.text-dim    { color: var(--text-dim); }
.text-muted  { color: var(--text-muted); }
.text-accent { color: var(--accent); }
.text-danger { color: var(--danger); }
.text-gold   { color: var(--gold); }
.text-purple { color: var(--purple); }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mt-4 { margin-top: 32px; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; } .mb-4 { margin-bottom: 32px; }
.flex      { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.flex-gap  { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.hidden    { display: none !important; }

/* ---------- Empty state ---------- */
.empty-state {
    text-align: center;
    padding: 48px 16px;
    color: var(--text-dim);
}
.empty-state .empty-icon { font-size: 2.5rem; margin-bottom: 12px; opacity: .5; }

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
    .nav-toggle { display: flex; }
    .main-nav {
        position: absolute;
        top: var(--header-h);
        left: 0; right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 12px 16px 20px;
        background: var(--bg-elevated);
        border-bottom: 1px solid var(--border);
        margin: 0;
        display: none;
    }
    .main-nav.open { display: flex; }
    .main-nav > a { padding: 12px; border-radius: var(--radius-sm); }
    .nav-user, .nav-auth {
        flex-direction: column;
        align-items: stretch;
        margin: 12px 0 0;
        padding: 12px 0 0;
        border-left: none;
        border-top: 1px solid var(--border);
    }
    .nav-greeting { padding: 8px 12px; }
    .nav-user .btn, .nav-auth .btn { width: 100%; }
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 24px; }
    .hero { padding: 32px 20px; }
    .article { padding: 20px; }
    .auth-card { margin: 16px auto; padding: 24px; }
}

@media (max-width: 480px) {
    .footer-grid { grid-template-columns: 1fr; }
    .section-head { flex-direction: column; align-items: stretch; }
    .filter-bar { flex-direction: column; align-items: stretch; }
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: #3a4660; }
