:root {
    --bg-dark: #000000;
    --bg-panel: #0b0b0b;
    --bg-card: #121212;
    --text-primary: #ffffff;
    --text-secondary: #a1a1aa;
    --accent: #244D44;
    --accent-hover: #1e4038;
    --maroon: #244D44;
    --maroon-hover: #1e4038;
    --border-color: rgba(255, 255, 255, 0.08);
    --danger: #ef4444;
    --success: #10b981;
    --warning: #eab308;
    --brand-blue: #244D44;
    --purple: #244D44;
    --purple-hover: #1e4038;
    --glass-bg: rgba(0, 0, 0, 0.7);
    --glass-border: rgba(255, 255, 255, 0.05);
    --glow-accent: rgba(36, 77, 68, 0.25);
    --glow-danger: rgba(239, 68, 68, 0.2);
    --glow-maroon: rgba(36, 77, 68, 0.25);
    --glow-navy: rgba(255, 255, 255, 0.05);
    --success-glow: rgba(16, 185, 129, 0.25);
    --cream: #F2E9D8;
}

.btn-maroon {
    background: var(--maroon);
    color: white;
    border: none;
    transition: all 0.3s ease;
}
.btn-maroon:hover {
    background: var(--maroon-hover);
    box-shadow: 0 0 15px var(--glow-navy);
    transform: translateY(-2px);
}

.btn-setup-load {
    background: var(--accent);
    border: 1px solid var(--accent);
    color: var(--cream);
    font-size: 12px;
    height: 38px;
    font-weight: 700;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
    width: 100%;
}

.btn-setup-load:hover {
    background: var(--cream);
    border-color: var(--accent);
    box-shadow: none !important;
    transform: translateY(-2px);
    color: var(--accent);
}

.glass-maroon {
    background: rgba(12, 29, 51, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
}

.btn-maroon-outline {
    background: transparent;
    border: 1px solid var(--maroon);
    transition: all 0.3s ease;
}
.btn-maroon-outline:hover {
    background: rgba(12, 29, 51, 0.1);
    color: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 0 10px var(--glow-maroon);
}

.bg-maroon-gradient {
    background: linear-gradient(135deg, #8B1E2B 0%, #EBB649 100%);
}

.bg-maroon-dark {
    background: linear-gradient(135deg, #2d0a0e 0%, #071426 100%);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-dark);
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    color: var(--text-primary);
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.app-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-width: 100%;
    margin: 0 auto;
    width: 100%;
    padding: 20px;
    gap: 20px;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
}

/* Header */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, var(--bg-panel) 0%, rgba(29,55,100,0.95) 100%);
    padding: 16px 30px;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.05);
    border: 1px solid var(--glass-border);
    position: relative;
    overflow: hidden;
}
.app-header::before {
    content: '';
    position: absolute;
    top: 0; left: -100%; width: 200%; height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    animation: headerShimmer 4s linear infinite;
}
@keyframes headerShimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.match-info h1 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 5px;
}

.match-info p {
    color: var(--text-secondary);
    font-size: 14px;
}

.header-actions {
    display: flex;
    gap: 15px;
}

.icon-btn {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 20px;
    cursor: pointer;
    transition: color 0.2s;
}

.icon-btn:hover {
    color: var(--accent);
}

/* Main Layout */
.main-content {
    display: grid;
    grid-template-columns: 350px 1fr 350px;
    gap: 20px;
    flex: 1;
    overflow: hidden;
}

/* Panels Common */
.scorecard-panel, .scoring-panel, .shortcuts-panel {
    background-color: var(--bg-panel);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
}

.panel-title {
    font-size: 18px;
    color: var(--warning);
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

/* Live Squad Section */
.live-squad-container {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px;
    max-height: 300px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.squad-player-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.03);
    transition: all 0.2s;
}

.squad-player-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--accent);
}

.squad-player-img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #1a1a2e;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid rgba(235, 182, 73, 0.3);
    flex-shrink: 0;
}

.squad-player-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.squad-player-img i {
    font-size: 14px;
    color: var(--accent);
    opacity: 0.7;
}

.squad-player-name {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Squad Comparison Styles */
.squad-comparison-container {
    background: var(--bg-panel);
    border-radius: 12px;
}

.squad-team-header-item {
    padding: 18px 25px;
    background: rgba(235, 182, 73, 0.03);
    display: flex;
    align-items: center;
    border: 1px solid rgba(255,255,255,0.05);
}
.squad-team-header-item.left {
    border-radius: 12px 0 0 12px;
    border-right: none;
    background: linear-gradient(90deg, rgba(235, 182, 73, 0.08), transparent);
}
.squad-team-header-item.right {
    border-radius: 0 12px 12px 0;
    justify-content: flex-end;
    background: linear-gradient(-90deg, rgba(235, 182, 73, 0.08), transparent);
}

.comparison-player-row {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    transition: all 0.3s ease;
}
.comparison-player-row:hover {
    background: rgba(255,255,255,0.02);
}
.comparison-player-row.right {
    flex-direction: row-reverse;
    text-align: right;
}

.comp-player-img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    background: #0a0a0a;
    border: 2px solid rgba(235, 182, 73, 0.2);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}
.comp-player-img img { width: 100%; height: 100%; object-fit: cover; }
.comp-player-img i { font-size: 20px; color: var(--accent); opacity: 0.5; }

.comp-player-info {
    margin: 0 15px;
    flex: 1;
    min-width: 0;
}
.comp-player-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    display: block;
    margin-bottom: 2px;
}
.comp-player-role {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Scorecard */
.main-score {
    text-align: center;
    padding: 20px 0;
    border-bottom: 1px solid var(--border-color);
    position: relative;
}

.main-score h2 {
    font-size: 64px;
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
    transition: transform 0.15s cubic-bezier(0.34,1.56,0.64,1);
    display: inline-block;
    letter-spacing: -2px;
}

.main-score h2.score-bump {
    transform: scale(1.08);
    color: var(--accent);
}

.main-score .overs {
    font-size: 22px;
    color: var(--text-secondary);
    font-weight: 500;
}

.batters-section {
    display: flex;
    flex-direction: column;
    border-bottom: 1px solid var(--border-color);
}

.batter {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
}

.batter:last-child {
    border-bottom: none;
}

.batter.active {
    background-color: rgba(196, 153, 58, 0.1);
    border-left: 4px solid var(--accent);
}

.batter-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
}

.bat-icon {
    color: var(--accent);
}

.bat-icon.inactive {
    color: var(--text-secondary);
}

.batter-score {
    margin-left: 10px;
    font-weight: 600;
}

.text-btn {
    background: transparent;
    border: none;
    color: var(--accent);
    cursor: pointer;
    font-size: 14px;
    text-decoration: underline;
}

.bowler-section {
    padding: 15px;
}

.bowler-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    margin-bottom: 15px;
}

.bowler-figures {
    margin-left: auto;
    font-weight: 600;
}

.delivery-types {
    display: flex;
    gap: 10px;
}

.delivery-btn {
    flex: 1;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    transition: all 0.2s;
}

.delivery-btn.active {
    border-color: var(--accent);
    background-color: rgba(196, 153, 58, 0.1);
}

.delivery-btn:hover {
    background-color: rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.stump-icon {
    font-family: monospace;
    font-weight: bold;
    color: var(--accent);
    letter-spacing: 2px;
}

/* Scoring Grid */
.scoring-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: minmax(80px, auto);
    gap: 15px;
    flex: 1;
}

.score-btn {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 14px;
    font-size: 28px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: all 0.15s cubic-bezier(0.34,1.56,0.64,1);
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
    position: relative;
    overflow: hidden;
}

.score-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(255,255,255,0.12), transparent 70%);
    opacity: 0;
    transition: opacity 0.2s;
}

.score-btn:hover::after {
    opacity: 1;
}

.score-btn[data-run="4"]:hover {
    border-color: var(--accent);
    box-shadow: 0 0 15px var(--glow-accent);
    color: var(--accent);
}

.score-btn[data-run="6"]:hover {
    border-color: #a855f7;
    box-shadow: 0 0 20px rgba(168,85,247,0.4);
    color: #a855f7;
}

