:root {
  --night: #0b2418;
  --turf: #14412a;
  --turf-2: #185033;
  --line: #2f6a4a;
  --chalk: #f4f1e6;
  --muted: #a9c2b3;
  --post: #f2c230;   /* goalpost yellow */
  --flag: #e5533d;
  --leather: #8a4b22;
  /* rarity tiers, common to rare */
  --t1: #f4f1e6;   /* white */
  --t2: #f2c230;   /* yellow */
  --t3: #4cc46a;   /* green */
  --t4: #3d6fe0;   /* dark blue, light enough to read on the field */
  --t5: #a26be8;   /* purple */
  --display: "Big Shoulders Display", "Oswald", "Arial Narrow", sans-serif;
  --body: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--night);
  /* faint yard lines down the whole page */
  background-image: repeating-linear-gradient(90deg, transparent 0 46px, rgba(244, 241, 230, 0.05) 46px 47px);
  color: var(--chalk);
  font: 17px/1.5 var(--body);
}

main { max-width: 560px; margin: 0 auto; padding: 24px 16px 40px; }

header { margin-bottom: 22px; border-bottom: 3px solid var(--chalk); padding-bottom: 12px; }

h1 {
  margin: 0;
  font: 800 3rem/1 var(--display);
  letter-spacing: 0.01em;
  text-transform: uppercase;
}
h1 span { color: var(--post); }

#tagline { margin: 6px 0 0; color: var(--muted); font-size: 0.8rem; letter-spacing: 0.1em; text-transform: uppercase; }

section { background: transparent; padding: 0; }

.lede { margin: 0 0 18px; color: var(--muted); }

button.primary {
  padding: 14px 22px;
  border: 0;
  border-radius: 4px;
  background: var(--post);
  color: #1c1a10;
  font: 800 1.2rem var(--display);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}
button.primary:focus-visible, input:focus-visible { outline: 3px solid var(--chalk); outline-offset: 2px; }

.meta { display: flex; justify-content: space-between; color: var(--muted); font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; }

h2 { margin: 10px 0 14px; font: 800 2rem/1.1 var(--display); text-transform: uppercase; text-wrap: balance; }

.clock { height: 8px; margin: 0 0 6px; border-radius: 4px; background: rgba(244, 241, 230, 0.1); overflow: hidden; }
#clock-bar { height: 100%; width: 100%; background: var(--t2); transition: width 0.1s linear; }
#clock-bar.low { background: var(--flag); }

