/* ============================================
   CricPulse — Premium Sports Dark Theme
   Font: Barlow Condensed (display) + Barlow (body)
   ============================================ */

/* ── CSS Variables ── */
:root {
    --bg-base:       #08091a;
    --bg-card:       #0f1228;
    --bg-card-hover: #161933;
    --bg-elevated:   #1a1f3a;
    --bg-input:      #111428;

    --accent:        #00d4ff;
    --accent-glow:   rgba(0, 212, 255, 0.25);
    --accent-2:      #ff6b35;
    --accent-3:      #7b61ff;
    --gold:          #ffd060;
    --green:         #22c55e;
    --red:           #ef4444;
    --red-soft:      rgba(239,68,68,0.15);

    --text-primary:  #f0f4ff;
    --text-secondary:#8892b0;
    --text-muted:    #4a5278;

    --border:        rgba(255,255,255,0.07);
    --border-accent: rgba(0,212,255,0.3);

    --live-color:    #ff4136;
    --live-glow:     rgba(255,65,54,0.3);

    --radius-sm:     8px;
    --radius-md:     14px;
    --radius-lg:     20px;
    --radius-xl:     28px;

    --shadow-card:   0 4px 24px rgba(0,0,0,0.4);
    --shadow-glow:   0 0 32px var(--accent-glow);

    --nav-height:    60px;
    --bottom-nav-h:  70px;
    --transition:    0.2s ease;
}

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }

body {
    font-family: 'Barlow', sans-serif;
    background: var(--bg-base);
    color: var(--text-primary);
    min-height: 100vh;
    padding-top: var(--nav-height);
    padding-bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px) + 16px);
    overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }

/* ── Typography ── */
h1, h2, h3, h4 { font-family: 'Barlow Condensed', sans-serif; font-weight: 700; line-height: 1.1; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-elevated); border-radius: 4px; }

/* ============================================
   TOP NAVIGATION
   ============================================ */
.top-nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--nav-height);
    background: rgba(8,9,26,0.92);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
}
.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 0 16px;
    max-width: 720px;
    margin: 0 auto;
}
.nav-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 800;
    font-size: 1.4rem;
    letter-spacing: -0.5px;
}
.logo-icon { font-size: 1.2rem; }
.logo-text { color: var(--text-primary); }
.logo-accent { color: var(--accent); }

.nav-badge {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    font-size: 0.75rem;
    padding: 5px 12px;
    border-radius: 20px;
    letter-spacing: 1px;
}
.nav-badge.subscribed {
    background: linear-gradient(135deg, var(--accent), var(--accent-3));
    color: #fff;
    display: flex;
    align-items: center;
    gap: 6px;
}
.nav-badge.free {
    background: rgba(0,212,255,0.12);
    border: 1px solid var(--border-accent);
    color: var(--accent);
}
.badge-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: #fff;
    animation: blink 1.2s infinite;
}

/* ============================================
   BOTTOM NAVIGATION
   ============================================ */
.bottom-nav {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px));
    background: rgba(8,9,26,0.95);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-around;
    z-index: 1000;
    padding-bottom: env(safe-area-inset-bottom);
}
.bnav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    flex: 1;
    padding: 8px 0;
    color: var(--text-muted);
    transition: color var(--transition);
    -webkit-tap-highlight-color: transparent;
}
.bnav-item.active { color: var(--accent); }
.bnav-item:active { transform: scale(0.92); }
.bnav-icon svg { width: 22px; height: 22px; }
.bnav-label { font-size: 0.65rem; font-weight: 600; letter-spacing: 0.5px; text-transform: uppercase; }

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content { max-width: 720px; margin: 0 auto; }

/* ============================================
   HERO SECTION
   ============================================ */
.hero-section {
    position: relative;
    padding: 32px 20px 24px;
    overflow: hidden;
}
.hero-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
}
.hero-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.25;
}
.hero-orb-1 {
    width: 280px; height: 280px;
    background: var(--accent);
    top: -80px; right: -60px;
}
.hero-orb-2 {
    width: 200px; height: 200px;
    background: var(--accent-3);
    bottom: -60px; left: -40px;
}
.hero-content { position: relative; z-index: 1; }

