/* styles.css — Dog Dash Draft. Mobile-first, dark stadium-night theme with a
   grass-green field track. All animation is CSS (translateX transitions + bob
   keyframe); prefers-reduced-motion turns motion off at the bottom. */

:root {
  --bg: #0b1210;
  --surface: #14201a;
  --surface-2: #1b2b22;
  --border: #2b4033;
  --text: #f2f7f0;
  --text-dim: #9db3a4;
  --text-faint: #6d8375;
  --accent: #ff6b2e;       /* game-day orange */
  --accent-hi: #ff8a55;
  --gold: #ffc53d;
  --grass: #1d5c31;
  --grass-dark: #17492a;
  --line: rgba(255, 255, 255, 0.28);
  --radius: 16px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background:
    radial-gradient(1200px 500px at 50% -10%, #1a2f22 0%, transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  min-height: 100%;
}

#app {
  max-width: 760px;
  margin: 0 auto;
  padding: 20px 16px 48px;
}

/* ---------- screens ---------- */
.screen { display: none; }
.screen.active { display: block; animation: screen-in 0.35s ease-out; }
@keyframes screen-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- buttons ---------- */
.btn {
  font: inherit;
  font-weight: 700;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 20px;
  min-height: 52px;            /* big party-thumb touch targets */
  cursor: pointer;
  transition: transform 0.1s ease, background 0.15s ease, border-color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.96); }
.btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #1a0d05;
}
.btn-primary:hover { background: var(--accent-hi); }

.btn-ghost { background: transparent; }
.btn-ghost:hover { background: var(--surface); }

.btn-huge {
  font-size: 1.6rem;
  padding: 20px 56px;
  min-height: 72px;
  background: var(--accent);
  border: none;
  color: #1a0d05;
  border-radius: 24px;
  box-shadow: 0 8px 30px rgba(255, 107, 46, 0.35);
  animation: pulse 1.8s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.045); }
}

/* ---------- landing ---------- */
#screen-landing.active {
  min-height: calc(100vh - 70px);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.landing-emoji { font-size: 4rem; }
.landing-title {
  font-size: clamp(2rem, 8vw, 3.4rem);
  line-height: 1.05;
  margin: 8px 0 0;
  letter-spacing: -0.02em;
}
.landing-title .accent { color: var(--accent); }
.landing-sub {
  margin: 6px 0 0;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  font-size: 0.85rem;
}
.tagline { color: var(--text-dim); margin: 18px auto 28px; max-width: 40ch; line-height: 1.5; }
.fine-print { color: var(--text-faint); font-size: 0.75rem; margin-top: 16px; }

/* ---------- setup steps ---------- */
.step-header { margin-bottom: 20px; }
.step-header h2 { margin: 2px 0 4px; font-size: 1.6rem; }
.step-label {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent);
}
.step-hint { color: var(--text-dim); margin: 0; font-size: 0.9rem; }

.stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin: 8px 0 20px;
}
.btn-step { font-size: 1.8rem; width: 64px; min-height: 64px; padding: 0; border-radius: 50%; }
.count-display {
  font-size: 3.2rem;
  font-weight: 800;
  min-width: 90px;
  text-align: center;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}

.count-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-bottom: 24px;
}
.count-grid .btn { min-height: 48px; padding: 8px; font-variant-numeric: tabular-nums; }
.count-grid .btn.selected {
  background: var(--accent);
  border-color: var(--accent);
  color: #1a0d05;
}

.nav-row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 8px; }
.nav-row .btn { flex: 1 1 auto; }
.nav-col { flex-direction: column; align-items: stretch; max-width: 420px; margin-left: auto; margin-right: auto; }

