*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #07111f;
  --surface: #102033;
  --surface-2: #172a42;
  --border: #2e4662;
  --text: #f8fafc;
  --text-muted: #9fb2ca;
  --primary: #38bdf8;
  --primary-dark: #0369a1;
  --accent: #f97316;
  --green: #22c55e;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 20% 0%, rgba(56, 189, 248, 0.18), transparent 32rem),
    linear-gradient(180deg, #07111f 0%, #0b1626 42%, #030712 100%);
}

.back-bar {
  padding: 0.75rem 1.5rem;
  border-bottom: 1px solid rgba(46, 70, 98, 0.75);
  background: rgba(7, 17, 31, 0.86);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(10px);
}

.back-link {
  display: inline-flex;
  color: var(--text-muted);
  font-size: 0.8rem;
  text-decoration: none;
  transition: color 0.2s ease;
}

.back-link:hover {
  color: var(--text);
}

.speed-header {
  max-width: 920px;
  margin: 0 auto;
  padding: 4rem 1.5rem 2.5rem;
  text-align: center;
}

.eyebrow {
  color: var(--primary);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  margin-bottom: 0.8rem;
  text-transform: uppercase;
}

.speed-header h1 {
  font-size: clamp(2rem, 8vw, 4.8rem);
  line-height: 1.02;
  letter-spacing: 0;
  margin-bottom: 1.2rem;
}

.elapsed {
  color: var(--text-muted);
  font-size: clamp(1rem, 3vw, 1.35rem);
  font-variant-numeric: tabular-nums;
  margin-bottom: 1.25rem;
}

#elapsed-time {
  color: var(--text);
  font-weight: 800;
}

.reset-btn {
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 700;
  padding: 0.65rem 1rem;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.reset-btn:hover {
  background: #1e3858;
  border-color: var(--primary);
}

.speed-main {
  max-width: 920px;
  margin: 0 auto;
  padding: 0 1.5rem 4rem;
}

.speed-list {
  display: grid;
  gap: 1rem;
}

.wait-line {
  color: var(--accent);
  font-size: 1rem;
  font-weight: 800;
  margin: 1.5rem 0 0.65rem;
  text-align: center;
}

.speed-card__body {
  display: grid;
  grid-template-columns: minmax(150px, 190px) 1fr;
  gap: 1.25rem;
  align-items: center;
  min-height: 178px;
  padding: 1.1rem;
  background: rgba(16, 32, 51, 0.78);
  border: 1px solid rgba(46, 70, 98, 0.88);
  border-radius: 0.75rem;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.2);
}

.orbit {
  width: 100%;
  max-width: 190px;
  aspect-ratio: 4 / 3;
  position: relative;
  display: grid;
  place-items: center;
}

.orbit svg {
  display: block;
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 16px 22px rgba(0, 0, 0, 0.24));
}

.speed-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.speed-title-row h2 {
  font-size: clamp(1.08rem, 3vw, 1.45rem);
  line-height: 1.18;
  letter-spacing: 0;
}

.speed-title-row span {
  flex-shrink: 0;
  color: #bae6fd;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.26);
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 800;
  padding: 0.28rem 0.6rem;
  white-space: nowrap;
}

.speed-copy p {
  color: var(--text-muted);
  font-size: 0.94rem;
  line-height: 1.58;
  margin-bottom: 0.8rem;
}

.distance-value,
.still-value {
  color: #fef3c7;
  font-size: clamp(1.5rem, 5vw, 2.6rem);
  font-weight: 900;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.meter {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  margin-top: 0.8rem;
  background: rgba(159, 178, 202, 0.16);
}

.meter span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary-dark), var(--primary), var(--accent));
  transition: width 0.2s linear;
}

.final-note {
  margin-top: 2rem;
  padding: 2rem 1.5rem;
  text-align: center;
  background: rgba(3, 7, 18, 0.68);
  border: 1px solid rgba(46, 70, 98, 0.88);
  border-radius: 0.75rem;
}

.final-note__mark {
  display: grid;
  place-items: center;
  width: 4rem;
  height: 4rem;
  margin: 0 auto 1rem;
  border-radius: 50%;
  color: #0f172a;
  background: #fef3c7;
  font-size: 2rem;
  font-weight: 900;
}

.final-note h2 {
  font-size: clamp(1.5rem, 5vw, 2.4rem);
  margin-bottom: 0.75rem;
}

.final-note p {
  max-width: 560px;
  margin: 0 auto 1.2rem;
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.65;
}

@media (max-width: 700px) {
  .speed-header {
    padding-top: 2.8rem;
  }

  .speed-card__body {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .orbit {
    margin: 0 auto;
  }

  .speed-title-row {
    align-items: center;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .meter span,
  .reset-btn,
  .back-link {
    transition: none;
  }
}
