/* ─── CSS Variables & Reset ─── */
:root {
    --bg-primary: #0a0e17;
    --bg-secondary: #111827;
    --bg-card: #1a2235;
    --bg-card-hover: #1f2a40;
    --bg-glass: rgba(26, 34, 53, 0.8);
    --border: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(255, 255, 255, 0.12);
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent: #22d3ee;
    --accent-glow: rgba(34, 211, 238, 0.15);
    --live: #ef4444;
    --live-glow: rgba(239, 68, 68, 0.2);
    --win: #10b981;
    --upcoming: #f59e0b;
    --gradient-1: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
    --gradient-hero: linear-gradient(135deg, #0ea5e9 0%, #8b5cf6 50%, #ec4899 100%);
    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 40px rgba(34, 211, 238, 0.08);
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ─── Scrollbar ─── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--text-muted); border-radius: 3px; }

/* ─── Header ─── */
#header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    background: rgba(10, 14, 23, 0.85);
    border-bottom: 1px solid var(--border);
}

.header-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.logo-icon { font-size: 28px; }
.accent { color: var(--accent); }

#nav {
    display: flex;
    gap: 8px;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
}

.nav-link:hover, .nav-link.active {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.06);
}

.nav-link.active {
    color: var(--accent);
}

.header-actions { display: flex; align-items: center; }

.live-pulse {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--live-glow);
    color: var(--live);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background: var(--live);
    border-radius: 50%;
    animation: pulse 1.5s ease-in-out infinite;
}

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

/* ─── Hero ─── */
#hero {
    padding: 100px 24px 40px;
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
}

