/* SportyPants design system — shared across landing/web/admin */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap");

:root {
    color-scheme: light dark;

    /* Brand */
    --brand-50:  #ecfdf5;
    --brand-100: #d1fae5;
    --brand-300: #6ee7b7;
    --brand-400: #34d399;
    --brand-500: #10b981;
    --brand-600: #059669;
    --brand-700: #047857;
    --brand-grad: linear-gradient(135deg, #10b981 0%, #14b8a6 50%, #06b6d4 100%);

    /* Neutrals — light */
    --bg: #f8fafc;
    --bg-elev: #ffffff;
    --bg-soft: #f1f5f9;
    --border: #e2e8f0;
    --border-strong: #cbd5e1;
    --text: #0f172a;
    --text-muted: #475569;
    --text-soft: #64748b;

    /* Status */
    --danger: #dc2626;
    --danger-bg: #fef2f2;
    --warn: #d97706;
    --success: #16a34a;
    --info: #0284c7;

    /* Misc */
    --radius-sm: 0.4rem;
    --radius: 0.75rem;
    --radius-lg: 1rem;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
    --shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 16px 40px rgba(15, 23, 42, 0.12);
    --container: 64rem;
    --container-wide: 76rem;
    --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --font-mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #060b14;
        --bg-elev: #0f172a;
        --bg-soft: #111c2f;
        --border: #1e293b;
        --border-strong: #334155;
        --text: #f1f5f9;
        --text-muted: #cbd5e1;
        --text-soft: #94a3b8;
        --danger-bg: #2a1010;
        --shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
        --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.55);
    }
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
    margin: 0;
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.55;
    color: var(--text);
    background: var(--bg);
    background-image:
        radial-gradient(1200px 600px at 90% -10%, rgba(16, 185, 129, 0.10), transparent 60%),
        radial-gradient(800px 500px at -10% 20%, rgba(6, 182, 212, 0.08), transparent 60%);
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; display: block; }
hr { border: 0; border-top: 1px solid var(--border); margin: 1.25rem 0; }
code, pre, kbd { font-family: var(--font-mono); font-size: 0.85em; }
code { background: var(--bg-soft); padding: 0.1rem 0.35rem; border-radius: 0.3rem; border: 1px solid var(--border); }
pre {
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    overflow: auto;
    box-shadow: var(--shadow-sm);
}

/* Typography */
h1, h2, h3, h4 { margin: 0 0 0.5rem; line-height: 1.2; letter-spacing: -0.02em; font-weight: 700; }
h1 { font-size: clamp(1.75rem, 2.4vw, 2.5rem); }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 0.75rem; }
small, .text-sm { font-size: 0.85rem; }
.muted { color: var(--text-muted); }
.soft { color: var(--text-soft); font-size: 0.9rem; }
.eyebrow {
    display: inline-block;
    color: var(--brand-600);
    font-weight: 600;
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}
@media (prefers-color-scheme: dark) {
    .eyebrow { color: var(--brand-300); }
}

a { color: var(--brand-600); text-decoration: none; }
a:hover { text-decoration: underline; }
@media (prefers-color-scheme: dark) {
    a { color: var(--brand-300); }
}

/* Layout */
.container, .container-wide { width: 100%; margin: 0 auto; padding: 0 1.25rem; }
.container { max-width: var(--container); }
.container-wide { max-width: var(--container-wide); }
.stack > * + * { margin-top: 1rem; }
.stack-tight > * + * { margin-top: 0.5rem; }
.row { display: flex; gap: 1rem; flex-wrap: wrap; align-items: center; }
.row.between { justify-content: space-between; }
.grid { display: grid; gap: 1rem; }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); }

/* Top nav */
.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: saturate(140%) blur(10px);
    -webkit-backdrop-filter: saturate(140%) blur(10px);
    background: color-mix(in oklab, var(--bg) 80%, transparent);
    border-bottom: 1px solid var(--border);
}
.site-header .inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
    gap: 1rem;
}
.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 800;
    color: var(--text);
    font-size: 1.05rem;
    letter-spacing: -0.01em;
}
.brand:hover { text-decoration: none; }
.brand-mark {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: var(--brand-grad);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
    display: inline-grid;
    place-items: center;
    color: #fff;
    font-weight: 800;
    font-size: 14px;
}
.brand .pill { margin-left: 0.25rem; }
.nav { display: flex; align-items: center; gap: 0.25rem; }
.nav a, .nav button {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.7rem;
    border-radius: 0.55rem;
    color: var(--text-muted);
    font-weight: 500;
    background: transparent;
    border: 0;
    cursor: pointer;
    font: inherit;
}
.nav a:hover, .nav button:hover { background: var(--bg-soft); color: var(--text); text-decoration: none; }
.nav .who { color: var(--text-soft); font-size: 0.85rem; padding: 0 0.5rem; border-left: 1px solid var(--border); margin-left: 0.25rem; }
@media (max-width: 640px) { .nav .label-only-md { display: none; } }

