:root {

    /* Backgrounds */
    --bg-main: #0f172a;
    --bg-nav: #111827;
    --bg-card: #1e293b;
    --bg-subtle: #0b1220;

    /* Borders */
    --border: #334155;

    /* Text */
    --text-primary: #ffffff;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;

    /* Accent */
    --accent: #38bdf8;

    /* Misc */
    --divider: #475569;

    /* Comparison bars */
    --compare-bar-a: color-mix(in srgb, var(--accent) 55%, var(--bg-subtle));
    --compare-bar-b: color-mix(in srgb, var(--text-muted) 35%, var(--bg-subtle));
}

html.light-theme,
.light-theme {

    /* Backgrounds */
    --bg-main: #f8fafc;
    --bg-nav: #ffffff;
    --bg-card: #ffffff;
    --bg-subtle: #f1f5f9;

    /* Borders */
    --border: #e2e8f0;

    /* Text */
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;

    /* Accent */
    --accent: #0284c7;

    /* Misc */
    --divider: #94a3b8;
}

html {
    background: var(--bg-main);
    color: var(--text-primary);
}

body {
    margin: 0;
    background: var(--bg-main);
    color: var(--text-primary);
    font-family: Inter, Arial, sans-serif;
}

.top-nav {
    height: 70px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 32px;
    background: var(--bg-nav);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
}


.nav-left {
    flex: 1;
}

.site-logo {
    text-decoration: none;
    color: var(--text-primary);
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}
.nav-center {
    flex: 2;
    display: flex;
    justify-content: center;
    gap: 60px;
}

.nav-item a {
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
    transition: 0.2s ease;
}

.nav-item a:hover {
    color: var(--text-primary);
}

.insights-link a {
    color: var(--accent);
    font-weight: 600;
}
.nav-right {
    flex: 1;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.theme-toggle,
.search-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: transparent;
    cursor: pointer;
    color: white;
    transition: 0.2s ease;
}

.theme-toggle:hover,
.search-btn:hover {
    background: rgba(255,255,255,0.08);
}

.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 18px);
    left: 50%;
    transform: translateX(-50%);
    min-width: 220px;
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px;
    opacity: 0;
    visibility: hidden;
    transition: 0.2s ease;
    box-shadow:
        0 10px 25px rgba(0,0,0,.15);
}
.dropdown-menu a {
    padding: 10px 14px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-secondary);
    transition: 0.2s ease;
}
.dropdown-menu a:hover {
    background: var(--bg-subtle);
    color: var(--text-primary);
}
.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
}
.dropdown-arrow {
    font-size: 0.75rem;
    margin-left: 4px;
    opacity: .7;
}

.league-status {
    height: 42px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 14px;
    background: var(--bg-subtle);
    border-bottom: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.85rem;
}
.status-divider {
    color: var(--divider);
}
.status-item {
    font-weight: 500;
    white-space: nowrap;
}
.page-container {
    width: 100%; 
    max-width: 1800px;
    margin: 0 auto;
    padding: 24px clamp(16px, 3vw, 32px);
}

.page-header { margin-bottom: 20px; }
.page-header h1 { margin: 0 0 4px; font-size: 1.6rem; font-weight: 700; }
.page-header p { margin: 0; color: var(--text-muted); }

.compare-select-form {
    display: grid;
    grid-template-columns: 1fr auto 1fr auto;
    align-items: end;
    gap: 16px;
    margin-bottom: 28px;
    padding: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
}

.compare-select-form.compare-form-error {
    border-color: #ef4444;
}

.compare-side-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
    margin-bottom: 8px;
}

