:root {
    --bg-main: #07090e;
    --bg-surface: #0e131f;
    --bg-card: #141c2e;
    --bg-card-hover: #1a253d;
    --border-color: #243049;
    --border-highlight: #3b82f6;

    --home-accent: #3b82f6;
    --home-accent-glow: rgba(59, 130, 246, 0.25);
    --away-accent: #f59e0b;
    --away-accent-glow: rgba(245, 158, 11, 0.25);

    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    --foul-safe: #10b981;
    --foul-warn: #eab308;
    --foul-trouble: #f97316;
    --foul-out: #ef4444;

    --font-ui: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-ui);
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Header */
.app-header {
    height: 72px;
    background: #0b101b;
    border-bottom: 2px solid #1c263c;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    gap: 12px;
    flex-shrink: 0;
    z-index: 20;
}

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

.brand-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #141d30;
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid #23314f;
}

.brand-logo {
    font-size: 20px;
}

.brand-title {
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 1px;
    color: #f8fafc;
.fixture-selector-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.fixture-selector-wrap select {
    background: #151f33;
    color: #f1f5f9;
    border: 1.5px solid #2e3e60;
    padding: 8px 12px;
    border-radius: 8px;
    font-family: var(--font-ui);
    font-size: 13px;
    font-weight: 600;
    outline: none;
    cursor: pointer;
    transition: all 0.2s;
}

.fixture-selector-wrap select:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
}

.fixture-selector-wrap select.round-select {
    min-width: 140px;
    background: #19253d;
    border-color: #3b82f6;
    color: #60a5fa;
    font-weight: 700;
}

.fixture-selector-wrap select.game-select {
    max-width: 360px;
}

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

.period-toggle-group {
    display: flex;
    background: #141c2c;
    padding: 4px;
    border-radius: 8px;
    border: 1px solid #23314f;
}

.period-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.5px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.period-btn.active {
    background: #3b82f6;
    color: #fff;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
}

/* Clock Mode Switcher & Controls */
.clock-mode-group {
    display: flex;
    background: #141c2c;
    padding: 3px;
    border-radius: 8px;
    border: 1px solid #23314f;
    gap: 2px;
}

.clock-mode-tab {
    background: transparent;
    border: none;
    color: #94a3b8;
    padding: 6px 10px;
    font-size: 11px;
    font-weight: 800;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.15s ease;
}

.clock-mode-tab.active {
    background: #25334e;
    color: #f8fafc;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.facility-clock-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #111827;
    border: 1.5px solid #283756;
    padding: 6px 14px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.facility-clock-indicator:hover {
    background: #172134;
    border-color: #38bdf8;
}

.indicator-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 8px #10b981;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.85); }
}

.indicator-text {
    font-size: 12px;
    font-weight: 800;
    color: #cbd5e1;
    letter-spacing: 0.3px;
}

/* Clock Module */
.clock-module {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #121826;
    padding: 4px 10px;
    border-radius: 8px;
    border: 1.5px solid #283756;
}

.clock-display {
    font-family: var(--font-mono);
    font-size: 26px;
    font-weight: 900;
    color: #38bdf8;
    min-width: 84px;
    text-align: center;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: background 0.1s ease;
}

.clock-display:hover {
    background: rgba(56, 189, 248, 0.15);
}

.clock-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn-clock-action {
    border: none;
    padding: 7px 11px;
    font-size: 12px;
    font-weight: 800;
    border-radius: 6px;
    cursor: pointer;
    transition: transform 0.08s ease, filter 0.1s ease;
}

.btn-clock-action:active {
    transform: scale(0.94);
}

.btn-clock-action.btn-play {
    background: #10b981;
    color: #fff;
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.3);
}

.btn-clock-action.btn-pause {
    background: #f97316;
    color: #fff;
    box-shadow: 0 2px 8px rgba(249, 115, 22, 0.4);
    animation: flashBorder 1.5s infinite;
}

@keyframes flashBorder {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.2); }
}

.btn-clock-action.btn-adjust {
    background: #1e293b;
    color: #94a3b8;
    font-size: 11px;
    padding: 7px 8px;
}

.btn-clock-action.btn-adjust:hover {
    background: #334155;
    color: #fff;
}

.btn-clock-action.btn-settings {
    background: #1e293b;
    color: #cbd5e1;
    padding: 7px 8px;
}

.btn-clock-action.btn-reset {
    background: #23314d;
    color: #cbd5e1;
}

/* Visibility toggling based on clock-mode */
body.clock-mode-facility .clock-module {
    display: none;
}

body.clock-mode-facility .facility-clock-indicator {
    display: flex;
}

body.clock-mode-timer .clock-module {
    display: flex;
}

body.clock-mode-timer .facility-clock-indicator {
    display: none;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Network and Offline Status Indicators */
.net-status-pill {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    user-select: none;
    letter-spacing: 0.3px;
}

.net-status-pill.online {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.4);
}

.net-status-pill.offline {
    background: rgba(239, 68, 68, 0.18);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.45);
}

.sync-queue-pill {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.5);
    cursor: pointer;
    letter-spacing: 0.3px;
    animation: queuePulse 2s infinite ease-in-out;
}

@keyframes queuePulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4); }
    50% { box-shadow: 0 0 10px 2px rgba(245, 158, 11, 0.5); }
}

.sync-queue-pill:hover {
    background: rgba(245, 158, 11, 0.35);
    border-color: #f59e0b;
}

.btn-quick-util {
    background: #1e293b;
    border: 1px solid #334155;
    color: #94a3b8;
    padding: 9px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.btn-finalise {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border: none;
    color: #fff;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.5px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    transition: transform 0.1s ease;
}

.btn-finalise:active {
    transform: scale(0.97);
}

/* Arena Split */
.courtside-arena {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 110px 1fr;
    height: calc(100vh - 72px);
    overflow: hidden;
}

.team-panel {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg-surface);
}

.team-home {
    border-right: 1px solid #1a243a;
}

.team-away {
    border-left: 1px solid #1a243a;
}

.team-panel-header {
    background: #0f1523;
    padding: 12px 16px;
    border-bottom: 2px solid #1c273e;
    flex-shrink: 0;
}

