:root {
  --panel: rgba(12, 14, 24, 0.72);
  --text: #f1ede4;
  --muted: #a8a49b;
  --accent: #ffbd40;
  --good: #7bd88f;
  --line: rgba(255, 255, 255, 0.12);
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root {
    --panel: rgba(250, 247, 240, 0.85);
    --text: #1d1b18;
    --muted: #5d5850;
    --accent: #b86e00;
    --good: #1d7a35;
    --line: rgba(0, 0, 0, 0.12);
  }
}
* { box-sizing: border-box; }
html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #0d0f1a;
  color: var(--text);
  font-family: "Petrov Sans", system-ui, sans-serif;
}
canvas {
  display: block;
  width: 100vw;
  height: 100vh;
  outline: none;
}
.hud, .message, .help, .credit {
  position: fixed;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  backdrop-filter: blur(6px);
  pointer-events: none;
}
.hud { top: 16px; left: 16px; padding: 8px 14px; }
.clock {
  font-size: 32px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.best { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.best:empty { display: none; }
.message {
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 18px;
  font-size: 18px;
  text-align: center;
}
.message:empty { display: none; }
.message .new { color: var(--good); font-weight: 600; }
.help {
  bottom: 16px;
  left: 16px;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
}
kbd {
  font-family: inherit;
  font-size: 12px;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0 5px;
  margin-right: 3px;
}
.credit {
  bottom: 16px;
  right: 16px;
  max-width: 250px;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--muted);
  pointer-events: auto;
}
.credit a { color: var(--accent); }
.credit:empty { display: none; }
.maps {
  position: fixed;
  top: 16px;
  right: 16px;
  font: inherit;
  font-size: 14px;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 8px;
}
.tuned, .tune {
  position: fixed;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  backdrop-filter: blur(6px);
}
.tuned[hidden], .tune[hidden] { display: none; }
.tuned {
  top: 108px;
  left: 16px;
  padding: 6px 12px;
  font-size: 13px;
  color: var(--accent);
  pointer-events: none;
}
.tune {
  top: 64px;
  right: 16px;
  width: 300px;
  max-width: calc(100vw - 32px);
  padding: 10px 14px;
  font-size: 13px;
}
.tune-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.tune button {
  font: inherit;
  color: var(--text);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 2px 10px;
  cursor: pointer;
}
.tune label { display: grid; grid-template-columns: 1fr auto; gap: 0 8px; margin: 6px 0; }
.tune label input { grid-column: 1 / -1; width: 100%; accent-color: var(--accent); }
.tune label span:last-of-type { color: var(--muted); font-variant-numeric: tabular-nums; }
.tune label.changed span:first-of-type { color: var(--accent); }
.tune p { margin: 8px 0 0; color: var(--muted); }

.wr { color: #9a6b00; font-weight: 600; }
.route { color: var(--muted); }
.wr a { color: inherit; }