.live-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,65,54,0.15);
    border: 1px solid rgba(255,65,54,0.3);
    color: var(--live-color);
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    font-size: 0.75rem;
    letter-spacing: 2px;
    padding: 6px 12px;
    border-radius: 20px;
    margin-bottom: 12px;
}
.pulse-ring {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--live-color);
    box-shadow: 0 0 0 0 rgba(255,65,54,0.7);
    animation: pulse-ring 1.5s infinite;
}
.pulse-dot {
    position: relative;
}

.hero-title {
    font-size: clamp(2.4rem, 8vw, 3.5rem);
    font-weight: 900;
    line-height: 1;
    letter-spacing: -1px;
    margin-bottom: 8px;
}
.accent-text { color: var(--accent); }
.hero-sub {
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 400;
}

/* ============================================
   SECTION TABS
   ============================================ */
.matches-section { padding: 0 16px; }

.section-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0;
}
.tab-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    transition: all var(--transition);
    -webkit-tap-highlight-color: transparent;
    margin-bottom: -1px;
}
.tab-btn.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}
.tab-count {
    background: var(--bg-elevated);
    color: var(--text-secondary);
    font-size: 0.7rem;
    padding: 2px 7px;
    border-radius: 10px;
    font-weight: 600;
}
.tab-btn.active .tab-count {
    background: rgba(0,212,255,0.15);
    color: var(--accent);
}
.tab-icon { width: 14px; height: 14px; }
.live-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--live-color);
    animation: blink 1s infinite;
}

.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeSlideUp 0.25s ease; }

/* ============================================
   COUNTRY SEARCH BAR
   ============================================ */
.country-search-bar {
    margin-bottom: 14px;
}
.search-input-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0 14px;
    min-height: 48px;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.search-input-wrap:focus-within {
    border-color: var(--border-accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}
.search-icon {
    width: 18px; height: 18px;
    color: var(--text-muted);
    flex-shrink: 0;
}
#countrySearch {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-family: 'Barlow', sans-serif;
    font-size: 16px; /* 16px prevents iOS auto-zoom on focus */
    padding: 0;
    min-height: 48px;
    -webkit-appearance: none;
}
#countrySearch::placeholder { color: var(--text-muted); }
/* hide browser's native clear button on search inputs */
#countrySearch::-webkit-search-cancel-button { -webkit-appearance: none; }
#clearSearch {
    display: none;
    align-items: center;
    justify-content: center;
    width: 28px; height: 28px;
    border-radius: 50%;
    background: var(--bg-elevated);
    color: var(--text-secondary);
    font-size: 0.65rem;
    flex-shrink: 0;
    transition: background var(--transition), color var(--transition);
    /* extend tap area beyond visual size */
    touch-action: manipulation;
}
#clearSearch:hover,
#clearSearch:focus { background: rgba(0,212,255,0.15); color: var(--accent); outline: none; }
.search-no-results {
    text-align: center;
    padding: 40px 16px;
    color: var(--text-secondary);
}
.search-no-results .snr-icon { font-size: 2.2rem; margin-bottom: 10px; }
.search-no-results p { font-size: 0.9rem; line-height: 1.5; }

/* ============================================
   REFRESH BAR
   ============================================ */
.refresh-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 12px;
    padding: 6px 10px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}
.refresh-icon { font-size: 0.9rem; animation: spin 3s linear infinite; }
.refresh-timer {
    margin-left: auto;
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    color: var(--accent);
}

/* ============================================
   MATCH CARDS
   ============================================ */
.matches-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-bottom: 8px;
}

.match-card {
    display: block;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px;
    position: relative;
    overflow: hidden;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
    -webkit-tap-highlight-color: transparent;
    cursor: pointer;
}
.match-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 2px;
    background: transparent;
    transition: background var(--transition);
}
.match-card.card-live::before { background: linear-gradient(90deg, var(--live-color), var(--accent-2)); }
.match-card.card-upcoming::before { background: linear-gradient(90deg, var(--accent-3), var(--accent)); }
.match-card.card-ended::before { background: linear-gradient(90deg, var(--text-muted), var(--bg-elevated)); }