/* ---------- names step ---------- */
.names-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.name-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;          /* measurables line wraps below chip + input */
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
}
.name-row .measurables {
  flex: 1 0 100%;
  margin: 0;
  font-size: 0.72rem;
  color: var(--text-faint);
}
.name-row .dog-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 86px;
  gap: 2px;
}
.name-row .dog-chip .dog-face { font-size: 1.6rem; }
.name-row .dog-chip .dog-jersey {
  font-size: 0.62rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  color: #10130f;
  text-align: center;
  max-width: 96px;
  line-height: 1.25;
}
.name-row input {
  flex: 1;
  min-width: 0;
  font: inherit;
  font-weight: 600;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  min-height: 48px;
}
.name-row input:focus-visible { outline: 3px solid var(--accent); outline-offset: 1px; }
.name-row input.invalid { border-color: #ff5c5c; }
.error-msg { color: #ff8080; font-weight: 600; font-size: 0.9rem; }

.name-inputs {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.name-inputs .dog-input { font-size: 0.85rem; color: var(--text-dim); }
.jersey-dot-lg { width: 14px; height: 14px; border-radius: 50%; display: inline-block; }

/* ---------- race ---------- */
.race-header { text-align: center; margin-bottom: 10px; }
.race-header h2 { margin: 0; font-size: 1.3rem; }
.race-header .fine-print { margin-top: 2px; }

.leaderboard {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 6px 2px 10px;
  scrollbar-width: none;
}
.leaderboard::-webkit-scrollbar { display: none; }
.lb-chip {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 10px 4px 6px;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}
.lb-chip .lb-rank {
  background: var(--surface-2);
  border-radius: 999px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  font-variant-numeric: tabular-nums;
}
.lb-chip.first { border-color: var(--gold); }
.lb-chip.first .lb-rank { background: var(--gold); color: #1a1405; }

.track {
  border: 2px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--grass);
}
.lane {
  position: relative;
  height: 52px;
  /* yard lines every 10% + alternating turf stripes */
  background-image:
    repeating-linear-gradient(to right,
      transparent 0,
      transparent calc(10% - 1px),
      var(--line) calc(10% - 1px),
      var(--line) 10%),
    linear-gradient(var(--grass), var(--grass));
  border-bottom: 1px dashed rgba(255, 255, 255, 0.12);
}
.lane:nth-child(even) {
  background-image:
    repeating-linear-gradient(to right,
      transparent 0,
      transparent calc(10% - 1px),
      var(--line) calc(10% - 1px),
      var(--line) 10%),
    linear-gradient(var(--grass-dark), var(--grass-dark));
}
.lane:last-child { border-bottom: none; }

/* end zone: right 8% checkered strip */
.lane::after {
  content: '🏁';
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 9%;
  display: grid;
  place-items: center;
  font-size: 0.9rem;
  background:
    repeating-conic-gradient(rgba(255,255,255,0.22) 0% 25%, rgba(0,0,0,0.25) 0% 50%)
    0 0 / 12px 12px;
}

.dog {
  --flip: -1;               /* -1 = face right (emoji dogs face left natively) */
  position: absolute;
  left: 2px;
  top: 50%;
  margin-top: -19px;
  width: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  will-change: transform;
  transition: transform 0.12s linear;   /* smooths the 100ms engine ticks */
  z-index: 2;
}
.dog.face-left { --flip: 1; }           /* heading points left → flip back */
.dog .dog-event {
  position: absolute;
  top: -14px;
  font-size: 0.85rem;
  min-height: 1em;
}
.dog .dog-face { font-size: 1.7rem; transform: scaleX(var(--flip)); }
.dog.running .dog-face { animation: bob 0.28s ease-in-out infinite; }
.dog.stalled .dog-face { animation: none; opacity: 0.85; }
@keyframes bob {
  0%, 100% { transform: scaleX(var(--flip)) translateY(0); }
  50%      { transform: scaleX(var(--flip)) translateY(-4px) rotate(-3deg); }
}
.dog .dog-tag {
  font-size: 0.56rem;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 999px;
  color: #10130f;
  white-space: nowrap;
  max-width: 84px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- commentary ticker (broadcast lower-third under the field) ---------- */
.ticker-wrap {
  margin-top: -2px;                 /* butts directly against the field */
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: none;
  border-left: 4px solid var(--accent);
  border-radius: 0 0 var(--radius) var(--radius);
  padding: 8px 14px 10px;
  min-height: 118px;
}
.ticker-label {
  margin: 0 0 6px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  color: var(--accent);
}
.ticker p { margin: 4px 0; font-size: 0.9rem; line-height: 1.35; }
.ticker p:first-child {
  font-weight: 800;
  font-size: 1.18rem;
  line-height: 1.3;
  color: var(--gold);
  padding: 3px 8px;
  margin: 2px 0 6px -8px;
  border-radius: 8px;
  animation: ticker-pop 0.9s ease-out;
}
.ticker p:nth-child(2) { opacity: 0.6; }
.ticker p:nth-child(3) { opacity: 0.35; }
.ticker p:nth-child(n + 4) { display: none; }
@keyframes ticker-pop {
  0%   { opacity: 0; transform: translateX(-16px); background: rgba(255, 197, 61, 0.3); }
  25%  { opacity: 1; transform: none; background: rgba(255, 197, 61, 0.28); }
  100% { opacity: 1; transform: none; background: transparent; }
}

/* ---------- overlays ---------- */
.overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(5, 10, 7, 0.72);
  z-index: 50;
}
.overlay[hidden] { display: none; }
.countdown-num {
  font-size: clamp(5rem, 28vw, 9rem);
  font-weight: 900;
  color: var(--gold);
  text-shadow: 0 6px 40px rgba(255, 197, 61, 0.4);
  animation: count-pop 0.8s ease-out;
}
@keyframes count-pop {
  0%   { transform: scale(0.3); opacity: 0; }
  35%  { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}
.finish-card {
  background: var(--surface);
  border: 2px solid var(--gold);
  border-radius: 20px;
  padding: 28px 36px;
  animation: flashbulb 0.5s ease-out 2;
}
.finish-text { font-size: clamp(1.5rem, 7vw, 2.4rem); font-weight: 900; }
@keyframes flashbulb {
  0%   { box-shadow: 0 0 0 rgba(255,255,255,0); }
  40%  { box-shadow: 0 0 90px rgba(255,255,255,0.85); }
  100% { box-shadow: 0 0 0 rgba(255,255,255,0); }
}

/* ---------- results ---------- */
.results-list { list-style: none; margin: 10px 0 24px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.result-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  opacity: 0;
  animation: reveal 0.45s ease-out forwards;
  animation-delay: var(--delay, 0s);   /* staggered reveal */
}
.result-row.first {
  border-color: var(--gold);
  background: linear-gradient(90deg, rgba(255, 197, 61, 0.14), var(--surface) 60%);
}
@keyframes reveal {
  from { opacity: 0; transform: translateX(-24px) scale(0.97); }
  to   { opacity: 1; transform: none; }
}
.result-pick {
  font-size: 1.05rem;
  font-weight: 900;
  min-width: 44px;
  text-align: center;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}
.result-dog { font-size: 1.8rem; transform: scaleX(-1); }
.result-names { min-width: 0; }
.result-manager { font-weight: 800; margin: 0; }
.result-dogname { margin: 0; font-size: 0.8rem; color: var(--text-dim); }
.result-dogname .jersey-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 5px;
}

/* confetti burst */
.confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 40; }
.confetti span {
  position: absolute;
  top: 30%;
  left: 50%;
  font-size: 1.5rem;
  animation: confetti-fly 1.4s ease-out forwards;
  animation-delay: var(--delay, 0s);
  opacity: 0;
}
@keyframes confetti-fly {
  0%   { opacity: 0; transform: translate(0, 0) scale(0.4) rotate(0deg); }
  15%  { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(1.15) rotate(var(--rot)); }
}

a.btn {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.results-meta { text-align: center; margin: 0 0 6px; }

/* copy-button feedback */
#btn-copy.copied { background: #3ddb84; border-color: #3ddb84; }

/* ---------- combine branding ---------- */
.tm { font-size: 0.4em; vertical-align: super; }
.scout-cert {
  margin-top: 18px;
  font-size: 0.78rem;
  color: var(--text-dim);
  max-width: 42ch;
  margin-left: auto;
  margin-right: auto;
}
.scout-cert em { color: var(--text-faint); }
.scout-banner {
  background: var(--surface);
  border: 1px dashed var(--gold);
  border-radius: var(--radius);
  padding: 8px 12px;
  font-size: 0.82rem;
  color: var(--text-dim);
  margin-bottom: 8px;
}
.event-count {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--gold);
}
.disclaimer {
  margin-top: 40px;
  font-size: 0.66rem;
  line-height: 1.5;
  color: var(--text-faint);
  text-align: center;
  max-width: 52ch;
  margin-left: auto;
  margin-right: auto;
}

/* ---------- event 2: vertical snatch ---------- */
.lane-jump .jump-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  opacity: 0.32;
  transition: width 1.3s cubic-bezier(0.2, 0.9, 0.3, 1);
  z-index: 1;
}
.jump-label {
  position: absolute;
  right: calc(9% + 6px);   /* just inside the end zone */
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--text);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
  z-index: 3;
  font-variant-numeric: tabular-nums;
}
.dog.hopping .dog-face { animation: hop 0.9s cubic-bezier(0.3, 0, 0.4, 1) 2; }
@keyframes hop {
  0%, 100% { transform: scaleX(var(--flip)) translateY(0); }
  45%      { transform: scaleX(var(--flip)) translateY(-26px) rotate(-8deg); }
}