/* Footer */
.site-footer {
    margin-top: 4rem;
    border-top: 1px solid var(--border);
    color: var(--text-soft);
    font-size: 0.85rem;
    padding: 1.25rem 0 2rem;
}

/* Cards */
.card {
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
}
.card.hover { transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease; }
.card.hover:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--border-strong); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 0.75rem; }
.card-head h2, .card-head h3 { margin: 0; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.55rem 0.95rem;
    border-radius: 0.55rem;
    background: var(--bg-elev);
    color: var(--text);
    border: 1px solid var(--border-strong);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 120ms ease, border-color 120ms ease, transform 60ms ease;
    text-decoration: none;
}
.btn:hover { background: var(--bg-soft); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: 0.6; cursor: not-allowed; }
.btn-primary {
    background: var(--brand-grad);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.25);
}
.btn-primary:hover { filter: brightness(1.05); background: var(--brand-grad); color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-muted); }
.btn-ghost:hover { color: var(--text); background: var(--bg-soft); }
.btn-danger { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.btn-sm { padding: 0.35rem 0.6rem; font-size: 0.8rem; }
.btn-lg { padding: 0.75rem 1.25rem; font-size: 1rem; }
.btn-block { width: 100%; }

/* Forms */
.field { display: block; margin-bottom: 0.75rem; }
.field > label { display: block; font-weight: 600; font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0.35rem; }
.input, .select, .textarea {
    width: 100%;
    padding: 0.6rem 0.75rem;
    background: var(--bg-elev);
    color: var(--text);
    border: 1px solid var(--border-strong);
    border-radius: 0.55rem;
    font-size: 0.95rem;
    font: inherit;
    line-height: 1.4;
    transition: border-color 120ms ease, box-shadow 120ms ease;
}
.select { appearance: none; padding-right: 2.5rem; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path d='M1 1l5 5 5-5' stroke='%2364748b' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>"); background-repeat: no-repeat; background-position: right 0.75rem center; }
.input:focus, .select:focus, .textarea:focus { outline: 0; border-color: var(--brand-500); box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.20); }
.input[readonly], .select[readonly] { background: var(--bg-soft); color: var(--text-muted); }
.help { color: var(--text-soft); font-size: 0.8rem; margin-top: 0.3rem; }

/* Pills / badges */
.pill {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.15rem 0.55rem;
    background: var(--bg-soft);
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.pill-brand { background: var(--brand-50); color: var(--brand-700); border-color: var(--brand-100); }
.pill-success { background: #dcfce7; color: #166534; border-color: #bbf7d0; }
.pill-info { background: #e0f2fe; color: #075985; border-color: #bae6fd; }
.pill-warn { background: #fef3c7; color: #92400e; border-color: #fde68a; }
.pill-danger { background: #fee2e2; color: #991b1b; border-color: #fecaca; }
@media (prefers-color-scheme: dark) {
    .pill-brand { background: rgba(16, 185, 129, 0.12); color: var(--brand-300); border-color: rgba(16, 185, 129, 0.30); }
    .pill-success { background: rgba(34, 197, 94, 0.12); color: #86efac; border-color: rgba(34, 197, 94, 0.3); }
    .pill-info { background: rgba(2, 132, 199, 0.15); color: #7dd3fc; border-color: rgba(56, 189, 248, 0.3); }
    .pill-warn { background: rgba(245, 158, 11, 0.15); color: #fcd34d; border-color: rgba(245, 158, 11, 0.3); }
    .pill-danger { background: rgba(220, 38, 38, 0.15); color: #fca5a5; border-color: rgba(220, 38, 38, 0.3); }
}

/* Alerts */
.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-soft);
    color: var(--text);
    font-size: 0.9rem;
}
.alert-error { background: var(--danger-bg); color: var(--danger); border-color: rgba(220,38,38,0.25); }
.alert-info { background: #eff6ff; color: #1e40af; border-color: #bfdbfe; }
@media (prefers-color-scheme: dark) {
    .alert-error { color: #fca5a5; }
    .alert-info  { background: rgba(59,130,246,0.10); color: #93c5fd; border-color: rgba(59,130,246,0.25); }
}

/* Tables */
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 0.9rem; }
.table th, .table td { text-align: left; padding: 0.65rem 0.75rem; border-bottom: 1px solid var(--border); }
.table th { color: var(--text-soft); font-weight: 600; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--bg-soft); }

/* Stepper */
.stepper { display: flex; gap: 0.5rem; align-items: center; margin: 0 0 1.25rem; flex-wrap: wrap; }
.step { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.4rem 0.7rem; border-radius: 999px; background: var(--bg-soft); color: var(--text-muted); font-size: 0.8rem; font-weight: 600; border: 1px solid var(--border); }
.step .num { width: 1.4rem; height: 1.4rem; border-radius: 999px; background: var(--bg-elev); color: var(--text-soft); font-size: 0.75rem; display: inline-grid; place-items: center; border: 1px solid var(--border-strong); }
.step.is-current { color: var(--brand-700); background: var(--brand-50); border-color: var(--brand-100); }
.step.is-current .num { background: var(--brand-grad); color: #fff; border-color: transparent; }
.step.is-done { color: var(--text); }
.step.is-done .num { background: var(--brand-500); color: #fff; border-color: transparent; }
@media (prefers-color-scheme: dark) {
    .step.is-current { color: var(--brand-300); background: rgba(16, 185, 129, 0.1); border-color: rgba(16, 185, 129, 0.3); }
}
.step-sep { color: var(--text-soft); }

/* Hero (landing) */
.hero { padding: 4rem 0 3rem; text-align: center; }
.hero h1 {
    font-size: clamp(2.25rem, 4vw, 3.6rem);
    margin-bottom: 1rem;
    text-wrap: balance;
}
.hero .lede { color: var(--text-muted); font-size: 1.15rem; max-width: 38rem; margin: 0 auto 1.5rem; }
.hero .gradient-text {
    background: var(--brand-grad);
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-cta { display: inline-flex; gap: 0.6rem; flex-wrap: wrap; justify-content: center; }

/* Selectable list (create wizard) */
.choice-list { display: grid; gap: 0.5rem; grid-template-columns: 1fr; }
.choice {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    text-decoration: none;
    transition: border-color 120ms ease, transform 120ms ease, background 120ms ease;
}
.choice:hover { border-color: var(--brand-500); background: var(--bg-soft); text-decoration: none; transform: translateY(-1px); }
.choice .arrow { color: var(--text-soft); transition: transform 120ms ease, color 120ms ease; }
.choice:hover .arrow { color: var(--brand-600); transform: translateX(2px); }
.choice .meta { color: var(--text-soft); font-size: 0.85rem; }
@media (prefers-color-scheme: dark) {
    .choice:hover .arrow { color: var(--brand-300); }
}

/* Match card (game dashboard) */
.match {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    background: var(--bg-elev);
    display: grid;
    gap: 0.75rem;
}
.match-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; color: var(--text-soft); font-size: 0.8rem; }
.match-teams { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 0.75rem; }
.match-team { display: flex; align-items: center; gap: 0.5rem; }
.match-team.away { justify-content: flex-end; }
.match-team .crest { width: 28px; height: 28px; border-radius: 8px; background: var(--bg-soft); border: 1px solid var(--border); display: grid; place-items: center; font-weight: 800; color: var(--text-muted); font-size: 12px; }
.match-vs { color: var(--text-soft); font-weight: 700; font-size: 0.8rem; letter-spacing: 0.08em; }
.match-actions { display: flex; gap: 0.5rem; }
.match-actions form { flex: 1; }
.match-actions .btn { width: 100%; }

/* Rank cells */
.rank { display: inline-grid; place-items: center; width: 1.6rem; height: 1.6rem; border-radius: 999px; background: var(--bg-soft); color: var(--text-muted); font-size: 0.75rem; font-weight: 700; border: 1px solid var(--border); }
.rank.gold   { background: #fef3c7; color: #92400e; border-color: #fde68a; }
.rank.silver { background: #e2e8f0; color: #334155; border-color: #cbd5e1; }
.rank.bronze { background: #fed7aa; color: #9a3412; border-color: #fdba74; }

/* Empty state */
.empty {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-soft);
}
.empty .ico {
    width: 44px; height: 44px; border-radius: 12px;
    background: var(--bg-soft); border: 1px solid var(--border);
    display: inline-grid; place-items: center; margin-bottom: 0.5rem;
}

/* Legal pages (privacy, terms) */
.legal { max-width: 46rem; padding-top: 2.5rem; padding-bottom: 3rem; }
.legal h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); }
.legal h2 { margin: 2rem 0 0.6rem; font-size: 1.2rem; }
.legal p, .legal li { color: var(--text-muted); line-height: 1.75; }
.legal .lede { font-size: 1.1rem; margin-bottom: 2rem; }
.legal ul { padding-left: 1.2rem; }
.legal li { margin-bottom: 0.5rem; }
.legal li strong, .legal p strong { color: var(--text); }
.legal code { font-size: 0.9em; }

.footer-links { display: flex; gap: 1rem; align-items: center; }

/* Utilities */
.flex { display: flex; gap: 0.5rem; align-items: center; }
.flex.col { flex-direction: column; align-items: stretch; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.text-center { text-align: center; }
.no-underline { text-decoration: none; }

/* Focus */
:focus-visible { outline: 0; box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.40); border-radius: 0.4rem; }

/* ============================================================
   Brand & sport / league / mode iconography
   ============================================================
   Replaces the gradient SP square with the Sporty Pants splash.
   .brand-mark.image keeps the same footprint but renders the PNG.
   .sport-icon / .league-icon / .mode-icon are reusable rounded
   square thumbnails sized for inline lists, choice rows, and
   marketing hero callouts.
*/
.brand-logo {
    display: inline-block;
    width: 36px;
    height: 36px;
    border-radius: 9px;
    object-fit: contain;
    background: transparent;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.18);
}
.brand-logo.sm { width: 28px; height: 28px; border-radius: 7px; box-shadow: 0 3px 10px rgba(15, 23, 42, 0.16); }
.brand-logo.lg { width: 64px; height: 64px; border-radius: 14px; box-shadow: 0 8px 22px rgba(15, 23, 42, 0.20); }
@media (prefers-color-scheme: dark) {
    .brand-logo { box-shadow: 0 4px 14px rgba(0, 0, 0, 0.55); }
}

.sport-icon, .league-icon, .mode-icon {
    display: inline-block;
    width: 28px;
    height: 28px;
    border-radius: 7px;
    object-fit: contain;
    flex-shrink: 0;
    background: transparent;
}
.sport-icon.sm, .league-icon.sm, .mode-icon.sm { width: 22px; height: 22px; border-radius: 6px; }
.sport-icon.md, .league-icon.md, .mode-icon.md { width: 40px; height: 40px; border-radius: 9px; }
.sport-icon.lg, .league-icon.lg, .mode-icon.lg { width: 64px; height: 64px; border-radius: 12px; }
.sport-icon.xl, .league-icon.xl, .mode-icon.xl { width: 96px; height: 96px; border-radius: 18px; box-shadow: 0 6px 18px rgba(15, 23, 42, 0.18); }

/* Round-card wrappers when you want a soft tinted background behind
   an icon (looks great in choice lists / mode pickers). */
.icon-tile {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    display: inline-grid;
    place-items: center;
    flex-shrink: 0;
}
.icon-tile img { width: 44px; height: 44px; object-fit: contain; }
.icon-tile.lg { width: 84px; height: 84px; border-radius: 18px; }
.icon-tile.lg img { width: 68px; height: 68px; }

/* Choice-row variant for the create-pool wizard sport / mode lists. */
.choice .choice-icon {
    margin-right: 0.65rem;
}

/* Hero illustration (landing page). The splash already has its own
   shadow baked into the artwork, so we don't add another one. */
.hero-illustration {
    width: clamp(180px, 22vw, 280px);
    height: auto;
    display: block;
    margin: 0 auto 1rem;
    filter: drop-shadow(0 18px 40px rgba(15, 23, 42, 0.25));
}
@media (prefers-color-scheme: dark) {
    .hero-illustration { filter: drop-shadow(0 18px 40px rgba(0, 0, 0, 0.6)); }
}

/* Subtle hover on icon list rows (catalog, teams page header). */
.with-icon { display: inline-flex; align-items: center; gap: 0.55rem; }
.with-icon img { vertical-align: middle; }

/* Pricing (landing — packs from docs/design/tokens.md) */
.pricing-intro { margin-bottom: 1.5rem; }
.pricing-lede {
    max-width: 36rem;
    margin: 0.5rem auto 0;
    font-size: 1.05rem;
}
.pricing-grid { align-items: stretch; }
.pricing-card {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
    padding: 1.5rem 1.25rem;
}
.pricing-card .pill { align-self: center; }
.pricing-card-featured {
    border-color: var(--brand-300);
    box-shadow: var(--shadow), 0 0 0 1px color-mix(in oklab, var(--brand-500) 25%, transparent);
}
.pricing-amount {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    margin: 0.75rem 0 0.25rem;
}
.pricing-tokens {
    font-size: clamp(2.4rem, 4vw, 3rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1;
    background: var(--brand-grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.pricing-unit {
    color: var(--text-soft);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.pricing-note {
    margin-top: auto;
    padding-top: 0.75rem;
}
.pricing-buy {
    margin-top: auto;
    align-self: stretch;
    text-align: center;
}
.pricing-was {
    text-decoration: line-through;
    opacity: 0.75;
    color: var(--text-soft);
    font-size: 0.95rem;
    font-weight: 600;
}
.pricing-footnote { margin-top: 1rem; }
@media (prefers-color-scheme: dark) {
    .pricing-card-featured {
        border-color: rgba(16, 185, 129, 0.45);
        box-shadow: var(--shadow), 0 0 0 1px rgba(16, 185, 129, 0.2);
    }
}