:root {
  --bg: #000000;
  --fg: #8de07f;
  --fg-dim: #5a9c50;
  --white: #ffffff;
  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Space Grotesk', system-ui, sans-serif;
  --font-mono: ui-monospace, 'SF Mono', Menlo, monospace;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
a:hover { opacity: .7; }

/* ---------- header (identical to other subpages: sticky bar + hairline) ---------- */
.bar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 1.5rem;
  padding-left: max(1.5rem, env(safe-area-inset-left));
  padding-right: max(1.5rem, env(safe-area-inset-right));
  padding-top: max(0.7rem, env(safe-area-inset-top));
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.bar__home {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  min-height: 44px;
  letter-spacing: 0.02em;
}
.bar__home:link,
.bar__home:visited {
  color: var(--white);
}
.bar__home:hover,
.bar__home:focus-visible {
  color: var(--white);
  text-decoration: underline;
}
.bar__mark {
  width: 28px;
  height: auto;
  display: block;
}
.bar__name {
  font-size: 0.92rem;
  font-weight: 400;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bar__here {
  font-size: 0.92rem;
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: 0.04em;
}

/* ---------- layout ---------- */
.layout {
  padding: 44px clamp(20px, 5vw, 64px) 80px;
  max-width: 900px;
  margin: 0 auto;
}

h1.h1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(40px, 7vw, 64px);
  letter-spacing: -.02em;
  margin-bottom: 8px;
  color: var(--fg);
}
/* ---------- stats ---------- */
.stats {
  font-family: var(--font-mono);
  font-size: 15px;
  letter-spacing: .12em;
  display: flex;
  gap: 28px;
  margin-bottom: 16px;
}
.stats span:last-child { color: var(--white); }

/* ---------- canvas ---------- */
.canvas-frame {
  border: 2px solid var(--white);
  border-radius: 6px;
  overflow: hidden;
  line-height: 0;
  max-width: 720px;
}
canvas { width: 100%; height: auto; display: block; }

/* ---------- hints ---------- */
.hints {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .08em;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-top: 20px;
  opacity: .75;
}
kbd {
  border: 1px solid var(--fg-dim);
  border-radius: 3px;
  padding: 1px 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--white);
}

/* ---------- mobile buttons ---------- */
.mobile-controls {
  display: none;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 14px;
}
.mbtn {
  appearance: none;
  -webkit-appearance: none;
  border: 2px solid var(--white);
  border-radius: 8px;
  background: transparent;
  color: var(--white);
  font-family: var(--font-mono);
  font-size: 28px;
  line-height: 1;
  min-height: 64px;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
}
.mbtn:active {
  background: rgba(255, 255, 255, 0.15);
  border-color: var(--fg);
  color: var(--fg);
}

/* ---------- speed slider ---------- */
.speed-row {
  display: none;
  align-items: center;
  gap: 14px;
  margin-top: 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .08em;
}
.speed-row label { color: var(--fg); white-space: nowrap; }
.speed-val { color: var(--white); min-width: 3.2em; text-align: right; }
input[type="range"] {
  flex: 1;
  appearance: none;
  -webkit-appearance: none;
  height: 4px;
  border-radius: 2px;
  background: var(--fg-dim);
  outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--white);
  border: 2px solid var(--bg);
  cursor: pointer;
}
input[type="range"]::-moz-range-thumb {
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--white);
  border: 2px solid var(--bg);
  cursor: pointer;
}
input[type="range"]::-moz-range-track {
  height: 4px;
  border-radius: 2px;
  background: var(--fg-dim);
}

/* ---------- responsive ---------- */
@media (max-width: 600px) {
  .bar { padding-top: 20px; padding-left: 16px; padding-right: 16px; }
  .bar__back, .bar__here { font-size: 12px; }
  .layout { padding: 20px 16px 60px; }
  h1.h1 { font-size: 32px; }
  .stats { gap: 14px; font-size: 11px; flex-wrap: wrap; }
  .canvas-frame { max-width: 100%; border-width: 1px; }
  .hints { font-size: 10px; gap: 6px 12px; }
  kbd { font-size: 10px; padding: 1px 4px; }
  .mobile-controls { display: grid; }
  .speed-row { display: flex; }
  .hints__touch { display: none; }
}
