* {
  box-sizing: border-box;
}

:root {
  --ink: #17130f;
  --muted: #756b5f;
  --paper: #f7efe2;
  --paper-deep: #eadcc8;
  --card: rgba(255, 250, 242, 0.88);
  --line: rgba(23, 19, 15, 0.16);
  --left: #1f2937;
  --right: #b45309;
  --green: #64745c;
}

html,
body {
  margin: 0;
  min-height: 100%;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 18% 18%, rgba(255, 255, 255, 0.72) 0 10%, transparent 11%),
    radial-gradient(circle at 86% 84%, rgba(255, 255, 255, 0.46) 0 13%, transparent 14%),
    linear-gradient(135deg, var(--paper), var(--paper-deep));
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(23, 19, 15, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 19, 15, 0.04) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: radial-gradient(circle at center, black, transparent 78%);
  pointer-events: none;
}

.wrap {
  width: min(920px, 94vw);
  padding: 28px;
  position: relative;
  z-index: 1;
  display: grid;
  gap: 18px;
}

.card,
.mini-card {
  border: 1px solid var(--line);
  border-radius: 34px;
  background: var(--card);
  box-shadow: 0 24px 70px rgba(65, 48, 28, 0.12);
  backdrop-filter: blur(14px);
}

.card {
  padding: clamp(28px, 6vw, 60px);
}

.mini-card {
  padding: clamp(20px, 4vw, 30px);
}

.topline,
.section-head,
.bottom,
.dates {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-size: 0.76rem;
  font-weight: 900;
  color: var(--muted);
}

.topline {
  justify-content: center;
  gap: clamp(12px, 3vw, 26px);
  margin-bottom: clamp(24px, 5vw, 48px);
  color: var(--ink);
  font-size: clamp(0.9rem, 2vw, 1.1rem);
}

.vs {
  color: var(--muted);
  font-size: 0.8em;
}

.scores {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(22px, 6vw, 76px);
  align-items: end;
}

.person {
  text-align: center;
}

.miles {
  font-size: clamp(4.8rem, 16vw, 12rem);
  line-height: 0.82;
  font-weight: 1000;
  letter-spacing: -0.09em;
  font-variant-numeric: tabular-nums;
}

.unit {
  margin-top: 16px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.72rem;
  font-weight: 900;
  color: var(--muted);
}

.track {
  display: flex;
  height: 14px;
  border-radius: 999px;
  background: rgba(23, 19, 15, 0.09);
  overflow: hidden;
}

.mileage-track {
  margin-top: clamp(30px, 5vw, 52px);
}

.date-track {
  margin-top: 16px;
}

.fill {
  height: 100%;
  transition: width 400ms ease;
}

.fill-left {
  background: var(--left);
}

.fill-right {
  background: var(--right);
}

.date-fill {
  background: var(--green);
}

.bottom {
  margin-top: 18px;
}

.dates {
  margin-top: 10px;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
}

.legend {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  display: inline-block;
}

.left-dot {
  background: var(--left);
}

.right-dot {
  background: var(--right);
  margin-left: 8px;
}

#chart {
  width: 100%;
  height: auto;
  margin-top: 16px;
  overflow: visible;
}

#grid line {
  stroke: rgba(23, 19, 15, 0.11);
  stroke-width: 1;
}

#leftLine,
#rightLine {
  fill: none;
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#leftLine {
  stroke: var(--left);
}

#rightLine {
  stroke: var(--right);
}

.left-point {
  fill: var(--left);
}

.right-point {
  fill: var(--right);
}

@media (max-width: 620px) {
  .wrap {
    padding: 16px;
  }

  .card,
  .mini-card {
    border-radius: 26px;
  }

  .scores {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .bottom,
  .section-head {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
}