.match-card:active {
    transform: scale(0.97);
}
@media (hover: hover) {
    .match-card:hover {
        border-color: var(--border-accent);
        box-shadow: var(--shadow-glow);
        transform: translateY(-2px);
        background: var(--bg-card-hover);
    }
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}
.match-badges { display: flex; gap: 6px; align-items: center; }

.badge-type {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    font-size: 0.65rem;
    letter-spacing: 1.5px;
    padding: 3px 8px;
    background: var(--bg-elevated);
    color: var(--text-secondary);
    border-radius: 4px;
    border: 1px solid var(--border);
}
.badge-live {
    display: flex;
    align-items: center;
    gap: 5px;
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    font-size: 0.65rem;
    letter-spacing: 1.5px;
    padding: 3px 8px;
    background: rgba(255,65,54,0.15);
    color: var(--live-color);
    border-radius: 4px;
    border: 1px solid rgba(255,65,54,0.3);
}
.live-blink {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--live-color);
    animation: blink 0.8s infinite;
}
.badge-upcoming {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    font-size: 0.65rem;
    letter-spacing: 1.5px;
    padding: 3px 8px;
    background: rgba(123,97,255,0.15);
    color: var(--accent-3);
    border-radius: 4px;
}
.badge-ended {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    font-size: 0.65rem;
    letter-spacing: 1.5px;
    padding: 3px 8px;
    background: var(--bg-elevated);
    color: var(--text-muted);
    border-radius: 4px;
}
.card-date {
    font-size: 0.72rem;
    color: var(--text-muted);
}