.team-info-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.team-meta {
    display: flex;
    align-items: center;
    gap: 10px;
}

.team-side-tag {
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 1px;
    padding: 3px 8px;
    border-radius: 4px;
}

.team-home .team-side-tag {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.4);
}

.team-away .team-side-tag {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.4);
}

.team-name-input {
    background: transparent;
    border: none;
    border-bottom: 1px dashed #334155;
    color: #fff;
    font-size: 19px;
    font-weight: 800;
    font-family: var(--font-ui);
    padding: 2px 4px;
    max-width: 280px;
}

.team-name-input:focus {
    outline: none;
    border-bottom: 1.5px solid #38bdf8;
    background: rgba(255, 255, 255, 0.04);
}

.team-big-score {
    font-family: var(--font-mono);
    font-size: 44px;
    font-weight: 900;
    line-height: 1;
}

.team-home .team-big-score {
    color: #60a5fa;
}

.team-away .team-big-score {
    color: #fbbf24;
}

/* Control Strip */
.team-control-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: #090e18;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid #1c263c;
}

.strip-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.strip-label {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.foul-pill-rack {
    display: flex;
    align-items: center;
    gap: 4px;
}

.foul-pip {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    background: #1e293b;
    border: 1px solid #334155;
}

.foul-pip.active {
    background: #eab308;
    border-color: #facc15;
    box-shadow: 0 0 6px rgba(234, 179, 8, 0.5);
}

.foul-pip.bonus {
    width: auto;
    padding: 1px 6px;
    font-size: 9px;
    font-weight: 900;
    color: #64748b;
    border-color: #334155;
}

.foul-pip.bonus.active {
    background: #ef4444;
    color: #fff;
    border-color: #f87171;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.6);
}

.timeout-rack {
    display: flex;
    align-items: center;
    gap: 6px;
}

.timeout-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #1e293b;
    border: 1.5px solid #334155;
    cursor: pointer;
    transition: all 0.15s ease;
}

.timeout-dot.used {
    background: #ef4444;
    border-color: #f87171;
    box-shadow: 0 0 6px rgba(239, 68, 68, 0.5);
}

.btn-add-player {
    background: #1e293b;
    border: 1px dashed #475569;
    color: #cbd5e1;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
    transition: background 0.15s ease;
}

.btn-add-player:hover {
    background: #334155;
    color: #fff;
}

/* Arena Divider */
.arena-divider {
    background: #090d16;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-left: 1px solid #192338;
    border-right: 1px solid #192338;
    padding: 10px;
    text-align: center;
    z-index: 5;
}

.divider-score-summary {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.summary-score-h {
    font-family: var(--font-mono);
    font-size: 32px;
    font-weight: 900;
    color: #60a5fa;
}

.summary-divider {
    font-size: 18px;
    font-weight: 900;
    color: #475569;
}

.summary-score-a {
    font-family: var(--font-mono);
    font-size: 32px;
    font-weight: 900;
    color: #fbbf24;
}

.divider-status {
    margin-top: 18px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1px;
    color: #94a3b8;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
}

.divider-status.pregame {
    color: #f59e0b;
    font-weight: 900;
}

/* Start Game (Tip-Off) Buttons */
.header-start-game-btn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border: none;
    color: #fff;
    padding: 7px 14px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 800;
    font-family: var(--font-ui);
    letter-spacing: 0.5px;
    cursor: pointer;
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.45);
    animation: tipoffPulse 2s infinite ease-in-out;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: transform 0.1s ease;
}

.header-start-game-btn:hover {
    transform: scale(1.03);
    box-shadow: 0 0 18px rgba(16, 185, 129, 0.6);
}

.header-start-game-btn:active {
    transform: scale(0.97);
}

.btn-start-game-tipoff {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border: none;
    color: #fff;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 900;
    font-family: var(--font-ui);
    cursor: pointer;
    margin: 10px 0;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
    animation: tipoffPulse 2s infinite ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

@keyframes tipoffPulse {
    0%, 100% { box-shadow: 0 0 8px rgba(16, 185, 129, 0.4); }
    50% { box-shadow: 0 0 18px rgba(16, 185, 129, 0.8); }
}

/* Roster Scroll Container */
.roster-scroll-container {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    -webkit-overflow-scrolling: touch;
}

.player-cards-rack {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Player Scoring Card */
.player-card {
    background: var(--bg-card);
    border: 1.5px solid var(--border-color);
    border-radius: 10px;
    padding: 8px 10px;
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 8px;
    transition: transform 0.1s ease, border-color 0.15s ease;
}

.player-card:hover {
    border-color: #3b82f6;
}

.player-card.foul-trouble {
    border-color: #f97316;
    background: rgba(249, 115, 22, 0.06);
}

.player-card.fouled-out {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.12);
    opacity: 0.75;
}

/* Player Identity Area */
.player-id-block {
    display: flex;
    align-items: center;
    gap: 10px;
}

.jersey-badge-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 82px;
}

.jersey-input-row {
    display: flex;
    align-items: center;
    background: #090e18;
    border: 2px solid #2a3a5a;
    border-radius: 8px;
    padding: 0 4px;
    transition: border-color 0.15s ease;
}

.jersey-input-row:focus-within {
    border-color: #38bdf8;
    box-shadow: 0 0 8px rgba(56, 189, 248, 0.3);
}

.jersey-hash {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 800;
    color: #64748b;
    user-select: none;
}

.jersey-num-input {
    width: 38px;
    height: 38px;
    background: transparent;
    border: none;
    color: #fff;
    font-family: var(--font-mono);
    font-size: 20px;
    font-weight: 900;
    text-align: center;
    outline: none;
}

.jersey-type-toggle {
    font-size: 9px;
    font-weight: 900;
    letter-spacing: 0.3px;
    padding: 4px 6px;
    border-radius: 5px;
    cursor: pointer;
    border: 1px solid transparent;
    text-align: center;
    width: 100%;
    white-space: nowrap;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    text-transform: uppercase;
}

.jersey-type-toggle.official {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
    border-color: rgba(16, 185, 129, 0.5);
    box-shadow: 0 1px 4px rgba(16, 185, 129, 0.15);
}