.score-btn.out:hover,
.score-btn.undo:hover {
    background: var(--maroon);
    border-color: var(--maroon);
    box-shadow: 0 0 20px var(--glow-maroon);
    color: white;
}

.score-btn:active {
    transform: scale(0.92);
    background-color: rgba(255,255,255,0.08);
}

.score-btn span {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 400;
    margin-top: 5px;
}

.score-btn.extra {
    font-size: 20px;
    color: var(--text-secondary);
}

.score-btn.action {
    font-size: 20px;
}

.score-btn.undo {
    color: #60a5fa;
    border-color: rgba(96, 165, 250, 0.35);
}

.score-btn.out {
    color: #f87171;
    font-weight: 800;
    border-color: rgba(248, 113, 113, 0.35);
}

/* Shortcuts Grid */
.shortcuts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.shortcut-btn {
    background: var(--accent);
    border: 1px solid var(--accent);
    color: var(--cream);
    padding: 12px 10px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.shortcut-btn i {
    font-size: 18px;
    color: var(--cream);
    transition: all 0.3s;
}

.shortcut-btn:hover {
    background: var(--cream);
    color: var(--accent);
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: none !important;
}

.shortcut-btn:hover i {
    color: var(--accent);
    transform: scale(1.15);
}

.shortcut-btn:active {
    transform: translateY(0) scale(0.97);
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .main-content {
        grid-template-columns: 300px 1fr 250px;
    }
}

@media (max-width: 900px) {
    .main-content {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
    }
    
    .app-container {
        height: auto;
    }
}

/* This Over Timeline */
.this-over-container {
    margin-top: 15px;
    margin-bottom: 15px;
}

.this-over-container h4 {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 10px;
    font-weight: 500;
}

.balls-timeline {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    min-height: 36px;
}

.ball-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
}

.ball-circle.boundary {
    background-color: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.ball-circle.wicket {
    background-color: var(--danger);
    color: #fff;
    border-color: var(--danger);
}

.ball-circle.extra {
    background-color: var(--warning);
    color: #121212;
    border-color: var(--warning);
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.75);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(8px);
    transition: all 0.3s ease;
}

.modal-content {
    background-color: var(--bg-panel);
    border-radius: 16px;
    width: 90vw;
    max-width: 450px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
    overflow: hidden;
    animation: modalPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Floating Panel (For Overlay Admin) */
.floating-panel {
    background-color: transparent !important;
    backdrop-filter: none !important;
    justify-content: flex-end !important;
    align-items: flex-start !important;
    padding: 80px 20px !important;
    pointer-events: none !important;
}

.floating-panel .modal-content {
    pointer-events: auto !important;
    box-shadow: 0 10px 40px rgba(0,0,0,0.8) !important;
    border: 1px solid var(--purple) !important;
    position: absolute;
    right: 20px;
    top: 80px;
}

.draggable-header {
    cursor: move;
    background: linear-gradient(90deg, var(--bg-card), var(--bg-dark)) !important;
}

@keyframes modalPop {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
}

.close-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
}

.close-btn:hover {
    color: var(--danger);
}

.modal-body {
    padding: 20px;
}

/* Player List in Modal */
.player-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 300px;
    overflow-y: auto;
}

.player-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background-color: var(--bg-card);
    border-radius: 8px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s;
}

.player-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: var(--border-color);
}

.player-item.selected {
    border-color: var(--accent);
    background-color: rgba(196, 153, 58, 0.1);
}

/* Out Types */
.out-types-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.out-type-btn {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 15px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
}

.out-type-btn:hover {
    background-color: var(--danger);
    border-color: var(--danger);
    color: white;
}

/* Inputs */
.modern-input {
    width: 100%;
    padding: 12px 15px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 16px;
    outline: none;
}

.modern-input:focus {
    border-color: var(--accent);
    outline: none;
    background-color: rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 10px var(--glow-accent);
}

.modern-input option {
    background-color: #121212;
    color: #fff;
}

select.modern-input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23EBB649' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    padding-right: 40px;
}

/* Premium Setup Load Buttons */

/* Visual Feedback Animations */
.loaded-pulse {
    animation: successPulse 0.6s ease-out;
}

@keyframes successPulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 var(--success-glow); }
    50% { transform: scale(1.05); box-shadow: 0 0 20px 10px var(--success-glow); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 transparent; }
}

