/* ======================================================
   LEC Versus 2026 — Premium Stylesheet
   ====================================================== */

/* === CSS Variables & Themes === */
:root {
    /* Dark theme (default) */
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-tertiary: #1a1a28;
    --bg-card: #16161f;
    --bg-elevated: #1e1e2a;
    --text-primary: #f0f0f5;
    --text-secondary: #a8a8b8;
    --text-muted: #5a5a6a;
    --accent-primary: #6366f1;
    --accent-secondary: #8b5cf6;
    --accent-tertiary: #a78bfa;
    --accent-glow: rgba(99, 102, 241, 0.4);
    --success: #10b981;
    --success-light: #34d399;
    --success-bg: rgba(16, 185, 129, 0.12);
    --success-glow: rgba(16, 185, 129, 0.3);
    --warning: #f59e0b;
    --warning-light: #fbbf24;
    --warning-bg: rgba(245, 158, 11, 0.12);
    --warning-glow: rgba(245, 158, 11, 0.3);
    --danger: #ef4444;
    --danger-light: #f87171;
    --danger-bg: rgba(239, 68, 68, 0.12);
    --danger-glow: rgba(239, 68, 68, 0.3);
    --border: rgba(255, 255, 255, 0.06);
    --border-light: rgba(255, 255, 255, 0.1);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 40px var(--accent-glow);
    --glass-bg: rgba(18, 18, 26, 0.8);
    --glass-border: rgba(255, 255, 255, 0.08);
    --radius: 12px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --nav-height: 54px;
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Light theme */
[data-theme="light"] {
    --bg-primary: #f5f5f9;
    --bg-secondary: #ffffff;
    --bg-tertiary: #eeeef2;
    --bg-card: #ffffff;
    --bg-elevated: #f0f0f5;
    --text-primary: #1a1a2e;
    --text-secondary: #555566;
    --text-muted: #888899;
    --accent-glow: rgba(99, 102, 241, 0.2);
    --border: rgba(0, 0, 0, 0.06);
    --border-light: rgba(0, 0, 0, 0.1);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.12);
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(0, 0, 0, 0.06);
    --success-bg: rgba(16, 185, 129, 0.1);
    --success-glow: rgba(16, 185, 129, 0.15);
    --warning-bg: rgba(245, 158, 11, 0.1);
    --warning-glow: rgba(245, 158, 11, 0.15);
    --danger-bg: rgba(239, 68, 68, 0.1);
    --danger-glow: rgba(239, 68, 68, 0.15);
}