.jersey-type-toggle.official:hover {
    background: rgba(16, 185, 129, 0.35);
}

.jersey-type-toggle.bib {
    background: rgba(245, 158, 11, 0.22);
    color: #fbbf24;
    border-color: rgba(245, 158, 11, 0.55);
    box-shadow: 0 1px 4px rgba(245, 158, 11, 0.15);
}

.jersey-type-toggle.bib:hover {
    background: rgba(245, 158, 11, 0.38);
}

.jersey-type-toggle.own_jersey {
    background: rgba(14, 165, 233, 0.22);
    color: #38bdf8;
    border-color: rgba(14, 165, 233, 0.55);
    box-shadow: 0 1px 4px rgba(14, 165, 233, 0.15);
}

.jersey-type-toggle.own_jersey:hover {
    background: rgba(14, 165, 233, 0.38);
}

.btn-sync-jerseys {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.4);
    color: #34d399;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-sync-jerseys:hover {
    background: rgba(16, 185, 129, 0.25);
    color: #fff;
}

.player-text-info {
    overflow: hidden;
}

.player-name-display {
    font-size: 15px;
    font-weight: 800;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-sub-meta {
    font-size: 11px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
}

.role-pill {
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 9px;
    font-weight: 800;
}

.role-pill.core {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
}

.role-pill.fillin {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
}

/* Points Tap Buttons */
.player-points-block {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-point {
    height: 44px;
    min-width: 44px;
    border-radius: 7px;
    border: none;
    font-family: var(--font-ui);
    font-size: 16px;
    font-weight: 900;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.08s ease, filter 0.1s ease;
}

.btn-point:active {
    transform: scale(0.92);
}

.btn-pt-1 {
    background: #1e293b;
    color: #cbd5e1;
    border: 1.5px solid #334155;
}

.btn-pt-2 {
    background: #2563eb;
    color: #fff;
    box-shadow: 0 3px 8px rgba(37, 99, 235, 0.35);
}

.btn-pt-3 {
    background: #7c3aed;
    color: #fff;
    box-shadow: 0 3px 8px rgba(124, 58, 237, 0.35);
}

.player-pts-total {
    font-family: var(--font-mono);
    font-size: 20px;
    font-weight: 900;
    color: #f8fafc;
    min-width: 34px;
    text-align: center;
}

.btn-undo-pt {
    background: transparent;
    border: 1px solid #334155;
    color: #94a3b8;
    height: 38px;
    width: 38px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    margin-left: 2px;
}

.btn-undo-pt:hover {
    background: #1e293b;
    color: #fff;
}

/* Fouls Block */
.player-fouls-block {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

.foul-indicators-row {
    display: flex;
    align-items: center;
    gap: 4px;
}

.foul-circle {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #162033;
    border: 1.5px solid #2d3e60;
    transition: all 0.15s ease;
}

.foul-circle.foul-1 { background: #10b981; border-color: #34d399; }
.foul-circle.foul-2 { background: #10b981; border-color: #34d399; }
.foul-circle.foul-3 { background: #eab308; border-color: #facc15; box-shadow: 0 0 6px rgba(234, 179, 8, 0.5); }
.foul-circle.foul-4 { background: #f97316; border-color: #fb923c; box-shadow: 0 0 6px rgba(249, 115, 22, 0.6); }
.foul-circle.foul-5 { background: #ef4444; border-color: #f87171; box-shadow: 0 0 8px rgba(239, 68, 68, 0.8); }

.foul-circle.active-foul {
    cursor: pointer;
}

.foul-circle.active-foul:hover {
    transform: scale(1.25);
}

.foul-btn-group {
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn-add-foul {
    background: #331515;
    border: 1.5px solid #7f1d1d;
    color: #fca5a5;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.08s ease;
}

.btn-add-foul:active {
    transform: scale(0.94);
    background: #7f1d1d;
    color: #fff;
}

.btn-undo-foul {
    background: transparent;
    border: 1px solid #334155;
    color: #94a3b8;
    height: 32px;
    width: 32px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.12s ease;
}

.btn-undo-foul:hover {
    background: #1e293b;
    border-color: #64748b;
    color: #fff;
}

/* Modals */
.modal-backdrop {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(4, 7, 13, 0.85);
    backdrop-filter: blur(4px);
    z-index: 100;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-backdrop.open {
    display: flex;
}

.modal-card {
    background: #0f172a;
    border: 2px solid #23314f;
    border-radius: 14px;
    width: 100%;
    max-width: 480px;
    padding: 24px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.7);
}

.modal-card.modal-lg {
    max-width: 680px;
}

.modal-foul-alert {
    text-align: center;
}

.foul-modal-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.foul-modal-title {
    font-size: 24px;
    font-weight: 900;
    margin-bottom: 8px;
}

.foul-modal-player {
    font-family: var(--font-mono);
    font-size: 20px;
    font-weight: 800;
    color: #f59e0b;
    margin-bottom: 10px;
}

.foul-modal-desc {
    color: #cbd5e1;
    font-size: 14px;
    margin-bottom: 20px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid #1e293b;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 800;
}

.modal-close {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 18px;
    cursor: pointer;
}

.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: #94a3b8;
    margin-bottom: 6px;
}

.form-group input, .form-group select {
    width: 100%;
    background: #090e18;
    border: 1.5px solid #243049;
    color: #fff;
    padding: 10px 14px;
    border-radius: 8px;
    font-family: var(--font-ui);
    font-size: 14px;
    font-weight: 600;
    outline: none;
}

.form-group input:focus, .form-group select:focus {
    border-color: #3b82f6;
}

.form-row {
    display: flex;
    gap: 12px;
}

.flex-1 { flex: 1; }

.official-notice-box {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #93c5fd;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 12px;
    line-height: 1.4;
    margin-top: 14px;
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
    padding-top: 14px;
    border-top: 1px solid #1e293b;
}

.btn-modal-cancel {
    background: transparent;
    border: 1px solid #334155;
    color: #cbd5e1;
    padding: 9px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.btn-modal-save, .btn-modal-confirm {
    background: #2563eb;
    border: none;
    color: #fff;
    padding: 9px 18px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
}

.btn-modal-upload {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border: none;
    color: #fff;
    padding: 10px 22px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
}

/* Finalise Banner */
.final-score-banner {
    display: flex;
    align-items: center;
    justify-content: space-around;
    background: #090e18;
    padding: 16px;
    border-radius: 10px;
    border: 1.5px solid #23314f;
    margin-bottom: 18px;
}

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

.final-team h4 {
    font-size: 14px;
    color: #94a3b8;
    margin-bottom: 4px;
}

.fin-score {
    font-family: var(--font-mono);
    font-size: 38px;
    font-weight: 900;
}

#finHomeScore { color: #60a5fa; }
#finAwayScore { color: #fbbf24; }

.final-vs {
    font-size: 18px;
    font-weight: 900;
    color: #475569;
}

.upload-options-card {
    background: #131b2e;
    border: 1px solid #243250;
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 14px;
}

.upload-options-card h4 {
    font-size: 13px;
    font-weight: 800;
    margin-bottom: 10px;
    color: #f1f5f9;
}

.checkbox-line {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: #cbd5e1;
    margin-bottom: 8px;
    cursor: pointer;
}

.checkbox-line input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #10b981;
}

.boxscore-preview {
    max-height: 180px;
    overflow-y: auto;
    background: #090e18;
    padding: 10px;
    border-radius: 8px;
    font-size: 12px;
    font-family: var(--font-mono);
    border: 1px solid #1c263c;
}

/* Scorer Sign-Off Card */
.scorer-signoff-card {
    background: #0b111e;
    border: 2px dashed #334155;
    border-radius: 10px;
    padding: 14px 16px;
    margin-top: 14px;
    transition: all 0.2s ease;
}

.scorer-signoff-card.signoff-approved {
    background: rgba(16, 185, 129, 0.08);
    border: 2px solid #10b981;
    box-shadow: 0 0 16px rgba(16, 185, 129, 0.2);
}

.signoff-top-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.signoff-badge {
    font-size: 10px;
    font-weight: 900;
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.4);
    padding: 2px 7px;
    border-radius: 4px;
    letter-spacing: 0.5px;
}

.scorer-signoff-card.signoff-approved .signoff-badge {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
    border-color: rgba(16, 185, 129, 0.4);
}

.signoff-title {
    font-size: 14px;
    font-weight: 800;
    color: #fff;
}

.signoff-prompt {
    font-size: 12px;
    color: #94a3b8;
    line-height: 1.4;
    margin-bottom: 12px;
}

.signoff-inputs-grid {
    display: flex;
    align-items: center;
    gap: 16px;
}

.signoff-initials-col {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 120px;
}

.signoff-initials-col label {
    font-size: 11px;
    font-weight: 800;
    color: #cbd5e1;
}

.scorer-initials-input {
    height: 42px;
    width: 100%;
    background: #090e18;
    border: 2px solid #243049;
    border-radius: 8px;
    font-family: var(--font-mono);
    font-size: 18px;
    font-weight: 900;
    text-transform: uppercase;
    text-align: center;
    color: #38bdf8;
    outline: none;
    letter-spacing: 2px;
    transition: all 0.15s ease;
}

.scorer-initials-input:focus {
    border-color: #38bdf8;
    box-shadow: 0 0 8px rgba(56, 189, 248, 0.3);
}

.scorer-signoff-card.signoff-approved .scorer-initials-input {
    border-color: #10b981;
    color: #34d399;
}

.signoff-check-col {
    flex: 1;
}

.signoff-check-line {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: 12.5px;
    color: #e2e8f0;
    line-height: 1.35;
    user-select: none;
}

.signoff-check-line input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: #10b981;
    margin-top: 1px;
    cursor: pointer;
    flex-shrink: 0;
}

.signoff-status-note {
    margin-top: 10px;
    font-size: 11.5px;
    font-weight: 700;
    color: #f59e0b;
    padding: 6px 10px;
    border-radius: 6px;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.25);
    transition: all 0.15s ease;
}

.scorer-signoff-card.signoff-approved .signoff-status-note {
    color: #34d399;
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.3);
}

/* Upload Finalise Button States */
.btn-modal-upload {
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.15s ease;
    border: none;
}

.btn-modal-upload.btn-locked {
    background: #1e293b !important;
    color: #64748b !important;
    border: 1.5px solid #334155 !important;
    cursor: not-allowed !important;
    opacity: 0.55 !important;
    transform: none !important;
    box-shadow: none !important;
}

.btn-modal-upload:not(.btn-locked) {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
    cursor: pointer;
}

.btn-modal-upload:not(.btn-locked):hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(16, 185, 129, 0.5);
}

/* Toast */
.scoresheet-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #1e293b;
    color: #fff;
    padding: 12px 18px;
    border-radius: 8px;
    border: 1.5px solid #3b82f6;
    font-size: 13px;
    font-weight: 700;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    display: none;
    z-index: 90; /* below modal backdrop (z-index: 100) */
}

.quick-preset-btns {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.quick-preset-btns button {
    flex: 1;
    background: #1e293b;
    border: 1px solid #334155;
    color: #cbd5e1;
    padding: 8px 4px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
}

/* Sync DB Button & Net Status Pill */
.btn-refresh-db {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #1e293b;
    border: 1.5px solid #334155;
    color: #38bdf8;
    padding: 7px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-refresh-db:hover {
    background: #334155;
    border-color: #38bdf8;
    color: #fff;
}

.btn-refresh-db.syncing .sync-icon {
    display: inline-block;
    animation: spin 1s infinite linear;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.net-status-pill {
    font-size: 11px;
    font-weight: 800;
    padding: 5px 8px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.net-status-pill.online {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.35);
}

.net-status-pill.offline {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.35);
}

/* Player Name Row & Edit */
.player-name-row {
    display: flex;
    align-items: center;
    gap: 4px;
}

.player-name-display {
    cursor: pointer;
}

.player-name-display:hover {
    color: #38bdf8;
    text-decoration: underline;
}

.btn-name-edit {
    background: transparent;
    border: none;
    font-size: 11px;
    color: #64748b;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 4px;
    opacity: 0.6;
    transition: all 0.15s ease;
}

.btn-name-edit:hover {
    opacity: 1;
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.12);
}

/* Modal Tabs */
.modal-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    border-bottom: 1.5px solid #243049;
    padding-bottom: 8px;
}

/* Rapid-Fire Courtside Quick Add Bar */
.rapid-fire-box {
    background: linear-gradient(135deg, #1e1b12, #29210e);
    border: 1.5px solid #f59e0b;
    border-radius: 10px;
    padding: 10px 14px;
    margin-bottom: 12px;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.15);
}

.rapid-fire-title {
    font-size: 12px;
    color: #fde68a;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.rapid-fire-inputs {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.rapid-input {
    background: #090e18;
    border: 1.5px solid #3b331f;
    color: #fff;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    outline: none;
    flex: 1;
    min-width: 140px;
}

.rapid-input:focus {
    border-color: #f59e0b;
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.25);
}

.rapid-select {
    background: #090e18;
    border: 1.5px solid #3b331f;
    color: #fde68a;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    outline: none;
    cursor: pointer;
}

.btn-rapid-add {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #0f172a;
    border: none;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 900;
    padding: 8px 14px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.35);
    white-space: nowrap;
    transition: all 0.15s ease;
}

