/* ==========================================================================
   WK Poule — Production CSS
   Football / World Cup — VodafoneZiggo corporate sports style
   ==========================================================================
   The WK theme layer is appended after the base styles.
   Variables are overridden here to establish the dark football theme.
   ========================================================================== */

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ==========================================================================
   CSS CUSTOM PROPERTIES  — WK Football Dark Theme
   ========================================================================== */
:root {
    /* Brand colours */
    --primary:          #e53935;
    --primary-dark:     #b71c1c;
    --primary-light:    #ef5350;
    --primary-hover:    #b71c1c;
    --secondary:        #1a1a2e;
    --secondary-light:  #16213e;
    --accent:           #ffd700;
    --accent-dark:      #f9a825;

    /* Backgrounds */
    --bg:               #0f0f1a;
    --bg-light:         #1a1a2e;
    --bg-card:          #1e1e3a;
    --bg-nav:           #0a0a18;
    --card-bg:          #1e1e3a;
    --card-bg-hover:    #25254a;
    --card-border:      rgba(255, 255, 255, 0.08);
    --border:           rgba(255, 255, 255, 0.08);
    --overlay:          rgba(0, 0, 0, 0.6);

    /* Typography */
    --text:             #ffffff;
    --text-muted:       rgba(255, 255, 255, 0.6);
    --text-subtle:      rgba(255, 255, 255, 0.35);
    --text-dark:        #1a1a1a;

    /* Semantic */
    --success:          #4caf50;
    --success-bg:       rgba(76, 175, 80, 0.15);
    --warning:          #ff9800;
    --warning-bg:       rgba(255, 152, 0, 0.15);
    --danger:           #f44336;
    --error:            #f44336;
    --error-bg:         rgba(244, 67, 54, 0.15);
    --info:             #2196f3;
    --info-bg:          rgba(33, 150, 243, 0.15);
    --gold:             #ffd700;
    --silver:           #c0c0c0;
    --bronze:           #cd7f32;

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, var(--primary), var(--primary-dark));
    --gradient-accent:  linear-gradient(135deg, var(--accent), var(--accent-dark));
    --gradient-hero:    linear-gradient(135deg, #1a1a2e 0%, #0f0f1a 100%);

    /* Shadows */
    --shadow:           0 4px 20px rgba(0, 0, 0, 0.3);
    --shadow-sm:        0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-lg:        0 8px 40px rgba(0, 0, 0, 0.4);
    --shadow-primary:   0 4px 20px rgba(229, 57, 53, 0.3);
    --shadow-accent:    0 4px 20px rgba(255, 215, 0, 0.3);

    /* Shape */
    --radius:           12px;
    --radius-sm:        8px;
    --radius-lg:        20px;
    --radius-pill:      9999px;

    /* Motion */
    --transition:       all 0.3s ease;
    --transition-fast:  all 0.15s ease;

    /* Spacing */
    --space-xs:   4px;
    --space-sm:   8px;
    --space-md:   16px;
    --space-lg:   24px;
    --space-xl:   32px;
    --space-2xl:  48px;
    --space-3xl:  64px;

    /* Layout */
    --nav-height:       64px;
    --container-max:    1200px;
    --sidebar-width:    260px;
}

/* Light mode — applied when body does NOT have .dark-mode */
body:not(.dark-mode) {
    --bg:           #f4f6fb;
    --bg-light:     #ffffff;
    --bg-card:      #ffffff;
    --bg-nav:       #1a2744;
    --card-bg:      #ffffff;
    --card-bg-hover:#f0f2ff;
    --card-border:  rgba(0, 0, 0, 0.1);
    --border:       #e5e7eb;
    --text:         #1a1a2e;
    --text-muted:   rgba(26, 26, 46, 0.6);
    --text-subtle:  rgba(26, 26, 46, 0.35);
    --shadow:        0 4px 20px rgba(0,0,0,0.1);
    --shadow-sm:     0 2px 8px rgba(0,0,0,0.06);
    --shadow-lg:     0 8px 40px rgba(0,0,0,0.15);
}

html { font-size: 16px; }
body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

/* ── Navbar ── */
.navbar {
    background: var(--bg-nav);
    color: #fff;
    padding: .75rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,.3);
}
.navbar-brand a {
    color: #fff;
    font-size: 1.25rem;
    font-weight: 700;
    text-decoration: none;
}
.navbar-menu { display: flex; gap: .5rem; flex: 1; }
.nav-link {
    color: rgba(255,255,255,.8);
    padding: .4rem .75rem;
    border-radius: 6px;
    text-decoration: none;
    font-size: .9rem;
    transition: background var(--transition), color var(--transition);
}
.nav-link:hover, .nav-link.active {
    background: rgba(255,255,255,.15);
    color: #fff;
    text-decoration: none;
}
.navbar-user { display: flex; align-items: center; gap: .75rem; }
.avatar-sm {
    width: 32px; height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255,255,255,.3);
}
.avatar-placeholder {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: .85rem;
}

/* ── Layout ── */
.main-content { flex: 1; padding: 1.5rem 0; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 1.25rem; }

.page-header { margin-bottom: 1.5rem; }
.page-header h1 { font-size: 1.75rem; font-weight: 700; }
.page-header p { color: var(--text-muted); margin-top: .25rem; }

/* ── Cards ── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow);
}
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: .75rem;
    border-bottom: 1px solid var(--border);
}
.card-header h2, .card-header h3 { font-size: 1.1rem; font-weight: 600; }
.card-footer {
    margin-top: 1rem;
    padding-top: .75rem;
    border-top: 1px solid var(--border);
    text-align: right;
}

/* ── Dashboard Grid ── */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}
.dashboard-grid.wide { grid-template-columns: 1fr; }
.dashboard-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.dashboard-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }

/* ── Stat Cards ── */
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: .5rem;
}
.stat-card .stat-label {
    font-size: .8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--text-muted);
}
.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
}
.stat-card .stat-sub { font-size: .85rem; color: var(--text-muted); }

/* ── Welcome Card ── */
.welcome-card {
    background: linear-gradient(135deg, #1a2744 0%, #2563eb 100%);
    color: #fff;
    border-radius: var(--radius);
    padding: 1.75rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
}
.welcome-card .avatar-lg {
    width: 72px; height: 72px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255,255,255,.4);
    flex-shrink: 0;
}
.welcome-card .avatar-placeholder-lg {
    width: 72px; height: 72px;
    border-radius: 50%;
    background: rgba(255,255,255,.2);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.75rem; font-weight: 700;
    flex-shrink: 0;
}
.welcome-card h2 { font-size: 1.4rem; margin-bottom: .25rem; }
.welcome-card .rank-badge {
    display: inline-block;
    background: rgba(255,255,255,.2);
    border-radius: 20px;
    padding: .2rem .75rem;
    font-size: .85rem;
    margin-top: .25rem;
}

/* ── Match Cards ── */
.match-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    box-shadow: var(--shadow);
    margin-bottom: .75rem;
    transition: border-color var(--transition);
}
.match-card:hover { border-color: var(--primary); }
.match-card .match-teams {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
}
.match-card .team-name { display: flex; align-items: center; gap: .4rem; }
.match-card .match-teams .team-name:last-child { justify-content: flex-end; text-align: right; }
.match-card .score {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
    min-width: 60px;
    text-align: center;
}
.match-card .match-meta {
    font-size: .8rem;
    color: var(--text-muted);
    margin-top: .5rem;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}
.match-card .phase-badge {
    font-size: .75rem;
    font-weight: 600;
    background: var(--primary);
    color: #fff;
    border-radius: 12px;
    padding: .15rem .6rem;
    display: inline-block;
}

