:root {
    --bg: #f4f7fb;
    --panel: #ffffff;
    --border: #e7ecf3;
    --text-soft: #667085;
    --shadow: 0 12px 32px rgba(16, 24, 40, 0.08);
    --app-page-bg:
        radial-gradient(circle at top left, rgba(var(--club-primary-rgb, 75, 107, 251), .17), transparent 35rem),
        radial-gradient(circle at 85% 15%, rgba(var(--club-secondary-rgb, 34, 197, 94), .14), transparent 28rem),
        linear-gradient(135deg, #f8fafc 0%, #eef4ff 48%, #fff7ed 100%);
    --app-page-bg-dark:
        radial-gradient(circle at top left, rgba(var(--club-primary-rgb, 75, 107, 251), .22), transparent 35rem),
        radial-gradient(circle at 85% 15%, rgba(var(--club-secondary-rgb, 34, 197, 94), .18), transparent 28rem),
        linear-gradient(135deg, #020617 0%, #0f172a 55%, #111827 100%);
}

body:not(.login-page) {
    --bs-primary: var(--club-primary);
    --bs-primary-rgb: var(--club-primary-rgb);
    --bs-link-color: var(--club-primary);
    --bs-link-hover-color: var(--club-primary-deep);
    background: var(--app-page-bg);
    color: #101828;
    -webkit-tap-highlight-color: transparent;
}

.app-shell {
    max-width: none;
}

.hero-card,
.toolbar-card,
.panel-card {
    background:
        linear-gradient(90deg, var(--club-primary) 0%, var(--club-secondary) 100%) top left / 100% var(--app-card-accent-height, 4px) no-repeat,
        var(--panel);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.hero-card {
    position: relative;
    overflow: hidden;
    background:
        linear-gradient(90deg, var(--club-primary) 0%, var(--club-secondary) 100%) top left / 100% var(--app-card-accent-height, 4px) no-repeat,
        linear-gradient(135deg, rgba(var(--club-primary-rgb), 0.12), rgba(var(--club-secondary-rgb), 0.08)),
        var(--panel);
}

.hero-card::before,
.panel-card::before,
.toolbar-card::before {
    content: "";
    position: absolute;
    inset: -1px;
    z-index: 2;
    border-radius: inherit;
    background:
        linear-gradient(90deg, var(--club-primary) 0%, var(--club-secondary) 100%)
        top left / 100% calc(var(--app-card-accent-height, 4px) + 1px) no-repeat;
    pointer-events: none;
}

.panel-card,
.toolbar-card {
    position: relative;
    overflow: hidden;
}

.live-toolbar-card {
    overflow: visible;
}

.live-toolbar-card .dropdown {
    position: relative;
}

.live-toolbar-card .dropdown-menu {
    z-index: 1100;
}

#actionTypeList {
    max-height: min(50vh, 18rem);
    overflow-y: auto;
    padding-right: .2rem;
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: .08em;
    font-size: .75rem;
    color: var(--club-primary-deep);
    font-weight: 700;
    margin-bottom: .35rem;
}

.panel-title {
    font-size: 1.15rem;
    font-weight: 700;
}

body:not(.login-page) .btn-primary {
    --bs-btn-bg: var(--club-primary) !important;
    --bs-btn-border-color: var(--club-primary) !important;
    --bs-btn-color: var(--club-primary-contrast) !important;
    --bs-btn-hover-bg: var(--club-primary-deep) !important;
    --bs-btn-hover-border-color: var(--club-primary-deep) !important;
    --bs-btn-hover-color: var(--club-primary-contrast) !important;
    --bs-btn-focus-shadow-rgb: var(--club-primary-rgb) !important;
    --bs-btn-active-bg: var(--club-primary-deep) !important;
    --bs-btn-active-border-color: var(--club-primary-deep) !important;
    --bs-btn-active-color: var(--club-primary-contrast) !important;
    --bs-btn-disabled-bg: var(--club-primary) !important;
    --bs-btn-disabled-border-color: var(--club-primary) !important;
    --bs-btn-disabled-color: var(--club-primary-contrast) !important;
    background: var(--club-primary) !important;
    border-color: var(--club-primary) !important;
    color: var(--club-primary-contrast) !important;
}

body:not(.login-page) .btn-primary:hover,
body:not(.login-page) .btn-primary:focus,
body:not(.login-page) .btn-primary:active,
body:not(.login-page) .btn-primary.active,
body:not(.login-page) .show > .btn-primary.dropdown-toggle {
    background: var(--club-primary-deep) !important;
    border-color: var(--club-primary-deep) !important;
    color: var(--club-primary-contrast) !important;
}

body:not(.login-page) .btn-primary:focus,
body:not(.login-page) .btn-primary:focus-visible {
    box-shadow: 0 0 0 .25rem rgba(var(--club-primary-rgb), 0.25) !important;
}

body:not(.login-page) .btn-primary:disabled,
body:not(.login-page) .btn-primary.disabled {
    background: var(--club-primary) !important;
    border-color: var(--club-primary) !important;
    color: var(--club-primary-contrast) !important;
    opacity: .65;
}

body:not(.login-page) .btn-outline-primary {
    --bs-btn-color: var(--club-primary) !important;
    --bs-btn-border-color: rgba(var(--club-primary-rgb), 0.45) !important;
    --bs-btn-hover-bg: var(--club-primary) !important;
    --bs-btn-hover-border-color: var(--club-primary) !important;
    --bs-btn-hover-color: var(--club-primary-contrast) !important;
    --bs-btn-focus-shadow-rgb: var(--club-primary-rgb) !important;
    --bs-btn-active-bg: var(--club-primary) !important;
    --bs-btn-active-border-color: var(--club-primary) !important;
    --bs-btn-active-color: var(--club-primary-contrast) !important;
    color: var(--club-primary) !important;
    border-color: rgba(var(--club-primary-rgb), 0.45) !important;
}

body:not(.login-page) .btn-outline-primary:hover,
body:not(.login-page) .btn-outline-primary:focus,
body:not(.login-page) .btn-outline-primary:active,
body:not(.login-page) .btn-outline-primary.active,
body:not(.login-page) .btn-check:checked + .btn-outline-primary,
body:not(.login-page) .show > .btn-outline-primary.dropdown-toggle {
    background: var(--club-primary) !important;
    border-color: var(--club-primary) !important;
    color: var(--club-primary-contrast) !important;
}

body:not(.login-page) .btn-outline-primary:focus,
body:not(.login-page) .btn-outline-primary:focus-visible {
    box-shadow: 0 0 0 .25rem rgba(var(--club-primary-rgb), 0.22) !important;
}

.badge.text-bg-primary {
    background: linear-gradient(135deg, var(--club-primary), var(--club-secondary)) !important;
    color: var(--club-primary-contrast) !important;
}

.table-light {
    --bs-table-bg: rgba(var(--club-primary-rgb), 0.08);
    --bs-table-color: #101828;
    --bs-table-border-color: rgba(var(--club-primary-rgb), 0.14);
}

.form-control:focus,
.form-select:focus {
    border-color: rgba(var(--club-primary-rgb), 0.55);
    box-shadow: 0 0 0 .25rem rgba(var(--club-primary-rgb), 0.18);
}

.panel-subtitle {
    color: var(--text-soft);
    font-size: .92rem;
}

.scoreboard {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: .55rem;
    align-items: center;
    min-height: 150px;
    background: linear-gradient(135deg, #0f172a 0%, #1d2939 100%);
    border-radius: 20px;
    padding: .75rem .9rem;
    color: white;
}


.score-team {
    text-align: center;
}

.team-chip {
    display: inline-block;
    background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.15);
    padding: .3rem .6rem;
    border-radius: 999px;
    font-weight: 700;
    font-size: .9rem;
}


.team-chip.alt {
    background: rgba(255,255,255,.06);
}

.set-wins {
    color: rgba(255,255,255,.72);
    margin: .45rem 0 .25rem;
    font-size: .85rem;
}


.display-score {
    font-size: clamp(2rem, 4vw, 2.8rem);
    line-height: 1;
    font-weight: 800;
    margin-bottom: .5rem;
}


.score-separator {
    font-size: 1.5rem;
    font-weight: 700;
    opacity: .55;
}


.score-btn {
    min-width: 96px;
}


.touch-btn {
    min-height: 48px;
}

.touch-score-btn {
    min-height: 48px;
    min-width: 108px;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 14px;
}


.info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: .6rem;
}


.info-item {
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: .65rem .75rem;
    background: linear-gradient(180deg, rgba(var(--club-primary-rgb), 0.06), #fafcff);
    display: flex;
    flex-direction: column;
    gap: .2rem;
}


.info-item span {
    color: var(--text-soft);
    font-size: .85rem;
}

.court {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, 120px);
    gap: 10px;
    background: linear-gradient(180deg, #fef0c7, #f9d7a7);
    border: 3px solid #b7791f;
    border-radius: 20px;
    padding: 12px;
}


.court-pos {
    background: rgba(255,255,255,.88);
    border: 2px dashed #d19a4a;
    border-radius: 16px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}


.pos-label {
    font-size: .78rem;
    color: #8b5e1a;
    font-weight: 700;
}


.player-name {
    font-size: .92rem;
    font-weight: 700;
}


.player-action-card {
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 1rem;
    background: linear-gradient(180deg, #fff, #fbfcfe);
    cursor: grab;
}

.player-action-card .btn {
    min-height: 48px;
    border-radius: 14px;
    font-weight: 600;
}

.player-action-voice-wrap {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: .5rem;
}

.voice-action-command {
    width: min(32rem, 100%);
}

.voice-action-status {
    max-width: 28rem;
    border: 1px solid rgba(15, 23, 42, .12);
    border-radius: 999px;
    padding: .35rem .75rem;
    background: rgba(248, 250, 252, .78);
    color: #475569;
}

.voice-action-status.listening {
    border-color: rgba(var(--club-primary-rgb, 37, 99, 235), .45);
    background: rgba(var(--club-primary-rgb, 37, 99, 235), .12);
    color: var(--club-primary-deep, #1d4ed8);
}

.voice-action-status.success {
    border-color: rgba(22, 163, 74, .32);
    background: rgba(22, 163, 74, .12);
    color: #166534;
}

.voice-action-status.error {
    border-color: rgba(220, 38, 38, .32);
    background: rgba(220, 38, 38, .12);
    color: #991b1b;
}


.player-action-name {
    font-size: 1rem;
}

.action-row-list {
    display: grid;
    gap: .75rem;
}

.action-row-list-two-rows {
    gap: .85rem;
}

.action-group-row {
    display: grid;
    grid-template-columns: repeat(var(--row-count, 2), minmax(0, 1fr));
    gap: .75rem;
    align-items: stretch;
}

.action-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: .75rem;
    align-items: stretch;
    padding: .8rem;
    border: 1px solid rgba(15, 23, 42, .08);
    border-radius: 16px;
    background: #fff;
    min-height: 100%;
}

.action-label {
    font-size: .98rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
}

.action-buttons {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .75rem;
}

.action-btn {
    min-height: 58px;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: .01em;
    transition: background-color .18s ease, border-color .18s ease, color .18s ease, box-shadow .18s ease, transform .18s ease;
}

@keyframes actionButtonPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(200, 128, 48, 0.42);
    }
    100% {
        box-shadow: 0 0 0 .55rem rgba(200, 128, 48, 0);
    }
}

.action-btn-flash,
.action-btn-flash:hover,
.action-btn-flash:focus,
.action-btn-flash:disabled,
.action-btn-flash:active {
    background: #C88030 !important;
    border-color: #C88030 !important;
    color: #fff !important;
    box-shadow: 0 0 0 .28rem rgba(200, 128, 48, .34), 0 14px 28px rgba(200, 128, 48, .22);
    transform: translateY(-1px) scale(.985);
    animation: actionButtonPulse 1s ease-out 1;
}


.player-stats-sortable {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .9rem;
    align-items: start;
}

.player-action-card {
    box-shadow: 0 8px 20px rgba(15, 23, 42, .06);
}

.player-action-card.dragging {
    opacity: .6;
    transform: scale(.985);
}

.player-action-card.drag-over {
    outline: 2px dashed #94a3b8;
    outline-offset: 2px;
}

.player-action-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .75rem;
    margin-bottom: .9rem;
}

