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

:root {
    --bg: #0a0e17;
    --bg-card: #111827;
    --bg-card-hover: #1a2332;
    --bg-table: #0f1729;
    --border: #1e2d45;
    --text: #e8edf5;
    --text-dim: #8892a8;
    --text-bright: #ffffff;
    --accent: #3b82f6;
    --accent-glow: rgba(59, 130, 246, 0.25);
    --green: #22c55e;
    --green-bg: rgba(34, 197, 94, 0.15);
    --yellow: #eab308;
    --yellow-bg: rgba(234, 179, 8, 0.15);
    --orange: #f97316;
    --orange-bg: rgba(249, 115, 22, 0.15);
    --red: #ef4444;
    --red-bg: rgba(239, 68, 68, 0.15);
    --blue: #3b82f6;
    --prob-bar: #1e40af;
    --radius: 12px;
    --radius-sm: 8px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Top Bar */
.top-bar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(10, 14, 23, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    gap: 24px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    color: var(--accent);
    display: flex;
    align-items: center;
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-title {
    font-weight: 700;
    font-size: 18px;
    color: var(--text-bright);
}

.logo-sub {
    font-size: 11px;
    color: var(--text-dim);
    font-weight: 500;
    letter-spacing: 0.5px;
}

.nav-links {
    display: flex;
    gap: 4px;
    background: var(--bg-table);
    padding: 4px;
    border-radius: var(--radius);
}

.nav-link {
    padding: 8px 20px;
    border-radius: var(--radius-sm);
    color: var(--text-dim);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s;
}

.nav-link:hover {
    color: var(--text);
    background: rgba(59, 130, 246, 0.1);
}

.nav-link.active {
    background: var(--accent);
    color: white;
    box-shadow: 0 0 20px var(--accent-glow);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.update-badge {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    background: var(--green-bg);
    color: var(--green);
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.update-badge.loading {
    background: var(--yellow-bg);
    color: var(--yellow);
    border-color: rgba(234, 179, 8, 0.2);
    animation: pulse 1.5s infinite;
}

/* Hero */
.hero {
    padding: 60px 0 40px;
    text-align: center;
}

.hero h1 {
    font-size: 48px;
    font-weight: 800;
    background: linear-gradient(135deg, #60a5fa, #a78bfa, #f472b6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 8px;
}

.hero-date {
    font-size: 18px;
    color: var(--text-dim);
    font-weight: 500;
}

.hero-desc {
    font-size: 14px;
    color: var(--text-dim);
    margin-top: 4px;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-top: 32px;
}

.hero-stat {
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 32px;
    font-weight: 700;
    color: var(--text-bright);
}

.stat-label {
    font-size: 13px;
    color: var(--text-dim);
    font-weight: 500;
}

/* Tabs */
.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

/* Section Header */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.section-header h2 {
    font-size: 24px;
    font-weight: 700;
}

/* Groups Grid */
.groups-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.group-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: all 0.2s;
}

.group-card:hover {
    border-color: rgba(59, 130, 246, 0.3);
    box-shadow: 0 0 30px rgba(59, 130, 246, 0.08);
}

.group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: var(--bg-table);
    border-bottom: 1px solid var(--border);
}

.group-header h3 {
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.group-badge {
    background: var(--accent);
    color: white;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.group-table {
    width: 100%;
    border-collapse: collapse;
}

.group-table th {
    padding: 10px 12px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.group-table th:not(.team-cell) {
    text-align: center;
    width: 40px;
}

.group-table td {
    padding: 10px 12px;
    font-size: 13px;
    border-bottom: 1px solid rgba(30, 45, 69, 0.5);
}

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

.group-table .team-cell {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.team-flag {
    font-size: 18px;
    line-height: 1;
}

.team-name {
    font-weight: 600;
}

.strength-bar {
    width: 60px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    display: inline-block;
    vertical-align: middle;
}

.strength-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.5s ease;
}

/* Position indicators */
.pos-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 700;
}

.pos-1st {
    background: var(--green-bg);
    color: var(--green);
}

.pos-2nd {
    background: var(--blue);
    color: white;
}

.pos-3rd {
    background: var(--orange-bg);
    color: var(--orange);
}

.pos-4th {
    background: var(--red-bg);
    color: var(--red);
}

/* Probability bar */
.prob-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 2px;
    overflow: hidden;
}

.prob-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.5s ease;
}

.prob-fill.high { background: var(--green); }
.prob-fill.med { background: var(--yellow); }
.prob-fill.low { background: var(--orange); }
.prob-fill.none { background: var(--red); }

/* Legend */
.legend {
    display: flex;
    gap: 16px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-dim);
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.dot-1st { background: var(--green); }
.dot-2nd { background: var(--blue); }
.dot-3rd { background: var(--orange); }
.dot-4th { background: var(--red); }

/* Matches */
.matches-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 40px;
}

.match-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    transition: all 0.2s;
}

.match-card.match-played {
    border-color: rgba(34, 197, 94, 0.3);
    background: linear-gradient(135deg, var(--bg-card), rgba(34, 197, 94, 0.03));
}

.match-card.match-played .match-scoreline-big {
    background: var(--green-bg);
    color: var(--green);
    font-size: 20px;
}

.match-card.pred-correct {
    border-color: rgba(34, 197, 94, 0.4);
}

.match-card.pred-wrong {
    border-color: rgba(239, 68, 68, 0.4);
    background: linear-gradient(135deg, var(--bg-card), rgba(239, 68, 68, 0.03));
}

.match-card.pred-wrong .match-scoreline-big {
    background: var(--red-bg);
    color: var(--red);
}

.pred-badge {
    font-size: 16px;
    line-height: 1;
}

.match-card:hover {
    border-color: rgba(59, 130, 246, 0.2);
}

.match-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 80px;
}

