 :root {
  color-scheme: dark;
  --bg: #09111f;
  --bg-soft: #101b2f;
  --card: rgba(16, 27, 47, 0.88);
  --card-strong: rgba(11, 18, 34, 0.96);
  --text: #e9f0ff;
  --muted: #a4b2d1;
  --line: rgba(154, 179, 255, 0.18);
  --accent: #73b7ff;
  --accent-2: #9a7dff;
  --good: #6fe2b1;
  --warn: #ffd36b;
  --bad: #ff8b98;
  --shadow: 0 24px 80px rgba(3, 8, 20, 0.42);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top, rgba(115, 183, 255, 0.18), transparent 30%),
    linear-gradient(180deg, #07101d 0%, #09111f 48%, #060b13 100%);
}
a { color: inherit; }
main { display: block; }
.shell { width: min(1180px, calc(100% - 2rem)); margin: 0 auto; }
.narrow { width: min(780px, calc(100% - 2rem)); }
.hero, .section { padding: 3.75rem 0; }
.hero-grid, .play-layout, .stats-grid, .controls-layout, .board-header, .cta-row, .inline-actions, .route-deck, .summary-top, .site-footer { display: flex; gap: 1rem; }
.hero-grid { align-items: start; justify-content: space-between; }
.hero-grid > * { flex: 1; }
.play-layout { align-items: start; flex-wrap: wrap; }
.route-panel { flex: 0 0 280px; }
.board-panel { flex: 1 1 520px; }
.log-panel { flex: 0 0 280px; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 1.3rem;
  backdrop-filter: blur(14px);
}
.hero-card { background: linear-gradient(180deg, rgba(18, 32, 58, 0.95), rgba(10, 17, 31, 0.95)); }
.eyebrow, .mini-label {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: #9ec6ff;
}
h1, h2, h3 { margin: 0 0 .85rem; line-height: 1.05; }
h1 { font-size: clamp(2.35rem, 4.8vw, 4.6rem); max-width: 11ch; }
h2 { font-size: clamp(1.45rem, 3vw, 2rem); }
h3 { font-size: 1.08rem; }
p { margin: 0 0 1rem; color: var(--muted); line-height: 1.65; }
.lead { font-size: 1.08rem; max-width: 62ch; color: #d9e6ff; }
.small-note, .info-blurb { color: var(--muted); font-size: .95rem; }
.btn {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: .9rem 1.15rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform .18s ease, opacity .18s ease, background .18s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:disabled { cursor: not-allowed; opacity: .45; transform: none; }
.btn-primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #04111d; }
.btn-secondary { background: rgba(255,255,255,.06); color: var(--text); border: 1px solid var(--line); }
.bullet-list, .legend-list { margin: 0; padding-left: 1.15rem; color: var(--muted); }
.bullet-list li, .legend-list li { margin-bottom: .55rem; }
.compact li:last-child { margin-bottom: 0; }
.section-heading.tight h2 { margin-bottom: .35rem; }
.route-deck { flex-direction: column; }
.route-card {
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.03);
  color: var(--text);
  border-radius: 18px;
  padding: 1rem;
  cursor: pointer;
}
.route-card:hover, .route-card.is-active { border-color: rgba(115, 183, 255, 0.48); background: rgba(115, 183, 255, 0.12); }
.route-card strong, .summary-item strong, .stat-card strong { display: block; color: var(--text); }
.route-card span { display: block; font-size: .92rem; color: var(--muted); margin-top: .3rem; }
.route-card p { margin: .45rem 0 0; font-size: .92rem; }
.route-meta { display: flex; justify-content: space-between; gap: .75rem; align-items: center; margin-top: .6rem; font-size: .8rem; color: #bfd3ff; }
.board-header { justify-content: space-between; align-items: start; flex-wrap: wrap; }
.inline-actions { flex-wrap: wrap; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .8rem; margin: 1.15rem 0; }
.stat-card {
  background: rgba(255,255,255,.04);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: .95rem;
}
.stat-card span { display: block; color: var(--muted); font-size: .82rem; margin-bottom: .25rem; }
.board {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: .5rem;
  margin-bottom: 1rem;
}
.tile {
  aspect-ratio: 1 / 1;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.08);
  padding: .45rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  background: rgba(255,255,255,.04);
  overflow: hidden;
}
.tile::after {
  content: '';
  position: absolute;
  inset: auto 0 0 0;
  height: 35%;
  background: linear-gradient(180deg, transparent, rgba(5, 9, 18, .32));
}
.tile-code, .tile-label { position: relative; z-index: 1; }
.tile-code { font-size: .75rem; color: #bed1ff; }
.tile-label { font-size: .84rem; font-weight: 700; color: var(--text); }
.tile-road { background: linear-gradient(180deg, rgba(30, 47, 76, .8), rgba(13, 22, 38, .88)); }
.tile-start { background: linear-gradient(180deg, rgba(46, 103, 168, .95), rgba(17, 44, 74, .96)); }
.tile-delivery { background: linear-gradient(180deg, rgba(85, 60, 150, .92), rgba(25, 14, 50, .96)); }
.tile-rain { background: linear-gradient(180deg, rgba(20, 96, 120, .92), rgba(7, 30, 40, .96)); }
.tile-coffee { background: linear-gradient(180deg, rgba(150, 92, 40, .92), rgba(47, 26, 12, .96)); }
.tile-sprint { background: linear-gradient(180deg, rgba(58, 129, 110, .92), rgba(18, 43, 37, .96)); }
.tile-block { background: linear-gradient(180deg, rgba(70, 70, 78, .92), rgba(27, 27, 32, .96)); opacity: .78; }
.tile-here { outline: 2px solid #ffffff; box-shadow: 0 0 0 3px rgba(115,183,255,.32); }
.tile-cleared { filter: saturate(.7); }
.courier-dot {
  position: absolute;
  top: .5rem;
  right: .5rem;
  width: .8rem;
  height: .8rem;
  border-radius: 50%;
  background: #fff07b;
  box-shadow: 0 0 18px rgba(255, 240, 123, .8);
  z-index: 1;
}
.controls-layout { align-items: start; gap: 1.1rem; flex-wrap: wrap; }
.controls-pad {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
}
.move-row { display: flex; gap: .5rem; }
.move-btn {
  width: 4rem;
  height: 4rem;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.05);
  color: var(--text);
  font: inherit;
  font-size: 1.5rem;
  font-weight: 800;
  cursor: pointer;
}
.move-btn:hover { border-color: rgba(115, 183, 255, 0.5); }
.move-btn.muted { font-size: 1.1rem; }
.legend-card { flex: 1; min-width: 240px; }
.legend-list { list-style: none; padding: 0; }
.legend-list li { display: flex; align-items: center; gap: .7rem; }
.legend-chip {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border-radius: .35rem;
  border: 1px solid rgba(255,255,255,.18);
}
.legend-chip.depot { background: #3e8fec; }
.legend-chip.parcel { background: #7750ff; }
.legend-chip.rain { background: #1d88a8; }
.legend-chip.coffee { background: #a8692f; }
.legend-chip.sprint { background: #2f9a7c; }
.legend-chip.block { background: #575760; }
.summary-card {
  margin-top: 1rem;
  border: 1px solid rgba(115, 183, 255, 0.26);
  background: linear-gradient(180deg, rgba(14, 27, 49, .96), rgba(8, 13, 24, .96));
}
.summary-top { justify-content: space-between; align-items: center; }
.medal-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 98px;
  padding: .6rem .85rem;
  border-radius: 999px;
  font-weight: 800;
  background: rgba(255,255,255,.06);
}
.medal-gold { background: rgba(255, 211, 107, .18); color: #ffe18c; }
.medal-silver { background: rgba(191, 214, 255, .18); color: #d8e4ff; }
.medal-bronze { background: rgba(201, 138, 90, .22); color: #ffceac; }
.medal-fail { background: rgba(255, 139, 152, .18); color: #ffb2ba; }
.log-list { display: flex; flex-direction: column; gap: .75rem; margin-top: 1rem; }
.summary-item {
  border: 1px solid rgba(255,255,255,.07);
  background: rgba(255,255,255,.035);
  border-radius: 18px;
  padding: .9rem;
}
.summary-item span, .summary-item p { display: block; margin: .25rem 0 0; font-size: .92rem; }
.empty { opacity: .8; }
.hero-mini { padding-bottom: 1rem; }
.prose h2 { margin-top: 1.65rem; }
.prose h3 { margin-top: 1rem; }
.site-footer {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto 2rem;
  padding: 1.35rem 1.5rem;
  border-radius: 24px;
  background: rgba(9, 16, 30, .94);
  border: 1px solid var(--line);
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}
.site-footer nav { display: flex; gap: 1rem; flex-wrap: wrap; }
.company-line { color: var(--muted); font-size: .92rem; }
@media (max-width: 980px) {
  .hero-grid, .play-layout { flex-direction: column; }
  .route-panel, .board-panel, .log-panel { flex: 1 1 auto; width: 100%; }
}
@media (max-width: 760px) {
  .hero, .section { padding: 2.75rem 0; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .board { gap: .4rem; }
  .tile { border-radius: 14px; }
  .move-btn { width: 3.45rem; height: 3.45rem; }
  .site-footer { padding: 1.1rem 1.2rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