/* === Reset & Base === */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--nav-height) + 16px);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    transition: background-color 0.4s ease, color 0.3s ease;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Animated background */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: 
        radial-gradient(ellipse 80% 50% at 20% -20%, rgba(99, 102, 241, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse 60% 40% at 80% 100%, rgba(139, 92, 246, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse 40% 30% at 50% 50%, rgba(99, 102, 241, 0.04) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
    transition: opacity 0.4s ease;
}

[data-theme="light"] body::before {
    opacity: 0.5;
}

::selection {
    background: var(--accent-primary);
    color: white;
}

/* === Loading Screen === */
.loading-screen {
    position: fixed;
    inset: 0;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loading-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.loading-logo {
    width: 80px;
    height: 80px;
    animation: pulse-glow 1.5s ease-in-out infinite;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-light);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading-content p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

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

@keyframes pulse-glow {
    0%, 100% { filter: drop-shadow(0 0 10px var(--accent-glow)); transform: scale(1); }
    50% { filter: drop-shadow(0 0 25px var(--accent-glow)); transform: scale(1.05); }
}

/* === Toast Notifications === */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: var(--shadow-lg);
    pointer-events: auto;
    animation: toast-in 0.4s var(--ease-spring);
    font-size: 0.9rem;
    font-weight: 500;
    max-width: 360px;
}

.toast.toast-out {
    animation: toast-out 0.3s ease forwards;
}

.toast-icon {
    flex-shrink: 0;
}

/* SVG Icon Base */
.icon {
    width: 1em;
    height: 1em;
    display: inline-block;
    vertical-align: -0.125em;
    flex-shrink: 0;
}

.toast-icon .icon {
    width: 1.2rem;
    height: 1.2rem;
}

.toast-success { border-left: 3px solid var(--success); }
.toast-info { border-left: 3px solid var(--accent-primary); }
.toast-warning { border-left: 3px solid var(--warning); }
.toast-error { border-left: 3px solid var(--danger); }

@keyframes toast-in {
    from { opacity: 0; transform: translateX(100%) scale(0.9); }
    to { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes toast-out {
    to { opacity: 0; transform: translateX(100%) scale(0.9); }
}

/* === Confetti Canvas === */
.confetti-canvas {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9998;
}

/* === Sticky Navigation === */
.main-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    z-index: 1000;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.main-nav.scrolled {
    box-shadow: var(--shadow-md);
}

.main-nav.hidden {
    transform: translateY(-100%);
}

.nav-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 16px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 700;
    font-size: 0.95rem;
    flex-shrink: 0;
}

.nav-logo {
    border-radius: 6px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 11px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.8rem;
    transition: all 0.25s ease;
    position: relative;
    white-space: nowrap;
}

.nav-link:hover {
    color: var(--text-primary);
    background: var(--border);
}

.nav-link.active {
    color: var(--accent-primary);
    background: rgba(99, 102, 241, 0.1);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 2px;
    background: var(--accent-primary);
    border-radius: 2px;
}

.nav-icon {
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
}

.nav-icon .icon {
    width: 0.95rem;
    height: 0.95rem;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid var(--border-light);
    background: var(--bg-elevated);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    transition: all 0.25s ease;
}

.nav-btn:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 0 15px var(--accent-glow);
    transform: translateY(-1px);
}

/* Theme button */
.theme-btn .theme-icon-light { display: none; }
[data-theme="light"] .theme-btn .theme-icon-dark { display: none; }
[data-theme="light"] .theme-btn .theme-icon-light { display: inline; }

/* Language button */
.lang-btn {
    font-weight: 700;
    font-size: 0.68rem;
    letter-spacing: 0.5px;
}

/* Mobile Nav Toggle */
.mobile-nav-toggle {
    display: none;
    position: fixed;
    top: 14px;
    right: 16px;
    z-index: 1001;
    width: 40px;
    height: 40px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    cursor: pointer;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 10px;
}

.mobile-nav-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.mobile-nav-toggle.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.mobile-nav-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-nav-toggle.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* === Layout === */
.container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 16px;
    padding-top: calc(var(--nav-height) + 16px);
}

/* Main content grid */
.main-content-grid {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 16px;
    align-items: stretch;
    margin-bottom: 16px;
}

/* === Header === */
header {
    text-align: center;
    padding: 18px 20px;
    background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    border-radius: var(--radius-lg);
    margin-bottom: 12px;
    border: 1px solid var(--border-light);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.header-glow {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 50% 0%, var(--accent-glow) 0%, transparent 30%);
    opacity: 0.5;
    pointer-events: none;
    animation: header-glow-pulse 4s ease-in-out infinite;
}

@keyframes header-glow-pulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.6; }
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-primary), transparent);
}

.header-logo {
    width: 60px;
    height: auto;
    margin-bottom: 8px;
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 0 20px var(--accent-glow));
    animation: float 4s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

header h1 {
    font-size: clamp(1.4rem, 3vw, 1.9rem);
    font-weight: 900;
    background: linear-gradient(135deg, #fff 0%, var(--accent-primary) 50%, var(--accent-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 6px;
    position: relative;
    z-index: 1;
    letter-spacing: -0.03em;
    line-height: 1.1;
}

[data-theme="light"] header h1 {
    background: linear-gradient(135deg, #1a1a2e 0%, var(--accent-primary) 50%, var(--accent-secondary) 100%);
    -webkit-background-clip: text;
    background-clip: text;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 500;
    position: relative;
    z-index: 1;
}

/* === Countdown === */
.countdown-wrapper {
    margin-top: 10px;
    position: relative;
    z-index: 1;
}

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

.countdown {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.countdown-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 5px 10px;
    min-width: 42px;
}

.countdown-value {
    font-size: 1rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.countdown-unit {
    font-size: 0.52rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.countdown-sep {
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--text-muted);
}

/* === Live Badge === */
.live-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1.2rem;
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.4);
    border-radius: 2rem;
    color: #ef4444;
    font-weight: 700;
    font-size: 0.9rem;
    animation: liveBadgePulse 2s ease-in-out infinite;
}

.live-dot {
    width: 8px;
    height: 8px;
    background: #ef4444;
    border-radius: 50%;
    animation: liveDotBlink 1s infinite;
}

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

@keyframes liveBadgePulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.3); }
    50% { box-shadow: 0 0 20px 5px rgba(239, 68, 68, 0.15); }
}

