@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@700;900&display=swap');

:root {
    --eg-primary:     #667eea;
    --eg-secondary:   #764ba2;
    --eg-tertiary:    #5a67d8;
    --eg-surface:     #f5f3ff;
    --eg-surface-alt: #ede9fe;
    --eg-home:        #2563eb;
    --eg-away:        #dc2626;

    /* Text hierarchy */
    --eg-text:        #1f2937;
    --eg-text-muted:  #6b7280;
    --eg-text-light:  #9ca3af;

    /* Borders */
    --eg-border:        #e5e7eb;
    --eg-border-strong: #d1d5db;

    /* Backgrounds */
    --eg-bg:     #f9fafb;
    --eg-bg-alt: #f3f4f6;

    /* Diff colours (multi-opponent) */
    --eg-positive: #5ba3ff;
    --eg-negative: #ff7070;

    /* Scoreboard dark card */
    --eg-scoreboard-bg: #131b2a;

    /* Status: setup (amber) */
    --eg-status-setup-bg:      #fef3c7;
    --eg-status-setup-text:    #92400e;
    --eg-status-setup-border:  #fcd34d;

    /* Status: active (blue) */
    --eg-status-active-bg:     #dbeafe;
    --eg-status-active-text:   #1d4ed8;
    --eg-status-active-border: #93c5fd;

    /* Status: complete (green) */
    --eg-status-complete-bg:     #dcfce7;
    --eg-status-complete-text:   #15803d;
    --eg-status-complete-border: #86efac;

    /* Status: archived (grey) */
    --eg-status-archived-bg:     #f3f4f6;
    --eg-status-archived-text:   #6b7280;
    --eg-status-archived-border: #d1d5db;

    /* Radius scale */
    --eg-radius:    12px;
    --eg-radius-lg: 16px;
    --eg-radius-sm: 8px;

    /* Z-index scale */
    --z-base:        1;
    --z-sticky:     10;
    --z-card-overlay: 50;
    --z-nav:       100;
    --z-hamburger: 300;
    --z-nav-overlay: 400;
    --z-nav-drawer:  500;
    --z-ctx-menu:  600;
    --z-modal:     700;
    --z-toast:     800;
    --z-loading:   900;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:focus-visible {
    outline: 2px solid var(--eg-primary);
    outline-offset: 2px;
    border-radius: 4px;
}

body {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, var(--eg-primary), var(--eg-secondary), var(--eg-tertiary));
    min-height: 100vh;
    min-height: 100dvh;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    color: var(--eg-text);
    touch-action: manipulation;
    padding: 10px;
}