.hero-content h1 {
    font-size: 48px;
    font-weight: 900;
    letter-spacing: -1.5px;
    line-height: 1.1;
    background: var(--gradient-hero);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-sub {
    color: var(--text-secondary);
    font-size: 16px;
    margin-top: 8px;
}

.hero-stats {
    display: flex;
    gap: 16px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 28px;
    text-align: center;
    min-width: 110px;
    transition: var(--transition);
}

.stat-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.stat-number {
    display: block;
    font-size: 32px;
    font-weight: 800;
    color: var(--accent);
}

.stat-label {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 4px;
}

/* ─── Filter Bar ─── */
.filter-bar {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px 24px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-btn {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 8px 20px;
    border-radius: 20px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.filter-btn:hover {
    border-color: var(--border-hover);
    color: var(--text-primary);
}

.filter-btn.active {
    background: var(--accent);
    color: #0a0e17;
    border-color: var(--accent);
    font-weight: 600;
}

/* ─── Matches Grid ─── */
.matches-grid {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px 40px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 16px;
}

/* ─── Match Card ─── */
.match-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.match-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-hero);
    opacity: 0;
    transition: var(--transition);
}

.match-card:hover {
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

.match-card:hover::before { opacity: 1; }

.match-card.live { border-left: 3px solid var(--live); }
.match-card.live .match-status { color: var(--live); }

.match-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.match-series {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
    max-width: 70%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.match-status {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 3px 10px;
    border-radius: 12px;
    white-space: nowrap;
}

.status-live {
    background: var(--live-glow);
    color: var(--live);
    animation: statusPulse 2s ease-in-out infinite;
}

@keyframes statusPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.status-upcoming {
    background: rgba(245, 158, 11, 0.15);
    color: var(--upcoming);
}

.status-completed {
    background: rgba(16, 185, 129, 0.15);
    color: var(--win);
}

/* ── Break states (Stumps / Lunch / Tea / Rain) ── */
.status-break {
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
    animation: stumpsPulse 3s ease-in-out infinite;
}

@keyframes stumpsPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.65; }
}

/* Stumps card — subtle amber left-border */
.match-card.stumps {
    border-left: 3px solid #fbbf24;
}

/* Stumps result message */
.match-result.stumps-msg {
    color: #fbbf24;
    font-style: italic;
}

.match-teams {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.team-flag {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 8px;
    border: 1px solid var(--border);
}

.team-flag-sm {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 4px;
    border: 1px solid var(--border);
}

.team-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.team-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.team-score {
    font-size: 16px;
    font-weight: 700;
    color: var(--accent);
    font-variant-numeric: tabular-nums;
}

.team-score.batting {
    color: var(--accent);
}

.match-result {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
    font-size: 13px;
    color: var(--win);
    font-weight: 500;
}

.match-venue {
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ─── Live Info Panel ─── */
.live-info {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
    opacity: 0.7;
    transition: opacity 0.5s ease;
}

.live-info-loading {
    font-size: 11px;
    color: var(--text-muted);
    text-align: center;
    padding: 8px 0;
    animation: pulse 1.5s ease-in-out infinite;
}

.live-players {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.live-section {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.live-section-title {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.live-player {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 8px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.02);
}

.live-player.striker {
    background: rgba(34, 211, 238, 0.08);
    border-left: 2px solid var(--accent);
}

.player-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
}

.live-player.striker .player-name {
    color: var(--accent);
}

.player-stats {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
}

.live-extras {
    font-size: 11px;
    color: var(--accent);
    font-weight: 500;
    padding: 4px 8px;
    background: rgba(34, 211, 238, 0.05);
    border-radius: 6px;
}

/* ─── Full Batting/Bowling Scorecard Table ─── */
.live-batting-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
    margin-top: 4px;
}

.live-batting-table th {
    text-align: left;
    padding: 4px 6px;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
}

.live-batting-table th:not(:first-child) { text-align: center; }

.live-batting-table td {
    padding: 5px 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
}

.live-batting-table td:not(:first-child) { text-align: center; }

.live-batting-table td:first-child {
    color: var(--text-primary);
    font-weight: 500;
}

.live-batting-table tr.highlighted-striker {
    background: rgba(34, 211, 238, 0.1);
}

.live-batting-table tr.highlighted-striker td:first-child {
    color: var(--accent);
    font-weight: 700;
}

.live-batting-table tr.live-active {
    background: rgba(0, 200, 83, 0.06);
}

.live-batting-table tr.live-out {
    opacity: 0.6;
}

.not-out-badge {
    color: var(--win);
    font-weight: 800;
    font-size: 12px;
}

.live-table-header {
    background: rgba(255, 255, 255, 0.03);
}

.live-recent {
    font-size: 11px;
    color: var(--text-secondary);
    padding: 3px 8px;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.5px;
}

.live-last-wkt {
    font-size: 10px;
    color: var(--text-muted);
    padding: 3px 8px;
    font-style: italic;
    border-top: 1px dashed var(--border);
    padding-top: 6px;
    margin-top: 2px;
}

/* ─── Skeleton Loading ─── */
.skeleton-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    height: 200px;
    position: relative;
    overflow: hidden;
}

.skeleton-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.03), transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ─── No Matches ─── */
.no-matches {
    text-align: center;
    padding: 80px 24px;
    max-width: 1280px;
    margin: 0 auto;
}

.no-matches-icon { font-size: 64px; display: block; margin-bottom: 16px; }
.no-matches h3 { color: var(--text-secondary); font-size: 20px; }
.no-matches p { color: var(--text-muted); margin-top: 8px; }

/* ─── Modal ─── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    max-width: 700px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    transform: translateY(20px) scale(0.97);
    transition: var(--transition);
}

.modal-overlay.active .modal {
    transform: translateY(0) scale(1);
}

.modal-close {
    position: sticky;
    top: 16px;
    float: right;
    margin: 16px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 16px;
    cursor: pointer;
    z-index: 10;
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--live);
    color: white;
    border-color: var(--live);
}

.modal-content {
    padding: 24px 28px 28px;
}

.modal-loading {
    text-align: center;
    padding: 60px 0;
}

.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
}

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

/* ─── Scorecard Styles ─── */
.sc-header {
    text-align: center;
    margin-bottom: 24px;
}

.sc-header h2 {
    font-size: 22px;
    font-weight: 700;
}

.sc-header .sc-series {
    color: var(--text-muted);
    font-size: 13px;
    margin-top: 4px;
}

.sc-header .sc-result {
    color: var(--win);
    font-weight: 600;
    font-size: 14px;
    margin-top: 8px;
}

.sc-innings {
    margin-bottom: 24px;
}

.sc-innings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
}

.sc-innings-team {
    font-weight: 700;
    font-size: 16px;
}

.sc-innings-score {
    color: var(--accent);
    font-weight: 700;
    font-size: 16px;
    font-variant-numeric: tabular-nums;
}

.sc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.sc-table th {
    text-align: left;
    padding: 8px 12px;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
}

.sc-table th:not(:first-child) { text-align: center; }

.sc-table td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
}

.sc-table td:not(:first-child) { text-align: center; }

.sc-table td:first-child {
    color: var(--text-primary);
    font-weight: 500;
}

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

.sc-extras, .sc-total {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
    font-size: 13px;
    color: var(--text-secondary);
}