/* === Simulation Progress === */
.sim-progress {
    background: linear-gradient(90deg, var(--bg-secondary), var(--bg-tertiary));
    border: 1px solid var(--accent-primary);
    border-radius: var(--radius);
    padding: 10px 14px;
    margin-bottom: 12px;
    box-shadow: 0 0 15px var(--accent-glow);
}

.sim-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.sim-progress-label {
    font-weight: 700;
    font-size: 0.82rem;
    color: var(--accent-primary);
}

.sim-progress-count {
    font-size: 0.82rem;
    color: var(--text-primary);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sim-progress-bar {
    height: 6px;
    background: var(--bg-primary);
    border-radius: 6px;
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
}

.sim-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), var(--success));
    border-radius: 6px;
    transition: width 0.4s var(--ease-out);
    position: relative;
}

.sim-progress-fill::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.2) 50%, transparent 100%);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* === Sections === */
section {
    background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-card) 100%);
    border-radius: var(--radius-lg);
    padding: 12px 14px;
    margin-bottom: 10px;
    border: 1px solid var(--border);
    position: relative;
    box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255, 255, 255, 0.03);
    transition: border-color 0.3s ease;
}

/* Sections inside main grid don't need bottom margin */
.main-content-grid section {
    margin-bottom: 0;
}

.main-content-grid .standings-section {
    padding: 10px 12px;
}

.main-content-grid .standings-section h2 {
    font-size: 1.05rem;
    margin-bottom: 8px;
}

.main-content-grid .standings-section h2::after {
    display: none;
}

.main-content-grid .simulator-section h2::after {
    display: none;
}

section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 24px;
    right: 24px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-light), transparent);
}

section h2 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

section h2::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, var(--border-light), transparent);
    margin-left: 10px;
}

.section-desc {
    color: var(--text-secondary);
    margin-bottom: 14px;
    font-size: 0.88rem;
    line-height: 1.5;
}

/* === Scroll Reveal Animation === */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger children */
.reveal.visible .stat-card,
.reveal.visible .match-card,
.reveal.visible .prob-row {
    animation: fade-up 0.4s var(--ease-out) both;
}

.reveal.visible .stat-card:nth-child(1) { animation-delay: 0.05s; }
.reveal.visible .stat-card:nth-child(2) { animation-delay: 0.1s; }
.reveal.visible .stat-card:nth-child(3) { animation-delay: 0.15s; }
.reveal.visible .stat-card:nth-child(4) { animation-delay: 0.2s; }

@keyframes fade-up {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

/* === Standings Table === */
.standings-info {
    display: flex;
    gap: 6px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.info-badge {
    padding: 3px 8px;
    border-radius: 50px;
    font-size: 0.62rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.3s ease;
}

.badge-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    flex-shrink: 0;
}

.info-badge.qualified {
    background: linear-gradient(135deg, var(--success-bg), rgba(16, 185, 129, 0.05));
    color: var(--success-light);
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.info-badge.qualified .badge-dot {
    background: var(--success);
    box-shadow: 0 0 6px var(--success-glow);
}

.info-badge.eliminated {
    background: linear-gradient(135deg, var(--danger-bg), rgba(239, 68, 68, 0.05));
    color: var(--danger-light);
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.info-badge.eliminated .badge-dot {
    background: var(--danger);
    box-shadow: 0 0 6px var(--danger-glow);
}

.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius);
}

.standings-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 4px;
    font-size: 0.9rem;
    table-layout: fixed;
}

.standings-table thead tr {
    background: transparent;
}

.standings-table th {
    padding: 5px 6px;
    text-align: left;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
    white-space: nowrap;
}

/* Column widths - simplified table */
.standings-table th:nth-child(1) { width: 28px; text-align: center; }
.standings-table th:nth-child(2) { width: auto; }
.standings-table th:nth-child(3) { width: 32px; text-align: center; }
.standings-table th:nth-child(4) { width: 32px; text-align: center; }

.standings-table tbody tr {
    background: var(--bg-elevated);
    transition: all 0.25s var(--ease-out);
    border-radius: var(--radius);
}