.player-count {
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.player-count.active-success {
    border-color: var(--success);
    background: rgba(16, 185, 129, 0.15) !important;
    box-shadow: 0 0 15px var(--success-glow);
}

.primary-btn {
    background-color: var(--accent);
    color: #121212;
    color: var(--cream) !important;
    border: 1px solid var(--accent);
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.primary-btn:hover {
    background-color: var(--cream) !important;
    color: var(--accent) !important;
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: none !important;
}

/* Full Scorecard */
.scorecard-content {
    max-width: 900px;
    width: 95%;
    max-height: 90vh;
    border: none;
    background: #000;
}

/* Broadcast Elite Scorecard Styles */
.scorecard-modal .bc-score-widget {
    background: #fff;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    border-radius: 8px;
}

.scorecard-modal #impacted-player-widget {
    background: linear-gradient(135deg, #1a1a1a, #0a0a0a);
    border: 1px solid rgba(196, 153, 58, 0.3);
    box-shadow: 0 10px 20px rgba(181, 49, 255, 0.15);
}

.scorecard-modal #impact-player-img-container {
    box-shadow: 0 0 15px rgba(196, 153, 58, 0.4);
}

.scorecard-body {
    padding: 30px;
    overflow-y: auto;
    max-height: calc(90vh - 65px);
    background: #0a0a0a;
}

.scorecard-header {
    text-align: center;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 20px;
    margin-bottom: 20px;
}

.scorecard-header h2 {
    font-size: 20px;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.scorecard-header h1 {
    font-size: 36px;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.scorecard-header p {
    font-size: 16px;
    color: var(--accent);
    font-weight: 600;
}

.scorecard-section-title {
    font-size: 16px;
    color: var(--warning);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 20px;
    margin-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 5px;
}

.table-responsive {
    overflow-x: auto;
    margin-bottom: 20px;
}

.scorecard-table {
    width: 100%;
    border-collapse: collapse;
    color: var(--text-primary);
    font-size: 14px;
}

.scorecard-table th {
    text-align: left;
    padding: 10px 8px;
    color: var(--text-secondary);
    font-weight: 500;
    border-bottom: 1px solid var(--border-color);
}

.scorecard-table td {
    padding: 10px 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.scorecard-table tr:last-child td {
    border-bottom: none;
}

.scorecard-table th:not(:first-child):not(:nth-child(2)),
.scorecard-table td:not(:first-child):not(:nth-child(2)) {
    text-align: center;
}

.scorecard-table td.player-name {
    font-weight: 600;
    color: var(--accent);
}

.scorecard-table td.dismissal-info {
    color: var(--text-secondary);
    font-size: 12px;
}

.scorecard-extras {
    background-color: var(--bg-card);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 14px;
}

.text-secondary {
    color: var(--text-secondary);
}

.fow-text {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 20px;
}

/* Setup Screen */
.setup-container {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    padding: 40px 20px;
    background-color: var(--bg-dark);
}

.setup-card {
    background-color: var(--bg-panel);
    padding: 25px;
    border-radius: 12px;
    width: 100%;
    max-width: 950px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    margin: 0 auto;
}

.setup-title {
    text-align: center;
    color: var(--text-primary);
    margin-bottom: 20px;
    font-size: 28px;
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    padding: 10px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tab-btn:hover {
    color: var(--text-primary);
    background: rgba(255,255,255,0.05);
}

.tab-btn.active {
    color: var(--cream);
    background: var(--accent);
}

.tournament-list-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: transform 0.2s;
}

.tournament-list-item:hover {
    transform: translateY(-2px);
    border-color: var(--accent);
}

.tournament-info h3 {
    margin: 0 0 5px 0;
    font-size: 16px;
    color: var(--text-primary);
}

.tournament-info p {
    margin: 0;
    font-size: 12px;
    color: var(--text-secondary);
}

.setup-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    margin-bottom: 30px;
}

@media (max-width: 768px) {
    .setup-grid {
        grid-template-columns: 1fr;
    }
}

.setup-team-box {
    background-color: var(--bg-card);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.setup-label {
    display: block;
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 8px;
    font-weight: 500;
}

.player-count {
    margin-top: 10px;
    font-size: 14px;
    color: var(--accent);
    font-weight: 600;
}

.toss-section {
    background-color: var(--bg-card);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    margin-bottom: 30px;
}

.manual-players-grid {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 20px;
}

.manual-players-grid input {
    padding: 8px 12px;
    font-size: 13px;
}

/* Player Photo Upload Button */
.player-photo-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    min-width: 32px;
    background: rgba(235, 182, 73, 0.1);
    border: 1px dashed rgba(235, 182, 73, 0.3);
    border-radius: 50%;
    cursor: pointer;
    color: rgba(235, 182, 73, 0.6);
    font-size: 12px;
    transition: all 0.2s ease;
}
.player-photo-btn:hover {
    background: rgba(235, 182, 73, 0.2);
    border-color: var(--accent);
    color: var(--accent);
    transform: scale(1.1);
}

/* Player Photo Preview Thumbnail */
.player-photo-preview {
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 50%;
    overflow: hidden;
    display: none;
    border: 2px solid rgba(16, 185, 129, 0.4);
    background: #000;
}
.player-photo-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.player-photo-preview.has-photo {
    display: flex;
    align-items: center;
    justify-content: center;
}

.setup-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
    background: rgba(255,255,255,0.03);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.05);
}

.setup-category-wrapper {
    margin-bottom: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Category Selector */
.category-selector {
    display: flex;
    gap: 20px;
    background: rgba(255,255,255,0.03);
    padding: 8px;
    border-radius: 50px;
    border: 1px solid rgba(255,255,255,0.05);
}

.category-option {
    cursor: pointer;
}

.category-option input {
    display: none !important;
}

.category-card {
    padding: 10px 24px;
    border-radius: 40px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-secondary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.category-card i {
    font-size: 16px;
}

.category-card span {
    font-size: 14px;
    font-weight: 600;
}

.category-option input:checked + .category-card {
    background: var(--accent);
    color: var(--cream) !important;
    box-shadow: none !important;
}

.category-option:not(:checked):hover .category-card {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

/* LIVE Indicator */
.live-indicator {
    background-color: rgba(255, 59, 48, 0.15);
    color: #ff3b30;
    border: 1px solid rgba(255, 59, 48, 0.3);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    letter-spacing: 1px;
}

.live-dot {
    width: 8px;
    height: 8px;
    background-color: #ff3b30;
    border-radius: 50%;
    animation: pulse-red 1.5s infinite;
}

.score-btn.free-hit {
    border-color: var(--danger);
    box-shadow: 0 0 15px rgba(244, 67, 54, 0.4);
    animation: freeHitGlow 1.5s infinite;
}

.export-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.export-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.export-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

@keyframes freeHitGlow {
    0% { box-shadow: 0 0 5px rgba(244, 67, 54, 0.4); }
    50% { box-shadow: 0 0 20px rgba(244, 67, 54, 0.8); }
    100% { box-shadow: 0 0 5px rgba(244, 67, 54, 0.4); }
}

@keyframes pulse-red {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.fa-spin {
    animation: spin 1s linear infinite;
}

/* Overlay Mode Styles */
body.overlay-mode {
    background-color: transparent !important;
}

body.overlay-mode .app-header,
body.overlay-mode .scoring-panel,
body.overlay-mode .shortcuts-panel,
body.overlay-mode .header-actions,
body.overlay-mode .text-btn,
body.overlay-mode .delivery-types,
body.overlay-mode #free-hit-indicator {
    display: none !important;
}

body.overlay-mode .app-container {
    padding: 0;
    max-width: 100%;
    justify-content: flex-end; /* Push to bottom */
}

body.overlay-mode .main-content {
    grid-template-columns: 1fr;
    height: auto;
    background: transparent;
}

body.overlay-mode .scorecard-panel {
    background: linear-gradient(90deg, rgba(13, 27, 46, 0.96) 0%, rgba(19, 33, 64, 0.82) 100%);
    border-radius: 0;
    flex-direction: row;
    align-items: center;
    justify-content: space-around;
    padding: 10px 40px;
    height: 100px;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    border-top: 3px solid var(--accent);
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

body.overlay-mode .main-score {
    padding: 0;
    border: none;
    text-align: left;
}

body.overlay-mode .main-score h2 {
    font-size: 32px;
}

body.overlay-mode .batters-section {
    flex-direction: row;
    border: none;
    gap: 40px;
}

body.overlay-mode .batter {
    padding: 0;
    border: none;
    background: transparent !important;
}

body.overlay-mode .bowler-section {
    padding: 0;
}

body.overlay-mode .this-over-container {
    display: none;
}

/* Celebration Overlay */
.celebration-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s ease;
}

body.overlay-mode .celebration-overlay {
    background: transparent !important;
    backdrop-filter: none !important;
}

.celebration-overlay.active {
    opacity: 1;
}

.celebration-content {
    text-align: center;
}

body.overlay-mode .celebration-content {
    transform: none; /* Centered on screen */
}


.celebration-content h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 15vw;
    font-weight: 800;
    text-transform: uppercase;
    margin: 0;
    padding: 20px;
    letter-spacing: -5px;
    transform: scale(0.3) rotate(-10deg);
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.celebration-overlay.active .celebration-content h1 {
    transform: scale(1) rotate(0deg);
    opacity: 1;
}

body.overlay-mode .celebration-content h1 {
    font-size: 8vw; /* Smaller for broadcast */
    letter-spacing: 0px;
}

/* ── THEME: CLASSIC (Default) ── */
.theme-classic .celebration-content h1 {
    transform: scale(0.3) rotate(-10deg);
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.celebration-overlay.active.theme-classic .celebration-content h1 {
    transform: scale(1) rotate(0deg);
}

/* ── THEME: STORM (Electric Storm) ── */
.theme-storm .celebration-content h1 {
    transform: scale(2);
    filter: blur(20px) brightness(2);
    transition: all 0.3s ease-out;
}
.celebration-overlay.active.theme-storm .celebration-content h1 {
    transform: scale(1);
    filter: blur(0px) brightness(1);
    animation: stormShake 0.1s infinite alternate;
}
@keyframes stormShake {
    0% { transform: translate(2px, 2px) rotate(0.5deg); }
    100% { transform: translate(-2px, -2px) rotate(-0.5deg); }
}
.theme-storm.celebration-overlay.active {
    background: rgba(255, 255, 255, 0.1);
    animation: stormFlash 0.5s infinite;
}
@keyframes stormFlash {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

/* ── THEME: GLASS (Modern Glass) ── */
.theme-glass .celebration-content {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 40px 100px;
    border-radius: 20px;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}
.celebration-overlay.active.theme-glass .celebration-content {
    transform: translateY(0);
    opacity: 1;
}
.theme-glass .celebration-content h1 {
    transform: none;
    letter-spacing: 15px;
    transition: letter-spacing 1s ease-out;
}
.celebration-overlay.active.theme-glass .celebration-content h1 {
    letter-spacing: 2px;
}

/* ── THEME: NEON (Cyberpunk) ── */
.theme-neon .celebration-content h1 {
    color: #fff;
    text-shadow: 0 0 5px #fff, 0 0 10px #fff, 0 0 20px #ff00de, 0 0 40px #ff00de, 0 0 80px #ff00de;
    transform: scale(0.8) skewX(-15deg);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.celebration-overlay.active.theme-neon .celebration-content h1 {
    transform: scale(1) skewX(0deg);
    opacity: 1;
    animation: neonFlicker 1.5s infinite alternate;
}
@keyframes neonFlicker {
    0%, 19%, 21%, 23%, 25%, 54%, 56%, 100% {
        text-shadow: 0 0 5px #fff, 0 0 10px #fff, 0 0 20px #ff00de, 0 0 40px #ff00de, 0 0 80px #ff00de;
    }
    20%, 24%, 55% {
        text-shadow: none;
    }
}
.theme-neon.celebration-overlay.active {
    background: rgba(10, 0, 20, 0.85);
    box-shadow: inset 0 0 50px rgba(255, 0, 222, 0.2);
}

/* ── THEME: GOLD (Premium/Championship) ── */
.theme-gold .celebration-content h1 {
    background: linear-gradient(to right, #bf953f, #fcf6ba, #b38728, #fbf5b7, #aa771c);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 5px 15px rgba(191, 149, 63, 0.5));
    transform: scale(1.5) translateY(-50px);
    opacity: 0;
    transition: all 1s cubic-bezier(0.23, 1, 0.32, 1);
    letter-spacing: 5px;
}
.celebration-overlay.active.theme-gold .celebration-content h1 {
    transform: scale(1) translateY(0);
    opacity: 1;
}
.theme-gold.celebration-overlay.active {
    background: radial-gradient(circle at center, rgba(30,25,10,0.9) 0%, rgba(0,0,0,0.95) 100%);
}

/* ── THEME: BLOOD MOON ── */
.theme-bloodmoon .celebration-content h1 {
    color: #ff1a1a;
    text-shadow: 0 0 10px #ff0000, 0 0 20px #990000;
    transform: scale(0.5);
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    letter-spacing: -5px;
}
.celebration-overlay.active.theme-bloodmoon .celebration-content h1 {
    transform: scale(1.2);
    letter-spacing: 5px;
    opacity: 1;
}
.theme-bloodmoon.celebration-overlay.active {
    background: radial-gradient(circle at center, rgba(50, 0, 0, 0.95), rgba(10, 0, 0, 1));
}

/* ── THEME: OCEANIC ── */
.theme-oceanic .celebration-content h1 {
    color: #00ffff;
    text-shadow: 0 0 15px #00ffff, 0 0 30px #0088ff;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.6s ease-out;
}
.celebration-overlay.active.theme-oceanic .celebration-content h1 {
    transform: translateY(0);
    opacity: 1;
}
.theme-oceanic.celebration-overlay.active {
    background: linear-gradient(180deg, rgba(0, 10, 30, 0.8), rgba(0, 40, 60, 0.95));
}

/* ── THEME: INFERNO (Fire & Heat) ── */
.theme-inferno .celebration-content h1 {
    background: linear-gradient(to bottom, #fff7e6 0%, #ff9900 40%, #cc2200 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 30px rgba(255, 80, 0, 0.8));
    transform: scale(0.5) translateY(60px);
    opacity: 0;
    transition: all 0.45s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.celebration-overlay.active.theme-inferno .celebration-content h1 {
    transform: scale(1) translateY(0);
    opacity: 1;
    animation: infernoFlicker 0.25s infinite alternate;
}
@keyframes infernoFlicker {
    0%  { filter: drop-shadow(0 0 20px rgba(255, 80,  0, 0.9)) brightness(1);   }
    100%{ filter: drop-shadow(0 0 60px rgba(255,140,  0, 1.0)) brightness(1.15); }
}
.theme-inferno.celebration-overlay.active {
    background: radial-gradient(circle at 50% 85%, rgba(200,50,0,0.9), rgba(10,0,0,0.98));
    animation: infernoBackground 1.5s ease-in-out infinite alternate;
}
@keyframes infernoBackground {
    0%  { background: radial-gradient(circle at 50% 85%, rgba(200,50,0,0.9), rgba(10,0,0,0.98)); }
    100%{ background: radial-gradient(circle at 50% 80%, rgba(230,80,0,0.85), rgba(20,5,0,0.98)); }
}

/* ── THEME: GALAXY (Deep Space) ── */
.theme-galaxy .celebration-content h1 {
    background: linear-gradient(135deg, #e0c3fc 0%, #8ec5fc 40%, #c2e9fb 70%, #e0c3fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-size: 300% auto;
    filter: drop-shadow(0 0 40px rgba(140,197,252,0.7));
    transform: scale(3);
    opacity: 0;
    transition: all 0.9s cubic-bezier(0.23, 1, 0.32, 1);
    animation: galaxyColorShift 4s linear infinite;
}
.celebration-overlay.active.theme-galaxy .celebration-content h1 {
    transform: scale(1);
    opacity: 1;
}
@keyframes galaxyColorShift {
    0%  { background-position: 0% center; }
    100%{ background-position: 300% center; }
}
.theme-galaxy.celebration-overlay.active {
    background: radial-gradient(ellipse at center, rgba(15,5,50,0.97) 0%, rgba(0,0,15,1) 100%);
    animation: galaxyPulse 4s ease infinite alternate;
}
@keyframes galaxyPulse {
    0%  { background: radial-gradient(ellipse at 45% 45%, rgba(15,5,50,0.97), rgba(0,0,10,1)); }
    50% { background: radial-gradient(ellipse at 55% 55%, rgba(30,10,80,0.97), rgba(0,0,20,1)); }
    100%{ background: radial-gradient(ellipse at 50% 50%, rgba(10,5,40,0.97), rgba(0,0,15,1)); }
}

/* ── THEME: MATRIX (Digital Rain) ── */
.theme-matrix .celebration-content h1 {
    color: #00ff41;
    text-shadow: 0 0 10px #00ff41, 0 0 20px #00ff41, 0 0 40px #00cc33, 0 0 80px #009922;
    font-family: 'Courier New', Courier, monospace;
    transform: translateY(-120vh);
    opacity: 0;
    transition: all 0.55s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.celebration-overlay.active.theme-matrix .celebration-content h1 {
    transform: translateY(0);
    opacity: 1;
    animation: matrixScan 0.12s infinite alternate;
}
@keyframes matrixScan {
    0%  { text-shadow: 0 0 10px #00ff41, 0 0 20px #00ff41; opacity: 1; }
    100%{ text-shadow: 0 0 5px #00ff41, 0 0 50px #00ff41, 0 0 100px #00cc33; opacity: 0.93; }
}
.theme-matrix.celebration-overlay.active {
    background: rgba(0, 5, 0, 0.96);
}
.theme-matrix .celebration-content {
    position: relative;
}

/* ── THEME: DIAMOND (Ice Crystal) ── */
.theme-diamond .celebration-content h1 {
    background: linear-gradient(135deg, #f0faff 0%, #a8d8f0 30%, #ffffff 50%, #c0e8ff 70%, #e8f8ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 25px rgba(180,220,255,0.95));
    transform: scale(0.05) rotate(45deg);
    opacity: 0;
    transition: all 0.55s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.celebration-overlay.active.theme-diamond .celebration-content h1 {
    transform: scale(1) rotate(0deg);
    opacity: 1;
    animation: diamondShimmer 1.2s ease-in-out infinite alternate;
}
@keyframes diamondShimmer {
    0%  { filter: drop-shadow(0 0 15px rgba(180,220,255,0.6)); }
    100%{ filter: drop-shadow(0 0 50px rgba(220,245,255,1.0)); }
}
.theme-diamond.celebration-overlay.active {
    background: linear-gradient(135deg, rgba(3,10,30,0.97), rgba(5,20,50,0.99));
}

/* ── THEME: AURORA (Northern Lights) ── */
.theme-aurora .celebration-content h1 {
    background: linear-gradient(to right, #43e97b, #38f9d7, #7f7fd5, #86a8e7, #91eae4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-size: 300% auto;
    filter: drop-shadow(0 0 30px rgba(67,233,123,0.6));
    transform: scale(0.85) translateY(-40px);
    opacity: 0;
    transition: all 0.9s cubic-bezier(0.23, 1, 0.32, 1);
    animation: auroraTextShift 3s linear infinite;
}
.celebration-overlay.active.theme-aurora .celebration-content h1 {
    transform: scale(1) translateY(0);
    opacity: 1;
}
@keyframes auroraTextShift {
    0%  { background-position:   0% center; }
    100%{ background-position: 300% center; }
}
.theme-aurora.celebration-overlay.active {
    animation: auroraBackground 5s ease infinite alternate;
}
@keyframes auroraBackground {
    0%  { background: linear-gradient(180deg, rgba(0,20,30,0.95), rgba(0,5,15,0.99)); }
    33% { background: linear-gradient(180deg, rgba(0,30,20,0.95), rgba(5,0,25,0.99)); }
    66% { background: linear-gradient(180deg, rgba(10,0,35,0.95), rgba(0,10,20,0.99)); }
    100%{ background: linear-gradient(180deg, rgba(0,25,25,0.95), rgba(0,5,10,0.99)); }
}

/* ── THEME: PRO SHIELD CELEBRATION ── */
.theme-pro-shield .celebration-content {
    position: relative;
    width: 85vw;
    height: 350px;
    max-width: 1000px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: visible;
}

.theme-pro-shield .celebration-content::before {
    content: '';
    position: absolute;
    left: 5%;
    width: 90%;
    height: 6px;
    background: linear-gradient(90deg, transparent, #dc2626 20%, #fbbf24 50%, #dc2626 80%, transparent);
    box-shadow: 0 0 20px rgba(220, 38, 38, 0.8), 0 0 35px rgba(251, 191, 36, 0.5);
    z-index: 10;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0;
}

.theme-pro-shield .celebration-content::after {
    content: '';
    position: absolute;
    left: 5%;
    width: 90%;
    height: 6px;
    background: linear-gradient(90deg, transparent, #dc2626 20%, #fbbf24 50%, #dc2626 80%, transparent);
    box-shadow: 0 0 20px rgba(220, 38, 38, 0.8), 0 0 35px rgba(251, 191, 36, 0.5);
    z-index: 10;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0;
}

@keyframes shield-bar-top {
    0% {
        top: 50%;
        transform: translateY(-50%);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    20% {
        top: 22%;
        transform: translateY(-50%);
        opacity: 1;
    }
    80% {
        top: 22%;
        transform: translateY(-50%);
        opacity: 1;
    }
    90% {
        top: 50%;
        transform: translateY(-50%);
        opacity: 1;
    }
    100% {
        top: 50%;
        transform: translateY(-50%);
        opacity: 0;
    }
}

@keyframes shield-bar-bottom {
    0% {
        top: 50%;
        transform: translateY(-50%);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    20% {
        top: 78%;
        transform: translateY(-50%);
        opacity: 1;
    }
    80% {
        top: 78%;
        transform: translateY(-50%);
        opacity: 1;
    }
    90% {
        top: 50%;
        transform: translateY(-50%);
        opacity: 1;
    }
    100% {
        top: 50%;
        transform: translateY(-50%);
        opacity: 0;
    }
}

.celebration-overlay.active.theme-pro-shield .celebration-content::before {
    animation: shield-bar-top 3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.celebration-overlay.active.theme-pro-shield .celebration-content::after {
    animation: shield-bar-bottom 3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes shield-text-zoom {
    0% {
        transform: scale(0) rotate(-6deg);
        opacity: 0;
        filter: blur(10px);
    }
    18% {
        transform: scale(0) rotate(-6deg);
        opacity: 0;
        filter: blur(10px);
    }
    28% {
        transform: scale(1.15) rotate(2deg);
        opacity: 1;
        filter: blur(0);
    }
    34% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
    78% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
        filter: blur(0);
    }
    85% {
        transform: scale(0.7) rotate(-3deg);
        opacity: 0.5;
        filter: blur(2px);
    }
    92% {
        transform: scale(0) rotate(5deg);
        opacity: 0;
        filter: blur(10px);
    }
    100% {
        transform: scale(0) rotate(5deg);
        opacity: 0;
    }
}

@keyframes shield-text-sheen {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.theme-pro-shield .celebration-content h1 {
    font-family: 'Outfit', 'Archivo Narrow', 'Impact', sans-serif !important;
    font-weight: 900 !important;
    text-transform: uppercase !important;
    letter-spacing: 8px !important;
    font-size: clamp(4.5rem, 8vw, 7.5rem) !important;
    margin: 0 !important;
    padding: 0 !important;
    text-align: center !important;
    z-index: 5 !important;
    background: linear-gradient(90deg, #ffffff 0%, #fbbf24 35%, #dc2626 50%, #fbbf24 65%, #ffffff 100%);
    background-size: 200% auto;
    color: transparent !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    filter: drop-shadow(0 0 10px rgba(220, 38, 38, 0.4)) drop-shadow(0 15px 30px rgba(0, 0, 0, 0.7));
    opacity: 0;
    transform: scale(0);
    transform-origin: center;
}

.celebration-overlay.active.theme-pro-shield .celebration-content h1 {
    animation: shield-text-zoom 3s cubic-bezier(0.25, 1, 0.5, 1) forwards,
               shield-text-sheen 3s linear infinite;
}

.theme-pro-shield .celebration-player {
    font-family: 'Outfit', sans-serif !important;
    font-size: 22px !important;
    font-weight: 800 !important;
    color: #fbbf24 !important;
    text-transform: uppercase !important;
    letter-spacing: 4px !important;
    margin-bottom: 10px !important;
    text-shadow: 0 4px 10px rgba(0,0,0,0.5) !important;
    opacity: 0;
    transform: translateY(-20px);
}

.celebration-overlay.active.theme-pro-shield .celebration-player {
    animation: shield-player-fade 3s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

.theme-pro-shield .celebration-stats {
    margin-top: 15px !important;
    opacity: 0;
    transform: translateY(20px);
}

.celebration-overlay.active.theme-pro-shield .celebration-stats {
    animation: shield-stats-fade 3s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

@keyframes shield-player-fade {
    0% { opacity: 0; transform: translateY(-20px); }
    20% { opacity: 0; }
    28% { opacity: 1; transform: translateY(0); }
    78% { opacity: 1; transform: translateY(0); }
    85% { opacity: 0; transform: translateY(-20px); }
    100% { opacity: 0; }
}

@keyframes shield-stats-fade {
    0% { opacity: 0; transform: translateY(20px); }
    20% { opacity: 0; }
    30% { opacity: 1; transform: translateY(0); }
    78% { opacity: 1; transform: translateY(0); }
    85% { opacity: 0; transform: translateY(20px); }
    100% { opacity: 0; }
}


/* Types */
.celebration-six {
    background: linear-gradient(135deg, #a855f7 0%, #ec4899 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 40px rgba(168, 85, 247, 0.6));
}

.celebration-four {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 30px rgba(255, 165, 0, 0.6));
}

.celebration-wicket {
    background: linear-gradient(135deg, #ef4444 0%, #991b1b 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 40px rgba(239, 68, 68, 0.6));
}

@keyframes celebrateIn {
    0% { transform: scale(0.5) rotate(-5deg); opacity: 0; }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

/* ── Animation Toggle Switch ── */
.anim-toggle-label {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
    flex-shrink: 0;
    cursor: pointer;
}

.anim-toggle-label input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.anim-toggle-track {
    position: absolute;
    inset: 0;
    border-radius: 28px;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.15);
    transition: background 0.3s, border-color 0.3s;
}

.anim-toggle-track::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.4);
    transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1);
}

.anim-toggle-label input:checked + .anim-toggle-track {
    background: #244D44;
    border-color: #244D44;
}

.anim-toggle-label input:checked + .anim-toggle-track::after {
    transform: translateX(22px);
}

/* Powerplay Badge */
.powerplay-badge {
    background-color: var(--danger);
    color: white;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: inline-block;
    margin-left: 10px;
    vertical-align: middle;
    box-shadow: 0 0 10px rgba(244, 67, 54, 0.3);
}

/* Break Overlay refinement */
#break-overlay h1 {
    text-shadow: 0 0 30px rgba(0, 188, 212, 0.5);
    color: var(--accent);
}

#break-overlay p {
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

/* Button Polish */
.out-type-btn {
    transition: transform 0.2s, background-color 0.2s, box-shadow 0.2s;
}

.out-type-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.score-btn.free-hit {
    border-color: #ffeb3b;
    color: #ffeb3b;
    box-shadow: 0 0 20px rgba(255, 235, 59, 0.4);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-card);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-color);
}

/* Fielder selection highlight */
.player-item.fielder-selected {
    border-color: var(--success);
    background-color: rgba(76, 175, 80, 0.1);
}

/* Quick stats in header */
#header-match-toss {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* Animation for toasts */
@keyframes toastIn {
    from { transform: translate(-50%, 20px); opacity: 0; }
    to { transform: translate(-50%, 0); opacity: 1; }
}

#app-toast {
    animation: toastIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Ball Type Selector */
.ball-type-selector {
    display: flex;
    gap: 10px;
}

.ball-option {
    flex: 1;
    cursor: pointer;
}

.ball-option input {
    display: none;
}

.ball-card {
    background-color: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.ball-card i, .ball-card svg {
    width: 20px;
    height: 20px;
}

.ball-svg {
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}


.ball-card span {
    font-size: 12px;
    font-weight: 600;
}

.ball-option input:checked + .ball-card {
    border-color: var(--accent);
    background-color: var(--accent);
    color: var(--cream) !important;
    box-shadow: none !important;
}

.ball-option:hover .ball-card {
    background-color: rgba(255, 255, 255, 0.05);
}

.category-option:not(:checked):hover .category-card {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

/* ═══════════════════════════════════════════════════════
   PREMIUM NEW FEATURES — Stream Scorer v4
═══════════════════════════════════════════════════════ */

/* ── Match Status Bar ── */
#match-status-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 6px 20px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    transition: all 0.4s ease;
}
#match-status-bar.status-live {
    background: rgba(255,59,48,0.12);
    border: 1px solid rgba(255,59,48,0.35);
    color: #ff5f52;
}
#match-status-bar.status-break {
    background: rgba(255,152,0,0.12);
    border: 1px solid rgba(255,152,0,0.35);
    color: var(--warning);
}
#match-status-bar.status-over {
    background: rgba(76,175,80,0.1);
    border: 1px solid rgba(76,175,80,0.3);
    color: var(--success);
}
#match-status-bar.status-idle {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--text-secondary);
}
.status-pulse {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: currentColor;
    animation: statusPulse 1.4s ease-in-out infinite;
}
@keyframes statusPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.7); }
}

/* ── Innings 1 Summary Strip (shown in Innings 2) ── */
#innings1-summary-strip {
    display: none;
    background: linear-gradient(135deg, rgba(196,153,58,0.08), rgba(30,62,106,0.5));
    border: 1px solid rgba(196,153,58,0.2);
    border-radius: 12px;
    padding: 10px 18px;
    margin-bottom: 6px;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    font-size: 13px;
    animation: slideDown 0.4s cubic-bezier(0.4,0,0.2,1);
}
#innings1-summary-strip.visible {
    display: flex;
}
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: translateY(0); }
}
.inn1-badge {
    background: rgba(196,153,58,0.15);
    border: 1px solid rgba(196,153,58,0.25);
    border-radius: 6px;
    padding: 3px 10px;
    font-size: 11px;
    color: var(--accent);
    font-weight: 700;
    white-space: nowrap;
}

/* ── Auto-Commentary Feed ── */
#commentary-feed {
    background: rgba(0,0,0,0.25);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 10px 14px;
    max-height: 100px;
    overflow-y: auto;
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-secondary);
    scroll-behavior: smooth;
}
#commentary-feed::-webkit-scrollbar { width: 4px; }
#commentary-feed::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 4px; }

.commentary-entry {
    border-left: 2px solid var(--border-color);
    padding-left: 8px;
    margin-bottom: 4px;
    animation: fadeSlideIn 0.35s ease;
}
.commentary-entry:last-child { border-left-color: var(--accent); }
.commentary-entry.boundary { border-left-color: var(--accent); color: var(--accent); }
.commentary-entry.six { border-left-color: #a855f7; color: #c084fc; }
.commentary-entry.wicket { border-left-color: var(--danger); color: #f87171; }
.commentary-entry.milestone { border-left-color: var(--success); color: #86efac; font-weight: 700; }
.commentary-entry.extra { border-left-color: var(--warning); color: var(--warning); }

@keyframes fadeSlideIn {
    from { opacity: 0; transform: translateX(-8px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* ── Ball Circle Pop-In Animation ── */
.ball-circle {
    animation: ballPop 0.25s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes ballPop {
    from { transform: scale(0); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}

/* ── Milestone Toast Badge ── */
.milestone-toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    z-index: 99998;
    background: linear-gradient(135deg, #0D1B2E, #1A3055);
    border: 2px solid var(--accent);
    border-radius: 20px;
    padding: 24px 50px;
    text-align: center;
    opacity: 0;
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.34,1.56,0.64,1);
    box-shadow: 0 20px 60px rgba(0,0,0,0.6), 0 0 40px var(--glow-accent);
}
.milestone-toast.active {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}
.milestone-toast h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 42px;
    font-weight: 800;
    color: var(--accent);
    margin: 0 0 6px 0;
    letter-spacing: -1px;
}
.milestone-toast p {
    font-size: 15px;
    color: var(--text-secondary);
    margin: 0;
}

/* ── Projected Score Stat ── */
.stat-projected {
    position: relative;
}
.stat-projected::after {
    content: 'EST';
    position: absolute;
    top: -2px; right: -4px;
    font-size: 8px;
    background: var(--accent);
    color: #121212;
    padding: 1px 4px;
    border-radius: 3px;
    font-weight: 800;
    letter-spacing: 0.5px;
}
.stat-projected.second-innings::after {
    display: none;
}

/* ── Bowler Picker Premium Stats ── */
.bowler-pick-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: var(--bg-card);
    border-radius: 10px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s;
    margin-bottom: 8px;
}
.bowler-pick-item:hover {
    border-color: var(--accent);
    background: rgba(196,153,58,0.08);
    transform: translateX(4px);
}
.bowler-pick-item.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}
.bowler-pick-stats {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: var(--text-secondary);
}
.bowler-pick-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
}
.bowler-pick-stat span:first-child {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.bowler-pick-stat span:last-child {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}
.bowler-er-good { color: var(--success) !important; }
.bowler-er-ok   { color: var(--warning) !important; }
.bowler-er-bad  { color: var(--danger) !important; }

/* ── Partnership Bar ── */
.partnership-bars {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 6px;
}
.pship-bar-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: var(--text-secondary);
}
.pship-bar-track {
    flex: 1;
    height: 6px;
    background: rgba(255,255,255,0.06);
    border-radius: 3px;
    overflow: hidden;
}
.pship-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s ease;
    background: linear-gradient(90deg, var(--brand-blue), var(--accent));
}
.pship-bar-score {
    min-width: 40px;
    text-align: right;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 12px;
}

/* ── Live Stats Row Enhancement ── */
#live-stats-row {
    border-radius: 10px;
    background: rgba(13,27,46,0.6);
    border: 1px solid rgba(255,255,255,0.06);
}
.stat-card-value {
    transition: color 0.3s;
}

/* ── Innings Summary in Scorecard ── */
.inn-tab-btn {
    flex: 1;
    padding: 8px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.inn-tab-btn.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* ── Player-item enhanced for batter modal ── */
.player-item .player-item-stats {
    display: flex;
    gap: 10px;
    font-size: 11px;
    color: var(--text-secondary);
}
.player-item .player-milestone-badge {
    background: linear-gradient(135deg, #bf953f, #fcf6ba);
    color: #0D1B2E;
    padding: 1px 7px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 800;
}

/* ── Scoring panel commentary section label ── */
.commentary-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    font-weight: 600;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.commentary-label i { color: var(--accent); }

/* ── Ripple on score buttons ── */
@keyframes ripple {
    0%   { transform: scale(0); opacity: 0.4; }
    100% { transform: scale(4); opacity: 0; }
}
.btn-ripple {
    position: absolute;
    width: 40px; height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.25);
    transform: scale(0);
    pointer-events: none;
    animation: ripple 0.5s linear;
}

/* ── Premium Live Indicator ── */
.live-indicator {
    background: rgba(255,59,48,0.15);
    color: #ff5f52;
    border: 1px solid rgba(255,59,48,0.3);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    letter-spacing: 1.5px;
    box-shadow: 0 0 12px rgba(255,59,48,0.15);
}
.live-dot {
    width: 7px; height: 7px;
    background: #ff5f52;
    border-radius: 50%;
    animation: liveDotPulse 1.2s ease-in-out infinite;
}
@keyframes liveDotPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255,95,82,0.7); }
    70%       { box-shadow: 0 0 0 6px rgba(255,95,82,0); }
}

/* ── Keyboard Shortcut Badge ── */
.kbd-badge {
    display: inline-block;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 4px;
    padding: 1px 5px;
    font-size: 9px;
    font-family: monospace;
    color: var(--text-secondary);
    letter-spacing: 0;
}

/* ── Target chase progress bar ── */
#chase-progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(255,255,255,0.06);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 6px;
}
#chase-progress-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.6s ease;
    background: linear-gradient(90deg, var(--success), var(--accent));
}

/* ═══════════════════════════════════════════════════════
   CRICHEROES STYLE UI — v4.1
═══════════════════════════════════════════════════════ */

/* ── Modal Tab Navigation ── */
.modal-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    padding: 0 20px;
    background: rgba(0,0,0,0.1);
    overflow-x: auto;
    scrollbar-width: none;
}
.modal-tabs::-webkit-scrollbar { display: none; }

.modal-tab-btn {
    padding: 14px 20px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    position: relative;
    white-space: nowrap;
    transition: all 0.2s;
}
.modal-tab-btn:hover { color: var(--text-primary); }
.modal-tab-btn.active { color: var(--accent); }
.modal-tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 3px;
    background: var(--accent);
    box-shadow: 0 -2px 10px var(--glow-accent);
}

.modal-tab-content {
    display: none;
    padding: 20px;
    animation: tabFadeIn 0.3s ease;
}
.modal-tab-content.active { display: block; }

@keyframes tabFadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ── Summary View Cards ── */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.performer-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 15px;
}
.performer-card h4 {
    font-size: 12px;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.performer-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.performer-row:last-child { border-bottom: none; }
.performer-info {
    display: flex;
    flex-direction: column;
}
.performer-name {
    font-weight: 700;
    font-size: 14px;
}
.performer-sub {
    font-size: 11px;
    color: var(--text-secondary);
}
.performer-stats {
    font-weight: 800;
    color: var(--text-primary);
}

/* ── Hero Awards ── */
.hero-award-card {
    background: linear-gradient(135deg, rgba(196,153,58,0.15), rgba(13,27,46,0.8));
    border: 1px solid var(--accent);
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}
.hero-award-card::before {
    content: '\f091';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    position: absolute;
    top: -10px; right: -10px;
    font-size: 80px;
    opacity: 0.05;
    color: var(--accent);
}
.award-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--accent);
    margin-bottom: 5px;
}
.award-player {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 5px;
}
.award-stats {
    font-size: 14px;
    color: var(--text-secondary);
}

/* ── Analysis Section ── */
.chart-container {
    width: 100%;
    height: 250px;
    background: rgba(0,0,0,0.2);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
    position: relative;
}
.manhattan-bar {
    transition: height 0.5s cubic-bezier(0.4,0,0.2,1);
}

.analysis-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

/* ── Results List Item (Tournament Hub) ── */
.result-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 12px;
    transition: all 0.2s;
}
.result-item:hover {
    transform: translateY(-2px);
    border-color: var(--accent);
}
.result-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
}
.result-teams {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
}
.result-team {
    flex: 1;
    display: flex;
    flex-direction: column;
}
.result-score {
    font-size: 18px;
    font-weight: 800;
}
.result-status {
    font-size: 13px;
    font-weight: 700;
    color: var(--success);
}
/* ── Win Predictor ── */
.win-predictor-container {
    margin-bottom: 25px;
    padding: 15px;
    background: rgba(0,0,0,0.2);
    border-radius: 12px;
    text-align: center;
}
.win-label {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 10px;
    display: block;
}
.win-bar-wrap {
    height: 12px;
    background: var(--danger);
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.5);
}
.win-bar-fill {
    height: 100%;
    background: var(--success);
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 2px 0 10px rgba(16, 185, 129, 0.4);
}
.win-percentages {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 16px;
}

