:root {
  --dark-blue: #0a2540;
  --mid-blue: #0f4471;
  --gold: #d4a52a;
  --gold-soft: #e6c766;
  --text: #0f172a;
  --muted: #64748b;
  --track: #2f7a4a;
  --track-line: #24633c;
  --wood: #1a3d28;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: #eef2f7;
  color: var(--text);
  min-height: 100vh;
}

.bar {
  background: var(--dark-blue);
  color: #e8ecf5;
  padding: 0.85rem 1rem;
}
.bar-inner {
  max-width: 1180px;
  margin: 0 auto;
}
.bar a {
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
}
.bar a:hover { text-decoration: underline; }

.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 1.25rem 1rem 3rem;
}

.hero h1 {
  margin: 0 0 0.65rem;
  color: var(--dark-blue);
  font-size: clamp(1.55rem, 3vw, 2.2rem);
  letter-spacing: -0.02em;
}
.hero-pills {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.85rem;
}
.season-pill,
.method-pill {
  display: inline-block;
  cursor: pointer;
  padding: 0.28rem 0.75rem;
  border-radius: 999px;
  background: #fff;
  border: 1px solid #c5d3e6;
  color: var(--dark-blue);
  font-size: 0.78rem;
  font-weight: 700;
}
.season-pill.active {
  background: #fff6d6;
  border-color: #ead58a;
  color: #7a5b00;
}
.method-pill:hover,
.method-pill[aria-expanded="true"],
.season-pill:hover {
  background: var(--dark-blue);
  color: #fff;
  border-color: var(--dark-blue);
}
.season-pill.active:hover {
  background: #fff6d6;
  color: #7a5b00;
  border-color: #ead58a;
}
.method-panel {
  margin: 0.65rem 0 0;
  padding: 0.85rem 1rem 0.95rem;
  background: #fff;
  border: 1px solid #dbe3ee;
  border-radius: 12px;
  max-width: 48rem;
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.45;
}
.method-panel h3 {
  margin: 0.85rem 0 0.35rem;
  color: var(--dark-blue);
  font-size: 0.95rem;
}
.method-panel h3:first-of-type { margin-top: 0.45rem; }
.method-panel p { margin: 0 0 0.55rem; }
.method-panel p:last-child { margin-bottom: 0; }
.method-panel ul {
  margin: 0 0 0.55rem;
  padding-left: 1.15rem;
}
.method-panel li { margin: 0.2rem 0; }
.method-panel a { color: var(--mid-blue); font-weight: 700; }
.method-source {
  color: var(--muted);
  font-size: 0.82rem;
}
.method-note {
  color: #7a5b00;
  background: #fff8e4;
  border-radius: 8px;
  padding: 0.5rem 0.65rem;
}

.tabs {
  display: flex;
  gap: 0.5rem;
  margin: 0.4rem 0 0.7rem;
}
.tab {
  border: 1px solid #c5d3e6;
  background: #fff;
  color: var(--dark-blue);
  font-weight: 700;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  cursor: pointer;
}
.tab.active {
  background: var(--dark-blue);
  color: #fff;
  border-color: var(--dark-blue);
}
.autos {
  margin: 0 0 1rem;
  font-size: 0.9rem;
  color: var(--mid-blue);
  font-weight: 600;
}