/* ── Prediction Items ── */
.prediction-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .75rem 0;
    border-bottom: 1px solid var(--border);
}
.prediction-item:last-child { border-bottom: none; }
.prediction-item .points-badge {
    font-size: .9rem;
    font-weight: 700;
    padding: .2rem .6rem;
    border-radius: 6px;
}
.points-badge.pts-good    { background: #dcfce7; color: #166534; }
.points-badge.pts-great   { background: #bbf7d0; color: #14532d; }
.points-badge.pts-none    { background: var(--border); color: var(--text-muted); }

/* ── Prediction Form ── */
.prediction-form { margin-top: .75rem; }
.score-inputs {
    display: flex;
    align-items: center;
    gap: .5rem;
}
.score-inputs input[type=number] {
    width: 56px;
    text-align: center;
    font-size: 1.1rem;
    font-weight: 700;
    padding: .4rem;
    border: 2px solid var(--border);
    border-radius: 6px;
    background: var(--bg);
    color: var(--text);
    transition: border-color var(--transition);
}
.score-inputs input[type=number]:focus {
    outline: none;
    border-color: var(--primary);
}
.score-inputs .dash { font-size: 1.25rem; font-weight: 700; color: var(--text-muted); }
.btn-save-prediction {
    margin-left: .75rem;
    padding: .4rem .9rem;
    font-size: .85rem;
}

/* ── Prediction Section Groups ── */
.phase-section { margin-bottom: 2rem; }
.phase-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    padding-bottom: .5rem;
    border-bottom: 2px solid var(--primary);
    display: flex;
    align-items: center;
    gap: .5rem;
}
.group-section { margin-bottom: 1.5rem; }
.group-title {
    font-size: .95rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-bottom: .75rem;
}

/* ── Status indicators ── */
.status-open    { color: var(--success); }
.status-closed  { color: var(--danger); }
.status-pending { color: var(--warning); }

.icon-check   { color: var(--success); }
.icon-warn    { color: var(--warning); }
.icon-lock    { color: var(--text-muted); }

/* ── Rankings Table ── */
.ranking-table { width: 100%; border-collapse: collapse; }
.ranking-table th,
.ranking-table td {
    padding: .7rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: .9rem;
}
.ranking-table th {
    font-weight: 600;
    color: var(--text-muted);
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    background: var(--bg);
}
.ranking-table tbody tr:hover { background: var(--bg); }
.ranking-table .current-user { background: rgba(37,99,235,.08) !important; font-weight: 600; }

.rank-1 td:first-child { color: var(--gold); font-weight: 700; }
.rank-2 td:first-child { color: var(--silver); font-weight: 700; }
.rank-3 td:first-child { color: var(--bronze); font-weight: 700; }
.rank-1 .rank-num::before { content: '🥇 '; }
.rank-2 .rank-num::before { content: '🥈 '; }
.rank-3 .rank-num::before { content: '🥉 '; }

.rank-arrow { font-size: .8rem; }
.rank-up   { color: var(--success); }
.rank-down { color: var(--danger); }
.rank-same { color: var(--text-muted); }

/* ── Filter Tabs ── */
.filter-tabs {
    display: flex;
    gap: .5rem;
    margin-bottom: 1.25rem;
    border-bottom: 2px solid var(--border);
    padding-bottom: 0;
}
.tab-btn {
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    padding: .5rem 1rem;
    font-size: .9rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition);
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }

/* ── Buttons ── */
.btn {
    display: inline-flex; align-items: center; gap: .4rem;
    padding: .5rem 1.1rem;
    border-radius: 7px;
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: background var(--transition), opacity var(--transition);
    text-decoration: none;
}
.btn:hover { opacity: .9; text-decoration: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary  { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: var(--border); color: var(--text); }
.btn-success  { background: var(--success); color: #fff; }
.btn-danger   { background: var(--danger); color: #fff; }
.btn-sm { padding: .3rem .7rem; font-size: .8rem; }
.btn-lg { padding: .7rem 1.5rem; font-size: 1rem; }

/* ── Forms ── */
.form-group { margin-bottom: 1rem; }
.form-group label {
    display: block;
    font-size: .875rem;
    font-weight: 600;
    margin-bottom: .35rem;
    color: var(--text);
}
.form-control {
    width: 100%;
    padding: .55rem .9rem;
    border: 1.5px solid var(--border);
    border-radius: 7px;
    font-size: .95rem;
    color: var(--text);
    background: var(--bg);
    transition: border-color var(--transition);
}
.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}
.form-text { font-size: .8rem; color: var(--text-muted); margin-top: .25rem; }

/* ── Alerts ── */
.alert {
    padding: .85rem 1.1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: .9rem;
    display: flex;
    align-items: flex-start;
    gap: .6rem;
}
.alert-success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.alert-danger  { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.alert-warning { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.alert-info    { background: #e0f2fe; color: #075985; border: 1px solid #bae6fd; }
.dark-mode .alert-success { background: #14532d; color: #bbf7d0; border-color: #166534; }
.dark-mode .alert-danger  { background: #7f1d1d; color: #fecaca; border-color: #991b1b; }
.dark-mode .alert-warning { background: #78350f; color: #fde68a; border-color: #92400e; }
.dark-mode .alert-info    { background: #0c4a6e; color: #bae6fd; border-color: #075985; }

/* ── Badge ── */
.badge {
    display: inline-block;
    padding: .2rem .55rem;
    border-radius: 12px;
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.badge-primary { background: var(--primary); color: #fff; }
.badge-success { background: var(--success); color: #fff; }
.badge-warning { background: var(--warning); color: #fff; }
.badge-danger  { background: var(--danger);  color: #fff; }
.badge-muted   { background: var(--border);  color: var(--text-muted); }

/* ── Table generic ── */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td {
    padding: .65rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
.table th { font-weight: 600; background: var(--bg); color: var(--text-muted); font-size: .8rem; text-transform: uppercase; }

/* ── Pagination ── */
.pagination { display: flex; gap: .4rem; margin-top: 1.25rem; justify-content: center; }
.page-link {
    padding: .4rem .75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: .875rem;
    color: var(--text);
    cursor: pointer;
    background: var(--bg-card);
    text-decoration: none;
    transition: all var(--transition);
}
.page-link:hover, .page-link.active { background: var(--primary); color: #fff; border-color: var(--primary); text-decoration: none; }
.page-link.disabled { opacity: .4; cursor: default; pointer-events: none; }

/* ── Progress Bar ── */
.progress-bar-wrap { background: var(--border); border-radius: 6px; height: 8px; overflow: hidden; }
.progress-bar { height: 100%; border-radius: 6px; background: var(--primary); transition: width .4s ease; }

/* ── Top 5 List ── */
.top5-list { list-style: none; }
.top5-list li {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .55rem 0;
    border-bottom: 1px solid var(--border);
    font-size: .9rem;
}
.top5-list li:last-child { border-bottom: none; }
.top5-list .pos { font-weight: 700; min-width: 24px; }
.top5-list .pts { margin-left: auto; font-weight: 700; color: var(--primary); }

/* ── Countdown ── */
.countdown { font-size: .78rem; font-weight: 600; }
.countdown.urgent { color: var(--danger); }
.countdown.soon   { color: var(--warning); }
.countdown.ok     { color: var(--success); }

/* ── Avatar upload ── */
.avatar-upload-wrap { display: flex; align-items: center; gap: 1.25rem; margin-bottom: 1rem; }
.avatar-preview {
    width: 80px; height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--border);
}
.avatar-preview-placeholder {
    width: 80px; height: 80px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 2rem; font-weight: 700;
    flex-shrink: 0;
}

/* ── Toggle Switch ── */
.toggle-wrap { display: flex; align-items: center; gap: .75rem; }
.toggle { position: relative; width: 44px; height: 24px; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
    position: absolute; inset: 0;
    background: var(--border);
    border-radius: 24px;
    cursor: pointer;
    transition: background var(--transition);
}
.toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px; height: 18px;
    left: 3px; top: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform var(--transition);
}
.toggle input:checked + .toggle-slider { background: var(--primary); }
.toggle input:checked + .toggle-slider::before { transform: translateX(20px); }

/* ── Match status ── */
.match-finished .match-teams { opacity: .75; }
.match-live .score { color: var(--danger); animation: pulse 1.5s infinite; }
@keyframes pulse { 0%,100%{opacity:1}50%{opacity:.5} }

/* ── Tournament Predictions ── */
.tournament-pred-card { border-left: 4px solid var(--primary); }
.tournament-pred-card .field-row {
    display: flex; align-items: center;
    gap: 1rem; margin-bottom: .75rem;
    flex-wrap: wrap;
}
.tournament-pred-card .field-row label { min-width: 160px; font-weight: 600; font-size: .9rem; }

/* ── Saving indicator ── */
.save-status {
    font-size: .8rem;
    margin-left: .5rem;
}
.save-status.saving { color: var(--warning); }
.save-status.saved  { color: var(--success); }
.save-status.error  { color: var(--danger); }

/* ── Site Footer ── */
.site-footer {
    background: var(--bg-nav);
    color: rgba(255,255,255,.5);
    text-align: center;
    padding: 1rem;
    font-size: .85rem;
}

/* ── Auth Pages ── */
.auth-wrapper {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 2.5rem 1rem;
    min-height: calc(100vh - 130px);
}
.auth-card {
    width: 100%;
    max-width: 440px;
}
.auth-logo {
    text-align: center;
    margin-bottom: 1.5rem;
}
.auth-logo__icon  { font-size: 2.5rem; line-height: 1.2; }
.auth-logo__title { font-size: 1.5rem; font-weight: 700; margin-top: .25rem; }
.auth-logo__sub   { font-size: .85rem; color: var(--text-muted); }

.auth-card__heading { font-size: 1.2rem; font-weight: 700; margin-bottom: 1rem; }
.auth-card__info {
    font-size: .875rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    line-height: 1.55;
}
.auth-card__footer {
    text-align: center;
    font-size: .875rem;
    color: var(--text-muted);
    margin-top: 1.25rem;
}
.auth-card__divider {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin: 1.25rem 0 1rem;
    color: var(--text-muted);
    font-size: .82rem;
}
.auth-card__divider::before,
.auth-card__divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* ── Form helpers ── */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
@media (max-width: 480px) { .form-row { grid-template-columns: 1fr; } }

.form-label       { display: block; font-size: .875rem; font-weight: 600; margin-bottom: .35rem; }
.form-label__link { font-weight: 400; font-size: .8rem; color: var(--primary); float: right; }
.form-hint        { font-size: .78rem; color: var(--text-muted); margin-top: .25rem; display: block; }

/* Code input */
.form-control--code {
    font-size: 1.6rem;
    letter-spacing: .6rem;
    text-align: center;
    font-weight: 700;
    padding: .65rem 1rem;
}

/* Input group (input + icon button) */
.input-group {
    display: flex;
    border: 1.5px solid var(--border);
    border-radius: 7px;
    overflow: hidden;
    transition: border-color var(--transition);
}
.input-group:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}
.input-group .form-control {
    border: none;
    border-radius: 0;
    flex: 1;
    box-shadow: none !important;
}
.input-group__toggle {
    background: var(--bg-card);
    border: none;
    border-left: 1.5px solid var(--border);
    padding: 0 .85rem;
    cursor: pointer;
    font-size: 1rem;
    color: var(--text-muted);
    transition: background var(--transition);
    flex: 0 0 auto;
}
.input-group__toggle:hover { background: var(--bg); }

/* Full-width button */
.btn-block { display: flex; width: 100%; justify-content: center; margin-top: .25rem; }
.btn-outline {
    background: transparent;
    border: 1.5px solid var(--border);
    color: var(--text);
}
.btn-outline:hover { background: var(--border); }

/* Alias: alert-error → alert-danger */
.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}
.dark-mode .alert-error { background: #7f1d1d; color: #fecaca; border-color: #991b1b; }

/* Alias: .alert__close / .alert__icon (used by layout.php) */
.alert__icon  { font-weight: 700; flex: 0 0 auto; }
.alert__close {
    background: none; border: none; cursor: pointer;
    font-size: 1.1rem; margin-left: auto; color: inherit; opacity: .6;
}
.alert__close:hover { opacity: 1; }

/* ── Navbar BEM aliases (layout.php uses __-variants) ── */
.navbar__brand  { flex: 0 0 auto; }
.navbar__logo   { display: flex; align-items: center; gap: .5rem; color: #fff; text-decoration: none; font-size: 1.15rem; font-weight: 700; }
.navbar__icon   { font-size: 1.4rem; }
.navbar__name     { font-weight: 700; }
.navbar__subtitle { font-size: .7rem; font-weight: 400; opacity: .65; margin-left: .15rem; }
.navbar__menu     { display: flex; align-items: center; gap: .25rem; flex: 1; flex-wrap: wrap; }
.navbar__link   { padding: .4rem .75rem; border-radius: 6px; color: rgba(255,255,255,.8); font-size: .9rem; transition: background var(--transition); text-decoration: none; }
.navbar__link:hover,
.navbar__link--active { background: rgba(255,255,255,.15); color: #fff; text-decoration: none; }
.navbar__link--admin  { color: #f5a623; }
.navbar__user   { display: flex; align-items: center; gap: .75rem; margin-left: auto; }
.navbar__username { font-size: .9rem; font-weight: 500; color: rgba(255,255,255,.9); }

.navbar__hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: .4rem;
    margin-left: auto;
}
.navbar__hamburger span { display: block; width: 22px; height: 2px; background: #fff; border-radius: 2px; }

/* ── Main / Footer BEM ── */
.main   { flex: 1; padding: 1.5rem 0; }
.footer { background: var(--bg-nav); color: rgba(255,255,255,.5); text-align: center; padding: 1rem; font-size: .85rem; }
.footer__copy { margin: 0; }

/* Avatar (BEM) */
.avatar        { border-radius: 50%; object-fit: cover; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; }
.avatar--sm    { width: 32px; height: 32px; font-size: .85rem; }
.avatar--lg    { width: 64px; height: 64px; font-size: 1.5rem; }
.avatar--initial { background: var(--primary); color: #fff; }

/* ── Responsive (legacy — handled by the overhaul block below) ── */
@media (max-width: 480px) { .form-row { grid-template-columns: 1fr; } }

/* ==========================================================================
   WK THEME EXTENSION
   Full football-atmosphere overrides and new components
   ========================================================================== */

/* --------------------------------------------------------------------------
   BASE OVERRIDES — fonts, body, links
   -------------------------------------------------------------------------- */
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto,
                 "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color 0.3s ease, color 0.3s ease;
}

a { color: var(--primary-light); text-decoration: none; transition: var(--transition-fast); }
a:hover { color: var(--primary); text-decoration: none; }

img, svg { display: block; max-width: 100%; }

/* --------------------------------------------------------------------------
   LAYOUT
   -------------------------------------------------------------------------- */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin-inline: auto;
    padding-inline: var(--space-lg);
}

.grid   { display: grid; gap: var(--space-lg); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-auto { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }

.flex         { display: flex; }
.flex-center  { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-col     { display: flex; flex-direction: column; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }

.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-muted  { color: var(--text-muted); }
.text-sm     { font-size: 0.85rem; }
.text-lg     { font-size: 1.15rem; }
.fw-bold     { font-weight: 700; }
.w-full      { width: 100%; }
.hidden      { display: none !important; }

.sr-only {
    position: absolute; width: 1px; height: 1px;
    padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* --------------------------------------------------------------------------
   NAVIGATION — WK dark theme
   -------------------------------------------------------------------------- */
.navbar {
    height: var(--nav-height);
    background: rgba(10, 10, 24, 0.96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--card-border);
    box-shadow: 0 2px 24px rgba(0, 0, 0, 0.5);
    color: #fff;
    padding: 0 var(--space-lg);
    display: flex;
    align-items: center;
    gap: var(--space-md);
    position: sticky;
    top: 0;
    z-index: 1000;
    flex-shrink: 0;
}

.navbar-brand a {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    text-decoration: none;
}

.navbar-brand a:hover { color: var(--accent); text-decoration: none; }

.navbar-menu {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    flex: 1;
    padding-left: var(--space-lg);
}

.nav-link {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    padding: var(--space-xs) var(--space-md);
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
    position: relative;
    text-decoration: none;
}

.nav-link:hover { color: var(--text); background: rgba(255,255,255,0.07); text-decoration: none; }

.nav-link.active {
    color: var(--text);
    font-weight: 600;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: var(--space-md);
    right: var(--space-md);
    height: 2px;
    background: var(--primary);
    border-radius: var(--radius-pill);
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-left: auto;
}

.avatar-sm {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255,255,255,0.2);
}

.avatar-placeholder {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    color: #fff;
    flex-shrink: 0;
}

/* Hamburger */
.nav-hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: var(--space-sm);
    cursor: pointer;
    margin-left: auto;
    background: none;
    border: none;
}

.nav-hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: var(--transition);
    transform-origin: center;
}

.nav-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Dropdown */
.dropdown { position: relative; }

.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 180px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: var(--space-sm);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: var(--transition);
    z-index: 999;
}

.dropdown:hover .dropdown-menu,
.dropdown.open .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    transition: var(--transition-fast);
    text-decoration: none;
}

.dropdown-item:hover { background: rgba(255,255,255,0.07); color: var(--text); text-decoration: none; }

/* --------------------------------------------------------------------------
   MAIN & CONTENT AREA
   -------------------------------------------------------------------------- */
.main-content {
    flex: 1;
    padding-top: var(--space-xl);
    padding-bottom: var(--space-3xl);
}

/* --------------------------------------------------------------------------
   PAGE HEADER / HERO — football atmosphere
   -------------------------------------------------------------------------- */
.page-header {
    background: var(--header-bg-img, var(--gradient-hero));
    background-size: cover;
    background-position: center;
    position: relative;
    overflow: hidden;
    padding: var(--space-2xl) var(--space-xl);
    margin-bottom: var(--space-xl);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
/* Overlay + radial glows — de linear-gradient zorgt voor leesbaarheid boven een foto */
.page-header::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    background-image:
        linear-gradient(to bottom, rgba(10,10,24,.35) 0%, rgba(10,10,24,.15) 100%),
        radial-gradient(circle at 20% 50%, rgba(229,57,53,0.14) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255,215,0,0.08) 0%, transparent 40%),
        radial-gradient(circle at 60% 80%, rgba(26,26,46,0.4) 0%, transparent 50%);
    pointer-events: none;
}

/* Dot grid pattern — mimics football pitch markings */
.page-header::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    background-image: radial-gradient(circle, rgba(255,255,255,0.05) 1px, transparent 1px);
    background-size: 28px 28px;
    pointer-events: none;
}

.page-header .container,
.page-header h1,
.page-header p {
    position: relative;
    z-index: 1;
}

.page-header h1 {
    font-size: clamp(1.8rem, 4vw, 3rem);
    font-weight: 800;
    letter-spacing: -1px;
    line-height: 1.1;
    margin-bottom: var(--space-sm);
}

.page-header h1 span { color: var(--accent); }
.page-header p { color: var(--text-muted); font-size: 1.1rem; max-width: 520px; }

.header-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    background: rgba(229,57,53,0.15);
    border: 1px solid rgba(229,57,53,0.4);
    color: var(--primary-light);
    padding: var(--space-xs) var(--space-md);
    border-radius: var(--radius-pill);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: var(--space-md);
}

/* --------------------------------------------------------------------------
   CARDS — dark glass style
   -------------------------------------------------------------------------- */
.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(255,255,255,0.14);
}

.card-header {
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--card-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
    margin-bottom: 0;
}

.card-header h2,
.card-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.card-body { padding: var(--space-lg); }

.card-footer {
    padding: var(--space-md) var(--space-lg);
    border-top: 1px solid var(--card-border);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space-md);
    margin-top: 0;
}

/* --------------------------------------------------------------------------
   STAT CARDS
   -------------------------------------------------------------------------- */
.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-left: 4px solid var(--primary);
    border-radius: var(--radius);
    padding: var(--space-lg);
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    flex-direction: row;
    transition: var(--transition);
    overflow: hidden;
    position: relative;
    box-shadow: var(--shadow);
}

.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }

.stat-card::before {
    content: '';
    position: absolute;
    top: -30px;
    right: -30px;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, rgba(229,57,53,0.1) 0%, transparent 70%);
    pointer-events: none;
}

.stat-card.accent   { border-left-color: var(--accent); }
.stat-card.success  { border-left-color: var(--success); }
.stat-card.info     { border-left-color: var(--info); }
.stat-card.warning  { border-left-color: var(--warning); }

.stat-card.accent::before  { background: radial-gradient(circle, rgba(255,215,0,0.1) 0%, transparent 70%); }
.stat-card.success::before { background: radial-gradient(circle, rgba(76,175,80,0.1) 0%, transparent 70%); }
.stat-card.info::before    { background: radial-gradient(circle, rgba(33,150,243,0.1) 0%, transparent 70%); }

.stat-icon {
    font-size: 1.8rem;
    line-height: 1;
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(229,57,53,0.1);
    border-radius: var(--radius-sm);
}

.stat-card.accent  .stat-icon { background: rgba(255,215,0,0.1); }
.stat-card.success .stat-icon { background: rgba(76,175,80,0.1); }
.stat-card.info    .stat-icon { background: rgba(33,150,243,0.1); }

.stat-info { flex: 1; min-width: 0; flex-direction: column; display: flex; gap: 4px; }

/* stat-text wraps label+sub on desktop (column) and on mobile (left side) */
.stat-card .stat-text {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 1;
    min-width: 0;
}

/* Desktop: label top, value below, sub below value */
.stat-card {
    flex-direction: column;
    align-items: flex-start;
}
.stat-card .stat-text { order: 1; }
.stat-card .stat-value { order: 2; margin-top: 0.4rem; }

.stat-card .stat-value {
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -1px;
    color: var(--text);
}

.stat-card .stat-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 0;
}

/* --------------------------------------------------------------------------
   MATCH CARDS
   -------------------------------------------------------------------------- */
.match-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: var(--space-md) var(--space-lg);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    margin-bottom: var(--space-sm);
    box-shadow: var(--shadow-sm);
}

.match-card:hover {
    border-color: rgba(229,57,53,0.35);
    box-shadow: var(--shadow-primary);
    transform: translateY(-2px);
}

.match-card .match-teams {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
}

/* Home team: left-aligned */
.match-card .team-name { display: flex; align-items: center; gap: 0.4rem; }

/* Away team: right-aligned */
.match-card .match-teams .team-name:last-child {
    justify-content: flex-end;
    text-align: right;
}

.match-card .score {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text);
    min-width: 60px;
    text-align: center;
}

.match-card .match-meta {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.match-card .phase-badge {
    font-size: 0.72rem;
    font-weight: 700;
    background: var(--primary);
    color: #fff;
    border-radius: var(--radius-pill);
    padding: 2px 8px;
}

/* Status badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-badge.live {
    background: rgba(229,57,53,0.2);
    color: var(--primary-light);
    border: 1px solid rgba(229,57,53,0.4);
}

.status-badge.live::before { background: var(--primary); animation: wkPulse 1.5s infinite; }

.status-badge.finished {
    background: rgba(255,255,255,0.07);
    color: var(--text-muted);
    border: 1px solid var(--card-border);
}

.status-badge.finished::before { background: var(--text-subtle); }

.status-badge.upcoming {
    background: rgba(76,175,80,0.15);
    color: var(--success);
    border: 1px solid rgba(76,175,80,0.3);
}

.status-badge.upcoming::before { background: var(--success); }

/* Match state helpers */
.match-live   .match-card .score { color: var(--primary); animation: wkPulse 1.5s infinite; }
.match-finished .match-teams { opacity: 0.8; }

/* Points badges */
.points-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    font-size: 0.78rem;
    font-weight: 700;
}

.points-badge.exact,
.points-badge.pts-great {
    background: rgba(255,215,0,0.15);
    color: var(--accent);
    border: 1px solid rgba(255,215,0,0.3);
}

.points-badge.correct,
.points-badge.pts-good {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid rgba(76,175,80,0.3);
}

.points-badge.wrong,
.points-badge.pts-none {
    background: rgba(255,255,255,0.06);
    color: var(--text-muted);
    border: 1px solid var(--card-border);
}

/* --------------------------------------------------------------------------
   BUTTONS — WK theme
   -------------------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.9rem;
    line-height: 1;
    border: 2px solid transparent;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
    -webkit-user-select: none;
    user-select: none;
}

.btn:disabled, .btn.disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }
.btn:hover { text-decoration: none; }

.btn-primary {
    background: var(--gradient-primary);
    color: #fff;
    border-color: transparent;
    box-shadow: var(--shadow-primary);
}

.btn-primary:hover {
    opacity: 1;
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(229,57,53,0.45);
    color: #fff;
}

.btn-primary:active { transform: translateY(0); }

.btn-secondary {
    background: rgba(255,255,255,0.08);
    color: var(--text);
    border-color: var(--card-border);
}

.btn-secondary:hover {
    opacity: 1;
    background: rgba(255,255,255,0.14);
    border-color: rgba(255,255,255,0.2);
    color: var(--text);
    transform: translateY(-1px);
}

.btn-success  { background: var(--success); color: #fff; border-color: transparent; }
.btn-success:hover  { opacity: 1; background: #43a047; transform: translateY(-1px); color: #fff; }
.btn-danger   { background: var(--danger); color: #fff; border-color: transparent; }
.btn-danger:hover   { opacity: 1; background: #e53935; transform: translateY(-1px); color: #fff; }
.btn-warning  { background: var(--warning); color: var(--text-dark); border-color: transparent; }
.btn-warning:hover  { opacity: 1; background: #fb8c00; transform: translateY(-1px); color: var(--text-dark); }

.btn-accent {
    background: var(--gradient-accent);
    color: var(--text-dark);
    border-color: transparent;
    box-shadow: var(--shadow-accent);
}

.btn-accent:hover {
    opacity: 1;
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(255,215,0,0.4);
    color: var(--text-dark);
}

.btn-outline {
    background: transparent;
    color: var(--primary-light);
    border-color: var(--primary);
}

.btn-outline:hover {
    opacity: 1;
    background: rgba(229,57,53,0.1);
    transform: translateY(-1px);
    color: var(--primary-light);
}

.btn-sm  { padding: 6px 14px; font-size: 0.8rem; }
.btn-lg  { padding: 14px 28px; font-size: 1rem; border-radius: var(--radius); }
.btn-block { display: flex; width: 100%; justify-content: center; }

.btn-icon       { width: 36px; height: 36px; padding: 0; border-radius: var(--radius-sm); }
.btn-icon.btn-sm { width: 28px; height: 28px; }

/* --------------------------------------------------------------------------
   FORMS
   -------------------------------------------------------------------------- */
.form-group { margin-bottom: var(--space-md); }

.form-group label,
.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: var(--space-sm);
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    background: rgba(255,255,255,0.05);
    border: 1.5px solid var(--card-border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 0.95rem;
    transition: var(--transition-fast);
    appearance: none;
    -webkit-appearance: none;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(229,57,53,0.05);
    box-shadow: 0 0 0 3px rgba(229,57,53,0.15);
}

.form-control::placeholder { color: var(--text-subtle); }
.form-control:disabled { opacity: 0.5; cursor: not-allowed; }
.form-control.is-valid   { border-color: var(--success); box-shadow: 0 0 0 3px rgba(76,175,80,0.15); }
.form-control.is-invalid { border-color: var(--error);   box-shadow: 0 0 0 3px rgba(244,67,54,0.15); }

.form-text,
.form-hint { font-size: 0.8rem; color: var(--text-muted); margin-top: var(--space-xs); display: block; }

.form-error { font-size: 0.8rem; color: var(--error); margin-top: var(--space-xs); display: flex; align-items: center; gap: 4px; }

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
}

textarea.form-control { resize: vertical; min-height: 100px; }

select.form-control {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='rgba(255,255,255,0.5)' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

/* Score inputs */
.score-inputs { display: flex; align-items: center; gap: 0.5rem; }
.score-inputs .dash { font-size: 1.25rem; font-weight: 700; color: var(--text-muted); }

.score-inputs input[type="number"],
.score-input {
    width: 64px;
    text-align: center;
    font-size: 1.4rem;
    font-weight: 800;
    padding: var(--space-sm);
    background: rgba(255,255,255,0.05);
    border: 2px solid var(--card-border);
    border-radius: var(--radius-sm);
    color: var(--text);
    transition: var(--transition-fast);
    -moz-appearance: textfield;
    appearance: textfield;
}

.score-inputs input[type="number"]:focus,
.score-input:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(229,57,53,0.15);
    background: rgba(229,57,53,0.05);
}

.score-inputs input[type="number"]::-webkit-inner-spin-button,
.score-inputs input[type="number"]::-webkit-outer-spin-button,
.score-input::-webkit-inner-spin-button,
.score-input::-webkit-outer-spin-button { -webkit-appearance: none; }

.score-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    border: 1px solid var(--card-border);
    color: var(--text);
    font-size: 1.2rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-fast);
    flex-shrink: 0;
    padding: 0;
    line-height: 1;
}