.btn-rapid-add:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.5);
}

.rapid-match-pill {
    margin-top: 8px;
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.4);
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 11px;
    color: #34d399;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.rapid-match-pill:hover {
    background: rgba(16, 185, 129, 0.25);
}

/* Frequent Fill-Ins Bar */
.frequent-fillins-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    background: #0b1120;
    border: 1px solid #1e293b;
    border-radius: 8px;
    padding: 6px 12px;
    overflow-x: auto;
}

.frequent-label {
    font-size: 11px;
    font-weight: 800;
    color: #94a3b8;
    white-space: nowrap;
    text-transform: uppercase;
}

.frequent-chips-wrap {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: nowrap;
}

.frequent-chip {
    background: #172138;
    border: 1px solid #2d3e66;
    color: #38bdf8;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.12s ease;
}

.frequent-chip:hover {
    background: #1e2f52;
    border-color: #38bdf8;
    color: #fff;
    transform: translateY(-1px);
}

.modal-tab {
    flex: 1;
    background: #0d1424;
    border: 1px solid #1e293b;
    color: #94a3b8;
    padding: 9px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.15s ease;
}

.modal-tab.active {
    background: #1e293b;
    border-color: #3b82f6;
    color: #fff;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.25);
}

/* Fill-in Filter Row */
.fillin-filter-row {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.flex-2 { flex: 2; }

.fillin-search-input {
    width: 100%;
    background: #090e18;
    border: 1.5px solid #243049;
    color: #fff;
    padding: 10px 14px;
    border-radius: 8px;
    font-family: var(--font-ui);
    font-size: 14px;
    font-weight: 600;
    outline: none;
}

.fillin-search-input:focus {
    border-color: #38bdf8;
}

.fillin-filter-select {
    width: 100%;
    background: #090e18;
    border: 1.5px solid #243049;
    color: #38bdf8;
    padding: 10px 12px;
    border-radius: 8px;
    font-family: var(--font-ui);
    font-size: 13px;
    font-weight: 800;
    outline: none;
}

.filter-summary-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11px;
    color: #94a3b8;
    font-weight: 700;
    margin-bottom: 8px;
    padding: 0 2px;
}

