/* ===== Reset & Base ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    /* AD'69 Huisstijl */
    --primary: #2DB848;
    --primary-dark: #22963A;
    --primary-light: #E4F7EB;
    --secondary: #132B13;        /* donkergroen header */
    --secondary-light: #1E3F1E;
    --bg: #F2F4F3;
    --card: #ffffff;
    --text: #1A1A1A;
    --text-light: #6B7280;
    --border: #E0E5E2;
    --team-a: #1D4ED8;
    --team-a-light: #DBEAFE;
    --team-b: #DC2626;
    --team-b-light: #FEE2E2;
    --gold: #D97706;
    --shadow-sm: 0 1px 4px rgba(0,0,0,0.07);
    --shadow: 0 2px 12px rgba(0,0,0,0.10);
    --shadow-lg: 0 6px 28px rgba(0,0,0,0.14);
    --radius: 10px;
    --radius-sm: 6px;
    --transition: 0.16s ease;
}

html, body {
    height: 100%;
}

body {
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    line-height: 1.5;
    min-height: 100vh;
}

h1, h2, h3, .nav-btn, .team-badge, .section-header h2 {
    font-family: 'Oswald', 'Segoe UI', sans-serif;
    letter-spacing: 0.3px;
}

/* ===== Header ===== */
header {
    background: var(--secondary);
    color: white;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 16px rgba(0,0,0,0.25);
    border-top: 4px solid var(--primary);
}

.header-inner {
    max-width: 960px;
    margin: 0 auto;
    padding: 12px 20px 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.header-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-title {
    display: flex;
    align-items: center;
    gap: 14px;
}

.btn-login {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 1.1rem;
    cursor: pointer;
    line-height: 1;
    transition: background var(--transition);
    flex-shrink: 0;
}

.btn-login:hover {
    background: rgba(255,255,255,0.25);
}

.btn-login.logged-in {
    background: rgba(255,255,255,0.25);
}

.login-error {
    color: #DC2626;
    font-size: 0.85rem;
    margin: 8px 0 0;
}

.header-logo {
    height: 44px;
    width: auto;
    filter: brightness(0) invert(1);  /* wit maken op donkere achtergrond */
    flex-shrink: 0;
}

.header-title h1 {
    font-family: 'Oswald', sans-serif;
    font-size: 1.7rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: white;
}

.header-sub {
    font-size: 0.72rem;
    color: rgba(255,255,255,0.5);
    margin-top: 1px;
    letter-spacing: 0.3px;
    font-family: 'Inter', sans-serif;
}

.main-nav {
    display: flex;
    gap: 4px;
}

.nav-btn {
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.6);
    font-family: 'Oswald', sans-serif;
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    padding: 9px 18px;
    cursor: pointer;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    transition: background var(--transition), color var(--transition);
    white-space: nowrap;
}

.nav-btn:hover {
    background: rgba(255,255,255,0.07);
    color: rgba(255,255,255,0.9);
}

.nav-btn.active {
    background: var(--bg);
    color: var(--primary-dark);
    font-weight: 700;
}

/* ===== Main ===== */
main {
    max-width: 960px;
    margin: 0 auto;
    padding: 28px 20px 60px;
}

/* ===== Tab Content ===== */
.tab-content {
    animation: fadeIn 0.2s ease;
}

.tab-content.hidden {
    display: none;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== Section Header ===== */
.section-header {
    margin-bottom: 20px;
}

.section-header h2 {
    font-size: 1.3rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--secondary);
}

.section-sub {
    color: var(--text-light);
    font-size: 0.88rem;
    margin-top: 3px;
}

/* ===== Empty State ===== */
.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-light);
}

.empty-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 12px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 0.95rem;
}

.hidden {
    display: none !important;
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
    white-space: nowrap;
}

.btn:active {
    transform: translateY(1px);
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-dark);
    box-shadow: 0 2px 8px rgba(39,174,96,0.35);
}

.btn-primary:disabled {
    background: #b2dfdb;
    color: #aaa;
    cursor: not-allowed;
}

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

