:root {
  --indigo: #110746;        /* Ylöjärven Ilves primary */
  --indigo-2: #1c0f63;
  --maroon: #610000;        /* accent: links, leader, points */
  --maroon-tint: rgba(97, 0, 0, 0.07);
  --ink: #14131a;
  --muted: #5d6470;
  --line: #e6e7ee;
  --bg: #f4f5f9;
  --surface: #ffffff;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
}
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 20px; }

/* Header */
.site-header { background: var(--indigo); color: #fff; border-bottom: 3px solid var(--maroon); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; }
.brand { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; }
.brand-mark { font-size: 1.6rem; line-height: 1; }
.brand-text { display: flex; flex-direction: column; }
.brand-text strong { font-family: 'Oswald', sans-serif; font-weight: 700; letter-spacing: 1.5px; font-size: 1.1rem; }
.brand-text small { color: #b9b3d6; font-size: 0.72rem; letter-spacing: 1px; text-transform: uppercase; }
.admin-link { color: #fff; text-decoration: none; font-weight: 600; font-size: 0.85rem; border: 1px solid rgba(255,255,255,0.35); padding: 7px 14px; border-radius: 8px; }
.admin-link:hover { background: rgba(255,255,255,0.12); }

/* Hero band */
.hero { margin: 24px 0 8px; }
.hero-band { background: linear-gradient(135deg, var(--indigo), var(--indigo-2)); color: #fff; border-radius: 14px; padding: 28px 28px; position: relative; overflow: hidden; }
.hero-band::after { content: ''; position: absolute; left: 28px; bottom: 18px; width: 64px; height: 4px; background: var(--maroon); border-radius: 2px; }
.hero-band h1 { font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 2.2rem; letter-spacing: 1px; margin: 0 0 18px; text-transform: uppercase; }
.hero-sub { margin: 0; color: #cfcae6; font-size: 0.95rem; }

/* Series cards */
.series-grid { display: grid; grid-template-columns: 1fr; gap: 22px; padding: 18px 0 8px; }
@media (min-width: 860px) { .series-grid { grid-template-columns: 1fr 1fr; } }
.series-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; box-shadow: 0 1px 2px rgba(17,7,70,0.04); }
.series-head { display: flex; align-items: center; justify-content: space-between; background: var(--indigo); color: #fff; padding: 12px 16px; }
.series-head h2 { font-family: 'Oswald', sans-serif; font-weight: 600; letter-spacing: 0.6px; margin: 0; font-size: 1.15rem; text-transform: uppercase; }
.series-chip { font-size: 0.66rem; text-transform: uppercase; letter-spacing: 1.2px; background: var(--maroon); color: #fff; padding: 3px 9px; border-radius: 999px; font-weight: 700; }

table.standings { width: 100%; border-collapse: collapse; }
table.standings th, table.standings td { padding: 9px 8px; text-align: center; font-variant-numeric: tabular-nums; font-size: 0.9rem; }
table.standings thead th { background: #faf9fc; color: var(--muted); font-weight: 700; font-size: 0.7rem; letter-spacing: 0.5px; border-bottom: 2px solid var(--line); }
table.standings th.team, table.standings td.team { text-align: left; font-weight: 600; }
table.standings th.pos, table.standings td.pos { width: 30px; color: var(--muted); }
table.standings tbody tr { border-top: 1px solid var(--line); }
table.standings td.pts { font-weight: 800; color: var(--maroon); font-size: 0.98rem; }
table.standings th.pts { color: var(--maroon); }
table.standings tr.leader { background: var(--maroon-tint); box-shadow: inset 3px 0 0 var(--maroon); }
table.standings tr.leader td.pos { color: var(--maroon); font-weight: 800; }

.scoresheet { text-align: center; color: var(--muted); font-size: 0.88rem; margin: 18px 0 36px; }

/* Index list */
.tournament-list { list-style: none; padding: 0; margin: 18px 0 40px; }
.tournament-list li { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; margin-bottom: 10px; }
.tournament-list a { color: var(--indigo); text-decoration: none; font-weight: 700; font-size: 1.1rem; font-family: 'Oswald', sans-serif; letter-spacing: 0.4px; }
.tournament-list .slug { color: var(--muted); font-size: 0.82rem; }
.tournament-list .empty { color: var(--muted); justify-content: center; }

/* Admin */
.admin-grid { display: grid; grid-template-columns: 1fr; gap: 22px; padding: 16px 0 12px; }
@media (min-width: 860px) { .admin-grid { grid-template-columns: 1fr 1fr; } }
.admin-panel { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 18px 18px; }
.admin-panel h2 { font-family: 'Oswald', sans-serif; text-transform: uppercase; letter-spacing: 0.6px; margin: 0 0 14px; color: var(--indigo); font-size: 1.15rem; }
.admin-series { margin-bottom: 18px; }
.admin-series h3 { font-family: 'Oswald', sans-serif; font-size: 1rem; margin: 0 0 8px; display: flex; gap: 8px; align-items: center; }
.rules-form { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; align-items: end; }
.rules-form label { display: flex; flex-direction: column; font-size: 0.8rem; color: var(--muted); gap: 4px; }
.rules-form label.wide { grid-column: 1 / -1; }
.rules-form input, .team-list input, .add-row input { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font: inherit; }
.rules-form .hint { grid-column: 1 / -1; color: var(--muted); font-size: 0.75rem; }
.team-list { list-style: none; padding: 0; margin: 0 0 8px; }
.team-list li { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.team-list .team-name { flex: 1; }
.add-row { display: flex; gap: 8px; }
.add-row .new-team { flex: 1; }
.btn { background: var(--indigo); color: #fff; border: 0; border-radius: 8px; padding: 10px 16px; font: inherit; font-weight: 600; cursor: pointer; }
.btn:hover { background: var(--indigo-2); }
.btn-sm { background: var(--surface); color: var(--indigo); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; font: inherit; font-size: 0.8rem; font-weight: 600; cursor: pointer; }
.btn-sm:hover { border-color: var(--indigo); }
.btn-sm.danger { color: var(--maroon); }
.btn-sm.danger:hover { border-color: var(--maroon); background: var(--maroon-tint); }
.admin-foot { margin: 8px 0 40px; }
.admin-foot a { color: var(--indigo); font-weight: 600; text-decoration: none; }

/* Fixtures / schedule */
.fixtures-title { font-family: 'Oswald', sans-serif; text-transform: uppercase; letter-spacing: 0.6px; font-size: 0.95rem; color: var(--indigo); margin: 16px 14px 6px; }
table.fixtures { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
table.fixtures th { background: #faf9fc; color: var(--muted); font-weight: 700; font-size: 0.66rem; letter-spacing: 0.5px; text-transform: uppercase; padding: 7px 8px; text-align: left; border-bottom: 1px solid var(--line); }
table.fixtures td { padding: 7px 8px; border-top: 1px solid var(--line); vertical-align: middle; }
table.fixtures td.t { white-space: nowrap; color: var(--muted); font-variant-numeric: tabular-nums; }
table.fixtures td.f { color: var(--muted); white-space: nowrap; }
table.fixtures td.match { font-weight: 600; }
table.fixtures td.match .vs { color: var(--muted); margin: 0 6px; }
table.fixtures td.res { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.fixtures td.pk { color: var(--maroon); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.fixtures td.ref { color: var(--muted); white-space: nowrap; }

/* Admin results */
.admin-results { margin-top: 22px; }
.admin-matches { margin-bottom: 16px; }
.admin-matches h3 { font-family: 'Oswald', sans-serif; font-size: 1rem; margin: 0 0 8px; display: flex; gap: 8px; align-items: center; }
.match-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.match-row .m-when { color: var(--muted); font-size: 0.78rem; min-width: 130px; }
.match-row .m-teams { font-weight: 600; min-width: 220px; flex: 1; }
.match-row label { font-size: 0.78rem; color: var(--muted); display: flex; align-items: center; gap: 4px; }
.match-row input { width: 46px; border: 1px solid var(--line); border-radius: 8px; padding: 6px 6px; font: inherit; text-align: center; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: 0.82rem; background: var(--surface); }
.site-footer .wrap { padding: 18px 20px 28px; }