.container {
    max-width: 600px;
    margin: 0 auto;
    height: calc(100vh - 20px);
    height: calc(100dvh - 20px);
    position: relative;
    background: var(--eg-surface);
    border-radius: 16px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

@media (min-width: 768px) {
    body { padding: 0; }
    .container {
        max-width: 100%;
        height: 100vh;
        height: 100dvh;
        border-radius: 0;
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
        background: var(--eg-surface);
        padding: 0 24px 0;
    }
}

.screen {
    display: none;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}

.screen.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.card {
    background: var(--eg-surface);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}

h1 {
    color: white;
    text-align: center;
    margin-bottom: 16px;
    font-size: clamp(20px, 4vw, 28px);
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
}

h1.compact {
    display: none;
}

/* Logo Styles */
.app-logo {
    height: 36px;
    width: auto;
    vertical-align: middle;
    margin-right: 8px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.signin-logo {
    display: block;
    width: 200px;
    height: auto;
    margin: 0 auto 24px auto;
}

.scoreboard-logo {
    position: absolute;
    top: 0;
    right: 16px;
    height: 56px;
    width: auto;
    opacity: 0.85;
}

h2 {
    color: var(--eg-primary);
    margin-bottom: 16px;
    font-size: clamp(18px, 3.5vw, 24px);
}

.btn {
    width: 100%;
    padding: 18px;
    font-size: 18px;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.btn-primary {
    background: linear-gradient(135deg, var(--eg-primary) 0%, var(--eg-secondary) 100%);
    color: white;
    position: relative;
    overflow: hidden;
}

/* Only apply hover effects on devices with hover capability (desktop/laptop) */
@media (hover: hover) {
    .btn-primary::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(135deg, #7c8ef0 0%, #8b63b8 100%);
        transition: left 0.3s ease;
    }

    .btn-primary:hover::before {
        left: 0;
    }

    .btn-primary:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 24px rgba(0,0,0,0.25);
    }
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.btn-primary > * {
    position: relative;
    z-index: 1;
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    background: linear-gradient(135deg, var(--eg-bg-alt) 0%, var(--eg-border) 100%);
    color: var(--eg-text-muted);
    border: 2px solid var(--eg-border-strong);
}

@media (hover: hover) {
    .btn-secondary:hover {
        background: linear-gradient(135deg, var(--eg-border) 0%, var(--eg-border-strong) 100%);
        border-color: var(--eg-text-light);
        transform: translateY(-2px);
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
    }
}

.btn-secondary:active {
    background: linear-gradient(135deg, var(--eg-border-strong) 0%, #c4c8cf 100%);
    transform: translateY(0);
}

.btn-danger {
    background: linear-gradient(135deg, #f87171 0%, #dc2626 100%);
    color: white;
    padding: 12px;
    font-size: 14px;
    border: none;
}

@media (hover: hover) {
    .btn-danger:hover {
        background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
    }
}

.btn-danger:active {
    transform: translateY(0);
}

.btn-success {
    background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
    color: white;
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.3);
}

@media (hover: hover) {
    .btn-success:hover {
        background: linear-gradient(135deg, #10b981 0%, #059669 100%);
        transform: translateY(-2px);
        box-shadow: 0 8px 24px rgba(16, 185, 129, 0.4);
    }
}

.btn-success:active {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-small {
    padding: 10px 16px;
    min-height: 44px;
    font-size: 14px;
    width: auto;
    display: inline-block;
    margin-right: 8px;
}

.btn-save-end {
    max-width: 400px;
    margin: 0 auto;
    display: block;
}

.game-actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.btn-half {
    flex: 1;
    margin: 0;
}

.file-list {
    max-height: 60vh;
    overflow-y: auto;
}

.file-item {
    display: flex;
    align-items: center;
    padding: 16px;
    margin-bottom: 8px;
    background: var(--eg-bg);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

@media (hover: hover) {
    .file-item:hover {
        background: var(--eg-bg-alt);
        transform: translateX(4px);
    }
}

.file-item:active {
    background: var(--eg-border);
    transform: scale(0.98);
}

.file-icon {
    font-size: 28px;
    margin-right: 16px;
}

.file-name {
    flex: 1;
    font-size: 16px;
    font-weight: 500;
}

.breadcrumb {
    display: flex;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.breadcrumb-item {
    color: var(--eg-primary);
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 6px;
    transition: background 0.2s;
}

@media (hover: hover) {
    .breadcrumb-item:hover {
        background: var(--eg-bg-alt);
    }
}

.breadcrumb-separator {
    margin: 0 4px;
    color: var(--eg-text-light);
}

.game-header {
    position: relative;
    text-align: center;
    margin-bottom: 16px;
    padding-top: 4px;
    padding-left: 44px;
    padding-right: 8px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--eg-border);
}

/* Apple-style circular back button with chevron */
.back-btn {
    /* Touch target: 44×44pt minimum (Apple HIG). Visual circle is 36px,
       achieved via padding so the element itself meets the 44px target. */
    min-width: 44px;
    min-height: 44px;
    border-radius: 50%;
    border: none;
    background: var(--eg-bg-alt);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    text-decoration: none;
    flex-shrink: 0;
    padding: 4px;
    touch-action: manipulation;
}

.back-btn::before {
    content: '';
    width: 10px;
    height: 10px;
    border-left: 2.5px solid var(--eg-primary);
    border-bottom: 2.5px solid var(--eg-primary);
    transform: rotate(45deg);
    margin-left: 3px;
}

@media (hover: hover) {
    .back-btn:hover {
        background: var(--eg-border);
    }
}

.back-btn:active {
    transform: scale(0.95);
}

/* Variant for dark/gradient backgrounds */
.back-btn.on-dark {
    background: rgba(255, 255, 255, 0.2);
}

.back-btn.on-dark::before {
    border-color: white;
}

.back-btn.on-dark:active {
    background: rgba(255, 255, 255, 0.4);
}


.progress-container {
    margin-top: 12px;
}

.progress-bar {
    position: relative;
    height: 20px;
    background: var(--eg-bg-alt);
    border-radius: 10px;
    overflow: visible;
}

.progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: var(--eg-text-light);
    transition: width 0.3s ease;
    width: 0%;
    border-radius: 10px;
}

.progress-text {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    color: var(--eg-text);
    z-index: 1;
}

.game-title {
    font-size: clamp(16px, 3vw, 22px);
    font-weight: 700;
    color: var(--eg-primary);
    margin-bottom: 10px;
}

.teams {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: start;
    gap: 12px;
    margin-bottom: 10px;
}

.team {
    text-align: center;
    display: flex;
    flex-direction: column;
}

.team-name {
    font-size: 16px;
    font-weight: 600;
    margin-top: 4px;
    order: 2;
}

.team-score {
    font-size: clamp(32px, 8vw, 48px);
    font-weight: 700;
    font-family: 'Barlow Condensed', sans-serif;
    transition: transform 0.3s ease;
    order: 1;
}

.team-score.updated {
    animation: scoreUpdate 0.5s ease;
}

.team.home .team-score {
    color: var(--eg-home);
}

.team.home .team-name {
    color: var(--eg-home);
}

.team.away .team-score {
    color: var(--eg-away);
}

.team.away .team-name {
    color: var(--eg-away);
}

.team-score.home-score {
    color: var(--eg-home);
}

.team-score.away-score {
    color: var(--eg-away);
}

/* Higher specificity rules for Over-Under games to override team colors */
.team.home .team-score.away-score {
    color: var(--eg-away);
}

.team.home .team-score.home-score {
    color: var(--eg-home);
}

/* Over-Under game type layout */
.teams.over-under {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 0;
}

.teams.over-under .team.home {
    display: contents;
}

.teams.over-under .team-name {
    order: 1;
    margin-top: 0;
    font-size: clamp(32px, 8vw, 48px);
    font-weight: 700;
    text-align: left;
    padding-right: 0;
}

.teams.over-under .team-name::after {
    content: ' :';
}

.teams.over-under .team-score {
    order: 2;
    font-size: clamp(32px, 8vw, 48px);
    text-align: center;
}

@keyframes scoreUpdate {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

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

.end-display {
    font-size: 16px;
    font-weight: 600;
    color: var(--eg-text-muted);
    background: var(--eg-bg-alt);
    padding: 6px 14px;
    border-radius: 16px;
    white-space: nowrap;
}

.slider-container {
    margin: 10px 0;
    padding: 12px 16px;
    background: var(--eg-bg);
    border-radius: 12px;
}

.slider-labels {
    display: none;
    justify-content: space-between;
    margin-bottom: 8px;
}

.slider-labels.show {
    display: flex;
}

.slider-label {
    font-size: 18px;
    font-weight: 600;
}

.slider-label.home {
    color: var(--eg-home);
    text-align: left;
}

.slider-label.away {
    color: var(--eg-away);
    text-align: right;
}

.slider-score-display {
    text-align: center;
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--eg-primary);
    transition: color 0.2s ease, transform 0.1s ease;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slider-score-display.home-score {
    color: var(--eg-home);
}

.slider-score-display.away-score {
    color: var(--eg-away);
}

.slider-score-display.zero {
    color: var(--eg-text-light);
}

.slider-wrapper {
    position: relative;
    height: 64px;
    margin-bottom: 10px;
}

.slider {
    width: 100%;
    height: 12px;
    border-radius: 6px;
    background: linear-gradient(to right, var(--eg-home) 0%, var(--eg-border) 50%, var(--eg-away) 100%);
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
}

.slider-thumb {
    width: 50px;
    height: 50px;
    background: white;
    border: 4px solid var(--eg-primary);
    border-radius: 50%;
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    cursor: grab;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0;
    font-weight: 700;
    transition: border-color 0.2s, background 0.2s;
}

.slider-thumb:active {
    cursor: grabbing;
}

.slider-thumb.home-score {
    border-color: var(--eg-home);
    background: color-mix(in srgb, var(--eg-home) 10%, white);
    color: var(--eg-home);
}

.slider-thumb.away-score {
    border-color: var(--eg-away);
    background: color-mix(in srgb, var(--eg-away) 10%, white);
    color: var(--eg-away);
}

.ends-list {
    height: 250px;
    overflow-y: scroll;
    overflow-x: hidden;
    margin-bottom: 16px;
    border: 1px solid var(--eg-border);
    border-radius: 8px;
    background: var(--eg-surface);
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    position: relative;
    touch-action: pan-y;
    will-change: scroll-position;
}

.ends-header {
    display: grid;
    grid-template-columns: 1fr 80px 1fr 40px;
    align-items: center;
    padding: 12px 16px 12px 12px;
    background: var(--eg-surface-alt);
    border-bottom: 2px solid var(--eg-border);
    font-weight: 600;
    color: var(--eg-text);
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
}

.ends-header > div {
    text-align: center;
}

.end-item-wrapper {
    position: relative;
    overflow: hidden;
}

.end-item {
    display: grid;
    grid-template-columns: 1fr 80px 1fr 40px;
    align-items: center;
    padding: 12px 16px 12px 12px;
    border-bottom: 1px solid var(--eg-border);
    transition: transform 0.3s ease, background 0.15s ease;
    background: var(--eg-surface);
    position: relative;
    z-index: 1;
    width: 100%;
    box-sizing: border-box;
}

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

.end-delete-btn {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 80px;
    background: #f87171;
    color: white;
    border: none;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    touch-action: manipulation;
    z-index: 0;
}

.end-delete-btn:active {
    background: #ef4444;
}

.end-edit-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: var(--eg-primary);
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
    touch-action: manipulation;
}

@media (hover: hover) {
    .end-edit-btn:hover {
        background: var(--eg-bg-alt);
        color: var(--eg-secondary);
    }
}

.end-edit-btn:active {
    background: var(--eg-border);
    transform: scale(0.9);
}

.end-number {
    font-weight: 600;
    color: var(--eg-text);
    text-align: center;
    font-size: 16px;
    border-left: 1px solid var(--eg-border);
    border-right: 1px solid var(--eg-border);
}

.end-scores {
    display: contents;
}

.end-score {
    font-size: 18px;
    font-weight: 600;
    padding: 0 8px;
    text-align: center;
}

.end-score.home {
    color: var(--eg-home);
}

.end-score.away {
    color: var(--eg-away);
}

.loading {
    display: none;
    text-align: center;
    padding: 40px;
    color: white;
    font-size: 18px;
}

.loading.active {
    display: block;
}

.error {
    background: #fee;
    color: #c33;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 16px;
}

.hidden {
    display: none;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: var(--z-modal);
    padding: 20px;
}

.modal:not(.hidden) {
    display: flex;
}

.modal-content {
    background: white;
    padding: 24px;
    border-radius: 16px;
    max-width: 400px;
    width: 100%;
}

.modal-buttons {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.modal-buttons .btn {
    margin: 0;
}

.modal-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: -24px -24px 20px -24px;
    padding: 16px 20px;
    background: linear-gradient(135deg, var(--eg-primary) 0%, var(--eg-secondary) 100%);
    border-radius: 16px 16px 0 0;
    border-bottom: none;
}

.modal-close-btn {
    background: none;
    border: none;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.85);
    border-radius: 6px;
    transition: all 0.2s;
    flex-shrink: 0;
}

.modal-close-btn:hover {
    background: rgba(255,255,255,0.2);
    color: white;
}

.modal-close-btn:active {
    transform: scale(0.95);
    background: rgba(255,255,255,0.3);
}

.modal-title {
    flex: 1;
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: white;
}

.players-list {
    font-size: 16px;
}

.players-grid {
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: 12px 16px;
    line-height: 1.8;
}

.player-position {
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.player-name {
    color: var(--eg-text);
    font-size: 16px;
}

.players-list .empty-state {
    color: var(--eg-text-light);
    text-align: center;
    padding: 20px;
    font-style: italic;
}

.confirm-modal-content {
    text-align: center;
}

.confirm-modal-content h2 {
    margin-bottom: 8px;
}

.confirm-modal-content p {
    color: #666;
    margin-bottom: 24px;
}

.end-game-btn {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: white;
    font-size: 14px;
    padding: 12px;
    border: none;
}

@media (hover: hover) {
    .end-game-btn:hover {
        background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(245, 158, 11, 0.4);
    }
}

.end-game-btn:active {
    transform: translateY(0);
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-loading);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
}

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

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--eg-border);
    border-top-color: var(--eg-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
/* Smaller inline spinner (32px, centred) */
.loading-spinner {
    width: 32px; height: 32px;
    border: 3px solid var(--eg-border);
    border-top-color: var(--eg-primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    margin: 40px auto;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ══════════════════════════════════════════════════════════
   Shared Page Components
   ══════════════════════════════════════════════════════════ */

/* ── Page Header ──────────────────────────────────────── */
.page-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-shrink: 0;
}

.hero-circle {
    position: absolute;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    pointer-events: none;
    z-index: 0;
}
.page-header-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.page-header-body h2 {
    margin-bottom: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.page-header-sub {
    font-size: 13px;
    color: var(--eg-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}
/* Kept for pages not yet migrated to .page-header-body */
.page-header h2 {
    flex: 1;
    margin-bottom: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Context strip (MatchScore immersive mode) ─────────── */
.context-strip {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    padding: 0 4px;
    margin-bottom: 8px;
}
.context-strip.hidden {
    display: none;
}
.context-strip-back {
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    line-height: 1;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    cursor: pointer;
    touch-action: manipulation;
    flex-shrink: 0;
}
.context-strip-back:active {
    color: white;
}
#contextLabel {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.75);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}
#contextLabel a {
    color: inherit;
    text-decoration: none;
}
#contextLabel a:active {
    color: white;
}

/* ── Card-scoped loading overlay ──────────────────────── */
.card-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-card-overlay);
    border-radius: 12px;
}
.card-overlay.hidden { display: none; }
.loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--eg-border);
    border-top-color: var(--eg-primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

/* ── Tabs ─────────────────────────────────────────────── */
.tab-bar {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--eg-border);
    margin-bottom: 16px;
    flex-shrink: 0;
}
.tab-btn {
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 600;
    color: var(--eg-text-muted);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    font-family: inherit;
}
.tab-btn.active {
    color: var(--eg-primary);
    border-bottom-color: var(--eg-primary);
}
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── List items ───────────────────────────────────────── */
.list-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--eg-surface);
    border-radius: 10px;
    padding: 14px 48px 14px 16px;
    margin-bottom: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    cursor: pointer;
    transition: box-shadow 0.15s, opacity 0.1s;
}
@media (hover: hover) {
    .list-item:hover {
        /* No transform — transform creates a stacking context that traps
           position:fixed ctx-menu descendants, causing incorrect positioning */
        box-shadow: 0 4px 12px rgba(0,0,0,0.1);
        background: var(--eg-bg-alt);
    }
}
.list-item:active { opacity: 0.85; }
.list-item.archived { opacity: 0.5; }
.list-item.past { background: var(--eg-bg-alt); }
.item-icon { font-size: 24px; flex-shrink: 0; }
.item-info { flex: 1; min-width: 0; }
.item-info h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--eg-text);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.item-info p { font-size: 12px; color: var(--eg-text-light); margin: 0; }
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid transparent;
}
.item-badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
    flex-shrink: 0;
}
.badge-archived    { background: var(--eg-status-archived-bg); color: var(--eg-status-archived-text); border: 1px solid var(--eg-status-archived-border); }
.badge-active      { background: var(--eg-status-active-bg);   color: var(--eg-status-active-text);   border: 1px solid var(--eg-status-active-border); }
.badge-complete    { background: var(--eg-status-complete-bg); color: var(--eg-status-complete-text); border: 1px solid var(--eg-status-complete-border); }
.badge-setup       { background: var(--eg-status-setup-bg);    color: var(--eg-status-setup-text);    border: 1px solid var(--eg-status-setup-border); }
.badge-in_progress { background: var(--eg-status-active-bg);   color: var(--eg-status-active-text);   border: 1px solid var(--eg-status-active-border); }

