:root {
    --bg-primary: #f1f2f5;
    --bg-secondary: #ffffff;
    --bg-dark: #222b3e;
    --text-primary: #111111;
    --text-secondary: #666666;
    --accent: #009270;
    --accent-dark: #007a5e;
    --live-red: #d32f2f;
    --border-color: #e0e0e0;
    --card-shadow: 0 2px 8px rgba(0,0,0,0.08);
    --font-main: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --font-heading: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

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

body {
    font-family: var(--font-main);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    overflow-x: hidden;
}

/* Header & Nav */
header {
    background-color: var(--accent);
    color: white;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-top {
    max-width: 1200px;
    margin: 0 auto;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-size: 24px;
    font-weight: 900;
    letter-spacing: -1px;
    color: white;
    text-decoration: none;
}

.logo span {
    color: #cbef43;
}

.nav-links {
    display: flex;
    gap: 20px;
}

.nav-link {
    color: white;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    padding: 5px 0;
}

.nav-secondary {
    background-color: var(--bg-dark);
}

.nav-secondary-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    gap: 25px;
    overflow-x: auto;
    scrollbar-width: none;
}

.nav-secondary-inner::-webkit-scrollbar {
    display: none;
}

.nav-secondary-link {
    color: #e0e0e0;
    text-decoration: none;
    font-size: 13px;
    padding: 12px 0;
    white-space: nowrap;
    border-bottom: 3px solid transparent;
}

.nav-secondary-link.active {
    border-bottom-color: #cbef43;
}

/* Ticker / Live Matches Bar */
.live-ticker {
    background-color: #f6f6f6;
    border-bottom: 1px solid var(--border-color);
}

.ticker-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px 20px;
    display: flex;
    gap: 15px;
    overflow-x: auto;
}

.ticker-card {
    background: white;
    min-width: 280px;
    padding: 12px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    flex-shrink: 0;
}

.ticker-card .status {
    font-size: 10px;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--live-red);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.ticker-card .status::before {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--live-red);
    border-radius: 50%;
    animation: blink 1s infinite;
}

@keyframes blink {
    0% { opacity: 1; }
    50% { opacity: 0.3; }
    100% { opacity: 1; }
}

.ticker-team {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    margin-bottom: 4px;
}

.ticker-team.winner {
    font-weight: 700;
}

.ticker-result {
    font-size: 11px;
    color: #1c6cbd;
    margin-top: 8px;
}

/* Main Layout */
.main-container {
    max-width: 1200px;
    margin: 20px auto;
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 20px;
    padding: 0 20px;
}

/* Score Card Section */
.card {
    background: white;
    border-radius: 4px;
    box-shadow: var(--card-shadow);
    margin-bottom: 20px;
    overflow: hidden;
}

.card-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-title {
    font-size: 18px;
    font-weight: 700;
}

.live-badge {
    background: var(--live-red);
    color: white;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 2px;
    font-weight: 700;
}

