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

body {
  background: #1a1a2e;
  color: #cccccc;
  font-family: Consolas, 'Courier New', monospace;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 100vh;
  padding: 16px;
}

#app {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  width: 100%;
  max-width: 640px;
}

#title {
  font-size: 40px;
  font-weight: bold;
  color: #00d4ff;
  letter-spacing: 2px;
  padding: 16px 0 8px;
}

#stage-label {
  font-size: 24px;
  font-weight: bold;
  color: #ffff00;
  letter-spacing: 2px;
  padding: 0 0 8px;
}

#canvas-wrapper {
  width: 100%;
  max-width: 600px;
  padding: 0 20px;
  position: relative;
}

#gameCanvas {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 2;
  background: #16213e;
  border: 2px solid #00d4ff;
  cursor: crosshair;
  touch-action: none;
}

/* Global stage clear overlay (full screen dark) */
#stage-clear-overlay-global {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.85);
  z-index: 9997;
  display: none;
}

/* Global stage clear canvas (for STAGECLEAR text and particles) */
#stageClearCanvasGlobal {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9999;
  display: none;
  pointer-events: none;
}

/* Global next level button */
#next-level-btn-global {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, 50%);
  z-index: 9998;
  font-family: Consolas, 'Courier New', monospace;
  font-size: 20px;
  font-weight: bold;
  color: #1a1a2e;
  background: #00d4ff;
  border: none;
  padding: 10px 28px;
  cursor: pointer;
  transition: background 0.15s;
  display: none;
  margin-top: 180px;
}

#next-level-btn-global:hover {
  background: #0099bb;
}

#next-level-btn-global:active {
  background: #007799;
}

#score-label {
  font-size: 64px;
  font-weight: bold;
  color: #888888;
  padding: 12px 0 4px;
  min-height: 54px;
  letter-spacing: 1px;
}

.score-unit {
  font-size: 42px;
}

#reset-btn {
  font-family: Consolas, 'Courier New', monospace;
  font-size: 26px;
  font-weight: bold;
  color: #1a1a2e;
  background: #00d4ff;
  border: none;
  padding: 6px 24px;
  margin: 4px 0 20px;
  cursor: pointer;
  letter-spacing: 1px;
  transition: background 0.15s;
}

#reset-btn:hover {
  background: #0099bb;
}

#reset-btn:active {
  background: #007799;
}

#version-label {
  position: fixed;
  bottom: 10px;
  right: 10px;
  font-size: 14px;
  color: #888888;
  z-index: 100;
  text-align: right;
  white-space: nowrap;
}