/* ---------- event 3: cone drill ---------- */
.lane-cones .cone {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1rem;
  z-index: 1;
}

/* ---------- antics: behavior states + field evidence ---------- */
.artifact {
  position: absolute;
  bottom: 3px;
  font-size: 0.85rem;
  z-index: 1;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.6));
}
.dog.b-sniff .dog-face { animation: sniff 0.5s ease-in-out infinite; }
@keyframes sniff {
  0%, 100% { transform: scaleX(var(--flip)) rotate(24deg) translateY(3px); }
  50%      { transform: scaleX(var(--flip)) rotate(32deg) translateY(5px) translateX(2px); }
}
.dog.b-poop .dog-face { animation: squat 0.4s ease-in-out infinite; }
@keyframes squat {
  0%, 100% { transform: scaleX(var(--flip)) scaleY(0.72) translateY(5px); }
  50%      { transform: scaleX(var(--flip)) scaleY(0.66) translateY(7px) rotate(-4deg); }
}
.dog.b-pee .dog-face,
.dog.b-eat .dog-face { animation: pee-tilt 0.7s ease-in-out infinite; }
@keyframes pee-tilt {
  0%, 100% { transform: scaleX(var(--flip)) rotate(-16deg); }
  50%      { transform: scaleX(var(--flip)) rotate(-20deg) translateY(1px); }
}
.dog.b-squirrel .dog-face { animation: bob 0.16s ease-in-out infinite; }
.dog.b-zoomies .dog-face { animation: spin360 0.5s linear infinite; }
@keyframes spin360 {
  from { transform: scaleX(var(--flip)) rotate(0deg); }
  to   { transform: scaleX(var(--flip)) rotate(-360deg); }
}
.dog.b-nap .dog-face {
  animation: none;
  transform: scaleX(var(--flip)) rotate(78deg) translateY(4px);
  opacity: 0.9;
}

