/*
 * OncroScore FanView - CSS
 * Matches iOS FanScoreboardView design exactly
 */

/* ============================================
   CSS VARIABLES - Match iOS Colors
   ============================================ */

:root {
    /* iOS Team Colors */
    --home-green: rgb(0, 242, 102);
    --guest-cyan: rgb(0, 188, 212);

    /* MoboScore Brand Colors */
    --electric-cyan: rgb(0, 188, 212);
    --lime-green: rgb(118, 255, 3);

    /* Possession Animation - Gold & White */
    --possession-gold: rgb(255, 215, 0);
    --possession-white: rgb(255, 255, 255);

    /* iOS Background Colors */
    --black-bg: rgb(0, 0, 0);
    --dark-gray: rgb(51, 51, 51);
    --medium-gray: rgb(85, 85, 85);
    --light-gray: rgb(170, 170, 170);

    /* Other Colors */
    --danger-red: rgb(255, 59, 48);
    --white: rgb(255, 255, 255);
}

/* ============================================
   GLOBAL STYLES
   ============================================ */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: var(--black-bg);
    color: var(--white);
    overflow-x: hidden;
}

.screen {
    display: none;
    min-height: 100vh;
    width: 100%;
    position: relative;
}

.screen.active {
    display: flex;
    flex-direction: column;
}

/* ============================================
   ENTRY SCREEN - Clean Black Background
   ============================================ */

.gradient-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--black-bg);
    z-index: -1;
}

.entry-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 32px;
    position: relative;
}

.header {
    text-align: center;
    margin-bottom: 48px;
}

.logo-entry {
    max-width: 180px;
    height: auto;
    margin-bottom: 20px;
}

.header h1 {
    font-size: 36px;
    font-weight: 900;
    margin-bottom: 8px;
}

.subtitle {
    font-size: 16px;
    opacity: 0.9;
}

.input-section {
    width: 100%;
    max-width: 400px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid transparent;
    border-radius: 16px;
    padding: 4px 4px 4px 20px;
    transition: all 0.3s ease;
}

.input-wrapper.valid {
    border-color: rgb(76, 217, 100);
    background: rgba(76, 217, 100, 0.1);
}

.input-wrapper.invalid {
    border-color: rgb(255, 59, 48);
    background: rgba(255, 59, 48, 0.1);
}

#game-code-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    font-size: 24px;
    font-weight: 700;
    color: white;
    padding: 16px 0;
    font-family: 'Courier New', monospace;
    letter-spacing: 4px;
}

#game-code-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.qr-button {
    width: 56px;
    height: 56px;
    background: rgba(255, 255, 255, 0.3);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.qr-button:hover {
    background: rgba(255, 255, 255, 0.4);
}

.qr-button svg {
    width: 28px;
    height: 28px;
}

.access-button {
    width: auto;
    min-width: 200px;
    background: var(--guest-cyan);
    border: none;
    border-radius: 12px;
    padding: 14px 32px;
    margin: 20px auto 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, opacity 0.3s ease;
}

.access-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.access-button:not(:disabled):active {
    transform: scale(0.95);
}

.access-button:not(:disabled):hover {
    opacity: 0.9;
}

.message {
    text-align: center;
    font-size: 14px;
    margin-top: 16px;
    min-height: 20px;
}

.message.validation {
    color: rgb(76, 217, 100);
}

.message.error {
    color: rgb(255, 59, 48);
}


/* ============================================
   SCOREBOARD SCREEN - iOS Design Match
   ============================================ */

#scoreboard-screen {
    background-color: var(--black-bg);
}

.scoreboard-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 8px 10px 80px 10px;
    overflow-y: auto;
    position: relative;
}

/* Fan Code Header */
.fan-code-header {
    text-align: center;
    padding: 4px 0;
    font-size: 14px;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    color: var(--white);
}

/* Clock Section - iOS Design */
.clock-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--dark-gray);
    border-radius: 10px;
    padding: 8px 10px;
    margin-top: 4px;
}

.clock-item {
    flex: 1;
    text-align: center;
}

.period-item {
    flex: 0.8;
}

.clock-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 2px;
}

.clock-value {
    font-size: 40px;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    font-variant-numeric: tabular-nums;
    color: var(--white);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    line-height: 1;
}

.period-circle {
    width: 40px;
    height: 40px;
    border: 2px solid var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

.period-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--white);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

