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

body {
  overflow: hidden;
  font-family: 'Segoe UI', 'Comic Sans MS', sans-serif;
  background: #aaddff;
}

#game-canvas {
  display: block;
  width: 100vw;
  height: 100vh;
}

/* HUD */
#hud {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  pointer-events: none;
}

.hud-bar {
  display: flex;
  justify-content: center;
  gap: 16px;
  padding: 10px 16px;
}

.hud-player {
  background: rgba(255, 255, 255, 0.85);
  border: 3px solid;
  border-radius: 12px;
  padding: 6px 14px;
  min-width: 160px;
  text-align: center;
  backdrop-filter: blur(4px);
}

.hud-name {
  font-weight: bold;
  font-size: 13px;
  margin-bottom: 2px;
}

.hud-stats {
  display: flex;
  gap: 10px;
  justify-content: center;
  font-size: 14px;
}

.hud-key-shared {
  text-align: center;
  font-size: 20px;
  font-weight: bold;
  color: #fff;
  text-shadow: 0 2px 4px rgba(0,0,0,0.4);
  margin-top: 2px;
}

.hud-level {
  text-align: center;
  color: #fff;
  text-shadow: 0 2px 4px rgba(0,0,0,0.3);
  font-size: 18px;
  font-weight: bold;
  margin-top: 4px;
}

/* Flash overlay for lightning */
#flash-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(255,255,255,0.9), rgba(170,100,255,0.7));
  opacity: 0;
  pointer-events: none;
  z-index: 15;
  transition: opacity 0.05s ease-in;
}

/* Menu */
#menu {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #ffccee, #ccddff, #ccffcc, #ffffcc);
  z-index: 20;
}

#menu h1 {
  font-size: 56px;
  background: linear-gradient(90deg, #ff6688, #ffaa44, #ffee55, #66dd88, #6688ff, #cc66ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 20px;
  text-shadow: none;
}

.controls-info {
  background: rgba(255,255,255,0.7);
  border-radius: 16px;
  padding: 20px 30px;
  margin-bottom: 24px;
  text-align: left;
  font-size: 15px;
  line-height: 1.8;
}

.controls-info b {
  display: inline-block;
  min-width: 140px;
}

.controls-info kbd {
  background: #eee;
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 1px 6px;
  font-family: monospace;
  font-size: 14px;
}

.player-count-select {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  font-size: 18px;
  font-weight: bold;
}

.player-count-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 3px solid #cc88dd;
  background: rgba(255,255,255,0.6);
  font-size: 20px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s;
}

.player-count-btn.selected {
  background: linear-gradient(135deg, #ff88aa, #ffaa66);
  color: white;
  border-color: #ff6688;
  transform: scale(1.1);
}

.player-count-btn:hover {
  transform: scale(1.1);
}

#start-btn, #next-level-btn, #restart-btn {
  background: linear-gradient(135deg, #ff88aa, #ffaa66);
  border: none;
  color: white;
  font-size: 22px;
  padding: 14px 40px;
  border-radius: 30px;
  cursor: pointer;
  font-weight: bold;
  box-shadow: 0 4px 12px rgba(255,100,100,0.3);
  transition: transform 0.2s;
}

#start-btn:hover, #next-level-btn:hover, #restart-btn:hover {
  transform: scale(1.05);
}

/* Level Complete / Game Over overlays */
#level-complete, #game-over {
  display: none;
  position: fixed;
  inset: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(255, 240, 255, 0.92);
  z-index: 20;
  backdrop-filter: blur(6px);
}

#level-complete h2, #game-over h2 {
  font-size: 36px;
  margin-bottom: 20px;
  color: #884488;
}

.score-summary {
  background: rgba(255,255,255,0.8);
  border-radius: 12px;
  padding: 16px 24px;
  margin-bottom: 20px;
  min-width: 280px;
}

.score-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 18px;
  border-bottom: 1px solid #eee;
}

.score-row:last-child {
  border-bottom: none;
}
