/* 5v5.global — mown pitch, cup football, varsity banners, scoreboard clock. */

:root {
  --chalk: #f7f3e8;      /* clubhouse cream */
  --ink: #16150f;        /* scoreboard black */
  --grass: #4e9346;      /* mown pitch, light stripe */
  --grass-dark: #427f3b; /* mown pitch, dark stripe */
  --pitch-line: #2f5d2a; /* deep green, legible on cream */
  --navy: #1d2c4f;       /* club navy */
  --amber: #e8722c;      /* scoreboard amber */
  --display: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --varsity: 'Graduate', 'Courier New', monospace;
  --body: 'Barlow', 'Helvetica Neue', Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--chalk);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.55;
}
a { color: var(--navy); }
img { max-width: 100%; }
/* the hidden attribute must beat class display rules (.arena-panels is a grid) */
[hidden] { display: none !important; }

.demo-strip {
  background: var(--ink);
  color: var(--chalk);
  font-size: 0.8rem;
  text-align: center;
  padding: 0.35rem 1rem;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
}
.demo-strip code { color: var(--amber); }
.demo-run { display: inline; margin: 0; }
.demo-run button {
  font-family: var(--display);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  color: var(--ink);
  background: var(--amber);
  border: 1px solid var(--chalk);
  border-radius: 4px;
  padding: 0.15rem 0.6rem;
  cursor: pointer;
}
.demo-run button:hover { filter: brightness(1.1); }

/* ---- top bar ---- */
.topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 1.4rem;
  border-bottom: 3px solid var(--ink);
  background: var(--chalk);
  position: sticky;
  top: 0;
  z-index: 100; /* above bracket connector SVGs, popups excluded (dialogs top-layer) */
}
.topbar .btn-enter { justify-self: end; }
.wordmark { display: inline-block; line-height: 0; }
.wordmark-img { height: 128px; width: auto; display: block; }
.topbar-brand { display: flex; align-items: center; gap: 1rem; }
.brand-tag {
  font-family: var(--varsity);
  font-size: 0.9rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--pitch-line);
  line-height: 1.6;
}
.brand-text { display: flex; flex-direction: column; gap: 0.35rem; }
.visit-stats {
  font-family: var(--varsity);
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
  background: #fffdf6;
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 0.3rem 0.85rem;
  box-shadow: 2px 2px 0 rgba(22, 21, 15, 0.2);
  align-self: flex-start;
  white-space: nowrap;
  min-height: 1.7em; /* filled by /api/stats; keeps the bar from shifting */
  visibility: hidden; /* shown once the numbers arrive */
}
.visit-stats.loaded { visibility: visible; }
.visit-stats .live-dot { margin-right: 0.3rem; }
@media (max-width: 900px) {
  .brand-text { display: none; } /* not enough room beside the clock */
}
.topbar-right { display: flex; align-items: center; gap: 1.4rem; justify-self: end; flex-wrap: wrap; justify-content: flex-end; }
.topnav { display: flex; gap: 1.2rem; }
.topnav a {
  font-family: var(--varsity);
  font-size: 0.95rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--pitch-line);
}
.topnav a:hover { text-decoration: underline; color: var(--ink); }
.wordmark-tld { color: var(--pitch-line) !important; font-size: 0.62em; letter-spacing: 0.06em; }
.clock { text-align: center; }
.clock-label {
  display: block;
  font-family: var(--varsity);
  font-size: 1.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--pitch-line);
  margin-bottom: 0.25rem;
}
.clock-local {
  display: block;
  font-family: var(--varsity);
  font-size: 1.05rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--pitch-line);
  margin-top: 0.3rem;
}
.clock-time {
  font-family: var(--varsity);
  font-size: 3rem;
  background: var(--ink);
  color: #7fd36f; /* lightened --grass; the base green is too dark on scoreboard black */
  padding: 0.2rem 0.9rem;
  border-radius: 8px;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
  display: inline-block;
}

/* ---- buttons ---- */
.btn {
  display: inline-block;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.05rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-decoration: none;
  color: var(--chalk);
  background: var(--navy);
  border: 2px solid var(--ink);
  border-radius: 6px;
  padding: 0.45rem 1.1rem;
  cursor: pointer;
  box-shadow: 3px 3px 0 var(--ink);
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.btn:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }
.btn-enter { background: var(--amber); color: var(--ink); }
.btn-small { font-size: 0.85rem; padding: 0.25rem 0.7rem; box-shadow: 2px 2px 0 var(--ink); }

/* ---- jerseys ---- */
.jersey { display: block; }
.jersey .j-stripes, .jersey .j-hoops { display: none; }
.jersey.j-style-stripes .j-stripes { display: block; }
.jersey.j-style-hoops .j-hoops { display: block; }
.jersey .j-brand {
  font-family: var(--varsity);
  fill: #fffdf6;
  stroke: #16150f;
  stroke-width: 0.35;
  paint-order: stroke;
  opacity: 0.85;
}
.jersey .j-backtext {
  font-family: var(--display);
  fill: #fffdf6;
  stroke: #16150f;
  stroke-width: 0.45;
  paint-order: stroke;
}
.jersey .j-placeholder text {
  font-family: var(--display);
  fill: #fffdf6;
  stroke: #16150f;
  stroke-width: 0.45;
  paint-order: stroke; /* thin dark outline keeps it readable on any shirt colour */
}
.jersey .j-logo { clip-path: inset(0 round 15%); } /* rounds square favicons on the shirt */
.mini-jersey { display: inline-block; vertical-align: middle; margin-right: 0.45rem; }
.mini-jersey .jersey { display: inline-block; vertical-align: middle; }