.score-btn:hover { background: var(--primary); border-color: var(--primary); transform: scale(1.1); }

/* Toggle switch */
.toggle-wrap { display: flex; align-items: center; gap: 0.75rem; }
.toggle { position: relative; width: 44px; height: 24px; display: inline-block; }
.toggle input { opacity: 0; width: 0; height: 0; }

.toggle-slider {
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.15);
    border-radius: 24px;
    cursor: pointer;
    transition: background var(--transition);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px; height: 18px;
    left: 3px; top: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform var(--transition);
}

.toggle input:checked + .toggle-slider { background: var(--primary); }
.toggle input:checked + .toggle-slider::before { transform: translateX(20px); }

/* Input group */
.input-group {
    display: flex;
    border: 1.5px solid var(--card-border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: border-color var(--transition-fast);
}

.input-group:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(229,57,53,0.15);
}

.input-group .form-control { border: none; border-radius: 0; flex: 1; box-shadow: none !important; }

.input-group__toggle {
    background: var(--card-bg);
    border: none;
    border-left: 1.5px solid var(--card-border);
    padding: 0 0.85rem;
    cursor: pointer;
    font-size: 1rem;
    color: var(--text-muted);
    transition: background var(--transition-fast);
    flex: 0 0 auto;
}

.input-group__toggle:hover { background: rgba(255,255,255,0.05); }