.standings-table tbody tr:hover {
    transform: translateX(2px);
    box-shadow: var(--shadow-md), -2px 0 0 var(--accent-primary);
}

.standings-table tbody tr td {
    padding: 6px;
    border: none;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.standings-table tbody tr td:nth-child(1) { text-align: center; }
.standings-table tbody tr td:nth-child(3),
.standings-table tbody tr td:nth-child(4) { text-align: center; }

.standings-table tbody tr td:first-child {
    border-left: 1px solid var(--border);
    border-radius: var(--radius) 0 0 var(--radius);
    font-weight: 700;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.standings-table tbody tr td:last-child {
    border-right: 1px solid var(--border);
    border-radius: 0 var(--radius) var(--radius) 0;
}

/* Row status colors */
.standings-table tbody tr.qualified {
    background: linear-gradient(90deg, var(--success-bg), var(--bg-elevated));
    box-shadow: inset 4px 0 0 var(--success);
}

.standings-table tbody tr.qualified:hover {
    box-shadow: var(--shadow-md), -4px 0 0 var(--success), 0 0 20px var(--success-glow);
}

.standings-table tbody tr.bubble {
    background: linear-gradient(90deg, var(--warning-bg), var(--bg-elevated));
    box-shadow: inset 4px 0 0 var(--warning);
}

.standings-table tbody tr.bubble:hover {
    box-shadow: var(--shadow-md), -4px 0 0 var(--warning), 0 0 20px var(--warning-glow);
}

.standings-table tbody tr.eliminated {
    background: linear-gradient(90deg, var(--danger-bg), var(--bg-elevated));
    box-shadow: inset 4px 0 0 var(--danger);
    opacity: 0.65;
}

.standings-table tbody tr.eliminated:hover {
    opacity: 1;
    box-shadow: var(--shadow-md), -4px 0 0 var(--danger), 0 0 20px var(--danger-glow);
}

/* Team info */
.team-info {
    display: flex;
    align-items: center;
    gap: 5px;
}

.team-logo-sm {
    width: 22px;
    height: 22px;
    min-width: 22px;
    min-height: 22px;
    max-width: 22px;
    max-height: 22px;
    object-fit: contain;
    border-radius: 3px;
    background: var(--bg-tertiary);
    padding: 1px;
    transition: all 0.25s ease;
    flex-shrink: 0;
}

.team-logo-sm:hover {
    transform: scale(1.12);
    filter: drop-shadow(0 0 6px var(--accent-glow));
}

.team-name {
    font-weight: 600;
    display: flex;
    flex-direction: column;
    gap: 0px;
    font-size: 0.85rem;
    line-height: 1.2;
}

.team-abbr {
    color: var(--text-muted);
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* Probability bars in table */
.prob-bar {
    display: flex;
    align-items: center;
    gap: 6px;
}

.prob-bar-bg {
    flex: 1;
    height: 7px;
    background: var(--bg-primary);
    border-radius: 7px;
    overflow: hidden;
    min-width: 50px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
}

.prob-bar-fill {
    height: 100%;
    border-radius: 8px;
    transition: width 0.4s var(--ease-out);
    position: relative;
}

.prob-bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(180deg, rgba(255,255,255,0.25) 0%, transparent 100%);
    border-radius: 10px 10px 0 0;
}

.prob-bar-fill.high {
    background: linear-gradient(90deg, var(--success), var(--success-light));
    box-shadow: 0 0 12px var(--success-glow);
}

.prob-bar-fill.medium {
    background: linear-gradient(90deg, var(--warning), var(--warning-light));
    box-shadow: 0 0 12px var(--warning-glow);
}

.prob-bar-fill.low {
    background: linear-gradient(90deg, var(--danger), var(--danger-light));
    box-shadow: 0 0 12px var(--danger-glow);
}

.prob-value {
    min-width: 42px;
    text-align: right;
    font-weight: 700;
    font-size: 0.82rem;
    font-variant-numeric: tabular-nums;
}

/* === Simulator === */
.simulator-controls {
    display: flex;
    gap: 6px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.btn {
    padding: 7px 14px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s var(--ease-out);
    font-size: 0.85rem;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    position: relative;
    overflow: hidden;
    user-select: none;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn:active {
    transform: scale(0.97) !important;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
}

.btn-icon .icon {
    width: 1rem;
    height: 1rem;
}

/* Share Bar — Twitter-style social buttons */
.share-bar {
    display: flex;
    gap: 6px;
    margin-left: auto;
}

.share-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.25s var(--ease-out);
    position: relative;
    color: white;
}

.share-btn .icon {
    width: 16px;
    height: 16px;
}

.share-btn:hover {
    transform: translateY(-2px) scale(1.08);
}

.share-btn:active {
    transform: scale(0.92);
}

/* X / Twitter */
.share-btn--x {
    background: #000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}
[data-theme="light"] .share-btn--x {
    background: #14171a;
}
.share-btn--x:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

/* WhatsApp */
.share-btn--wa {
    background: #25d366;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}
.share-btn--wa:hover {
    background: #20bd5a;
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
}

/* Copy */
.share-btn--copy {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
}
.share-btn--copy:hover {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
    box-shadow: 0 6px 20px var(--accent-glow);
}

.share-btn--copy.copied {
    background: var(--success);
    color: white;
    border-color: var(--success);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    box-shadow: 0 4px 15px var(--accent-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--accent-glow);
    filter: brightness(1.1);
}

.btn-secondary {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-md), 0 0 15px var(--accent-glow);
}

/* Match days */
.match-day {
    margin-bottom: 10px;
}

.match-day:last-child {
    margin-bottom: 0;
}

.match-day h3 {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    padding-bottom: 5px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: 600;
}

.day-icon {
    display: inline-flex;
    align-items: center;
}

.day-icon .icon {
    width: 0.95rem;
    height: 0.95rem;
}

.match-count {
    margin-left: auto;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg-primary);
    padding: 2px 8px;
    border-radius: 50px;
    font-variant-numeric: tabular-nums;
}

.matches-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
}

/* Match card */
.match-card {
    background: linear-gradient(135deg, var(--bg-card), var(--bg-elevated));
    border-radius: 12px;
    padding: 14px;
    border: 1px solid var(--border);
    transition: all 0.25s var(--ease-out);
    position: relative;
    overflow: hidden;
}

.match-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    opacity: 0;
    transition: opacity 0.3s;
}

.match-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg), 0 0 25px var(--accent-glow);
}