/* Teams */
.card-body { margin-bottom: 12px; }
.team-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 0;
}
.team-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}
.team-flag {
    width: 36px; height: 36px;
    border-radius: 8px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 900;
    font-size: 0.65rem;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    flex-shrink: 0;
}
/* Team color accents */
[data-team="IND"] { background: linear-gradient(135deg,#0062cc,#002d6a); color:#5db3ff; }
[data-team="AUS"] { background: linear-gradient(135deg,#f7c500,#c4a000); color:#fff; }
[data-team="ENG"] { background: linear-gradient(135deg,#003399,#001466); color:#4d88ff; }
[data-team="SA"]  { background: linear-gradient(135deg,#007a4d,#004d30); color:#4dffb3; }
[data-team="PAK"] { background: linear-gradient(135deg,#01411c,#012810); color:#4dffb3; }
[data-team="NZ"]  { background: linear-gradient(135deg,#000000,#222); color:#fff; }
[data-team="SL"]  { background: linear-gradient(135deg,#2e1a87,#1a0f57); color:#b3a0ff; }
[data-team="BAN"] { background: linear-gradient(135deg,#006a4e,#003d2c); color:#4dffb3; }
[data-team="WI"]  { background: linear-gradient(135deg,#7b0000,#4d0000); color:#ff9999; }
[data-team="ZIM"] { background: linear-gradient(135deg,#006400,#003c00); color:#80ff80; }

.team-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.team-score {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-primary);
    text-align: right;
    white-space: nowrap;
}

.vs-divider {
    display: flex;
    align-items: center;
    padding: 2px 0;
}
.vs-text {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 0.65rem;
    font-weight: 900;
    color: var(--text-muted);
    letter-spacing: 2px;
    margin-left: 46px; /* align with team name */
}

.card-status {
    font-size: 0.8rem;
    color: var(--text-secondary);
    padding: 8px 10px;
    background: rgba(255,255,255,0.03);
    border-radius: var(--radius-sm);
    border-left: 2px solid var(--border);
    margin-bottom: 8px;
    line-height: 1.4;
}
.card-status.status-live {
    border-left-color: var(--live-color);
    color: var(--text-primary);
    background: rgba(255,65,54,0.06);
}

.card-venue {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-bottom: 10px;
}
.venue-icon { width: 12px; height: 12px; flex-shrink: 0; }

.card-tap-indicator {
    font-size: 0.72rem;
    color: var(--accent);
    text-align: right;
    opacity: 0.7;
    font-weight: 600;
}

/* Skeleton loading */
.skeleton {
    background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-elevated) 50%, var(--bg-card) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}
.skel-card {
    height: 140px;
    border-radius: var(--radius-lg);
    margin-bottom: 12px;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-muted);
}
.empty-icon { font-size: 3rem; margin-bottom: 12px; }

/* ============================================
   PROMO BANNER
   ============================================ */
.promo-banner {
    margin: 20px 16px 16px;
    background: linear-gradient(135deg, rgba(0,212,255,0.1), rgba(123,97,255,0.1));
    border: 1px solid var(--border-accent);
    border-radius: var(--radius-lg);
    padding: 16px;
}
.promo-inner {
    display: flex;
    align-items: center;
    gap: 12px;
}
.promo-icon { font-size: 1.8rem; flex-shrink: 0; }
.promo-text { flex: 1; min-width: 0; }
.promo-text strong { font-family: 'Barlow Condensed', sans-serif; font-size: 1rem; font-weight: 800; display: block; }
.promo-text p { font-size: 0.75rem; color: var(--text-secondary); margin-top: 2px; }
.btn-subscribe-cta {
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--accent), var(--accent-3));
    color: #fff;
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
    padding: 8px 14px;
    border-radius: 20px;
    white-space: nowrap;
}

/* ============================================
   MATCH HERO (DETAIL PAGE)
   ============================================ */
.match-hero {
    position: relative;
    background: var(--bg-card);
    padding: 16px 16px 24px;
    border-bottom: 1px solid var(--border);
    overflow: hidden;
}
.match-hero::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
}
.match-hero-live .match-hero-bg {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at top right, rgba(255,65,54,0.08) 0%, transparent 70%);
    pointer-events: none;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
    -webkit-tap-highlight-color: transparent;
}
.back-btn svg { width: 18px; height: 18px; }
.back-btn:active { opacity: 0.7; }

.match-meta-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

/* Scoreboard */
.scoreboard {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 12px;
    align-items: center;
    margin-bottom: 16px;
}
.sb-team {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}
.sb-team-right { align-items: flex-end; text-align: right; }

.sb-flag {
    width: 48px; height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 900;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
    border: 1px solid var(--border);
    background: var(--bg-elevated);
}
.sb-team-name {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1;
}
.sb-score {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 900;
    font-size: 2rem;
    line-height: 1;
    color: var(--text-primary);
}
.sb-overs {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.sb-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}
.sb-vs {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 900;
    font-size: 1.1rem;
    color: var(--text-muted);
    letter-spacing: 2px;
}
.sb-live-dot {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    font-size: 0.6rem;
    letter-spacing: 1px;
    color: var(--live-color);
    display: flex;
    align-items: center;
    gap: 4px;
}

.match-status-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-align: center;
    padding: 8px 16px;
    background: rgba(255,255,255,0.03);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
}
.match-status-text.status-live {
    color: var(--text-primary);
    background: rgba(255,65,54,0.08);
    border: 1px solid rgba(255,65,54,0.2);
}
.match-venue-text {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 6px;
}

/* ============================================
   DETAIL TABS
   ============================================ */
.detail-section { padding: 0; }

.detail-tabs {
    display: flex;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
    scrollbar-width: none;
}
.detail-tabs::-webkit-scrollbar { display: none; }

.dtab {
    flex-shrink: 0;
    padding: 14px 18px;
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    transition: all var(--transition);
    -webkit-tap-highlight-color: transparent;
    white-space: nowrap;
}
.dtab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
    background: rgba(0,212,255,0.04);
}

.dtab-panel { display: none; padding: 16px; }
.dtab-panel.active { display: block; animation: fadeSlideUp 0.2s ease; }

/* ============================================
   SCORECARD TABLES
   ============================================ */
.inning-block { margin-bottom: 24px; }

.inning-title {
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: var(--accent);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 12px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.score-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
    min-width: 420px;
}
.score-table thead {
    background: var(--bg-elevated);
}
.score-table th {
    padding: 10px 12px;
    text-align: left;
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    font-size: 0.72rem;
    letter-spacing: 1px;
    color: var(--text-muted);
    text-transform: uppercase;
    white-space: nowrap;
}
.score-table td {
    padding: 10px 12px;
    border-top: 1px solid var(--border);
    color: var(--text-secondary);
    white-space: nowrap;
}
.score-table tbody tr:hover { background: rgba(255,255,255,0.02); }
.player-name { color: var(--text-primary) !important; font-weight: 600; }
.dismissal { font-size: 0.75rem; color: var(--text-muted) !important; max-width: 160px; white-space: normal !important; line-height: 1.3; }
.score-cell.highlight { font-family: 'Barlow Condensed', sans-serif; font-weight: 800; font-size: 1rem; color: var(--text-primary) !important; }

.sub-table-title {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 12px 0 8px;
    letter-spacing: 0.5px;
}
.bowling-table-wrap { margin-top: 8px; }

.extras-row, .total-row {
    font-size: 0.8rem;
    color: var(--text-secondary);
    padding: 6px 8px;
}
.total-row { font-weight: 600; color: var(--text-primary); }

/* ============================================
   LOCK OVERLAY
   ============================================ */
.lock-overlay {
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
    position: relative;
}
.lock-content {
    background: var(--bg-card);
    border: 1px solid var(--border-accent);
    border-radius: var(--radius-xl);
    padding: 28px 24px;
    text-align: center;
    max-width: 340px;
    width: 100%;
    box-shadow: var(--shadow-glow);
}
.lock-icon { font-size: 2.5rem; margin-bottom: 12px; }
.lock-title {
    font-size: 1.4rem;
    font-weight: 800;
    margin-bottom: 8px;
}
.lock-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 16px;
}
.lock-features {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 20px;
}
.lock-feature {
    font-size: 0.78rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: rgba(255,255,255,0.03);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}
.lock-feature span { color: var(--green); font-size: 0.7rem; }
.btn-unlock {
    display: block;
    background: linear-gradient(135deg, var(--accent), var(--accent-3));
    color: #fff;
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 800;
    font-size: 1.05rem;
    letter-spacing: 0.5px;
    padding: 14px 24px;
    border-radius: var(--radius-md);
    text-align: center;
    transition: opacity var(--transition), transform var(--transition);
}
.btn-unlock:active { opacity: 0.85; transform: scale(0.97); }

/* ============================================
   COMMENTARY
   ============================================ */
.commentary-stream { display: flex; flex-direction: column; gap: 1px; }
.commentary-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    border-bottom: 1px solid var(--border);
    transition: background var(--transition);
}
.commentary-item:hover { background: rgba(255,255,255,0.02); }
.ci-ball {
    flex-shrink: 0;
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--accent);
    min-width: 36px;
}
.ci-text { font-size: 0.85rem; color: var(--text-secondary); line-height: 1.5; }
.ci-highlight {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 800;
    font-size: 0.9rem;
    padding: 2px 8px;
    border-radius: 4px;
    margin-right: 6px;
}
.ci-highlight.six { background: rgba(0,212,255,0.15); color: var(--accent); }
.ci-highlight.four { background: rgba(34,197,94,0.15); color: var(--green); }
.ci-highlight.wicket { background: rgba(239,68,68,0.15); color: var(--red); }
.ci-special { background: rgba(255,255,255,0.015); }
.commentary-note {
    padding: 12px;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
}

/* ============================================
   STATS SECTION
   ============================================ */
.stats-section-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-secondary);
    margin-bottom: 12px;
    letter-spacing: 0.5px;
}
.stats-cards-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 8px;
}
.stats-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px;
    transition: border-color var(--transition);
}
.stats-card:hover { border-color: var(--border-accent); }
.stats-card-label {
    font-size: 0.68rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 4px;
}
.stats-player-name {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-primary);
    margin-bottom: 4px;
}
.stats-primary {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 900;
    font-size: 1.8rem;
    line-height: 1;
    color: var(--accent);
    margin-bottom: 2px;
}
.stats-unit { font-size: 1rem; color: var(--text-secondary); }
.stats-secondary { font-size: 0.72rem; color: var(--text-muted); margin-bottom: 8px; }
.stats-bar-row { display: flex; align-items: center; gap: 8px; }
.stats-bar-label { font-size: 0.65rem; color: var(--text-muted); width: 40px; flex-shrink: 0; }
.stats-bar {
    flex: 1;
    height: 4px;
    background: var(--bg-elevated);
    border-radius: 4px;
    overflow: hidden;
}
.stats-bar-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 4px;
    transition: width 1s ease;
}
.stats-bar-fill.accent { background: var(--accent-3); }
.stats-bar-fill.gold   { background: var(--gold); }
.stats-bar-fill.green  { background: var(--green); }

/* ============================================
   AI INSIGHTS
   ============================================ */
.ai-section { padding: 4px 0; }
.ai-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding: 14px;
    background: linear-gradient(135deg, rgba(123,97,255,0.1), rgba(0,212,255,0.1));
    border: 1px solid rgba(123,97,255,0.2);
    border-radius: var(--radius-md);
}
.ai-icon { font-size: 2rem; }
.ai-title { font-family: 'Barlow Condensed', sans-serif; font-weight: 800; font-size: 1.1rem; }
.ai-sub { font-size: 0.72rem; color: var(--text-muted); }

.ai-insight-card {
    display: flex;
    gap: 12px;
    padding: 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-bottom: 10px;
    transition: border-color var(--transition);
}
.ai-insight-card:hover { border-color: rgba(123,97,255,0.3); }
.ai-insight-icon { font-size: 1.4rem; flex-shrink: 0; }
.ai-insight-body { flex: 1; }
.ai-insight-body strong { font-size: 0.9rem; display: block; margin-bottom: 4px; }
.ai-insight-body p { font-size: 0.82rem; color: var(--text-secondary); line-height: 1.5; }
.ai-highlight { color: var(--accent); font-weight: 700; }
.ai-disclaimer { font-size: 0.72rem; color: var(--text-muted); text-align: center; padding: 8px; }

.win-prob-bar {
    display: flex;
    margin-top: 10px;
    border-radius: 4px;
    overflow: hidden;
    height: 24px;
}
.win-prob-fill {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 700;
    font-family: 'Barlow Condensed', sans-serif;
    transition: width 1s ease;
}
.win-prob-fill.ind { background: linear-gradient(90deg,#0062cc,#0080ff); color:#fff; }
.win-prob-fill.aus { background: linear-gradient(90deg,#c4a000,#f7c500); color:#000; }

/* ============================================
   SUBSCRIPTION PAGE
   ============================================ */
.sub-page { padding-bottom: 32px; }

.sub-hero {
    position: relative;
    padding: 36px 20px 28px;
    text-align: center;
    overflow: hidden;
}
.sub-hero-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
}
.sub-hero-content { position: relative; z-index: 1; }
.sub-badge {
    display: inline-block;
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 800;
    font-size: 0.75rem;
    letter-spacing: 2px;
    padding: 5px 14px;
    background: linear-gradient(135deg, rgba(0,212,255,0.15), rgba(123,97,255,0.15));
    border: 1px solid var(--border-accent);
    color: var(--accent);
    border-radius: 20px;
    margin-bottom: 12px;
}
.sub-title {
    font-size: clamp(2rem, 7vw, 3rem);
    font-weight: 900;
    margin-bottom: 8px;
}
.sub-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.features-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 0 16px 20px;
}
.feature-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}
.fc-icon { font-size: 1.3rem; flex-shrink: 0; }
.fc-text strong { font-size: 0.82rem; display: block; font-weight: 700; }
.fc-text small { font-size: 0.7rem; color: var(--text-muted); }

.sub-form-card {
    margin: 0 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 28px 20px;
    position: relative;
    overflow: hidden;
}
.sub-form-card.already-sub { text-align: center; }
.already-sub .success-icon { font-size: 3rem; margin-bottom: 12px; }
.already-sub h2 { font-size: 1.4rem; margin-bottom: 8px; }
.already-sub p { color: var(--text-secondary); font-size: 0.85rem; margin-bottom: 20px; }
.unsub-link-wrap { margin-top: 12px; }
.unsub-link { font-size: 0.8rem; color: var(--text-muted); text-decoration: underline; }

.sub-step { animation: fadeSlideUp 0.3s ease; }
.sub-step.hidden { display: none; }

.form-title {
    font-size: 1.3rem;
    font-weight: 800;
    margin-bottom: 4px;
}
.form-hint {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.input-group {
    display: flex;
    align-items: center;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 4px 12px;
    margin-bottom: 12px;
    transition: border-color var(--transition);
}
.input-group:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0,212,255,0.1); }
.input-prefix { font-size: 1.1rem; margin-right: 8px; flex-shrink: 0; }
.form-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 1rem;
    font-family: 'Barlow', sans-serif;
    padding: 12px 0;
}
.form-input::placeholder { color: var(--text-muted); }