/* ---- champion banner over the mown pitch (the signature) ---- */
.banner {
  --champ1: var(--navy);
  --champ2: var(--amber);
  --champ-ink: var(--chalk);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(0, 0, 0, 0.08)),
    repeating-linear-gradient(90deg, var(--grass) 0 90px, var(--grass-dark) 90px 180px);
  border-bottom: 6px solid var(--pitch-line);
  padding: 0 1rem 1.2rem;
  text-align: center;
}
.banner-cloth {
  max-width: 620px;
  margin: 0 auto;
  background: var(--champ1);
  color: var(--champ-ink);
  border: 3px solid var(--ink);
  border-top: none;
  padding: 2.6rem 2rem 3.4rem;
  position: relative;
  clip-path: polygon(0 0, 100% 0, 100% 84%, 50% 100%, 0 84%);
  box-shadow: 0 14px 24px rgba(22, 21, 15, 0.3);
}
.banner-cloth::before {
  content: '';
  position: absolute;
  inset: 8px 8px 12px;
  border: 2px solid var(--champ2);
  clip-path: polygon(0 0, 100% 0, 100% 83%, 50% 99%, 0 83%);
  pointer-events: none;
}
.banner-eyebrow {
  font-family: var(--varsity);
  font-size: 1rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  margin: 0 0 0.7rem;
  /* champ-ink is picked for contrast against the banner colour — the secondary
     kit colour could land unreadable (e.g. navy on navy) */
  color: var(--champ-ink);
}
.banner-name {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(2rem, 6.5vw, 3.4rem);
  line-height: 0.95;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin: 0 0 0.5rem;
}
.banner-name-link { color: inherit; text-decoration: none; }
.banner-name-link:hover { text-decoration: underline; }
.banner-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
  margin: 0.3rem 0 0.6rem;
}
.banner-head .banner-name { margin: 0; text-align: center; }
.banner-logo {
  width: 116px;
  height: 116px;
  flex-shrink: 0;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  /* white plate behind the logo — dark marks vanish straight onto dark kit colours */
  background: #fffdf6;
  border-radius: 16px;
  padding: 10px;
  box-shadow: 0 6px 8px rgba(0, 0, 0, 0.3);
}
.banner-logo img { width: 100%; height: 100%; object-fit: contain; border-radius: 10px; }
.banner-tagline {
  font-size: 1.45rem;
  line-height: 1.35;
  margin: 0 auto 0.8rem;
  max-width: 30rem;
  font-weight: 500;
}
.banner-jersey { display: flex; justify-content: center; margin: 0.4rem 0 0.8rem; }
.banner-jersey .jersey { filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.3)); }
.banner-record {
  font-family: var(--varsity);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin: 0 0 1.1rem;
  opacity: 0.85;
}
.banner-cta { background: var(--champ2); color: var(--champ1); }
.banner-note { font-size: 0.9rem; margin: 1.1rem 0 0; color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4); }
.banner-note a { color: #fff; }
.banner-opening .banner-cloth { --champ1: var(--navy); --champ2: var(--amber); }

/* ---- sections ---- */
.section { max-width: 1000px; margin: 0 auto; padding: 2.6rem 1.4rem 0.6rem; scroll-margin-top: 120px; /* clear the sticky top bar when jumped to */ }
#rankings { max-width: 1360px; } /* the table has a lot of columns — give it the arena's width */
#results { max-width: 1360px; } /* the bracket runs many rounds deep — same wide treatment */
.how { max-width: 1360px; } /* matches the results section it sits beside */
#champions { max-width: 1360px; } /* room for more pennants per row */
.section-title {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.9rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin: 0 0 1rem;
  border-bottom: 3px solid var(--ink);
  padding-bottom: 0.3rem;
}
.section-sub {
  font-family: var(--varsity);
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  color: var(--pitch-line);
  margin-left: 0.6rem;
  vertical-align: middle;
}

/* ---- bracket ---- */
.bracket-scroll { overflow-x: auto; padding-bottom: 0.8rem; }
.bracket { display: flex; gap: 1.6rem; min-width: min-content; position: relative; }
/* Every round column stretches to the same height and divides it into equal
   slots (32, 16, 8, ...), one match centered per slot — so each fixture sits
   exactly at the midpoint of the two fixtures that feed it. The heading is
   absolute so it can't push the slots out of line. */
.round { display: flex; flex-direction: column; min-width: 210px; position: relative; padding-top: 1.5rem; }
.round-name { position: absolute; top: 0.2rem; left: 0; }
.slot { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 0.45rem 0; }
/* connector lines between fixtures, drawn by app.js */
.bracket-lines { position: absolute; inset: 0; pointer-events: none; }
.bracket-lines path { fill: none; stroke: rgba(22, 21, 15, 0.3); stroke-width: 2; }
.bracket-lines .line-champ { stroke: var(--grass); stroke-width: 3; }
.round-name {
  font-family: var(--varsity);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--pitch-line);
  margin: 0;
}
.match {
  border: 2px solid var(--ink);
  border-radius: 6px;
  background: #fffdf6;
  box-shadow: 3px 3px 0 rgba(22, 21, 15, 0.15);
  overflow: hidden;
}
.side {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.6rem;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1rem;
  text-transform: uppercase;
}
.side + .side { border-top: 1px dashed var(--pitch-line); }
.side.loser { opacity: 0.45; }
.side.winner { background: rgba(78, 147, 70, 0.14); }
.side .team-name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side .score { font-family: var(--varsity); font-size: 0.7rem; }
.seed { font-family: var(--varsity); font-size: 0.55rem; color: var(--pitch-line); min-width: 1.1em; }
.chip {
  width: 0.7rem; height: 0.7rem;
  border-radius: 50%;
  border: 1.5px solid var(--ink);
  display: inline-block;
  flex-shrink: 0;
}