.btn-secondary:hover {
    background: #c9d4df;
}

.btn-danger {
    background: #fde8e7;
    color: var(--team-b);
    border: 1px solid #f5b7b1;
}

.btn-danger:hover {
    background: #f5b7b1;
}

/* ===== Standings Table ===== */
.table-wrapper {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.standings-table {
    width: 100%;
    min-width: 540px;
    border-collapse: collapse;
}

.standings-table thead {
    background: var(--secondary);
    color: white;
}

.standings-table th {
    padding: 12px 14px;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
}

.standings-table th.col-name {
    text-align: left;
}

.standings-table td {
    padding: 12px 14px;
    text-align: center;
    border-bottom: 1px solid var(--border);
    font-size: 0.92rem;
}

.standings-table td.col-name {
    text-align: left;
    font-weight: 500;
}

.standings-table tbody tr:last-child td {
    border-bottom: none;
}

.standings-table tbody tr:hover {
    background: #f7fafd;
}

.standings-table tbody tr.rank-1 td { background: #fffde7; }
.standings-table tbody tr.rank-2 td { background: #fafafa; }
.standings-table tbody tr.rank-3 td { background: #fff8f0; }
.standings-table tbody tr.rank-1:hover td,
.standings-table tbody tr.rank-2:hover td,
.standings-table tbody tr.rank-3:hover td {
    filter: brightness(0.97);
}

.rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    font-size: 0.8rem;
    font-weight: 700;
}

.rank-1 .rank-badge { background: #f39c12; color: white; }
.rank-2 .rank-badge { background: #95a5a6; color: white; }
.rank-3 .rank-badge { background: #cd6133; color: white; }

.points-cell {
    font-weight: 700;
    font-size: 1rem;
    color: var(--primary-dark);
}

.saldo-cell { font-weight: 700; }
.saldo-pos { color: var(--primary-dark); }
.saldo-neg { color: var(--team-b); }

/* ===== Speeldag - Selection ===== */
.selection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}

.player-checkbox {
    position: relative;
    cursor: pointer;
}

.player-checkbox input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.player-checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: var(--card);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
    box-shadow: var(--shadow-sm);
    user-select: none;
}

.player-checkbox-label:hover {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.player-checkbox input:checked + .player-checkbox-label {
    border-color: var(--primary);
    background: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(39,174,96,0.15);
}

.checkbox-indicator {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: border-color var(--transition), background var(--transition);
    font-size: 0.75rem;
    color: white;
}

.player-checkbox input:checked + .player-checkbox-label .checkbox-indicator {
    background: var(--primary);
    border-color: var(--primary);
}

.checkbox-indicator::after {
    content: '';
}

.player-checkbox input:checked + .player-checkbox-label .checkbox-indicator::after {
    content: '✓';
}

.player-checkbox-name {
    font-weight: 500;
    font-size: 0.92rem;
    flex: 1;
}

.player-checkbox-pts {
    font-size: 0.78rem;
    color: var(--text-light);
    font-weight: 400;
}

.add-inline-form {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.add-inline-form .text-input {
    flex: 1;
}

.player-card-wrapper {
    position: relative;
}

.player-delete-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    padding: 2px 4px;
    border-radius: 4px;
    color: var(--text-light);
    opacity: 0;
    transition: opacity var(--transition), background var(--transition), color var(--transition);
    line-height: 1;
    z-index: 1;
}

.player-card-wrapper:hover .player-delete-btn {
    opacity: 1;
}

.player-delete-btn:hover {
    background: #fde8e7;
    color: var(--team-b);
}

.selection-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 8px;
}

.selection-count {
    font-size: 0.88rem;
    color: var(--text-light);
    font-weight: 500;
}

/* ===== Speeldag - Teams ===== */
.teams-container {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 16px;
    align-items: start;
    margin-bottom: 20px;
}

.team-card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.team-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.team-badge {
    font-weight: 700;
    font-size: 0.88rem;
    padding: 4px 10px;
    border-radius: 20px;
    letter-spacing: 0.3px;
}

.team-badge-a { background: var(--team-a); color: white; }
.team-badge-b { background: var(--team-b); color: white; }

.team-points {
    font-size: 0.8rem;
    color: var(--text-light);
    font-weight: 500;
}

.player-list {
    list-style: none;
    padding: 0;
}

.player-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 0;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background var(--transition);
    user-select: none;
}

.player-list-item:last-child {
    border-bottom: none;
}

.player-list-item:hover {
    background: #f5f8fb;
}

.player-list-item.selected-for-swap {
    background: #fff9c4;
    box-shadow: inset 3px 0 0 #f39c12;
}

.player-list-item .pli-name {
    font-weight: 500;
    font-size: 0.92rem;
}

.player-list-item .pli-pts {
    font-size: 0.78rem;
    color: var(--text-light);
}

.vs-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-light);
    padding-top: 40px;
}

.swap-hint {
    text-align: center;
    font-size: 0.85rem;
    color: var(--gold);
    background: #fffde7;
    border: 1px solid #f9e09a;
    border-radius: var(--radius-sm);
    padding: 8px 14px;
    margin-bottom: 16px;
}

/* ===== Speeldag - Result ===== */
.result-summary {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 20px;
    align-items: start;
    margin-bottom: 24px;
}

.result-team {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.result-player-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.result-player-list li {
    font-size: 0.88rem;
    color: var(--text);
    padding: 3px 0;
    border-bottom: 1px solid var(--border);
}

.result-player-list li:last-child {
    border-bottom: none;
}

.result-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
    justify-content: center;
    padding-top: 4px;
}

.result-option {
    cursor: pointer;
    width: 100%;
}

.result-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.result-label {
    display: block;
    text-align: center;
    padding: 11px 16px;
    background: var(--card);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color var(--transition), background var(--transition);
    box-shadow: var(--shadow-sm);
    white-space: nowrap;
}

.result-option input:checked + .result-label {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary-dark);
}