.otp-demo-note {
    font-size: 0.75rem;
    color: var(--gold);
    background: rgba(255,208,96,0.08);
    border: 1px solid rgba(255,208,96,0.2);
    border-radius: var(--radius-sm);
    padding: 8px 10px;
    margin-bottom: 16px;
    line-height: 1.4;
}

.otp-preview-box {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 16px;
    padding: 12px;
    background: rgba(255,208,96,0.06);
    border: 1px solid rgba(255,208,96,0.2);
    border-radius: var(--radius-md);
}
.otp-preview-label { font-size: 0.75rem; color: var(--gold); }
.otp-preview-code {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 900;
    font-size: 1.6rem;
    letter-spacing: 6px;
    color: var(--gold);
}

.otp-inputs {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 20px;
}
.otp-digit {
    width: 44px; height: 52px;
    background: var(--bg-input);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    text-align: center;
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 900;
    font-size: 1.4rem;
    color: var(--text-primary);
    outline: none;
    transition: border-color var(--transition);
    -webkit-appearance: none;
}
.otp-digit:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0,212,255,0.1); }
.otp-inputs.shake { animation: shake 0.5s ease; }

.resend-row {
    text-align: center;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 12px;
}
.resend-btn {
    color: var(--accent);
    font-size: 0.78rem;
    padding: 0;
    text-decoration: underline;
    cursor: pointer;
}
.resend-btn:disabled { color: var(--text-muted); text-decoration: none; cursor: default; }