/* ── Key Moments Timeline ── */
.key-moments-list {
    margin-top: 20px;
    position: relative;
}
.key-moment-item {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    position: relative;
}
.key-moment-item::before {
    content: '';
    position: absolute;
    left: 17px; top: 20px; bottom: -15px;
    width: 2px;
    background: rgba(255,255,255,0.05);
}
.key-moment-item:last-child::before { display: none; }
.moment-icon {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--border-color);
    font-size: 14px;
    z-index: 1;
}
.moment-content {
    background: rgba(255,255,255,0.02);
    padding: 10px 15px;
    border-radius: 10px;
    flex: 1;
}
.moment-over { color: var(--accent); font-weight: 700; font-size: 12px; }
.moment-text { font-size: 13px; color: var(--text-primary); margin-top: 2px; }

/* ── Tournament Leaderboards ── */
.leaderboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 25px;
}
.leader-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    overflow: hidden;
    transition: 0.3s;
}
.leader-card:hover { transform: translateY(-5px); border-color: var(--accent); }
.leader-header {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    background: linear-gradient(135deg, rgba(255,255,255,0.03), transparent);
}
.leader-avatar {
    width: 60px; height: 60px;
    border-radius: 50%;
    background: var(--card);
    display: flex; align-items: center; justify-content: center;
    font-size: 24px;
    border: 2px solid var(--border);
}
.leader-card.orange .leader-avatar { border-color: #f59e0b; color: #f59e0b; }
.leader-card.purple .leader-avatar { border-color: #EBB649; color: #EBB649; }

.leader-info h3 { font-size: 18px; font-weight: 800; }
.leader-info p { font-size: 11px; color: var(--text-sec); text-transform: uppercase; letter-spacing: 1px; }

.leader-stats-row {
    padding: 15px 20px;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
    text-align: center;
    border-top: 1px solid var(--border);
}
.stat-item .val { display: block; font-size: 18px; font-weight: 800; color: var(--accent); }
.stat-item .lab { display: block; font-size: 10px; color: var(--text-sec); text-transform: uppercase; }
/* Responsive Floating Panels */
@media (max-width: 768px) {
    .floating-panel {
        padding: 20px 10px !important;
        justify-content: center !important;
    }
    .floating-panel .modal-content {
        width: 95vw !important;
        right: auto !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        top: 20px !important;
    }
}
/* Switch Toggle Styling for Live Sync Control */
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 22px;
}
.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255,255,255,0.1);
    transition: .3s;
    border-radius: 22px;
    border: 1px solid rgba(255,255,255,0.2);
}
.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
.result-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
}
.result-teams {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
}
.result-team {
    flex: 1;
    display: flex;
    flex-direction: column;
}
.result-score {
    font-size: 18px;
    font-weight: 800;
}
.result-status {
    font-size: 13px;
    font-weight: 700;
    color: var(--success);
}
/* ── Win Predictor ── */
.win-predictor-container {
    margin-bottom: 25px;
    padding: 15px;
    background: rgba(0,0,0,0.2);
    border-radius: 12px;
    text-align: center;
}
.win-label {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 10px;
    display: block;
}
.win-bar-wrap {
    height: 12px;
    background: var(--danger);
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.5);
}
.win-bar-fill {
    height: 100%;
    background: var(--success);
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 2px 0 10px rgba(16, 185, 129, 0.4);
}
.win-percentages {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 16px;
}

