/* =====================================================
   BowlingScore - Custom Styles
   Modern dark theme bowling score management
   ===================================================== */

:root {
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 70px;
    --topbar-height: 60px;
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --bowling-orange: #ff6b35;
    --bowling-blue: #004e89;
    --bowling-green: #00b894;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --card-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    --transition-speed: 0.3s;
}

/* ---- Typography ---- */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #0f1117;
    color: #e1e5ee;
    overflow-x: hidden;
}

/* =====================================================
   LIGHT THEME OVERRIDES
   ===================================================== */
[data-bs-theme="light"] {
    --glass-bg: rgba(0, 0, 0, 0.02);
    --glass-border: rgba(0, 0, 0, 0.1);
    --card-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.08);
}

[data-bs-theme="light"] body,
html[data-bs-theme="light"] body {
    background-color: #f0f2f5;
    color: #1a1a2e;
}

[data-bs-theme="light"] .sidebar {
    background: #ffffff;
    border-right-color: rgba(0, 0, 0, 0.08);
}

[data-bs-theme="light"] .sidebar-header {
    border-bottom-color: rgba(0, 0, 0, 0.08);
}

[data-bs-theme="light"] .sidebar-brand {
    color: #1a1a2e;
}

[data-bs-theme="light"] .sidebar-nav .nav-link {
    color: #5a6070;
}

[data-bs-theme="light"] .sidebar-nav .nav-link:hover {
    color: #1a1a2e;
    background: rgba(102, 126, 234, 0.06);
}

[data-bs-theme="light"] .sidebar-nav .nav-link.active {
    color: #667eea;
    background: rgba(102, 126, 234, 0.08);
}

[data-bs-theme="light"] .topbar {
    background: rgba(255, 255, 255, 0.9);
    border-bottom-color: rgba(0, 0, 0, 0.08);
}

[data-bs-theme="light"] .topbar-title {
    color: #1a1a2e;
}

[data-bs-theme="light"] .topbar-user {
    color: #1a1a2e;
}

[data-bs-theme="light"] .card {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.08);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
}

[data-bs-theme="light"] .card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

[data-bs-theme="light"] .card-header {
    border-bottom-color: rgba(0, 0, 0, 0.06);
}

[data-bs-theme="light"] .table {
    color: #1a1a2e;
}

[data-bs-theme="light"] .table thead th {
    background: rgba(102, 126, 234, 0.05);
    border-color: rgba(0, 0, 0, 0.06);
    color: #5a6070;
}

[data-bs-theme="light"] .table tbody td {
    border-color: rgba(0, 0, 0, 0.06);
}

[data-bs-theme="light"] .table-hover tbody tr:hover {
    background: rgba(102, 126, 234, 0.03);
}

[data-bs-theme="light"] .form-control,
[data-bs-theme="light"] .form-select {
    background: #ffffff;
    border-color: #d1d5db;
    color: #1a1a2e;
}

[data-bs-theme="light"] .form-control:focus,
[data-bs-theme="light"] .form-select:focus {
    background: #ffffff;
    color: #1a1a2e;
}

[data-bs-theme="light"] .form-label {
    color: #5a6070;
}

[data-bs-theme="light"] .footer {
    border-top-color: rgba(0, 0, 0, 0.06);
    background: rgba(255, 255, 255, 0.5);
}

[data-bs-theme="light"] .auth-page {
    background: #f0f2f5;
    background-image:
        radial-gradient(ellipse at 20% 50%, rgba(102, 126, 234, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 50%, rgba(118, 75, 162, 0.08) 0%, transparent 50%);
}

[data-bs-theme="light"] .auth-card {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.08);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.1);
}

[data-bs-theme="light"] .highlight-card {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.08);
}

[data-bs-theme="light"] .dataTables_wrapper .dataTables_filter input,
[data-bs-theme="light"] .dataTables_wrapper .dataTables_length select {
    background: #ffffff;
    border-color: #d1d5db;
    color: #1a1a2e;
}

[data-bs-theme="light"] .dataTables_wrapper .dataTables_info,
[data-bs-theme="light"] .dataTables_wrapper .dataTables_length label,
[data-bs-theme="light"] .dataTables_wrapper .dataTables_filter label {
    color: #5a6070;
}

