:root {
    /* Base Variables (Dark Theme Default) */
    --font-main: 'Outfit', system-ui, sans-serif;
    --radius: 12px;
    
    /* Requested Colors */
    --gold: #D4AF37;
    --red: #FF0055;
    --green: #00F260;
    --blue: #0575E6;
    
    /* Theme Mapping - Dark Mode */
    --bg-color: rgba(5, 5, 5, 0.85);
    --bg-panel: rgba(20, 20, 20, 0.7);
    --surface-color: rgba(30, 30, 30, 0.6);
    --border-color: rgba(255, 255, 255, 0.1);
    
    --text-primary: #FFFFFF;
    --text-secondary: #CCCCCC;
    --text-muted: #A0A0A0;
    --text-light: #E2E8F0;
    
    --primary-color: var(--gold);
    --accent-color: var(--red);
    --accent-1: var(--green);
    --accent-2: var(--blue);
    
    --glow-primary: rgba(212, 175, 55, 0.5);
    --accent-glow: rgba(255, 0, 85, 0.4);
    
    --gradient-1: linear-gradient(135deg, var(--gold), var(--red));
}

[data-theme="light"] {
    /* Theme Mapping - Light Mode */
    --bg-color: rgba(248, 249, 250, 0.85);
    --bg-panel: rgba(255, 255, 255, 0.8);
    --surface-color: rgba(255, 255, 255, 0.6);
    --border-color: rgba(0, 0, 0, 0.1);
    
    --text-primary: #1A1A1A;
    --text-secondary: #4A4A4A;
    --text-muted: #718096;
    --text-light: #2D3748;
    
    /* Keep requested colors but use them on light backgrounds */
    --primary-color: #B8860B; /* Darker Gold for visibility */
    --accent-color: #D60047; /* Darker Red */
    --accent-1: #00A340; /* Darker Green */
    --accent-2: #0056B3; /* Darker Blue */
    
    --glow-primary: rgba(184, 134, 11, 0.3);
    --accent-glow: rgba(214, 0, 71, 0.3);
    
    --gradient-1: linear-gradient(135deg, var(--primary-color), var(--accent-color));
}

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

html {
    max-width: 100%;
    width: 100%;
    overflow-x: hidden;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
}

/* Background blob effects */
body::before, body::after {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    filter: blur(100px);
    z-index: -1;
    opacity: 0.15;
}

body::before {
    background: var(--accent-1);
    top: 0;
    left: 0;
}

body::after {
    background: var(--accent-2);
    bottom: 0;
    right: 0;
}

/* Background Video */
.bg-video {
    position: fixed;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    transform: translate(-50%, -50%);
    z-index: -2;
    opacity: 0.8;
}

/* Glassmorphism utility */
.glass {
    background: var(--surface-color);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
}

/* Navigation */
.navbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%;
    position: sticky;
    top: 0;
    z-index: 100;
}

.brand-text {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 1px;
}

.brand-accent {
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-links {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
    position: relative;
}

.nav-links a:hover, .nav-links a.active {
    color: var(--text-primary);
}

.nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--accent-color);
    box-shadow: 0 0 10px var(--accent-glow);
}

/* Main Content */
.container {
    flex: 1;
    padding: 2rem 5%;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.hero {
    text-align: center;
    margin: 4rem 0;
    animation: fadeInDown 1s ease;
}

.hero-title {
    font-size: 4rem;
    font-weight: 800;
    margin-bottom: 1rem;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.9));
}

.text-gradient {
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 1.3rem;
    font-weight: 600;
    color: #FFFFFF;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 1), 0 4px 20px rgba(0, 0, 0, 0.8);
    letter-spacing: 0.5px;
}

/* Grid */
.matches-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

/* Match Card */
.match-card {
    border-radius: 16px;
    padding: 1.5rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    min-width: 0;
    max-width: 100%;
}

.match-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.05), transparent);
    transform: skewX(-20deg);
    transition: left 0.5s ease;
}

