/* ted4.ca — Richmond night-pitch. Vanilla CSS, no build step.
   Sections: tokens/reset · background · layout · masthead · believe · scoreboard ·
   banners · quote card · fixtures · footer · sky+sprites · confetti · toast ·
   reduced motion · responsive */

/* ── Tokens + reset ─────────────────────────────────────────── */
:root {
  --navy: #0a2a5e;
  --navy-deep: #071a3d;
  --night: #050f26;
  --panel: #06142e;
  --red: #d21f26;
  --red-dark: #8e1418;
  --gold: #f5c518;
  --cream: #fdf6e3;
  --pitch: #1e7a3c;
  --pitch-2: #23854a;
  --ink: #1c2230;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
a { color: var(--gold); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--gold); color: var(--navy-deep); }

/* ── Night-pitch background (pure gradients) ────────────────── */
body {
  font-family: var(--font);
  color: var(--cream);
  min-height: 100vh;
  min-height: 100svh;
  background-color: var(--night);
  background-image:
    /* touchline */
    linear-gradient(#ffffffd9, #ffffffd9),
    /* mowed pitch stripes */
    repeating-linear-gradient(90deg, var(--pitch) 0 72px, var(--pitch-2) 72px 144px),
    /* floodlight glows */
    radial-gradient(58vw 34vh at 10% -6%, rgba(255, 243, 196, 0.16), transparent 65%),
    radial-gradient(58vw 34vh at 90% -6%, rgba(255, 243, 196, 0.16), transparent 65%),
    /* night sky */
    linear-gradient(180deg, var(--night) 0%, var(--navy-deep) 45%, var(--navy) 100%);
  background-repeat: no-repeat, no-repeat, no-repeat, no-repeat, no-repeat;
  /* The grass band has a floor (8.5rem) so the touchline can never climb up
     into the schedule text on short viewports; the footer below reserves the
     whole band so no copy ever straddles the white line. */
  background-size: 100% 3px, 100% max(14vh, 8.5rem), auto, auto, 100%;
  background-position: 0 calc(100% - max(14vh, 8.5rem)), 0 100%, 0 0, 0 0, 0 0;
}

/* ── Layout ─────────────────────────────────────────────────── */
main {
  position: relative;
  z-index: 1;
  max-width: 46rem;
  margin: 0 auto;
  padding: clamp(1.2rem, 4vw, 2.5rem) clamp(1rem, 4vw, 2rem) 0;
  display: flex;
  flex-direction: column;
  gap: clamp(1.6rem, 4.5vw, 2.6rem);
  text-align: center;
}
section h2 { font-weight: 800; }

/* ── Masthead ───────────────────────────────────────────────── */
.kicker {
  text-transform: uppercase;
  letter-spacing: 0.34em;
  font-size: 0.72rem;
  font-weight: 700;
  color: rgba(245, 197, 24, 0.75);
}
h1 {
  margin-top: 0.4rem;
  font-size: clamp(2.4rem, 9vw, 4rem);
  font-weight: 900;
  color: #fff;
  text-shadow: 0 3px 0 rgba(0, 0, 0, 0.3);
  letter-spacing: 0.01em;
  cursor: default;
  -webkit-user-select: none;
  user-select: none;
}
.s4-badge {
  display: inline-block;
  background: var(--red);
  color: #fff;
  font-size: 0.45em;
  padding: 0.18em 0.6em 0.22em;
  border-radius: 999px;
  transform: rotate(-3deg) translateY(-0.35em);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  letter-spacing: 0.06em;
}

/* ── The BELIEVE sign ───────────────────────────────────────── */
.believe {
  position: relative;
  width: max-content;
  max-width: 94%;
  margin: 0.4rem auto 0;
  padding: 0.32em 0.75em 0.38em;
  background: linear-gradient(180deg, #ffd84d, var(--gold) 55%, #e3b30c);
  color: var(--navy-deep);
  border-radius: 4px;
  rotate: -1.5deg;
  transform-origin: 50% -10px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.45), inset 0 2px 0 rgba(255, 255, 255, 0.45), inset 0 -3px 0 rgba(0, 0, 0, 0.14);
  animation: sway 7s ease-in-out infinite alternate;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.believe span {
  display: inline-block;
  font-weight: 900;
  font-size: clamp(1.9rem, 7.5vw, 3.1rem);
  letter-spacing: 0.1em;
}
.believe span:nth-child(1) { transform: rotate(-3deg); }
.believe span:nth-child(2) { transform: rotate(2.5deg) translateY(1px); }
.believe span:nth-child(3) { transform: rotate(-1deg) translateY(-1.5px); }
.believe span:nth-child(4) { transform: rotate(1.5deg); }
.believe span:nth-child(5) { transform: rotate(-2deg) translateY(1.5px); }
.believe span:nth-child(6) { transform: rotate(2deg) translateY(-1px); }
.believe span:nth-child(7) { transform: rotate(-2.5deg) translateY(1px); }
.believe::before,
.believe::after {
  content: "";
  position: absolute;
  top: -9px;
  width: 52px;
  height: 17px;
  background: rgba(243, 246, 250, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.45);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
}
.believe::before { left: -16px; transform: rotate(-40deg); }
.believe::after { right: -16px; transform: rotate(40deg); }
@keyframes sway { from { rotate: -2.4deg; } to { rotate: -0.6deg; } }
.believe.wobble { animation: wobble 0.5s ease-in-out 1, sway 7s ease-in-out 0.5s infinite alternate; }
@keyframes wobble {
  25% { transform: rotate(2.5deg) scale(1.02); }
  60% { transform: rotate(-2.5deg); }
}
/* one corner of tape gives way… */
.believe.tape-off { animation: none; rotate: -6.5deg; transition: rotate 0.6s cubic-bezier(0.3, 1.8, 0.4, 1); }
.believe.tape-off::after { opacity: 0; transition: opacity 0.15s; }

/* ── Scoreboard ─────────────────────────────────────────────── */
.countdown-label {
  text-transform: uppercase;
  letter-spacing: 0.28em;
  font-size: clamp(0.85rem, 2.8vw, 1.05rem);
  color: rgba(253, 246, 227, 0.85);
  margin-bottom: 1rem;
}
.scoreboard {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.6rem;
}
.cell {
  background: var(--panel);
  border: 1px solid rgba(245, 197, 24, 0.28);
  border-radius: 12px;
  padding: 0.55em 0.15em 0.6em;
  box-shadow: inset 0 0 26px rgba(0, 0, 0, 0.55), 0 3px 12px rgba(0, 0, 0, 0.3);
}
.num {
  display: block;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: clamp(2rem, 8.5vw, 4.1rem);
  line-height: 1.05;
  color: var(--gold);
  text-shadow: 0 0 16px rgba(245, 197, 24, 0.4), 0 0 2px rgba(245, 197, 24, 0.9);
}
.num.pulse { animation: pulse 0.4s ease-out 1; }
@keyframes pulse { from { text-shadow: 0 0 30px rgba(245, 197, 24, 0.95), 0 0 6px #fff; } }
.unit {
  display: block;
  margin-top: 0.4em;
  text-transform: uppercase;
  letter-spacing: 0.24em;
  font-size: 0.66rem;
  color: rgba(253, 246, 227, 0.6);
}
.target-line {
  margin-top: 1.1rem;
  font-weight: 700;
  font-size: clamp(1rem, 3vw, 1.15rem);
  color: #fff;
}
.local-line {
  margin-top: 0.35rem;
  font-size: 0.9rem;
  color: rgba(253, 246, 227, 0.6);
}
.noscript {
  margin-top: 1.2rem;
  font-size: 1.05rem;
  line-height: 1.5;
}

/* ── Celebration banner + full-time card ───────────────────── */
.celebration-banner {
  margin-top: 1.4rem;
  background: linear-gradient(135deg, var(--red), #a3151b);
  border: 2px solid var(--gold);
  border-radius: 16px;
  padding: 1.15rem 1.3rem 1.3rem;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.5);
  animation: pop 0.55s cubic-bezier(0.2, 1.6, 0.4, 1) 1;
}
@keyframes pop { from { transform: scale(0.6); opacity: 0; } }
.banner-title {
  font-size: clamp(1.5rem, 5.5vw, 2.2rem);
  font-weight: 900;
  letter-spacing: 0.05em;
  color: #fff;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.35);
}
.banner-sub { margin-top: 0.4rem; color: rgba(255, 255, 255, 0.92); font-size: 1.02rem; }
.watch-btn {
  display: inline-block;
  margin-top: 0.9rem;
  background: var(--gold);
  color: var(--navy-deep);
  font-weight: 800;
  text-decoration: none;
  padding: 0.55em 1.2em;
  border-radius: 999px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
  transition: transform 0.15s ease;
}
.watch-btn:hover { transform: scale(1.05) rotate(-1deg); }
.fulltime-card {
  margin-top: 1.4rem;
  background: var(--panel);
  border: 2px dashed rgba(245, 197, 24, 0.55);
  border-radius: 16px;
  padding: 1.3rem 1.4rem;
  line-height: 1.55;
}
.ft-whistle {
  font-weight: 900;
  letter-spacing: 0.18em;
  font-size: 1.35rem;
  color: var(--gold);
  margin-bottom: 0.4rem;
}

/* ── Quote of the day ───────────────────────────────────────── */
.quote-card {
  position: relative;
  background: var(--cream);
  color: var(--ink);
  transform: rotate(0.6deg);
  border-radius: 8px 18px 10px 16px / 16px 8px 18px 8px;
  padding: 1.9rem 1.6rem 1.15rem;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.38);
  min-height: 9.5rem;
}
.quote-card::before {
  content: "\201C";
  position: absolute;
  top: -0.18em;
  left: 0.12em;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 5.2rem;
  line-height: 1;
  color: var(--red);
  opacity: 0.85;
}
.quote-card blockquote p {
  font-size: clamp(1.15rem, 3.4vw, 1.5rem);
  font-weight: 600;
  line-height: 1.45;
  text-wrap: balance;
}
.quote-card.quote--long blockquote p { font-size: clamp(1rem, 2.9vw, 1.2rem); }
.quote-card figcaption {
  margin-top: 0.9rem;
  text-align: right;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--red-dark);
}
.quote-card figcaption::before { content: "\2014\00A0"; }
.quote-where { font-weight: 500; color: rgba(28, 34, 48, 0.55); }

/* ── Match schedule ─────────────────────────────────────────── */
.schedule h2 {
  text-transform: uppercase;
  letter-spacing: 0.3em;
  font-size: 0.95rem;
  color: var(--gold);
  margin-bottom: 0.7rem;
}
.fixtures { list-style: none; text-align: left; }
.fixtures li {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.6rem;
  align-items: center;
  padding: 0.32rem 0.65rem;
  border-bottom: 1px dashed rgba(253, 246, 227, 0.18);
  break-inside: avoid;
}
.fixtures li:last-child { border-bottom: none; }
/* two compact columns once there's room — halves the schedule's height */
@media (min-width: 560px) {
  .fixtures { columns: 2; column-gap: 1.6rem; }
}
.fixtures .ep { font-family: var(--font-mono); font-weight: 700; color: var(--gold); }
.fixtures .when { color: rgba(253, 246, 227, 0.92); font-size: 0.88rem; }
.fixtures .chip {
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  padding: 0.3em 0.7em;
  border-radius: 999px;
  border: 1px solid rgba(253, 246, 227, 0.35);
  color: rgba(253, 246, 227, 0.55);
}
.fixtures li.done { opacity: 0.45; }
.fixtures li.done .chip { color: var(--gold); border-color: rgba(245, 197, 24, 0.6); }
.fixtures li.next {
  background: rgba(210, 31, 38, 0.14);
  border: 1px solid rgba(210, 31, 38, 0.55);
  border-radius: 10px;
  box-shadow: 0 0 16px rgba(210, 31, 38, 0.3);
}
.fixtures li.next .chip { background: var(--red); border-color: var(--red); color: #fff; }
.schedule-note {
  margin-top: 0.9rem;
  font-size: 0.78rem;
  color: rgba(253, 246, 227, 0.45);
}

/* ── Footer ─────────────────────────────────────────────────── */
footer {
  /* Owns the grass strip: taller than the band, text pushed to the bottom so
     it sits ON the pitch, clear of the touchline above. */
  min-height: max(17vh, 10.5rem);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0.6rem 0 2.2rem;
  font-size: 0.8rem;
  line-height: 1.6;
  color: rgba(253, 246, 227, 0.85);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}
.hint { margin-top: 0.4rem; font-style: italic; color: rgba(245, 197, 24, 0.7); }

/* ── Sky + sprites (whimsy layer, ABOVE content) ────────────────
   Sprites fly over the page so balls are kickable anywhere. The layer
   and every non-ball sprite are click-transparent; only balls catch
   the pointer — and a ball briefly covering a link is part of the game. */
.sky {
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: 2;
  pointer-events: none;
}
.sprite {
  position: absolute;
  top: var(--top, 30vh);
  left: 0;
  pointer-events: none;
  will-change: transform;
  animation: traverse var(--dur, 20s) linear var(--delay, 0s) 1 both;
}
.sprite--reverse { animation-name: traverse-rev; }
.sprite-inner { display: block; width: calc(46px * var(--scale, 1)); animation: bob var(--bob, 3.5s) ease-in-out infinite alternate; }
.sprite-inner svg { display: block; width: 100%; height: auto; filter: drop-shadow(0 5px 7px rgba(0, 0, 0, 0.35)); }
.sprite--ball { pointer-events: auto; cursor: pointer; padding: 12px; margin: -12px; -webkit-tap-highlight-color: transparent; }
.sprite--ball .sprite-inner svg { animation: spin var(--spin, 4s) linear infinite; }
.sprite--dart .sprite-inner { animation: none; }
.sprite--dog .sprite-inner { width: auto; font-size: calc(2.3rem * var(--scale, 1)); }
.sprite.kicked { animation: kick 0.7s cubic-bezier(0.25, 0.8, 0.4, 1) 1 both; pointer-events: none; }
@keyframes traverse { from { transform: translate3d(-20vw, 0, 0); } to { transform: translate3d(112vw, 0, 0); } }
@keyframes traverse-rev { from { transform: translate3d(112vw, 0, 0); } to { transform: translate3d(-20vw, 0, 0); } }
@keyframes bob { from { transform: translateY(-12px); } to { transform: translateY(12px); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes kick { to { transform: translate3d(var(--kickx, 38vw), -125vh, 0) rotate(900deg); } }

/* ── Confetti + mustache rain ───────────────────────────────── */
.confetti-layer {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 10;
}
.confetti-piece {
  position: absolute;
  top: -7vh;
  left: var(--x, 50vw);
  width: 9px;
  height: 15px;
  border-radius: 2px;
  background: var(--c, var(--gold));
  opacity: 0.95;
  animation: fall var(--dur, 4.5s) linear var(--delay, 0s) 1 both;
}
.confetti-piece.round { height: 9px; border-radius: 50%; }
.confetti-piece.stache { width: auto; height: auto; background: none; }
.confetti-piece.stache svg { width: 40px; height: auto; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.3)); }
@keyframes fall { to { transform: translate3d(var(--drift, 0px), 118vh, 0) rotate(var(--rot, 540deg)); } }

/* ── Toast ──────────────────────────────────────────────────── */
.toast {
  position: fixed;
  left: 50%;
  bottom: 1.4rem;
  transform: translateX(-50%) translateY(24px);
  z-index: 20;
  max-width: min(92vw, 34rem);
  background: var(--panel);
  color: var(--cream);
  border: 1px solid rgba(245, 197, 24, 0.55);
  border-radius: 999px;
  padding: 0.6em 1.25em;
  font-weight: 600;
  font-size: 0.95rem;
  text-align: center;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── Reduced motion: countdown still ticks, whimsy retires ──── */
@media (prefers-reduced-motion: reduce) {
  .sky, .confetti-layer, .hint { display: none; }
  .believe, .sprite, .sprite-inner, .sprite-inner svg, .confetti-piece, .num, .celebration-banner { animation: none !important; }
  .toast, .watch-btn { transition: none; }
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 430px) {
  .scoreboard { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fixtures li { gap: 0.55rem; padding: 0.5rem 0.5rem; }
}
@media (min-width: 700px) {
  .believe { margin-top: 0.8rem; }
}