.btn-text-action {
    background: transparent;
    border: none;
    color: #38bdf8;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
}

.btn-text-action:hover {
    text-decoration: underline;
}

/* Athlete Picker Rack */
.athlete-picker-rack {
    max-height: 240px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-right: 4px;
    border: 1px solid #1c263c;
    border-radius: 8px;
    padding: 8px;
    background: #090e18;
    margin-bottom: 12px;
}

.athlete-card-pick {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #111827;
    border: 1.5px solid #1f293d;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.12s ease;
}

.athlete-card-pick:hover {
    border-color: #3b82f6;
    background: #172238;
}

.athlete-card-pick.selected {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.12);
}

.athlete-pick-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.athlete-pick-name {
    font-size: 14px;
    font-weight: 800;
    color: #fff;
}

.athlete-badge-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.ath-badge {
    font-size: 10px;
    font-weight: 800;
    padding: 1px 6px;
    border-radius: 4px;
}

.ath-badge-age {
    background: rgba(59, 130, 246, 0.2);
    color: #93c5fd;
}

.ath-badge-club {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
}

.ath-badge-div {
    background: rgba(16, 185, 129, 0.2);
    color: #6ee7b7;
}

.btn-pick-player {
    background: #1e293b;
    border: 1px solid #334155;
    color: #38bdf8;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
}

.athlete-card-pick.selected .btn-pick-player {
    background: #10b981;
    color: #fff;
    border-color: #10b981;
}

/* Selected Athlete Config */
.selected-athlete-config {
    background: #0f172a;
    border: 1.5px solid #283756;
    border-radius: 8px;
    padding: 10px 12px;
}

.selected-athlete-strip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid #1e293b;
}

.selected-label {
    font-size: 11px;
    font-weight: 900;
    color: #34d399;
}

.selected-sub {
    font-size: 12px;
    color: #94a3b8;
    margin-left: auto;
}

.mt-2 { margin-top: 10px; }

.form-help-txt {
    font-size: 13px;
    color: #94a3b8;
    margin-bottom: 12px;
    line-height: 1.4;
}

.req-star { color: #f87171; }
.opt-label { font-size: 11px; color: #64748b; font-weight: normal; }

/* Header Season Attendance Button */
.btn-season-att {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #1e293b;
    border: 1.5px solid #334155;
    color: #e2e8f0;
    padding: 7px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-season-att:hover {
    background: #334155;
    border-color: #38bdf8;
    color: #38bdf8;
}

/* Team Header Attendance Pill */
.team-attendance-pill {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 800;
    color: #34d399;
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.35);
    padding: 3px 8px;
    border-radius: 12px;
    margin-left: 8px;
    white-space: nowrap;
}

/* Team Strip Check-In All Button */
.btn-checkin-all {
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.35);
    color: #38bdf8;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-checkin-all:hover {
    background: rgba(56, 189, 248, 0.25);
    color: #fff;
}

/* Player Card Check-In Toggle Button */
.player-checkin-col {
    display: flex;
    align-items: center;
}

.btn-checkin-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 38px;
    padding: 0 10px;
    background: #090e18;
    border: 1.5px dashed #475569;
    border-radius: 6px;
    color: #94a3b8;
    font-size: 10px;
    font-weight: 900;
    cursor: pointer;
    letter-spacing: 0.5px;
    user-select: none;
    transition: all 0.15s ease;
}