/* ── Key Moments Timeline ── */
.key-moments-list {
    margin-top: 20px;
    position: relative;
}
.key-moment-item {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    position: relative;
}
.key-moment-item::before {
    content: '';
    position: absolute;
    left: 17px; top: 20px; bottom: -15px;
    width: 2px;
    background: rgba(255,255,255,0.05);
}
.key-moment-item:last-child::before { display: none; }
.moment-icon {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--border-color);
    font-size: 14px;
    z-index: 1;
}
.moment-content {
    background: rgba(255,255,255,0.02);
    padding: 10px 15px;
    border-radius: 10px;
    flex: 1;
}
.moment-over { color: var(--accent); font-weight: 700; font-size: 12px; }
.moment-text { font-size: 13px; color: var(--text-primary); margin-top: 2px; }

/* ── Tournament Leaderboards ── */
.leaderboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 25px;
}
.leader-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    overflow: hidden;
    transition: 0.3s;
}
.leader-card:hover { transform: translateY(-5px); border-color: var(--accent); }
.leader-header {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    background: linear-gradient(135deg, rgba(255,255,255,0.03), transparent);
}
.leader-avatar {
    width: 60px; height: 60px;
    border-radius: 50%;
    background: var(--card);
    display: flex; align-items: center; justify-content: center;
    font-size: 24px;
    border: 2px solid var(--border);
}
.leader-card.orange .leader-avatar { border-color: #f59e0b; color: #f59e0b; }
.leader-card.purple .leader-avatar { border-color: #EBB649; color: #EBB649; }

.leader-info h3 { font-size: 18px; font-weight: 800; }
.leader-info p { font-size: 11px; color: var(--text-sec); text-transform: uppercase; letter-spacing: 1px; }

.leader-stats-row {
    padding: 15px 20px;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
    text-align: center;
    border-top: 1px solid var(--border);
}
.stat-item .val { display: block; font-size: 18px; font-weight: 800; color: var(--accent); }
.stat-item .lab { display: block; font-size: 10px; color: var(--text-sec); text-transform: uppercase; }
/* Responsive Floating Panels */
@media (max-width: 768px) {
    .floating-panel {
        padding: 20px 10px !important;
        justify-content: center !important;
    }
    .floating-panel .modal-content {
        width: 95vw !important;
        right: auto !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        top: 20px !important;
    }
}
/* Switch Toggle Styling for Live Sync Control */
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 22px;
}
.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255,255,255,0.1);
    transition: .3s;
    border-radius: 22px;
    border: 1px solid rgba(255,255,255,0.2);
}
.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}
.switch input:checked + .slider {
    background-color: var(--accent) !important;
}
.switch input:checked + .slider:before {
    transform: translateX(20px);
}