[data-bs-theme="light"] .btn-outline-light {
    color: #5a6070;
    border-color: #c5cad3;
    background: transparent;
}

[data-bs-theme="light"] .btn-outline-light:hover {
    color: #1a1a2e;
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.06);
}

[data-bs-theme="light"] .btn-outline-danger {
    color: #dc3545;
    border-color: #dc3545;
}

[data-bs-theme="light"] .breadcrumb-item a {
    color: #667eea;
}

[data-bs-theme="light"] ::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
}

[data-bs-theme="light"] ::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.25);
}

/* Theme toggle button */
.theme-toggle {
    background: none;
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #8892a4;
}

.theme-toggle:hover {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    border-color: #667eea;
}

[data-bs-theme="light"] .theme-toggle {
    color: #5a6070;
    border-color: #d1d5db;
}

[data-bs-theme="light"] .theme-toggle:hover {
    color: #667eea;
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.06);
}

/* ---- Auth Page ---- */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0f1117;
    background-image:
        radial-gradient(ellipse at 20% 50%, rgba(102, 126, 234, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 50%, rgba(118, 75, 162, 0.15) 0%, transparent 50%);
}

.auth-container {
    width: 100%;
    max-width: 440px;
    padding: 1rem;
}

.auth-card {
    background: rgba(30, 33, 43, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 1rem;
    padding: 2.5rem;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
}

.auth-logo i {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ---- App Layout ---- */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

/* ---- Sidebar ---- */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    max-height: 100vh;
    background: rgba(18, 20, 28, 0.98);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--glass-border);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1050;
    display: flex;
    flex-direction: column;
    transition: transform var(--transition-speed) ease;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--glass-border);
    height: var(--topbar-height);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: #fff;
    font-weight: 700;
    font-size: 1.15rem;
}

.sidebar-brand i {
    font-size: 1.5rem;
}