.btn-checkin-toggle:hover {
    border-color: #94a3b8;
    color: #f1f5f9;
}

.btn-checkin-toggle.checked {
    background: rgba(16, 185, 129, 0.18);
    border: 1.5px solid #10b981;
    color: #34d399;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.2);
}

.btn-checkin-toggle.checked:hover {
    background: rgba(16, 185, 129, 0.28);
}

.checkin-box-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 4px;
    border: 1.5px solid #64748b;
    font-size: 11px;
    font-weight: 900;
    line-height: 1;
    transition: all 0.15s ease;
}

.btn-checkin-toggle.checked .checkin-box-mark {
    background: #10b981;
    border-color: #10b981;
    color: #04070d;
}

.checkin-label-text {
    white-space: nowrap;
}

/* Player Card State Styles */
.player-card.player-absent {
    opacity: 0.85;
    background: #090e18;
    border: 1.5px solid #1e293b;
}

.player-card.player-present {
    opacity: 1;
    border-color: #2e4066;
    background: #0c1424;
}

/* Extra Large Modal for Season Attendance */
.modal-card.modal-xl {
    max-width: 960px;
    width: 95vw;
    max-height: 90vh;
}

.modal-subtitle {
    font-size: 12px;
    color: #94a3b8;
    font-weight: normal;
    margin-top: 3px;
}

.attendance-filter-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}

.attendance-summary-kpis {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 14px;
}

.kpi-card {
    background: #090e18;
    border: 1px solid #1e293b;
    border-radius: 8px;
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.kpi-num {
    font-family: var(--font-mono);
    font-size: 22px;
    font-weight: 900;
    color: #f8fafc;
}

.kpi-num.highlight-today { color: #38bdf8; }
.kpi-num.highlight-qual { color: #34d399; }

.kpi-lbl {
    font-size: 11px;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.attendance-table-wrap {
    overflow-y: auto;
    max-height: 420px;
    border: 1px solid #1e293b;
    border-radius: 8px;
    background: #090e18;
}

.attendance-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12.5px;
    text-align: left;
}

.attendance-table th {
    background: #111a2e;
    color: #cbd5e1;
    font-weight: 800;
    padding: 10px 12px;
    position: sticky;
    top: 0;
    z-index: 2;
    border-bottom: 1.5px solid #1e293b;
    white-space: nowrap;
}

.attendance-table td {
    padding: 9px 12px;
    border-bottom: 1px solid #151f33;
    color: #e2e8f0;
}

.attendance-table tr:hover td {
    background: #0f192c;
}

.att-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 4px;
    white-space: nowrap;
}

.att-status-badge.eligible {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.4);
}

.att-status-badge.needs {
    background: rgba(245, 158, 11, 0.12);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.35);
}

.att-status-badge.present {
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.4);
}

.att-status-badge.absent {
    background: rgba(100, 116, 139, 0.15);
    color: #94a3b8;
    border: 1px solid rgba(100, 116, 139, 0.3);
}

/* ====================================================
   TABLET MODE BUTTON & OPTIMIZATIONS
   ==================================================== */