/* Ad Banner - iOS Design */
.ad-banner {
    background: var(--white);
    border-radius: 8px;
    padding: 8px 10px;
    margin-top: 4px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.ad-label {
    font-size: 10px;
    color: rgb(0, 122, 255);
    font-weight: 400;
}

.fan-mode-badge {
    font-size: 10px;
    padding: 2px 8px;
    background: rgba(128, 128, 128, 0.8);
    color: var(--white);
    border-radius: 3px;
    font-weight: 600;
}

.oncro-label {
    font-size: 10px;
    color: rgb(128, 128, 128);
    font-weight: 400;
}

.oncro-icon {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgb(255, 204, 0), rgb(255, 59, 48), rgb(175, 82, 222));
}

/* Main Scoreboard - iOS Design */
.main-scoreboard {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin: 20px 20px;
    flex: 1;
}

.team-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.center-spacer {
    width: 40px;
}

.team-name {
    font-size: 20px;
    font-weight: 700;
    text-transform: uppercase;
    max-width: 180px;
    text-align: center;
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

.team-column.guest .team-name {
    color: var(--guest-cyan);
}

/* Score Box - iOS Design (114x114) */
.score-box {
    position: relative;
    width: 114px;
    height: 114px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.home-score-box {
    background: var(--home-green);
}

.guest-score-box {
    background: var(--guest-cyan);
}

.score-value {
    font-size: 75px;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    font-variant-numeric: tabular-nums;
    color: var(--white);
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.5);
    line-height: 1;
    z-index: 1;
}

/* 🔥 FIX: Responsive font size for 100+ points (3 digits) */
.score-value.large-score {
    font-size: 58px; /* Reduced from 75px to fit 3 digits */
    letter-spacing: -2px; /* Tighter spacing for 3 digits */
}

/* Possession Border - Gold & White Animated Gradient */
.possession-border {
    position: absolute;
    top: -2px;
    left: -2px;
    width: 118px;
    height: 118px;
    border-radius: 18px;
    border: 4px solid transparent;
    background: linear-gradient(45deg,
        var(--possession-gold),
        var(--possession-white),
        var(--possession-gold),
        var(--possession-white),
        var(--possession-gold)
    ) border-box;
    -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    box-shadow:
        0 0 15px var(--possession-gold),
        0 0 25px var(--possession-white);
}

.possession-border.active {
    opacity: 1;
    animation: possessionGlow 1s ease-in-out infinite alternate,
               possessionShimmer 3s linear infinite;
}

@keyframes possessionGlow {
    from {
        box-shadow:
            0 0 15px var(--possession-gold),
            0 0 25px var(--possession-white);
    }
    to {
        box-shadow:
            0 0 25px var(--possession-gold),
            0 0 40px var(--possession-white),
            0 0 50px rgba(255, 215, 0, 0.5);
    }
}

@keyframes possessionShimmer {
    0% {
        background: linear-gradient(45deg,
            var(--possession-gold),
            var(--possession-white),
            var(--possession-gold),
            var(--possession-white),
            var(--possession-gold)
        ) border-box;
    }
    25% {
        background: linear-gradient(135deg,
            var(--possession-white),
            var(--possession-gold),
            var(--possession-white),
            var(--possession-gold),
            var(--possession-white)
        ) border-box;
    }
    50% {
        background: linear-gradient(225deg,
            var(--possession-gold),
            var(--possession-white),
            var(--possession-gold),
            var(--possession-white),
            var(--possession-gold)
        ) border-box;
    }
    75% {
        background: linear-gradient(315deg,
            var(--possession-white),
            var(--possession-gold),
            var(--possession-white),
            var(--possession-gold),
            var(--possession-white)
        ) border-box;
    }
    100% {
        background: linear-gradient(45deg,
            var(--possession-gold),
            var(--possession-white),
            var(--possession-gold),
            var(--possession-white),
            var(--possession-gold)
        ) border-box;
    }
}

/* Stat Box (Fouls/Timeouts) - iOS Design */
.stat-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.stat-label {
    font-size: 18px;
    font-weight: 500;
    color: var(--white);
}

.stat-box-frame {
    width: 65px;
    height: 52px;
    border-radius: 10px;
    border: 3px solid;
    display: flex;
    align-items: center;
    justify-content: center;
}

.home-stat-frame {
    border-color: var(--home-green);
}

.guest-stat-frame {
    border-color: var(--guest-cyan);
}

.stat-box .stat-value {
    font-size: 48px;
    font-weight: 700;
    color: var(--white);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    line-height: 1;
}

/* Bonus (red) styling for fouls >= bonus limit */
.stat-box-frame.bonus {
    border-color: var(--danger-red);
}

.stat-box .stat-value.bonus {
    color: var(--danger-red);
}

.stat-label.bonus {
    color: var(--white);
}

/* Game Leaders Section - iOS Design */
.game-leaders {
    margin-top: 4px;
}

.leaders-header {
    background: rgba(255, 255, 255, 0.1);
    padding: 6px;
    text-align: center;
    font-size: 14px;
    font-weight: 700;
    color: var(--white);
}

.leaders-cards {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 10px;
}

.placeholder-text {
    width: 100%;
    text-align: center;
    font-size: 12px;
    color: rgb(128, 128, 128);
    padding: 20px 10px;
}

.leader-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 8px;
    border-radius: 8px;
}