.match-card:hover::before {
    opacity: 1;
}

.match-card.decided {
    border-color: rgba(16, 185, 129, 0.2);
}

.match-card.decided::before {
    background: linear-gradient(90deg, var(--success), var(--success-light));
    opacity: 1;
}

.match-card.locked {
    border-color: rgba(234, 179, 8, 0.3);
    position: relative;
}

.match-card.locked::after {
    content: '🔒';
    position: absolute;
    top: 8px;
    right: 10px;
    font-size: 0.85rem;
    opacity: 0.8;
}

.match-card.locked .match-team {
    cursor: not-allowed;
    pointer-events: none;
}

.match-time {
    color: var(--text-muted);
    font-size: 0.72rem;
    margin-bottom: 8px;
    text-align: center;
    font-weight: 600;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.match-teams {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

.match-team {
    flex: 1;
    padding: 10px 8px;
    border-radius: 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s var(--ease-out);
    border: 2px solid transparent;
    background: var(--bg-tertiary);
    font-weight: 600;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.match-team::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 40%, rgba(255,255,255,0.05) 100%);
    opacity: 0;
    transition: opacity 0.3s;
}

.match-team:hover {
    border-color: var(--accent-primary);
    background: var(--bg-secondary);
    transform: scale(1.03);
}

.match-team:hover::before {
    opacity: 1;
}

.match-team:hover .team-logo {
    transform: scale(1.12);
    filter: drop-shadow(0 0 10px var(--accent-glow));
}

.match-team.selected {
    border-color: var(--success);
    background: linear-gradient(135deg, var(--success-bg), rgba(16, 185, 129, 0.05));
    box-shadow: 0 0 20px var(--success-glow), inset 0 0 15px var(--success-glow);
}

.match-team.selected .team-logo {
    filter: drop-shadow(0 0 12px var(--success-glow));
}

.match-team.selected::after {
    content: '✓';
    position: absolute;
    top: 6px;
    right: 8px;
    font-size: 0.7rem;
    color: var(--success);
    font-weight: 700;
}

.match-team.loser {
    opacity: 0.35;
    transform: scale(0.97);
    filter: grayscale(0.3);
}

.team-logo {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    max-width: 40px;
    max-height: 40px;
    object-fit: contain;
    transition: all 0.25s ease;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    flex-shrink: 0;
}

.match-team .team-full {
    display: block;
    font-size: 0.88rem;
    line-height: 1.2;
}

.team-record {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 500;
}

.match-vs {
    color: var(--text-muted);
    font-weight: 800;
    font-size: 0.72rem;
    background: var(--bg-primary);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1px solid var(--border);
}

/* === Team Selector === */
.team-selector {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.team-selector label {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.82rem;
}

.select-wrapper {
    position: relative;
    flex: 1;
    max-width: 280px;
}

.team-selector select {
    width: 100%;
    padding: 8px 32px 8px 12px;
    border-radius: 8px;
    background: var(--bg-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border-light);
    font-size: 0.84rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: var(--shadow-sm);
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.select-wrapper::after {
    content: '▾';
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
    font-size: 0.9rem;
}

.team-selector select:hover {
    border-color: var(--accent-primary);
}

.team-selector select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-md), 0 0 15px var(--accent-glow);
}

/* === Scenarios === */
.scenarios-content {
    background: linear-gradient(135deg, var(--bg-card), var(--bg-elevated));
    border-radius: 10px;
    padding: 14px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.scenario-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    border-radius: 8px;
    margin-bottom: 14px;
    font-weight: 700;
    font-size: 0.92rem;
    position: relative;
    overflow: hidden;
}

.scenario-status::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
}