/* ---- join the cup CTA ---- */
.join-cup {
  background: var(--navy);
  color: var(--chalk);
  border: 3px solid var(--ink);
  border-radius: 12px;
  box-shadow: 4px 4px 0 rgba(22, 21, 15, 0.2);
  text-align: center;
  padding: 2.2rem 1.5rem 2.5rem;
  position: relative;
}
.join-how {
  position: absolute;
  top: 0.9rem;
  right: 1.2rem;
  font-family: var(--varsity);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(247, 243, 232, 0.85);
  text-decoration: none;
}
.join-how:hover { color: var(--chalk); text-decoration: underline; }
@media (max-width: 640px) {
  .join-how { position: static; display: inline-block; margin-bottom: 0.5rem; }
}
.join-cup-title {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(1.9rem, 5vw, 2.8rem);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin: 0 0 0.4rem;
}
.join-cup-lede { margin: 0 auto 1.3rem; max-width: 34rem; color: rgba(247, 243, 232, 0.85); }
.join-cup-form { display: flex; justify-content: center; align-items: flex-end; gap: 0.6rem; flex-wrap: wrap; }
.join-field { display: flex; flex-direction: column; align-items: flex-start; gap: 0.3rem; }
.join-field-url { flex: 1 1 20rem; max-width: 36rem; }
.join-field-url input { align-self: stretch; }
.join-field-label {
  font-family: var(--varsity);
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(247, 243, 232, 0.85);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.join-cup-form input {
  font-family: var(--body);
  font-size: 1.05rem;
  padding: 0.7rem 0.9rem;
  border: 2px solid var(--ink);
  border-radius: 8px;
}
.join-field-amount input { width: 7rem; }
/* button matches the input boxes' height so the row lines up */
.join-cup-form input, .join-cup-form .btn-enter { height: 3rem; box-sizing: border-box; }
.join-cup-form .btn-enter { font-size: 1.05rem; display: inline-flex; align-items: center; }

/* ---- "?" tooltip ---- */
.tip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.15rem;
  height: 1.15rem;
  border: 2px solid currentColor;
  border-radius: 50%;
  font-family: var(--body);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0;
  cursor: help;
}
.tip-bubble {
  display: none;
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  width: 17rem;
  background: var(--ink);
  color: var(--chalk);
  border-radius: 8px;
  padding: 0.6rem 0.8rem;
  font-family: var(--body);
  font-size: 0.82rem;
  font-weight: 400;
  line-height: 1.45;
  letter-spacing: normal;
  text-transform: none;
  text-align: left;
  z-index: 20;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.35);
}
.tip-bubble::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--ink);
}
.tip:hover .tip-bubble,
.tip:focus .tip-bubble { display: block; }

