/* ============================================================
   WK Voorspel — design system (2026)
   Neutraal-first · 1 merk-accent · 2 vaste spelerkleuren
   ============================================================ */
:root {
    /* neutralen (slate) */
    --bg: #f7f8fa;
    --surface: #ffffff;
    --surface-2: #f1f3f6;
    --border: #e7e9ee;
    --border-strong: #d4d8e0;
    --text: #11151c;
    --text-muted: #5b6472;
    --text-faint: #6e7682;

    /* merk-accent (pitch) + semantiek */
    --accent: #15a34a;
    --accent-press: #11823c;
    --accent-weak: #e9f9ef;
    --accent-line: #b6e8c6;
    --raak: #d97706;
    --raak-weak: #fdf3e6;
    --danger: #dc2626;

    /* vaste spelerkleuren */
    --p1: #6366f1;  --p1-weak: #ecedfe;  --p1-line: #c9cbf8;
    --p2: #f43f5e;  --p2-weak: #fdeaef;  --p2-line: #fbcdd6;

    /* radius / elevatie / focus */
    --r-sm: 8px;
    --r-md: 12px;
    --r-lg: 16px;
    --shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
    --shadow-pop: 0 8px 28px -10px rgba(16, 24, 40, 0.22), 0 2px 6px rgba(16, 24, 40, 0.06);
    --ring: 0 0 0 3px rgba(21, 163, 74, 0.22);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    background: var(--bg);
    font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    font-feature-settings: "cv11", "ss01";
}
h1, h2, h3 { margin: 0; }
a { color: inherit; }
.tnum { font-variant-numeric: tabular-nums; }

.ico { display: inline-block; vertical-align: middle; flex: 0 0 auto; }

/* ---------- layout ---------- */
.wrap { max-width: 1080px; margin: 0 auto; padding: 24px 20px 72px; }
.layout { display: flex; flex-direction: column; }
.content { min-width: 0; order: 1; } /* op mobiel: stand + voorspellingen eerst */
.sidebar { order: 2; }              /* dagkalender eronder (desktop-grid hieronder overschrijft de volgorde) */
.content > .card,
.content > .section-title,
.content > .nudge { max-width: 720px; }
@media (min-width: 940px) {
    .layout:has(.sidebar) {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 320px;
        gap: 28px;
        align-items: start;
    }
    .layout:has(.sidebar) .content { grid-column: 1; grid-row: 1; }
    .layout:has(.sidebar) .sidebar { grid-column: 2; grid-row: 1; position: sticky; top: 20px; }
}

/* ---------- header ---------- */
.top {
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px; flex-wrap: wrap; margin: 0 0 28px;
}
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; }
.brand .logo { width: 30px; height: 30px; flex: 0 0 auto; }
.brand-name { font-size: 18px; font-weight: 700; letter-spacing: -0.02em; }
.top-right { display: flex; align-items: center; gap: 10px; }

/* ---------- knoppen ---------- */
.btn {
    appearance: none; border: 1px solid transparent; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    font: inherit; font-weight: 600; font-size: 14px;
    padding: 9px 15px; border-radius: var(--r-md);
    background: var(--accent); color: #fff;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.08s ease;
}
.btn:hover { background: var(--accent-press); }
.btn:active { transform: translateY(0.5px); }
.btn:disabled { opacity: 0.45; cursor: default; }
.btn:disabled:hover { background: var(--accent); }
.btn--secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn--secondary:hover { background: var(--surface-2); border-color: var(--border-strong); }
.btn--ghost { background: none; color: var(--text-muted); border-color: transparent; padding: 7px 10px; }
.btn--ghost:hover { background: var(--surface-2); color: var(--text); }
.btn--lg { padding: 12px 22px; font-size: 15px; }