.sidebar-nav {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 0.75rem 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

.sidebar-nav::-webkit-scrollbar {
    width: 6px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

.sidebar-nav .nav-header {
    padding: 1rem 1.25rem 0.4rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #6c757d;
    list-style: none;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1.25rem;
    color: #8892a4;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 0;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.sidebar-nav .nav-link:hover {
    color: #e1e5ee;
    background: rgba(255, 255, 255, 0.05);
}

.sidebar-nav .nav-link.active {
    color: #667eea;
    background: rgba(102, 126, 234, 0.1);
    border-left-color: #667eea;
}

.sidebar-nav .nav-link i {
    font-size: 1.1rem;
    width: 1.5rem;
    text-align: center;
}

.sidebar-toggle {
    color: #8892a4;
    text-decoration: none;
    padding: 0;
}

/* ---- Main Content ---- */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    transition: margin-left var(--transition-speed) ease;
}

/* ---- Topbar ---- */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    height: var(--topbar-height);
    background: rgba(18, 20, 28, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 1040;
    gap: 0.5rem;
}

@media (max-width: 575.98px) {
    .topbar {
        padding: 0 0.75rem;
    }
}

.topbar-title {
    color: #e1e5ee;
    min-width: 0;
}

/* Score-verloop chart: vaste hoogte zodat hij ook op mobiel
   leesbaar blijft (maintainAspectRatio staat uit). */
.score-trend-wrapper {
    position: relative;
    width: 100%;
    height: 320px;
}

@media (max-width: 575.98px) {
    .score-trend-wrapper {
        height: 260px;
    }
}

/* Compacte highlight-tabellen (dashboard) — op mobiel iets kleiner
   lettertype en strakkere padding zodat een volledig record op één
   regel past. */
.highlights-table th,
.highlights-table td {
    padding-top: 0.4rem;
    padding-bottom: 0.4rem;
}
.highlights-table .nowrap,
th.nowrap,
td.nowrap {
    white-space: nowrap;
}
@media (max-width: 575.98px) {
    .highlights-table {
        font-size: 0.85rem;
    }
    .highlights-table th,
    .highlights-table td {
        padding-left: 0.4rem;
        padding-right: 0.4rem;
    }
}

/* Mijlpaal-kaarten op de Hoogtepunten-pagina: op xs een kleinere
   cijfer-hoogte zodat 4 kaarten (2×2) niet onnodig scroll vragen. */
@media (max-width: 575.98px) {
    .milestone-card .card-body {
        padding: 0.75rem 0.5rem;
    }
    .milestone-card .h3 {
        font-size: 1.35rem;
    }
    .milestone-card .text-uppercase {
        font-size: 0.7rem;
    }
}

/* Card-headers met lange titels op de Hoogtepunten-pagina:
   op smalle schermen mag de titel wrappen i.p.v. overflowen. */
@media (max-width: 767.98px) {
    .card-header h6 {
        font-size: 0.95rem;
        line-height: 1.3;
    }
}

.topbar-toggle {
    color: #8892a4;
    text-decoration: none;
    padding: 0;
}

.topbar-user {
    color: #e1e5ee;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0;
}

.user-avatar i {
    font-size: 1.5rem;
}

/* Topbar-dropdowns mobiel-vriendelijk: binnen viewport houden + woorden wrappen */
.topbar .dropdown-menu {
    max-width: calc(100vw - 1rem) !important;
    max-height: calc(100vh - var(--topbar-height) - 1rem);
    overflow-y: auto;
    overflow-x: hidden;
}
.topbar .dropdown-menu .dropdown-item {
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
}
.topbar .dropdown-menu .profile-switch-item {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}
@media (max-width: 575.98px) {
    .topbar .dropdown-menu {
        width: calc(100vw - 1rem) !important;
        min-width: 0 !important;
    }
}

/* ---- Cards ---- */
.card {
    background: rgba(30, 33, 43, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 0.75rem;
    box-shadow: var(--card-shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.75rem 1.5rem rgba(0, 0, 0, 0.25);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--glass-border);
    font-weight: 600;
}

/* ---- Stat Cards ---- */
.stat-card {
    position: relative;
    overflow: hidden;
}

.stat-card .stat-icon {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 2.5rem;
    opacity: 0.15;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-card .stat-label {
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #8892a4;
    margin-top: 0.25rem;
}

.stat-card .stat-change {
    font-size: 0.75rem;
    margin-top: 0.5rem;
}

.stat-card .stat-change.positive {
    color: var(--bowling-green);
}

.stat-card .stat-change.negative {
    color: #e74c3c;
}

/* ---- Score specific ---- */
.score-200 {
    color: var(--bowling-green);
    font-weight: 700;
}

.score-250 {
    color: var(--bowling-orange);
    font-weight: 700;
}

.score-300 {
    color: #ffd700;
    font-weight: 700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

/* ---- Tables ---- */
.table {
    color: #e1e5ee;
}

.table thead th {
    background: rgba(102, 126, 234, 0.1);
    border-color: var(--glass-border);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #8892a4;
}

.table tbody td {
    border-color: var(--glass-border);
    vertical-align: middle;
}

.table-hover tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

/* DataTables overrides */
.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
    background: rgba(30, 33, 43, 0.8);
    border: 1px solid var(--glass-border);
    color: #e1e5ee;
    border-radius: 0.5rem;
    padding: 0.4rem 0.75rem;
}

.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_length label,
.dataTables_wrapper .dataTables_filter label {
    color: #8892a4;
    font-size: 0.85rem;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    color: #8892a4 !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: rgba(102, 126, 234, 0.2) !important;
    border-color: #667eea !important;
    color: #667eea !important;
}

/* ---- Badges ---- */
.badge {
    font-weight: 500;
    letter-spacing: 0.02em;
}

/* ---- Buttons ---- */
.btn-primary {
    background: var(--primary-gradient);
    border: none;
    font-weight: 500;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5a6fd6 0%, #6a4295 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.35);
}

.btn-glow {
    position: relative;
    overflow: hidden;
}

.btn-glow::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, transparent 60%);
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.5s ease;
}

.btn-glow:hover::after {
    transform: translate(-50%, -50%) scale(1);
}

/* ---- Forms ---- */
.form-control,
.form-select {
    background: rgba(30, 33, 43, 0.8);
    border: 1px solid var(--glass-border);
    color: #e1e5ee;
    border-radius: 0.5rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus,
.form-select:focus {
    background: rgba(30, 33, 43, 0.95);
    border-color: #667eea;
    color: #e1e5ee;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.form-label {
    font-weight: 500;
    font-size: 0.875rem;
    color: #8892a4;
}

/* ---- Highlights / Achievement Cards ---- */
.highlight-card {
    background: rgba(30, 33, 43, 0.8);
    border: 1px solid var(--glass-border);
    border-radius: 0.75rem;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
}

.highlight-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3);
}

