:root {
  --track: #8A2B1E;
  --cinder: #5E1E14;
  --lane: #FFFFFF;
  --yellow: #E9E31F;
  --spike: #1C0F0B;
  --soft: #F3DCD6;
  --display: "Big Shoulders Display", "Sen", system-ui, sans-serif;
  --body: "Sen", system-ui, sans-serif;
  /* rubber granules: two offset dot grids, cheap to paint */
  --granules:
    radial-gradient(rgba(28, 15, 11, 0.22) 0.8px, transparent 1.2px) 0 0 / 6px 6px,
    radial-gradient(rgba(255, 255, 255, 0.05) 0.8px, transparent 1.2px) 3px 3px / 6px 6px;
  /* worn lane paint for straight lines: white with irregular gaps */
  --worn: repeating-linear-gradient(90deg, var(--lane) 0 34px, rgba(255, 255, 255, 0.55) 34px 37px, var(--lane) 37px 61px, rgba(255, 255, 255, 0.3) 61px 63px, var(--lane) 63px 97px, transparent 97px 99px);
  --page: min(1180px, 100% - 2 * clamp(16px, 4vw, 40px));
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--granules), var(--track);
  color: var(--lane);
  font: 400 16px/1.55 var(--body);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button, input { font: inherit; }

/* ---------- header ---------- */
.top {
  width: var(--page); margin: 0 auto;
  display: flex; align-items: center; gap: 24px;
  padding: 16px 0;
}
.mark { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.mark span { font: 900 28px/1 var(--display); }
.topNav { display: flex; gap: 22px; margin-left: auto; }
.topNav a { text-decoration: none; font-weight: 600; font-size: 15px; }
.topNav a:hover { color: var(--yellow); }
.walletBtn {
  background: transparent; color: var(--lane);
  border: 2px solid var(--lane); border-radius: 999px;
  padding: 7px 16px; font-weight: 700; font-size: 15px; cursor: pointer;
}
.walletBtn:hover { background: var(--lane); color: var(--track); }
.walletBtn.on { border-color: var(--yellow); color: var(--yellow); }

/* ---------- hero ---------- */
.hero {
  width: var(--page); margin: 0 auto;
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 32px; align-items: end;
  padding: clamp(12px, 3vw, 28px) 0 clamp(18px, 3vw, 26px);
}
.hero h1 { font: 900 clamp(38px, 5vw, 62px)/0.95 var(--display); margin: 0; }
.hero p { margin: 0; color: var(--soft); font-size: 16px; max-width: 520px; }

/* ---------- the oval ---------- */
.stadium {
  position: relative;
  width: min(var(--page), calc(64vh * 1000 / 520));
  aspect-ratio: 1000 / 520;
  margin: 0 auto;
  border-radius: 9999px;
  background: var(--granules), var(--cinder);
}
.lanes { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.infield {
  position: absolute; left: 9%; right: 9%; top: 16%; bottom: 16%;
  border-radius: 9999px; overflow: hidden;
  background: radial-gradient(70% 80% at 50% 45%, #6E2619 0%, #4C1810 100%);
}
#route { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hud { position: absolute; left: 0; right: 0; display: flex; justify-content: center; align-items: baseline; gap: 10px 26px; flex-wrap: wrap; padding: 0 14%; pointer-events: none; text-align: center; }
.hudTop { top: 9%; }
.hudBottom { bottom: 10%; }
.hud p { margin: 0; font-weight: 600; font-size: 15px; }
.hud b { color: var(--yellow); }
.clock span { font: 900 22px/1 var(--display); color: var(--yellow); letter-spacing: 0.02em; }
.tally { display: flex; align-items: baseline; gap: 6px; }
.tally b { font: 900 22px/1 var(--display); color: var(--lane); }
.tally span { font-size: 13px; font-weight: 600; color: var(--soft); }
.infieldNote { position: absolute; left: 0; right: 0; bottom: 25%; margin: 0; text-align: center; font-size: 13px; color: var(--soft); pointer-events: none; }

/* ---------- home straights ---------- */
.straights {
  width: var(--page); margin: 34px auto 0;
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 26px; align-items: start;
}
.col { display: grid; gap: 26px; }
.straight { position: relative; display: grid; grid-template-columns: 46px 1fr; padding: 4px 0; }
.straight::before, .straight::after { content: ""; position: absolute; left: 0; right: 0; height: 4px; background: var(--worn); }
.straight::before { top: 0; }
.straight::after { bottom: 0; }
.laneNo { font: 900 30px/1 var(--display); display: grid; place-items: center; }
.straightBody { position: relative; padding: 20px 22px 22px; border-left: 4px solid rgba(255, 255, 255, 0.9); background: rgba(28, 15, 11, 0.16); }
.straight h2 { font: 900 clamp(26px, 2.8vw, 34px)/1 var(--display); margin: 0 0 10px; }
.straight p { margin: 0 0 12px; color: var(--soft); }

.passForm label { display: block; font-weight: 700; margin-bottom: 6px; font-size: 15px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row input {
  flex: 1 1 240px; min-width: 0;
  background: var(--spike); color: var(--lane);
  border: 2px solid var(--lane); border-radius: 10px 2px 10px 2px;
  padding: 10px 14px; font-size: 15px;
}
.row input:focus { outline: none; border-color: var(--yellow); }
.go {
  background: var(--yellow); color: var(--spike);
  border: 0; border-radius: 2px 14px 2px 14px;
  padding: 11px 20px; font: 900 19px/1 var(--display); letter-spacing: 0.01em;
  cursor: pointer; box-shadow: 0 4px 0 var(--spike);
  transition: transform .1s, box-shadow .1s;
}
.go:hover { transform: translateY(-1px); box-shadow: 0 5px 0 var(--spike); }
.go:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--spike); }
.go:disabled { opacity: 0.5; cursor: not-allowed; }
.ghost { background: transparent; color: var(--lane); border: 2px dashed var(--lane); padding: 8px 14px; font-weight: 700; cursor: pointer; border-radius: 2px; }
.status { min-height: 1.4em; margin: 10px 0 0 !important; font-weight: 600; color: var(--lane) !important; }
.status.err { color: #FFD3C8 !important; }

.rules { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr; gap: 12px; }
.rules li { padding-left: 12px; border-left: 3px solid var(--yellow); color: var(--soft); font-size: 15px; }
.rules b { display: block; font: 900 19px/1.15 var(--display); color: var(--lane); }

.logLane .straightBody { max-height: 560px; display: flex; flex-direction: column; }
.routeLog { margin: 0; padding: 0; list-style: none; overflow-y: auto; scrollbar-width: thin; }
.routeLog li {
  display: grid; grid-template-columns: 62px 1fr auto; gap: 12px; align-items: center;
  padding: 9px 0; border-bottom: 1px dashed rgba(255, 255, 255, 0.3); font-size: 15px;
}
.routeLog .legNo { font: 900 19px/1 var(--display); color: var(--yellow); }
.routeLog .who { font-weight: 700; overflow-wrap: anywhere; }
.routeLog .when { color: var(--soft); font-size: 13px; text-align: right; }
.routeLog .tag { display: inline-block; margin-left: 8px; font-size: 12px; padding: 1px 7px; border: 1.5px solid var(--yellow); color: var(--yellow); border-radius: 999px; }

/* ---------- footer ---------- */
.foot {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 18px;
  margin-top: 48px; padding: 28px max(clamp(16px, 4vw, 40px), (100% - 1180px) / 2) 34px;
  background: var(--spike); font-size: 15px;
}
.foot p { margin: 3px 0; }
.foot a { text-decoration-color: var(--yellow); text-underline-offset: 3px; }
.foot .built { font: 900 24px/1.1 var(--display); }
.foot .addr { word-break: break-all; }

/* ---------- smaller screens ---------- */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 12px; }
  .straights { grid-template-columns: 1fr; }
  .rules { grid-template-columns: 1fr 1fr; gap: 12px 22px; }
}
@media (max-width: 640px) {
  .topNav { display: none; }
  .walletBtn { margin-left: auto; }
  .stadium { width: var(--page); aspect-ratio: auto; height: 470px; border-radius: 190px; }
  .lanes { display: none; }
  .stadium { box-shadow: inset 0 0 0 3px var(--lane), inset 0 0 0 18px transparent, inset 0 0 0 21px rgba(255, 255, 255, 0.85); }
  .infield { left: 8%; right: 8%; top: 7%; bottom: 7%; border-radius: 160px; }
  .hud { padding: 0 10%; gap: 6px 14px; }
  .hudTop { top: 11%; }
  .hudBottom { bottom: 9%; }
  .tally span { font-size: 12px; }
  .hudBottom { flex-direction: column; align-items: center; gap: 2px; bottom: 8%; }
  .infieldNote { display: none; }
  .rules { grid-template-columns: 1fr; }
  .straight { grid-template-columns: 34px 1fr; }
  .laneNo { font-size: 24px; }
  .routeLog li { grid-template-columns: 52px 1fr; }
  .routeLog .when { grid-column: 2; text-align: left; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