/* Success animation */
.success-anim {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
}
.success-circle {
    width: 72px; height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--green), #16a34a);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 0 32px rgba(34,197,94,0.3);
}
.success-circle.neutral {
    background: linear-gradient(135deg, var(--text-muted), var(--bg-elevated));
    box-shadow: none;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--accent), var(--accent-3));
    color: #fff;
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 800;
    font-size: 1.05rem;
    letter-spacing: 0.5px;
    padding: 14px 24px;
    border-radius: var(--radius-md);
    transition: opacity var(--transition), transform var(--transition);
    cursor: pointer;
    border: none;
}
.btn-primary:active { opacity: 0.85; transform: scale(0.97); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: var(--text-secondary);
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    padding: 13px 24px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    transition: border-color var(--transition), color var(--transition);
    cursor: pointer;
}
.btn-ghost:hover { border-color: var(--border-accent); color: var(--accent); }

.btn-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--red-soft);
    color: var(--red);
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 800;
    font-size: 1.05rem;
    padding: 14px 24px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(239,68,68,0.3);
    cursor: pointer;
    transition: background var(--transition);
}
.btn-danger:hover { background: rgba(239,68,68,0.2); }

.btn-full { width: 100%; }
.btn-text, .btn-loader { transition: opacity var(--transition); }
.hidden { display: none !important; }