/* ---------- wide cinematic event screen ---------- */
/* The combine screen breaks out of the centered column: full viewport width
   with small gutters (negative-margin breakout — no transform, so the fixed
   overlays inside keep covering the real viewport). */
#screen-combine.active {
  width: min(96vw, 1800px);
  margin-left: calc((100% - min(96vw, 1800px)) / 2);
}

/* ---------- 2D open field (Zoomie + Cone Drill) ---------- */
.field2d {
  position: relative;
  height: min(48vh, 560px);
  min-height: 300px;   /* never collapses, even if styles arrive stale */
  background-image:
    repeating-linear-gradient(to right,
      transparent 0,
      transparent calc(10% - 1px),
      var(--line) calc(10% - 1px),
      var(--line) 10%),
    linear-gradient(var(--grass), var(--grass));
}
/* shaded "past the line" end zone */
.field2d::after {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 9%;
  background: rgba(0, 0, 0, 0.28);
  pointer-events: none;
}

/* ---------- the FINISH line ---------- */
.finish-line {
  position: absolute;
  left: calc(91% - 9px);
  top: 0;
  bottom: 0;
  width: 18px;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  background: repeating-conic-gradient(#f2f2f2 0% 25%, #101010 0% 50%) 0 0 / 9px 9px;
  animation: finish-glow 1.6s ease-in-out infinite;
  pointer-events: none;
}
@keyframes finish-glow {
  0%, 100% { box-shadow: 0 0 10px rgba(255, 255, 255, 0.4); }
  50%      { box-shadow: 0 0 24px rgba(255, 255, 255, 0.85); }
}
.finish-line .fl-text {
  writing-mode: vertical-rl;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.35em;
  color: #fff;
  background: rgba(0, 0, 0, 0.78);
  padding: 12px 2px;
  border-radius: 6px;
}
.finish-line .fl-flag {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.15rem;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.6));
}
.finish-line .fl-flag.top { top: -4px; }
.finish-line .fl-flag.bottom { bottom: -4px; }