/* ---- rankings ---- */
.table-scroll { overflow-x: auto; }
.rankings { width: 100%; border-collapse: collapse; }
.rankings th {
  font-family: var(--varsity);
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-align: left;
  color: var(--pitch-line);
  padding: 0.3rem 0.6rem;
}
.rankings td { padding: 0.85rem 0.6rem; border-top: 1px solid rgba(22, 21, 15, 0.15); vertical-align: middle; }
.num { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.seed-cell { font-family: var(--varsity); font-size: 0.95rem; }
.logo-cell { width: 66px; }
.logo-tile {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  background: #fffdf6;
  border: 2px solid var(--ink);
  border-radius: 10px;
  padding: 5px;
  box-shadow: 2px 2px 0 rgba(22, 21, 15, 0.15);
}
.logo-tile img { width: 100%; height: 100%; object-fit: contain; border-radius: 6px; }
.team-link { font-family: var(--display); font-weight: 700; font-size: 1.1rem; text-transform: uppercase; text-decoration: none; }
.team-link:hover { text-decoration: underline; }
.team-link-big { font-size: 1.5rem; line-height: 1.1; }
.kit-cell { width: 76px; text-align: center; }
.kit-cell .mini-jersey { margin: 0; }
.power-num { font-size: 1.15rem; }
.title-count { font-size: 0.75rem; color: var(--amber); margin-left: 0.35rem; }
.team-tagline { display: block; font-size: 1rem; color: rgba(22, 21, 15, 0.75); margin-top: 0.15rem; }
.team-meta {
  display: block;
  font-size: 0.75rem;
  color: rgba(22, 21, 15, 0.55);
  margin-top: 0.2rem;
  font-variant-numeric: tabular-nums;
}
.actions-cell { white-space: nowrap; }
.actions-cell .btn { display: block; text-align: center; margin: 0.3rem 0; }

.rewatch-line { margin: 0.2rem 0 1rem; }
.arena-toggle { vertical-align: middle; margin: 0 0.4rem 0 0.6rem; }
.fair-note { font-size: 0.85rem; color: rgba(22, 21, 15, 0.65); margin: 0.6rem 0 0.4rem; }

/* ---- EU analytics consent bar ---- */
.consent-bar {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 1rem;
  z-index: 300;
  max-width: min(94vw, 44rem);
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  background: var(--ink);
  color: var(--chalk);
  font-size: 0.9rem;
  border: 2px solid var(--chalk);
  border-radius: 10px;
  box-shadow: 0 8px 20px rgba(22, 21, 15, 0.4);
  padding: 0.8rem 1.1rem;
}
.consent-bar a { color: var(--chalk); }
.consent-actions { display: flex; gap: 0.6rem; margin-left: auto; }
.consent-bar .consent-no { background: transparent; color: var(--chalk); box-shadow: none; }

/* ---- post-payment welcome ---- */
.welcome { max-width: 720px; text-align: center; }
.welcome-eyebrow { color: var(--pitch-line); }
.welcome-title { margin-top: 0.2rem; }
.welcome-card {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2.2rem;
  background: #fffdf6;
  border: 3px solid var(--ink);
  border-radius: 12px;
  box-shadow: 5px 5px 0 rgba(22, 21, 15, 0.2);
  padding: 1.8rem 2rem;
  margin: 1.4rem 0;
  text-align: left;
  flex-wrap: wrap;
}
.welcome-kit { flex-shrink: 0; }
.welcome-facts { max-width: 24rem; }
.welcome-logo {
  width: 56px;
  height: 56px;
  object-fit: contain;
  border: 2px solid var(--ink);
  border-radius: 10px;
  background: #fffdf6;
  padding: 4px;
  margin-bottom: 0.5rem;
}
.welcome-tagline { margin: 0 0 0.8rem; color: rgba(22, 21, 15, 0.7); }
.welcome-stats { display: flex; gap: 2rem; margin-bottom: 0.9rem; }
.welcome-stat-label {
  display: block;
  font-family: var(--varsity);
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--pitch-line);
}
.welcome-stat-value { font-family: var(--display); font-weight: 800; font-size: 2rem; line-height: 1.1; }
.welcome-stat-sub { display: block; font-size: 0.8rem; color: rgba(22, 21, 15, 0.6); }
.welcome-note { margin: 0; font-size: 0.95rem; color: rgba(22, 21, 15, 0.75); }
.welcome-actions { display: flex; flex-direction: column; align-items: center; gap: 0.8rem; }
.welcome-team-link { font-size: 0.9rem; }

/* ---- rules & terms ---- */
.terms { max-width: 720px; }
.terms h3 {
  font-family: var(--display);
  font-weight: 800;
  text-transform: uppercase;
  font-size: 1.15rem;
  margin: 1.6rem 0 0.4rem;
}
.terms p { margin: 0 0 0.6rem; line-height: 1.55; }
.terms ul { margin: 0 0 0.6rem; padding-left: 1.3rem; line-height: 1.55; }
.terms li { margin-bottom: 0.35rem; }
.terms-date { font-size: 0.8rem; color: rgba(22, 21, 15, 0.55); margin-top: 1.6rem; }
.fair-note code { font-size: 0.75rem; word-break: break-all; background: rgba(22, 21, 15, 0.07); padding: 0.1rem 0.3rem; border-radius: 4px; }

/* ---- "View team" popup card ---- */
.team-pop { border: none; padding: 0; background: transparent; overflow: visible; }
.team-pop::backdrop { background: rgba(22, 21, 15, 0.55); }
.team-pop-card {
  position: relative;
  width: min(92vw, 24rem);
  background: var(--chalk);
  color: var(--ink);
  border: 3px solid var(--ink);
  border-radius: 12px;
  box-shadow: 6px 6px 0 var(--ink);
  padding: 1.2rem 1.4rem 1.3rem;
}
.team-pop-close {
  position: absolute;
  top: 0.4rem;
  right: 0.6rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--ink);
  cursor: pointer;
}
.team-pop-head { display: flex; align-items: center; gap: 0.8rem; padding-right: 1.2rem; }
.team-pop-logo {
  width: 52px;
  height: 52px;
  object-fit: contain;
  border-radius: 10px;
  border: 2px solid var(--ink);
  background: #fffdf6;
  padding: 4px;
  flex-shrink: 0;
}
.team-pop-name { font-family: var(--display); font-weight: 800; font-size: 1.35rem; text-transform: uppercase; line-height: 1.05; margin: 0; }
.team-pop-url { font-size: 0.85rem; color: var(--navy); word-break: break-all; }
.team-pop-tagline { margin: 0.6rem 0 0; font-size: 1rem; color: rgba(22, 21, 15, 0.75); }
.team-pop-body { display: flex; align-items: center; gap: 1.1rem; margin: 0.9rem 0 0.4rem; }
.team-pop-kit { flex-shrink: 0; }
.team-pop-squad { list-style: none; margin: 0; padding: 0; font-size: 0.85rem; }
.team-pop-squad li { padding: 0.12rem 0; }
.team-pop-squad em { color: rgba(22, 21, 15, 0.45); font-style: italic; }
.team-pop-num { font-family: var(--varsity); font-size: 0.7rem; }
.team-pop-pos {
  font-family: var(--varsity);
  font-size: 0.55rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--pitch-line);
  margin-right: 0.2rem;
}
.team-pop-stats { font-size: 0.8rem; color: rgba(22, 21, 15, 0.65); margin: 0.5rem 0 0.9rem; font-variant-numeric: tabular-nums; }
.bar-cell { width: 30%; min-width: 120px; }
.bar { height: 0.85rem; background: linear-gradient(90deg, var(--pitch-line), var(--grass)); border-radius: 3px; border: 1px solid var(--ink); }
.empty { color: var(--pitch-line); font-style: italic; }
.sort-tabs { display: flex; gap: 0.35rem; margin-bottom: 0.7rem; }
.sort-tab {
  font-family: var(--varsity);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: 2px solid var(--ink);
  border-radius: 4px;
  background: #fffdf6;
  color: var(--ink);
  padding: 0.25rem 0.7rem;
  text-decoration: none;
}
.sort-tab.active { background: var(--ink); color: var(--amber); }
.pager { display: flex; align-items: center; justify-content: space-between; margin-top: 0.9rem; }
.pager-info { font-family: var(--varsity); font-size: 0.8rem; letter-spacing: 0.12em; color: var(--pitch-line); }