/* the throwing scene */
.stage-wrap { position: relative; margin: 8px 0 14px; }
#stage { display: block; width: 100%; height: auto; overflow: hidden; }
.turf-a { fill: var(--turf); }
.turf-b { fill: var(--turf-2); }
.sideline { stroke: var(--chalk); stroke-width: 2; opacity: 0.7; }
.endzone { fill: var(--t5); opacity: 0.35; }
.goalline { stroke: var(--chalk); stroke-width: 3; }
.yardnums text { fill: var(--chalk); opacity: 0.35; font: 800 12px var(--display); text-anchor: middle; }
.post line { stroke: var(--post); stroke-width: 4; stroke-linecap: round; }
.shell { fill: var(--t4); }
.stripe { fill: none; stroke: var(--chalk); stroke-width: 2; }
.earhole { fill: #10200f; }
.mask { fill: none; stroke: #c9ccd1; stroke-width: 1.6; stroke-linecap: round; }
.jersey { fill: var(--t4); }   /* not green: it would vanish into the turf */
.pants { fill: var(--chalk); }
.d-shell, .d-jersey { fill: var(--flag); }   /* the other team's colours */
.ball { fill: var(--leather); }
.lace { stroke: var(--chalk); stroke-width: 1.4; stroke-linecap: round; }

#flash {
  position: absolute;
  left: 4%;
  top: 14%;
  font: 800 2.4rem/1 var(--display);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0;
  pointer-events: none;
}
#flash.show { animation: flash 1.1s ease-out forwards; }
@keyframes flash {
  0% { opacity: 0; transform: translateY(8px) scale(0.9); }
  20% { opacity: 1; transform: none; }
  80% { opacity: 1; }
  100% { opacity: 0; }
}

input {
  width: 100%;
  padding: 13px 14px;
  border: 2px solid var(--line);
  border-radius: 4px;
  background: var(--turf);
  color: var(--chalk);
  font: inherit;
}
#miss { margin: 8px 0 0; color: var(--flag); font-size: 0.92rem; }
#era.down { color: var(--flag); }
#named { margin: 4px 0 10px; color: var(--chalk); font-weight: 600; }

#options { list-style: none; margin: 8px 0 0; padding: 0; }
#options li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}
#options li:first-child { background: rgba(242, 194, 48, 0.12); border-radius: 4px; }
#options li:hover { background: rgba(244, 241, 230, 0.08); }
#options small { color: var(--muted); white-space: nowrap; }

/* tier ladder (start screen and result card) */
.ladder { list-style: none; margin: 14px 0; padding: 0; display: grid; gap: 6px; }
.ladder li {
  display: grid;
  grid-template-columns: 14px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(20, 65, 42, 0.6);
  font: 700 1.05rem var(--display);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.ladder i { width: 12px; height: 12px; border-radius: 50%; background: var(--c); }
.ladder b { color: var(--muted); font-weight: 700; }
.ladder li.on { background: var(--c); color: var(--ink); border-color: var(--c); }
.ladder li.on b { color: var(--ink); }

.label { margin: 0; color: var(--muted); font-size: 0.78rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }
#answer { margin: 4px 0 0; font: 800 2.4rem/1 var(--display); text-transform: uppercase; }
#points-line { margin: 6px 0 0; display: flex; align-items: baseline; gap: 12px; }
#points { font: 800 2.6rem/1 var(--display); color: var(--c, var(--chalk)); }
#tier-chip { border: 1px solid var(--c, var(--muted)); color: var(--c, var(--muted)); padding: 1px 8px; border-radius: 3px; font: 700 0.75rem var(--body); letter-spacing: 0.08em; text-transform: uppercase; }
#receipt { margin: 4px 0 0; font-variant-numeric: tabular-nums; }
#context { color: var(--muted); font-size: 0.92rem; margin: 12px 0 18px; }

.total { margin: 0; text-align: center; font: 800 4.4rem/1 var(--display); }
.total small { font-size: 1.3rem; color: var(--muted); margin-left: 6px; }
#grid { text-align: center; font-size: 1.6rem; letter-spacing: 0.1em; margin: 10px 0 18px; }
#share { display: block; margin: 0 auto; }

#recap { margin: 22px 0 0; padding-left: 22px; font-size: 0.92rem; }
#recap li { margin: 10px 0; color: var(--muted); }
#recap b { color: var(--chalk); }
#recap small { display: block; font-variant-numeric: tabular-nums; }

.note { text-align: center; color: var(--muted); font-size: 0.9rem; margin: 18px 0 0; }
#error { color: var(--flag); text-align: center; }

/* Phones: thumb-sized buttons, one-line suggestions, and a compact header while a round is on. */
@media (max-width: 600px) {
  main { padding-top: 16px; }
  button.primary { width: 100%; }
  h2 { font-size: 1.7rem; }
  body.playing header { margin-bottom: 12px; padding-bottom: 8px; }
  body.playing h1 { font-size: 1.9rem; }
  body.playing #tagline { display: none; }
  #options li { padding: 10px 12px; align-items: baseline; }
  #options li { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  #options small { font-size: 0.8rem; }
  #options li:nth-child(n + 6) { display: none; }
  #answer { font-size: 2rem; }
  body.typing footer { display: none; }
  body.typing .stage-wrap { margin: 4px 0 8px; }
  body.typing #options li { padding: 8px 12px; }
}

footer { margin-top: 26px; border-top: 1px solid var(--line); padding-top: 14px; color: var(--muted); font-size: 0.8rem; }
footer a { color: inherit; }