.highlight-card.perfect-game {
    border-color: rgba(255, 215, 0, 0.3);
    background: rgba(255, 215, 0, 0.05);
}

.highlight-card .highlight-score {
    font-size: 2.5rem;
    font-weight: 800;
}

/* ---- Animated Counter ---- */
.counter-animate {
    transition: all 0.5s ease;
}

/* ---- Chart containers ---- */
.chart-container {
    position: relative;
    padding: 1rem;
}

/* ---- CSV Import Wizard ---- */
.import-wizard .step {
    display: none;
}

.import-wizard .step.active {
    display: block;
}

.import-steps {
    display: flex;
    justify-content: center;
    gap: 0;
    margin-bottom: 2rem;
}

.import-steps .step-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: #6c757d;
    position: relative;
}

.import-steps .step-indicator.active {
    color: #667eea;
}

.import-steps .step-indicator.completed {
    color: var(--bowling-green);
}

.import-steps .step-indicator .step-number {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(108, 117, 125, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
}

.import-steps .step-indicator.active .step-number {
    background: var(--primary-gradient);
    color: #fff;
}

.import-steps .step-indicator.completed .step-number {
    background: var(--bowling-green);
    color: #fff;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ---- Page Content (scrollable between topbar and footer) ---- */
.main-content > main {
    flex: 1;
    overflow-y: auto;
}

/* ---- Footer ---- */
.footer {
    border-top: 1px solid var(--glass-border);
    background: rgba(18, 20, 28, 0.5);
    position: sticky;
    bottom: 0;
    z-index: 1040;
}

/* ---- Animations ---- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.5s ease forwards;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.slide-in-left {
    animation: slideInLeft 0.3s ease forwards;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.pulse {
    animation: pulse 2s ease-in-out infinite;
}

/* ---- Nearest match day highlight ---- */
.table tbody tr.next-matchday > td {
    background: rgba(102, 126, 234, 0.15);
    border-color: rgba(102, 126, 234, 0.25);
}

[data-bs-theme="light"] .table tbody tr.next-matchday > td {
    background: rgba(102, 126, 234, 0.10);
    border-color: rgba(102, 126, 234, 0.15);
}

/* ---- Responsive ---- */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1040;
        display: none;
    }

    .sidebar-overlay.show {
        display: block;
    }
}

@media (max-width: 575.98px) {
    .auth-card {
        padding: 1.5rem;
    }

    .stat-card .stat-value {
        font-size: 1.5rem;
    }
}

/* =============================================================
   Scoresheet: sticky player-name column on mobile so the player
   name stays visible while horizontally scrolling game scores.
   Desktop keeps the normal table-responsive behaviour.
   ============================================================= */
@media (max-width: 767.98px) {
    .scoresheet-table {
        font-size: 0.75rem !important;
    }

    /* 4th column = "Naam" in the data rows and header */
    .scoresheet-table thead tr th:nth-child(4),
    .scoresheet-table tbody tr td:nth-child(4):not([colspan]) {
        position: sticky;
        left: 0;
        z-index: 2;
        background-color: var(--bs-body-bg);
        box-shadow: 2px 0 4px rgba(0, 0, 0, 0.12);
    }

    /* Header row sits above body row when both are sticky */
    .scoresheet-table thead tr th:nth-child(4) {
        z-index: 3;
    }

    /* Team header rows span the full table via colspan — don't stickify them
       and preserve their original background for visual grouping */
    .scoresheet-table tbody tr td[colspan] {
        position: static;
        box-shadow: none;
    }
}

/* =====================================================
   Scoresheet cell coloring — theme-aware
   Dark mode (default) uses saturated tints against dark bg
   Light mode overrides via [data-bs-theme="light"]
   ===================================================== */