.tour-roster-box {
    background: rgba(255, 255, 255, 0.02);
    border: 1px dashed rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 20px;
}
.tour-roster-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.tour-roster-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.tour-roster-select-all {
    font-size: 11px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    user-select: none;
}
.tour-roster-list {
    max-height: 250px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding-right: 4px;
}
.tour-roster-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}
.tour-roster-item:hover {
    border-color: rgba(255, 255, 255, 0.15);
}
.tour-roster-item.selected {
    border-color: var(--accent);
    background: rgba(36, 77, 68, 0.08);
}
.tour-roster-item.selected:hover {
    border-color: var(--accent-hover);
}
.tour-roster-item.unselected {
    opacity: 0.5;
}
.tour-roster-checkbox {
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
    cursor: pointer;
}
.tour-roster-player-img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}
.tour-roster-player-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.tour-roster-player-name {
    font-size: 13px;
    color: var(--text-primary);
    flex-grow: 1;
}
.tour-roster-status {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 4px;
}
.tour-roster-status.playing {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}
.tour-roster-status.bench {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
}

/* Pre-Match Setup Sub-tab Center Styling */
.setup-sub-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 10px;
    overflow-x: auto;
}
.sub-tab-btn {
    background: rgba(255, 255, 255, 0.02) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    color: var(--text-secondary) !important;
    font-size: 13px;
    font-weight: 600;
    padding: 8px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    outline: none !important;
}
.sub-tab-btn:hover {
    color: var(--text-primary) !important;
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
}
.sub-tab-btn.active {
    color: var(--cream) !important;
    background: var(--accent) !important;
    border-color: var(--accent) !important;
    box-shadow: 0 0 10px var(--glow-accent);
}
.sub-tab-next-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 700;
    border-radius: 8px;
    background: rgba(36, 77, 68, 0.15) !important;
    color: var(--cream) !important;
    border: 1px solid rgba(36, 77, 68, 0.4) !important;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 20px;
    width: 100%;
    outline: none !important;
}
.sub-tab-next-btn:hover {
    background: var(--accent) !important;
    border-color: var(--accent) !important;
    color: var(--cream) !important;
    box-shadow: 0 0 12px var(--glow-accent);
    transform: translateY(-1px);
}