.btn-tablet-toggle {
    background: #151d2e;
    border: 1.5px solid #283756;
    color: #38bdf8;
    padding: 7px 11px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 800;
    font-family: var(--font-ui);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.btn-tablet-toggle:hover {
    background: #202d47;
    border-color: #38bdf8;
    color: #fff;
}

.btn-tablet-toggle.active {
    background: #0284c7;
    border-color: #38bdf8;
    color: #fff;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.4);
}

/* ====================================================
   TABLET MODE OVERRIDES (Only triggered when toggled on)
   Default view on laptops/notebooks is 100% UNCHANGED.
   ==================================================== */

/* Header in Tablet Mode: Dedicated 2-Row Split */
body.tablet-mode .app-header {
    height: auto !important;
    min-height: 84px !important;
    padding: 6px 12px !important;
    display: grid !important;
    grid-template-columns: 1fr auto !important;
    grid-template-rows: auto auto !important;
    row-gap: 6px !important;
    column-gap: 8px !important;
    align-items: center !important;
    box-sizing: border-box !important;
    overflow: visible !important;
    z-index: 50 !important;
}

/* Row 1, Column 1: Left Navigation & Match Selector */
body.tablet-mode .header-left {
    grid-column: 1 / 2 !important;
    grid-row: 1 / 2 !important;
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    min-width: 0 !important;
    width: 100% !important;
}

body.tablet-mode .btn-tablet-toggle {
    padding: 5px 8px !important;
    font-size: 11px !important;
    gap: 4px !important;
    flex-shrink: 0 !important;
}

body.tablet-mode .brand-badge {
    padding: 3px 6px !important;
    border-radius: 6px !important;
    flex-shrink: 0 !important;
}

body.tablet-mode .brand-title {
    display: none !important;
}

body.tablet-mode .fixture-selector-wrap {
    flex: 1 1 auto !important;
    min-width: 120px !important;
    max-width: 280px !important;
}

body.tablet-mode .fixture-selector-wrap select {
    width: 100% !important;
    max-width: 100% !important;
    padding: 5px 8px !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

/* Row 1, Column 2: Right Utilities, Attendance, Sync DB & Finalise Button */
body.tablet-mode .header-right {
    grid-column: 2 / 3 !important;
    grid-row: 1 / 2 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 6px !important;
    flex-wrap: nowrap !important;
    flex-shrink: 0 !important;
}

body.tablet-mode .btn-season-att {
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    padding: 5px 9px !important;
    font-size: 11px !important;
    font-weight: 800 !important;
    white-space: nowrap !important;
    background: #1e293b !important;
    border: 1.5px solid #334155 !important;
    border-radius: 6px !important;
    color: #e2e8f0 !important;
}

body.tablet-mode .btn-season-att span:last-child {
    display: inline !important;
}

body.tablet-mode .btn-refresh-db {
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    padding: 5px 9px !important;
    font-size: 11px !important;
    font-weight: 800 !important;
    white-space: nowrap !important;
    background: #1e293b !important;
    border: 1.5px solid #334155 !important;
    border-radius: 6px !important;
    color: #38bdf8 !important;
}

body.tablet-mode .btn-refresh-db .sync-text {
    display: inline !important;
}

body.tablet-mode .net-status-pill {
    display: none !important;
}

body.tablet-mode .btn-quick-util {
    display: inline-flex !important;
    align-items: center !important;
    padding: 5px 8px !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    background: #1e293b !important;
    border: 1px solid #334155 !important;
    border-radius: 6px !important;
    color: #94a3b8 !important;
}

body.tablet-mode .btn-finalise {
    display: inline-flex !important;
    align-items: center !important;
    padding: 5px 12px !important;
    font-size: 11px !important;
    font-weight: 900 !important;
    letter-spacing: 0.3px !important;
    white-space: nowrap !important;
    border-radius: 6px !important;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    color: #fff !important;
    border: none !important;
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.4) !important;
}

/* Row 2: Full-Width Centered Tip-Off, Period & Clock/Wall Clock */
body.tablet-mode .header-center {
    grid-column: 1 / -1 !important;
    grid-row: 2 / 3 !important;
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    padding-top: 5px !important;
    border-top: 1px solid #1a253d !important;
    flex-wrap: wrap !important;
}

body.tablet-mode .header-start-game-btn {
    padding: 4px 10px !important;
    font-size: 11px !important;
    font-weight: 900 !important;
    white-space: nowrap !important;
}

body.tablet-mode .period-toggle-group {
    display: flex !important;
    padding: 2px !important;
    gap: 2px !important;
    background: #141c2c !important;
    border: 1px solid #23314f !important;
    border-radius: 7px !important;
}

body.tablet-mode .period-btn {
    padding: 4px 9px !important;
    font-size: 11px !important;
    font-weight: 800 !important;
}

/* Clock Mode Selector (Facility Wall Clock vs Tablet Timer) */
body.tablet-mode .clock-mode-group {
    display: flex !important;
    background: #141c2c !important;
    padding: 2px !important;
    border-radius: 7px !important;
    border: 1px solid #23314f !important;
    gap: 2px !important;
}

body.tablet-mode .clock-mode-tab {
    padding: 4px 8px !important;
    font-size: 11px !important;
    font-weight: 800 !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    white-space: nowrap !important;
}

/* Facility Wall Clock Active Indicator */
body.tablet-mode .facility-clock-indicator {
    padding: 4px 10px !important;
    gap: 6px !important;
    background: #111827 !important;
    border: 1.5px solid #283756 !important;
    border-radius: 7px !important;
    cursor: pointer !important;
    white-space: nowrap !important;
}

body.tablet-mode .indicator-text {
    font-size: 11px !important;
    font-weight: 800 !important;
    color: #cbd5e1 !important;
}

body.tablet-mode.clock-mode-facility .facility-clock-indicator {
    display: flex !important;
}

body.tablet-mode.clock-mode-facility .clock-module {
    display: none !important;
}

body.tablet-mode.clock-mode-timer .facility-clock-indicator {
    display: none !important;
}

body.tablet-mode.clock-mode-timer .clock-module {
    display: flex !important;
}

body.tablet-mode .clock-module {
    padding: 3px 8px !important;
    gap: 6px !important;
    border-radius: 7px !important;
}

body.tablet-mode .clock-display {
    font-size: 20px !important;
    min-width: 65px !important;
    padding: 2px 4px !important;
}

body.tablet-mode .btn-clock-action {
    padding: 4px 7px !important;
    font-size: 11px !important;
}

/* Courtside Arena in Tablet Mode adjusted for 2-row header */
body.tablet-mode .courtside-arena {
    flex: 1 1 0% !important;
    min-height: 0 !important;
    height: auto !important;
    grid-template-columns: 1fr 66px 1fr !important;
    overflow: hidden !important;
}

body.tablet-mode .arena-divider {
    padding: 6px 2px;
}

body.tablet-mode .summary-score-h,
body.tablet-mode .summary-score-a {
    font-size: 22px;
}

body.tablet-mode .summary-divider {
    font-size: 13px;
}

body.tablet-mode .divider-status {
    font-size: 8px;
    margin-top: 10px;
}

body.tablet-mode .team-panel-header {
    padding: 6px 10px;
}

body.tablet-mode .team-info-box {
    margin-bottom: 4px;
}

body.tablet-mode .team-name-input {
    font-size: 15px;
    max-width: 160px;
}

body.tablet-mode .team-big-score {
    font-size: 32px;
}

body.tablet-mode .team-control-strip {
    padding: 4px 8px;
    gap: 6px;
}

body.tablet-mode .foul-pip {
    width: 10px;
    height: 10px;
}

body.tablet-mode .timeout-dot {
    width: 15px;
    height: 15px;
}

body.tablet-mode .btn-checkin-all {
    padding: 3px 6px;
    font-size: 9px;
}

body.tablet-mode .team-attendance-pill {
    font-size: 9px;
    padding: 2px 6px;
}

/* Roster Scrolling & Player Cards in Tablet Mode */
body.tablet-mode .roster-scroll-container {
    padding: 6px 6px 64px 6px; /* Generous bottom spacing for tablets */
    overflow-y: scroll;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    overscroll-behavior: contain;
}

body.tablet-mode .player-cards-rack {
    gap: 4px;
}

body.tablet-mode .player-card {
    padding: 4px 8px;
    gap: 6px;
    border-radius: 7px;
    touch-action: pan-y;
}

body.tablet-mode .player-id-block {
    gap: 6px;
}

body.tablet-mode .jersey-badge-wrap {
    min-width: 58px;
    gap: 2px;
}

body.tablet-mode .jersey-input-row {
    padding: 0 2px;
}

body.tablet-mode .jersey-input {
    width: 30px;
    height: 24px;
    font-size: 13px;
}

body.tablet-mode .jersey-hash {
    font-size: 11px;
}

body.tablet-mode .badge-num-type {
    font-size: 8px;
    padding: 1px 3px;
}

body.tablet-mode .btn-checkin-toggle {
    padding: 2px 5px;
    font-size: 9px;
    gap: 3px;
}

body.tablet-mode .player-display-name {
    font-size: 13px;
    line-height: 1.15;
}

body.tablet-mode .player-stat-summary {
    font-size: 10px;
}

body.tablet-mode .pts-grid {
    gap: 2px;
}

body.tablet-mode .btn-pts {
    min-width: 36px;
    height: 38px;
    font-size: 13px;
    padding: 0;
    touch-action: manipulation;
}

body.tablet-mode .btn-foul-add {
    height: 38px;
    padding: 0 8px;
    font-size: 11px;
    touch-action: manipulation;
}

body.tablet-mode .btn-undo-player {
    width: 34px;
    height: 38px;
    font-size: 13px;
    touch-action: manipulation;
}

/* Match History & Box Score Viewer */
.history-match-card {
    background: #141c2e;
    border: 1.5px solid #23314f;
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 12px;
    transition: all 0.15s ease;
}

.history-match-card:hover {
    border-color: #3b82f6;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.hmc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 8px;
}

.hmc-meta {
    display: flex;
    align-items: center;
    gap: 8px;
}

.hmc-round {
    font-size: 11px;
    font-weight: 700;
    color: #cbd5e1;
    background: #1e293b;
    padding: 2px 8px;
    border-radius: 6px;
    border: 1px solid #334155;
}

.hmc-date {
    font-size: 11px;
    color: var(--text-muted);
}

.hmc-signoff {
    font-size: 11px;
    color: #94a3b8;
    background: rgba(15, 23, 42, 0.6);
    padding: 2px 8px;
    border-radius: 6px;
    border: 1px solid rgba(51, 65, 85, 0.5);
}

.hmc-scoreboard {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #090e18;
    border: 1.5px solid #1c273e;
    border-radius: 10px;
    padding: 12px 18px;
    gap: 12px;
}

.hmc-team {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.hmc-team.away {
    justify-content: flex-end;
}

.hmc-name {
    font-size: 14px;
    font-weight: 700;
    color: #cbd5e1;
}

.hmc-team.winner .hmc-name {
    color: #f8fafc;
    font-weight: 900;
}

.hmc-pts {
    font-family: var(--font-mono);
    font-size: 24px;
    font-weight: 900;
    color: #94a3b8;
    background: #151d30;
    padding: 2px 12px;
    border-radius: 6px;
    border: 1px solid #23314f;
    min-width: 44px;
    text-align: center;
}

.hmc-team.winner .hmc-pts {
    color: #38bdf8;
    border-color: #38bdf8;
    background: rgba(56, 189, 248, 0.12);
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.25);
}

.hmc-vs {
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 1px;
    color: #64748b;
    background: #141c2e;
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid #23314f;
}

.btn-boxscore-toggle {
    background: transparent;
    border: 1px solid #334155;
    color: #38bdf8;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-boxscore-toggle:hover {
    background: rgba(56, 189, 248, 0.12);
    border-color: #38bdf8;
}

.hmc-boxscore-details {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid #23314f;
    animation: fadeIn 0.2s ease;
}

.hmc-tables-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

@media (max-width: 768px) {
    .hmc-tables-grid {
        grid-template-columns: 1fr;
    }
}

.boxscore-mini-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
    background: #090e18;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #1c273e;
}