.compare-filter-stack {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.compare-select-group { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.compare-select-group label { font-size: 0.68rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; }
.filter-select { background: var(--bg-subtle); color: var(--text-primary); border: 1px solid var(--border); border-radius: 6px; padding: 10px 12px; width: 100%; }
.filter-select:disabled { opacity: 0.55; cursor: not-allowed; }
.filter-btn { padding: 10px 20px; background: var(--accent); color: #fff; border: none; border-radius: 6px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.compare-vs { font-size: 1.2rem; font-weight: 800; color: var(--text-muted); padding-bottom: 10px; text-align: center; }

.compare-empty {
    text-align: center;
    padding: 56px 24px;
    background: var(--bg-card);
    border: 1px dashed var(--border);
    border-radius: 10px;
}

.compare-empty-icon { font-size: 2.4rem; margin-bottom: 12px; opacity: 0.6; }
.compare-empty h2 { margin: 0 0 8px; font-size: 1.2rem; }
.compare-empty p { margin: 0; color: var(--text-muted); }

.compare-headers {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

.compare-player-header {
    text-align: center;
    padding: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
}

.compare-ovr { font-size: 2.5rem; font-weight: 800; color: var(--accent); line-height: 1; }
.compare-name { display: block; font-size: 1.1rem; font-weight: 700; color: var(--text-primary); text-decoration: none; margin: 8px 0 4px; }
.compare-name:hover { color: var(--accent); }
.compare-meta { font-size: 0.82rem; color: var(--text-muted); }

.compare-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
}

.compare-section h2 { margin: 0 0 16px; font-size: 1rem; border-bottom: 1px solid var(--divider); padding-bottom: 8px; }

.mirror-row {
    display: grid;
    grid-template-columns: 52px 1fr 52px;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--divider);
}

.mirror-row:last-child { border-bottom: none; }

.mirror-val {
    font-size: 1rem;
    font-weight: 700;
    text-align: center;
    color: var(--text-secondary);
}

.mirror-val.winner { color: var(--accent); }

.mirror-axis { min-width: 0; }

.mirror-label {
    text-align: center;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.mirror-bars {
    display: grid;
    grid-template-columns: 1fr 2px 1fr;
    align-items: center;
    height: 10px;
}

.mirror-center {
    width: 2px;
    height: 100%;
    background: var(--divider);
    border-radius: 1px;
}

.mirror-bar-left-wrap,
.mirror-bar-right-wrap {
    height: 8px;
    display: flex;
    align-items: center;
}

.mirror-bar-left-wrap { justify-content: flex-end; }

.mirror-bar-right-wrap { justify-content: flex-start; }

.mirror-bar-left,
.mirror-bar-right {
    height: 7px;
    min-width: 0;
    border-radius: 3px;
    transition: width 0.25s ease;
}

.mirror-bar-left {
    background: var(--compare-bar-a);
    border-radius: 3px 0 0 3px;
}

.mirror-bar-right {
    background: var(--compare-bar-b);
    border-radius: 0 3px 3px 0;
}

.mirror-row:has(.mirror-val.left.winner) .mirror-bar-left {
    background: color-mix(in srgb, var(--accent) 80%, transparent);
}

.mirror-row:has(.mirror-val.right.winner) .mirror-bar-right {
    background: color-mix(in srgb, var(--text-secondary) 55%, var(--accent) 25%);
}

.stat-compare-names {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 12px;
    padding-bottom: 12px;
    margin-bottom: 4px;
    border-bottom: 1px solid var(--divider);
    font-size: 0.88rem;
    font-weight: 700;
}

.stat-compare-names .compare-name-left {
    text-align: left;
    color: var(--text-primary);
    text-decoration: none;
}

.stat-compare-names .compare-name-right {
    text-align: right;
    color: var(--text-primary);
    text-decoration: none;
}

.stat-compare-names .compare-name-left:hover,
.stat-compare-names .compare-name-right:hover {
    color: var(--accent);
}

.stat-compare-vs {
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    align-self: center;
}

.stat-compare-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--divider);
    align-items: center;
}

.stat-compare-row:last-child {
    border-bottom: none;
}

.stat-compare-val {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.stat-compare-val.left {
    text-align: left;
}

.stat-compare-val.right {
    text-align: right;
}

.stat-compare-val.winner {
    color: var(--accent);
}

.stat-compare-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    text-align: center;
    min-width: 48px;
}

@media (max-width: 900px) {
    .compare-select-form {
        grid-template-columns: 1fr;
    }

    .compare-vs {
        padding: 0;
    }
}

@media (max-width: 700px) {
    .compare-headers { grid-template-columns: 1fr; }
}