.swap-hint {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
}

.swap-hint-or {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #b08000;
}

.btn-move {
    background: var(--secondary);
    color: white;
    border: none;
    padding: 5px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background var(--transition);
}

.btn-move:hover {
    background: var(--secondary-light);
}

/* ===== Speeldag - Score invoer ===== */
.score-entry {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 8px 0;
}

.match-date-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.match-date-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-light);
}

.match-date-input {
    padding: 6px 10px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-family: inherit;
    color: var(--text);
    background: var(--card);
    cursor: pointer;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.match-date-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.score-entry-label {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-light);
}

.score-inputs {
    display: flex;
    align-items: center;
    gap: 10px;
}

.score-input {
    width: 64px;
    height: 64px;
    text-align: center;
    font-size: 1.8rem;
    font-weight: 700;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--card);
    color: var(--text);
    font-family: inherit;
    transition: border-color var(--transition), box-shadow var(--transition);
    -moz-appearance: textfield;
}

.score-input::-webkit-inner-spin-button,
.score-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
}

.score-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.score-divider {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-light);
}

.score-result-label {
    font-size: 0.9rem;
    font-weight: 700;
    padding: 5px 14px;
    border-radius: 20px;
    min-height: 28px;
}

.result-win-a {
    background: var(--team-a-light);
    color: var(--team-a);
}

.result-win-b {
    background: var(--team-b-light);
    color: var(--team-b);
}

.result-draw {
    background: #fef9e7;
    color: var(--gold);
}

/* ===== Speeldag - Done ===== */
.done-state {
    text-align: center;
    padding: 60px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

.done-icon {
    width: 70px;
    height: 70px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    box-shadow: 0 4px 16px rgba(39,174,96,0.35);
}

.done-state h2 {
    font-size: 1.4rem;
    color: var(--text);
}

.done-state p {
    color: var(--text-light);
    font-size: 0.95rem;
    max-width: 320px;
}

/* ===== Step Footer ===== */
.step-footer {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding-top: 4px;
}

/* ===== Deelnemers ===== */
.add-participant-form {
    display: flex;
    gap: 10px;
    margin-bottom: 24px;
}

.text-input {
    flex: 1;
    padding: 10px 14px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.92rem;
    font-family: inherit;
    background: var(--card);
    color: var(--text);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.text-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.participant-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.participant-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 16px;
    background: var(--card);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}

.participant-item-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.participant-item-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.participant-item-stats {
    font-size: 0.78rem;
    color: var(--text-light);
}

.participant-item-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px 8px;
    border-radius: 6px;
    font-size: 1rem;
    color: var(--text-light);
    transition: background var(--transition), color var(--transition);
}