/* ── Page-level ⋯ button (sits in .page-header flex row, not absolutely positioned) */
.page-ctx-btn {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    font-size: 20px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    border-radius: 6px;
}
.page-ctx-btn:active { background: rgba(255, 255, 255, 0.4); }
@media (hover: hover) { .page-ctx-btn:hover { background: rgba(255, 255, 255, 0.3); } }

/* ── Context menu ─────────────────────────────────────── */
.ctx-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    color: var(--eg-text-light);
    border-radius: 6px;
}
.ctx-btn:hover { background: var(--eg-bg-alt); color: var(--eg-text-muted); }
.ctx-menu {
    position: absolute;
    background: var(--eg-surface);
    border: 1px solid var(--eg-border);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    min-width: 160px;
    z-index: var(--z-ctx-menu);
    display: none;
}
.ctx-menu.open { display: block; }
.ctx-menu.flip { top: auto; bottom: calc(50% + 20px); }
.ctx-menu-item {
    padding: 12px 16px;
    cursor: pointer;
    font-size: 14px;
    border-bottom: 1px solid var(--eg-bg-alt);
}
.ctx-menu-item:last-child { border-bottom: none; }
.ctx-menu-item:hover { background: var(--eg-bg); }
.ctx-menu-item.danger { color: #dc2626; }

/* ── Empty state ──────────────────────────────────────── */
.empty-state {
    display: flex; flex-direction: column; align-items: center; gap: 12px;
    padding: 48px 24px;
    color: var(--eg-text-muted);
    text-align: center;
}
/* New canonical child classes */
.empty-state-icon  { font-size: 40px; opacity: 0.5; }
.empty-state-title { font-size: 16px; font-weight: 600; color: var(--eg-text); }
.empty-state-sub   { font-size: 14px; }
/* Legacy aliases — kept for backward compatibility */
.empty-state .empty-icon  { font-size: 40px; opacity: 0.5; line-height: 1; }
.empty-state .empty-icon img { width: 48px; }
.empty-state .empty-hint  { font-size: 13px; }
.empty-state p            { font-size: 15px; }
.item-icon img            { width: 24px; }

/* ── Skeleton loading ─────────────────────────────────── */
@keyframes shimmer {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}
.skeleton-card {
    background: var(--eg-surface);
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    display: flex;
    align-items: center;
    gap: 12px;
}
.skeleton-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.skeleton-line {
    border-radius: 4px;
    background: var(--eg-bg-alt);
    position: relative;
    overflow: hidden;
}
.skeleton-line::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 0%, var(--eg-bg) 50%, transparent 100%);
    animation: shimmer 1.4s ease-in-out infinite;
}

