:root{
  --pitch-green: #0F3B78;
  --pitch-green-dark: #081F42;
  --chalk: #F5F6FA;
  --score-amber: #FDBB11;
  --live-red: #E5384B;
  --ink-soft: rgba(245,246,250,0.68);
  --hairline: rgba(245,246,250,0.18);
  --radius: 2px;
}

*{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }

body{
  margin:0;
  background: var(--pitch-green);
  color: var(--chalk);
  font-family: 'Oswald', sans-serif;
  font-weight: 400;
  letter-spacing: 0.01em;
  background-image:
    repeating-linear-gradient(
      90deg,
      rgba(255,255,255,0.025) 0px,
      rgba(255,255,255,0.025) 1px,
      transparent 1px,
      transparent 80px
    );
}

@media (prefers-reduced-motion: no-preference){
  .reveal{
    opacity:0;
    transform: translateY(14px);
    animation: rise 0.7s ease forwards;
  }
}
@keyframes rise{ to{ opacity:1; transform:none; } }

/* ---------- Layout shell ---------- */
.wrap{ max-width: 1080px; margin: 0 auto; padding: 0 24px; }

/* ---------- Top bar ---------- */
header.topbar{
  border-bottom: 1px solid var(--hairline);
  position: sticky; top:0; z-index: 50;
  background: linear-gradient(var(--pitch-green) 85%, transparent);
  backdrop-filter: blur(6px);
}
.topbar-inner{
  display:flex; align-items:center; justify-content:space-between;
  padding: 16px 0;
}
.brandmark{
  display:flex; align-items:center; gap:10px;
  font-family:'Anton', sans-serif;
  font-size: 18px; letter-spacing: 0.06em;
  color: var(--chalk); text-decoration:none;
}
.brandmark .dot{
  width:9px; height:9px; border-radius:50%;
  background: var(--score-amber);
  box-shadow: 0 0 0 3px rgba(255,183,3,0.18);
}
nav.toplinks{ display:flex; gap: 28px; }
nav.toplinks a{
  color: var(--ink-soft); text-decoration:none;
  font-size: 13px; letter-spacing: 0.12em; text-transform: uppercase;
  font-weight: 500;
  padding-bottom: 3px;
  border-bottom: 1px solid transparent;
  transition: color .2s ease, border-color .2s ease;
}
nav.toplinks a:hover, nav.toplinks a:focus-visible{
  color: var(--score-amber);
  border-color: var(--score-amber);
}

/* Mobile menu toggle (hidden unless the narrow-screen media query below shows it) */
.nav-toggle{
  display:none;
  flex-direction:column;
  justify-content:center;
  align-items:center;
  gap:5px;
  width:36px; height:36px;
  flex:none;
  padding:0;
  background:none;
  border:1px solid var(--hairline);
  cursor:pointer;
}
.nav-toggle span{
  display:block; width:18px; height:2px;
  background:var(--chalk);
  transition: transform .2s ease, opacity .2s ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1){ transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2){ opacity:0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3){ transform: translateY(-7px) rotate(-45deg); }

.mobile-nav{
  display:none;
  flex-direction:column;
  border-top:1px solid var(--hairline);
  background: var(--pitch-green-dark);
}
.mobile-nav a{
  padding:14px 24px;
  color: var(--ink-soft);
  text-decoration:none;
  font-size: 14px; letter-spacing: 0.1em; text-transform: uppercase;
  font-weight: 500;
  border-bottom: 1px dashed var(--hairline);
}
.mobile-nav a:last-child{ border-bottom:none; }
.mobile-nav a:hover, .mobile-nav a:focus-visible{ color: var(--score-amber); }

/* ---------- Hero / scoreboard ---------- */
.hero{
  padding: 72px 0 56px;
  position: relative;
  overflow: hidden;
}
.hero::before{
  content:"";
  position:absolute; left:50%; top:0; bottom:0;
  width:1px; background: var(--hairline);
  transform: translateX(-50%);
}
.hero::after{
  content:"";
  position:absolute; left:50%; top:50%;
  width:140px; height:140px;
  border: 1px solid var(--hairline);
  border-radius:50%;
  transform: translate(-50%,-50%);
}
.eyebrow{
  font-size: 13px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--score-amber); font-weight: 600;
  margin: 0 0 18px;
}
h1.title{
  font-family:'Anton', sans-serif;
  font-weight: 400;
  font-size: clamp(48px, 9vw, 104px);
  line-height: 0.92;
  margin: 0;
  text-transform: uppercase;
  color: var(--chalk);
  text-shadow: 0 2px 0 rgba(0,0,0,0.15);
}
h1.title .accent{ color: var(--score-amber); }