.match-card:hover::before {
    left: 150%;
}

.match-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 15px rgba(0, 242, 96, 0.2);
    border-color: rgba(0, 242, 96, 0.3);
}

.match-status {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1rem;
}

.status-live {
    background: rgba(0, 242, 96, 0.1);
    color: var(--accent-color);
    box-shadow: 0 0 10px rgba(0, 242, 96, 0.2);
    animation: pulse 2s infinite;
}

.status-upcoming {
    background: rgba(5, 117, 230, 0.1);
    color: var(--accent-2);
}

.match-teams {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.team {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    width: 40%;
    text-align: center;
}

.team-badge {
    width: 48px;
    height: 48px;
    object-fit: contain;
}

.team-name {
    font-size: 0.9rem;
    font-weight: 600;
}

.match-vs {
    font-weight: 800;
    color: var(--text-secondary);
    font-size: 1.2rem;
}

.match-time {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

/* Match Modal */
.modal {
    display: flex;
    justify-content: center;
    align-items: center;
    position: fixed; 
    z-index: 1000; 
    left: 0;
    top: 0;
    width: 100%; 
    height: 100%; 
    overflow: auto; 
    background-color: rgba(0,0,0,0.8);
    backdrop-filter: blur(10px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal:not(.hidden) {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    width: 90%;
    max-width: 900px;
    border-radius: 16px;
    padding: 1rem;
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal:not(.hidden) .modal-content {
    transform: scale(1);
}

.close-btn {
    position: absolute;
    top: -15px;
    right: -15px;
    background: var(--bg-color);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s;
}

.close-btn:hover {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: #fff;
}

.stream-container {
    width: 100%;
    aspect-ratio: 16/9;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
}

.bg-video {
    position: fixed;
    right: 0;
    bottom: 0;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    z-index: -2;
    object-fit: cover;
    opacity: 0.8;
}

.stream-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.modal-details {
    margin-top: 1rem;
    padding: 1rem;
}

.sources-list {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.source-btn {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font-main);
}

.source-btn:hover, .source-btn.active {
    background: var(--accent-color);
    color: #fff;
    border-color: var(--accent-color);
    font-weight: 600;
}

/* Footer */
.footer {
    margin-top: auto;
    padding: 2rem 5%;
    text-align: center;
    border-top: 1px solid var(--border-color);
    border-radius: 20px 20px 0 0;
}

.disclaimer {
    color: var(--text-secondary);
    font-size: 0.85rem;
    max-width: 800px;
    margin: 0 auto 1rem auto;
    line-height: 1.5;
}

.copyright {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Loaders */
.loader {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
    font-size: 1.2rem;
    animation: pulse 1.5s infinite;
}

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
    background: var(--surface-color);
    border-radius: 16px;
    border: 1px dashed var(--border-color);
}

/* WC 26 Launch Screen */
#launch-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 1s ease, visibility 1s;
}

#launch-screen.fade-out {
    opacity: 0;
    visibility: hidden;
}

.launch-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.launch-logo {
    max-width: 300px;
    width: 80%;
    animation: fadeInDown 1s ease;
}

.enter-btn {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    padding: 1rem 3rem;
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: 2px;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
}

.enter-btn:hover {
    background: var(--primary-color);
    color: #000;
    box-shadow: 0 0 30px var(--glow-primary);
    transform: scale(1.05);
}

/* Theme Toggle Button */
.nav-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.theme-toggle-btn {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    filter: grayscale(100%);
    transition: transform 0.3s ease, filter 0.3s ease;
}

.theme-toggle-btn:hover {
    transform: scale(1.1);
    filter: grayscale(0%);
}

/* Keyframes */
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

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

@keyframes loadBar {
    0% { width: 0; }
    100% { width: 300px; }
}

/* Responsive Mobile UI Optimizations */
@media (max-width: 768px) {
    /* Base spacing */
    .container {
        padding: 1rem 3%;
    }
    
    .hero {
        margin: 2rem 0;
    }

    /* Typography */
    .hero-title { font-size: 2.2rem; }
    .hero-subtitle { font-size: 1rem; }
    .countdown-timer { font-size: 2rem; }
    
    /* Navigation */
    .navbar {
        flex-direction: column;
        gap: 0.8rem;
        padding: 0.8rem;
        align-items: center;
    }
    
    .nav-brand {
        display: flex;
        justify-content: center;
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .nav-links { 
        display: flex;
        gap: 1rem; 
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        font-size: 0.85rem;
        padding: 0;
        margin: 0;
    }
    
    .nav-links li {
        text-align: center;
    }
    
    .nav-right {
        display: flex;
        width: 100%;
        justify-content: center;
        gap: 1rem;
        margin-top: 0.5rem;
    }
    
    /* Grids */
    .matches-grid { 
        grid-template-columns: 1fr; 
        gap: 1rem;
        padding: 0;
    }
    .standings-grid { 
        grid-template-columns: 1fr; 
        gap: 1.5rem;
    }
    
    /* Match Cards */
    .match-card {
        padding: 1rem 0.5rem;
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    .match-status {
        margin: 0 auto 0.5rem auto;
    }
    .match-teams {
        width: 100%;
        justify-content: space-between;
        gap: 0.2rem;
    }
    .team { width: 42%; gap: 0.4rem; justify-content: flex-start; }
    .team-badge { width: 45px; height: 45px; }
    .team-name { font-size: 0.75rem; line-height: 1.2; word-wrap: break-word; text-align: center; width: 100%; }
    .match-vs { font-size: 1rem; width: 15%; text-align: center; }
    
    /* Auto Player / Modals */
    .auto-player-section {
        padding: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .modal-content {
        width: 95%;
        padding: 0.5rem;
    }
    
    /* Theater Mode overrides for mobile */
    body.theater-mode .auto-player-header {
        padding: 0.8rem 1rem;
    }
    
    body.theater-mode .auto-player-header h3 {
        font-size: 1rem;
    }
    
    /* Standings Tables */
    .group-table {
        padding: 0.8rem;
    }
    th, td {
        padding: 0.5rem 0.2rem;
        font-size: 0.8rem;
    }
    
    /* Launch screen */
    .enter-btn {
        padding: 0.8rem 2rem;
        font-size: 1rem;
    }
}

/* =========================================
   WORLD CUP 2026 SPECIFIC COMPONENTS
   ========================================= */

/* Countdown Timer */
.countdown-section {
    text-align: center;
    padding: 2rem;
    margin-bottom: 2rem;
    border-radius: var(--radius);
    background: var(--bg-panel);
}

.countdown-label {
    color: var(--text-muted);
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 0.5rem;
}

.countdown-timer {
    font-size: 3rem;
    font-weight: 800;
    color: var(--accent-1);
    text-shadow: 0 0 10px rgba(0, 242, 96, 0.4);
    font-variant-numeric: tabular-nums;
}

/* Auto Player Section */
.auto-player-section {
    margin-bottom: 3rem;
    padding: 1.5rem;
    border-radius: var(--radius);
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
}

.auto-player-section h3 {
    text-align: center;
    margin-bottom: 1rem;
    font-size: 1.5rem;
    color: var(--text-light);
}

.theater-btn {
    background: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

.theater-btn:hover {
    background: var(--primary-color);
    color: var(--bg-dark);
    box-shadow: 0 0 15px var(--glow-primary);
}

/* Theater Mode Styles */
body.theater-mode {
    overflow: hidden; /* Prevent scrolling in theater mode */
}

body.theater-mode .navbar,
body.theater-mode .countdown-section,
body.theater-mode .live-matches,
body.theater-mode .page-section:not(.active),
body.theater-mode footer {
    opacity: 0.1;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

body.theater-mode .auto-player-section {
    position: fixed;
    top: 0;
    left: 0;
    transform: none;
    width: 100vw;
    height: 100vh;
    max-width: none;
    z-index: 9999;
    background: #000;
    border: none;
    border-radius: 0;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    padding: 0;
}

body.theater-mode .stream-container {
    flex-grow: 1;
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
    border-radius: 0;
}

.auto-player-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

body.theater-mode .auto-player-header {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 1.5rem 2rem;
    margin: 0;
    z-index: 10000;
    background: linear-gradient(to bottom, rgba(0,0,0,0.9), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

body.theater-mode .auto-player-section.show-controls .auto-player-header {
    opacity: 1;
}

body.theater-mode.hide-cursor,
body.theater-mode.hide-cursor * {
    cursor: none !important;
}

/* Match Info Details */
.match-info {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

body.theater-mode .match-info {
    display: none;
}

.stadium-info {
    color: var(--text-muted);
}

.stream-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    background: rgba(0, 242, 96, 0.1);
    color: var(--accent-1);
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    align-self: center;
    margin-top: 0.5rem;
}

.status-finished {
    background: var(--surface-color);
    color: var(--text-muted);
}

/* Standings Grid */
.standings-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    margin-bottom: 3rem;
}

.group-table {
    padding: 1.5rem;
    border-radius: var(--radius);
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

.group-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--accent-2);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

th {
    text-align: center;
    padding: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
}

th:first-child, td:first-child {
    text-align: left;
}

td {
    text-align: center;
    padding: 0.8rem;
    color: var(--text-light);
    border-bottom: 1px dashed var(--border-color);
}

tr:last-child td {
    border-bottom: none;
}

.team-cell {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-weight: 600;
}

.small-badge {
    width: 24px;
    height: 16px;
    border-radius: 2px;
    object-fit: cover;
}

.bold {
    font-weight: 800;
    color: var(--accent-1);
}

@media (max-width: 480px) {
    .hero-title { font-size: 2rem; }
    .hero-subtitle { font-size: 1rem; }
    
    .standings-grid {
        grid-template-columns: 1fr;
    }
    
    .countdown-timer {
        font-size: 2rem;
    }
    
    .enter-btn {
        padding: 0.8rem 2rem;
        font-size: 1rem;
    }
    
    .launch-logo {
        width: 90%;
    }
}

/* =========================================
   SPA AND BRANDING SPECIFIC COMPONENTS
   ========================================= */

.hidden {
    position: absolute !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    z-index: -100;
    height: 0 !important;
    width: 0 !important;
    overflow: hidden !important;
}

.user-clock {
    font-family: 'Outfit', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--accent-1);
    background: rgba(0, 229, 255, 0.1);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    border: 1px solid rgba(0, 229, 255, 0.3);
    margin-left: 1rem;
}

/* Animations */
.fade-in {
    opacity: 0;
    animation: fadeInUp 0.5s ease forwards;
}

/* Updated Countdown Glow */
.countdown-timer {
    text-shadow: 0 0 15px rgba(0, 229, 255, 0.6);
}

.auto-player-section {
    border: 1px solid rgba(255, 0, 85, 0.4);
    box-shadow: 0 0 20px rgba(255, 0, 85, 0.1);
}

.stream-badge {
    background: rgba(255, 0, 85, 0.1);
    color: var(--accent-2);
}

.status-live {
    background: rgba(255, 0, 85, 0.2);
    color: #ff3377;
    animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
    0% { box-shadow: 0 0 0 0 rgba(255, 0, 85, 0.4); }
    70% { box-shadow: 0 0 0 6px rgba(255, 0, 85, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 0, 85, 0); }
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.countdown-section[style*="cursor: pointer"]:hover {
    transform: scale(1.02);
    box-shadow: 0 0 30px rgba(0, 229, 255, 0.2);
    transition: all 0.3s ease;
}

.rotating-badge {
    animation: rotateSlow 8s linear infinite;
    transform-origin: center;
}

@keyframes rotateSlow {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}