/* --------------------------------------------------------------------------
   PREDICTION FORM
   -------------------------------------------------------------------------- */
.prediction-form { margin-top: 0; }

.prediction-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--card-border);
    gap: var(--space-md);
    flex-wrap: wrap;
}

.prediction-item:last-child { border-bottom: none; }
.btn-save-prediction { margin-left: 0.75rem; padding: 0.4rem 0.9rem; font-size: 0.85rem; }

.phase-section { margin-bottom: 2rem; }

.phase-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.group-section { margin-bottom: 1.5rem; }

.group-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.75rem;
}

.result-preview {
    text-align: center;
    margin-top: var(--space-lg);
    padding: var(--space-md);
    background: rgba(255,255,255,0.04);
    border-radius: var(--radius-sm);
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-muted);
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.save-status,
.save-feedback {
    font-size: 0.8rem;
    font-weight: 600;
    margin-left: 0.5rem;
}

.save-status.saving, .save-feedback.saving { color: var(--warning); }
.save-status.saved,  .save-feedback.saved  { color: var(--success); }
.save-status.error,  .save-feedback.error  { color: var(--error); }

/* Tournament predictions */
.tournament-pred-card { border-left: 4px solid var(--primary); }
.tournament-pred-card .field-row { display: flex; align-items: center; gap: 1rem; margin-bottom: 0.75rem; flex-wrap: wrap; }
.tournament-pred-card .field-row label { min-width: 160px; font-weight: 600; font-size: 0.9rem; }

/* --------------------------------------------------------------------------
   TABLES
   -------------------------------------------------------------------------- */
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }

.table th {
    padding: var(--space-md) var(--space-lg);
    text-align: left;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-muted);
    background: rgba(255,255,255,0.03);
    border-bottom: 1px solid var(--card-border);
    white-space: nowrap;
}

.table th.sortable { cursor: pointer; -webkit-user-select: none; user-select: none; }
.table th.sortable:hover    { color: var(--text); background: rgba(255,255,255,0.06); }
.table th.sortable::after   { content: ' ⇅'; opacity: 0.4; font-size: 0.7rem; }
.table th.sort-asc::after   { content: ' ▲'; opacity: 1; color: var(--accent); }
.table th.sort-desc::after  { content: ' ▼'; opacity: 1; color: var(--accent); }

.table td {
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--card-border);
    vertical-align: middle;
}

.table tbody tr { transition: var(--transition-fast); }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: rgba(255,255,255,0.04); }

