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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: #fff;
  user-select: none;
}

#canvas-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

#canvas-container canvas {
  display: block;
  width: 100%;
  height: 100%;
}

#canvas-container.interactive-hover {
  cursor: pointer;
}

/* Loading Screen */
#loading-screen {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: #1a1a2e;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.loading-content {
  text-align: center;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(255,255,255,0.2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-content p {
  font-size: 1.2rem;
  opacity: 0.8;
}

/* Title Screen */
#title-screen {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: linear-gradient(180deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 900;
}

#title-screen h1 {
  font-size: 5rem;
  font-weight: 900;
  text-shadow: 0 4px 12px rgba(0,0,0,0.5);
  margin-bottom: 0.25em;
  letter-spacing: 0.05em;
}

#title-screen .subtitle {
  font-size: 1.3rem;
  opacity: 0.7;
  margin-bottom: 2em;
}

#play-btn, #resume-btn, #restart-btn {
  font-size: 1.4rem;
  padding: 14px 48px;
  border: 2px solid rgba(255,255,255,0.5);
  background: rgba(255,255,255,0.1);
  color: #fff;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  font-family: inherit;
}

#play-btn:hover, #resume-btn:hover, #restart-btn:hover {
  background: rgba(255,255,255,0.25);
  border-color: #fff;
}

/* Pause Overlay */
#pause-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 800;
}

.pause-content {
  text-align: center;
}

.pause-content h2 {
  font-size: 3rem;
  margin-bottom: 1em;
}

.pause-content button {
  display: block;
  margin: 12px auto;
  min-width: 200px;
}

/* HUD */
#hud {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 100;
}

#score-display {
  position: absolute;
  top: 20px;
  right: 24px;
  font-size: 2.5rem;
  font-weight: 700;
  text-shadow: 0 2px 6px rgba(0,0,0,0.6);
}

#crosshair {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 4px;
  height: 4px;
  background: #fff;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

#power-bar-container {
  position: absolute;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  width: 200px;
  height: 14px;
  background: rgba(0,0,0,0.5);
  border: 1px solid rgba(255,255,255,0.4);
  border-radius: 7px;
  overflow: hidden;
}

#power-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #4caf50 0%, #ff9800 50%, #f44336 100%);
  transition: width 0.05s linear;
  border-radius: 7px;
}

#interaction-prompt {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.1rem;
  text-align: center;
  text-shadow: 0 1px 4px rgba(0,0,0,0.7);
  opacity: 0;
  transition: opacity 0.3s;
  white-space: nowrap;
}

#interaction-prompt.visible {
  opacity: 1;
}

/* Floating score popup */
.score-popup {
  position: fixed;
  font-size: 1.5rem;
  font-weight: 700;
  color: #ffd700;
  text-shadow: 0 2px 8px rgba(0,0,0,0.7);
  pointer-events: none;
  z-index: 150;
  animation: scoreFloat 1.5s ease-out forwards;
}

@keyframes scoreFloat {
  0% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-60px); }
}

.hidden {
  display: none !important;
}
