:root {
  --bg-color: #000;
  --text-color: #fff;
  --accent-color: #ff0;
}

html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: var(--bg-color);
  color: var(--text-color);
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

#game-container {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

#game-canvas {
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  outline: none;
}

/* ── Pie-pad (four directional pie slices) ───────────────────────────── */

#piepad {
  position: fixed;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 200px;
  height: 200px;
  z-index: 100;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
  filter: drop-shadow(0 0 6px rgba(0,0,0,0.5));
}

#piepad path {
  fill: rgba(255, 255, 255, 0.10);
  stroke: rgba(255, 255, 255, 0.25);
  stroke-width: 1.5;
  cursor: pointer;
  transition: fill 0.08s;
}

#piepad path:active,
#piepad path.pressed {
  fill: rgba(255, 255, 0, 0.35);
  stroke: rgba(255, 255, 0, 0.6);
}

#piepad .arrow {
  fill: rgba(255, 255, 255, 0.55);
  pointer-events: none;
}

@media (max-width: 480px) {
  #piepad {
    width: 170px;
    height: 170px;
    bottom: 6px;
  }
}

/* ── Fullscreen button ───────────────────────────────────────────────── */

#fullscreen-btn {
  position: fixed;
  bottom: 8px;
  right: 8px;
  z-index: 100;
  width: 40px;
  height: 40px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
  padding: 0;
}

#fullscreen-btn:active {
  background: rgba(255, 255, 255, 0.2);
}

/* ── Arcade brand ────────────────────────────────────────────────────── */

#arcade-brand {
  position: fixed;
  top: 6px;
  left: 10px;
  z-index: 100;
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(7px, 1.4vw, 13px);
  letter-spacing: 0.15em;
  color: #ff2244;
  text-shadow:
    0 0 6px #ff2244,
    0 0 18px #ff2244,
    2px 2px 0 #220000;
  text-transform: uppercase;
  pointer-events: none;
  white-space: nowrap;
}

/* ── Ghost speed slider ──────────────────────────────────────────────── */

#speed-control {
  position: fixed;
  top: 8px;
  right: 8px;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 6px;
  padding: 4px 10px;
  font-family: monospace;
  font-size: 12px;
  color: #fff;
}

#speed-control label {
  font-size: 16px;
  cursor: default;
}

#ghost-speed {
  width: 80px;
  accent-color: var(--accent-color);
  cursor: pointer;
}

#speed-label {
  min-width: 20px;
  text-align: center;
}

/* ── High score overlay ───────────────────────────────────────────────── */

#highscore-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.75);
  z-index: 200;
}

#highscore-overlay .highscore-modal {
  text-align: center;
  font-family: 'Press Start 2P', monospace, sans-serif;
  color: var(--accent-color);
  background: var(--bg-color);
  border: 3px solid var(--accent-color);
  border-radius: 8px;
  padding: 32px 40px;
  min-width: 300px;
}

#highscore-overlay h2 {
  color: var(--accent-color);
  font-size: clamp(0.8rem, 2vw, 1.2rem);
  margin: 0 0 16px;
  letter-spacing: 0.05em;
}

#highscore-name {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 10px;
  font-size: 1em;
  font-family: monospace;
  background: transparent;
  color: var(--accent-color);
  border: 2px solid var(--accent-color);
  border-radius: 4px;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  outline: none;
}

#highscore-name:focus {
  border-color: #fff;
  box-shadow: 0 0 6px rgba(255, 255, 0, 0.4);
}

#highscore-overlay .highscore-hint {
  margin: 8px 0 0;
  font-size: 0.55em;
  color: #aaa;
}