.sc-total {
    font-weight: 700;
    color: var(--text-primary);
    border-top: 1px solid var(--border);
}

.sc-fow {
    margin-top: 8px;
    padding: 10px 12px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    font-size: 12px;
    color: var(--text-muted);
}

.sc-fow-title {
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

/* ─── Partnership Section ─── */
.sc-partnership-section {
    margin-top: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.sc-partnership-header {
    padding: 14px 16px 10px;
    border-bottom: 1px solid var(--border);
}

.sc-partnership-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-secondary);
}

.sc-partnership-col-labels {
    display: flex;
    justify-content: space-between;
    padding: 6px 16px 0;
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
}

.sc-partnership-row {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    transition: background 0.2s ease;
}

.sc-partnership-row:last-child {
    border-bottom: none;
}

.sc-partnership-row:hover {
    background: rgba(255, 255, 255, 0.02);
}

.sc-partnership-wicket-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sc-partnership-ongoing-badge {
    background: rgba(34, 211, 238, 0.15);
    color: var(--accent);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1px;
    animation: partnershipPulse 1.8s ease-in-out infinite;
}

@keyframes partnershipPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.sc-partnership-derived-badge {
    background: rgba(245, 158, 11, 0.12);
    color: var(--upcoming);
    padding: 2px 6px;
    border-radius: 8px;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.sc-partnership-names {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 10px;
}

.sc-partnership-batter1 {
    flex: 1;
}

.sc-partnership-batter2 {
    flex: 1;
    text-align: right;
}

.sc-partnership-batter-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
}

.sc-partnership-batter-runs {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
    font-variant-numeric: tabular-nums;
}

.sc-partnership-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
    min-width: 80px;
}

.sc-partnership-total-runs {
    font-size: 18px;
    font-weight: 800;
    color: #d97706;
    line-height: 1;
    letter-spacing: -0.5px;
    font-variant-numeric: tabular-nums;
}

.sc-partnership-total-balls {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 1px;
}

/* Split bar */
.sc-partnership-bar-wrap {
    display: flex;
    height: 6px;
    border-radius: 3px;
    overflow: hidden;
    gap: 1px;
    margin-top: 4px;
}

.sc-partnership-bar-bat1 {
    background: #27ae60;
    border-radius: 3px 0 0 3px;
    min-width: 4px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.sc-partnership-bar-bat2 {
    background: #8b0000;
    border-radius: 0 3px 3px 0;
    min-width: 4px;
    flex: 1;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.sc-partnership-bar-extras {
    background: rgba(245, 158, 11, 0.5);
    min-width: 2px;
}

.sc-partnership-extras-note {
    font-size: 10px;
    color: var(--text-muted);
    text-align: center;
    margin-top: 4px;
    font-style: italic;
}

/* Mobile: stack vertically below 480px */
@media (max-width: 480px) {
    .sc-partnership-names {
        flex-direction: column;
        gap: 4px;
    }
    .sc-partnership-batter2 {
        text-align: left;
    }
    .sc-partnership-center {
        min-width: unset;
        flex-direction: row;
        gap: 6px;
        align-items: baseline;
    }
}

/* ─── Yet to Bat Section ─── */
.sc-ytb-section {
    margin-top: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.sc-ytb-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    background: var(--border);
}

.sc-ytb-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-card);
    transition: background 0.2s ease;
    cursor: default;
}

.sc-ytb-card:hover {
    background: rgba(255, 255, 255, 0.03);
}

.sc-ytb-avatar {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border);
}

.sc-ytb-avatar-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.06);
}

.sc-ytb-info {
    min-width: 0;
    flex: 1;
}

.sc-ytb-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sc-ytb-role {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Mobile: single column */
@media (max-width: 480px) {
    .sc-ytb-grid {
        grid-template-columns: 1fr;
    }
}



/* ─── Footer ─── */
#footer {
    text-align: center;
    padding: 32px 24px;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 13px;
}

.footer-sub {
    margin-top: 4px;
    font-size: 11px;
    color: var(--text-muted);
    opacity: 0.6;
}

