@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

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

body {
  background: #1a0a2e;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  font-family: 'Press Start 2P', monospace;
  overflow: hidden;
}

#game-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  transform-origin: top center;
}

#title {
  color: #7fff4f;
  font-size: 18px;
  text-shadow: 0 0 20px #7fff4f, 0 0 40px #7fff4f88;
  margin-bottom: 8px;
  letter-spacing: 2px;
}

#hud {
  display: flex;
  gap: 30px;
  margin-bottom: 8px;
  align-items: center;
  width: 600px;
}

.hud-item {
  color: #fff;
  font-size: 9px;
  text-shadow: 0 0 8px rgba(255,255,255,0.5);
}

.hud-item span {
  color: #ffdd44;
  text-shadow: 0 0 8px #ffdd44;
}

#livesDisplay {
  font-size: 16px;
  line-height: 1;
  vertical-align: middle;
  white-space: nowrap;
}

#gameCanvas {
  border: 3px solid #7fff4f;
  box-shadow: 0 0 30px #7fff4f55, 0 0 60px #7fff4f22, inset 0 0 30px rgba(0,0,0,0.5);
  image-rendering: pixelated;
}

#gameCanvas.playing {
  cursor: none;
}

#controls {
  color: #888;
  font-size: 9px;
  margin-top: 8px;
  text-align: center;
  line-height: 2;
}

#overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(26, 10, 46, 0.92);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  z-index: 10;
}

#overlay h2 {
  font-family: 'Press Start 2P', monospace;
  color: #7fff4f;
  font-size: 24px;
  text-shadow: 0 0 20px #7fff4f;
  text-align: center;
  line-height: 1.8;
}

#overlay p {
  font-family: 'Press Start 2P', monospace;
  color: #ffdd44;
  font-size: 10px;
  text-align: center;
  line-height: 2;
}

#startBtn {
  font-family: 'Press Start 2P', monospace;
  background: #7fff4f;
  color: #1a0a2e;
  border: none;
  padding: 14px 28px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
  box-shadow: 0 4px 0 #3d8020;
}

#startBtn:hover {
  background: #afffaa;
  transform: translateY(-2px);
  box-shadow: 0 6px 0 #3d8020;
}

#startBtn:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #3d8020;
}

#howToPlayBtn {
  background: transparent;
  color: #ffdd44;
  border: 2px solid #ffdd4466;
  padding: 10px 24px;
  font-size: 10px;
  cursor: pointer;
  font-family: 'Press Start 2P', monospace;
  transition: border-color 0.15s;
}
#howToPlayBtn:hover { border-color: #ffdd44; }

.hud-btn {
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  color: #7fff4f;
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 5px;
  opacity: 0.85;
  transition: opacity 0.1s, color 0.15s;
  flex-shrink: 0;
}
.hud-btn:first-of-type { margin-left: auto; }
.hud-btn:hover { opacity: 1; }
.hud-btn.off { color: #3a3a3a; opacity: 1; }

#pauseOverlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(13, 8, 32, 0.96);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  z-index: 15;
}

.pause-title {
  font-family: 'Press Start 2P', monospace;
  font-size: 20px;
  color: #ffdd44;
  text-shadow: 0 0 16px #ffdd44;
  margin: 0 0 4px;
}

.pause-opts {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.pause-opt {
  font-family: 'Press Start 2P', monospace;
  font-size: 9px;
  color: #7fff4f;
  background: none;
  border: 2px solid #7fff4f44;
  cursor: pointer;
  padding: 9px 0;
  width: 260px;
  transition: border-color 0.1s, color 0.1s;
}
.pause-opt:hover { border-color: #7fff4f; }
.pause-opt.off { color: #444; border-color: #2a2a2a; }
.pause-opt.resume { color: #ffdd44; border-color: #ffdd4444; margin-top: 6px; }
.pause-opt.resume:hover { border-color: #ffdd44; }

#tiltCalib {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 260px;
  padding-top: 4px;
}

.calib-label {
  font-family: 'Press Start 2P', monospace;
  font-size: 7px;
  color: #888;
}
.calib-hint {
  font-family: 'Press Start 2P', monospace;
  font-size: 6px;
  color: #555;
  text-align: center;
  line-height: 1.8;
}
.calib-bar-wrap { width: 100%; padding: 4px 0; }
.calib-bar {
  position: relative;
  height: 6px;
  background: #1a1a2e;
  border: 1px solid #333;
}
.calib-mark {
  position: absolute;
  top: -4px;
  width: 3px;
  height: 14px;
  transform: translateX(-50%);
}
.calib-mark.neutral { background: #7fff4f; }
.calib-mark.current { background: #ffdd44; }
.calib-angles {
  font-family: 'Press Start 2P', monospace;
  font-size: 7px;
  color: #aaa;
  letter-spacing: 1px;
}

#waveMsg {
  position: absolute;
  pointer-events: none;
  font-family: 'Press Start 2P', monospace;
  font-size: 22px;
  color: #ffdd44;
  text-shadow: 0 0 20px #ffdd44;
  opacity: 0;
  transition: opacity 0.3s;
  text-align: center;
}
