/*
 * Copyright (c) 2026 Write Words - Make Magic, LLC. All rights reserved.
 * SPDX-License-Identifier: LicenseRef-Proprietary
 */

/* ── Tournament Locked Status Banner ─────────────────────────────────────── */
.tournament-locked-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 20px;
    background: rgba(239, 68, 68, 0.15);
    border-bottom: 1px solid rgba(239, 68, 68, 0.4);
    color: #fca5a5;
    font-size: 0.92rem;
    font-weight: 700;
    text-align: center;
    letter-spacing: 0.02em;
    z-index: 11;
}

[data-theme="light"] .tournament-locked-banner {
    background: #fee2e2;
    border-color: #f87171;
    color: #991b1b;
}

/* ── Predictions Status & Action Toolbar ─────────────────────────────────── */
.predictions-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 12px 20px;
    background: var(--bg-card, #1e293b);
    border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
    flex-wrap: wrap;
    position: relative;
    z-index: 10;
}

.pred-status-group {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.pred-counter-pill,
.pred-champ-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 9999px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.85rem;
    font-weight: 600;
}

.pred-counter-pill .pill-label,
.pred-champ-pill .pill-label {
    color: var(--text-muted, #94a3b8);
}

.pred-counter-pill .pill-value {
    color: var(--accent-color, #38bdf8);
    font-family: monospace;
    font-size: 0.92rem;
}

.pred-champ-pill .pill-champ-name {
    color: #facc15;
    font-weight: 700;
}

.pred-actions-group {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-pred-submit,
.btn-pred-share,
.btn-pred-reset {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: none;
}

.btn-pred-submit {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-pred-submit:hover:not(:disabled) {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.45);
    transform: translateY(-1px);
}

.btn-pred-submit:disabled {
    background: #334155;
    color: #94a3b8;
    cursor: not-allowed;
    opacity: 0.65;
    box-shadow: none;
}

.btn-pred-share {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-pred-share:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.45);
    transform: translateY(-1px);
}

.btn-pred-reset {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-pred-reset:hover {
    background: rgba(239, 68, 68, 0.25);
    border-color: rgba(239, 68, 68, 0.5);
}

/* ── Spectator Banner ────────────────────────────────────────────────────── */
.spectator-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 10px 20px;
    background: linear-gradient(90deg, #1e1b4b 0%, #172554 100%);
    border-bottom: 1px solid rgba(129, 140, 248, 0.3);
    color: #f8fafc;
    font-size: 0.9rem;
    flex-wrap: wrap;
}

.spectator-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.spectator-badge {
    padding: 3px 8px;
    background: #4f46e5;
    color: #ffffff;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.05em;
}

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

.btn-create-own-bracket,
.btn-view-own-bracket {
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.btn-create-own-bracket {
    background: #38bdf8;
    color: #0f172a;
}

.btn-create-own-bracket:hover {
    background: #0ea5e9;
}

.btn-view-own-bracket {
    background: rgba(255, 255, 255, 0.12);
    color: #f8fafc;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-view-own-bracket:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ── Interactive Predictable Match Card Rows ─────────────────────────────── */
.match-card-node.is-prediction-mode .match-participant-row {
    cursor: pointer;
    transition: all 0.18s ease-in-out;
    position: relative;
    user-select: none;
}

.match-card-node.is-prediction-mode .match-participant-row:hover:not(.is-disabled) {
    background: rgba(56, 189, 248, 0.15) !important;
}

.match-participant-row.is-selected-winner {
    background: rgba(37, 99, 235, 0.2) !important;
    border-left: 3px solid #3b82f6;
}

.match-participant-row.is-selected-winner .participant-name,
.match-participant-row.is-selected-winner .participant-team-name {
    color: #60a5fa !important;
    font-weight: 800 !important;
}

.match-participant-row.is-selected-winner .participant-players-label {
    color: #93c5fd !important;
}

.match-participant-row.is-correct-pick {
    background: rgba(16, 185, 129, 0.28) !important;
    border-left: 3px solid #10b981 !important;
}

.match-participant-row.is-correct-pick .participant-name,
.match-participant-row.is-correct-pick .participant-team-name {
    color: #34d399 !important;
    font-weight: 800 !important;
}

.match-participant-row.is-correct-pick .participant-players-label {
    color: #a7f3d0 !important;
}

.match-participant-row.is-incorrect-pick {
    background: rgba(239, 68, 68, 0.16) !important;
    border-left: 3px solid #ef4444 !important;
    opacity: 0.6;
}

.match-participant-row.is-incorrect-pick .participant-name,
.match-participant-row.is-incorrect-pick .participant-team-name {
    text-decoration: line-through;
    color: #f87171 !important;
}

.match-participant-row.is-incorrect-pick .participant-players-label {
    text-decoration: line-through;
    color: #fca5a5 !important;
}

.pick-check-indicator.is-correct {
    background: #10b981 !important;
    color: #ffffff !important;
    font-weight: 900;
}

.pick-check-indicator.is-incorrect {
    background: #ef4444 !important;
    color: #ffffff !important;
    font-weight: 900;
}

.match-participant-row.is-unselected-loser {
    opacity: 0.45;
}

.match-participant-row.is-disabled {
    cursor: default;
    pointer-events: none;
}

.champ-pill-logo {
    width: 18px;
    height: 18px;
    object-fit: contain;
    border-radius: 3px;
    vertical-align: middle;
    margin-right: 6px;
}

/* Selected Winner Indicator Pill */
.pick-check-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #2563eb;
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 900;
    margin-left: auto;
    flex-shrink: 0;
    box-shadow: 0 0 8px rgba(37, 99, 235, 0.6);
}

/* Locked status badge on match card */
.match-card-node.is-locked .match-participant-row {
    cursor: default !important;
}

.locked-indicator-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: #fbbf24;
    border-radius: 4px;
    font-size: 0.68rem;
    font-weight: 700;
}

/* ── Modal Dialogs ───────────────────────────────────────────────────────── */
.pred-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: fadeInModal 0.2s ease-out;
}

@keyframes fadeInModal {
    from {
        opacity: 0;
        transform: scale(0.96);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.pred-modal-card {
    background: var(--bg-card, #1e293b);
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.15));
    border-radius: 14px;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
    overflow: hidden;
}

.pred-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: #0f172a;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.pred-modal-header h4 {
    margin: 0;
    color: var(--text-main, #f8fafc);
    font-size: 1.1rem;
    font-weight: 700;
}

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

.pred-modal-desc {
    margin: 0;
    color: var(--text-muted, #94a3b8);
    font-size: 0.9rem;
    line-height: 1.5;
}

.pred-modal-champ-preview {
    display: flex;
    align-items: center;
    gap: 14px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(250, 204, 21, 0.3);
    border-radius: 10px;
    padding: 14px;
}

.pred-modal-champ-preview .champ-icon {
    font-size: 2rem;
}

.pred-modal-champ-preview .champ-label {
    font-size: 0.72rem;
    font-weight: 800;
    color: #eab308;
    letter-spacing: 0.05em;
}

.pred-modal-champ-preview .champ-name {
    font-size: 1.05rem;
    font-weight: 800;
    color: #f8fafc;
    margin-top: 2px;
}

.pred-form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.pred-form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted, #94a3b8);
}

.pred-form-group input {
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(15, 23, 42, 0.6);
    color: var(--text-main, #f8fafc);
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s;
}

.pred-form-group input:focus {
    border-color: #38bdf8;
}

.pred-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 8px;
}

.btn-modal-cancel {
    padding: 8px 16px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #cbd5e1;
    font-weight: 600;
    cursor: pointer;
}

.btn-modal-cancel:hover {
    background: rgba(255, 255, 255, 0.15);
}

.btn-modal-confirm {
    padding: 8px 18px;
    border-radius: 6px;
    background: #10b981;
    border: none;
    color: #ffffff;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-modal-confirm:hover {
    background: #059669;
}

/* ── Share Modal Elements ────────────────────────────────────────────────── */
.share-url-container {
    display: flex;
    gap: 8px;
}

.share-url-container input {
    flex: 1;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(15, 23, 42, 0.8);
    color: #cbd5e1;
    font-size: 0.85rem;
    font-family: monospace;
    outline: none;
}

.btn-copy-url {
    padding: 10px 16px;
    border-radius: 8px;
    background: #38bdf8;
    color: #0f172a;
    font-weight: 700;
    border: none;
    cursor: pointer;
    flex-shrink: 0;
}

.btn-copy-url:hover {
    background: #0ea5e9;
}

.share-buttons-row {
    display: flex;
    gap: 10px;
}

.btn-share-reddit {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 8px;
    background: #ff4500;
    color: #ffffff;
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 700;
    transition: background 0.2s;
}

.btn-share-reddit:hover {
    background: #e03d00;
}

.toast-copied {
    padding: 8px 14px;
    border-radius: 6px;
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid #10b981;
    color: #34d399;
    font-size: 0.84rem;
    font-weight: 600;
    text-align: center;
}

/* ── Mobile Tweaks ───────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .predictions-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .pred-status-group,
    .pred-actions-group {
        justify-content: space-between;
        width: 100%;
    }

    .btn-pred-submit,
    .btn-pred-share {
        flex: 1;
        justify-content: center;
    }
}

/* ── Light Mode Styles ([data-theme="light"]) ────────────────────────────── */
[data-theme="light"] .predictions-toolbar {
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
}

[data-theme="light"] .pred-counter-pill,
[data-theme="light"] .pred-champ-pill {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
}

[data-theme="light"] .pred-counter-pill .pill-label,
[data-theme="light"] .pred-champ-pill .pill-label {
    color: #64748b;
}

[data-theme="light"] .pred-counter-pill .pill-value {
    color: #0284c7;
}

[data-theme="light"] .pred-champ-pill .pill-champ-name {
    color: #b45309;
}

[data-theme="light"] .btn-pred-submit:disabled {
    background: #e2e8f0;
    color: #94a3b8;
}

[data-theme="light"] .btn-pred-reset {
    background: #fee2e2;
    color: #dc2626;
    border-color: #fca5a5;
}

[data-theme="light"] .btn-pred-reset:hover {
    background: #fecaca;
    border-color: #f87171;
}

[data-theme="light"] .spectator-banner {
    background: linear-gradient(90deg, #e0e7ff 0%, #dbeafe 100%);
    border-bottom: 1px solid #bfdbfe;
    color: #1e1b4b;
}

[data-theme="light"] .spectator-badge {
    background: #3b82f6;
    color: #ffffff;
}

[data-theme="light"] .btn-view-own-bracket {
    background: #ffffff;
    color: #1e293b;
    border: 1px solid #cbd5e1;
}

[data-theme="light"] .btn-view-own-bracket:hover {
    background: #f8fafc;
}

[data-theme="light"] .match-card-node.is-prediction-mode .match-participant-row:hover:not(.is-disabled) {
    background: rgba(56, 189, 248, 0.12) !important;
}

[data-theme="light"] .match-participant-row.is-selected-winner {
    background: #eff6ff !important;
    border-left: 3px solid #2563eb;
}

[data-theme="light"] .match-participant-row.is-selected-winner .participant-name,
[data-theme="light"] .match-participant-row.is-selected-winner .participant-team-name {
    color: #1d4ed8 !important;
}

[data-theme="light"] .match-participant-row.is-selected-winner .participant-players-label {
    color: #2563eb !important;
}

[data-theme="light"] .match-divider {
    border-top: 1px solid #f1f5f9;
}

[data-theme="light"] .locked-indicator-pill {
    background: #fef3c7;
    border-color: #fcd34d;
    color: #b45309;
}

[data-theme="light"] .pred-modal-desc {
    color: #64748b;
}

[data-theme="light"] .pred-modal-champ-preview {
    background: #fefce8;
    border: 1px solid #fde047;
}

[data-theme="light"] .pred-modal-champ-preview .champ-label {
    color: #ca8a04;
}

[data-theme="light"] .pred-modal-champ-preview .champ-name {
    color: #0f172a;
}

[data-theme="light"] .pred-form-group label {
    color: #475569;
}

[data-theme="light"] .pred-form-group input {
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    color: #0f172a;
}

[data-theme="light"] .pred-form-group input:focus {
    border-color: #2563eb;
}

[data-theme="light"] .btn-modal-cancel {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    color: #475569;
}

[data-theme="light"] .btn-modal-cancel:hover {
    background: #e2e8f0;
}

[data-theme="light"] .share-url-container input {
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    color: #0f172a;
}

/* ── The Champion Prediction Pill (Further Above Championship Finals & Semifinals) ── */
.champion-prediction-node {
    position: absolute;
    bottom: calc(100% + 40px);
    left: 50%;
    transform: translateX(-50%);
    display: inline-flex;
    align-items: center;
    gap: 22px;
    padding: 24px 48px;
    border-radius: 9999px;
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.98) 0%, rgba(45, 34, 18, 0.98) 100%);
    border: 2.5px solid #f59e0b;
    box-shadow: 0 0 32px rgba(245, 158, 11, 0.45), 0 8px 26px rgba(0, 0, 0, 0.5);
    margin: 0;
    z-index: 10;
    animation: champPop 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    min-height: 112px;
    min-width: 480px;
    width: max-content;
    max-width: 720px;
    flex-shrink: 0;
    box-sizing: border-box;
    white-space: nowrap;
    pointer-events: auto;
}

@keyframes champPop {
    from {
        opacity: 0;
        transform: translate(-50%, -8px) scale(0.96);
    }

    to {
        opacity: 1;
        transform: translate(-50%, 0) scale(1);
    }
}

.champion-card-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.3) 0%, rgba(217, 119, 6, 0.15) 100%);
    border: 1.5px solid rgba(245, 158, 11, 0.4);
    flex-shrink: 0;
}