/* ─── Responsive ─── */
@media (max-width: 768px) {
    #hero {
        flex-direction: column;
        padding: 90px 16px 24px;
        align-items: flex-start;
        gap: 24px;
    }

    .hero-content h1 { font-size: 32px; }

    .hero-stats { width: 100%; }
    .stat-card { flex: 1; padding: 14px 8px; min-width: unset; }
    .stat-number { font-size: 24px; }

    .matches-grid {
        grid-template-columns: 1fr;
        padding: 0 16px 32px;
    }

    .filter-bar { padding: 0 16px 16px; }

    #nav { display: none; }

    .modal { max-height: 90vh; }
    .modal-content { padding: 16px; }

    .sc-table { font-size: 11px; }
    .sc-table th, .sc-table td { padding: 6px 6px; }
}

/* ─── Scorecard Active Player Highlighting ─── */
.sc-active-player {
    background: rgba(34, 211, 238, 0.08) !important;
}

.sc-active-name {
    color: #22d3ee !important;
    font-weight: 700;
}

.sc-striker {
    color: #22d3ee;
    font-size: 16px;
    font-weight: 900;
}

/* ─── Bat & Ball Icons ─── */
.section-icon {
    width: 14px;
    height: 14px;
    vertical-align: middle;
    margin-right: 2px;
}

.striker-icon {
    width: 16px;
    height: 16px;
    vertical-align: middle;
    margin-left: 4px;
    filter: brightness(0) saturate(100%) invert(78%) sepia(55%) saturate(1000%) hue-rotate(120deg) brightness(100%) contrast(90%);
}

.sc-bat-icon {
    width: 14px;
    height: 14px;
    vertical-align: middle;
    margin-left: 4px;
    filter: brightness(0) saturate(100%) invert(78%) sepia(55%) saturate(1000%) hue-rotate(120deg) brightness(100%) contrast(90%);
}

.ball-icon {
    filter: brightness(0) saturate(100%) invert(45%) sepia(95%) saturate(1500%) hue-rotate(340deg) brightness(100%) contrast(90%);
}

.bat-icon {
    filter: brightness(0) saturate(100%) invert(65%) sepia(50%) saturate(500%) hue-rotate(20deg) brightness(100%) contrast(90%);
}

@media (max-width: 420px) {
    .stat-card { padding: 10px 4px; }
    .stat-number { font-size: 20px; }
    .stat-label { font-size: 10px; }
    .match-card { padding: 16px; }
}

/* ─── IPL Schedule Section ─── */
#iplSection {
    max-width: 1280px;
    margin: 0 auto;
    padding: 90px 24px 40px;
}

.ipl-header {
    margin-bottom: 32px;
}

.ipl-title {
    font-size: 36px;
    font-weight: 900;
    letter-spacing: -1px;
    background: linear-gradient(135deg, #f59e0b, #ef4444, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.ipl-sub {
    color: var(--text-muted);
    font-size: 14px;
    margin-top: 6px;
}

.ipl-date-group {
    margin-bottom: 24px;
}

.ipl-date-header {
    font-size: 14px;
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 10px 16px;
    background: rgba(34, 211, 238, 0.06);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--accent);
    margin-bottom: 12px;
}

.ipl-match-row {
    display: grid;
    grid-template-columns: 120px 1fr auto;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    cursor: pointer;
    transition: var(--transition);
}

.ipl-match-row:hover {
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
    transform: translateX(4px);
}

.ipl-match-row.ipl-live {
    border-left: 3px solid var(--live);
    background: rgba(239, 68, 68, 0.04);
}