.scenario-status.qualified {
    background: linear-gradient(90deg, var(--success-bg), transparent);
    color: var(--success-light);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.scenario-status.qualified::before { background: var(--success); }

.scenario-status.eliminated {
    background: linear-gradient(90deg, var(--danger-bg), transparent);
    color: var(--danger-light);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.scenario-status.eliminated::before { background: var(--danger); }

.scenario-status.contending {
    background: linear-gradient(90deg, var(--warning-bg), transparent);
    color: var(--warning-light);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.scenario-status.contending::before { background: var(--warning); }

.scenario-details h4 {
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin-bottom: 10px;
    margin-top: 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.scenario-details ul {
    list-style: none;
    padding-left: 0;
}

.scenario-details li {
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border-radius: 6px;
    margin-bottom: 5px;
    font-size: 0.82rem;
    border-left: 3px solid var(--accent-primary);
    transition: all 0.25s ease;
    line-height: 1.4;
}

.scenario-details li:hover {
    transform: translateX(4px);
    background: var(--bg-elevated);
}

.scenario-details li.good {
    border-left-color: var(--success);
    background: linear-gradient(90deg, var(--success-bg), var(--bg-tertiary));
}

.scenario-details li.bad {
    border-left-color: var(--danger);
    background: linear-gradient(90deg, var(--danger-bg), var(--bg-tertiary));
}

/* === Probability Stats === */
.probability-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 14px;
}

.stat-card {
    background: linear-gradient(135deg, var(--bg-card), var(--bg-elevated));
    border-radius: 10px;
    padding: 8px 6px;
    text-align: center;
    border: 1px solid var(--border);
    transition: all 0.25s var(--ease-out);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-primary), transparent);
}

.stat-card:hover {
    transform: translateY(-3px);
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-md), 0 0 20px var(--accent-glow);
}

.stat-icon {
    display: block;
    margin-bottom: 6px;
}

.stat-icon .icon {
    width: 1.2rem;
    height: 1.2rem;
}

/* Heart icon color */
.heart-icon .icon {
    color: var(--danger);
    width: 1em;
    height: 1em;
}

/* Section title icons */
h2 > .icon, h3 > .icon {
    width: 1.2em;
    height: 1.2em;
    vertical-align: -0.15em;
}

/* Live dot animation */
.icon-live {
    color: var(--danger);
}
.icon-live circle:last-child {
    animation: pulse-ring 1.5s ease infinite;
}
@keyframes pulse-ring {
    0% { opacity: 0.4; }
    50% { opacity: 0.1; }
    100% { opacity: 0.4; }
}