.btn-icon:hover {
    background: #fde8e7;
    color: var(--team-b);
}

/* ===== Historie ===== */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.history-card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.history-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--secondary);
    color: white;
}

.history-date {
    font-size: 0.82rem;
    color: rgba(255,255,255,0.7);
}

.result-badge {
    font-size: 0.78rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
}

.result-badge-a { background: var(--team-a); color: white; }
.result-badge-b { background: var(--team-b); color: white; }
.result-badge-draw { background: var(--gold); color: white; }

.history-card-body {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 12px;
    padding: 14px 16px;
    align-items: start;
}

.history-team {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.history-team-title {
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 2px;
}

.history-team-a .history-team-title { color: var(--team-a); }
.history-team-b .history-team-title { color: var(--team-b); }

.history-team-players {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.history-team-players span {
    font-size: 0.83rem;
    color: var(--text);
}

.history-vs {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-light);
    padding-top: 6px;
}

/* ===== Historie - bewerk knop ===== */
.history-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.history-edit-btn {
    background: rgba(255,255,255,0.15);
    border: none;
    color: white;
    cursor: pointer;
    font-size: 1rem;
    padding: 3px 7px;
    border-radius: var(--radius-sm);
    line-height: 1;
    transition: background var(--transition);
}

.history-edit-btn:hover {
    background: rgba(255,255,255,0.30);
}

/* ===== Archief tabblad ===== */
.archive-season-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.archive-season-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 16px 20px;
    cursor: pointer;
    text-align: left;
    width: 100%;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.archive-season-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow);
}

.archive-season-card-main {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.archive-season-card-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.archive-season-meta {
    font-size: 0.82rem;
    color: var(--text-light);
}

.archive-season-arrow {
    font-size: 1.4rem;
    color: var(--text-light);
}

.archive-season-card {
    cursor: pointer;
}

.archive-season-edit-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    color: var(--text-light);
    padding: 4px 6px;
    border-radius: 6px;
    line-height: 1;
    transition: background var(--transition), color var(--transition);
}

.archive-season-edit-btn:hover {
    background: var(--bg);
    color: var(--primary);
}

.archive-detail-header {
    display: flex;
    align-items: center;
    gap: 14px;
}

.archive-detail-header h2 {
    margin: 0;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.82rem;
}

.archive-detail-section {
    margin-bottom: 28px;
}

.archive-detail-section-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 12px;
    padding-bottom: 6px;
    border-bottom: 2px solid var(--primary-light);
}

/* ===== Seizoensarchief (legacy) ===== */
.archive-season {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 16px;
}

.archive-season:last-child {
    margin-bottom: 0;
}

.archive-season-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    background: var(--secondary);
    color: white;
    flex-wrap: wrap;
}

.archive-season-label {
    font-family: 'Oswald', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.archive-season-date {
    font-size: 0.78rem;
    color: rgba(255,255,255,0.65);
}

/* ===== Modal ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 16px;
}

.modal-overlay.hidden {
    display: none;
}

.modal {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 420px;
    overflow: hidden;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--secondary);
    color: white;
}

.modal-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.4rem;
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
    opacity: 0.8;
    transition: opacity var(--transition);
}

.modal-close:hover { opacity: 1; }

.modal-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.modal-teams-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.modal-team {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.modal-player-list {
    list-style: none;
    padding: 0;
    margin-top: 4px;
}

.modal-player-item {
    padding: 7px 8px;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: background var(--transition);
    user-select: none;
}

.modal-player-item:last-child {
    border-bottom: none;
}

.modal-player-item:hover {
    background: #f5f8fb;
}

.modal-player-item.selected-for-swap {
    background: #fff9c4;
    box-shadow: inset 3px 0 0 #f39c12;
}

.modal-field {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.modal-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-light);
    align-self: flex-start;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 20px;
    border-top: 1px solid var(--border);
}

/* ===== Instellingen ===== */
.settings-card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    max-width: 560px;
}