/* Rankings table */
.ranking-table { width: 100%; border-collapse: collapse; }
.ranking-table th, .ranking-table td { padding: 0.7rem 1rem; text-align: left; border-bottom: 1px solid var(--card-border); font-size: 0.9rem; }
.ranking-table th { font-weight: 700; color: var(--text-muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; background: rgba(255,255,255,0.03); }
.ranking-table tbody tr:hover { background: rgba(255,255,255,0.04); }
.ranking-table .current-user { background: rgba(229,57,53,0.08) !important; font-weight: 600; }

.rank-1 td { background: rgba(255,215,0,0.06) !important; }
.rank-2 td { background: rgba(192,192,192,0.04) !important; }
.rank-3 td { background: rgba(205,127,50,0.04) !important; }

.rank-1 td:first-child, .rank-1 .rank-num { color: var(--gold); font-weight: 700; }
.rank-2 td:first-child, .rank-2 .rank-num { color: var(--silver); font-weight: 700; }
.rank-3 td:first-child, .rank-3 .rank-num { color: var(--bronze); font-weight: 700; }

.rank-1 .rank-num::before { content: '🥇 '; }
.rank-2 .rank-num::before { content: '🥈 '; }
.rank-3 .rank-num::before { content: '🥉 '; }

.rank-arrow, .rank-change { font-size: 0.78rem; font-weight: 700; }
.rank-up, .rank-change.up     { color: var(--success); }
.rank-down, .rank-change.down { color: var(--error); }
.rank-same, .rank-change.same { color: var(--text-muted); }

/* Pagination */
.pagination { display: flex; gap: 0.4rem; margin-top: 1.25rem; justify-content: center; }
.page-link { padding: 0.4rem 0.75rem; border: 1px solid var(--card-border); border-radius: var(--radius-sm); font-size: 0.875rem; color: var(--text); cursor: pointer; background: var(--card-bg); text-decoration: none; transition: all var(--transition-fast); }
.page-link:hover, .page-link.active { background: var(--primary); color: #fff; border-color: var(--primary); text-decoration: none; }
.page-link.disabled { opacity: 0.4; cursor: default; pointer-events: none; }

/* --------------------------------------------------------------------------
   ALERTS  — dark-friendly
   -------------------------------------------------------------------------- */
.alert {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    padding: 0.85rem 1.1rem;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    margin-bottom: var(--space-md);
    font-size: 0.9rem;
    animation: wkSlideIn 0.3s ease;
    position: relative;
}

.alert-close, .alert__close {
    background: none;
    border: none;
    color: inherit;
    opacity: 0.6;
    cursor: pointer;
    padding: 2px;
    line-height: 1;
    font-size: 1.1rem;
    transition: var(--transition-fast);
    flex-shrink: 0;
    margin-left: auto;
}

.alert-close:hover, .alert__close:hover { opacity: 1; }

/* Alerts work in both dark (default) and light mode */
.alert-success { background: var(--success-bg); border-color: rgba(76,175,80,0.4); color: #81c784; }
.alert-error   { background: var(--error-bg);   border-color: rgba(244,67,54,0.4); color: #ef9a9a; }
.alert-danger  { background: var(--error-bg);   border-color: rgba(244,67,54,0.4); color: #ef9a9a; }
.alert-warning { background: var(--warning-bg); border-color: rgba(255,152,0,0.4); color: #ffcc80; }
.alert-info    { background: var(--info-bg);    border-color: rgba(33,150,243,0.4); color: #90caf9; }

/* Light mode alert overrides */
body:not(.dark-mode) .alert-success { background: #dcfce7; color: #166534; border-color: #bbf7d0; }
body:not(.dark-mode) .alert-error,
body:not(.dark-mode) .alert-danger  { background: #fee2e2; color: #991b1b; border-color: #fecaca; }
body:not(.dark-mode) .alert-warning { background: #fef3c7; color: #92400e; border-color: #fde68a; }
body:not(.dark-mode) .alert-info    { background: #e0f2fe; color: #075985; border-color: #bae6fd; }

/* --------------------------------------------------------------------------
   BADGES
   -------------------------------------------------------------------------- */
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.2rem 0.55rem;
    border-radius: var(--radius-pill);
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.4;
    white-space: nowrap;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.badge-primary { background: rgba(229,57,53,0.2);   color: var(--primary-light); }
.badge-success { background: var(--success-bg);      color: var(--success); }
.badge-warning { background: var(--warning-bg);      color: var(--warning); }
.badge-danger,
.badge-error   { background: var(--error-bg);        color: var(--error); }
.badge-info    { background: var(--info-bg);         color: var(--info); }
.badge-muted   { background: rgba(255,255,255,0.08); color: var(--text-muted); }

.badge-gold   { background: rgba(255,215,0,0.18);  color: var(--accent);  border: 1px solid rgba(255,215,0,0.35); }
.badge-silver { background: rgba(192,192,192,0.12); color: var(--silver); border: 1px solid rgba(192,192,192,0.3); }
.badge-bronze { background: rgba(205,127,50,0.12);  color: var(--bronze); border: 1px solid rgba(205,127,50,0.3); }

/* --------------------------------------------------------------------------
   PROGRESS BARS
   -------------------------------------------------------------------------- */
.progress, .progress-bar-wrap {
    height: 8px;
    background: rgba(255,255,255,0.08);
    border-radius: var(--radius-pill);
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    border-radius: var(--radius-pill);
    background: var(--gradient-primary);
    transition: width 0.6s ease;
    min-width: 4px;
}

.progress-bar.accent  { background: var(--gradient-accent); }
.progress-bar.success { background: var(--success); }
.progress-bar.warning { background: var(--warning); }
.progress-bar.info    { background: var(--info); }
.progress-lg { height: 12px; }
.progress-sm { height: 4px; }

/* --------------------------------------------------------------------------
   TABS
   -------------------------------------------------------------------------- */
.tabs, .filter-tabs {
    border-bottom: 1px solid var(--card-border);
    margin-bottom: var(--space-xl);
}

.tab-nav, .filter-tabs {
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.tab-nav::-webkit-scrollbar, .filter-tabs::-webkit-scrollbar { display: none; }

.tab-nav button, .tab-btn {
    padding: var(--space-md) var(--space-lg);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
    white-space: nowrap;
    margin-bottom: -1px;
}

.tab-nav button:hover, .tab-btn:hover { color: var(--text); }

.tab-nav button.active, .tab-btn.active {
    color: var(--text);
    border-bottom-color: var(--primary);
}

.tab-pane { display: none; animation: wkFadeIn 0.25s ease; }
.tab-pane.active { display: block; }

/* --------------------------------------------------------------------------
   MODAL
   -------------------------------------------------------------------------- */
.modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal.open { opacity: 1; visibility: visible; }

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    z-index: 1;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 540px;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(20px) scale(0.97);
    transition: var(--transition);
}

.modal.open .modal-content { transform: translateY(0) scale(1); }

.modal-header {
    padding: var(--space-lg) var(--space-xl);
    border-bottom: 1px solid var(--card-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 { font-size: 1.1rem; font-weight: 700; }

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 1.2rem;
    transition: var(--transition-fast);
    background: transparent;
    border: none;
    cursor: pointer;
}

.modal-close:hover { background: rgba(255,255,255,0.08); color: var(--text); }
.modal-body { padding: var(--space-xl); }
.modal-footer { padding: var(--space-lg) var(--space-xl); border-top: 1px solid var(--card-border); display: flex; justify-content: flex-end; gap: var(--space-sm); }

/* --------------------------------------------------------------------------
   LOADING SPINNER
   -------------------------------------------------------------------------- */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: wkSpin 0.7s linear infinite;
    flex-shrink: 0;
}

.loading-spinner.lg { width: 40px; height: 40px; border-width: 3px; }

.loading-overlay {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
    padding: var(--space-3xl);
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* --------------------------------------------------------------------------
   DASHBOARD GRID
   -------------------------------------------------------------------------- */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.dashboard-grid.wide   { grid-template-columns: 1fr; }
.dashboard-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.dashboard-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--space-md); }

/* --------------------------------------------------------------------------
   INSTALLER / STEP INDICATOR
   -------------------------------------------------------------------------- */
.installer-card { max-width: 720px; margin-inline: auto; }

.step-indicator {
    display: flex;
    align-items: center;
    margin-bottom: var(--space-2xl);
    overflow-x: auto;
}

.step { display: flex; flex-direction: column; align-items: center; gap: var(--space-xs); position: relative; flex: 1; }

.step-circle {
    width: 40px; height: 40px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.9rem;
    background: rgba(255,255,255,0.08);
    border: 2px solid var(--card-border);
    color: var(--text-muted);
    transition: var(--transition);
    position: relative; z-index: 1; flex-shrink: 0;
}

.step.active .step-circle { background: var(--gradient-primary); border-color: var(--primary); color: #fff; box-shadow: var(--shadow-primary); }
.step.complete .step-circle { background: var(--success); border-color: var(--success); color: #fff; }
.step.complete .step-circle::after { content: '✓'; }
.step.complete .step-number { display: none; }

.step-label { font-size: 0.72rem; font-weight: 600; color: var(--text-subtle); white-space: nowrap; text-align: center; }
.step.active  .step-label  { color: var(--primary-light); }
.step.complete .step-label { color: var(--success); }

/* Connector */
.step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 20px;
    left: calc(50% + 20px);
    right: calc(-50% + 20px);
    height: 2px;
    background: var(--card-border);
    z-index: 0;
}

.step.complete:not(:last-child)::after { background: var(--success); }

/* --------------------------------------------------------------------------
   ADMIN LAYOUT
   -------------------------------------------------------------------------- */
.admin-wrapper { display: flex; min-height: calc(100vh - var(--nav-height)); }

.admin-sidebar {
    width: var(--sidebar-width);
    background: var(--secondary);
    border-right: 1px solid var(--card-border);
    padding: var(--space-lg) 0;
    position: sticky;
    top: var(--nav-height);
    height: calc(100vh - var(--nav-height));
    overflow-y: auto;
    flex-shrink: 0;
}

.admin-sidebar-title {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    padding: 0 var(--space-lg);
    margin: var(--space-md) 0 var(--space-xs);
}

.admin-nav-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 10px var(--space-lg);
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition-fast);
    border-left: 3px solid transparent;
    text-decoration: none;
}

.admin-nav-item:hover { background: rgba(255,255,255,0.05); color: var(--text); text-decoration: none; }

.admin-nav-item.active {
    background: rgba(229,57,53,0.1);
    color: var(--primary-light);
    border-left-color: var(--primary);
    font-weight: 600;
}

.admin-nav-item .nav-icon { font-size: 1rem; width: 20px; text-align: center; flex-shrink: 0; }
.admin-content { flex: 1; padding: var(--space-xl); overflow-x: hidden; min-width: 0; }

.admin-page-title {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: var(--space-xl);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

/* --------------------------------------------------------------------------
   COUNTDOWN TIMER
   -------------------------------------------------------------------------- */
.countdown { font-size: 0.78rem; font-weight: 600; display: inline-flex; align-items: center; gap: var(--space-sm); }
.countdown.urgent { color: var(--error); }
.countdown.soon   { color: var(--warning); }
.countdown.ok     { color: var(--success); }

.countdown-unit { display: flex; flex-direction: column; align-items: center; gap: 2px; }

.countdown-value {
    font-size: 1.4rem;
    font-weight: 800;
    line-height: 1;
    min-width: 2ch;
    text-align: center;
    font-family: "Courier New", monospace;
    color: var(--accent);
}

.countdown-label {
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.countdown-sep { font-size: 1.2rem; font-weight: 800; line-height: 1; align-self: flex-start; margin-top: 4px; color: var(--text-muted); }

/* --------------------------------------------------------------------------
   CODE BLOCKS
   -------------------------------------------------------------------------- */
.code-block {
    position: relative;
    background: rgba(0,0,0,0.4);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sm);
    padding: var(--space-md) var(--space-lg);
    font-family: "Courier New", Courier, monospace;
    font-size: 0.85rem;
    overflow-x: auto;
    line-height: 1.6;
    color: var(--text);
}

.copy-btn {
    position: absolute;
    top: var(--space-sm);
    right: var(--space-sm);
    padding: 4px 10px;
    background: rgba(255,255,255,0.08);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 0.75rem;
    cursor: pointer;
    transition: var(--transition-fast);
}

.copy-btn:hover { background: rgba(255,255,255,0.14); color: var(--text); }
.copy-btn.copied { color: var(--success); border-color: rgba(76,175,80,0.4); }

/* --------------------------------------------------------------------------
   WELCOME CARD  — WK hero gradient
   -------------------------------------------------------------------------- */

/* ── Notificatiebalk ── */
.notif-bar {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.4);
    border-left: 4px solid #f59e0b;
    border-radius: var(--radius);
    padding: .85rem 1rem;
    margin-bottom: 1.25rem;
}
.notif-bar__icon { font-size: 1.1rem; flex-shrink: 0; line-height: 1.5; }
.notif-bar__list {
    margin: 0; padding: 0; list-style: none;
    display: flex; flex-direction: column; gap: .3rem;
    font-size: .9rem; color: var(--text);
}
.notif-bar__list a { color: #f59e0b; font-weight: 600; text-decoration: none; }
.notif-bar__list a:hover { text-decoration: underline; }

.welcome-card {
    background: linear-gradient(135deg, #1a1a2e 0%, #b71c1c 100%);
    color: #fff;
    border-radius: var(--radius);
    padding: 1.75rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-primary);
    overflow: hidden;
    position: relative;
}

.welcome-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, rgba(255,255,255,0.04) 1px, transparent 1px);
    background-size: 20px 20px;
    pointer-events: none;
}

.welcome-card .avatar-lg, .welcome-card .avatar-placeholder-lg { position: relative; z-index: 1; }
.welcome-card h2, .welcome-card .rank-badge { position: relative; z-index: 1; }

/* --------------------------------------------------------------------------
   SITE FOOTER
   -------------------------------------------------------------------------- */
.site-footer {
    background: var(--secondary);
    border-top: 1px solid var(--card-border);
    padding: var(--space-xl) 0;
    text-align: center;
    flex-shrink: 0;
    margin-top: auto;
}

.site-footer p { color: var(--text-muted); font-size: 0.85rem; }

/* Alias */
.footer { background: var(--secondary); color: var(--text-muted); text-align: center; padding: 1rem; font-size: 0.85rem; }

/* --------------------------------------------------------------------------
   MISC COMPONENTS
   -------------------------------------------------------------------------- */
.divider { height: 1px; background: var(--card-border); margin: var(--space-lg) 0; }
.page-section { margin-bottom: var(--space-2xl); }

.section-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: var(--space-lg);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.section-title::after { content: ''; flex: 1; height: 1px; background: var(--card-border); margin-left: var(--space-sm); }

.empty-state { text-align: center; padding: var(--space-3xl) var(--space-lg); color: var(--text-muted); }
.empty-state-icon { font-size: 3rem; margin-bottom: var(--space-md); }
.empty-state h3 { font-size: 1.1rem; font-weight: 600; margin-bottom: var(--space-sm); color: var(--text); }

.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: rgba(255,255,255,0.07);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-pill);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
}

.color-preview { width: 28px; height: 28px; border-radius: var(--radius-sm); border: 2px solid var(--card-border); cursor: pointer; transition: var(--transition-fast); display: inline-block; }
.color-preview:hover { transform: scale(1.1); }

/* Skeleton shimmer */
.skeleton {
    background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.04) 75%);
    background-size: 400px 100%;
    animation: wkShimmer 1.5s infinite;
    border-radius: var(--radius-sm);
    color: transparent !important;
    pointer-events: none;
}

/* Avatar BEM helpers */
.avatar        { border-radius: 50%; object-fit: cover; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; overflow: hidden; }
.avatar--sm    { width: 32px; height: 32px; font-size: 0.85rem; }
.avatar--lg    { width: 64px; height: 64px; font-size: 1.5rem; }
.avatar--initial { background: var(--gradient-primary); color: #fff; }

/* Auth pages */
.auth-wrapper { display: flex; align-items: flex-start; justify-content: center; padding: 2.5rem 1rem; min-height: calc(100vh - 130px); }
.auth-card { width: 100%; max-width: 440px; }
.auth-logo { text-align: center; margin-bottom: 1.5rem; }
.auth-logo__icon  { font-size: 2.5rem; line-height: 1.2; }
.auth-logo__title { font-size: 1.5rem; font-weight: 700; margin-top: 0.25rem; }
.auth-logo__sub   { font-size: 0.85rem; color: var(--text-muted); }
.auth-card__heading { font-size: 1.2rem; font-weight: 700; margin-bottom: 1rem; }
.auth-card__info { font-size: 0.875rem; color: var(--text-muted); margin-bottom: 1rem; line-height: 1.55; }
.auth-card__footer { text-align: center; font-size: 0.875rem; color: var(--text-muted); margin-top: 1.25rem; }
.auth-card__divider { display: flex; align-items: center; gap: 0.75rem; margin: 1.25rem 0 1rem; color: var(--text-muted); font-size: 0.82rem; }
.auth-card__divider::before, .auth-card__divider::after { content: ''; flex: 1; height: 1px; background: var(--card-border); }
.form-label__link { font-weight: 400; font-size: 0.8rem; color: var(--primary-light); float: right; }
.form-control--code { font-size: 1.6rem; letter-spacing: 0.6rem; text-align: center; font-weight: 700; padding: 0.65rem 1rem; }

/* Top-5 list */
.top5-list { list-style: none; }
.top5-list li { display: flex; align-items: center; gap: 0.75rem; padding: 0.55rem 0; border-bottom: 1px solid var(--card-border); font-size: 0.9rem; }
.top5-list li:last-child { border-bottom: none; }
.top5-list .pos { font-weight: 700; min-width: 24px; }
.top5-list .pts { margin-left: auto; font-weight: 700; color: var(--accent); }

/* Navbar BEM aliases */
.navbar__brand  { flex: 0 0 auto; }
.navbar__logo   { display: flex; align-items: center; gap: 0.5rem; color: #fff; text-decoration: none; font-size: 1.15rem; font-weight: 700; }
.navbar__icon   { font-size: 1.4rem; }
.navbar__name   { font-weight: 700; }
.navbar__menu   { display: flex; align-items: center; gap: 0.25rem; flex: 1; flex-wrap: wrap; }
.navbar__link   { padding: 0.4rem 0.75rem; border-radius: var(--radius-sm); color: rgba(255,255,255,0.8); font-size: 0.9rem; transition: background var(--transition-fast); text-decoration: none; }
.navbar__link:hover, .navbar__link--active { background: rgba(255,255,255,0.15); color: #fff; text-decoration: none; }
.navbar__link--admin { color: var(--accent); }
.navbar__user { display: flex; align-items: center; gap: 0.75rem; margin-left: auto; }
.navbar__username { font-size: 0.9rem; font-weight: 500; color: rgba(255,255,255,0.9); }
.navbar__hamburger { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 0.4rem; margin-left: auto; }
.navbar__hamburger span { display: block; width: 22px; height: 2px; background: #fff; border-radius: 2px; }
.main { flex: 1; padding: 1.5rem 0; }
.footer__copy { margin: 0; }

/* --------------------------------------------------------------------------
   KEYFRAMES — prefixed to avoid collision with existing @keyframes pulse
   -------------------------------------------------------------------------- */
@keyframes wkPulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.5; }
}

@keyframes wkSlideIn {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes wkFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes wkSpin {
    to { transform: rotate(360deg); }
}

@keyframes wkShimmer {
    0%   { background-position: -400px 0; }
    100% { background-position:  400px 0; }
}

/* Map generic class names to wk- keyframes */
.animate-pulse   { animation: wkPulse 2s infinite; }
.animate-fadein  { animation: wkFadeIn 0.4s ease forwards; }
.animate-slidein { animation: wkSlideIn 0.3s ease forwards; }

/* Responsive additions consolidated in the overhaul block at end of file */

/* --------------------------------------------------------------------------
   PRINT
   -------------------------------------------------------------------------- */
@media print {
    .navbar, .site-footer, .footer, .nav-hamburger, .modal { display: none !important; }
    body { background: #fff; color: #000; }
    .card, .match-card, .stat-card { border: 1px solid #ccc; box-shadow: none; break-inside: avoid; }
}

/* ==========================================================================
   LIGHT MODE FIXES
   ==========================================================================
   The page-header and footer always use a dark background regardless of
   the active theme, so their text must always be white/light.
   ========================================================================== */

/* Page header: dark gradient bg, always — keep text white */
.page-header h1 { color: #fff; }
.page-header p  { color: rgba(255, 255, 255, 0.72); }

/* Footer: dark bg (var(--secondary) = #1a1a2e), always white text */
.footer,
.site-footer { color: rgba(255, 255, 255, 0.6) !important; }

/* Toggle slider: rgba(255,255,255,0.15) is invisible on a light card */
body:not(.dark-mode) .toggle-slider {
    background: #94a3b8;
}

/* Select: dark mode — style options so popup is readable */
.dark-mode select.form-control {
    color-scheme: dark;
    background-color: #1e1e3a;
    color: #fff;
}
.dark-mode select.form-control option {
    background-color: #1e1e3a;
    color: #fff;
}

/* Select: light mode — dark arrow + light scheme */
body:not(.dark-mode) select.form-control {
    color-scheme: light;
    background-color: #ffffff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='rgba(26,26,46,0.55)' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}
body:not(.dark-mode) select.form-control option {
    background-color: #fff;
    color: #1a1a2e;
}

/* Form controls: use background-color (NOT background shorthand — that resets
   background-image/repeat on select and causes tiling of the arrow SVG) */
body:not(.dark-mode) .form-control {
    background-color: #ffffff;
    border-color: #d1d5db;
}

body:not(.dark-mode) .form-control:focus {
    background-color: #fff;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(229, 57, 53, 0.12);
}

/* Score number inputs light mode */
body:not(.dark-mode) .score-inputs input[type="number"],
body:not(.dark-mode) .score-input {
    background-color: #fff;
    border-color: #d1d5db;
}

/* Card hover: don't lift cards in light mode (subtle shadow enough) */
body:not(.dark-mode) .card:hover { transform: none; }

/* btn-secondary in light mode: readable contrast */
body:not(.dark-mode) .btn-secondary {
    background: #e5e7eb;
    border-color: #d1d5db;
    color: #1a1a2e;
}
body:not(.dark-mode) .btn-secondary:hover {
    background: #d1d5db;
    border-color: #9ca3af;
    color: #1a1a2e;
}

/* btn-outline in light mode */
body:not(.dark-mode) .btn-outline {
    color: var(--primary);
    border-color: var(--primary);
}

/* ==========================================================================
   MOBILE — HAMBURGER NAV OVERHAUL (≤ 768px)
   ========================================================================== */

@media (max-width: 768px) {

    /* ── Navbar container ── */
    .navbar {
        height: auto;
        min-height: var(--nav-height);
        padding: 0 1rem;
        flex-wrap: wrap;
        gap: 0;
        align-items: center;
    }

    /* ── Row 1: brand | user compact | hamburger ── */
    .navbar__brand {
        order: 1;
        flex: 1;
        padding: 0.75rem 0;
    }

    .navbar__user {
        order: 2;
        margin-left: 0;
        gap: 0.4rem;
        padding: 0.5rem 0;
    }

    /* Hide full name on mobile – avatar + logout button is enough */
    .navbar__username { display: none; }

    .navbar__hamburger {
        display: flex !important;
        order: 3;
        margin-left: 0.5rem;
        padding: 0.4rem;
        border-radius: var(--radius-sm);
        transition: background var(--transition-fast);
        flex-direction: column;
        gap: 5px;
    }

    .navbar__hamburger:hover { background: rgba(255, 255, 255, 0.12); }

    /* Hamburger → X animation using aria-expanded */
    .navbar__hamburger span {
        transition: transform 0.28s ease, opacity 0.2s ease;
        transform-origin: center;
    }
    .navbar__hamburger[aria-expanded="true"] span:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }
    .navbar__hamburger[aria-expanded="true"] span:nth-child(2) {
        opacity: 0;
        transform: scaleX(0);
    }
    .navbar__hamburger[aria-expanded="true"] span:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }

    /* ── Row 2: dropdown menu ── */
    .navbar__menu {
        display: none !important;
        order: 10;
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        padding: 0.4rem 0 0.75rem;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        gap: 0.1rem;
        /* Solid background so menu is readable over page content */
        background: #0a0a18;
    }

    .navbar__menu--open {
        display: flex !important;
        animation: wkSlideIn 0.2s ease;
    }

    .navbar__link {
        padding: 0.65rem 0.75rem;
        border-radius: var(--radius-sm);
        font-size: 0.95rem;
        width: 100%;
        display: block;
    }

    /* ── Match cards on mobile ── */
    .match-card {
        padding: 0.75rem;
    }

    /* Grid layout: home | score | away — each column gets equal space */
    .match-card .match-teams {
        display: grid;
        grid-template-columns: 1fr auto 1fr;
        align-items: center;
        gap: 0.35rem;
    }

    .match-card .team-name {
        font-size: 0.82rem;
        font-weight: 600;
        display: flex;
        align-items: center;
        gap: 0.3rem;
        flex-wrap: wrap;        /* allow name to wrap to 2nd line */
        word-break: break-word;
    }

    /* Away team right-aligned */
    .match-card .match-teams .team-name:last-child {
        justify-content: flex-end;
        text-align: right;
    }

    .match-card .score {
        font-size: 1.05rem;
        min-width: 40px;
        text-align: center;
    }

    /* ── Prediction inputs on mobile ── */
    .score-inputs {
        flex-wrap: wrap;
        gap: 0.35rem;
    }

    .btn-save-prediction {
        margin-left: 0;
        width: 100%;
        justify-content: center;
        margin-top: 0.35rem;
    }

    /* ── Page header on mobile ── */
    .page-header {
        padding: var(--space-2xl) 0 var(--space-xl);
        border-radius: 0;
    }

    .page-header h1 {
        font-size: clamp(1.4rem, 5vw, 2rem);
    }

    /* ── Content grids ── */
    /* cols-3 stacks to 1 column on mobile — 2 cols is too tight for stat cards */
    .dashboard-grid.cols-3 { grid-template-columns: 1fr; }
    /* cols-2 becomes 1 column (side-by-side cards stack) */
    .dashboard-grid.cols-2 { grid-template-columns: 1fr; }
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }

    /* Full-span items inside cols-2 grid should still fill the row */
    .dashboard-grid.cols-2 > [style*="grid-column"] {
        grid-column: 1 / -1 !important;
    }

    /* ── Card header: allow button to wrap below title on small screens ── */
    .card-header { flex-wrap: wrap; gap: 0.5rem; }

    /* ── Welcome card ── */
    .welcome-card { flex-direction: column; text-align: center; }

    /* ── Tournament predictions ── */
    .tournament-pred-card .field-row { flex-direction: column; align-items: flex-start; }
    .tournament-pred-card .field-row label { min-width: unset; }

    /* ── Rankings: hide extra columns ── */
    .ranking-table th:nth-child(n+5),
    .ranking-table td:nth-child(n+5) { display: none; }

    /* ── Admin sidebar ── */
    .admin-wrapper { flex-direction: column; }
    .admin-sidebar {
        width: 100%; height: auto; position: static;
        display: flex; flex-wrap: wrap;
        padding: var(--space-sm); gap: var(--space-xs);
        overflow-y: visible;
    }
    .admin-nav-item {
        border-left: none;
        border-bottom: 2px solid transparent;
        padding: var(--space-xs) var(--space-sm);
        border-radius: var(--radius-sm);
        font-size: 0.8rem;
    }
    .admin-nav-item.active { border-left: none; border-bottom-color: var(--primary); }
    .admin-content { padding: var(--space-md); }

    /* ── Forms ── */
    .form-row { grid-template-columns: 1fr; }

    /* ── Modals: slide up from bottom ── */
    .modal { align-items: flex-end; padding: 0; }
    .modal-content { max-width: 100%; border-radius: var(--radius) var(--radius) 0 0; }

    /* ── Installer step labels: hide on small screens ── */
    .step-label { display: none; }
}

@media (max-width: 768px) {
    /* Stat cards: horizontal layout — label+sub left, big value right */
    .dashboard-grid.cols-3 .stat-card {
        flex-direction: row !important;
        align-items: center;
        padding: 0.9rem 1rem;
    }
    .dashboard-grid.cols-3 .stat-card .stat-text {
        order: 1;
        flex: 1;
    }
    .dashboard-grid.cols-3 .stat-card .stat-value {
        order: 2;
        font-size: 2.2rem;
        margin-top: 0;
        margin-left: 1rem;
        flex-shrink: 0;
    }
}

@media (max-width: 480px) {
    .container { padding-inline: 0.75rem; }

    .stats-grid { grid-template-columns: 1fr; }
    .stat-card .stat-value { font-size: 1.8rem; }

    .match-card .score { font-size: 1rem; min-width: 36px; }
    .score-inputs input[type="number"], .score-input { width: 52px; font-size: 1.2rem; }

    .btn { padding: 8px 16px; font-size: 0.85rem; }
    .btn-lg { padding: 12px 22px; font-size: 0.95rem; }
    .card-body { padding: var(--space-md); }
    .table th, .table td { padding: var(--space-sm) var(--space-md); font-size: 0.82rem; }
}