.stat-label {
    display: block;
    color: var(--text-muted);
    font-size: 0.6rem;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.stat-value {
    display: block;
    font-size: 1.1rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* === Probability Bars === */
.probability-bars {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.prob-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 8px;
    background: linear-gradient(90deg, var(--bg-card), var(--bg-elevated));
    border-radius: 8px;
    border: 1px solid var(--border);
    transition: all 0.25s var(--ease-out);
}

.prob-row:hover {
    transform: translateX(3px);
    border-color: var(--border-light);
    box-shadow: var(--shadow-md);
}

.prob-row:hover .team-logo-sm {
    transform: scale(1.1);
    filter: drop-shadow(0 0 6px var(--accent-glow));
}

.prob-row .team-info {
    min-width: 120px;
}

.prob-row .team-name {
    flex-direction: row;
    gap: 5px;
}

.prob-row .prob-bar-bg {
    flex: 1;
    height: 14px;
    border-radius: 7px;
}

.prob-row .prob-value {
    min-width: 48px;
    font-size: 0.88rem;
    font-weight: 700;
}

/* === Footer === */
footer {
    text-align: center;
    padding: 20px 12px 16px;
    color: var(--text-muted);
    font-size: 0.72rem;
    position: relative;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-light), transparent);
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
    font-size: 0.8rem;
    color: var(--text-primary);
}

.footer-logo {
    width: 26px;
    height: 26px;
    border-radius: 5px;
    opacity: 0.8;
}

.footer-text {
    color: var(--text-muted);
    font-size: 0.68rem;
}

.footer-credits {
    font-size: 0.68rem;
    color: var(--text-secondary);
}

.footer-credits strong {
    color: var(--accent-primary);
}

.footer-discord {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 0.68rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.footer-discord svg {
    color: #5865F2;
}

.footer-badges {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 3px;
}

.footer-badge {
    padding: 2px 8px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 50px;
    font-size: 0.62rem;
    font-weight: 600;
    color: var(--text-muted);
}

/* === Scroll to Top === */
.scroll-top-btn {
    position: fixed;
    bottom: 16px;
    right: 16px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    box-shadow: var(--shadow-md);
    transition: all 0.25s ease;
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
    z-index: 100;
}

.scroll-top-btn.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.scroll-top-btn:hover {
    background: var(--accent-primary);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px var(--accent-glow);
}

/* === Modal === */
.modal {
    position: fixed;
    inset: 0;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal[open],
.modal.open {
    opacity: 1;
    visibility: visible;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 32px;
    max-width: 420px;
    width: 100%;
    box-shadow: var(--shadow-lg);
    transform: scale(0.95) translateY(10px);
    transition: transform 0.3s var(--ease-spring);
}

.modal.open .modal-content {
    transform: scale(1) translateY(0);
}

.modal-content h3 {
    font-size: 1.3rem;
    margin-bottom: 20px;
    font-weight: 700;
}

.shortcuts-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 24px;
}

.shortcut-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.shortcut-item span {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    padding: 0 8px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-light);
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    box-shadow: 0 2px 0 var(--border);
}

.modal-close {
    width: 100%;
    justify-content: center;
}

/* === Animations === */
@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.85; transform: scale(0.99); }
}

@keyframes glow {
    0%, 100% { box-shadow: 0 0 20px var(--accent-glow); }
    50% { box-shadow: 0 0 40px var(--accent-glow); }
}

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

@keyframes bounce-in {
    0% { transform: scale(0.8); opacity: 0; }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); opacity: 1; }
}

.updating {
    animation: pulse 0.5s ease-in-out;
}

/* === Scrollbar === */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 4px;
    border: 2px solid var(--bg-primary);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--bg-elevated);
}

/* Firefox scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--bg-tertiary) var(--bg-primary);
}

/* === Focus Styles === */
:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

/* === Responsive === */
@media (max-width: 900px) {
    .nav-link .nav-text {
        display: none;
    }
    
    .nav-link {
        padding: 8px 10px;
    }
    
    .nav-icon {
        font-size: 1.1rem;
    }
}