.champion-crown-icon {
    font-size: 2rem;
    line-height: 1;
}

.champion-team-logo {
    width: 60px;
    height: 60px;
    object-fit: contain;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.75);
    padding: 3px;
    border: 1.5px solid rgba(245, 158, 11, 0.4);
    flex-shrink: 0;
}

.champion-details {
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: 4px;
}

.champion-line-1 {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.champion-badge-text {
    font-size: 0.85rem;
    font-weight: 900;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #fbbf24;
}

.champion-team-title {
    font-size: 1.65rem;
    font-weight: 800;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

.champion-line-2 {
    min-width: 0;
}

.champion-players-subtitle {
    font-size: 1.5rem;
    font-weight: 700;
    color: #facc15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    line-height: 1.25;
    opacity: 0.95;
}

/* Light Mode Support for Champion Pill */
[data-theme="light"] .champion-prediction-node {
    background: linear-gradient(135deg, #ffffff 0%, #fef3c7 100%);
    border-color: #d97706;
    box-shadow: 0 0 24px rgba(217, 119, 6, 0.28), 0 6px 16px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .champion-card-badge {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-color: rgba(217, 119, 6, 0.4);
}

[data-theme="light"] .champion-badge-text {
    color: #92400e;
}

[data-theme="light"] .champion-team-title {
    color: #0f172a;
}

[data-theme="light"] .champion-players-subtitle {
    color: #b45309;
}

[data-theme="light"] .champion-team-logo {
    background: #ffffff;
    border-color: rgba(217, 119, 6, 0.35);
}

/* ── View Switcher Tabs (Bracket vs Leaderboard) ── */
.predictions-view-tabs {
    display: inline-flex;
    align-items: center;
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 4px;
    gap: 4px;
    margin: 12px auto 16px auto;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

.view-tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 9px;
    font-size: 0.92rem;
    font-weight: 700;
    color: #94a3b8;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.view-tab-btn:hover {
    color: #f8fafc;
    background: rgba(255, 255, 255, 0.05);
}

.view-tab-btn.is-active {
    color: #ffffff;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    box-shadow: 0 2px 10px rgba(37, 99, 235, 0.45);
}

.tab-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 8px;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 800;
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
}

[data-theme="light"] .predictions-view-tabs {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .view-tab-btn {
    color: #64748b;
}

[data-theme="light"] .view-tab-btn:hover {
    color: #0f172a;
    background: #f1f5f9;
}

[data-theme="light"] .view-tab-btn.is-active {
    color: #ffffff;
    background: #2563eb;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

/* ── Tiebreaker Stepper in Save Modal ── */
.tiebreaker-stepper-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 6px;
}

.tiebreaker-stepper-wrap input {
    width: 72px;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 800;
    text-align: center;
    background: #0f172a;
    border: 1px solid #334155;
    color: #ffffff;
}

.tiebreaker-stepper-wrap input:focus {
    border-color: #38bdf8;
    outline: none;
}

.tiebreaker-label {
    font-size: 0.88rem;
    color: #94a3b8;
    font-weight: 500;
}

.pred-form-help {
    display: block;
    font-size: 0.8rem;
    color: #64748b;
    margin-top: 2px;
    margin-bottom: 6px;
}

[data-theme="light"] .tiebreaker-stepper-wrap input {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #0f172a;
}

[data-theme="light"] .tiebreaker-label {
    color: #64748b;
}

/* ── Leaderboard View Layout ── */
.leaderboard-wrap {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 16px 0px 32px 0px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 20px;
    animation: fadeIn 0.25s ease-out;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.leaderboard-summary-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
}

.summary-metric-card {
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(8px);
    border-radius: 14px;
    padding: 14px 18px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.summary-metric-card .metric-label {
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #94a3b8;
}

.summary-metric-card .metric-value {
    font-size: 1.45rem;
    font-weight: 800;
    color: #ffffff;
}

[data-theme="light"] .summary-metric-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .summary-metric-card .metric-label {
    color: #64748b;
}

[data-theme="light"] .summary-metric-card .metric-value {
    color: #0f172a;
}

/* Leaderboard Toolbar */
.leaderboard-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.leaderboard-search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    padding: 8px 14px;
    flex: 1;
    max-width: 380px;
}

.leaderboard-search-box input {
    background: transparent;
    border: none;
    outline: none;
    color: #ffffff;
    font-size: 0.92rem;
    width: 100%;
}

.leaderboard-search-box input::placeholder {
    color: #64748b;
}

.btn-clear-search {
    background: transparent;
    border: none;
    color: #64748b;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0;
}

.leaderboard-filter-chips {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-chip {
    padding: 6px 14px;
    border-radius: 9999px;
    font-size: 0.82rem;
    font-weight: 700;
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.15s ease;
}

.filter-chip:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

.filter-chip.is-active {
    background: #3b82f6;
    border-color: #3b82f6;
    color: #ffffff;
}

[data-theme="light"] .leaderboard-search-box {
    background: #ffffff;
    border: 1px solid #cbd5e1;
}

[data-theme="light"] .leaderboard-search-box input {
    color: #0f172a;
}

[data-theme="light"] .filter-chip {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: #64748b;
}

[data-theme="light"] .filter-chip.is-active {
    background: #2563eb;
    border-color: #2563eb;
    color: #ffffff;
}

/* Standings Table */
.leaderboard-table-responsive {
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    overflow-x: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
    text-align: left;
}

.leaderboard-table th {
    background: rgba(15, 23, 42, 0.9);
    color: #94a3b8;
    font-weight: 700;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    white-space: nowrap;
}

.leaderboard-table td {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: #f1f5f9;
    vertical-align: middle;
}

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

.leaderboard-table tr.is-user-entry td {
    background: rgba(37, 99, 235, 0.12);
    border-bottom-color: rgba(37, 99, 235, 0.3);
}

.rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 28px;
    padding: 0 8px;
    border-radius: 9999px;
    font-weight: 900;
    font-size: 0.85rem;
    white-space: nowrap;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}

.rank-badge.rank-1 {
    background: linear-gradient(135deg, #f59e0b 0%, #b45309 100%);
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.5);
}

.rank-badge.rank-2 {
    background: linear-gradient(135deg, #94a3b8 0%, #64748b 100%);
    box-shadow: 0 0 10px rgba(148, 163, 184, 0.4);
}

.rank-badge.rank-3 {
    background: linear-gradient(135deg, #d97706 0%, #92400e 100%);
    box-shadow: 0 0 10px rgba(217, 119, 6, 0.4);
}

.player-name-cell {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
}

.user-you-tag {
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
    background: #2563eb;
    color: #ffffff;
    font-weight: 800;
    text-transform: uppercase;
}

.col-score-value {
    font-size: 1.15rem;
    font-weight: 900;
    color: #38bdf8;
}

.tiebreaker-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.06);
    color: #e2e8f0;
}

.tiebreaker-diff-badge {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 800;
    background: #10b981;
    color: #ffffff;
}

.champ-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 9999px;
    font-size: 0.82rem;
    font-weight: 700;
}

.champ-status-pill.is-alive {
    background: rgba(37, 99, 235, 0.15) !important;
    border: 1px solid rgba(59, 130, 246, 0.35) !important;
    color: #60a5fa !important;
}

[data-theme="light"] .champ-status-pill.is-alive {
    background: #eff6ff !important;
    border: 1px solid #93c5fd !important;
    color: #1d4ed8 !important;
}

.champ-status-pill.is-crowned {
    background: rgba(16, 185, 129, 0.15) !important;
    border: 1px solid rgba(16, 185, 129, 0.35) !important;
    color: #34d399 !important;
}

.champ-status-pill.is-eliminated {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #f87171;
    text-decoration: line-through;
}

.btn-inspect-bracket {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 700;
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.3);
    color: #38bdf8;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-inspect-bracket:hover {
    background: #0284c7;
    border-color: #0284c7;
    color: #ffffff;
}

.lb-loading-cell {
    text-align: center;
    padding: 40px !important;
    color: #94a3b8;
    font-style: italic;
}

/* Light Mode Standings Table */
[data-theme="light"] .leaderboard-table-responsive {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .leaderboard-table th {
    background: #f8fafc;
    color: #64748b;
    border-bottom-color: #e2e8f0;
}

[data-theme="light"] .leaderboard-table td {
    border-bottom-color: #f1f5f9;
    color: #1e293b;
}

[data-theme="light"] .leaderboard-table tr:hover td {
    background: #f8fafc;
}

[data-theme="light"] .leaderboard-table tr.is-user-entry td {
    background: #eff6ff;
    border-bottom-color: #bfdbfe;
}

[data-theme="light"] .col-score-value {
    color: #0284c7;
}

[data-theme="light"] .tiebreaker-pill {
    background: #f1f5f9;
    color: #334155;
}

[data-theme="light"] .btn-inspect-bracket {
    background: #f0f9ff;
    border-color: #bae6fd;
    color: #0284c7;
}

[data-theme="light"] .btn-inspect-bracket:hover {
    background: #0284c7;
    color: #ffffff;
}

/* Scorecard Inspection Header Banner */
.inspection-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 18px;
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
    border: 1px solid #4338ca;
    border-radius: 10px;
    color: #ffffff;
    margin-bottom: 12px;
}

.inspection-title {
    font-weight: 700;
    font-size: 0.95rem;
}

.btn-back-leaderboard {
    padding: 5px 12px;
    border-radius: 6px;
    background: #ffffff;
    color: #1e1b4b;
    font-weight: 700;
    border: none;
    cursor: pointer;
}

[data-theme="light"] .inspection-banner {
    background: linear-gradient(135deg, #e0e7ff 0%, #ede9fe 100%);
    border-color: #c7d2fe;
    color: #1e1b4b;
}

[data-theme="light"] .btn-back-leaderboard {
    background: #4338ca;
    color: #ffffff;
}

/* Match Card Pick Evaluation Feedback */
.match-participant-row.is-correct-pick {
    background: rgba(16, 185, 129, 0.22) !important;
    border-left: 3px solid #10b981 !important;
}

.match-participant-row.is-correct-pick .participant-name,
.match-participant-row.is-correct-pick .participant-team-name {
    color: #34d399 !important;
    font-weight: 700 !important;
}

.match-participant-row.is-correct-pick .participant-players-label {
    color: #a7f3d0 !important;
}

.match-participant-row.is-incorrect-pick {
    background: rgba(239, 68, 68, 0.18) !important;
    border-left: 3px solid #ef4444 !important;
    opacity: 0.85;
}

.match-participant-row.is-incorrect-pick .participant-name,
.match-participant-row.is-incorrect-pick .participant-team-name {
    color: #f87171 !important;
    text-decoration: line-through;
}

.match-participant-row.is-incorrect-pick .participant-players-label {
    color: #fca5a5 !important;
    text-decoration: line-through;
}

.pick-result-tag {
    font-size: 0.75rem;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.pick-result-tag.correct {
    background: #10b981;
    color: #ffffff;
}

.pick-result-tag.incorrect {
    background: #ef4444;
    color: #ffffff;
}

/* Light mode for pick evaluation */
[data-theme="light"] .match-participant-row.is-correct-pick {
    background: #ecfdf5 !important;
    border-left: 3px solid #10b981 !important;
}

[data-theme="light"] .match-participant-row.is-correct-pick .participant-name,
[data-theme="light"] .match-participant-row.is-correct-pick .participant-team-name {
    color: #059669 !important;
}

[data-theme="light"] .match-participant-row.is-correct-pick .participant-players-label {
    color: #047857 !important;
}

[data-theme="light"] .match-participant-row.is-incorrect-pick {
    background: #fef2f2 !important;
    border-left: 3px solid #ef4444 !important;
}

[data-theme="light"] .match-participant-row.is-incorrect-pick .participant-name,
[data-theme="light"] .match-participant-row.is-incorrect-pick .participant-team-name {
    color: #dc2626 !important;
}

[data-theme="light"] .match-participant-row.is-incorrect-pick .participant-players-label {
    color: #dc2626 !important;
    text-decoration: line-through;
}

/* ── Bracket Transfer Link Footer & Modal ────────────────────────────────── */
.bracket-transfer-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 8px 16px 2px;
    background: transparent;
}

.btn-transfer-bracket-link {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
    padding: 4px 8px;
    border-radius: 6px;
    transition: color 0.15s ease, background 0.15s ease;
}

.btn-transfer-bracket-link:hover {
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.08);
}

.transfer-warning-box {
    background: rgba(239, 68, 68, 0.14);
    border: 1px solid rgba(239, 68, 68, 0.45);
    border-left: 4px solid #ef4444;
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 12px;
}

.transfer-warning-title {
    color: #f87171;
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    margin-bottom: 4px;
}

.transfer-warning-text {
    color: #fca5a5;
    font-size: 0.82rem;
    line-height: 1.45;
    margin: 0;
}

.btn-copy-url:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

[data-theme="light"] .btn-transfer-bracket-link {
    color: #64748b;
}

[data-theme="light"] .btn-transfer-bracket-link:hover {
    color: #0284c7;
    background: rgba(2, 132, 199, 0.08);
}

[data-theme="light"] .transfer-warning-box {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-left: 4px solid #dc2626;
}

[data-theme="light"] .transfer-warning-title {
    color: #b91c1c;
}

[data-theme="light"] .transfer-warning-text {
    color: #7f1d1d;
}

[data-theme="light"] .rank-badge {
    background: #e2e8f0;
    color: #0f172a;
}

/* ── Narrow Screen Leaderboard Optimizations (down to 350px) ─────────────── */
@media (max-width: 768px) {
    .leaderboard-wrap {
        gap: 14px;
    }

    .leaderboard-summary-bar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .summary-metric-card {
        padding: 10px 12px;
        border-radius: 12px;
    }

    .summary-metric-card .metric-label {
        font-size: 0.68rem;
        letter-spacing: 0.05em;
    }

    .summary-metric-card .metric-value {
        font-size: 1.15rem;
    }

    .leaderboard-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .leaderboard-search-box {
        max-width: 100%;
        width: 100%;
        padding: 7px 12px;
    }

    .leaderboard-filter-chips {
        width: 100%;
        flex-wrap: wrap;
        gap: 6px;
    }

    .filter-chip {
        padding: 5px 11px;
        font-size: 0.76rem;
    }

    .leaderboard-table th {
        padding: 10px 8px;
        font-size: 0.7rem;
        letter-spacing: 0.04em;
    }

    .leaderboard-table td {
        padding: 10px 8px;
        font-size: 0.82rem;
    }

    .rank-badge {
        min-width: 28px;
        height: 24px;
        padding: 0 6px;
        font-size: 0.76rem;
    }

    .col-score-value {
        font-size: 1rem;
    }

    .tiebreaker-pill,
    .champ-status-pill {
        padding: 3px 7px;
        font-size: 0.75rem;
        white-space: nowrap;
    }

    .btn-inspect-bracket {
        padding: 5px 8px;
        font-size: 0.75rem;
        white-space: nowrap;
    }
}

@media (max-width: 480px) {
    body {
        padding: 12px 6px;
    }

    .bracket-widget {
        padding: 14px 8px;
        border-radius: 12px;
    }

    .leaderboard-summary-bar {
        gap: 8px;
    }

    .summary-metric-card {
        padding: 8px 10px;
        border-radius: 10px;
    }

    .summary-metric-card .metric-label {
        font-size: 0.62rem;
        letter-spacing: 0.03em;
    }

    .summary-metric-card .metric-value {
        font-size: 1.02rem;
    }

    .filter-chip {
        padding: 4px 9px;
        font-size: 0.72rem;
    }

    .leaderboard-table-responsive {
        border-radius: 12px;
    }

    .leaderboard-table th {
        padding: 8px 5px;
        font-size: 0.64rem;
        letter-spacing: 0.02em;
    }

    .leaderboard-table td {
        padding: 8px 5px;
        font-size: 0.76rem;
    }

    .rank-badge {
        min-width: 24px;
        height: 22px;
        padding: 0 5px;
        font-size: 0.72rem;
    }

    .user-you-tag {
        font-size: 0.6rem;
        padding: 1px 4px;
    }

    .col-score-value {
        font-size: 0.92rem;
    }

    .tiebreaker-pill,
    .champ-status-pill {
        padding: 2px 6px;
        font-size: 0.7rem;
        gap: 4px;
    }

    .btn-inspect-bracket {
        padding: 4px 6px;
        font-size: 0.7rem;
    }

    .inspection-banner {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 10px 12px;
    }

    .inspection-title {
        font-size: 0.82rem;
    }
}

/* ── Bracket SVG Connectors (Missed vs Correct vs Active/Picked vs Neutral) ── */
.bracket-connector.connector-line--missed,
path.connector-line--missed {
    stroke: #ef4444 !important;
    stroke-width: 2.5px;
    filter: drop-shadow(0 0 3px rgba(239, 68, 68, 0.45));
}

.bracket-connector.connector-line--correct,
path.connector-line--correct {
    stroke: #10b981 !important;
    stroke-width: 2.5px;
    filter: drop-shadow(0 0 3px rgba(16, 185, 129, 0.45));
}

.bracket-connector.connector-line--active,
path.connector-line--active,
.bracket-connector.connector-line--picked,
path.connector-line--picked {
    stroke: #3b82f6 !important;
    stroke-width: 2.5px;
    filter: drop-shadow(0 0 3px rgba(59, 130, 246, 0.45));
}

.bracket-connector.connector-line--neutral,
path.connector-line--neutral {
    stroke: rgba(59, 130, 246, 0.25);
    stroke-width: 2px;
}

/* ── The Champion Prediction Pill (Eliminated & Winner States) ─────────────── */
.champion-prediction-node.is-champ-eliminated {
    border-color: #ef4444 !important;
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.98) 0%, rgba(65, 20, 20, 0.98) 100%) !important;
    box-shadow: 0 0 28px rgba(239, 68, 68, 0.4), 0 8px 26px rgba(0, 0, 0, 0.5) !important;
}

