:root {
    color-scheme: light dark;
    --bg: #0f1115;
    --bg-elevated: #171a21;
    --border: #2a2e37;
    --text: #e7e9ee;
    --text-muted: #9aa1ad;
    --accent: #4f8cff;
    --ok: #2fbf71;
    --warn: #e0a72e;
    --error: #e0522e;
    --radius: 10px;
}

@media (prefers-color-scheme: light) {
    :root {
        --bg: #f5f6f8;
        --bg-elevated: #ffffff;
        --border: #e1e4e9;
        --text: #171a21;
        --text-muted: #5b6270;
    }
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    line-height: 1.5;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1rem 3rem;
}

header.topbar {
    border-bottom: 1px solid var(--border);
    margin-bottom: 1.5rem;
}

.topbar-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1.25rem;
}

.brand { font-weight: 700; font-size: 1.1rem; margin-right: auto; }

nav.main-nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; }
nav.main-nav a { color: var(--text-muted); font-size: 0.95rem; }
nav.main-nav a.active { color: var(--text); font-weight: 600; }

.grid { display: grid; gap: 1rem; }
.grid-cols-2 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

.card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
}

.card h2, .card h3 { margin-top: 0; }

.section-title {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    margin: 2rem 0 0.75rem;
}

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 0.5rem 0.6rem; border-bottom: 1px solid var(--border); font-size: 0.92rem; }
th { color: var(--text-muted); font-weight: 600; }

.badge {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--border);
    color: var(--text);
}
.badge-live { background: var(--error); color: #fff; }
.badge-ok { background: var(--ok); color: #06210f; }
.badge-warn { background: var(--warn); color: #241a02; }

.fixture-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}
.fixture-row:last-child { border-bottom: none; }

.teams { display: flex; align-items: center; gap: 0.5rem; flex: 1; min-width: 220px; }
.teams img { width: 22px; height: 22px; object-fit: contain; }

.score { font-weight: 700; min-width: 3.5rem; text-align: center; }

.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 1.25rem;
}
input[type], select, textarea {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 6px;
    padding: 0.5rem 0.7rem;
    font-size: 0.9rem;
    font-family: inherit;
}

button, .btn {
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    cursor: pointer;
}
button.secondary, .btn.secondary {
    background: none;
    border: 1px solid var(--border);
    color: var(--text);
}

.pagination { display: flex; gap: 0.5rem; margin-top: 1.5rem; }
.pagination a, .pagination span {
    padding: 0.35rem 0.7rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.9rem;
}

.empty-state { color: var(--text-muted); padding: 2rem 0; text-align: center; }

.comment-body { white-space: pre-line; }

@media (max-width: 640px) {
    .fixture-row { flex-direction: column; align-items: stretch; }
    .score { text-align: left; }
}