@media (max-width: 768px) {
    :root {
        --nav-height: 52px;
    }
    
    .container {
        padding: 10px;
        padding-top: calc(var(--nav-height) + 10px);
    }
    
    .main-content-grid {
        grid-template-columns: 1fr;
    }

    header {
        padding: 16px 18px;
        border-radius: var(--radius-lg);
    }

    section {
        padding: 12px 14px;
        border-radius: var(--radius);
    }

    section h2 {
        font-size: 1rem;
    }

    .nav-links {
        display: none;
    }

    .nav-links.mobile-open {
        display: flex;
        position: fixed;
        top: var(--nav-height);
        left: 0;
        right: 0;
        background: var(--glass-bg);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-bottom: 1px solid var(--glass-border);
        padding: 10px 14px;
        flex-direction: column;
        gap: 4px;
        animation: slide-down 0.3s var(--ease-out);
        z-index: 999;
    }

    .nav-links.mobile-open .nav-link {
        padding: 10px 14px;
        font-size: 0.9rem;
    }

    .nav-links.mobile-open .nav-text {
        display: inline;
    }

    .mobile-nav-toggle {
        display: flex;
    }

    .standings-table {
        font-size: 0.76rem;
        table-layout: auto;
    }

    .standings-table th,
    .standings-table tbody tr td {
        padding: 5px 4px;
    }
    
    .standings-table th:nth-child(1) { width: 24px; }
    .standings-table th:nth-child(3),
    .standings-table th:nth-child(4) { width: 30px; }

    .matches-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .probability-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .prob-row {
        padding: 5px 8px;
        gap: 6px;
    }

    .prob-row .team-info {
        min-width: 90px;
    }

    .prob-row .prob-bar-bg {
        height: 12px;
    }

    .prob-row .prob-value {
        min-width: 44px;
        font-size: 0.84rem;
    }

    .countdown-item {
        padding: 5px 8px;
        min-width: 38px;
    }

    .countdown-value {
        font-size: 0.9rem;
    }

    .toast-container {
        bottom: 12px;
        right: 12px;
        left: 12px;
    }

    .toast {
        max-width: 100%;
    }
}

@keyframes slide-down {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 480px) {
    .container {
        padding: 8px;
        padding-top: calc(var(--nav-height) + 8px);
    }

    section {
        padding: 10px;
    }
    
    .matches-grid {
        grid-template-columns: 1fr;
    }

    .simulator-controls {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .simulator-controls .btn {
        flex: 1 1 auto;
    }

    .share-bar {
        margin-left: 0;
        justify-content: center;
        width: 100%;
    }

    .btn {
        justify-content: center;
    }

    .team-selector {
        flex-direction: column;
        align-items: stretch;
    }

    .select-wrapper {
        max-width: 100%;
    }

    .match-team .team-full {
        font-size: 0.65rem;
    }

    .team-logo {
        width: 28px;
        height: 28px;
        min-width: 28px;
        min-height: 28px;
        max-width: 28px;
        max-height: 28px;
    }

    .standings-table tbody tr td:first-child,
    .standings-table tbody tr td:last-child {
        border-radius: 0;
    }

    .prob-row .team-name {
        font-size: 0.78rem;
    }

    .countdown {
        gap: 3px;
    }

    .countdown-sep {
        font-size: 0.85rem;
    }

    .footer-badges {
        gap: 4px;
    }
}

/* === Cookie Animation === */
.cookie-rain {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    pointer-events: none;
    z-index: 100;
    display: flex;
    gap: 4px;
}

.cookie-item {
    font-size: 1.2rem;
    animation: cookieFall 1.8s ease-in forwards;
    opacity: 0;
}

.cookie-item:nth-child(1) { animation-delay: 0s; }
.cookie-item:nth-child(2) { animation-delay: 0.15s; }
.cookie-item:nth-child(3) { animation-delay: 0.3s; }
.cookie-item:nth-child(4) { animation-delay: 0.1s; }
.cookie-item:nth-child(5) { animation-delay: 0.25s; }

@keyframes cookieFall {
    0% {
        opacity: 1;
        transform: translateY(0) rotate(0deg) scale(0.5);
    }
    20% {
        opacity: 1;
        transform: translateY(10px) rotate(15deg) scale(1.1);
    }
    50% {
        opacity: 1;
        transform: translateY(35px) rotate(-10deg) scale(1);
    }
    80% {
        opacity: 0.8;
        transform: translateY(55px) rotate(20deg) scale(0.9);
    }
    100% {
        opacity: 0;
        transform: translateY(80px) rotate(30deg) scale(0.7);
    }
}

.match-team,
.standings-table tbody tr {
    position: relative;
}

/* === Print === */
@media print {
    .main-nav,
    .mobile-nav-toggle,
    .scroll-top-btn,
    .simulator-controls,
    .countdown-wrapper,
    .sim-progress,
    .toast-container,
    .confetti-canvas,
    .loading-screen,
    .cookie-rain {
        display: none !important;
    }

    body {
        background: white;
        color: black;
    }

    section {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
