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

:root {
  --bg: #f5f0e6;
  --ink: #111111;
  --muted: #4a463f;
  --line: #1a1a1a;
  --btn: #ffffff;
  --btn-border: #1a1a1a;
  --shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
  --radius: 999px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

.page {
  max-width: 920px;
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.header {
  text-align: center;
  max-width: 40rem;
}

.header h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.35rem, 4.2vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--ink);
}

.subtitle {
  margin: 0;
  font-size: clamp(0.9rem, 2.4vw, 1.05rem);
  line-height: 1.55;
  color: var(--muted);
  font-weight: 400;
}

.stage-wrap {
  width: min(100%, 560px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
}

#arena {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  border-radius: 50%;
  background: transparent;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.75rem 1rem;
  width: 100%;
  max-width: 560px;
}

.btn {
  appearance: none;
  border: 1.5px solid var(--btn-border);
  background: var(--btn);
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.55rem 1.15rem;
  border-radius: var(--radius);
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: background 0.15s ease, transform 0.1s ease;
}

.btn:hover {
  background: #f0ebe3;
}

.btn:active {
  transform: scale(0.97);
}

.btn.primary {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

.btn.primary:hover {
  background: #2a2a2a;
}

.speed {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--muted);
  user-select: none;
}

.speed input[type="range"] {
  width: clamp(90px, 22vw, 140px);
  accent-color: var(--ink);
  cursor: pointer;
}

#speed-label {
  min-width: 2.6em;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  font-weight: 600;
}

.stat {
  font-size: 0.95rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.stat strong {
  color: var(--ink);
  font-weight: 700;
}

.cap-note {
  margin-left: 0.25rem;
  color: #a35b2a;
  font-weight: 600;
}

@media (max-width: 480px) {
  .page {
    padding: 1.35rem 1rem 2.25rem;
    gap: 1.15rem;
  }

  .controls {
    gap: 0.65rem;
  }

  .btn {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
  }
}