/* ---- how it works ---- */
.how-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }
.how-card { border: 2px solid var(--ink); border-radius: 8px; background: #fffdf6; padding: 1rem 1.2rem; box-shadow: 4px 4px 0 rgba(22, 21, 15, 0.15); }
.how-card h3 { font-family: var(--display); font-weight: 800; text-transform: uppercase; font-size: 1.25rem; margin: 0 0 0.4rem; }
.how-card p { margin: 0; font-size: 0.95rem; }

/* ---- the ticket-draw explainer ---- */
.how-explainer {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: minmax(15rem, 1fr) minmax(0, 1.15fr);
  gap: 1.8rem;
  align-items: center;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: #fffdf6;
  box-shadow: 4px 4px 0 rgba(22, 21, 15, 0.15);
  padding: 1.4rem 1.6rem;
}
.how-explainer-copy h3 { font-family: var(--display); font-weight: 800; text-transform: uppercase; font-size: 1.25rem; margin: 0 0 0.4rem; }
.how-explainer-copy p { margin: 0 0 0.7rem; font-size: 0.95rem; }
.how-explainer-copy p:last-child { margin-bottom: 0; }

.draw-diagram { text-align: center; font-size: 0.85rem; }
.draw-team {
  display: inline-grid;
  grid-template-columns: auto auto;
  grid-template-areas: 'jersey name' 'jersey power' 'jersey stubs';
  column-gap: 0.6rem;
  text-align: left;
  align-items: center;
  vertical-align: middle;
}
.draw-team .jersey { grid-area: jersey; }
.draw-team-name { grid-area: name; font-family: var(--display); font-weight: 800; text-transform: uppercase; font-size: 0.95rem; line-height: 1.1; }
.draw-team-power { grid-area: power; color: rgba(22, 21, 15, 0.65); font-size: 0.8rem; }
.draw-stubs { grid-area: stubs; display: flex; gap: 3px; margin-top: 0.2rem; }
.draw-vs {
  display: inline-block;
  vertical-align: middle;
  margin: 0 1rem;
  font-family: var(--varsity);
  font-size: 0.7rem;
  color: var(--pitch-line);
}
.stub {
  display: inline-block;
  width: 13px;
  height: 20px;
  background: var(--stub);
  border: 2px solid var(--ink);
  border-radius: 3px;
  /* a notch, so they read as raffle tickets rather than pixels */
  -webkit-mask: radial-gradient(circle 3px at 50% 0, transparent 98%, #000) 50% 0 / 100% 100% no-repeat;
  mask: radial-gradient(circle 3px at 50% 0, transparent 98%, #000) 50% 0 / 100% 100% no-repeat;
}
.draw-flow {
  margin: 0.9rem 0 0.45rem;
  font-family: var(--varsity);
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--pitch-line);
}
.draw-flow::before, .draw-flow::after { content: '\2193'; margin: 0 0.5rem; }
.draw-pile { display: flex; justify-content: center; gap: 3px; }
.draw-pile .stub { width: 17px; height: 26px; }
.stub-drawn {
  outline: 3px solid var(--amber);
  outline-offset: 1.5px;
  transform: translateY(-4px);
}
.draw-note { margin-top: 0.45rem; color: rgba(22, 21, 15, 0.75); }
.draw-note-mark { color: var(--amber); }
.draw-odds { display: flex; justify-content: center; gap: 1.4rem; margin-top: 0.8rem; flex-wrap: wrap; font-size: 0.85rem; }
@media (max-width: 760px) {
  .how-explainer { grid-template-columns: 1fr; }
}

/* ---- hall of champions ---- */
.hall { display: flex; gap: 1.2rem; overflow-x: auto; padding: 0.4rem 0 1.2rem; }
.pennant {
  --p: var(--navy);
  --p-ink: var(--chalk);
  flex-shrink: 0;
  width: 190px;
  min-height: 190px;
  background: var(--p);
  color: var(--p-ink);
  text-decoration: none;
  text-align: center;
  padding: 1.2rem 0.9rem 2.4rem;
  border: 2px solid var(--ink);
  clip-path: polygon(0 0, 100% 0, 100% 75%, 50% 100%, 0 75%);
}
.pennant-date { display: block; font-family: var(--varsity); font-size: 0.8rem; letter-spacing: 0.12em; opacity: 0.8; }
.pennant-name {
  display: block;
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.45rem;
  text-transform: uppercase;
  line-height: 1.05;
  margin-top: 0.45rem;
  word-break: break-word;
}
.pennant-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  margin: 0.7rem auto 0;
  background: #fffdf6;
  border: 2px solid var(--ink);
  border-radius: 10px;
  padding: 5px;
}
.pennant-logo img { width: 100%; height: 100%; object-fit: contain; border-radius: 6px; }
.pennant:hover { transform: translateY(-3px); transition: transform 0.1s ease; }

/* ---- forms & kit designer ---- */
.form-section { max-width: 560px; }
.form-designer { max-width: 980px; }
.form-lede { color: rgba(22, 21, 15, 0.75); }
.team-form { display: flex; flex-direction: column; gap: 0.9rem; margin-top: 1.2rem; }
.team-form label { display: flex; flex-direction: column; gap: 0.25rem; font-family: var(--display); font-weight: 700; text-transform: uppercase; font-size: 0.95rem; }
.team-form .opt { font-weight: 400; text-transform: none; color: var(--pitch-line); font-family: var(--body); font-size: 0.8rem; }
.team-form input {
  font-family: var(--body);
  font-size: 1rem;
  padding: 0.5rem 0.6rem;
  border: 2px solid var(--ink);
  border-radius: 6px;
  background: #fffdf6;
}
.team-form input:focus-visible { outline: 3px solid var(--amber); outline-offset: 1px; }
.team-form input[disabled] { opacity: 0.75; cursor: default; pointer-events: none; }
.team-form input[type='color'] { padding: 0.15rem; height: 2.6rem; width: 5rem; }
.color-row { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.form-error { background: #7a1f1f; color: var(--chalk); padding: 0.5rem 0.8rem; border-radius: 6px; }
.form-ok { background: #24522f; color: var(--chalk); padding: 0.5rem 0.8rem; border-radius: 6px; }
.team-power { font-size: 1.15rem; }
.team-head { display: flex; align-items: center; gap: 1.4rem; flex-wrap: wrap; }
.team-head .section-title { border-bottom: none; margin-bottom: 0.2rem; }

.designer { display: grid; grid-template-columns: minmax(320px, 420px) 1fr; gap: 2rem; align-items: start; }
.designer-preview .jersey { width: 100%; max-width: 380px; height: auto; }
.designer-preview {
  position: sticky;
  top: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7rem;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(0, 0, 0, 0.08)),
    repeating-linear-gradient(90deg, var(--grass) 0 40px, var(--grass-dark) 40px 80px);
  padding: 1.4rem 1rem 1rem;
  box-shadow: 4px 4px 0 rgba(22, 21, 15, 0.15);
}
.designer-preview .jersey { filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.3)); }
.designer-caption { font-size: 0.95rem; font-weight: 600; color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45); text-align: center; margin: 0; }
.designer-controls { display: flex; flex-direction: column; gap: 0.9rem; }