.title-row{
  display:flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  margin: 0 0 24px;
}
.host-logo-hero{
  /* Matches h1.title's rendered height exactly: font-size * line-height * 2 lines.
     (A percentage height here would rely on flex stretch resolving against
     the h1's box, which is unreliable — so the formula is duplicated instead.) */
  height: clamp(88.32px, 16.56vw, 191.36px);
  width: auto;
  flex: none;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.35));
}

@media (max-width: 560px){
  .title-row{
    flex-direction: column;
    align-items: center;
    gap: 16px;
  }
  h1.title{ text-align: center; }
  .host-logo-hero{
    height: auto;
    width: clamp(64px, 20vw, 96px);
  }
}

.hero-host{
  margin: 0 0 6px;
  font-size: 16px;
  color: var(--ink-soft);
  letter-spacing: 0.02em;
}

.hero-meta{
  display:none; /* hidden for now */
  flex-wrap:wrap; gap: 14px 34px;
  margin-top: 34px;
  font-family:'Roboto Mono', monospace;
}
.hero-meta .item{
  display:flex; flex-direction:column; gap: 4px;
}
.hero-meta .label{
  font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-soft);
}
.hero-meta .value{
  font-size: 20px; font-weight: 700; color: var(--chalk);
}

.scoreboard{
  margin-top: 46px;
  border: 1px solid var(--hairline);
  background: var(--pitch-green-dark);
  display:grid;
  grid-template-columns: repeat(3, 1fr);
}
.scoreboard .cell{
  padding: 20px 22px;
  border-right: 1px solid var(--hairline);
  font-family:'Roboto Mono', monospace;
}
.scoreboard .cell:last-child{ border-right:none; }
.scoreboard .cell .num{
  font-size: 34px; font-weight: 700; color: var(--score-amber);
  line-height:1;
}
.scoreboard .cell .cap{
  margin-top:8px; font-size: 11px; letter-spacing:0.12em;
  text-transform: uppercase; color: var(--ink-soft);
}

/* ---------- Section shell ---------- */
section{ padding: 64px 0; border-top: 1px solid var(--hairline); scroll-margin-top: 84px; }
.section-head{
  display:flex; align-items:baseline; justify-content:space-between;
  gap: 20px; margin-bottom: 34px; flex-wrap: wrap;
}
.section-head h2{
  font-family:'Anton', sans-serif; font-weight:400;
  font-size: clamp(28px, 4vw, 40px);
  text-transform: uppercase; margin:0;
  color: var(--chalk);
}
.section-note{
  font-size: 13px; color: var(--ink-soft);
  font-family:'Roboto Mono', monospace;
  max-width: 320px; text-align: right;
}

/* ---------- Groups ---------- */
.groups-grid{
  display:grid; grid-template-columns: 1fr 1fr; gap: 28px;
}
.group-card{
  border: 1px solid var(--hairline);
  background: rgba(255,255,255,0.02);
}
.group-card .group-head{
  display:flex; align-items:center; justify-content:space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--hairline);
  background: var(--pitch-green-dark);
}
.group-head .glabel{
  font-family:'Anton', sans-serif; font-size: 22px; letter-spacing:0.04em;
  color: var(--chalk);
}
.group-head .gcount{
  font-family:'Roboto Mono', monospace; font-size: 12px; color: var(--score-amber);
}
ol.team-list{
  list-style:none; margin:0; padding: 6px 0;
}
ol.team-list li{
  display:flex; align-items:center; gap: 14px;
  padding: 10px 20px;
  border-bottom: 1px dashed var(--hairline);
  font-size: 15px;
}
ol.team-list li:last-child{ border-bottom:none; }
ol.team-list .tname{ color: var(--chalk); }

.tname-clickable{
  appearance: none; -webkit-appearance: none;
  background: none; border: none; padding: 0;
  font: inherit; text-align: left;
  cursor: pointer;
  transition: color .15s ease;
}
.tname-clickable:hover,
.tname-clickable:focus-visible{
  color: var(--score-amber);
  outline: none;
}

/* Crest badges */
.badge{
  width: 36px; height: 36px; flex: none;
  display:flex; align-items:center; justify-content:center;
  background: var(--chalk);
  border-radius: 50%;
  border: 1px solid var(--hairline);
  overflow: hidden;
  padding: 3px;
}
.badge img{
  width:100%; height:100%; object-fit: contain;
}
.badge.sm{ width: 28px; height: 28px; padding: 2px; }