.icon-btn {
    appearance: none; cursor: pointer;
    width: 38px; height: 38px; border-radius: var(--r-md);
    border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
    display: inline-flex; align-items: center; justify-content: center;
    transition: background 0.15s, border-color 0.15s, transform 0.08s;
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn:active { transform: scale(0.94); }

:where(button, a, input, .fx-row, summary):focus-visible {
    outline: none; box-shadow: var(--ring); border-radius: var(--r-sm);
}

/* segmented control (identiteit) */
.seg {
    display: inline-flex; gap: 2px; padding: 3px;
    background: var(--surface-2); border: 1px solid var(--border); border-radius: 11px;
}
.seg button {
    appearance: none; border: none; background: none; cursor: pointer; font: inherit;
    display: inline-flex; align-items: center; gap: 7px;
    font-size: 13px; font-weight: 600; color: var(--text-muted);
    padding: 5px 11px 5px 7px; border-radius: 8px;
    transition: background 0.15s, color 0.15s;
}
.seg button:hover { color: var(--text); }
.seg button.is-active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); cursor: default; }

/* ---------- avatar ---------- */
.avatar {
    width: 28px; height: 28px; border-radius: 50%; flex: 0 0 auto;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 700; color: #fff; letter-spacing: 0;
}
.avatar--sm { width: 22px; height: 22px; font-size: 10px; }
.avatar--lg { width: 46px; height: 46px; font-size: 18px; }
.avatar--p1 { background: var(--p1); }
.avatar--p2 { background: var(--p2); }

/* ---------- tag ---------- */
.tag {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 12px; font-weight: 600; line-height: 1.4;
    padding: 2px 9px; border-radius: 999px;
    background: var(--surface-2); border: 1px solid var(--border); color: var(--text-muted);
    white-space: nowrap;
}
.tag--count { background: var(--surface); }
.tag--exact { background: var(--accent-weak); border-color: var(--accent-line); color: var(--accent-press); }
.tag--raak  { background: var(--raak-weak); border-color: #f5d9a8; color: var(--raak); }
.tag--you   { background: var(--accent-weak); border-color: var(--accent-line); color: var(--accent-press); }
.tag--p1 { background: var(--p1-weak); border-color: var(--p1-line); color: var(--p1); }
.tag--p2 { background: var(--p2-weak); border-color: var(--p2-line); color: var(--p2); }
.tag--solid-p1 { background: var(--p1); border-color: var(--p1); color: #fff; }
.tag--solid-p2 { background: var(--p2); border-color: var(--p2); color: #fff; }

/* ---------- cards ---------- */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 22px;
    margin: 0 0 16px;
    box-shadow: var(--shadow);
}
.card--quiet { background: var(--surface); box-shadow: none; }
.card--hero { box-shadow: var(--shadow-pop); }
.card-label {
    font-size: 11px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase;
    color: var(--text-faint); margin: 0 0 16px;
}

/* ---------- sectie-kop ---------- */
.section-title {
    display: flex; align-items: center; gap: 9px;
    margin: 32px 2px 14px; font-size: 15px; font-weight: 650; color: var(--text);
}
.section-title .ico { color: var(--text-faint); }
.section-title .tag { margin-left: 2px; }

/* ---------- actie-nudge ---------- */
.nudge {
    display: flex; align-items: center; gap: 11px;
    padding: 12px 16px; margin: 0 0 16px;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md);
    box-shadow: var(--shadow); text-decoration: none; color: var(--text);
    transition: border-color 0.15s;
}
.nudge:hover { border-color: var(--border-strong); }
.nudge .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: 0 0 auto; }
.nudge.is-done .dot { background: var(--accent); }
.nudge.is-wait .dot { background: var(--raak); }
.nudge b { font-weight: 700; }
.nudge .nudge-cta { margin-left: auto; display: inline-flex; align-items: center; gap: 5px; color: var(--accent-press); font-weight: 600; }
.nudge.is-done { color: var(--text-muted); }