/* Warning box */
.warning-box {
    font-size: 0.82rem;
    color: var(--gold);
    background: rgba(255,208,96,0.08);
    border: 1px solid rgba(255,208,96,0.2);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    margin-bottom: 16px;
    line-height: 1.4;
}

/* ============================================
   UNSUBSCRIBE PAGE
   ============================================ */
.unsub-hero {
    padding: 20px 16px 24px;
    text-align: center;
    position: relative;
}
.unsub-hero .back-btn {
    position: absolute;
    left: 16px;
    top: 20px;
}
.unsub-icon { font-size: 3rem; margin-bottom: 12px; margin-top: 8px; }

/* ============================================
   PROFILE PAGE
   ============================================ */
.profile-page { padding: 20px 16px; }

.profile-hero {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    padding: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
}
.avatar-circle {
    width: 60px; height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-3), var(--accent));
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 900;
    font-size: 1.2rem;
    color: #fff;
    flex-shrink: 0;
}
.profile-avatar { position: relative; flex-shrink: 0; }
.avatar-badge {
    position: absolute;
    bottom: -4px; right: -4px;
    background: linear-gradient(135deg, var(--accent), var(--accent-3));
    color: #fff;
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 800;
    font-size: 0.6rem;
    letter-spacing: 0.5px;
    padding: 2px 5px;
    border-radius: 4px;
}
.profile-phone { font-size: 1rem; font-weight: 600; }
.profile-joined { font-size: 0.75rem; color: var(--text-muted); margin-top: 4px; }