/* Out Modal Extra/Runs active selectors */
.out-ball-type-btn.active,
.out-nb-source-btn.active {
    border-color: var(--accent) !important;
    background: rgba(196, 153, 58, 0.15) !important;
    color: var(--accent) !important;
    box-shadow: 0 0 8px rgba(196, 153, 58, 0.25) !important;
}
.out-extra-run-btn.active {
    border-color: var(--accent) !important;
    background: rgba(196, 153, 58, 0.2) !important;
    color: var(--accent) !important;
    box-shadow: 0 0 10px rgba(196, 153, 58, 0.3) !important;
}

/* Studio Mobile Responsive Tabs & Overrides */
.studio-mobile-tabs {
    display: none;
}

@media (max-width: 900px) {
    .studio-mobile-tabs {
        display: flex !important;
        justify-content: space-around;
        background: rgba(11, 11, 11, 0.8) !important;
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        border: 1px solid rgba(255, 255, 255, 0.08);
        border-radius: 12px;
        padding: 6px;
        margin-bottom: 10px;
        gap: 8px;
        z-index: 10;
    }
    .mobile-tab-btn {
        flex: 1;
        background: transparent;
        border: none;
        color: var(--text-secondary);
        font-size: 13px;
        font-weight: 600;
        padding: 10px;
        cursor: pointer;
        border-radius: 8px;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        outline: none !important;
    }
    .mobile-tab-btn:hover {
        color: var(--text-primary);
        background: rgba(255, 255, 255, 0.04);
    }
    .mobile-tab-btn.active {
        background: var(--accent) !important;
        color: var(--cream) !important;
        box-shadow: 0 0 10px var(--glow-accent);
    }
    
    /* Layout overrides */
    .main-content {
        grid-template-columns: 1fr !important;
        grid-template-rows: 1fr !important;
        overflow: hidden !important;
        height: calc(100vh - 190px) !important; /* adjust for header and tabs */
    }
    .app-container {
        height: 100vh !important;
        overflow: hidden !important;
        padding: 10px !important;
        gap: 10px !important;
    }
    .app-header {
        padding: 12px 15px !important;
        border-radius: 10px !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px !important;
    }
    .app-header > div {
        justify-content: space-between !important;
        width: 100% !important;
    }
    .header-actions {
        justify-content: flex-end !important;
        gap: 10px !important;
    }
    .match-info h1 {
        font-size: 18px !important;
        margin-bottom: 2px !important;
    }
    .match-info p {
        font-size: 12px !important;
    }
    
    /* Hide all panels by default in tabbed mode */
    .scorecard-panel, .scoring-panel, .shortcuts-panel {
        display: none !important;
        width: 100% !important;
        max-width: 100% !important;
        height: 100% !important;
        margin: 0 !important;
    }
    
    /* Active panel toggles */
    .show-panel-scorecard .scorecard-panel {
        display: flex !important;
    }
    .show-panel-scoring .scoring-panel {
        display: flex !important;
    }
    .show-panel-shortcuts .shortcuts-panel {
        display: flex !important;
    }
}

@media (max-width: 768px) {
    /* Setup view mobile optimizations */
    .setup-tabs {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 8px !important;
        border-bottom: none !important;
        padding-bottom: 0 !important;
    }
    .setup-tabs > div {
        display: none !important; /* Hide spacer */
    }
    .setup-tabs .tab-btn {
        width: 100% !important;
        justify-content: center !important;
    }
    .setup-sub-tabs {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
    }
    .setup-sub-tabs .sub-tab-btn {
        font-size: 11px !important;
        padding: 8px 4px !important;
        gap: 4px !important;
    }
    
    /* Inline grid overrides inside setup-screen */
    #match-setup-screen div[style*="display: grid"],
    #match-setup-screen div[style*="display:grid"] {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }
    /* Let round/group group row stack but keep 2 cols if possible, but 1 col is safer */
    #tour-round-group-selection {
        grid-template-columns: 1fr !important;
    }
    /* Setup card padding */
    .setup-card {
        padding: 15px !important;
    }
    .setup-title {
        font-size: 22px !important;
    }
}


