:root {
  --bg: #f7f4ef;
  --surface: #fffdf8;
  --ink: #102a43;
  --muted: #486581;
  --accent: #0f766e;
  --line: #d9e2ec;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% -10%, #c7f9cc 0%, transparent 30%),
    radial-gradient(circle at 90% -20%, #caf0f8 0%, transparent 35%),
    var(--bg);
}

.wrap {
  width: min(1100px, 92vw);
  margin: 0 auto;
}

.site-header {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.site-header .wrap {
  padding: 1rem 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  font-weight: 700;
  text-decoration: none;
  color: var(--ink);
}

nav a {
  margin-left: 1rem;
  text-decoration: none;
  color: var(--accent);
  font-weight: 600;
}

main.wrap {
  padding: 2rem 0 3rem;
}

h1, h2 {
  font-family: "IBM Plex Serif", Georgia, serif;
}

.prose {
  max-width: 72ch;
}

.muted {
  color: var(--muted);
}

.summary-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  margin: 1rem 0 1.5rem;
}

.summary-table th,
.summary-table td {
  border-bottom: 1px solid var(--line);
  text-align: left;
  padding: 0.65rem 0.7rem;
  font-size: 0.93rem;
}

.summary-table thead {
  background: #edf6f9;
}

.chart-shell {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.7rem;
}

.site-footer {
  padding: 0 0 1.8rem;
  color: var(--muted);
}

.chart-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.small {
  font-size: 0.85rem;
  margin: -0.5rem 0 0.8rem;
}

.map-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.btn-play {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0.4rem 0.9rem;
  font-size: 0.9rem;
  cursor: pointer;
  white-space: nowrap;
}

.btn-play:hover { opacity: 0.85; }

.time-label {
  font-variant-numeric: tabular-nums;
  font-size: 0.95rem;
  color: var(--muted);
  min-width: 3.5rem;
}

.race-map {
  height: 520px;
  border-radius: 10px;
  border: 1px solid var(--line);
  overflow: hidden;
  margin-bottom: 2rem;
}

@media (max-width: 860px) {
  .summary-table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }

  .chart-grid {
    grid-template-columns: 1fr;
  }
}