.board-wrap {
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(10, 37, 64, 0.18);
  border: 3px solid var(--gold);
}
.marquee {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0.55rem 1rem;
  background: linear-gradient(180deg, #7a1a1a, #5c1010);
  color: #fff6d6;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: clamp(0.7rem, 1.6vw, 0.88rem);
}
.marquee span { white-space: nowrap; }

.board {
  background:
    repeating-linear-gradient(
      90deg,
      var(--track) 0 28px,
      var(--track-line) 28px 30px
    ),
    linear-gradient(180deg, #3b9460, var(--wood));
  padding: 0.45rem 0 0.7rem;
  position: relative;
}
.board-loading {
  color: #f4fff8;
  padding: 1.1rem 1rem;
  font-weight: 700;
  margin: 0;
}

.lane {
  display: grid;
  grid-template-columns: 7.2rem 1fr 2.4rem;
  align-items: center;
  min-height: 5.85rem;
  border-bottom: 2px solid rgba(12, 40, 24, 0.35);
  padding: 0.12rem 0.4rem 0.12rem 0.55rem;
}
.lane-name {
  font-size: 0.72rem;
  font-weight: 800;
  color: #f4fff8;
  text-shadow: 0 1px 2px rgba(0,0,0,.45);
  line-height: 1.15;
}
.lane-name small {
  display: block;
  font-weight: 600;
  opacity: 0.85;
}
.lane.in .lane-name { color: #fff4c4; }

.track {
  position: relative;
  height: 5.7rem;
  overflow: visible;
}
.start-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(6.6rem + 8px);
  width: 3px;
  background: repeating-linear-gradient(
    180deg,
    #fff6d6 0 7px,
    #1a1a1a 7px 14px
  );
  box-shadow: 0 0 0 1px rgba(0,0,0,.28);
  z-index: 1;
  pointer-events: none;
}
.start-label {
  position: absolute;
  top: 0.12rem;
  left: calc(6.6rem + 14px);
  z-index: 2;
  pointer-events: none;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #fff6d6;
  text-shadow: 0 1px 2px rgba(0,0,0,.55);
}
.horse {
  position: relative;
  width: 6.6rem;
  height: 5.7rem;
  filter: drop-shadow(0 2px 2px rgba(0,0,0,.35));
}
.horse-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  left: calc(var(--progress) * (100% - 6.6rem));
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  width: 6.6rem;
  transition: left 0.7s ease;
  z-index: 3;
}
.horse-btn:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.horse-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  pointer-events: none;
}
.star {
  position: absolute;
  left: 8%;
  top: -6%;
  color: var(--gold);
  font-size: 0.85rem;
  text-shadow: 0 0 4px #000;
}

.hole {
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 50%;
  margin-left: auto;
  background:
    radial-gradient(circle at 40% 35%, #f3e0a2, #b8860b 55%, #6b4a08 100%);
  box-shadow: inset 0 4px 8px rgba(0,0,0,.45), 0 0 0 2px #f6e7a8;
  opacity: 0.28;
}
.lane.in .hole {
  opacity: 1;
  box-shadow: inset 0 4px 8px rgba(0,0,0,.45), 0 0 0 2px #fff4c4, 0 0 10px rgba(246, 211, 107, 0.7);
}
.lane.bubble .hole {
  opacity: 0.55;
  background: radial-gradient(circle at 40% 35%, #d7dde8, #7a8796 70%);
  box-shadow: inset 0 4px 8px rgba(0,0,0,.4), 0 0 0 2px #c5d0dc;
}

.also {
  margin: 0.9rem 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.card {
  margin-top: 1.1rem;
  background: #fff;
  border: 1px solid #dbe3ee;
  border-radius: 12px;
  padding: 1rem 1.1rem 1.15rem;
}
.card h2 {
  margin: 0 0 0.25rem;
  color: var(--dark-blue);
}
.detail-meta {
  margin: 0 0 0.75rem;
  color: var(--muted);
  font-size: 0.9rem;
}
.dual-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.dual {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.4rem 0.55rem;
  border-radius: 8px;
  border-left: 4px solid #94a3b8;
  background: #f8fafc;
  font-size: 0.88rem;
}
.dual.win { border-left-color: #1f9d64; }
.dual.loss { border-left-color: #d64545; }

@media (max-width: 720px) {
  .lane {
    grid-template-columns: 5.2rem 1fr 1.6rem;
    min-height: 5rem;
  }
  .horse-btn, .horse { width: 5.4rem; }
  .horse { height: 4.7rem; }
  .track { height: 4.8rem; }
  .horse-btn { left: calc(var(--progress) * (100% - 5.4rem)); }
  .start-line { left: calc(5.4rem + 8px); }
  .start-label { left: calc(5.4rem + 14px); }
  .marquee span:nth-child(2) { display: none; }
}