.status-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    border-radius: var(--radius-lg);
    margin-bottom: 16px;
    border: 1px solid;
}
.status-card.status-premium {
    background: linear-gradient(135deg, rgba(0,212,255,0.06), rgba(123,97,255,0.06));
    border-color: var(--border-accent);
}
.status-card.status-free {
    background: var(--bg-card);
    border-color: var(--border);
}
.status-icon { font-size: 1.8rem; flex-shrink: 0; }
.status-label {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 800;
    font-size: 1.05rem;
    margin-bottom: 2px;
}
.status-desc { font-size: 0.78rem; color: var(--text-secondary); line-height: 1.4; }

.access-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}
.access-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 0.85rem;
}
.access-item.unlocked { color: var(--text-primary); }
.access-item.locked { color: var(--text-muted); }
.access-icon { font-size: 1rem; }

.status-check-card {
    margin-top: 24px;
    padding: 18px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
}
.status-check-card h3 { font-size: 1rem; margin-bottom: 4px; }
.status-check-card p { font-size: 0.78rem; color: var(--text-secondary); margin-bottom: 12px; }
.status-result { margin-top: 12px; text-align: center; }
.status-badge {
    display: inline-block;
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    font-size: 0.85rem;
    padding: 6px 16px;
    border-radius: 20px;
    letter-spacing: 0.5px;
}
.status-badge.premium {
    background: rgba(0,212,255,0.12);
    color: var(--accent);
    border: 1px solid var(--border-accent);
}
.status-badge.free {
    background: var(--bg-elevated);
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.unsub-link-profile { font-size: 0.82rem; color: var(--text-muted); text-decoration: underline; }

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */
.toast-container {
    position: fixed;
    top: calc(var(--nav-height) + 12px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
    width: min(360px, 90vw);
}
.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    font-size: 0.85rem;
    color: var(--text-primary);
    pointer-events: all;
    animation: slideDown 0.3s ease, fadeOut 0.3s ease 2.7s forwards;
    box-shadow: var(--shadow-card);
}
.toast.toast-error { border-color: rgba(239,68,68,0.4); background: rgba(239,68,68,0.1); }
.toast.toast-success { border-color: rgba(34,197,94,0.4); background: rgba(34,197,94,0.08); }

/* ============================================
   PAGE LOADER
   ============================================ */
.page-loader {
    position: fixed;
    inset: 0;
    background: rgba(8,9,26,0.85);
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
}
.page-loader.hidden { display: none; }
.loader-inner { display: flex; gap: 8px; }
.loader-ball {
    width: 12px; height: 12px;
    border-radius: 50%;
    background: var(--accent);
    animation: bounceBall 0.6s infinite alternate;
}
.loader-ball:nth-child(2) { animation-delay: 0.15s; background: var(--accent-3); }
.loader-ball:nth-child(3) { animation-delay: 0.3s; background: var(--accent-2); }

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes pulse-ring {
    0%   { box-shadow: 0 0 0 0 rgba(255,65,54,0.7); }
    70%  { box-shadow: 0 0 0 8px rgba(255,65,54,0); }
    100% { box-shadow: 0 0 0 0 rgba(255,65,54,0); }
}
@keyframes blink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.3; }
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
@keyframes shimmer {
    to { background-position: -200% 0; }
}
@keyframes fadeSlideUp {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeOut {
    to { opacity: 0; transform: translateY(-4px); }
}
@keyframes popIn {
    from { transform: scale(0.5); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}
@keyframes bounceBall {
    from { transform: translateY(0); }
    to   { transform: translateY(-16px); }
}
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%       { transform: translateX(-6px); }
    40%       { transform: translateX(6px); }
    60%       { transform: translateX(-4px); }
    80%       { transform: translateX(4px); }
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (min-width: 600px) {
    .stats-cards-grid { grid-template-columns: 1fr 1fr 1fr 1fr; }
    .features-grid { grid-template-columns: 1fr 1fr 1fr 1fr; }
    .sub-form-card { max-width: 420px; margin: 0 auto; }
    .otp-digit { width: 52px; height: 60px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