/* ---------- chooser ---------- */
.chooser { text-align: center; max-width: 460px; margin: 40px auto 0; }
.chooser h2 { font-size: 20px; letter-spacing: -0.01em; margin-bottom: 6px; }
.chooser p { color: var(--text-muted); margin: 0 0 22px; }
.chooser-btns { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.chooser-btns .btn { gap: 9px; }

/* ============================================================
   STAND — head-to-head hero
   ============================================================ */
.h2h { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; }
.h2h-player { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.h2h-name { display: inline-flex; align-items: center; gap: 7px; font-weight: 650; font-size: 15px; }
.h2h-avatar { position: relative; display: inline-flex; }
.h2h-crown { position: absolute; top: -13px; left: 50%; transform: translateX(-50%) rotate(-6deg); color: #eab308; line-height: 0; pointer-events: none; }
.h2h-fire {
    display: inline-flex; align-items: center; gap: 2px;
    padding: 1px 7px 1px 5px; border-radius: 999px;
    font-size: 11px; font-weight: 750; line-height: 1.5;
    color: #c2410c; background: #fff1e6; border: 1px solid #fed7aa;
    transform-origin: 50% 80%; animation: fireFlicker 1.6s ease-in-out infinite;
}
.h2h-fire .ico { color: #f97316; }
html[data-theme="dark"] .h2h-fire { color: #fdba74; background: rgba(249,115,22,0.14); border-color: rgba(249,115,22,0.35); }
@keyframes fireFlicker {
    0%, 100% { transform: scale(1) rotate(0deg); }
    35%      { transform: scale(1.06) rotate(-1.5deg); }
    70%      { transform: scale(0.98) rotate(1deg); }
}
@media (prefers-reduced-motion: reduce) { .h2h-fire { animation: none; } }
.h2h-score { font-size: 46px; font-weight: 750; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.h2h-score .sep { color: var(--text-faint); margin: 0 6px; font-weight: 500; }
.h2h-score .count { display: inline-block; min-width: 0.62em; text-align: center; }

/* live aftel-timer: cijfers niet laten springen */
.js-countdown .urg-text { font-variant-numeric: tabular-nums; }

/* reveal-flip van de verborgen voorspelling */
.pv.is-revealing { display: inline-block; transform-origin: center; backface-visibility: hidden; animation: revealFlip 0.5s ease-out both; }
@keyframes revealFlip { from { transform: rotateY(90deg); opacity: 0; } to { transform: rotateY(0); opacity: 1; } }

/* confetti bij een voltreffer */
.confetti-layer { position: absolute; pointer-events: none; height: 0; z-index: 60; overflow: visible; }
.confetti-bit { position: absolute; top: 0; width: 8px; height: 11px; border-radius: 2px; opacity: 0; will-change: transform, opacity; animation-name: confettiFall; animation-timing-function: cubic-bezier(0.25, 0.6, 0.4, 1); animation-fill-mode: forwards; }
@keyframes confettiFall {
    0%   { transform: translate(0, -12px) rotate(0deg); opacity: 1; }
    100% { transform: translate(var(--dx, 0), 56vh) rotate(var(--rot, 180deg)); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
    .pv.is-revealing { animation: none; }
    .confetti-bit { display: none; }
}
.h2h-stats { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }

.momentum { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; display: flex; margin: 20px 0 6px; }
.momentum > span { display: block; height: 100%; transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1); }
.momentum .m1 { background: var(--p1); }
.momentum .m2 { background: var(--p2); }
.momentum-legend { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-faint); font-weight: 600; }

/* grafiek */
.chart-wrap { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--border); }
.chart { width: 100%; height: auto; display: block; }
.chart .grid { stroke: var(--border); stroke-width: 1; }
.chart .ylab, .chart .xlab { fill: var(--text-faint); font-size: 10px; font-family: inherit; }
.chart .ylab { text-anchor: end; }
.legend { display: flex; gap: 18px; justify-content: center; margin-top: 10px; font-size: 12.5px; color: var(--text-muted); }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; background: currentColor; }
.chart .s1, .legend i.s1 { color: var(--p1); }
.chart .s2, .legend i.s2 { color: var(--p2); }
.chart .s3, .legend i.s3 { color: #d97706; }
.chart .s4, .legend i.s4 { color: #0ea5e9; }

.empty-inline { display: flex; align-items: center; gap: 10px; justify-content: center; color: var(--text-faint); font-size: 13.5px; padding: 8px 0; }
.empty-inline .ico { color: var(--text-faint); }

/* ============================================================
   WEDSTRIJDKAART
   ============================================================ */
.match { padding: 20px; }
.match.needs-me { border-color: var(--accent-line); box-shadow: inset 3px 0 0 var(--accent); }
.mhead { margin-bottom: 16px; }
.mteams { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 14px; }
.team { display: flex; align-items: center; gap: 10px; min-width: 0; }
.team.home { justify-content: flex-end; }
.team.away { justify-content: flex-start; }
.team .tn { font-weight: 650; font-size: 16px; letter-spacing: -0.01em; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vs { font-size: 11px; color: var(--text-faint); font-weight: 600; }
.flag { width: 24px; height: auto; border-radius: 3px; box-shadow: 0 0 0 1px rgba(0,0,0,0.07); vertical-align: middle; display: inline-block; object-fit: cover; }
.flag-lg { width: 30px; }
.flag-none { box-shadow: none; font-size: 22px; }
.flag-lg.flag-none { font-size: 28px; }

.mmeta {
    display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap;
    margin-top: 12px; font-size: 12.5px; color: var(--text-muted);
}
.mmeta .sepdot { width: 3px; height: 3px; border-radius: 50%; background: var(--text-faint); }
.mmeta .urg { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; }
.mmeta .urg .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-faint); }
.mmeta .urg.soon { color: var(--raak); } .mmeta .urg.soon .dot { background: var(--raak); }
.mmeta .urg.urgent { color: var(--danger); } .mmeta .urg.urgent .dot { background: var(--danger); }
.mhead { position: relative; }
.del { position: absolute; top: -4px; right: -4px; }
.x { background: none; border: none; cursor: pointer; color: var(--text-faint); padding: 5px; border-radius: 8px; display: inline-flex; transition: color 0.15s, background 0.15s; }
.x:hover { color: var(--danger); background: var(--surface-2); }
.mmeta .picked-by { display: inline-flex; align-items: center; gap: 5px; }

.finalscore { text-align: center; font-size: 30px; font-weight: 750; letter-spacing: -0.01em; margin: 2px 0 10px; font-variant-numeric: tabular-nums; }
.round-winner { display: flex; align-items: center; justify-content: center; gap: 7px; font-size: 13px; color: var(--text-muted); margin: 0 0 14px; }
.round-winner .ico { color: var(--text-faint); }
.round-winner b { color: var(--text); }

/* ---------- voorspellingen ---------- */
.preds { display: flex; flex-direction: column; gap: 8px; }
.pred {
    display: flex; align-items: center; gap: 11px;
    padding: 10px 12px; border-radius: var(--r-md);
    background: var(--surface-2); border: 1px solid var(--border);
}
.pred .pname { font-weight: 600; flex: 1; min-width: 0; }
.pred .pv { font-weight: 700; font-size: 17px; font-variant-numeric: tabular-nums; }
.pred--you { background: var(--surface); border-color: var(--border-strong); }
.pred--hidden { color: var(--text-faint); }
.pred--hidden .hide-label { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; }
.pred.exact { border-color: var(--accent-line); background: var(--accent-weak); }
.pred.raak  { border-color: #f5d9a8; background: var(--raak-weak); }
.pp { font-weight: 700; font-size: 13px; min-width: 30px; text-align: center; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--text-muted); }
.pred.exact .pp { background: var(--accent); color: #fff; }
.pred.raak .pp  { background: var(--raak); color: #fff; }

/* score-stepper */
.score-stepper { display: inline-flex; align-items: center; gap: 8px; }
.score-field {
    width: 50px; text-align: center; padding: 9px 6px;
    font-weight: 700; font-size: 18px; font-variant-numeric: tabular-nums;
    color: var(--text); background: var(--surface); border: 1px solid var(--border-strong);
    border-radius: var(--r-sm); -moz-appearance: textfield;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.score-field::-webkit-outer-spin-button, .score-field::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.score-field:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
.score-dash { color: var(--text-faint); font-weight: 600; }
.save-state { font-size: 12.5px; font-weight: 600; white-space: nowrap; min-width: 96px; display: inline-flex; align-items: center; gap: 6px; color: var(--text-faint); }
.save-state:empty { min-width: 96px; }
.save-state.saving { color: var(--text-muted); }
.save-state.ok { color: var(--accent-press); }
.save-state.err { color: var(--danger); }
.ok-check { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 10px; font-weight: 700; line-height: 1; }
@keyframes savePulse { 0% { transform: scale(0.5); opacity: 0; } 55% { transform: scale(1.15); } 100% { transform: scale(1); opacity: 1; } }
.save-state.pulse .ok-check { animation: savePulse 0.4s cubic-bezier(0.22, 1, 0.36, 1); }
html[data-theme="dark"] .ok-check { color: #06231a; }

.result-entry { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); display: flex; align-items: center; gap: 11px; flex-wrap: wrap; }
.result-entry .rlabel { font-weight: 600; color: var(--text-muted); font-size: 13px; }
.fix-result { margin-top: 12px; }
.fix-result summary { font-size: 12.5px; color: var(--text-faint); font-weight: 500; cursor: pointer; list-style: none; }
.fix-result summary::-webkit-details-marker { display: none; }
.fix-result form { margin-top: 12px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ============================================================
   ZIJBALK — dagkalender
   ============================================================ */
.dayview { padding: 16px; transition: opacity 0.12s; }
.dayview.is-loading { opacity: 0.55; }
.day-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 14px; }
.day-nav .icon-btn { width: 32px; height: 32px; }
.day-nav .icon-btn.off { opacity: 0.3; pointer-events: none; }
.day-title { text-align: center; line-height: 1.2; }
.day-title strong { font-size: 14px; display: block; font-weight: 700; }
.day-title small { font-size: 11px; color: var(--text-faint); }
.day-empty { display: flex; align-items: center; gap: 8px; justify-content: center; color: var(--text-faint); font-size: 13px; padding: 16px 0; }
.day-rows { display: flex; flex-direction: column; gap: 7px; }
.day-row {
    display: block; padding: 9px 11px; border-radius: var(--r-md);
    border: 1px solid var(--border); background: var(--surface-2);
    text-decoration: none; color: var(--text); transition: border-color 0.12s, background 0.12s;
}
.day-row:hover { border-color: var(--border-strong); }
.dr-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 5px; }
.dr-time { font-size: 12px; font-weight: 700; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.dr-teams { font-size: 13px; font-weight: 600; line-height: 1.35; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.dr-teams .flag { width: 16px; }
.dr-vs { color: var(--text-faint); font-weight: 500; }
.dr-state { font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 999px; white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--border); color: var(--text-muted); background: var(--surface); }
.dr-state.final { font-variant-numeric: tabular-nums; }
.dr-state.todo { color: var(--accent-press); background: var(--accent-weak); border-color: var(--accent-line); }
.dr-state.na { color: var(--text-faint); background: transparent; border-style: dashed; }
.day-row.is-mine { border-color: var(--accent-line); background: var(--accent-weak); }
.day-row.is-mine .dr-state.done { color: #fff; background: var(--accent); border-color: var(--accent); }
.day-row.is-na { opacity: 0.62; }
.day-row.is-na:hover { border-color: var(--border); }
.day-row.is-na.is-past { opacity: 0.5; cursor: not-allowed; }
.dr-state.past { color: var(--text-faint); background: transparent; }

/* ============================================================
   KALENDER-KIEZER
   ============================================================ */
.picker-summary { display: flex; align-items: center; gap: 10px; cursor: pointer; list-style: none; }
.picker-summary::-webkit-details-marker { display: none; }
.picker-summary .ico { color: var(--text-faint); }
.ps-title { font-weight: 650; font-size: 15px; }
.ps-hint { font-size: 13px; color: var(--text-faint); }
.ps-chev { margin-left: auto; color: var(--text-faint); transition: transform 0.2s; }
.picker details[open] .ps-chev { transform: rotate(180deg); }
.picker details[open] .picker-summary { margin-bottom: 14px; }

.field-search { position: relative; }
.field-search .ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-faint); }
.fx-search { width: 100%; padding: 10px 12px 10px 38px; font: inherit; color: var(--text); background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: var(--r-md); }
.fx-search::placeholder { color: var(--text-faint); }
.fx-search:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); background: var(--surface); }

.fx-list { max-height: 440px; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--r-md); padding: 6px 8px 8px; margin: 12px 0; background: var(--bg); }
.fx-list [hidden] { display: none !important; }
.fx-date { position: sticky; top: -2px; background: var(--bg); padding: 10px 4px 6px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-faint); z-index: 1; }
.fx-row { display: flex; align-items: center; gap: 11px; padding: 9px 10px; margin-bottom: 6px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); cursor: pointer; transition: background 0.12s, border-color 0.12s; }
.fx-row:hover { border-color: var(--border-strong); }
.fx-row:has(input:checked) { background: var(--accent-weak); border-color: var(--accent-line); }
.fx-row input { position: absolute; opacity: 0; width: 0; height: 0; }
.fx-check { width: 20px; height: 20px; flex: 0 0 auto; border: 2px solid var(--border-strong); border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; color: #fff; transition: background 0.12s, border-color 0.12s; }
.fx-row input:checked ~ .fx-check { background: var(--accent); border-color: var(--accent); }
.fx-row input:focus-visible ~ .fx-check { box-shadow: var(--ring); border-color: var(--accent); }
.fx-match { flex: 1 1 auto; min-width: 0; font-size: 14px; font-weight: 500; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.fx-vs { color: var(--text-faint); }
.fx-time { flex: 0 0 auto; font-size: 13px; color: var(--text-muted); font-variant-numeric: tabular-nums; display: inline-flex; align-items: center; gap: 5px; }
.fx-row.is-added .fx-check { background: var(--accent); border-color: var(--accent); }
.fx-row.is-added { cursor: default; opacity: 0.6; }
.fx-row.is-added:hover { border-color: var(--border); }
.fx-row.is-added .fx-time { color: var(--accent-press); font-weight: 600; }
.fx-row.is-past { cursor: default; opacity: 0.5; }
.fx-row.is-past:hover { border-color: var(--border); }
.fx-row.is-past .fx-time { color: var(--text-faint); font-weight: 600; }
.fx-bar { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.fx-empty { color: var(--text-muted); font-size: 14px; margin-right: auto; }

/* knockout zelf toevoegen */
.custom-add { margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--border-strong); }
.ca-head { display: flex; align-items: center; gap: 7px; font-weight: 650; font-size: 14px; }
.ca-head .ico { color: var(--text-faint); }
.custom-add .section-hint { margin: 4px 0 12px; }
.ca-form { display: flex; flex-direction: column; gap: 10px; }
.ca-teams { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; }
.ca-vs { color: var(--text-faint); font-weight: 600; }
.ca-row { display: flex; gap: 8px; flex-wrap: wrap; }
.ca-row > * { flex: 1 1 auto; min-width: 140px; }
.ca-form select, .ca-form input[type="datetime-local"] {
    width: 100%; padding: 10px 11px; font: inherit; color: var(--text);
    background: var(--surface); border: 1px solid var(--border-strong);
    border-radius: var(--r-sm); -webkit-appearance: none; appearance: none;
}
.ca-form input[type="datetime-local"] { -webkit-appearance: none; }
.ca-form select:focus, .ca-form input:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
.ca-form .btn { align-self: flex-start; }

/* ---------- lege staat ---------- */
.empty-hero { text-align: center; padding: 44px 20px; }
.empty-hero .eh-ico { width: 56px; height: 56px; border-radius: 16px; background: var(--accent-weak); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; margin-bottom: 16px; }
.empty-hero h2 { font-size: 19px; letter-spacing: -0.01em; margin-bottom: 7px; }
.empty-hero p { color: var(--text-muted); margin: 0 0 18px; }
.empty-hero .btn { text-decoration: none; }

/* ---------- toast ---------- */
.toast {
    position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(0);
    display: inline-flex; align-items: center; gap: 8px;
    background: #11151c; color: #fff; padding: 11px 16px; border-radius: var(--r-md);
    font-size: 14px; font-weight: 600; z-index: 50; box-shadow: var(--shadow-pop);
    transition: opacity 0.35s ease, transform 0.35s ease;
}
.toast .ico { color: #4ade80; }
.toast.hide { opacity: 0; transform: translateX(-50%) translateY(10px); }

/* ---------- diversen ---------- */
.muted { color: var(--text-muted); font-size: 14px; }
.foot { text-align: center; margin-top: 32px; font-size: 12.5px; color: var(--text-faint); }
.foot b { color: var(--text-muted); }

/* ---------- audit-verfijningen ---------- */
.section-hint { display: flex; align-items: center; gap: 7px; margin: -6px 2px 14px; font-size: 12.5px; color: var(--text-faint); }
.section-hint .ico { color: var(--text-faint); }

.h2h-delta { text-align: center; font-size: 13.5px; font-weight: 600; color: var(--text-muted); margin-top: 14px; }
.h2h-delta.is-empty { font-weight: 500; color: var(--text-faint); }

.save-state.hint { color: var(--raak); }

@keyframes livePulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
.mmeta .urg.live { color: var(--accent-press); }
.mmeta .urg.live .dot { background: var(--accent); animation: livePulse 1.4s ease-in-out infinite; }
.dr-state.live { color: var(--accent-press); background: var(--accent-weak); border-color: var(--accent-line); }
.livedot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); display: inline-block; animation: livePulse 1.4s ease-in-out infinite; }

.result-late { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.result-late > summary { font-size: 13px; color: var(--text-muted); font-weight: 600; cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: 6px; }
.result-late > summary::-webkit-details-marker { display: none; }
.result-late .result-entry { margin-top: 0; border-top: none; padding-top: 14px; }

/* "wie ging door" bij een gelijke knock-outstand (penalty's) */
.adv-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: 0 0 14px; }
.adv-q { font-size: 12.5px; color: var(--text-muted); font-weight: 600; }
.adv-opts { display: flex; gap: 8px; flex-wrap: wrap; }
.adv-btn {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 6px 11px; border-radius: 999px; font: inherit; font-size: 13px; font-weight: 600;
    background: var(--surface-2); border: 1px solid var(--border-strong); color: var(--text); cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.adv-btn .flag { width: 18px; }
.adv-btn:hover { border-color: var(--accent-line); }
.adv-btn.is-sel { background: var(--accent); border-color: var(--accent); color: #fff; }
.adv-btn.is-sel .flag { box-shadow: 0 0 0 1px rgba(255,255,255,0.45); }

.day-rows .quick-add { margin: 0; }
button.day-row { width: 100%; text-align: left; font: inherit; cursor: pointer; appearance: none; -webkit-appearance: none; }
button.day-row.is-na:hover { border-color: var(--accent-line); opacity: 1; }
button.day-row.is-na:hover .dr-state.na { color: var(--accent-press); border-color: var(--accent-line); border-style: solid; }

/* ---------- statistieken-popup ---------- */
.modal { position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center; padding: 18px; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(8,11,16,0.55); }
.modal-card {
    position: relative; width: 100%; max-width: 440px; max-height: 88vh; overflow-y: auto;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
    box-shadow: var(--shadow-pop); padding: 20px; animation: modalIn 0.18s ease-out;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(8px) scale(0.98); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.modal-head h2 { font-size: 17px; display: inline-flex; align-items: center; gap: 8px; }
.modal-head h2 .ico { color: var(--text-faint); }
.modal-empty { color: var(--text-muted); display: flex; gap: 8px; align-items: center; padding: 10px 0; }
body.modal-open { overflow: hidden; }

/* stats-knop in het Stand-kaartje */
.standings { position: relative; }
.stats-card-btn {
    position: absolute; top: 13px; right: 13px;
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 11px 6px 9px; border-radius: 999px;
    font: inherit; font-size: 12px; font-weight: 650; line-height: 1;
    background: var(--surface-2); border: 1px solid var(--border-strong); color: var(--text-muted);
    cursor: pointer; box-shadow: var(--shadow);
    transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.08s;
}
.stats-card-btn .ico { color: var(--text-faint); transition: color 0.15s; }
.stats-card-btn:hover { background: var(--surface); border-color: var(--accent-line); color: var(--text); }
.stats-card-btn:hover .ico { color: var(--accent-press); }
.stats-card-btn:active { transform: scale(0.96); }

.st-players { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; margin-bottom: 10px; font-weight: 650; font-size: 13px; }
.st-p { display: inline-flex; align-items: center; gap: 7px; }
.st-p--r { justify-content: flex-end; }
.st-table { display: flex; flex-direction: column; }
.st-row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--border); }
.st-row:first-child { border-top: none; }
.st-lbl { font-size: 12px; color: var(--text-muted); text-align: center; }
.st-v { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text-muted); }
.st-v:first-child { text-align: right; }
.st-v:last-child { text-align: left; }
.st-v.win { color: var(--accent-press); }
.st-facts { margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--border-strong); display: flex; flex-direction: column; gap: 11px; }
.st-fact { display: flex; gap: 9px; font-size: 13px; line-height: 1.45; color: var(--text-muted); }
.st-fact .ico { color: var(--text-faint); flex: 0 0 auto; margin-top: 1px; }
.st-fact b { color: var(--text); font-weight: 650; }
.st-fact .st-sub { color: var(--text-faint); }
@media (prefers-reduced-motion: reduce) { .modal-card { animation: none; } }

/* ---------- responsive ---------- */
@media (max-width: 620px) {
    .wrap { padding: 18px 14px 64px; }
    .h2h-score { font-size: 38px; }
    .team .tn { font-size: 14px; }
    .team .flag-lg { width: 26px; }
    .pred { flex-wrap: wrap; }
    .score-stepper { width: 100%; justify-content: flex-start; }
    .save-state { min-width: 0; }
    .icon-btn { width: 42px; height: 42px; }
    .day-row, .fx-row { min-height: 44px; }
    .fx-row { align-items: center; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; }
}

/* ============================================================
   DARK MODE
   ============================================================ */
html[data-theme="dark"] {
    --bg: #0d1016;
    --surface: #161b22;
    --surface-2: #1d242d;
    --border: #262e39;
    --border-strong: #38424f;
    --text: #e7edf4;
    --text-muted: #9aa7b6;
    --text-faint: #7e8796;

    --accent: #22c55e;
    --accent-press: #4ade80;
    --accent-weak: rgba(34, 197, 94, 0.13);
    --accent-line: rgba(34, 197, 94, 0.38);
    --raak: #f59e0b;
    --raak-weak: rgba(245, 158, 11, 0.13);
    --danger: #f87171;

    --p1: #818cf8; --p1-weak: rgba(129, 140, 248, 0.15); --p1-line: rgba(129, 140, 248, 0.4);
    --p2: #fb7185; --p2-weak: rgba(251, 113, 133, 0.15); --p2-line: rgba(251, 113, 133, 0.4);

    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-pop: 0 10px 30px -10px rgba(0, 0, 0, 0.6), 0 2px 6px rgba(0, 0, 0, 0.4);
    --ring: 0 0 0 3px rgba(34, 197, 94, 0.3);
    color-scheme: dark;
}
html[data-theme="dark"] .btn { color: #06231a; }
html[data-theme="dark"] .pred.exact .pp,
html[data-theme="dark"] .pred.raak .pp,
html[data-theme="dark"] .day-row.is-mine .dr-state.done,
html[data-theme="dark"] .tag--solid-p1,
html[data-theme="dark"] .tag--solid-p2 { color: #0d1016; }
html[data-theme="dark"] .toast { background: #1d242d; }