.badge-clickable{
  appearance: none; -webkit-appearance: none;
  font: inherit;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.badge-clickable:hover,
.badge-clickable:focus-visible{
  transform: translateY(-2px);
  border-color: var(--score-amber);
  box-shadow: 0 0 0 3px rgba(253,187,17,0.28);
  outline: none;
}

/* ---------- Fixtures ---------- */
.fixture-controls{
  margin-bottom: 22px;
}

.club-filter{
  display:flex; align-items:center; gap: 10px;
}
.club-filter label{
  font-family:'Roboto Mono', monospace;
  font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-soft);
}
.club-filter select{
  font-family:'Oswald', sans-serif;
  font-size: 14px; font-weight: 500;
  color: var(--chalk);
  background: var(--pitch-green-dark);
  border: 1px solid var(--hairline);
  padding: 9px 36px 9px 14px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%23FDBB11' d='M4 6l4 4 4-4z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px;
  min-width: 200px;
  transition: border-color .18s ease;
}
.club-filter select:hover,
.club-filter select:focus-visible{
  border-color: var(--score-amber);
  outline: none;
}
.club-filter select option{
  background: var(--pitch-green-dark);
  color: var(--chalk);
}

@media (max-width: 640px){
  .club-filter{ justify-content: space-between; }
  .club-filter select{ flex: 1; min-width: 0; }
}

.fixtures-table{ border: 1px solid var(--hairline); }
.fixture-row{
  display:grid;
  grid-template-columns: 92px 1fr auto 1fr 84px;
  align-items:center;
  gap: 14px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--hairline);
}
.fixture-row:last-child{ border-bottom:none; }
.fixture-row:hover{ background: rgba(255,255,255,0.03); }
.fixture-row .fround{
  font-family:'Roboto Mono', monospace; font-weight:700;
  color: var(--score-amber); font-size: 12px;
  letter-spacing: 0.06em; line-height: 1.5;
}
.fixture-row .fround .ftime{
  color: var(--ink-soft); font-weight: 500; font-size: 12px;
}
.fixture-row .fteam{
  display:flex; align-items:center; gap: 10px;
  font-size: 15px; color: var(--chalk);
}
.fixture-row .fteam.right{ justify-content: flex-end; text-align: right; }
.fixture-row .fvs{
  font-family:'Roboto Mono', monospace; font-size: 12px; color: var(--ink-soft);
  padding: 0 6px;
}
.fixture-row .fpitch{
  font-family:'Roboto Mono', monospace; font-size: 12px;
  color: var(--ink-soft); text-align:right;
  text-transform: uppercase; letter-spacing: 0.06em;
}
.fixture-row .fteam-active{
  color: var(--score-amber);
}
.fixture-row .fteam-active .badge{
  border-color: var(--score-amber);
  box-shadow: 0 0 0 2px rgba(253,187,17,0.25);
}

/* ---------- Live Fixtures ---------- */
.live-status{
  display:flex; align-items:center; gap: 10px;
  margin-bottom: 22px;
  font-family:'Roboto Mono', monospace;
  font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-soft);
}
.live-beacon{
  width: 12px; height: 12px; border-radius: 50%; flex: none;
  background: rgba(245,246,250,0.25);
}
.live-status.is-live{ color: var(--chalk); }
.live-status.is-live .live-beacon{
  background: var(--live-red);
  animation: beacon-pulse 1.6s ease-out infinite;
}
@keyframes beacon-pulse{
  0%{ box-shadow: 0 0 0 0 rgba(229,56,75,0.55); }
  70%{ box-shadow: 0 0 0 10px rgba(229,56,75,0); }
  100%{ box-shadow: 0 0 0 0 rgba(229,56,75,0); }
}
@media (prefers-reduced-motion: reduce){
  .live-status.is-live .live-beacon{ animation:none; }
}

.fixtures-empty{
  padding: 40px 20px;
  text-align: center;
  font-family:'Roboto Mono', monospace;
  font-size: 13px;
  color: var(--ink-soft);
  letter-spacing: 0.04em;
}

.fround-short, .fpitch-short{ display:none; }

/* ---------- Pitches ---------- */
.pitches-map{
  display:block;
  width:100%; height:auto;
  border: 1px solid var(--hairline);
}