/* break-the-tape burst at the winner's crossing point */
.tape-burst {
  position: absolute;
  z-index: 4;
  font-size: 1.3rem;
  pointer-events: none;
  animation: confetti-fly 1.2s ease-out forwards;
}

/* comic action bubble at the dog when an antic fires (~2s) */
.action-bubble {
  position: absolute;
  z-index: 5;
  font-size: 0.74rem;
  font-weight: 800;
  background: #fff;
  color: #14130f;
  padding: 2px 7px;
  border-radius: 10px 10px 10px 2px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
  white-space: nowrap;
  pointer-events: none;
  animation: bubble-pop 2s ease-out forwards;
}
@keyframes bubble-pop {
  0%       { opacity: 0; transform: translateY(4px) scale(0.6); }
  10%, 75% { opacity: 1; transform: translateY(0) scale(1); }
  100%     { opacity: 0; transform: translateY(-6px) scale(0.95); }
}
.field2d .dog { left: 0; top: 0; margin-top: 0; }
.field2d .dog .dog-tag { opacity: 0.85; }  /* labels may overlap; soften them */
.cone2d {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 1;
  font-size: 1.05rem;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
}
.squirrel2d {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 2;
  font-size: 1rem;
  transition: transform 0.12s linear;
}
.artifact-2d { left: 0; top: 0; bottom: auto; }

/* ---------- intro card + interstitial standings ---------- */
.intro-card { text-align: center; max-width: min(90vw, 480px); }
.intro-quote {
  margin: 10px 0 0;
  color: var(--text-dim);
  font-size: 0.9rem;
  font-style: italic;
}
.finish-sub {
  margin-top: 12px;
  font-size: 0.95rem;
  line-height: 1.8;
  color: var(--text-dim);
}

/* ---------- results: grades ---------- */
.result-grade {
  display: inline-block;
  background: var(--gold);
  color: #1a1405;
  font-size: 0.68rem;
  font-weight: 900;
  border-radius: 999px;
  padding: 2px 8px;
  margin-left: 6px;
  vertical-align: middle;
}
.result-note {
  margin: 2px 0 0;
  font-size: 0.76rem;
  font-style: italic;
  color: var(--text-faint);
}

/* ---------- desktop tweaks ---------- */
@media (min-width: 640px) {
  .lane { height: 58px; }
  .dog .dog-tag { max-width: 120px; font-size: 0.62rem; }
  .count-grid { grid-template-columns: repeat(8, 1fr); }
}