.player-card-tools {
    display: flex;
    align-items: center;
    gap: .45rem;
    flex-wrap: wrap;
}

.player-card-meta {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
}

.player-card-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    min-width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid rgba(15, 23, 42, .12);
    border-radius: 12px;
    background: #fff;
    color: var(--text-soft);
    font-size: 1rem;
    line-height: 1;
    transition: background-color .2s ease, border-color .2s ease, color .2s ease, transform .2s ease;
}

.player-card-icon-btn:hover:not(:disabled),
.player-card-icon-btn:focus-visible:not(:disabled) {
    background: #eef2ff;
    border-color: rgba(67, 56, 202, .25);
    color: #3730a3;
    transform: translateY(-1px);
}

.player-card-icon-btn:disabled {
    opacity: .62;
    cursor: not-allowed;
}

.player-card-move-btn,
.player-card-drag {
    border: 1px solid rgba(15, 23, 42, .12);
    background: #fff;
    color: var(--text-soft);
    border-radius: 12px;
    min-width: 42px;
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.player-card-drag {
    cursor: grab;
    padding: 0 .8rem;
    touch-action: none;
    user-select: none;
}

.player-card-drag:active {
    cursor: grabbing;
}

.player-action-card:active {
    cursor: grabbing;
}

.event-person-tile {
    background: #f8fafc;
    border-color: #d0d5dd !important;
    color: #101828;
    min-height: 52px;
    display: flex;
    align-items: center;
}

.event-person-tile .form-check-input {
    flex: 0 0 auto;
}

.event-person-tile span {
    color: inherit;
}

.player-position-badge {
    background: #eef2ff;
    color: #3730a3;
    font-weight: 700;
}

.libero-card {
    border: 2px solid #f59e0b;
    background: #fff7ed;
}

.libero-card .player-action-name {
    color: #9a3412;
}

.action-row {
    border-width: 0;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.55);
}