@media (max-width: 640px){
  .fixture-row{
    grid-template-columns: 26px minmax(0,1fr) 14px minmax(0,1fr) 24px;
    gap: 6px;
    padding: 10px 12px;
  }
  .fixture-row .fround{ text-align:center; }
  .fround-full{ display:none; }
  .fround-short{ display:block; font-size: 10px; line-height:1.3; }
  .fround-short .ftime-short{ display:block; color: var(--ink-soft); font-weight:500; font-size: 9px; }
  .fixture-row .fteam{ gap: 6px; font-size: 12px; min-width:0; }
  .fixture-row .fteam-name{
    overflow:hidden; text-overflow:ellipsis; white-space:nowrap; min-width:0; flex:1;
  }
  .fixture-row .badge.sm{ width: 20px; height: 20px; padding: 2px; }
  .fixture-row .fvs{ padding:0 2px; }
  .fpitch-full{ display:none; }
  .fpitch-short{ display:block; font-size: 10px; text-align:center; }
  .groups-grid{ grid-template-columns: 1fr; }
  .group-card .group-head{ flex-direction: column; align-items: flex-start; gap: 6px; }
  .group-head .glabel{ font-size: 18px; }
  nav.toplinks{ display:none; }
  .nav-toggle{ display:flex; }
  .mobile-nav.open{ display:flex; }

  /* Tighter, phone-tuned spacing instead of a shrunk desktop layout */
  section{ padding: 40px 0; }
  .section-head{ margin-bottom: 20px; justify-content: center; text-align: center; }
  .section-note{ display: none; }

  .eyebrow{ text-align: center; padding-top: 6px; }
  .hero-host{ text-align: center; }

  .hero{ padding: 40px 0 32px; }
  .hero-meta{ margin-top: 22px; gap: 12px 22px; }
  .hero-meta .value{ font-size: 17px; }
  .hero-meta .label{ padding-top: 6px; }

  .scoreboard{ margin-top: 26px; }
  .scoreboard .cell{ padding: 14px 10px; text-align: center; }
  .scoreboard .cell .num{ font-size: 26px; }
  .scoreboard .cell .cap{ font-size: 9.5px; margin-top: 5px; letter-spacing: 0.08em; padding-top: 2px; }

  .crest-parade{ margin-top: 22px; gap: 8px; justify-content: center; }
  .crest-parade .badge{ width: 34px; height: 34px; padding: 3px; }
}

/* Crest parade strip in hero */
.crest-parade{
  margin-top: 40px;
  display:flex; flex-wrap:wrap; gap: 10px;
}
.crest-parade .badge{ width: 42px; height: 42px; padding: 4px; }

/* ---------- Info / footer ---------- */
.info-grid{
  display:grid; grid-template-columns: repeat(3, 1fr); gap: 28px;
}
.info-card h3{
  font-family:'Anton', sans-serif; font-weight:400; font-size:18px;
  text-transform: uppercase; letter-spacing:0.03em;
  margin: 0 0 10px; color: var(--score-amber);
}
.info-card p{
  margin:0; font-size: 14px; line-height:1.6; color: var(--ink-soft);
}
@media (max-width:640px){ .info-grid{ grid-template-columns: 1fr; } }

/* ---------- Rules & Regs ---------- */
.rules-grid{
  display:grid; grid-template-columns: repeat(3, 1fr); gap: 24px;
}
.rule-card{
  border: 1px solid var(--hairline);
  background: rgba(255,255,255,0.02);
  padding: 20px 22px;
}
.rule-card h3{
  font-family:'Anton', sans-serif; font-weight:400; font-size:16px;
  text-transform: uppercase; letter-spacing:0.03em;
  margin: 0 0 12px; color: var(--score-amber);
}
.rule-card ul{
  margin:0; padding: 0 0 0 18px;
}
.rule-card li{
  font-size: 13.5px; line-height:1.6; color: var(--ink-soft);
  margin-bottom: 8px;
}
.rule-card li:last-child{ margin-bottom:0; }
.rule-card li::marker{ color: var(--score-amber); }
.rule-card a{
  color: var(--chalk); text-decoration: underline;
  text-decoration-color: var(--hairline);
  text-underline-offset: 2px;
}
.rule-card a:hover{ color: var(--score-amber); }

@media (max-width:900px){ .rules-grid{ grid-template-columns: 1fr 1fr; } }
@media (max-width:640px){ .rules-grid{ grid-template-columns: 1fr; } }

footer{
  padding: 36px 0 48px;
  border-top: 1px solid var(--hairline);
  text-align:center;
}
footer p{
  margin:0; font-size:12px; letter-spacing:0.08em; text-transform:uppercase;
  color: var(--ink-soft); font-family:'Roboto Mono', monospace;
}