.boxscore-mini-table th {
    background: #141d30;
    color: #94a3b8;
    padding: 6px 10px;
    font-weight: 700;
    text-align: left;
    border-bottom: 1px solid #23314f;
}

.boxscore-mini-table td {
    padding: 6px 10px;
    border-bottom: 1px solid rgba(35, 49, 79, 0.5);
    color: #cbd5e1;
}

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

.boxscore-mini-table tfoot td {
    background: #141d30;
    font-weight: 800;
    color: #f8fafc;
    border-top: 1px solid #23314f;
}

/* Locked Match Banner & Read-Only State for Played & Closed Games */
.locked-match-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(90deg, #581c87, #7e22ce, #9333ea);
    border-bottom: 2px solid #c084fc;
    padding: 10px 24px;
    color: #fff;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
    z-index: 99;
}

.locked-match-banner.closed-red {
    background: linear-gradient(90deg, #7f1d1d, #991b1b, #b91c1c);
    border-bottom: 2px solid #ef4444;
}

.lmb-content {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
}

.lmb-icon {
    font-size: 24px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.4));
}

.lmb-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.lmb-title {
    font-size: 14px;
    font-weight: 900;
    letter-spacing: 1px;
    color: #fee2e2;
    text-transform: uppercase;
}

.lmb-subtitle {
    font-size: 13px;
    font-weight: 500;
    color: #fca5a5;
}

.btn-lmb-view {
    margin-left: auto;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.35);
    color: #fff;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-lmb-view:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* When match is closed, lock all scoring controls and mutations */
body.match-closed .scoring-grid,
body.match-closed .btn-pts,
body.match-closed .btn-foul,
body.match-closed .btn-undo-foul,
body.match-closed .team-control-strip button,
body.match-closed .header-start-game-btn,
body.match-closed .btn-finalise,
body.match-closed .clock-actions button,
body.match-closed .btn-undo,
body.match-closed .btn-checkin-all,
body.match-closed .btn-sync-jerseys,
body.match-closed .btn-add-player,
body.match-closed .jersey-edit-btn,
body.match-closed .btn-bib-toggle,
body.match-closed #clockToggleBtn,
body.match-closed #headerStartGameBtn,
body.match-closed #btnStartGameTipoff {
    pointer-events: none !important;
    opacity: 0.3 !important;
    filter: grayscale(85%) !important;
    cursor: not-allowed !important;
}

body.match-closed .team-name-input {
    pointer-events: none !important;
    opacity: 0.8 !important;
    border-color: transparent !important;
}

body.match-closed .team-big-score {
    color: #fbbf24 !important;
    text-shadow: 0 0 20px rgba(251, 191, 36, 0.4);
}

