/* Eight Second Goal — a night match: the kick-off clock, split times for navigation, the referee's notebook and his
   cards, the coach's clipboard, a tactics board, the game, a running-track record board, and full time in the centre
   circle. Fonts: Kanit (display and text), Architects Daughter (the referee's handwriting). */
@font-face { font-family: "Kanit"; src: url("../assets/fonts/Kanit-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Kanit"; src: url("../assets/fonts/Kanit-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Kanit"; src: url("../assets/fonts/Kanit-800i.woff2") format("woff2"); font-weight: 800; font-style: italic; font-display: swap; }
@font-face { font-family: "Kanit"; src: url("../assets/fonts/Kanit-900i.woff2") format("woff2"); font-weight: 900; font-style: italic; font-display: swap; }
@font-face { font-family: "Architects Daughter"; src: url("../assets/fonts/Architects-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }

:root {
  --night: #0D2617; --night2: #12331F; --pitch: #1E8A4A; --pitch2: #22964F; --chalk: #F7F7F2; --yellow: #FFD200; --red: #E3262E;
  --ink: #111111; --paper: #FBF8EE; --rule: #BCD3E6; --blue: #2F6FD6; --grey: #5A6158; --track: #C2412D;
  --sans: "Kanit", system-ui, -apple-system, "Segoe UI", sans-serif; --hand: "Architects Daughter", "Comic Sans MS", cursive;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--night); color: var(--chalk); font: 400 18px/1.55 var(--sans); }
a { color: var(--yellow); }
img { max-width: 100%; }
[hidden] { display: none !important; }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }
.whistle-btn { font: italic 800 18px var(--sans); background: var(--yellow); color: var(--ink); border: 3px solid var(--ink); border-radius: 999px; padding: 8px 22px; cursor: pointer; box-shadow: 0 4px 0 var(--ink); text-transform: uppercase; letter-spacing: .02em; }
.whistle-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.whistle-btn.ghost { background: var(--chalk); }
.whistle-btn.big { font-size: 22px; padding: 10px 30px; }
.sec-h { display: flex; align-items: baseline; gap: 18px; flex-wrap: wrap; margin-bottom: 18px; }
.sec-h h2 { margin: 0; font: italic 900 clamp(40px, 5.5vw, 72px)/.95 var(--sans); text-transform: uppercase; letter-spacing: -.01em; }
.back { margin-left: auto; font-weight: 600; font-size: 15px; color: var(--chalk); text-decoration-color: var(--yellow); text-decoration-thickness: 3px; }
.lede { max-width: 70ch; margin: 0 0 24px; font-size: 19px; color: #DDE7DF; }
section { padding: 84px 28px 40px; max-width: 1260px; margin: 0 auto; }
section > * { min-width: 0; }

/* ---------------------------------------------------------------- 1. the whistle */
.whistle { position: relative; overflow: hidden; background: repeating-linear-gradient(90deg, var(--night) 0 120px, var(--night2) 120px 240px); border-bottom: 6px solid var(--yellow); }
.whistle::before { content: ""; position: absolute; left: 50%; top: 50%; width: 640px; height: 640px; margin: -320px 0 0 -320px; border: 4px solid rgba(247,247,242,.12); border-radius: 50%; }
.whistle::after { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 4px; margin-left: -2px; background: rgba(247,247,242,.12); }
.wh-in { position: relative; z-index: 1; max-width: 1260px; margin: 0 auto; padding: 56px 28px 34px; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 30px; align-items: center; }
.wh-k { margin: 0 0 8px; font: 600 15px var(--sans); letter-spacing: .2em; text-transform: uppercase; color: var(--yellow); }
.whistle h1 { margin: 0; font: italic 900 clamp(64px, 10vw, 150px)/.86 var(--sans); text-transform: uppercase; letter-spacing: -.02em; }
.whistle h1 span { display: block; }
.h-eight { color: var(--yellow); }
.h-sec { -webkit-text-stroke: 3px var(--chalk); color: transparent; }
.wh-digits { margin: 18px 0 0; }
.wh-digits span { display: inline-block; font: italic 800 clamp(40px, 5vw, 64px)/1 var(--sans); background: var(--ink); color: var(--yellow); padding: 8px 22px 10px; border-radius: 14px; border: 3px solid var(--yellow); font-variant-numeric: tabular-nums; min-width: 6.4ch; }
.wh-sub { max-width: 46ch; font-size: 20px; margin: 18px 0 0; color: #DDE7DF; }
.wh-sub b { color: var(--yellow); }
.wh-art { position: relative; aspect-ratio: 1 / 1.05; max-width: 520px; justify-self: center; width: 100%; }
.sweep { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.sw-bg { fill: none; stroke: rgba(247,247,242,.14); stroke-width: 10; }
.sw-run { fill: none; stroke: var(--yellow); stroke-width: 10; stroke-linecap: round; }
.tick-hero { position: absolute; left: 9%; top: 6%; width: 84%; filter: drop-shadow(0 18px 18px rgba(0,0,0,.35)); }
.tick-hero svg { display: block; width: 100%; height: auto; }
.laps { position: relative; z-index: 1; max-width: 1260px; margin: 0 auto; padding: 0 28px 34px; }
.laps-h { display: flex; justify-content: space-between; margin: 0; font: 600 13px var(--sans); letter-spacing: .2em; text-transform: uppercase; color: #9FB8A6; border-bottom: 2px solid rgba(247,247,242,.25); padding-bottom: 6px; }
.laps ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); counter-reset: lap; }
.laps li { counter-increment: lap; border-bottom: 2px solid rgba(247,247,242,.25); }
.laps a { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0 10px; padding: 12px 10px 12px 0; text-decoration: none; color: var(--chalk); }
.laps a::before { content: counter(lap, decimal-leading-zero); font: 600 13px var(--sans); color: #9FB8A6; grid-row: 1 / span 2; padding-top: 6px; }
.laps a:hover .lp-n { color: var(--yellow); }
.lp-t { font: italic 800 26px/1 var(--sans); color: var(--yellow); font-variant-numeric: tabular-nums; }
.lp-n { font-size: 16px; font-weight: 600; }

/* ---------------------------------------------------------------- 2. the notebook, the cards, the clipboard */
.book { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); background: var(--paper); color: var(--ink); border-radius: 10px; box-shadow: 0 24px 50px rgba(0,0,0,.35); position: relative; }
.book::after { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 30px; margin-left: -15px; background: linear-gradient(90deg, transparent, rgba(0,0,0,.12) 45%, rgba(0,0,0,.18) 50%, rgba(0,0,0,.12) 55%, transparent); pointer-events: none; }
.page { padding: 26px 34px 26px 58px; min-width: 0; background-image: linear-gradient(90deg, transparent 40px, rgba(227,38,46,.5) 40px, rgba(227,38,46,.5) 42px, transparent 42px), repeating-linear-gradient(transparent 0 33px, var(--rule) 33px 35px); background-position: 0 12px; }
.hand { font: 400 22px/35px var(--hand); margin: 0; }
.hand.big { font-size: 30px; color: var(--blue); }
.hand.small { font-size: 17px; color: var(--grey); }
.ca { display: block; font: 400 20px/35px var(--hand); color: var(--blue); word-break: break-all; }
.ca-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; min-height: 70px; }
.ok { font: 400 19px var(--hand); color: var(--pitch); }
.lines { list-style: none; margin: 0; padding: 0; }
.lines li { display: flex; justify-content: space-between; gap: 14px; font: 400 21px/35px var(--hand); }
.lines b { font-weight: 400; color: var(--blue); }
.lines b sub { font-size: .6em; }
.lines b.up { color: var(--pitch); } .lines b.down { color: var(--red); }
.cards { display: flex; flex-wrap: wrap; gap: 22px; justify-content: center; margin: 34px 0 10px; }
.rcard { width: 150px; height: 206px; border-radius: 12px; border: 3px solid var(--ink); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-decoration: none; color: var(--ink); font: italic 800 20px var(--sans); box-shadow: 0 10px 0 rgba(0,0,0,.3); transition: transform .2s; }
.rcard:nth-child(1) { transform: rotate(-6deg); } .rcard:nth-child(2) { transform: rotate(3deg); } .rcard:nth-child(3) { transform: rotate(-2deg); } .rcard:nth-child(4) { transform: rotate(5deg); }
.rcard:hover { transform: translateY(-10px) rotate(0); }
.rcard.green { background: #3DBE6A; } .rcard.yellow { background: var(--yellow); } .rcard.red { background: var(--red); color: #fff; } .rcard.white { background: var(--chalk); }
.rcard img { width: 54px; height: 54px; border-radius: 12px; background: #fff; padding: 4px; border: 2px solid var(--ink); object-fit: contain; }
.rcard small { font: 600 13px var(--sans); text-transform: uppercase; letter-spacing: .14em; opacity: .8; }
.clipboard { margin: 40px auto 0; max-width: 1060px; position: relative; padding-top: 26px; }
.clip { position: absolute; left: 50%; top: 0; width: 220px; height: 58px; margin-left: -110px; background: linear-gradient(#D7DCE0, #9AA3AA); border: 3px solid #4C555C; border-radius: 14px 14px 6px 6px; z-index: 2; }
.clip::after { content: ""; position: absolute; left: 50%; top: 10px; width: 60px; height: 16px; margin-left: -30px; border-radius: 8px; background: #4C555C; }
.cb-board { background: #9A6B3E; background-image: repeating-linear-gradient(170deg, rgba(0,0,0,.05) 0 3px, transparent 3px 9px); border-radius: 22px; padding: 46px 22px 18px; border: 3px solid #5E3D1F; }
.cb-frame { position: relative; background: #fff; border-radius: 6px; overflow: hidden; height: 520px; box-shadow: 0 4px 0 rgba(0,0,0,.25); }
.cb-frame iframe { width: 100%; height: 100%; border: 0; display: block; }
.cb-wait { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: var(--paper); color: var(--grey); font: 400 22px var(--hand); transition: opacity .4s; }
.cb-wait.off { opacity: 0; pointer-events: none; }
.clipboard figcaption { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; color: #FFF6E6; font-size: 16px; margin-top: 12px; }
.clipboard figcaption a { color: var(--yellow); font-weight: 600; }

/* ---------------------------------------------------------------- 3. the tactics board */
.rp-wrap { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, .5fr); gap: 26px; align-items: center; }
#tac { width: 100%; height: auto; display: block; border-radius: 16px; border: 6px solid #0A1D11; box-shadow: 0 18px 40px rgba(0,0,0,.35); }
.rp-side { display: flex; flex-direction: column; gap: 14px; }
.rp-clock { margin: 0; }
.rp-clock span { font: italic 800 52px/1 var(--sans); color: var(--yellow); font-variant-numeric: tabular-nums; }
.rp-cap { margin: 0; min-height: 3.2em; font-size: 20px; }
.rp-scrub input { width: 100%; accent-color: var(--yellow); }
.rp-note { margin: 0; font-size: 14px; color: #9FB8A6; }

/* ---------------------------------------------------------------- 4. the game */
.game { background: #0A1D11; border-radius: 22px; padding: 18px; border: 3px solid #29513A; }
.g-top { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-bottom: 12px; }
.g-clock { margin: 0; background: var(--ink); border: 3px solid var(--yellow); border-radius: 14px; padding: 4px 16px 6px; display: flex; align-items: baseline; gap: 8px; }
.g-clock span { font: italic 900 46px/1 var(--sans); color: var(--yellow); font-variant-numeric: tabular-nums; min-width: 2.6ch; text-align: right; }
.g-clock span.rec { color: #7CFF9E; }
.g-clock small { font-size: 14px; color: #9FB8A6; }
.g-msg { margin: 0; flex: 1 1 260px; font-size: 19px; font-weight: 600; min-height: 1.6em; }
.g-lvl { display: inline-flex; border: 2px solid var(--chalk); border-radius: 999px; overflow: hidden; }
.g-lvl button { font: 600 15px var(--sans); background: transparent; color: var(--chalk); border: 0; padding: 6px 14px; cursor: pointer; }
.g-lvl button[aria-pressed=true] { background: var(--chalk); color: var(--ink); }
#pitch { width: 100%; height: auto; display: block; border-radius: 10px; touch-action: none; border: 4px solid #fff; background: var(--pitch); }
.g-bot { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-top: 14px; }
.g-help { margin: 0; font-size: 15px; color: #9FB8A6; flex: 1 1 260px; }
.g-stats { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 18px; margin-top: 16px; }
.g-stats dl { margin: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.g-stats dl div { background: var(--night2); border-radius: 12px; padding: 8px 12px; }
.g-stats dt { font-size: 13px; color: #9FB8A6; text-transform: uppercase; letter-spacing: .1em; }
.g-stats dd { margin: 0; font: italic 800 26px var(--sans); color: var(--yellow); }
.g-log { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.g-log li { background: var(--night2); border-radius: 12px; padding: 6px 12px; display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 8px; font-size: 14px; border-left: 5px solid #57705F; }
.g-log li.goal { border-left-color: var(--yellow); }
.g-log li b { font: italic 800 20px var(--sans); grid-row: 1 / span 2; align-self: center; }
.g-log li small { color: #9FB8A6; }
.g-log li.none { display: block; color: #9FB8A6; border-left: 0; }

/* ---------------------------------------------------------------- 5. the record board */
.race { background: var(--track); border-radius: 18px; padding: 18px 22px 30px; position: relative; border: 4px solid #8E2A1C; }
.lane { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 16px; align-items: center; padding: 12px 0; border-bottom: 3px solid rgba(255,255,255,.75); }
.ln-l { margin: 0; display: grid; }
.ln-l b { font: italic 900 34px/1 var(--sans); }
.ln-l span { font-weight: 600; font-size: 16px; } .ln-l small { color: #FFD9CF; font-size: 14px; }
.lane.new .ln-l b { color: var(--yellow); }
.ln-track { position: relative; height: 26px; background: rgba(0,0,0,.18); border-radius: 13px; }
.ln-track i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 13px; background: var(--chalk); }
.lane.new .ln-track i { background: var(--yellow); }
.ln-flag { position: absolute; top: -8px; width: 4px; height: 42px; background: var(--ink); }
.ln-axis { position: relative; margin-left: 236px; height: 20px; font-size: 13px; color: #FFE6DE; }
.ln-axis span { position: absolute; transform: translateX(-50%); top: 6px; white-space: nowrap; }
.race-note { color: #DDE7DF; margin: 16px 0 0; max-width: 80ch; }
.slower { margin-top: 26px; background: var(--paper); color: var(--ink); border-radius: 12px; padding: 18px 26px; transform: rotate(-.6deg); max-width: 640px; }
.sl-h { margin: 0 0 6px; font: italic 800 22px var(--sans); text-transform: uppercase; }
.slower ul { margin: 0; padding-left: 22px; font: 400 20px/1.6 var(--hand); }

/* ---------------------------------------------------------------- 6. full time */
.fulltime { background: var(--pitch); background-image: repeating-linear-gradient(90deg, var(--pitch) 0 90px, var(--pitch2) 90px 180px); padding: 60px 20px 30px; margin-top: 70px; text-align: center; border-top: 6px solid var(--chalk); }
.ft-circle { width: min(520px, 100%); aspect-ratio: 1; margin: 0 auto; border: 5px solid var(--chalk); border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 30px; position: relative; }
.ft-score { margin: 0; font: italic 900 clamp(64px, 12vw, 108px)/1 var(--sans); }
.ft-score span { display: block; font-size: .3em; color: var(--yellow); letter-spacing: .2em; }
.ft-sub { margin: 0; font-size: 17px; max-width: 26ch; }
.ft-links { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 16px; justify-content: center; position: relative; z-index: 1; }
.ft-links a { color: var(--ink); background: var(--chalk); padding: 4px 14px; border-radius: 999px; font-weight: 600; text-decoration: none; }
.ft-links a:hover { background: var(--yellow); }
.ft-v { margin: 0; font-size: 14px; color: #E8F3EA; }
.ft-small { max-width: 820px; margin: 30px auto 0; font-size: 14px; color: #E2EFE5; }

/* ---------------------------------------------------------------- small screens */
@media (max-width: 1000px) {
  .wh-in { grid-template-columns: minmax(0, 1fr); padding-top: 40px; }
  .wh-art { max-width: 380px; }
  .laps ol { grid-template-columns: minmax(0, 1fr); }
  .book { grid-template-columns: minmax(0, 1fr); }
  .book::after { display: none; }
  .rp-wrap { grid-template-columns: minmax(0, 1fr); }
  .g-stats { grid-template-columns: minmax(0, 1fr); }
  .cb-frame { height: 440px; }
}
@media (max-width: 560px) {
  body { font-size: 17px; }
  section { padding: 64px 16px 30px; }
  .wh-in { padding: 34px 16px 24px; }
  .laps { padding: 0 16px 24px; }
  .page { padding: 18px 16px 18px 52px; }
  .hand.big { font-size: 25px; }
  .ca { font-size: 17px; }
  .rcard { width: 130px; height: 178px; }
  .lane { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .ln-axis { margin-left: 0; }
  .g-stats dl { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-log { grid-template-columns: minmax(0, 1fr); }
  .g-clock span { font-size: 38px; }
  .cb-board { padding: 40px 10px 14px; }
  .cb-frame { height: 400px; }
  .back { margin-left: 0; width: 100%; }
  .rp-clock span { font-size: 42px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .rcard, .cb-wait { transition: none; }
}