.style-picker { border: 2px solid var(--ink); border-radius: 8px; background: #fffdf6; padding: 0.7rem 0.9rem 0.9rem; display: flex; gap: 0.7rem; flex-wrap: wrap; }
.style-picker legend { font-family: var(--display); font-weight: 700; text-transform: uppercase; font-size: 0.95rem; padding: 0 0.3rem; }
.style-option {
  display: flex !important;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem !important;
  border: 2px solid transparent;
  border-radius: 8px;
  padding: 0.5rem 0.8rem 0.4rem;
  cursor: pointer;
  text-align: center;
}
.style-option input { position: absolute; opacity: 0; pointer-events: none; }
.style-option:has(input:checked) { border-color: var(--ink); background: rgba(78, 147, 70, 0.12); box-shadow: 2px 2px 0 rgba(22, 21, 15, 0.2); }
.style-option:has(input:focus-visible) { outline: 3px solid var(--amber); outline-offset: 1px; }
.style-name { font-family: var(--display); font-weight: 700; text-transform: uppercase; font-size: 0.9rem; }
.style-hint { font-family: var(--body); font-weight: 600; text-transform: none; font-size: 0.85rem; color: var(--pitch-line); }
#secondary-label.is-disabled { opacity: 0.4; }
.pill-picker { gap: 0.5rem; }
.pill-option {
  display: inline-flex !important;
  flex-direction: row;
  align-items: center;
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 0.25rem 0.9rem;
  cursor: pointer;
  font-family: var(--display);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.9rem;
  background: #fffdf6;
}
.pill-option input { position: absolute; opacity: 0; pointer-events: none; }
.pill-option:has(input:checked) { background: var(--ink); color: var(--chalk); box-shadow: 2px 2px 0 rgba(22, 21, 15, 0.2); }
.pill-option:has(input:focus-visible) { outline: 3px solid var(--amber); outline-offset: 1px; }
.squad-fieldset { flex-direction: column; align-items: stretch; }
.squad-hint { font-family: var(--body); font-weight: 600; text-transform: none; font-size: 0.92rem; color: var(--pitch-line); margin: 0 0 0.2rem; }
.player-row { display: flex; align-items: center; gap: 0.6rem; }
.player-pos {
  font-family: var(--varsity);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--pitch-line);
  flex: 0 0 130px;
}
.player-row input { flex: 1; min-width: 0; }
.player-row .jersey { flex-shrink: 0; }
.squad-line { margin: 0.3rem 0 0; font-size: 0.85rem; }
.squad-p {
  font-family: var(--varsity);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  background: var(--ink);
  color: var(--chalk);
  border-radius: 3px;
  padding: 0.1rem 0.4rem;
  margin-right: 0.35rem;
  white-space: nowrap;
  display: inline-block;
  margin-bottom: 0.25rem;
}
.match-log .log-team { font-weight: 400; opacity: 0.7; }