/* Blind: diagonale streep-patroon i.p.v. kleurvlak — visueel onderscheid
   werkt ook voor kleurenblinden (kleur + patroon = dubbele indicatie) */
.scoresheet-table .ss-blind {
    background-color: rgba(100, 116, 139, 0.35) !important;
    background-image: repeating-linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.18) 0,
        rgba(255, 255, 255, 0.18) 4px,
        transparent 4px,
        transparent 10px
    ) !important;
    color: #ffffff !important;
    font-style: italic;
}
.scoresheet-table .ss-empty       { background-color: rgba(120, 140, 150, 0.18) !important; color: var(--bs-body-color); }
/* Win: fel groen/cyaan-achtig — Okabe-Ito kleurenblind-veilig groen */
.scoresheet-table .ss-win         { background-color: rgba(0, 180, 120, 0.75) !important; color: #ffffff; font-weight: 700; }
/* Tie: fel oranje i.p.v. geel — beter onderscheidend van groen voor
   rood-groen kleurenblinden (deuteranopie/protanopie) */
.scoresheet-table .ss-tie         { background-color: rgba(230, 126, 34, 0.75) !important; color: #ffffff; font-weight: 600; }
/* High score 200+: fel magenta-paars — staat los van alle andere kleuren */
.scoresheet-table .ss-high        { background-color: rgba(200, 70, 180, 0.80) !important; color: #ffffff; font-weight: bold; }
.scoresheet-table .ss-team-header   > td { background-color: rgba(255, 255, 255, 0.06); }
.scoresheet-table .ss-team-totals   > td { background-color: rgba(255, 255, 255, 0.10); font-weight: bold; }
.scoresheet-table .ss-series-totals > td { background-color: rgba(13, 110, 253, 0.18); font-weight: bold; }
.scoresheet-table .ss-lane-separator {
    height: 6px;
    background: var(--bs-border-color);
    padding: 0;
    border: none;
}

/* Light-mode overrides — use the original soft pastels */
[data-bs-theme="light"] .scoresheet-table .ss-blind       { background-color: #edd9b7 !important; color: #212529; }
[data-bs-theme="light"] .scoresheet-table .ss-empty       { background-color: #dff3f5 !important; color: #212529; }
[data-bs-theme="light"] .scoresheet-table .ss-win         { background-color: #d4edda !important; color: #212529; }
[data-bs-theme="light"] .scoresheet-table .ss-tie         { background-color: #fff3cd !important; color: #212529; }
[data-bs-theme="light"] .scoresheet-table .ss-high        { background-color: #e7c6ef !important; color: #212529; font-weight: bold; }
[data-bs-theme="light"] .scoresheet-table .ss-team-header   > td { background-color: #f0f0f0; color: #212529; }
[data-bs-theme="light"] .scoresheet-table .ss-team-totals   > td { background-color: #e0e0e0; color: #212529; font-weight: bold; }
[data-bs-theme="light"] .scoresheet-table .ss-series-totals > td { background-color: #f5f5f5; color: #212529; font-weight: bold; }
[data-bs-theme="light"] .scoresheet-table .ss-lane-separator { background: #4a4a4a; }

/* =====================================================
   Rank-medailles (goud / zilver / brons) voor top-3 in
   dashboard-tabellen (gemiddelde per baan, per game, etc.)
   ===================================================== */
.badge.rank-gold {
    background: linear-gradient(135deg, #ffd700 0%, #d4a017 100%) !important;
    color: #3d2e00 !important;
    font-weight: 700;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}
.badge.rank-silver {
    background: linear-gradient(135deg, #e0e0e0 0%, #a0a0a0 100%) !important;
    color: #2c2c2c !important;
    font-weight: 700;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}
.badge.rank-bronze {
    background: linear-gradient(135deg, #cd7f32 0%, #8a5120 100%) !important;
    color: #ffffff !important;
    font-weight: 700;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25);
}
/* Overige rijen: outline-stijl — duidelijk anders dan de zilveren medaille */
.badge.rank-other {
    background: transparent !important;
    color: var(--bs-body-color) !important;
    font-weight: 500;
    box-shadow: inset 0 0 0 1px rgba(128, 128, 128, 0.55);
    opacity: 0.75;
}
[data-bs-theme="light"] .badge.rank-other {
    color: #495057 !important;
    box-shadow: inset 0 0 0 1px rgba(73, 80, 87, 0.45);
}

/* ===== Oliepatroon-kaart op dashboard ===== */
.oil-pattern-card {
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.08), rgba(220, 38, 38, 0.06));
    border-left: 4px solid #0d6efd !important;
}
[data-bs-theme="dark"] .oil-pattern-card {
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.18), rgba(220, 38, 38, 0.12));
}
.oil-pattern-card .oil-pattern-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0d6efd, #0a58ca);
    color: #fff;
    font-size: 1.4rem;
    flex-shrink: 0;
}

/* ===== Oliepatroon thumbnails ===== */
.oil-pattern-thumb-sm {
    /* Originele Kegel-images zijn portrait (160x588). Behoud de natuurlijke
       verhouding met object-fit: contain zodat het hele patroon zichtbaar
       blijft i.p.v. te croppen op een 56x32 box. */
    width: auto;
    max-width: 40px;
    height: auto;
    max-height: 96px;
    object-fit: contain;
    border-radius: 4px;
    background: #f8f9fa;
}
.oil-pattern-thumb-md {
    width: 140px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    background: #f8f9fa;
}
.oil-pattern-thumb-link {
    display: inline-block;
    transition: transform 0.15s;
}
.oil-pattern-thumb-link:hover {
    transform: scale(1.04);
}
.oil-pattern-detail .img-fluid {
    max-height: 480px;
    object-fit: contain;
}

/* ===== Oliepatroon lightbox / zoom ===== */
.oil-pattern-zoom-btn {
    position: relative;
    display: block;
    width: 100%;
    cursor: zoom-in;
    overflow: hidden;
    border-radius: 0.5rem;
    transition: filter 0.15s;
}
.oil-pattern-zoom-btn:hover .oil-pattern-zoomable {
    filter: brightness(0.92);
}
.oil-pattern-zoom-btn:hover .oil-pattern-zoom-hint {
    opacity: 1;
    transform: translateY(0);
}
.oil-pattern-zoom-btn:focus-visible {
    outline: 3px solid var(--bs-primary, #0d6efd);
    outline-offset: 2px;
}
.oil-pattern-zoomable {
    cursor: zoom-in;
    display: block;
}
.oil-pattern-zoom-hint {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 0.18s, transform 0.18s;
    pointer-events: none;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

/* Lightbox modal: zwarte achtergrond, image gecentreerd */
.oil-pattern-lightbox-modal .modal-content {
    background: #000;
}
.oil-pattern-lightbox-modal .modal-body {
    min-height: 60vh;
}
.oil-pattern-lightbox-modal img {
    user-select: none;
    -webkit-user-drag: none;
}

/* ===== Oliepatroon-logo (Kegel-branding) op detail-pagina ===== */
.oil-pattern-logo {
    height: 48px;
    width: auto;
    max-width: 120px;
    object-fit: contain;
    background: transparent;
}

/* ===== Oil-pattern detail tabs ===== */
.oil-pattern-tabs-content {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}
.oil-pattern-tabs-content #oil-pattern-composite {
    max-width: 100%;
}

/* ===== Demo-omgeving banner ===== */
.demo-banner {
    position: sticky;
    top: 0;
    z-index: 1040;
    background: linear-gradient(90deg, #f59e0b 0%, #facc15 50%, #f59e0b 100%);
    background-size: 200% 100%;
    color: #1a0a00;
    font-weight: 600;
    font-size: 0.92rem;
    padding: 0.55rem 0;
    text-align: center;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
    animation: demo-banner-shimmer 14s linear infinite;
}
.demo-banner i { color: #1a0a00; }
.demo-banner strong { color: #1a0a00; letter-spacing: 0.04em; }
.demo-banner a {
    color: #1a0a00;
    text-decoration: underline;
    font-weight: 700;
}
.demo-banner a:hover { color: #000; }
@keyframes demo-banner-shimmer {
    0%   { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}
@media (max-width: 575.98px) {
    .demo-banner { font-size: 0.82rem; padding: 0.45rem 0.75rem; }
}