.champion-prediction-node.is-champ-eliminated .champion-card-badge {
    background: rgba(239, 68, 68, 0.25) !important;
    border-color: rgba(239, 68, 68, 0.5) !important;
}

.champion-prediction-node.is-champ-eliminated .champion-crown-icon {
    filter: grayscale(1);
    opacity: 0.65;
}

.champion-prediction-node.is-champ-eliminated .champion-team-title {
    text-decoration: line-through;
    color: #f87171 !important;
}

.champion-prediction-node.is-champ-eliminated .champion-badge-text {
    color: #f87171 !important;
}

.champion-prediction-node.is-champ-winner {
    border-color: #10b981 !important;
    box-shadow: 0 0 32px rgba(16, 185, 129, 0.45), 0 8px 26px rgba(0, 0, 0, 0.5) !important;
}

.champion-prediction-node.is-champ-winner .champion-badge-text {
    color: #34d399 !important;
}

[data-theme="light"] .champion-prediction-node.is-champ-eliminated {
    background: linear-gradient(135deg, #ffffff 0%, #fee2e2 100%) !important;
    border-color: #dc2626 !important;
    box-shadow: 0 0 24px rgba(220, 38, 38, 0.25), 0 6px 16px rgba(0, 0, 0, 0.08) !important;
}

[data-theme="light"] .champion-prediction-node.is-champ-eliminated .champion-team-title {
    color: #dc2626 !important;
}

[data-theme="light"] .champion-prediction-node.is-champ-eliminated .champion-badge-text {
    color: #991b1b !important;
}

/* Toolbar Champion Pill Eliminated State */
.pred-champ-pill.is-champ-eliminated {
    border-color: rgba(239, 68, 68, 0.4);
    background: rgba(45, 15, 15, 0.6);
}

.champ-pill-name.is-eliminated {
    text-decoration: line-through;
    color: #f87171 !important;
}

.champ-pill-elim-tag {
    font-size: 0.72rem;
    font-weight: 800;
    padding: 1px 5px;
    border-radius: 4px;
    background: #ef4444;
    color: #ffffff;
    margin-left: 6px;
}