.match-group-badge {
    font-size: 11px;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
}

.match-date {
    font-size: 11px;

.match-venue {
    font-size: 9px;
    color: var(--text-dim);
    font-weight: 400;
    opacity: 0.7;
    display: block;
    margin-top: 1px;
}
    color: var(--text-dim);
}

.match-teams {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-width: 0;
}

.match-team {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    font-size: 14px;
    min-width: 0;
    max-width: 130px;
}

.match-team.right {
    text-align: right;
    flex-direction: row-reverse;
}

.match-vs {
    color: var(--text-dim);
    font-weight: 500;
    font-size: 12px;
}

.match-probs {
    display: flex;
    gap: 8px;
    align-items: center;
}

.match-main {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1;
    min-width: 0;
}

.team-name-inline {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
}

.match-scoreline-big {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-bright);
    background: var(--bg-table);
    padding: 2px 10px;
    border-radius: 6px;
    min-width: 40px;
    text-align: center;
}

.match-side {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px 12px;
    background: var(--bg-table);
    border-radius: var(--radius-sm);
    min-width: 140px;
    flex-shrink: 0;
}

.side-xg-bar {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.xg-track {
    display: flex;
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    background: rgba(255,255,255,0.05);
}

.xg-fill-home {
    background: linear-gradient(90deg, #22c55e, #16a34a);
    height: 100%;
    border-radius: 4px 0 0 4px;
}

.xg-fill-away {
    background: linear-gradient(90deg, #3b82f6, #2563eb);
    height: 100%;
    border-radius: 0 4px 4px 0;
}

.xg-labels {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
}

.xg-label {
    display: flex;
    align-items: center;
    gap: 3px;
    font-weight: 600;
    color: var(--text);
}

.team-flag-sm {
    font-size: 12px;
}

.side-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 3px 8px;
}

.side-stat {
    font-size: 10px;
    color: var(--text-dim);
}

.side-stat strong {
    color: var(--text-bright);
}

.match-vs-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.prob-box {
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    min-width: 50px;
}

.prob-home {
    background: var(--green-bg);
    color: var(--green);
}

.prob-draw {
    background: var(--yellow-bg);
    color: var(--yellow);
}

.prob-away {
    background: var(--blue);
    color: white;
}

/* Match Legend */
.match-legend {
    background: var(--bg-table);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 20px;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.legend-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    font-size: 13px;
}

.legend-label {
    font-weight: 600;
    color: var(--text-dim);
    min-width: 80px;
}

.legend-example {
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 4px;
}

.dot-legend {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

/* Search input */
.filter-input {
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    background: var(--bg-table);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 13px;
    font-weight: 500;
    outline: none;
    min-width: 180px;
    transition: border-color 0.2s;
}

.filter-input:focus {
    border-color: var(--accent);
}

.filter-input::placeholder {
    color: var(--text-dim);
    opacity: 0.6;
}

/* Filters */
.filter-group {
    display: flex;
    gap: 12px;
}

.filter-select {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    background: var(--bg-table);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    outline: none;
}

.filter-select:focus {
    border-color: var(--accent);
}

/* General Stats */
.general-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 40px;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.card.full-width {
    grid-column: 1 / -1;
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-table);
}

.card-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.card-body {
    padding: 20px;
}

/* Winner List */
.winner-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.winner-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    background: var(--bg-table);
    transition: all 0.2s;
}

.winner-item:hover {
    background: var(--bg-card-hover);
}

.winner-rank {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-dim);
    width: 24px;
}