.leader-card.home {
    background: var(--home-green);
}

.leader-card.guest {
    background: var(--guest-cyan);
}

.leader-title {
    font-size: 9px;
    font-weight: 700;
    color: var(--white);
    text-align: center;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
}

.leader-circle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.leader-circle::before {
    content: '';
    position: absolute;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: var(--white);
    z-index: 0;
}

.leader-stat-value {
    font-size: 22px;
    font-weight: 700;
    font-family: 'SF Pro Rounded', -apple-system, sans-serif;
    position: relative;
    z-index: 1;
}

.leader-card.home .leader-stat-value {
    color: var(--home-green);
}

.leader-card.guest .leader-stat-value {
    color: var(--guest-cyan);
}

.leader-name {
    font-size: 11px;
    font-weight: 700;
    color: var(--white);
    text-align: center;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
}

.leader-stat {
    font-size: 10px;
    font-weight: 500;
    color: var(--white);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
}

/* Tab Bar */
.tab-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: var(--black-bg);
    border-top: 1px solid rgb(128, 128, 128, 0.3);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 100;
}

.tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: transparent;
    border: none;
    color: rgb(128, 128, 128);
    cursor: pointer;
    padding: 8px;
    border-radius: 15px;
}

.tab svg {
    width: 24px;
    height: 24px;
}

.tab span {
    font-size: 11px;
    font-weight: 600;
}

.tab.active {
    color: var(--white);
    background: rgb(0, 188, 212);
}

/* Tab Content */
.tab-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: calc(100% - 70px); /* Account for tab bar height */
    background: var(--black-bg);
    z-index: 50;
    padding: 20px;
    padding-bottom: 90px; /* Extra padding for tab bar */
    overflow-y: auto;
}

.players-container,
.settings-container {
    color: var(--white);
}

.players-container h2,
.settings-container h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 20px;
}

/* Team Tabs */
.team-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.team-tab {
    flex: 1;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid transparent;
    border-radius: 8px;
    color: var(--white);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
}

.team-tab:hover {
    background: rgba(255, 255, 255, 0.15);
}

.team-tab.active {
    background: rgba(0, 242, 102, 0.2);
    border-color: var(--home-green);
    color: var(--home-green);
}

.team-tab[data-team="guest"].active {
    background: rgba(0, 188, 212, 0.2);
    border-color: var(--guest-cyan);
    color: var(--guest-cyan);
}

/* Player Stats Table */
.stats-table {
    width: 100%;
    margin-top: 10px;
    overflow-x: auto; /* Enable horizontal scroll for wider table */
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
}

.stats-table::-webkit-scrollbar {
    height: 6px;
}

.stats-table::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.stats-header .stat-cell:first-child,
.stats-row .stat-cell:first-child {
    position: sticky;
    left: 0;
    z-index: 10;
}

.stats-header .stat-cell:first-child {
    background: rgba(255, 255, 255, 0.1);
}

.stats-row.home .stat-cell:first-child {
    background: transparent !important;
}

.stats-row.guest .stat-cell:first-child {
    background: transparent !important;
}

.stats-header {
    display: grid;
    grid-template-columns: minmax(100px, 140px) repeat(13, minmax(60px, 1fr));
    gap: 8px;
    padding: 8px 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px 8px 0 0;
    text-align: center;
    white-space: nowrap; /* Prevent header text wrapping */
}