/* ── Toast notification ───────────────────────────────── */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--eg-text);
    color: white;
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    z-index: var(--z-toast);
    transition: transform 0.3s ease;
    white-space: nowrap;
    pointer-events: none;
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.error { background: #dc2626; }

/* ── Modal overlay ────────────────────────────────────── */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: var(--z-modal);
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal-box {
    background: white;
    border-radius: 14px;
    padding: 24px;
    width: 100%;
    max-width: 520px;
    max-height: 88vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.modal-box h3 {
    margin: -24px -24px 20px;
    padding: 16px 24px;
    font-size: 18px;
    font-weight: 600;
    border-radius: 14px 14px 0 0;
    background: linear-gradient(135deg, var(--eg-primary), var(--eg-secondary));
    color: white;
}
.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}
.modal-actions .btn { flex: 1; }

/* Two-column modal layout — tablet and up */
@media (min-width: 768px) {
    .modal-cols {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0 40px;
    }
}

/* ── Section header (scrolling page sections) ─────────── */
.section-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 16px 8px;
    font-size: 12px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.5px;
    color: var(--eg-text-muted);
    border-top: 1px solid var(--eg-border);
}
.section-header:first-child { border-top: none; }

/* ── Section CTA button (compact, sits in section headers and toolbars) ── */
.section-cta-btn {
    padding: 5px 12px; min-height: 30px;
    font-size: 12px; font-weight: 600;
    border: none; border-radius: 6px;
    background: var(--eg-primary); color: white;
    cursor: pointer; font-family: inherit;
    flex-shrink: 0;
}
.section-cta-btn:active { opacity: 0.8; }
@media (hover: hover) { .section-cta-btn:hover { opacity: 0.88; } }