.winner-flag {
    font-size: 20px;
}

.winner-name {
    flex: 1;
    font-weight: 600;
    font-size: 14px;
}

.winner-bar-wrap {
    flex: 2;
    height: 8px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 4px;
    overflow: hidden;
}

.winner-bar {
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--accent), var(--green));
    transition: width 0.5s ease;
}

.winner-pct {
    font-weight: 700;
    font-size: 14px;
    min-width: 45px;
    text-align: right;
    color: var(--text-bright);
}

.winner-odds {
    font-size: 12px;
    color: var(--text-dim);
    min-width: 40px;
    text-align: right;
}

/* Analysis */
.analysis-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid rgba(30, 45, 69, 0.5);
}

.analysis-item:last-child {
    border-bottom: none;
}

.analysis-label {
    color: var(--text-dim);
    font-size: 14px;
}

.analysis-value {
    font-weight: 600;
    font-size: 14px;
}

/* Prediction Summary Table */
.prediction-summary-table {
    width: 100%;
    border-collapse: collapse;
}

.prediction-summary-table th {
    padding: 10px 12px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-dim);
    text-transform: uppercase;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.prediction-summary-table td {
    padding: 10px 12px;
    font-size: 13px;
    border-bottom: 1px solid rgba(30, 45, 69, 0.5);
}

.prediction-summary-table tr:hover td {
    background: rgba(59, 130, 246, 0.03);
}

/* Knockout */
.knockout-container {
    margin-bottom: 40px;
}

.bracket-placeholder {
    text-align: center;
    padding: 60px;
    color: var(--text-dim);
    font-size: 16px;
}

/* Sources */
.sources-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.source-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 14px;
    background: var(--bg-table);
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.source-item:hover {
    background: var(--bg-card-hover);
}

.source-icon {
    font-size: 18px;
    line-height: 1.4;
}

.source-info {
    flex: 1;
}

.source-name {
    font-weight: 600;
    font-size: 14px;
    display: block;
}

.source-desc {
    font-size: 12px;
    color: var(--text-dim);
    margin-top: 2px;
}

.source-type {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
}

.source-type.scrape { background: var(--green-bg); color: var(--green); }
.source-type.reference { background: var(--blue); color: white; }
.source-type.api { background: var(--yellow-bg); color: var(--yellow); }

/* Footer */
footer {
    border-top: 1px solid var(--border);
    padding: 24px 0;
    text-align: center;
    margin-top: 40px;
}

footer p {
    color: var(--text-dim);
    font-size: 13px;
}

.footer-disclaimer {
    color: var(--orange);
    font-weight: 500;
    margin-top: 4px;
}

/* Loading */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 14, 23, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: opacity 0.5s;
}

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

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