/* Score Hero */
.score-hero {
    padding: 30px 20px;
    background: linear-gradient(to bottom, #ffffff, #f9f9f9);
    text-align: center;
}

.match-info {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.teams-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 40px;
}

.team-block {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.team-logo {
    width: 60px;
    height: 60px;
    background: #eee;
    border-radius: 50%;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.team-name {
    font-size: 20px;
    font-weight: 700;
}

.team-score {
    font-size: 28px;
    font-weight: 900;
}

.vs-divider {
    font-size: 18px;
    color: var(--text-secondary);
    font-weight: 300;
}

.match-status-text {
    margin-top: 20px;
    font-weight: 600;
    color: var(--accent);
}

/* Commentary & Tabs */
.tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    background: #fafafa;
}

.tab {
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    text-decoration: none;
    border-bottom: 3px solid transparent;
}

.tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
    background: white;
}

.commentary-list {
    padding: 0;
}

.over-divider {
    background: #f1f2f5;
    padding: 8px 20px;
    font-size: 13px;
    font-weight: 700;
    display: flex;
    justify-content: space-between;
}

.comm-item {
    padding: 15px 20px;
    border-bottom: 1px solid #f0f0f0;
    display: grid;
    grid-template-columns: 45px 1fr;
    gap: 15px;
}

.ball-num {
    font-weight: 700;
    font-size: 14px;
}

.comm-text {
    font-size: 14px;
}

.comm-text strong {
    color: #111;
}

.event-tag {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 800;
    margin-right: 8px;
}

.tag-four { background: #e3f2fd; color: #1976d2; }
.tag-six { background: #f3e5f5; color: #7b1fa2; }
.tag-out { background: #ffebee; color: #c62828; }

/* Sidebar */
.sidebar-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.news-item {
    margin-bottom: 15px;
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: 12px;
}

.news-img {
    width: 80px;
    height: 50px;
    background: #ddd;
    border-radius: 4px;
}

.news-headline {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
    color: #333;
    text-decoration: none;
}

.news-headline:hover {
    color: var(--accent);
}

/* Refresh Simulation overlay (for "2 seconds load" feel) */
.refresh-pulse {
    position: fixed;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 2000;
    animation: fadeInOut 2s infinite;
}

@keyframes fadeInOut {
    0% { opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { opacity: 0; }
}

.loader-dot {
    width: 6px;
    height: 6px;
    background: #cbef43;
    border-radius: 50%;
    animation: pulse 0.5s infinite alternate;
}

@keyframes pulse {
    from { transform: scale(1); }
    to { transform: scale(1.5); }
}

@media (max-width: 900px) {
    .main-container {
        grid-template-columns: 1fr;
        padding: 0 10px;
    }
    .nav-links {
        display: none;
    }
}

/* Mobile Adjustments (375px and below) */
@media (max-width: 480px) {
    :root {
        --font-main: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    }

    body {
        font-size: 14px;
    }

    .nav-top {
        padding: 10px 15px;
    }

    .logo {
        font-size: 20px;
    }

    .nav-secondary-inner {
        padding: 0 15px;
        gap: 15px;
    }

    .nav-secondary-link {
        font-size: 12px;
        padding: 10px 0;
    }

    .ticker-inner {
        padding: 10px 15px;
        gap: 10px;
    }

    .ticker-card {
        min-width: 240px;
        padding: 10px;
    }

    /* Score Hero Mobile Stacking */
    .teams-display {
        flex-direction: column;
        gap: 15px;
    }

    .vs-divider {
        font-size: 14px;
        font-weight: 700;
        opacity: 0.6;
    }

    .team-name {
        font-size: 16px;
    }

    .team-score {
        font-size: 22px;
    }

    .team-logo {
        width: 48px;
        height: 48px;
    }

    .score-hero {
        padding: 20px 15px;
    }

    .match-info {
        font-size: 12px;
        margin-bottom: 15px;
    }

    /* Tabs scrollable on mobile */
    .tabs {
        overflow-x: auto;
        white-space: nowrap;
        scrollbar-width: none;
    }
    
    .tabs::-webkit-scrollbar {
        display: none;
    }

    .tab {
        padding: 10px 15px;
        font-size: 13px;
        flex: 0 0 auto;
    }

    .card-header {
        padding: 12px 15px;
    }

    .card-title {
        font-size: 15px;
    }

    .comm-item {
        padding: 12px 15px;
        grid-template-columns: 35px 1fr;
        gap: 10px;
    }

    .ball-num {
        font-size: 13px;
    }

    .comm-text {
        font-size: 13px;
    }

    .over-divider {
        padding: 6px 15px;
        font-size: 12px;
    }

    /* Footer Mobile */
    footer > div {
        grid-template-columns: 1fr 1fr !important;
        padding: 30px 15px !important;
        gap: 20px !important;
    }

    footer > div > div:first-child {
        grid-column: 1 / -1;
        margin-bottom: 10px;
    }

    .refresh-pulse {
        width: 90%;
        justify-content: center;
    }

    /* Fixed vertical stacking and potential overflows */
    .main-container {
        margin-top: 10px;
        gap: 15px;
    }

    .ticker-inner {
        padding-right: 20px; /* Ensure last card isn't cut off abruptly */
    }

    .ticker-card {
        min-width: 260px; /* Slightly wider for better readability on small screens */
    }

    .news-item {
        grid-template-columns: 60px 1fr;
        gap: 10px;
    }

    .news-img {
        width: 60px;
        height: 40px;
    }

    .sidebar-title {
        font-size: 14px;
        margin-bottom: 12px;
    }

    /* Prevent text overflow in team names or results */
    .ticker-team span, .ticker-result {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* Fix for 375px specifically to ensure no horizontal scroll on body */
    html, body {
        overflow-x: hidden;
        width: 100%;
        position: relative;
    }

    .card {
        width: 100%;
        border-radius: 0; /* Full width cards look better on mobile */
        margin-left: -10px;
        margin-right: -10px;
        width: calc(100% + 20px);
    }

    /* Fix footer grid */
    footer > div {
        grid-template-columns: 1fr !important; /* Single column for 375px */
    }
}