/* ---- matchday arena ---- */
.arena-status { font-family: var(--display); font-weight: 700; text-transform: uppercase; font-size: 1.05rem; letter-spacing: 0.03em; }
.live-dot {
  display: inline-block;
  width: 0.6em; height: 0.6em;
  border-radius: 50%;
  background: #c81e1e;
  animation: live-pulse 1.2s ease-in-out infinite;
  vertical-align: 0.08em;
}
@keyframes live-pulse { 50% { opacity: 0.35; } }
.arena-viewer {
  border: 3px solid var(--ink);
  border-radius: 8px;
  overflow: hidden;
  background: #3e8047;
  box-shadow: 5px 5px 0 rgba(22, 21, 15, 0.2);
  margin-bottom: 1rem;
}
.arena-viewer canvas { display: block; width: 100%; height: auto; }
.viewer-hud {
  background: var(--ink);
  color: var(--chalk);
  font-family: var(--display);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.5rem 0.9rem 0.4rem;
  text-align: center;
}
.hud-clock {
  font-family: var(--varsity);
  font-size: 0.8rem;
  color: var(--amber);
  margin-bottom: 0.25rem;
}
/* Equal 1fr name columns either side of fixed-width logos + score mean the score's
   dash always sits at the exact centre — the pitch's halfway line. */