/* ---------- event 2: the GYM (side-view vertical snatch) ---------- */
.gym {
  background:
    radial-gradient(300px 140px at 20% 0%, rgba(255, 244, 200, 0.18), transparent 70%),
    radial-gradient(300px 140px at 80% 0%, rgba(255, 244, 200, 0.18), transparent 70%),
    linear-gradient(#0a1026 0%, #131c3a 55%, #1c2430 100%);
}
.gym-ground {
  position: absolute; left: 0; right: 0; bottom: 0; height: 26px;
  background: linear-gradient(#2c3d2e, #1b2a1d);
  border-top: 2px solid rgba(255, 255, 255, 0.35);
}
.gym-ruler {
  position: absolute; left: 6px; top: 0; bottom: 0; width: 58px; z-index: 2;
  border-right: 2px dashed rgba(255, 255, 255, 0.25);
}
.gym-tick {
  position: absolute; left: 2px; font-size: 0.62rem; font-weight: 800;
  color: rgba(255, 255, 255, 0.75); white-space: nowrap;
}
.gym-board {
  position: absolute; top: 8px; right: 8px; z-index: 6; width: 172px;
  max-height: 58%; overflow-y: auto;
  background: rgba(10, 14, 24, 0.85); border: 1px solid var(--border);
  border-radius: 10px; padding: 6px 8px; font-size: 0.68rem;
}
.gym-board-title { font-weight: 900; color: var(--gold); margin-bottom: 4px; }
.gym-board-row { padding: 1px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gym-board-row:last-child { font-weight: 800; color: var(--text); }
.gym .dog { top: auto; margin-top: 0; transition: transform 0.45s cubic-bezier(0.25, 0.6, 0.35, 1); }
.gym .dog.leaping .dog-face { transform: scaleX(var(--flip)) scaleY(1.12); }
.gym.dimmed .dog:not(.spotlight) { opacity: 0.4; }
.dog.spotlight { z-index: 7; filter: brightness(1.35) drop-shadow(0 0 12px rgba(255, 244, 200, 0.55)); }
.gym-hotdog {
  position: absolute; z-index: 5; font-size: 1.1rem;
  transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.4, 1);
}

/* ---------- event 3: the cone SLALOM ---------- */
.field2d.slalom {
  background-image:
    repeating-linear-gradient(to right, transparent 0, transparent calc(10% - 1px),
      rgba(255, 255, 255, 0.16) calc(10% - 1px), rgba(255, 255, 255, 0.16) 10%),
    linear-gradient(#12371f, #0e2c19);
}
.ideal-line { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.ideal-line polyline {
  fill: none; stroke: rgba(255, 255, 255, 0.22); stroke-width: 2px;
  stroke-dasharray: 6 7; vector-effect: non-scaling-stroke;
}
.slalom .cone2d { font-size: 1.35rem; transition: rotate 0.25s ease-out; }
.cone2d.tipped { opacity: 0.8; }
.gate-num {
  position: absolute; z-index: 1; font-size: 0.6rem; font-weight: 900;
  color: #10130f; background: rgba(255, 197, 61, 0.9);
  width: 15px; height: 15px; border-radius: 50%;
  display: grid; place-items: center;
}
.gate-num.flash { animation: gate-pulse 0.7s ease-out; }
@keyframes gate-pulse {
  0%   { box-shadow: 0 0 0 2px rgba(255, 197, 61, 1), 0 0 18px 6px rgba(255, 197, 61, 0.8); }
  100% { box-shadow: 0 0 0 0 rgba(255, 197, 61, 0); }
}
.dog-next {
  font-size: 0.5rem;
  font-weight: 800;
  color: #ffe9ad;
  background: rgba(0, 0, 0, 0.55);
  border-radius: 999px;
  padding: 0 4px;
  margin-top: 1px;
}
.paw {
  position: absolute; z-index: 0; width: 5px; height: 5px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  animation: paw-fade 2.5s ease-out forwards;
}
@keyframes paw-fade { from { opacity: 0.55; } to { opacity: 0; } }
.dog.b-tip .dog-face { animation: pee-tilt 0.4s ease-in-out infinite; }

/* ---------- reduced motion ---------- */
/* Squat/spin/hop/bob animations are skipped; artifacts (💩💦), commentary,
   and final states still appear. */
@media (prefers-reduced-motion: reduce) {
  .btn-huge,
  .dog.running .dog-face,
  .dog.hopping .dog-face,
  .dog.b-sniff .dog-face,
  .dog.b-poop .dog-face,
  .dog.b-pee .dog-face,
  .dog.b-squirrel .dog-face,
  .dog.b-zoomies .dog-face,
  .dog.b-eat .dog-face,
  .dog.b-tip .dog-face,
  .gate-num.flash,
  .countdown-num,
  .finish-card { animation: none; }
  .dog,
  .gym .dog,
  .gym-hotdog,
  .squirrel2d { transition: none; }
  .paw { display: none; }
  .lane-jump .jump-fill { transition: none; }
  .screen.active,
  .ticker p:first-child,
  .finish-line,
  .action-bubble { animation: none; }   /* bubbles still show, statically */
  .result-row { animation-duration: 0.01s; animation-delay: 0s; }
  .confetti span,
  .tape-burst { display: none; }
}