.stats-header .stat-cell {
    font-size: 10px; /* 30% bigger than previous 8px */
    font-weight: 900; /* Extra bold to stand out */
    color: var(--white);
    letter-spacing: 0px;
}

.stats-row {
    display: grid;
    grid-template-columns: minmax(100px, 140px) repeat(13, minmax(60px, 1fr));
    gap: 8px;
    padding: 10px 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 12px;
    text-align: center;
    align-items: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

/* Alternating row colors for home team */
.stats-row.home:nth-child(even) {
    background: rgba(0, 242, 102, 0.08);
    border-left: 3px solid var(--home-green);
}

.stats-row.home:nth-child(odd) {
    background: rgba(0, 242, 102, 0.15);
    border-left: 3px solid var(--home-green);
}

/* Alternating row colors for guest team */
.stats-row.guest:nth-child(even) {
    background: rgba(0, 188, 212, 0.08);
    border-left: 3px solid var(--guest-cyan);
}

.stats-row.guest:nth-child(odd) {
    background: rgba(0, 188, 212, 0.15);
    border-left: 3px solid var(--guest-cyan);
}

/* Hover animations - border glow only */
.stats-row.home:hover {
    box-shadow: 0 0 15px rgba(0, 242, 102, 0.4), inset 0 0 20px rgba(0, 242, 102, 0.1);
}

.stats-row.guest:hover {
    box-shadow: 0 0 15px rgba(0, 188, 212, 0.4), inset 0 0 20px rgba(0, 188, 212, 0.1);
}

/* Clean table background */
#home-players-list .stats-table,
#guest-players-list .stats-table {
    background: transparent;
}

.stat-cell {
    color: var(--white);
    font-weight: 600;
}

.stat-cell.player-name {
    text-align: left;
    display: flex;
    align-items: center;
    gap: 4px;
    padding-left: 4px;
    overflow: visible; /* Allow name to be fully visible */
}

.player-number {
    font-size: 10px;
    font-weight: 700;
    color: var(--light-gray);
    min-width: 22px;
    flex-shrink: 0; /* Don't shrink the number */
}

.stat-cell .name {
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap; /* Keep name on one line */
    overflow: visible; /* Don't truncate */
    flex: 1; /* Take remaining space */
}

/* Plus/Minus styling */
.stat-cell.plus-minus {
    font-weight: 700;
}

.stat-cell.plus-minus.positive {
    color: #00ff00; /* Green for positive */
}

.stat-cell.plus-minus.negative {
    color: #ff4444; /* Red for negative */
}

.players-container .placeholder {
    text-align: center;
    color: rgb(128, 128, 128);
    padding: 40px 20px;
    font-size: 14px;
}

.settings-section {
    margin-bottom: 30px;
}

.settings-section h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--light-gray);
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.setting-label {
    font-size: 16px;
    color: var(--white);
}

.status-indicator {
    font-size: 14px;
    color: rgb(76, 217, 100);
    font-weight: 600;
}

.disconnect-button {
    width: 100%;
    padding: 16px;
    background: var(--danger-red);
    color: var(--white);
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
}

.app-version,
.copyright {
    font-size: 12px;
    color: rgb(128, 128, 128);
    text-align: center;
    margin: 8px 0;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 20px;
    z-index: 1000;
}

.loading-overlay.active {
    display: flex;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--white);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-overlay p {
    font-size: 16px;
    color: var(--white);
}

/* ============================================
   AD OVERLAY (Timeout/Warmup/Break)
   ============================================ */

.ad-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0; /* Full screen overlay - covers navigation tabs */
    background: #000000;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.overlay-top {
    padding: 40px 20px 20px;
    text-align: center;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0) 100%);
}

.overlay-label {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 3px;
    margin-bottom: 8px;
    opacity: 0.6;
}

.overlay-label.timeout-home {
    color: var(--home-green);
}

.overlay-label.timeout-guest {
    color: var(--guest-cyan);
}

.overlay-label.warmup {
    color: var(--lime-green);
}

.overlay-label.break {
    color: rgb(128, 0, 204); /* Purple */
}

.overlay-timer {
    font-size: 64px;
    font-weight: 700;
    font-family: 'SF Pro Display', -apple-system, sans-serif;
    color: var(--white);
    opacity: 0.6;
    letter-spacing: 2px;
}

