:root {
  --paper: #f5f2ec;
  --ink: #18171b;
  --mute: #8d8a84;
  --line: rgba(24, 23, 27, 0.16);
  --accent: #e0502a;
  --ghost: rgba(24, 23, 27, 0.14);
  --pad: clamp(16px, 3.4vmin, 36px);
}

* { box-sizing: border-box; margin: 0; }

html, body { height: 100%; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: "Mona Sans Variable", system-ui, sans-serif;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

.stage {
  position: relative;
  height: 100vh;
  height: 100svh;
  max-height: 100vh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  padding: var(--pad);
  cursor: crosshair;
  touch-action: none;
  user-select: none;
}

.head, .foot {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  font-size: clamp(11px, 1.7vmin, 13px);
  letter-spacing: 0.01em;
}

.head__name {
  font-weight: 640;
  font-variation-settings: "wdth" 112;
  font-size: clamp(13px, 2.1vmin, 16px);
}

.head__hint { color: var(--mute); text-align: right; }

.paper {
  min-height: 0;
  display: grid;
  place-items: center;
}

.spiro {
  width: min(78vmin, 100%);
  height: min(78vmin, 100%);
  overflow: visible;
}

.ring { fill: none; stroke: var(--line); stroke-width: 0.5; }
.ticks line { stroke: var(--line); stroke-width: 0.35; }

.trace {
  fill: none;
  stroke: var(--accent);
  stroke-width: 0.7;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.ghost {
  fill: none;
  stroke: var(--ghost);
  stroke-width: 0.45;
  stroke-linejoin: round;
}

.wheel__rim { fill: rgba(245, 242, 236, 0.35); stroke: var(--ink); stroke-width: 0.45; }
.wheel__arm { stroke: var(--ink); stroke-width: 0.35; stroke-dasharray: 1.2 1.4; }
.wheel__hub { fill: var(--ink); }

.pen { fill: var(--paper); stroke: var(--accent); stroke-width: 0.9; }

.ratio, .hole {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.ratio__mask {
  display: inline-block;
  overflow: hidden;
  height: 1.25em;
  line-height: 1.25em;
  vertical-align: bottom;
}

.ratio__val, .hole__val {
  display: inline-block;
  font-family: "JetBrains Mono Variable", ui-monospace, monospace;
  font-size: clamp(12px, 1.9vmin, 14px);
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.ratio__label, .hole__label { color: var(--mute); }

@media (max-width: 480px) {
  .head__hint { max-width: 52%; }
}