/* ── Toolbar ──────────────────────────────────────────── */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 8px;
    flex-shrink: 0;
}
.toolbar-buttons {
    display: flex;
    gap: 8px;
}
.btn-toolbar {
    padding: 10px 16px;
    min-height: 44px;
    font-size: 13px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    font-family: inherit;
}
.btn-toolbar:active { transform: scale(0.97); }

/* ── Inline form ──────────────────────────────────────── */
.form-inline {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}
.form-inline label {
    font-size: 13px;
    font-weight: 600;
    color: var(--eg-text-muted);
    white-space: nowrap;
    flex-shrink: 0;
    min-width: 80px;
}
.form-inline input,
.form-inline select {
    flex: 1;
    padding: 9px 12px;
    border: 2px solid var(--eg-border);
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    outline: none;
    box-sizing: border-box;
}
.form-inline input:focus,
.form-inline select:focus { border-color: var(--eg-primary); }
.form-inline .toggle-group { flex: 1; }
.form-inline.hidden { display: none; }

/* ── Shared form input (explicit class) ──────────────── */
.form-input {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid var(--eg-border);
    border-radius: var(--eg-radius-sm);
    font-family: inherit;
    font-size: 15px;
    color: var(--eg-text);
    background: var(--eg-surface);
    transition: border-color 0.2s;
    outline: none;
    box-sizing: border-box;
}
.form-input:focus {
    border-color: var(--eg-primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--eg-primary) 15%, transparent);
}
.form-input::placeholder { color: var(--eg-text-light); }

/* ── Form group descendant inputs (used by clubmaint, playermaint, memberinvites) */
.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid var(--eg-border);
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus { border-color: var(--eg-primary); }
.form-group textarea { resize: vertical; min-height: 80px; }

/* ── Search input ────────────────────────────────────── */
.search-bar input,
.search-wrap input,
.search-input {
    width: 100%;
    padding: 12px 16px 12px 40px;
    border: 2px solid var(--eg-border);
    border-radius: 10px;
    font-size: 15px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}
.search-bar input:focus,
.search-wrap input:focus,
.search-input:focus { border-color: var(--eg-primary); }
.search-bar::before,
.search-wrap::before {
    content: '\1F50D';
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    opacity: 0.4;
    pointer-events: none;
}

/* ── Form section title ───────────────────────────────── */
.form-section-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--eg-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
    margin-top: 16px;
}

/* ── Game type pills ──────────────────────────────────── */
.game-type-pills {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}
.game-pill {
    padding: 8px 16px;
    border: 2px solid var(--eg-border);
    border-radius: 8px;
    background: white;
    font-size: 13px;
    font-weight: 600;
    color: var(--eg-text-muted);
    cursor: pointer;
    font-family: inherit;
}
.game-pill.active {
    border-color: var(--eg-primary);
    background: #eef2ff;
    color: #4338ca;
}

/* ── Segmented toggle ─────────────────────────────────── */
.toggle-group {
    display: flex;
    background: var(--eg-bg-alt);
    border-radius: 8px;
    padding: 3px;
    gap: 2px;
}
.toggle-opt {
    padding: 8px 14px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    background: transparent;
    color: var(--eg-text-muted);
    white-space: nowrap;
    font-family: inherit;
}
.toggle-opt.active {
    background: white;
    color: var(--eg-text);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* ── Suppress number input spinner arrows ─────────────── */
input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Mobile optimizations */
@media (max-width: 640px) {
    body {
        padding: 8px;
    }

    .container {
        padding: 8px;
        border-radius: 12px;
        height: calc(100vh - 16px);
    }

    .card {
        padding: 12px;
        margin-bottom: 8px;
        border-radius: 10px;
    }

    h1 {
        font-size: 20px;
        margin-bottom: 12px;
    }

    h1.compact {
        display: none;
    }

    h2 {
        font-size: 18px;
        margin-bottom: 12px;
    }

    .game-header {
        margin-bottom: 12px;
        padding-bottom: 8px;
    }

    .team-score {
        font-size: 36px;
    }

    .slider-container {
        margin: 12px 0;
        padding: 12px;
    }

    .slider-score-display {
        font-size: 36px;
        min-height: 48px;
    }

    .ends-list {
        height: 230px;
    }

    .btn {
        padding: 14px;
        font-size: 16px;
    }
}

/* ══════════════════════════════════════════════════════════
   Global Navigation Drawer
   ══════════════════════════════════════════════════════════ */

/* ── Hamburger button ─────────────────────────────────── */
.hamburger-btn {
    min-width: 44px;
    min-height: 44px;
    border: none;
    background: var(--eg-bg-alt);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 4px;
    flex-shrink: 0;
    touch-action: manipulation;
    transition: background 0.2s;
}
.hamburger-btn:active { background: var(--eg-border); transform: scale(0.95); }
@media (hover: hover) { .hamburger-btn:hover { background: var(--eg-border); } }

/* Variant on dark/gradient page headers */
.page-header .hamburger-btn,
.hamburger-btn.on-dark {
    background: rgba(255, 255, 255, 0.2);
}
.page-header .hamburger-btn:active,
.hamburger-btn.on-dark:active { background: rgba(255, 255, 255, 0.4); }

.hamburger-bar {
    display: block;
    width: 18px;
    height: 2.5px;
    background: var(--eg-primary);
    border-radius: 2px;
    transition: background 0.2s;
}
.page-header .hamburger-bar,
.hamburger-btn.on-dark .hamburger-bar { background: white; }

/* Home page frosted header — push hamburger to far right */
.welcome-header .hamburger-btn { margin-left: auto; }

/* Fixed fallback (pages without .page-header) */
.hamburger-fixed {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: var(--z-hamburger);
}

/* ── Overlay ──────────────────────────────────────────── */
.nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: var(--z-nav-overlay);
    -webkit-backdrop-filter: blur(1px);
    backdrop-filter: blur(1px);
}
.nav-overlay.nav-overlay-open { display: block; }