.overlay-bottom {
    padding: 16px 12px 40px; /* Increased bottom padding to prevent cutoff */
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0) 100%);
    flex-shrink: 0; /* Prevent shrinking when content overflows */
    min-height: 140px; /* Increased minimum height for visibility */
    margin-bottom: 20px; /* Add margin to move entire section up from bottom edge */
}

.sponsor-text {
    text-align: center;
    font-size: 11px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.6);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.lower-thirds {
    display: flex;
    justify-content: space-around;
    align-items: center;
    background: rgba(0, 0, 0, 0.7); /* Darker background for better visibility */
    border: 2px solid rgba(255, 255, 255, 0.3); /* Brighter border */
    border-radius: 12px;
    padding: 12px 12px; /* Increased padding */
    min-height: 80px; /* Ensure minimum height */
}

.team-score {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.team-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
}

.team-label.home {
    color: var(--home-green);
}

.team-label.guest {
    color: var(--guest-cyan);
}

.score-display {
    font-size: 56px;
    font-weight: 700;
    font-family: 'SF Pro Display', -apple-system, sans-serif;
    color: var(--white);
    padding: 4px 12px;
    border-radius: 6px;
    line-height: 1;
}

/* 🔥 FIX: Responsive font size for 100+ points in overlay (3 digits) */
.score-display.large-score {
    font-size: 44px; /* Reduced from 56px to fit 3 digits */
    letter-spacing: -1px; /* Tighter spacing for 3 digits */
}

.home-side .score-display {
    border: 2px solid var(--home-green);
}

.guest-side .score-display {
    border: 2px solid var(--guest-cyan);
}

.team-stats {
    display: flex;
    gap: 6px;
    font-size: 10px;
    color: #999999;
}

.center-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
}

.game-clock-overlay,
.shot-clock-overlay {
    font-size: 28px;
    font-weight: 700;
    font-family: 'SF Pro Display', -apple-system, sans-serif;
    color: var(--white);
}

.clock-label-small {
    font-size: 9px;
    font-weight: 500;
    color: #999999;
    letter-spacing: 0.5px;
}

.period-circle-overlay {
    width: 36px;
    height: 36px;
    border: 2px solid var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: var(--white);
}

.possession-arrow {
    font-size: 14px;
    margin-top: 4px;
}

/* Overlay Middle Section - Ad Content or Stats */
.overlay-middle {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    margin-bottom: 50px; /* Move ad content up 50px to ensure lower thirds visibility */
}

/* Stats Carousel Content */
.stats-content {
    width: 100%;
    max-width: 600px;
    text-align: center;
}

.stats-header {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--electric-cyan);
    margin-bottom: 30px;
    text-transform: uppercase;
}

.stats-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.stats-item {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 15px 20px;
    font-size: 18px;
    font-weight: 600;
    color: var(--white);
    text-align: left;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stats-item-rank {
    color: var(--lime-green);
    font-size: 20px;
    font-weight: 700;
    min-width: 30px;
}

.stats-item-name {
    flex: 1;
    padding: 0 15px;
}

.stats-item-value {
    color: var(--electric-cyan);
    font-size: 22px;
    font-weight: 700;
}

/* ELITE: Video/Image Ad Content - Marcus Johnson (Ex-Apple) */
.video-content {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.overlay-ad-image {
    max-width: 70%;
    max-height: 70%;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    margin-bottom: 50px;
}

/* Ad Placeholder Content */
.placeholder-content {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.placeholder-box {
    background: linear-gradient(135deg, rgba(0, 188, 212, 0.1) 0%, rgba(118, 255, 3, 0.1) 100%);
    border: 3px dashed rgba(255, 255, 255, 0.3);
    border-radius: 24px;
    padding: 60px 40px;
    text-align: center;
    max-width: 500px;
}

.placeholder-icon {
    font-size: 80px;
    margin-bottom: 20px;
}

.placeholder-title {
    font-size: 48px;
    font-weight: 700;
    color: var(--white);
    letter-spacing: 3px;
    margin-bottom: 15px;
}

.placeholder-subtitle {
    font-size: 20px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 25px;
}

.placeholder-email {
    font-size: 24px;
    font-weight: 600;
    color: var(--electric-cyan);
    letter-spacing: 1px;
}