.settings-card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text);
}

.settings-card-desc {
    font-size: 0.88rem;
    color: var(--text-light);
    margin-bottom: 20px;
    line-height: 1.6;
}

.settings-restart-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.settings-radio-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: border-color var(--transition), background var(--transition);
}

.settings-radio-label:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.settings-radio-label input[type="radio"] {
    margin-top: 3px;
    flex-shrink: 0;
    accent-color: var(--primary);
    width: 16px;
    height: 16px;
}

.settings-radio-label input[type="radio"]:checked ~ .settings-radio-text {
    color: var(--text);
}

.settings-radio-label:has(input:checked) {
    border-color: var(--primary);
    background: var(--primary-light);
}

.settings-radio-text {
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 0.9rem;
}

.settings-radio-text strong {
    font-weight: 600;
    color: var(--text);
}

.settings-radio-text span {
    font-size: 0.82rem;
    color: var(--text-light);
    line-height: 1.5;
}

.btn-danger {
    background: #DC2626;
    color: white;
    border: none;
    padding: 11px 24px;
    border-radius: var(--radius-sm);
    font-family: 'Oswald', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: background var(--transition), transform var(--transition);
}

.btn-danger:hover {
    background: #B91C1C;
    transform: translateY(-1px);
}

.btn-danger:active {
    transform: none;
}

.btn-danger:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
    opacity: 0.6;
}

/* ===== Confirm modal ===== */

.confirm-modal {
    max-width: 380px;
}

.confirm-modal-msg {
    margin: 0 0 20px;
    font-size: 0.97rem;
    line-height: 1.5;
    color: var(--text);
}

.confirm-modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* ===== Step visibility ===== */
.step {
    display: block;
}

.step.hidden {
    display: none !important;
}

/* ===== Responsive ===== */
@media (max-width: 620px) {
    /* Header */
    .header-inner {
        padding: 10px 12px 0;
        gap: 8px;
    }

    .header-logo {
        height: 34px;
    }

    .header-title h1 {
        font-size: 1.3rem;
    }

    .header-sub {
        display: none;
    }

    /* Nav — verspreid over volledige breedte */
    .main-nav {
        gap: 2px;
    }

    .nav-btn {
        flex: 1;
        text-align: center;
        padding: 8px 6px;
        font-size: 0.78rem;
        letter-spacing: 0.2px;
    }

    /* Main */
    main {
        padding: 16px 12px 60px;
    }

    /* Knoppen kleiner */
    .btn {
        padding: 9px 14px;
        font-size: 0.85rem;
    }

    /* Speeldag teams: team A links, team B rechts */
    .teams-container {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .vs-divider {
        display: none;
    }

    /* Uitslag: score bovenaan gecentreerd, teams eronder gelijke breedte */
    .result-summary {
        display: grid;
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto auto;
        gap: 12px;
    }

    .result-summary .score-entry {
        grid-column: 1 / -1;
        order: -1;
        align-self: center;
        margin: 0 auto;
    }

    .vs-divider,
    .history-vs {
        padding: 0;
        text-align: center;
    }

    /* Score invoer */
    .score-input {
        width: 56px;
        height: 56px;
        font-size: 1.6rem;
    }

    /* Selectiegrid */
    .selection-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 8px;
    }

    /* Inline toevoegformulier stapelen */
    .add-inline-form {
        flex-direction: column;
    }

    /* Historie: team A links, team B rechts */
    .history-card-body {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .history-vs {
        display: none;
    }

    /* Step footer */
    .step-footer {
        gap: 8px;
    }

    /* Selectie footer */
    .selection-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .selection-count {
        text-align: center;
    }
}