/* ── Drawer ───────────────────────────────────────────── */
.nav-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(280px, 85vw);
    background: var(--eg-surface);
    z-index: var(--z-nav-drawer);
    display: flex;
    flex-direction: column;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.2);
    transform: translateX(100%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
}
.nav-drawer.nav-drawer-open { transform: translateX(0); }

/* ── Drawer header ────────────────────────────────────── */
.nav-drawer-header {
    position: relative;
    padding: 20px 16px 16px;
    background: linear-gradient(135deg, var(--eg-primary) 0%, var(--eg-secondary) 100%);
    flex-shrink: 0;
}
.nav-drawer-club {
    font-size: 16px;
    font-weight: 700;
    color: white;
    margin-bottom: 2px;
    padding-right: 32px;
}
.nav-drawer-user {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.75);
}
.nav-drawer-close {
    position: absolute;
    top: 14px;
    right: 12px;
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}
.nav-drawer-close:active { background: rgba(255, 255, 255, 0.35); }

/* ── Divider ──────────────────────────────────────────── */
.nav-drawer-divider {
    margin: 0;
    border: none;
    border-top: 1px solid var(--eg-border);
    flex-shrink: 0;
}

/* ── Nav list ─────────────────────────────────────────── */
.nav-drawer-list {
    list-style: none;
    padding: 8px 0;
    margin: 0;
    flex: 1;
}

.nav-drawer-item {
    display: block;
    width: 100%;
    padding: 14px 20px;
    font-size: 16px;
    font-weight: 500;
    color: var(--eg-text);
    text-decoration: none;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s;
    box-sizing: border-box;
}
@media (hover: hover) { .nav-drawer-item:hover { background: var(--eg-bg-alt); } }
.nav-drawer-item:active { background: var(--eg-border); }

.nav-drawer-item-active {
    color: var(--eg-primary);
    font-weight: 700;
    background: var(--eg-bg-alt);
}

/* ── Sign out ─────────────────────────────────────────── */
.nav-drawer-signout {
    color: var(--eg-text-muted);
    font-size: 15px;
}

/* ── Sub-360px safety net ─────────────────────────────── */
@media (max-width: 360px) {
    body { padding: 6px; }
    .container { padding: 8px; border-radius: 10px; }
    .btn { font-size: 16px; padding: 15px; }
}

/* ═══════════════════════════════════════════════════════
   Phase 4.5 — Visual Refresh
   ═══════════════════════════════════════════════════════ */

/* ── 4.5a Card elevation scale ────────────────────────── */
/* Flat — list rows, inline items */
.eg-surface-flat {
    background: var(--eg-surface);
    border: 1px solid var(--eg-border);
    border-radius: var(--eg-radius);
}
/* Raised — content cards, panels */
.eg-surface-raised {
    background: var(--eg-surface);
    border-radius: var(--eg-radius);
    box-shadow: 0 2px 8px rgba(0,0,0,0.07), 0 1px 2px rgba(0,0,0,0.05);
}
/* Elevated — modals, focused panels */
.eg-surface-elevated {
    background: var(--eg-surface);
    border-radius: var(--eg-radius-lg);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12), 0 2px 6px rgba(0,0,0,0.08);
}

/* ── 4.5b Section header accent bar ──────────────────── */
.section-header-label {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--eg-text-muted);
    padding-left: 10px;
    border-left: 3px solid var(--eg-primary);
}
.section-header-label.no-pipe { border-left: none; padding-left: 0; }

/* ── 4.5c Typography utility classes ─────────────────── */
.text-title  { font-size: 15px; font-weight: 600; color: var(--eg-text); }
.text-meta   { font-size: 13px; color: var(--eg-text-muted); }
.text-label  { font-size: 11px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--eg-text-muted); }

/* ── 4.5d Status chip polish ─────────────────────────── */
@keyframes badge-pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }
.badge-in_progress::before {
    content: '●';
    margin-right: 3px;
    font-size: 9px;
    color: var(--eg-status-active-text);
    animation: badge-pulse 1.5s ease infinite;
}

/* ── 4.5e List item press state ──────────────────────── */
/* opacity only — no transform (would create stacking context, trapping ctx-menu) */
.list-item:active {
    opacity: 0.82;
    background: var(--eg-surface-alt);
}

/* ── 4.5f Entrance animation ─────────────────────────── */
@keyframes fadeSlideUp {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}
.animate-in {
    animation: fadeSlideUp 0.25s ease both;
}

/* ── 4.5g Page toolbar + toolbar action button ────────── */
.page-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0 12px 0;
    border-bottom: 1px solid var(--eg-border);
    flex-shrink: 0;
}
.toolbar-action {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: var(--eg-radius-sm);
    background: linear-gradient(135deg, var(--eg-primary), var(--eg-secondary));
    color: white;
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    font-family: inherit;
    min-height: 36px;
}
.toolbar-action:active { opacity: 0.85; transform: scale(0.98); }
@media (hover: hover) { .toolbar-action:hover { opacity: 0.9; } }