.ipl-match-time {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.ipl-status-upcoming { color: var(--upcoming); }
.ipl-status-live { color: var(--live); animation: statusPulse 2s ease-in-out infinite; }
.ipl-status-done { color: var(--win); }

.ipl-match-teams {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ipl-team {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.ipl-vs {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

.ipl-match-details {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    min-width: 160px;
}

.ipl-score {
    font-size: 13px;
    font-weight: 600;
    color: var(--accent);
    font-variant-numeric: tabular-nums;
}

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

.ipl-result {
    font-size: 11px;
    color: var(--win);
    font-weight: 500;
}

.ipl-loading {
    text-align: center;
    padding: 60px 0;
    color: var(--text-muted);
}

@media (max-width: 768px) {
    .ipl-match-row {
        grid-template-columns: 80px 1fr;
        gap: 10px;
        padding: 12px 14px;
    }
    .ipl-match-details {
        grid-column: 1 / -1;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        min-width: unset;
    }
    #iplSection { padding: 80px 16px 32px; }
    .ipl-title { font-size: 28px; }
}

/* ─── Squad Section ─── */
.squad-section {
    border-top: 1px solid var(--border);
    padding-top: 24px;
}

.squad-tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.squad-tab {
    background: var(--accent);
    color: #0a0e17;
    border: none;
    padding: 8px 24px;
    border-radius: 20px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.squad-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.squad-team-header {
    font-size: 16px;
    font-weight: 700;
    color: var(--accent);
    text-align: center;
    padding: 12px;
    background: rgba(34, 211, 238, 0.06);
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    border: 1px solid var(--border);
}

.squad-player {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
}

.squad-player:hover {
    background: rgba(255, 255, 255, 0.03);
}

.squad-player-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

.squad-player-role {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
    padding: 2px 8px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 10px;
}

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

/* ─── Squad / XI Enhancements ─── */

/* Make team header a flex row so we can show a count badge inline */
.squad-team-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Small pill showing player count (e.g. "11" or "22") */
.squad-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 20px;
    padding: 0 7px;
    font-size: 11px;
    font-weight: 700;
    border-radius: 10px;
    background: rgba(34, 211, 238, 0.15);
    color: var(--accent);
    letter-spacing: 0;
}

/* Confirmed Playing XI player row — subtle accent left border */
.squad-player.squad-player-xi {
    border-left: 2px solid var(--accent);
    background: rgba(34, 211, 238, 0.04);
}

.squad-player.squad-player-xi .squad-player-name {
    color: var(--accent);
}

/* Captain badge "(C)" styled as a small pill */
.squad-badge {
    display: inline-block;
    padding: 1px 6px;
    font-size: 10px;
    font-weight: 700;
    border-radius: 8px;
    background: rgba(245, 158, 11, 0.2);
    color: var(--upcoming);
    margin-left: 4px;
    vertical-align: middle;
    letter-spacing: 0;
}

/* ─── IPL Section Styles ─── */
.ipl-header {
    max-width: 1280px;
    margin: 0 auto;
    padding: 100px 24px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.ipl-toggle-bar {
    display: flex;
    background: var(--bg-card);
    padding: 4px;
    border-radius: 24px;
    border: 1px solid var(--border);
    margin-top: 8px;
}

.ipl-toggle-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 8px 24px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.ipl-toggle-btn.active {
    background: var(--accent);
    color: #0a0e17;
    box-shadow: 0 4px 12px var(--accent-glow);
}

.ipl-points-table-container {
    max-width: 1000px;
    margin: 0 auto 60px;
    padding: 0 24px;
    overflow-x: auto;
}

.pts-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 8px;
    font-size: 14px;
}

.pts-table th {
    text-align: left;
    padding: 12px 16px;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.pts-table th:not(:nth-child(2)) {
    text-align: center;
}

.pts-row {
    background: var(--bg-card);
    transition: var(--transition);
}

.pts-row:hover {
    background: var(--bg-card-hover);
    transform: scale(1.01);
}

.pts-row td {
    padding: 16px;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.pts-row td:first-child {
    border-left: 1px solid var(--border);
    border-radius: 12px 0 0 12px;
    font-weight: 800;
    color: var(--text-muted);
    width: 50px;
    text-align: center;
}

.pts-row td:last-child {
    border-right: 1px solid var(--border);
    border-radius: 0 12px 12px 0;
    font-weight: 800;
    color: var(--accent);
    font-size: 18px;
    text-align: center;
}

.pts-team-col {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pts-team-name {
    font-weight: 600;
    color: var(--text-primary);
}

.pts-data {
    text-align: center;
    font-weight: 500;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
}

.pts-nrr {
    font-weight: 600;
}

.nrr-pos { color: var(--win); }
.nrr-neg { color: var(--live); }

.pts-rank-1, .pts-rank-2, .pts-rank-3, .pts-rank-4 {
    border-left: 3px solid var(--win) !important;
}

@media (max-width: 768px) {
    .pts-table { font-size: 12px; }
    .pts-row td { padding: 12px 8px; }
    .pts-team-name { max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

/* ══════════════════════════════════════════════════════════════════════════
   NEW STATE ADAPTIVE UI STYLES
   ══════════════════════════════════════════════════════════════════════════ */

/* Match State Badges */
.match-state-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.state-pre { background: rgba(245, 158, 11, 0.15); color: var(--upcoming); }
.state-xi { background: rgba(16, 185, 129, 0.15); color: var(--win); }

/* Pre-Match View */
.pre-match-info-card {
    text-align: center;
    padding: 24px 16px;
    background: rgba(255,255,255,0.02);
    border-radius: 16px;
    margin-bottom: 24px;
    border: 1px solid rgba(255,255,255,0.05);
}
.pre-match-teams {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 12px 0 8px;
}
.pre-match-vs {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 500;
    margin: 0 8px;
}
.pre-match-detail {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}
.pre-match-time {
    color: var(--accent);
    font-weight: 600;
}
.pre-match-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 32px 0 16px;
    padding: 0 8px;
}
.pre-match-section-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}
.pre-match-no-squad {
    text-align: center;
    padding: 40px;
    background: rgba(255,255,255,0.02);
    border-radius: 12px;
    border: 1px dashed var(--border);
    margin-top: 24px;
}
.no-squad-icon { font-size: 48px; display: block; margin-bottom: 12px; }
.no-squad-sub { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

/* Squad / XI Badges */
.role-badge {
    font-size: 9px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 6px;
    margin-right: 6px;
}
.role-wk { background: rgba(139, 92, 246, 0.2); color: #a78bfa; }
.role-ar { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
.role-bwl { background: rgba(239, 68, 68, 0.2); color: #f87171; }
.role-bat { background: rgba(56, 189, 248, 0.2); color: #38bdf8; }
.pre-foreign-badge { font-size: 12px; margin-left: 4px; }
.squad-player-meta { display: flex; align-items: center; }

/* XI Confirmed View */
.xi-confirmed-header {
    text-align: center;
    margin-bottom: 24px;
}
.xi-match-info {
    font-size: 15px;
    font-weight: 600;
    margin-top: 12px;
    color: var(--text-primary);
}
.xi-venue {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 400;
    display: block;
    margin-top: 4px;
}
.xi-section {
    background: var(--bg-card);
    border: 1px solid var(--accent);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: 0 4px 20px rgba(34, 211, 238, 0.05);
}
.xi-section-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--accent);
    text-align: center;
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.xi-player-row {
    border-left: 3px solid var(--accent);
    background: rgba(34, 211, 238, 0.04);
}
.xi-player-left {
    display: flex;
    align-items: center;
    gap: 8px;
}
.xi-player-icon {
    font-size: 8px;
    color: var(--accent);
}
.xi-badge-wk {
    font-size: 9px;
    background: rgba(139, 92, 246, 0.2);
    color: #a78bfa;
    padding: 1px 5px;
    border-radius: 6px;
    margin-left: 4px;
    font-weight: 700;
}

/* Substitutes (details/summary) */
.sub-section {
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 20px;
    margin-bottom: 24px;
}
.sub-section-summary {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 8px;
}
.sub-section-summary::-webkit-details-marker { display: none; }
.sub-player-row { opacity: 0.8; }

/* Live State Animation */
.live-state-transition {
    animation: fadeIn 0.4s ease-in-out;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Batting Info Strip */
.batting-info-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}
.batting-strip-item {
    flex: 1;
    min-width: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 13px;
}
.batting-strip-highlight {
    background: rgba(34, 211, 238, 0.08);
    border-color: rgba(34, 211, 238, 0.2);
    color: var(--accent);
}
.batting-strip-need {
    background: rgba(245, 158, 11, 0.08);
    border-color: rgba(245, 158, 11, 0.2);
}
.strip-icon { font-size: 14px; }
.strip-label { color: var(--text-muted); font-size: 11px; text-transform: uppercase; }
.strip-value { color: var(--text-primary); font-weight: 500; }
.need-text-val { color: var(--upcoming); font-weight: 600; }

/* Current Partnership Card */
.current-partnership-card {
    background: linear-gradient(145deg, var(--bg-card) 0%, rgba(34, 211, 238, 0.03) 100%);
    border: 1px solid var(--accent);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
    box-shadow: 0 4px 20px rgba(34, 211, 238, 0.05);
}
.partnership-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}
.partnership-card-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 1px;
}
.partnership-card-live-badge {
    font-size: 10px;
    background: var(--live-glow);
    color: var(--live);
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 700;
    animation: statusPulse 2s infinite;
}
.partnership-card-body {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 16px;
}
.partnership-card-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}
.pcard-num {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
}
.pcard-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-top: 4px;
    letter-spacing: 0.5px;
}
.partnership-card-divider {
    width: 1px;
    height: 30px;
    background: var(--border);
}
.partnership-card-players {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    padding-top: 12px;
    border-top: 1px dashed rgba(255,255,255,0.1);
}
.pcard-player {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}
.pcard-player-runs {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 400;
    margin-left: 4px;
}
.pcard-sep {
    color: var(--accent);
    font-size: 14px;
}