.loading-overlay p {
    color: var(--text-dim);
    font-size: 14px;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

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

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

/* Responsive */
/* Mobile: ≤ 900px */
@media (max-width: 900px) {
    .header-inner {
        flex-direction: column;
        height: auto;
        padding: 10px 0;
        gap: 8px;
    }
    .nav-links { gap: 2px; }
    .nav-link { padding: 6px 10px; font-size: 11px; }
    .hero h1 { font-size: 28px; }
    .hero-stats { gap: 20px; }
    .stat-value { font-size: 26px; }
    .groups-grid { grid-template-columns: 1fr; }
    .general-grid { grid-template-columns: 1fr; }
    .section-header { flex-direction: column; align-items: flex-start; }
    .filter-group { flex-wrap: wrap; width: 100%; }
    .filter-input { min-width: 100%; }
    .filter-select { flex: 1; min-width: 0; }

    /* Match cards: stack vertically */
    .match-card {
        flex-direction: column;
        padding: 12px;
        gap: 10px;
    }
    .match-main {
        flex-wrap: wrap;
        gap: 8px;
        width: 100%;
    }
    .match-info {
        flex-direction: row;
        align-items: center;
        gap: 8px;
        width: 100%;
        min-width: 0;
    }
    .match-info .match-date {
        margin-left: auto;
    }
    .match-venue {
        display: none;
    }
    .match-teams {
        flex: 1;
        min-width: 0;
        justify-content: space-between;
        gap: 6px;
    }
    .match-team {
        font-size: 13px;
        gap: 4px;
        max-width: 38%;
    }
    .team-name-inline {
        max-width: 80px;
        font-size: 12px;
    }
    .team-name-inline .team-flag {
        width: 16px;
        height: 12px;
    }
    .match-team.right {
        flex-direction: row;
        text-align: left;
    }
    .match-vs-box {
        flex-shrink: 0;
    }
    .match-vs { font-size: 10px; }
    .match-scoreline-big {
        font-size: 14px;
        min-width: 30px;
        padding: 1px 6px;
    }
    .match-probs {
        width: 100%;
        justify-content: center;
        gap: 6px;
    }
    .prob-box {
        padding: 4px 8px;
        font-size: 11px;
        min-width: 30px;
    }

    /* Side panel: full width below */
    .match-side {
        width: 100%;
        min-width: 0;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        padding: 6px 10px;
        gap: 8px;
    }
    .side-xg-bar {
        flex: 1;
        min-width: 0;
    }
    .xg-labels { font-size: 10px; }
    .side-stats {
        flex-shrink: 0;
        flex-direction: column;
        gap: 1px;
    }
    .side-stat { font-size: 9px; }
    .pred-badge { font-size: 14px; }

    /* Groups table scroll */
    .group-table { font-size: 12px; }
    .group-table th, .group-table td { padding: 6px 8px; }
    .strength-bar { width: 40px; }

    /* Winner list */
    .winner-item { padding: 6px 10px; gap: 8px; }
    .winner-name { font-size: 12px; }
    .winner-pct { font-size: 12px; min-width: 35px; }
    .winner-odds { font-size: 10px; }

    /* Other */
    .match-legend { padding: 10px 12px; }
    .legend-row { font-size: 11px; gap: 8px; }
    .legend-label { min-width: 60px; font-size: 10px; }
    .card-header { padding: 12px 14px; }
    .card-body { padding: 14px; }
}

/* Small mobile: ≤ 480px */
@media (max-width: 480px) {
    .hero h1 { font-size: 22px; }
    .hero-date { font-size: 14px; }
    .hero-desc { font-size: 12px; }
    .hero-stats { gap: 12px; }
    .stat-value { font-size: 20px; }
    .container { padding: 0 12px; }
    .match-card { padding: 8px 10px; gap: 6px; }
    .match-main { gap: 4px; }
    .match-team { font-size: 11px; max-width: 32%; }
    .team-name-inline { max-width: 55px; font-size: 10px; }
    .match-scoreline-big { font-size: 12px; min-width: 24px; }
    .match-probs { gap: 3px; }
    .prob-box { padding: 2px 5px; font-size: 10px; min-width: 24px; border-radius: 4px; }
    .match-side { padding: 4px 8px; flex-wrap: wrap; }
    .xg-labels { font-size: 9px; }
    .side-stat { font-size: 8px; }
    .section-header h2 { font-size: 18px; }
    .card-header h3 { font-size: 14px; }
    .filter-select { font-size: 11px; padding: 6px 10px; }
    .filter-input { font-size: 11px; padding: 6px 10px; min-width: 100%; }
    .nav-link { padding: 4px 8px; font-size: 10px; }
    .pred-badge { font-size: 12px; }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-dim);
}