/* ── About modal ─────────────────────────────────────── */
.about-modal-box {
    max-width: 340px;
    padding: 0;
    overflow: hidden;
}
.about-modal-box .modal-actions { justify-content: center; }
.about-modal-box .modal-actions .btn { flex: none; min-width: 100px; max-width: 140px; }
.about-modal-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 20px 20px 18px;
    background: linear-gradient(135deg, var(--eg-primary), var(--eg-secondary));
    border-radius: var(--eg-radius) var(--eg-radius) 0 0;
}
.about-logo {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    flex-shrink: 0;
}
.about-title {
    font-size: 20px;
    font-weight: 700;
    color: white;
}
.about-version {
    font-size: 13px;
    color: rgba(255,255,255,0.8);
    margin-top: 2px;
}
.about-body {
    padding: 18px 20px 4px;
}
.about-byline {
    font-size: 15px;
    font-weight: 600;
    color: var(--eg-text);
    margin: 0 0 6px;
}
.about-copy {
    font-size: 13px;
    color: var(--eg-text-muted);
    margin: 0 0 14px;
    line-height: 1.5;
}
.about-stack {
    background: var(--eg-surface-alt);
    border-radius: var(--eg-radius-sm);
    border: 1px solid var(--eg-border);
    overflow: hidden;
    margin-bottom: 6px;
}
.about-stack-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--eg-text-muted);
    padding: 8px 12px 4px;
}
.about-stack-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    border-top: 1px solid var(--eg-border);
}
.about-tier-badge {
    flex-shrink: 0;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 4px;
    min-width: 62px;
    text-align: center;
}
.about-tier-browser { background: #ede9fe; color: #7c3aed; }
.about-tier-api     { background: #dbeafe; color: #2563eb; }
.about-tier-lambda  { background: #ffedd5; color: #ea580c; }
.about-tier-dynamo  { background: #d1fae5; color: #059669; }
.about-tier-detail {
    flex: 1;
    font-size: 11px;
    font-family: ui-monospace, monospace;
    color: var(--eg-text-muted);
    min-width: 0;
}
.about-tier-ok  { color: #059669; font-weight: 700; font-size: 12px; }
.about-tier-err { color: #dc2626; font-size: 11px; }
.about-tier-ms  { color: var(--eg-text-light); font-size: 10px; }
.about-tier-spinner {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid var(--eg-border);
    flex-shrink: 0;
}
.about-tier-spinner.about-spinning {
    border-top-color: var(--eg-primary);
    animation: spin 0.7s linear infinite;
}

/* ── Card UI — shared component ─────────────────────────────
   Used by MatchManager, MatchSeries, MatchDay (and future list pages).
   Page-local rules (grid container) stay inline.
   ─────────────────────────────────────────────────────────── */

/* Base card */
.comp-card {
    background: #fff; border-radius: var(--eg-radius-lg);
    overflow: hidden; cursor: pointer;
    box-shadow:
        0 0 0 1px rgba(0,0,0,0.06),
        0 2px 6px rgba(0,0,0,0.06),
        0 8px 24px rgba(0,0,0,0.07);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}
.comp-card.archived { opacity: 0.5; }
@media (hover: hover) {
    .comp-card:hover {
        transform: translateY(-2px);
        box-shadow:
            0 0 0 1px rgba(0,0,0,0.07),
            0 4px 12px rgba(0,0,0,0.1),
            0 16px 40px rgba(0,0,0,0.1);
    }
}
.comp-card:active { transform: scale(0.975); transition-duration: 0.08s; }

/* 1. Header */
.comp-card-header {
    display: flex; align-items: center;
    gap: 12px; padding: 14px 12px 12px;
}
.comp-card-icon {
    width: 52px; height: 52px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; overflow: hidden;
}
.comp-card-icon img { width: 52px; height: 52px; object-fit: cover; }
.comp-card-icon-rink {
    background: linear-gradient(135deg, var(--eg-primary), var(--eg-secondary));
    font-size: 22px; font-weight: 800; color: white;
}
.comp-card-header-text { flex: 1; min-width: 0; }
.comp-card-title {
    font-size: 15px; font-weight: 700; color: var(--eg-text);
    margin: 0 0 3px; line-height: 1.2;
    display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.comp-card-subtitle {
    font-size: 12px; font-weight: 500; color: var(--eg-text-muted);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Management tray */
.card-action-tray { display: flex; align-items: center; gap: 5px; flex-shrink: 0; }
.tray-btn {
    width: 40px; height: 40px;
    border: 1.5px solid rgba(0,0,0,0.22); background: white;
    border-radius: 10px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    padding: 0; -webkit-tap-highlight-color: transparent;
    transition: transform 0.1s; box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.tray-btn:active { transform: scale(0.86); }
.tray-btn img { width: 24px; height: 24px; object-fit: contain; }
.tray-btn-pin.pinned { border-color: var(--eg-primary); background: rgba(102,126,234,0.1); }
@media (max-width: 767px) {
    .comp-card-header { flex-wrap: wrap; }
    .card-action-tray { width: 100%; justify-content: space-evenly; padding-top: 4px; }
    .comp-card-format .fmt-col-empty { display: none; }
}
@media (min-width: 768px) {
    .tray-btn { width: 46px; height: 46px; border-radius: 11px; }
    .tray-btn img { width: 28px; height: 28px; }
    .card-action-tray { gap: 7px; }
}

/* 2. Format band */
.comp-card-format {
    display: flex;
    border-top: 1px solid var(--eg-border);
    background: var(--eg-border); gap: 1px;
}
.fmt-type {
    flex: 1; display: flex; flex-direction: row;
    align-items: center; justify-content: center;
    gap: 10px; padding: 12px 10px; background: #f7f8fa;
}
.fmt-label { font-size: 13px; font-weight: 700; color: var(--eg-text-muted); letter-spacing: 0.2px; }
.fmt-clock {
    flex: 1; display: flex; flex-direction: row;
    align-items: center; justify-content: center;
    gap: 10px; padding: 12px 10px; background: #f7f8fa;
}
.fmt-clock-text { display: flex; flex-direction: column; gap: 2px; }
.fmt-time { font-size: 17px; font-weight: 800; color: var(--eg-text); letter-spacing: 0.5px; }
.fmt-sublabel {
    font-size: 9px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.7px; color: var(--eg-text-light);
}
.fmt-single-icon { width: 72px; height: 72px; object-fit: contain; flex-shrink: 0; }
.fmt-icon-away { width: 104px; height: 104px; }
.fmt-player-names { display: flex; flex-direction: column; gap: 2px; }
.fmt-player-name { font-size: 11px; font-weight: 500; color: var(--eg-text); white-space: nowrap; }
.fmt-player-skip { font-weight: 700; }

/* Diagonal shirt cascade */
.shirt-stack { position: relative; display: inline-block; flex-shrink: 0; }
.shirts-1 { width: 44px; height: 44px; }
.shirts-2 { width: 60px; height: 54px; }
.shirts-3 { width: 76px; height: 64px; }
.shirts-4 { width: 92px; height: 74px; }
.shirt-stack img {
    position: absolute; width: 44px; height: 44px; object-fit: contain;
    filter:
        drop-shadow( 2px  2px 0 #f7f8fa)
        drop-shadow(-2px -2px 0 #f7f8fa)
        drop-shadow( 2px -2px 0 #f7f8fa)
        drop-shadow(-2px  2px 0 #f7f8fa);
}
.shirt-stack img:nth-child(1) { top:  0px; left:  0px; z-index: 1; }
.shirt-stack img:nth-child(2) { top: 10px; left: 16px; z-index: 2; }
.shirt-stack img:nth-child(3) { top: 20px; left: 32px; z-index: 3; }
.shirt-stack img:nth-child(4) { top: 30px; left: 48px; z-index: 4; }

/* 3. Stat strip */
.comp-card-stats {
    display: flex;
    border-top: 1px solid var(--eg-border);
    background: var(--eg-border); gap: 1px;
}
.stat-cell {
    flex: 1; min-width: 0;
    display: flex; flex-direction: row;
    align-items: center; justify-content: center;
    gap: 10px; padding: 12px 10px; background: #fafafa;
}
.stat-cell-text { display: flex; flex-direction: column; gap: 2px; }
.stat-value { font-size: 26px; font-weight: 800; color: var(--eg-text); line-height: 1; }
.stat-label {
    font-size: 9px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.7px; color: var(--eg-text-light); white-space: nowrap;
}
.stat-icon { width: 48px; height: 48px; object-fit: contain; flex-shrink: 0; }
@media (min-width: 768px) {
    .stat-icon { width: 64px; height: 64px; }
    .stat-cell { padding: 16px 14px; gap: 14px; }
    .stat-value { font-size: 32px; }
}

/* 4. Navigation action strip */
.comp-card-actions {
    display: flex;
    border-top: 1px solid var(--eg-border);
    background: var(--eg-border); gap: 1px;
}
.card-nav-btn {
    flex: 1; display: flex; align-items: center; justify-content: center;
    gap: 8px; padding: 13px 8px;
    background: white; border: none; cursor: pointer;
    font-size: 13px; font-weight: 600; color: var(--eg-text);
    font-family: inherit; -webkit-tap-highlight-color: transparent;
    transition: background 0.1s;
}
.card-nav-btn:active { background: var(--eg-surface-alt); }
.card-nav-btn img { width: 32px; height: 32px; object-fit: contain; }
@media (min-width: 768px) {
    .card-nav-btn { padding: 15px 12px; font-size: 14px; }
    .card-nav-btn img { width: 36px; height: 36px; }
}

/* Type group divider — used by MatchManager, MatchSeries */
.type-divider {
    display: flex; align-items: center; gap: 10px; padding: 4px 0 2px;
}
.type-divider::before, .type-divider::after {
    content: ''; flex: 1; height: 1px; background: var(--eg-border);
}
.type-divider span {
    font-size: 11px; font-weight: 700; color: var(--eg-text-light);
    text-transform: uppercase; letter-spacing: 0.5px; white-space: nowrap;
}
/* ── Card UI — legacy action buttons (MatchSeries, MatchDay) ─
   These pages still use the old emoji-button card pattern.
   Remove once those pages are migrated to the new card layout.
   ─────────────────────────────────────────────────────────── */
.comp-card-controls { flex-shrink: 0; }
.comp-card-sep { height: 1px; background: var(--eg-border); width: 50%; margin: 0 auto; }
.comp-card-details { display: flex; background: #fff; }
.comp-detail-row {
    flex: 1; min-width: 0;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 2px; padding: 7px 4px;
}
.comp-detail-label {
    font-size: 9px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.6px; color: var(--eg-text-light); white-space: nowrap;
}
.comp-detail-value {
    font-size: 13px; font-weight: 700; color: var(--eg-text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    max-width: 100%; text-align: center;
}
.comp-card-action-btn {
    flex: 1;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 3px; padding: 8px 4px; min-height: 42px;
    background: var(--eg-surface); border: none; cursor: pointer;
    color: var(--eg-primary); -webkit-tap-highlight-color: transparent;
    transition: background 0.1s; min-width: 0;
}
@media (hover: hover) { .comp-card-action-btn:hover { background: var(--eg-surface-alt); } }
.comp-card-action-btn:active { background: var(--eg-surface-alt); }
.comp-action-icon { font-size: 15px; line-height: 1; }
.comp-action-label {
    font-size: 10px; font-weight: 600; letter-spacing: 0.1px; color: var(--eg-text-muted);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
}
.comp-card-action-btn.action-muted { color: var(--eg-text-muted); }

.about-tier-spinner.about-spinning { will-change: transform; }
