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

:root {
    --bg:       #0d1117;
    --surface:  #161b22;
    --surface2: #21262d;
    --border:   #30363d;
    --text:     #e6edf3;
    --muted:    #7d8590;
    --accent:   #388bfd;
    --home:     #1a6c38;
    --away:     #6e1c1c;
    --radius:   8px;
}

body { background: var(--bg); color: var(--text); font-family: system-ui, sans-serif; min-height: 100vh; }

/* ── Header / Nav ── */
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
.site-nav { max-width: 960px; margin: 0 auto; padding: 0.75rem 1rem; display: flex; align-items: center; gap: 1.25rem; }
.nav-logo { font-size: 1.2rem; text-decoration: none; font-weight: 700; color: var(--text); }
.nav-links { display: flex; gap: 1rem; flex: 1; }
.nav-links a { color: var(--muted); text-decoration: none; font-size: 0.9rem; }
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-right { display: flex; gap: 0.75rem; align-items: center; margin-left: auto; }

/* ── Page ── */
.page-content { max-width: 960px; margin: 0 auto; padding: 1.5rem 1rem; }

/* ── Filters ── */
.filters { display: flex; flex-wrap: wrap; gap: 1rem; margin-bottom: 1.5rem; align-items: center; }
.filter-group { display: flex; gap: 0.4rem; align-items: center; }
.filter-label { font-size: 0.82rem; color: var(--muted); }
.filter-btn { padding: 0.3rem 0.7rem; border-radius: 20px; border: 1px solid var(--border); font-size: 0.82rem; color: var(--muted); text-decoration: none; }
.filter-btn:hover { color: var(--text); border-color: var(--accent); }
.filter-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ── Fixture cards ── */
.fixture-list { display: flex; flex-direction: column; gap: 0.6rem; }
.fixture-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.85rem 1rem; border-left: 4px solid var(--border); }
.fixture-card.home { border-left-color: var(--home); }
.fixture-card.away { border-left-color: var(--away); }
.fixture-card.past { opacity: 0.8; }

.fixture-meta { display: flex; gap: 0.6rem; align-items: center; margin-bottom: 0.35rem; font-size: 0.82rem; color: var(--muted); }
.sport-badge { font-size: 1rem; }
.ha-badge { background: var(--surface2); padding: 0.1rem 0.4rem; border-radius: 4px; font-size: 0.75rem; }
.fixture-card.home .ha-badge { background: var(--home); color: #d4f7e2; }
.fixture-card.away .ha-badge { background: var(--away); color: #f7d4d4; }

.fixture-match { font-size: 1rem; display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.fixture-match strong { color: var(--accent); }
.vs { color: var(--muted); }
.result { font-weight: 700; font-size: 1.05rem; margin-left: 0.5rem; padding: 0.1rem 0.45rem; border-radius: 4px; }
.result.win  { background: #1a6c3833; color: #4ade80; }
.result.loss { background: #6e1c1c33; color: #f87171; }
.result.draw { background: var(--surface2); color: var(--muted); }

.fixture-venue, .fixture-comp { font-size: 0.78rem; color: var(--muted); margin-top: 0.2rem; }

/* ── Stats ── */
.stats-section { margin-bottom: 2.5rem; }
.stats-section h2 { margin-bottom: 0.75rem; font-size: 1.1rem; }

.standing-table, .scorers-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.standing-table th, .scorers-table th { background: var(--surface2); color: var(--muted); text-align: left; padding: 0.4rem 0.6rem; font-weight: 600; }
.standing-table td, .scorers-table td { padding: 0.4rem 0.6rem; border-top: 1px solid var(--border); }
.standing-table tr.highlight td, .scorers-table tr.highlight td { background: #161e2e; }
.standing-table a, .scorers-table a { color: var(--text); text-decoration: none; }
.standing-table a:hover, .scorers-table a:hover { color: var(--accent); }

/* ── Cup bracket ── */
.cup-wrap { overflow-x: auto; padding: 1rem 0; }
.cup-bracket { display: flex; gap: 1.5rem; align-items: flex-start; }
.cup-round { display: flex; flex-direction: column; gap: 0.75rem; min-width: 220px; }
.cup-round-title { font-size: 0.78rem; color: var(--muted); text-align: center; margin-bottom: 0.25rem; text-transform: uppercase; letter-spacing: 0.05em; }
.cup-match { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.6rem 0.75rem; }
.cup-match.has-bif { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.cup-team { font-size: 0.85rem; padding: 0.2rem 0; display: flex; justify-content: space-between; gap: 0.5rem; }
.cup-team.highlight { color: var(--accent); font-weight: 700; }
.cup-score { font-weight: 700; }
.cup-date { font-size: 0.75rem; color: var(--muted); margin-top: 0.3rem; }
.cup-tie { display: flex; flex-direction: column; gap: 0.4rem; }
.cup-leg { border-top: 1px solid var(--border); padding-top: 0.4rem; }
.cup-leg:first-child { border-top: none; padding-top: 0; }
.cup-leg-label { font-size: 0.68rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; display: block; margin-bottom: 0.1rem; }
.cup-aggregate { font-size: 0.75rem; color: var(--muted); border-top: 1px dashed var(--border); padding-top: 0.4rem; margin-top: 0.1rem; }

/* ── Team header ── */
.team-header { margin-bottom: 1.5rem; }
.team-header h1 { font-size: 1.6rem; }
.team-league { color: var(--muted); margin-top: 0.25rem; }
.standing-box { margin-bottom: 1.5rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; }
.standing-box h2 { margin-bottom: 0.75rem; font-size: 0.95rem; color: var(--muted); }

/* ── Buttons ── */
.btn-ical { background: var(--surface2); border: 1px solid var(--border); color: var(--muted); padding: 0.3rem 0.7rem; border-radius: 6px; font-size: 0.82rem; text-decoration: none; }
.btn-ical:hover { color: var(--text); border-color: var(--accent); }
.btn-ghost-sm { background: none; border: 1px solid var(--border); color: var(--muted); padding: 0.3rem 0.6rem; border-radius: 6px; font-size: 0.82rem; text-decoration: none; }
.btn-ghost-sm:hover { color: var(--text); }
.btn-primary { background: var(--accent); color: #fff; border: none; padding: 0.5rem 1rem; border-radius: 6px; cursor: pointer; font-size: 0.9rem; font-weight: 600; width: 100%; }
.btn-primary:hover { filter: brightness(1.1); }

/* ── Login ── */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 2.5rem; width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 1.25rem; }
.login-box h1 { text-align: center; font-size: 1.4rem; }
.error { color: #e84040; font-size: 0.88rem; text-align: center; }
label { display: flex; flex-direction: column; gap: 0.35rem; font-size: 0.85rem; color: var(--muted); }
input { background: var(--surface2); border: 1px solid var(--border); color: var(--text); padding: 0.5rem 0.75rem; border-radius: 6px; font-size: 0.9rem; outline: none; width: 100%; }
input:focus { border-color: var(--accent); }

/* ── Misc ── */
.empty-state { color: var(--muted); padding: 2rem 0; text-align: center; }
.site-footer { text-align: center; padding: 1.5rem; color: var(--muted); font-size: 0.82rem; border-top: 1px solid var(--border); margin-top: 2rem; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--text); }

@media (max-width: 640px) {
    .nav-links { display: none; }
    .fixture-match { font-size: 0.9rem; }
}