.hud-score {
  display: grid;
  grid-template-columns: 1fr auto auto auto 1fr;
  align-items: center;
  gap: 0.9rem;
  font-size: 1.9rem;
  line-height: 1.1;
}
.hud-team {
  min-width: 0;
  justify-self: start;
  text-align: left;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2; /* long names wrap to at most two lines */
}
.hud-team-a { justify-self: end; text-align: right; }
.hud-team-long { font-size: 1.25rem; }
a.hud-team { color: inherit; text-decoration: none; }
a.hud-team:hover { text-decoration: underline; }
.hud-num {
  font-family: var(--varsity);
  font-size: 1.5rem;
  background: rgba(255, 253, 246, 0.12);
  border-radius: 6px;
  padding: 0.1rem 0.7rem;
  white-space: nowrap;
}
.hud-logo {
  width: 46px;
  height: 46px;
  background: #fffdf6;
  border-radius: 8px;
  padding: 4px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.hud-logo img { width: 100%; height: 100%; object-fit: contain; border-radius: 5px; }
.hud-logo-none { background: var(--chalk); opacity: 0.4; }
.hud-flash {
  font-size: 1rem;
  margin-top: 0.3rem;
  color: var(--amber);
  animation: live-pulse 1s ease-in-out infinite;
  white-space: nowrap; /* one line always — reserved height never changes */
  overflow: hidden;
  text-overflow: ellipsis;
}
.hud-flash-ft { color: var(--chalk); animation: none; }

.viewer-next {
  background: var(--ink);
  color: var(--amber);
  font-family: var(--varsity);
  font-size: 1.25rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: center;
  padding: 0.55rem 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---- arena layout: fixtures | pitch | match log ---- */
.arena { max-width: 1360px; }
.arena-panels {
  display: grid;
  grid-template-areas: 'fixtures viewer log';
  grid-template-columns: 240px minmax(0, 1fr) 240px;
  gap: 1rem;
  /* items stretch: the viewer sets the row height, panels scroll inside it */
}
.fixtures { grid-area: fixtures; }
.arena-panels .arena-viewer { grid-area: viewer; margin-bottom: 0; }
.match-log { grid-area: log; }
.match-log {
  background: #fffdf6;
  border: 2px solid var(--ink);
  border-radius: 8px;
  box-shadow: 4px 4px 0 rgba(22, 21, 15, 0.15);
  padding: 0.7rem 0.9rem;
  overflow-y: auto;
  /* height 0 + min-height 100%: never contributes to the row height (so a new log
     entry can't grow the page), always fills exactly the pitch column's height */
  height: 0;
  min-height: 100%;
}
.log-title {
  font-family: var(--varsity);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--pitch-line);
  margin: 0 0 0.5rem;
}
.match-log ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.45rem; }
.match-log li {
  font-size: 0.85rem;
  line-height: 1.3;
  border-bottom: 1px dashed rgba(22, 21, 15, 0.15);
  padding-bottom: 0.4rem;
}
.match-log li.log-goal { color: var(--pitch-line); }
.log-min {
  font-family: var(--varsity);
  font-size: 0.62rem;
  color: var(--amber);
  background: var(--ink);
  border-radius: 3px;
  padding: 0.05rem 0.3rem;
  margin-right: 0.45rem;
}
@media (max-width: 1020px) {
  .arena-panels { grid-template-areas: 'viewer viewer' 'fixtures log'; grid-template-columns: 1fr 1fr; }
  /* stacked below the pitch there's no row to stretch to — fix the height instead */
  .fixtures, .match-log { height: 300px; min-height: 0; }
}
@media (max-width: 640px) {
  .arena-panels { grid-template-areas: 'viewer' 'fixtures' 'log'; grid-template-columns: 1fr; }
  .hud-score { font-size: 1.25rem; gap: 0.6rem; }
  .hud-team-long { font-size: 0.95rem; }
  .hud-logo { width: 32px; height: 32px; }
}
/* ---- fixtures panel ---- */
.fixtures {
  background: #fffdf6;
  border: 2px solid var(--ink);
  border-radius: 8px;
  box-shadow: 4px 4px 0 rgba(22, 21, 15, 0.15);
  padding: 0.7rem 0.8rem;
  overflow-y: auto;
  height: 0;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.fixtures .arena-status { font-size: 0.7rem; margin: 0; color: var(--pitch-line); }
.round-tabs { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.round-tab {
  font-family: var(--varsity);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 2px solid var(--ink);
  border-radius: 4px;
  background: var(--chalk);
  color: var(--ink);
  padding: 0.2rem 0.5rem;
  cursor: pointer;
}
.round-tab.active { background: var(--ink); color: var(--amber); }
.round-tab:focus-visible { outline: 3px solid var(--amber); outline-offset: 1px; }
.match-list { display: flex; flex-direction: column; gap: 0.45rem; }
.match-row {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  border: 2px solid var(--ink);
  border-radius: 6px;
  background: var(--chalk);
  padding: 0.35rem 2.6rem 0.35rem 0.5rem; /* right gutter keeps LIVE/FT badge clear of the scores */
  font-family: var(--display);
  font-weight: 700;
  font-size: 0.95rem;
  text-transform: uppercase;
  text-align: left;
  cursor: pointer;
  width: 100%;
}
.match-row.disabled { cursor: default; opacity: 0.55; }
.chip-logo {
  width: 19px;
  height: 19px;
  background: #fffdf6;
  border: 1.5px solid var(--ink);
  border-radius: 5px;
  padding: 1px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.chip-logo img { width: 100%; height: 100%; object-fit: contain; border-radius: 3px; }
.match-row.watching { background: rgba(78, 147, 70, 0.18); box-shadow: 2px 2px 0 rgba(22, 21, 15, 0.25); }
.match-row .mr-team { display: flex; align-items: center; gap: 0.4rem; min-width: 0; }
.match-row .mr-name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.match-row .mr-s { font-family: var(--varsity); font-size: 0.72rem; }
.match-row .mr-ft, .match-row .mr-livebadge {
  position: absolute;
  top: 0.3rem;
  right: 0.4rem;
  font-family: var(--varsity);
  font-size: 0.5rem;
}
.match-row .mr-ft { color: var(--pitch-line); }
.match-row .mr-team.mr-winner {
  background: rgba(78, 147, 70, 0.28);
  border-radius: 4px;
  padding: 0.05rem 0.3rem;
  margin: 0 -0.3rem;
  color: var(--pitch-line);
}
.match-row .mr-team.mr-loser { opacity: 0.5; }
.match-row .mr-bye-note { font-family: var(--body); font-weight: 400; font-size: 0.7rem; text-transform: none; color: var(--pitch-line); }
.match-row .mr-livebadge { color: #c81e1e; animation: live-pulse 1.2s ease-in-out infinite; }
.match-row-bye { opacity: 0.6; }
.chip-tbd { background: repeating-linear-gradient(45deg, #ccc 0 3px, #eee 3px 6px); }
.team-name.tbd { font-weight: 600; font-style: italic; opacity: 0.6; text-transform: none; }
.form-notice { background: var(--navy); color: var(--chalk); padding: 0.5rem 0.8rem; border-radius: 6px; }

/* ---- footer ---- */
.footer {
  margin-top: 3rem;
  border-top: 3px solid var(--ink);
  padding: 1.2rem 1.4rem 2rem;
  font-size: 0.85rem;
  color: rgba(22, 21, 15, 0.7);
  text-align: center;
}
.footer-credit {
  font-family: var(--varsity);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-top: 0.9rem;
}
.footer-credit a { color: var(--pitch-line); }

@media (max-width: 760px) {
  .designer { grid-template-columns: 1fr; }
  .designer-preview { position: static; }
}
@media (max-width: 640px) {
  /* Not sticky on phones — the bar is too tall to pin. Small logo in the top-left
     corner, countdown centered, shortcuts row underneath. */
  .topbar {
    position: static;
    grid-template-columns: 1fr auto 1fr;
    grid-template-areas:
      'brand clock .'
      'right right right';
    gap: 0.8rem 0.5rem;
    padding: 0.8rem 1rem;
  }
  .topbar-brand { grid-area: brand; align-self: start; justify-self: start; }
  .wordmark-img { height: 56px; }
  .clock { grid-area: clock; justify-self: center; }
  .clock-label { font-size: 1.1rem; margin-bottom: 0.15rem; }
  .clock-time { font-size: 2rem; padding: 0.15rem 0.6rem; }
  .clock-local { font-size: 0.85rem; }
  .topbar-right {
    grid-area: right;
    justify-self: stretch;
    flex-direction: column;
    align-items: center;
    gap: 0.7rem;
  }
  .topnav { flex-wrap: wrap; justify-content: center; gap: 0.5rem 1.1rem; }
  .section { scroll-margin-top: 16px; } /* no sticky bar to clear on phones */
  .color-row { flex-direction: column; gap: 0.9rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .pennant { transition: none; }
}
