:root {
  --navy: #0b2149;
  --navy-2: #13306a;
  --red: #c8203a;
  --blue: #1f6fd6;
  --gold: #b7791f;
  --bg: #f4f6fa;
  --card: #ffffff;
  --ink: #14213a;
  --muted: #5b6780;
  --line: #dfe4ee;
  --win: #1a7f4b;
  --loss: #b3261e;
  --radius: 14px;
  --display: "Barlow Condensed", "Arial Narrow", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 Barlow, system-ui, -apple-system, "Segoe UI", sans-serif;
}
img { max-width: 100%; display: block; }
a { color: var(--navy-2); }
h2, h3, p { margin: 0; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }

/* Top bar */
.top { position: sticky; top: 0; z-index: 1000; background: var(--navy); color: #fff; border-bottom: 3px solid var(--red); }
.top-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; min-width: 0; }
.brand-logo { background: #fff; border-radius: 10px; padding: 4px 6px; flex: none; }
.brand-logo img { height: 30px; width: auto; }
.brand strong { display: block; font: 700 1.25rem/1.1 var(--display); letter-spacing: .02em; text-transform: uppercase; white-space: nowrap; }
.brand small { display: block; font-size: .78rem; opacity: .8; }
.top nav { display: flex; gap: 4px; }
.top nav a { color: #fff; text-decoration: none; font-weight: 500; font-size: .92rem; padding: 6px 10px; border-radius: 8px; opacity: .85; white-space: nowrap; }
.top nav a:hover { background: rgba(255,255,255,.12); opacity: 1; }

/* Hero */
.hero { background: linear-gradient(160deg, var(--navy) 0%, var(--navy-2) 100%); color: #fff; padding: 28px 0 36px; }
.hero-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 20px; align-items: stretch; }
.next { background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.16); border-radius: var(--radius); padding: 20px; }
.eyebrow { font: 600 .85rem/1 var(--display); letter-spacing: .14em; text-transform: uppercase; color: #ffb3bf; }
.next-main { display: flex; align-items: center; gap: 16px; margin: 14px 0 6px; }
.next-main .logo { width: 84px; height: 84px; }
.next h1 { margin: 0; font: 700 clamp(1.9rem, 5vw, 2.8rem)/1 var(--display); text-transform: uppercase; letter-spacing: .01em; }
.next .when { font-size: 1.05rem; opacity: .92; margin-top: 6px; }
.countdown { display: flex; gap: 10px; margin: 16px 0; }
.countdown div { background: rgba(0,0,0,.25); border-radius: 10px; padding: 8px 12px; min-width: 68px; text-align: center; }
.countdown b { display: block; font: 700 1.9rem/1 var(--display); font-variant-numeric: tabular-nums; }
.countdown span { font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; opacity: .75; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }

.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat { background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.16); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; justify-content: center; }
.stat b { font: 700 2rem/1 var(--display); font-variant-numeric: tabular-nums; }
.stat span { font-size: .82rem; opacity: .8; margin-top: 4px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; font: 600 .92rem/1 Barlow, sans-serif; padding: 10px 14px; border-radius: 10px; border: 1px solid transparent; background: var(--red); color: #fff; text-decoration: none; cursor: pointer; }
.btn:hover { filter: brightness(1.08); }
.btn.light { background: #fff; color: var(--navy); }
.btn.ghost { background: transparent; color: var(--navy); border-color: var(--line); }
.btn.ghost:hover { background: #fff; }
.hero .btn.ghost { color: #fff; border-color: rgba(255,255,255,.4); }
.hero .btn.ghost:hover { background: rgba(255,255,255,.1); }
:focus-visible { outline: 3px solid #ffbf47; outline-offset: 2px; }

/* Sections */
.section { padding-top: 36px; padding-bottom: 36px; }
.section.alt { background: #e9edf5; }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
h2 { font: 700 2rem/1.05 var(--display); text-transform: uppercase; color: var(--navy); letter-spacing: .01em; }
.sub { color: var(--muted); margin-top: 4px; }
.fine { color: var(--muted); font-size: .85rem; margin-top: 16px; }

/* Filters */
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.chip { font: 600 .9rem/1 Barlow, sans-serif; padding: 9px 14px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--ink); cursor: pointer; }
.chip span { color: var(--muted); font-weight: 500; margin-left: 4px; }
.chip[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
.chip[aria-pressed="true"] span { color: rgba(255,255,255,.7); }

/* Schedule */
.month { font: 700 1rem/1 var(--display); letter-spacing: .14em; text-transform: uppercase; color: var(--red); margin: 22px 0 10px; }
.event { background: var(--card); border: 1px solid var(--line); border-left: 5px solid var(--accent, var(--line)); border-radius: var(--radius); margin-bottom: 10px; overflow: hidden; }
.event.past { opacity: .72; }
.event.is-next { box-shadow: 0 0 0 2px var(--red); }
.event.flash { animation: flash 1.4s ease-out; }
@keyframes flash { 0% { box-shadow: 0 0 0 4px #ffbf47; } 100% { box-shadow: 0 0 0 0 transparent; } }
.row { display: grid; grid-template-columns: 58px 52px 1fr auto 20px; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; background: none; border: 0; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.row:hover { background: #f8fafd; }
.date { text-align: center; line-height: 1; }
.date small { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.date b { display: block; font: 700 1.7rem/1 var(--display); color: var(--navy); margin: 2px 0; }
.logo { width: 52px; height: 52px; background: #fff; border: 1px solid var(--line); border-radius: 12px; display: grid; place-items: center; padding: 5px; flex: none; }
.logo img { width: 100%; height: 100%; object-fit: contain; }
.logo.trophy { background: #fdf5e4; border-color: #f0dcae; font-size: 1.5rem; }
.title { min-width: 0; }
.title b { display: block; font: 700 1.3rem/1.1 var(--display); letter-spacing: .01em; }
.title small { color: var(--muted); font-size: .86rem; }
.meta { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.pill { font: 700 .74rem/1 Barlow, sans-serif; letter-spacing: .08em; text-transform: uppercase; padding: 5px 8px; border-radius: 6px; white-space: nowrap; }
.pill.home { background: #fde8eb; color: var(--red); }
.pill.away { background: #e3eefc; color: #1557ae; }
.pill.tbc { background: #eceff4; color: #4a5568; }
.pill.tournament { background: #fdf0d2; color: #8a5a0b; }
.pill.note { background: #fff; border: 1px dashed #b9c1d1; color: #4a5568; }
.pill.next { background: var(--red); color: #fff; }
.results { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.res { font: 600 .82rem/1 Barlow, sans-serif; padding: 4px 7px; border-radius: 6px; background: #eef1f6; white-space: nowrap; }
.res.W { background: #e2f4ea; color: var(--win); }
.res.L { background: #fbe6e4; color: var(--loss); }
.chev { color: var(--muted); transition: transform .2s; font-size: .9rem; }
.row[aria-expanded="true"] .chev { transform: rotate(180deg); }
.detail { padding: 4px 14px 16px; border-top: 1px solid var(--line); display: grid; grid-template-columns: 1fr 1.2fr; gap: 20px; }
.detail[hidden] { display: none; }
.detail h3 { font: 700 .82rem/1 var(--display); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 14px 0 8px; }
.detail p { font-size: .95rem; }
.detail .actions { margin-top: 12px; }
.detail .muted { color: var(--muted); font-size: .88rem; margin-top: 4px; }
.h2h-sum { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.h2h { list-style: none; margin: 0; padding: 0; font-size: .92rem; }
.h2h li { display: grid; grid-template-columns: 92px 44px 1fr; gap: 8px; padding: 5px 0; border-bottom: 1px solid #eef1f6; align-items: center; }
.h2h li:last-child { border-bottom: 0; }
.h2h .d { color: var(--muted); }
.h2h a { font-weight: 600; text-decoration: none; }
.h2h a:hover { text-decoration: underline; }
.h2h .W { color: var(--win); }
.h2h .L { color: var(--loss); }
.h2h em { font-style: normal; color: var(--muted); font-weight: 400; }
.rounds { list-style: none; margin: 0; padding: 0; font-size: .93rem; }
.rounds li { padding: 5px 0; border-bottom: 1px solid #eef1f6; }
.rounds b { display: block; }

/* Map */
#map { height: 480px; border-radius: var(--radius); border: 1px solid var(--line); background: #dfe4ee; z-index: 0; }
.legend { list-style: none; display: flex; gap: 14px; flex-wrap: wrap; margin: 0; padding: 0; font-size: .86rem; color: var(--muted); }
.legend li { display: flex; align-items: center; gap: 6px; }
.dot { width: 12px; height: 12px; border-radius: 50%; border: 3px solid; background: #fff; }
.dot.home { border-color: var(--red); }
.dot.away { border-color: var(--blue); }
.dot.visitor { border-color: #8a94a8; }
.dot.tourney { border-color: var(--gold); border-radius: 3px; }
.pin { overflow: hidden; width: 44px; height: 44px; background: #fff; border: 3px solid #8a94a8; border-radius: 50%; display: grid; place-items: center; padding: 5px; box-shadow: 0 2px 6px rgba(11,33,73,.35); }
.pin img { width: 100% !important; height: 100% !important; max-width: 100% !important; object-fit: contain; }
.pin.home { border-color: var(--red); width: 58px; height: 58px; }
.pin.away { border-color: var(--blue); }
.pin.tourney { border-color: var(--gold); border-radius: 10px; font-size: 1.2rem; }
.leaflet-popup-content { font: 14px/1.45 Barlow, system-ui, sans-serif; margin: 12px 14px; }
.pop b { font: 700 1.15rem/1.1 var(--display); display: block; color: var(--navy); }
.pop ul { margin: 6px 0; padding-left: 18px; }
.pop .links { display: flex; gap: 12px; margin-top: 6px; font-weight: 600; }
.pop button { background: none; border: 0; padding: 0; font: inherit; font-weight: 600; color: var(--navy-2); text-decoration: underline; cursor: pointer; }

/* Seasons */
.seasons { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.season { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.season h3 { font: 700 1.3rem/1 var(--display); color: var(--navy); margin-bottom: 10px; }
.team { padding: 10px 0; border-top: 1px solid var(--line); }
.team .lab { font: 600 .78rem/1 var(--display); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.team .rec { font: 700 1.9rem/1.1 var(--display); font-variant-numeric: tabular-nums; }
.bar { height: 6px; border-radius: 3px; background: #f3d3d0; overflow: hidden; margin: 6px 0 8px; }
.bar i { display: block; height: 100%; background: var(--win); }
.team p { font-size: .88rem; color: var(--muted); }

/* Primer */
.primer { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 12px; }
.primer article { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.primer h3 { font: 700 1.25rem/1.1 var(--display); color: var(--navy); margin-bottom: 6px; }
.primer p { font-size: .95rem; }

.foot { background: var(--navy); color: rgba(255,255,255,.8); padding: 24px 0; font-size: .88rem; }
.foot p + p { margin-top: 8px; }
.foot a { color: #fff; }

@media (max-width: 820px) {
  .hero-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(4, 1fr); }
  .stat { padding: 10px; }
  .stat b { font-size: 1.5rem; }
  .stat span { font-size: .72rem; }
  .seasons { grid-template-columns: 1fr; }
  .detail { grid-template-columns: 1fr; gap: 0; }
  .top nav a { padding: 6px 7px; font-size: .85rem; }
}
@media (max-width: 600px) {
  .brand small { display: none; }
  .brand strong { font-size: 1.05rem; white-space: normal; }
  .top nav a:nth-child(n+3) { display: none; }
  .row { grid-template-columns: 44px 42px 1fr 16px; gap: 10px; padding: 12px 10px; }
  .row .meta { grid-column: 2 / 4; grid-row: 2; flex-direction: row; flex-wrap: wrap; justify-content: flex-start; align-items: center; text-align: left; }
  .row .chev { grid-column: 4; grid-row: 1; }
  .logo { width: 42px; height: 42px; border-radius: 10px; }
  .date b { font-size: 1.45rem; }
  .title b { font-size: 1.15rem; }
  .next-main .logo { width: 64px; height: 64px; }
  .countdown div { min-width: 0; flex: 1; }
  .stats { grid-template-columns: 1fr 1fr; }
  #map { height: 400px; }
  .section-head .btn { width: 100%; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .event.flash { animation: none; }
}