.action-tone-service_pass {
    background: linear-gradient(180deg, #dbeafe, #eff6ff);
}

.action-tone-rally_pass {
    background: linear-gradient(180deg, #dcfce7, #f0fdf4);
}

.action-tone-aanval {
    background: linear-gradient(180deg, #fee2e2, #fff1f2);
}

.action-tone-opslag {
    background: linear-gradient(180deg, #fef3c7, #fffbeb);
}

.action-tone-blok {
    background: linear-gradient(180deg, #ede9fe, #f5f3ff);
}

.action-tone-verdediging {
    background: linear-gradient(180deg, #cffafe, #ecfeff);
}

.action-tone-default {
    background: linear-gradient(180deg, #f1f5f9, #f8fafc);
}

.action-row .btn {
    box-shadow: 0 6px 12px rgba(15, 23, 42, .08);
}

.event-list {
    display: flex;
    flex-direction: column;
    gap: .9rem;
    max-height: 620px;
    overflow: auto;
}

.event-item {
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: .9rem 1rem;
    background: #fafcff;
}

.event-head {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    color: var(--text-soft);
    font-size: .8rem;
}

.set-pill {
    min-width: 120px;
    display: flex;
    flex-direction: column;
    gap: .2rem;
    padding: .8rem .9rem;
    border-radius: 16px;
    background: #f8fafc;
    border: 1px solid var(--border);
}

.set-pill.active {
    background: #eef4ff;
    border-color: #bfd4ff;
}

.table-modern thead th {
    background: #f8fafc;
    color: #475467;
    font-size: .82rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    border-bottom-width: 1px;
}

.table-modern td,
.table-modern th {
    border-color: var(--border);
}

.used-timeout {
    opacity: .55;
}

.disabled-state {
    opacity: .98;
}


.scoreboard-shell {
    position: sticky;
    top: 1rem;
    z-index: 5;
}

.set-overview-panel,
.lineup-panel,
.player-actions-panel {
    min-height: auto;
}

.player-action-card {
    padding: .8rem;
}

.player-action-card .btn {
    min-height: 50px;
    border-radius: 14px;
    font-weight: 700;
    font-size: 1rem;
}

@media (min-width: 1200px) {
    .console-main-grid {
        align-items: start;
    }
}

@media (max-width: 991px) {
    .player-stats-sortable {
        grid-template-columns: 1fr;
    }

    .scoreboard-shell {
        position: static;
    }

    .scoreboard {
        grid-template-columns: 1fr 1fr;
        gap: .5rem 1rem;
        min-height: 0;
    }

    .score-separator {
        display: none;
    }

    .info-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}



@media (max-width: 767px) {
    .hero-card,
    .toolbar-card,
    .panel-card {
        border-radius: 18px;
        padding: 1rem;
    }

    .touch-btn {
        min-height: 50px;
    }

    .scoreboard {
        grid-template-columns: 1fr;
        padding: .7rem;
    }

    .touch-score-btn {
        width: 100%;
        min-width: 0;
    }

    .info-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .court {
        grid-template-rows: repeat(2, 95px);
        gap: 8px;
        padding: 10px;
    }

    .action-group-row {
        grid-template-columns: repeat(var(--row-count, 2), minmax(0, 1fr));
        gap: .65rem;
    }

    .action-row {
        grid-template-columns: 1fr;
        gap: .65rem;
        padding: .75rem;
    }

    .action-label {
        font-size: 1rem;
    }

    .action-buttons {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: .65rem;
    }

    .player-action-card .btn {
        min-height: 60px;
        font-size: 1rem;
    }

    .player-action-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .player-card-tools {
        width: 100%;
        justify-content: flex-end;
    }

    .player-card-meta {
        margin-right: auto;
    }
}


@media (max-width: 575px) {
    .hero-card,
    .toolbar-card,
    .panel-card {
        padding: 1rem;
        border-radius: 20px;
    }

    .info-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: .6rem;
    }
}


@media (max-width: 420px) {
    .action-group-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .action-buttons {
        grid-template-columns: 1fr;
    }

    .player-action-card .btn {
        min-height: 62px;
    }
}

/* Kalender kleuren en iconen */
.calendar-legend-badge {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .35rem .65rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: .85rem;
}

.calendar-event-btn {
    display: block;
    border-radius: .75rem;
    border: 1px solid transparent;
    padding: .45rem .55rem;
    margin-bottom: .4rem;
    text-decoration: none;
}

.calendar-event-btn.match,
.event-pill.match,
.calendar-legend-badge.match {
    background: #dbeafe;
    border-color: #93c5fd;
    color: #1d4ed8;
}

.calendar-event-btn.training,
.event-pill.training,
.calendar-legend-badge.training {
    background: #dcfce7;
    border-color: #86efac;
    color: #15803d;
}

.calendar-event-btn.activity,
.event-pill.activity,
.calendar-legend-badge.activity {
    background: #ffedd5;
    border-color: #fdba74;
    color: #c2410c;
}

.calendar-event-time {
    font-size: .76rem;
    font-weight: 700;
    opacity: .9;
}

.calendar-event-title {
    font-size: .82rem;
    font-weight: 600;
    line-height: 1.2;
}

.calendar-event-icon {
    margin-right: .35rem;
}

.month-calendar-table td {
    min-width: 150px;
    height: 150px;
    vertical-align: top;
}


.compact-panel {
    padding: 1.1rem;
}

.scoreboard-compact {
    min-height: 190px;
    padding: 1rem 1.1rem;
    gap: .75rem;
}

.scoreboard-compact .team-chip {
    display: inline-block;
    background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.15);
    padding: .3rem .6rem;
    border-radius: 999px;
    font-weight: 700;
    font-size: .9rem;
}


.scoreboard-compact .set-wins {
    color: rgba(255,255,255,.72);
    margin: .45rem 0 .25rem;
    font-size: .85rem;
}


.scoreboard-compact .display-score {
    font-size: clamp(2rem, 4vw, 2.8rem);
    line-height: 1;
    font-weight: 800;
    margin-bottom: .5rem;
}


.scoreboard-compact .touch-score-btn {
    min-height: 48px;
    min-width: 108px;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 14px;
}


.info-grid-compact {
    gap: .6rem;
}

.info-grid-compact .info-item {
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: .65rem .75rem;
    background: #fafcff;
    display: flex;
    flex-direction: column;
    gap: .2rem;
}


.court-compact {
    grid-template-rows: repeat(2, 118px);
    gap: 10px;
    padding: 12px;
}

.court-compact .court-pos {
    background: rgba(255,255,255,.88);
    border: 2px dashed #d19a4a;
    border-radius: 16px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}


.court-compact .player-name {
    font-size: .92rem;
    font-weight: 700;
}


#playerStatsList {
    display: grid;
    gap: .75rem;
}

.console-main-grid > .col-12 {
    width: 100%;
}

.set-overview-panel,
.player-actions-panel,
.points-panel {
    width: 100%;
}

@media (max-width: 1199px) {
    .console-main-grid {
        align-items: start;
    }

    .scoreboard-compact {
        min-height: 170px;
    }
}



/* Echte tablet-wedstrijdmodus */
.tablet-match-mode .app-topnav {
    position: static;
    top: auto;
}

.tablet-match-mode .app-shell {
    max-width: none;
}

.tablet-match-mode .hero-card {
    padding: 1rem 1.25rem;
}

.tablet-match-mode .toolbar-card {
    padding: 1rem 1.1rem;
}

.tablet-match-mode .toolbar-card .form-text {
    font-size: .78rem;
}

.tablet-match-mode .panel-card {
    border-radius: 20px;
}

.tablet-match-mode .lineup-panel .panel-subtitle,
.tablet-match-mode .scoreboard-shell .panel-subtitle {
    font-size: .84rem;
}

.tablet-match-mode .player-actions-panel {
    margin-top: -.15rem;
}

.tablet-match-mode .player-action-card {
    padding: .7rem;
    border-radius: 16px;
}

.tablet-match-mode .player-action-card .btn {
    min-height: 62px;
    font-size: 1.02rem;
    font-weight: 700;
}

.tablet-match-mode .action-row {
    grid-template-columns: minmax(120px, 1fr) minmax(0, 2.2fr);
}

.tablet-match-mode .scoreboard-shell {
    position: sticky;
    top: .75rem;
}

.tablet-match-mode .scoreboard-compact {
    min-height: 118px;
    padding: .65rem .75rem;
    gap: .45rem;
    border-radius: 16px;
}

.tablet-match-mode .scoreboard-compact .team-chip {
    font-size: .78rem;
    padding: .22rem .45rem;
    max-width: 100%;
}

.tablet-match-mode .scoreboard-compact .set-wins {
    font-size: .72rem;
    margin: .28rem 0 .12rem;
}

.tablet-match-mode .scoreboard-compact .display-score {
    font-size: clamp(1.6rem, 3vw, 2.15rem);
    margin-bottom: .35rem;
}

.tablet-match-mode .scoreboard-compact .touch-score-btn {
    min-height: 42px;
    min-width: 78px;
    padding: .35rem .55rem;
    font-size: .9rem;
    border-radius: 12px;
}

.tablet-match-mode .scoreboard-shell .touch-btn {
    min-height: 42px;
}

.tablet-match-mode .scoreboard-shell .info-grid {
    gap: .45rem;
}

.tablet-match-mode .scoreboard-shell .info-item {
    padding: .5rem .55rem;
    border-radius: 12px;
}

.tablet-match-mode .scoreboard-shell .info-item span {
    font-size: .72rem;
}

.tablet-match-mode .scoreboard-shell .info-item strong {
    font-size: .95rem;
}

.tablet-match-mode .lineup-panel .court-compact {
    grid-template-rows: repeat(2, 102px);
    gap: 8px;
    padding: 10px;
}

.tablet-match-mode .court-compact .court-pos {
    padding: 8px;
    border-radius: 14px;
}

.tablet-match-mode .court-compact .player-name {
    font-size: .86rem;
}

@media (min-width: 992px) and (max-width: 1366px) {
    .tablet-match-mode .console-main-grid > [class*="col-xl-7"] {
        width: 60%;
    }

    .tablet-match-mode .console-main-grid > [class*="col-xl-5"] {
        width: 40%;
    }

    .tablet-match-mode .toolbar-card .row {
        --bs-gutter-x: .75rem;
        --bs-gutter-y: .75rem;
    }

    .tablet-match-mode .toolbar-card .btn-lg {
        font-size: .96rem;
        padding: .55rem .85rem;
    }

    .tablet-match-mode .hero-card {
        margin-bottom: 1rem !important;
    }

    .tablet-match-mode .toolbar-card {
        margin-bottom: 1rem !important;
    }
}

@media (min-width: 992px) {
    .tablet-match-mode .console-main-grid {
        --bs-gutter-x: 1rem;
        --bs-gutter-y: 1rem;
    }
}

@media (max-width: 991px) {
    .tablet-match-mode .scoreboard-shell {
        position: static;
    }

    .tablet-match-mode .scoreboard-compact {
        min-height: 0;
        grid-template-columns: 1fr 1fr;
    }

    .tablet-match-mode .score-separator {
        display: none;
    }
}

@media (min-width: 700px) and (max-width: 991px) and (orientation: portrait) {
    .tablet-match-mode .player-actions-panel {
        padding: .72rem .8rem;
    }

    .tablet-match-mode .player-stats-sortable {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: .5rem;
    }

    .tablet-match-mode .player-action-card {
        padding: .48rem .52rem;
        border-radius: 13px;
    }

    .tablet-match-mode .player-action-header {
        gap: .35rem;
        margin-bottom: .42rem;
    }

    .tablet-match-mode .player-action-name {
        font-size: .82rem;
        line-height: 1.1;
    }

    .tablet-match-mode .player-card-tools {
        gap: .22rem;
    }

    .tablet-match-mode .player-card-icon-btn {
        width: 30px;
        min-width: 30px;
        height: 30px;
        border-radius: 9px;
        font-size: .78rem;
    }

    .tablet-match-mode .player-card-move-btn,
    .tablet-match-mode .player-card-drag {
        min-width: 30px;
        min-height: 30px;
        border-radius: 9px;
        padding: 0 .4rem;
        font-size: .74rem;
    }

    .tablet-match-mode .player-position-badge {
        font-size: .6rem;
        padding: .16rem .34rem;
    }

    .tablet-match-mode .libero-card .badge {
        font-size: .66rem;
        padding: .24rem .42rem;
    }

    .tablet-match-mode .action-row-list-stacked {
        gap: .34rem;
    }

    .tablet-match-mode .action-row {
        grid-template-columns: 1fr;
        gap: .28rem;
        padding: .42rem;
        border-radius: 11px;
    }

    .tablet-match-mode .action-label {
        font-size: .75rem;
        line-height: 1.05;
    }

    .tablet-match-mode .action-buttons {
        gap: .34rem;
    }

    .tablet-match-mode .player-action-card .btn,
    .tablet-match-mode .action-btn {
        min-height: 34px;
        font-size: .8rem;
        border-radius: 9px;
        padding: .22rem .35rem;
    }

    .tablet-match-mode .libero-card {
        order: 99;
        grid-column: 1 / -1;
        max-width: none;
        width: 100%;
        justify-self: stretch;
    }

    .tablet-match-mode .libero-card .player-action-name {
        font-size: .78rem;
    }

    .tablet-match-mode .libero-card .text-muted {
        font-size: .66rem;
        line-height: 1.05;
    }
}

@media (min-width: 900px) and (max-height: 780px) and (orientation: landscape) {
    .tablet-match-mode .player-actions-panel {
        padding: .72rem .8rem;
    }

    .tablet-match-mode .player-stats-sortable {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: .5rem;
    }

    .tablet-match-mode .player-action-card {
        padding: .48rem .52rem;
        border-radius: 13px;
    }

    .tablet-match-mode .player-action-header {
        gap: .35rem;
        margin-bottom: .42rem;
    }

    .tablet-match-mode .player-action-name {
        font-size: .82rem;
        line-height: 1.1;
    }

    .tablet-match-mode .player-card-tools {
        gap: .22rem;
    }

    .tablet-match-mode .player-card-icon-btn {
        width: 30px;
        min-width: 30px;
        height: 30px;
        border-radius: 9px;
        font-size: .78rem;
    }

    .tablet-match-mode .player-card-move-btn,
    .tablet-match-mode .player-card-drag {
        min-width: 30px;
        min-height: 30px;
        border-radius: 9px;
        padding: 0 .4rem;
        font-size: .74rem;
    }

    .tablet-match-mode .player-position-badge {
        font-size: .6rem;
        padding: .16rem .34rem;
    }

    .tablet-match-mode .libero-card .badge {
        font-size: .66rem;
        padding: .24rem .42rem;
    }

    .tablet-match-mode .action-row-list-stacked {
        gap: .34rem;
    }

    .tablet-match-mode .action-row {
        grid-template-columns: 1fr;
        gap: .28rem;
        padding: .42rem;
        border-radius: 11px;
    }

    .tablet-match-mode .action-label {
        font-size: .75rem;
        line-height: 1.05;
    }

    .tablet-match-mode .action-buttons {
        gap: .34rem;
    }

    .tablet-match-mode .player-action-card .btn,
    .tablet-match-mode .action-btn {
        min-height: 34px;
        font-size: .8rem;
        border-radius: 9px;
        padding: .22rem .35rem;
    }

    .tablet-match-mode .libero-card {
        order: 99;
        grid-column: 1 / -1;
        max-width: none;
        width: 100%;
        justify-self: stretch;
    }

    .tablet-match-mode .libero-card .player-action-name {
        font-size: .78rem;
    }

    .tablet-match-mode .libero-card .text-muted {
        font-size: .66rem;
        line-height: 1.05;
    }
}

.action-row-list-stacked {
    display: grid;
    grid-template-columns: 1fr;
    gap: .75rem;
}

.action-row-list-stacked .action-row {
    width: 100%;
}


.set-overview-panel .info-grid-compact {
    margin-top: .1rem;
}

.points-panel {
    margin-top: -.1rem;
}

.tablet-match-mode .set-overview-panel .panel-subtitle,
.tablet-match-mode .points-panel .panel-subtitle {
    font-size: .84rem;
}

.tablet-match-mode .points-panel {
    position: sticky;
    top: .75rem;
}


html.dark-mode body:not(.login-page),
body.dark-mode:not(.login-page) {
    --bg: #0b1220;
    --panel: #111827;
    --border: #243041;
    --text-soft: #98a2b3;
    --shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
    background: var(--app-page-bg-dark);
    color: #e5e7eb;
}

html.dark-mode .hero-card,
html.dark-mode .toolbar-card,
html.dark-mode .panel-card,
html.dark-mode .player-action-card,
html.dark-mode .action-row,
html.dark-mode .info-item,
html.dark-mode .modal-content,
html.dark-mode .dropdown-menu,
body.dark-mode .hero-card,
body.dark-mode .toolbar-card,
body.dark-mode .panel-card,
body.dark-mode .player-action-card,
body.dark-mode .action-row,
body.dark-mode .info-item,
body.dark-mode .modal-content,
body.dark-mode .dropdown-menu {
    background: #111827;
    color: #e5e7eb;
    border-color: #243041;
}

html.dark-mode .hero-card,
html.dark-mode .toolbar-card,
html.dark-mode .panel-card,
body.dark-mode .hero-card,
body.dark-mode .toolbar-card,
body.dark-mode .panel-card {
    background:
        linear-gradient(90deg, var(--club-primary) 0%, var(--club-secondary) 100%) top left / 100% var(--app-card-accent-height, 4px) no-repeat,
        #111827;
}

html.dark-mode .libero-card,
body.dark-mode .libero-card {
    background: #3b2a13;
    border-color: #f59e0b;
}

html.dark-mode .libero-card .player-action-name,
body.dark-mode .libero-card .player-action-name {
    color: #fde68a;
}

html.dark-mode .hero-card .text-secondary,
html.dark-mode .toolbar-card .text-secondary,
html.dark-mode .panel-subtitle,
html.dark-mode .small.text-secondary,
html.dark-mode .form-text,
html.dark-mode .eyebrow,
html.dark-mode .info-item span,
html.dark-mode .pos-label,
html.dark-mode .text-muted,
html.dark-mode .small.text-muted,
body.dark-mode .hero-card .text-secondary,
body.dark-mode .toolbar-card .text-secondary,
body.dark-mode .panel-subtitle,
body.dark-mode .small.text-secondary,
body.dark-mode .form-text,
body.dark-mode .eyebrow,
body.dark-mode .info-item span,
body.dark-mode .pos-label,
body.dark-mode .text-muted,
body.dark-mode .small.text-muted {
    color: #98a2b3 !important;
}

html.dark-mode .court,
body.dark-mode .court {
    background: linear-gradient(180deg, #3a2b13, #5b431d);
    border-color: #8b5e1a;
}

html.dark-mode .court-pos,
body.dark-mode .court-pos {
    background: rgba(17, 24, 39, 0.92);
    border-color: #8b5e1a;
}

html.dark-mode .player-name,
html.dark-mode .action-label,
html.dark-mode .panel-title,
html.dark-mode .form-label,
html.dark-mode .fw-semibold,
html.dark-mode strong,
html.dark-mode .player-action-name,
body.dark-mode .player-name,
body.dark-mode .action-label,
body.dark-mode .panel-title,
body.dark-mode .form-label,
body.dark-mode .fw-semibold,
body.dark-mode strong,
body.dark-mode .player-action-name {
    color: #f3f4f6;
}

html.dark-mode .action-row,
body.dark-mode .action-row {
    background: #0f172a;
}

html.dark-mode .form-select,
html.dark-mode .form-control,
body.dark-mode .form-select,
body.dark-mode .form-control {
    background-color: #0f172a;
    color: #e5e7eb;
    border-color: #243041;
}

html.dark-mode .form-select:focus,
html.dark-mode .form-control:focus,
body.dark-mode .form-select:focus,
body.dark-mode .form-control:focus {
    background-color: #0f172a;
    color: #e5e7eb;
}

html.dark-mode .btn-outline-secondary,
html.dark-mode .btn-outline-dark,
html.dark-mode .btn-outline-primary,
body.dark-mode .btn-outline-secondary,
body.dark-mode .btn-outline-dark,
body.dark-mode .btn-outline-primary {
    color: #e5e7eb;
    border-color: #475467;
}

html.dark-mode .btn-close,
body.dark-mode .btn-close {
    filter: invert(1) grayscale(100%);
}

html.dark-mode .badge.text-bg-light,
body.dark-mode .badge.text-bg-light {
    background: #1f2937 !important;
    color: #e5e7eb !important;
}

html.dark-mode .dropdown-menu,
body.dark-mode .dropdown-menu {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.45);
}

html.dark-mode .player-card-move-btn,
html.dark-mode .player-card-drag,
html.dark-mode .player-card-icon-btn,
body.dark-mode .player-card-move-btn,
body.dark-mode .player-card-drag,
body.dark-mode .player-card-icon-btn {
    background: #0f172a;
    color: #e5e7eb;
    border-color: #374151;
}

html.dark-mode .voice-action-status,
body.dark-mode .voice-action-status {
    background: rgba(15, 23, 42, .92);
    color: #cbd5e1;
    border-color: #334155;
}

html.dark-mode .voice-action-status.listening,
body.dark-mode .voice-action-status.listening {
    background: rgba(var(--club-primary-rgb, 37, 99, 235), .18);
    color: #f8fafc;
}

html.dark-mode .voice-action-status.success,
body.dark-mode .voice-action-status.success {
    background: rgba(22, 163, 74, .18);
    color: #bbf7d0;
}

html.dark-mode .voice-action-status.error,
body.dark-mode .voice-action-status.error {
    background: rgba(220, 38, 38, .18);
    color: #fecaca;
}

html.dark-mode .event-person-tile,
body.dark-mode .event-person-tile {
    background: #0f172a;
    color: #f3f4f6;
    border-color: #374151 !important;
}

html.dark-mode .event-person-tile .text-secondary,
body.dark-mode .event-person-tile .text-secondary {
    color: #98a2b3 !important;
}

html.dark-mode .lineup-select,
html.dark-mode .libero-select,
html.dark-mode .libero-linked-select,
html.dark-mode #outPlayerSelect,
html.dark-mode #inPlayerSelect,
body.dark-mode .lineup-select,
body.dark-mode .libero-select,
body.dark-mode .libero-linked-select,
body.dark-mode #outPlayerSelect,
body.dark-mode #inPlayerSelect {
    background: #0f172a;
    color: #f3f4f6;
    border-color: #374151;
}


html.dark-mode .set-pill,
body.dark-mode .set-pill {
    background: #172033;
    border-color: #243041;
    color: #e5e7eb;
}

html.dark-mode .set-pill small,
body.dark-mode .set-pill small {
    color: #98a2b3;
}

html.dark-mode .set-pill.active,
body.dark-mode .set-pill.active {
    background: linear-gradient(135deg, var(--club-primary), var(--club-secondary));
    border-color: rgba(var(--club-primary-rgb), 0.55);
    color: var(--club-primary-contrast);
}

html.dark-mode .set-pill.active small,
body.dark-mode .set-pill.active small {
    color: #dbeafe;
}
