:root {
    --bg-color: #0f0f0f;
    --card-bg: #1a1a1a;
    --text-color: #e0e0e0;
    --accent: #3498db; 
    --live-color: #e74c3c;
}

body {
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
}

header {
    background: #000;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #333;
}

.logo { font-size: 1.5rem; font-weight: 800; color: white; }
.logo span { color: var(--accent); }

#search-input {
    padding: 8px 15px;
    border-radius: 20px;
    border: none;
    background: #333;
    color: white;
    outline: none;
    width: 200px;
}

nav {
    display: flex;
    overflow-x: auto;
    padding: 15px 20px;
    background: #121212;
    gap: 10px;
    scrollbar-width: none; 
}
nav::-webkit-scrollbar { display: none; }

.nav-btn {
    background: #252525;
    border: none;
    color: #aaa;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    transition: 0.2s;
    flex-shrink: 0;
}

.nav-btn:hover, .nav-btn.active { background: var(--accent); color: white; }
.live-btn { color: var(--live-color); border: 1px solid var(--live-color); background: transparent; }
.live-btn:hover, .live-btn.active { background: var(--live-color); color: white; }

main { padding: 20px; max-width: 1400px; margin: 0 auto; }
#section-title { margin-bottom: 20px; font-size: 1.2rem; color: #fff; }

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

/* Match Card Styling with Background Image Support */
.match-card {
    background-color: var(--card-bg);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 12px;
    padding: 20px;
    transition: transform 0.2s;
    cursor: pointer;
    border: 1px solid #333;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    overflow: hidden;
    min-height: 180px;
}

/* Dark overlay so text pops */
.match-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(to bottom, rgba(0,0,0,0.4), rgba(0,0,0,0.95));
    z-index: 1;
}

.match-card:hover { transform: translateY(-5px); border-color: #555; }

/* Content layering */
.teams-container, .match-info {
    position: relative;
    z-index: 2;
    width: 100%;
}

.teams-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.team { display: flex; flex-direction: column; align-items: center; width: 40%; }

.team img { 
    width: 60px; 
    height: 60px; 
    object-fit: contain; 
    margin-bottom: 8px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.8));
}

.team span { 
    color: #fff; 
    text-shadow: 0 2px 4px rgba(0,0,0,0.8); 
    font-weight: bold; 
}

.vs { 
    font-size: 0.9rem; 
    color: #fff; 
    font-weight: 800; 
    text-shadow: 0 2px 4px rgba(0,0,0,0.8); 
}

.match-info {
    margin-top: auto;
    border-top: 1px solid rgba(255,255,255,0.2);
    padding-top: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: #ccc;
}

.live-badge { background: var(--live-color); color: white; padding: 2px 8px; border-radius: 4px; font-weight: bold; font-size: 0.7rem; }

/* Modal & Player */
.modal {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.9);
    z-index: 1000;
    display: flex; justify-content: center; align-items: center;
}
.hidden { display: none; }

.modal-content {
    background: #181818; width: 90%; max-width: 900px;
    border-radius: 10px; padding: 20px; position: relative;
}

.close-btn {
    position: absolute; top: 10px; right: 20px; font-size: 2rem; cursor: pointer; color: #aaa;
}
.close-btn:hover { color: white; }

.video-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    background: #000;
    margin-bottom: 15px;
    border-radius: 8px;
    overflow: hidden;
}

.video-container iframe, #placeholder-screen {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
}

#placeholder-screen {
    display: flex; justify-content: center; align-items: center;
    color: #555;
}

.stream-list { display: flex; gap: 10px; flex-wrap: wrap; }

.stream-btn {
    background: #333; border: none; color: white; padding: 8px 12px;
    border-radius: 6px; cursor: pointer; font-size: 0.9rem;
    display: flex; align-items: center; gap: 5px;
}
.stream-btn:hover { background: #444; }
.stream-btn.active { background: var(--accent); }
.hd-tag { background: #000; color: #f1c40f; padding: 1px 4px; border-radius: 3px; font-size: 0.7em; }

/* New Badge Styling */
.popular-badge { 
    background: #e67e22; 
    color: white; 
    padding: 2px 6px; 
    border-radius: 4px; 
    font-weight: bold; 
    font-size: 0.7rem; 
    margin-right: 5px; 
}