/* Inventory Boxes */
#bombInventory, #freezeInventory {
  min-width: 100px;
  padding: 15px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: rgba(0,0,0,0.4);
  border-radius: 8px;
  font-size: 28px;
  color: #fff;
  text-align: center;
  text-shadow: 0 0 8px #fff;
  user-select: none;
  pointer-events: none;
}

.inventoryEmoji { font-size: 32px; line-height: 1; text-align: center; }
.inventoryCount {
  font-size: 32px;
  font-weight: bold;
  background: linear-gradient(45deg, #ff0000, #00ff00, #0000ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradientShift 3s ease infinite;
  text-align: center;
  margin: 5px 0;
}

.inventorySwipe { font-size: 12px; color: #ccc; text-align: center; }

/* Swipe instructions */
.swipe-text {
  font-size: 14px;
  font-family: 'Press Start 2P', monospace;
  background: linear-gradient(45deg, #ff0000, #00ff00, #0000ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradientShift 3s ease infinite;
  text-align: center;
  margin-top: 5px;
}

/* Game Over Overlay */
#gameOverOverlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: rgba(0,0,0,0.8);
  color: #fff;
  font-size: 24px;
  z-index: 10000;
  padding: 20px;
  box-sizing: border-box;
}

#gameOverOverlay > div { margin: 0 auto; }
#gameOverOverlay button { border: none; cursor: pointer; }

/* Vertical stacking for overlay buttons */
#overlayButtons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  justify-content: center;
  margin-top: 15px;
  width: 100%;
  align-items: center;
}

#overlayButtons button {
  width: 90%;
  max-width: 400px;
  margin: 10px auto;
  background: rgba(255,255,255,0.2);
  border: 2px solid rgba(255,255,255,0.5);
  border-radius: 12px;
  padding: 12px 0;
  font-family: 'Press Start 2P', cursive;
  color: #fff;
  text-shadow: 0 0 8px #000;
  transition: background 0.3s, transform 0.2s;
}

#overlayButtons button:hover {
  background: rgba(255,255,255,0.3);
  transform: scale(1.02);
}

/* Overlay Options */
#overlayOptions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-top: 15px;
}

.toggle-control {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 10px;
  color: #fff;
}

.toggle-switch {
  position: relative;
  width: 40px;
  height: 20px;
  margin-top: 2px;
}

.toggle-switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #ccc;
  border-radius: 20px;
  transition: 0.4s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  border-radius: 50%;
  transition: 0.4s;
}

input:checked + .slider { background-color: #66bb6a; }
input:checked + .slider:before { transform: translateX(20px); }

/* Music mode toggle styling */
.music-mode-toggle input:not(:checked) + .slider { background-color: #66bb6a; }
.music-mode-toggle input:checked + .slider { background-color: #66bb6a; }
.music-mode-toggle input:disabled + .slider { opacity: 0.5; cursor: not-allowed; }

.music-mode-label {
  font-family: 'Press Start 2P', cursive;
  font-size: 14px;
  transition: all 0.3s;
}

.active-music-mode { color: #66bb6a; text-shadow: 0 0 8px #66bb6a; }
.inactive-music-mode { color: #ff0000; text-shadow: none; }
.music-mode-label.disabled { opacity: 0.5; }

/* Overlay rules icon */
#overlayRulesIcon {
  display: block;
  font-size: 18px;
  color: #fff;
  text-align: center;
  cursor: pointer;
  margin-top: 3px;
}

/* Fullscreen Button */
#overlayFullscreenBtn {
  position: absolute;
  bottom: 20px;
  right: 20px;
  background: rgba(0,0,0,0.6);
  border: none;
  border-radius: 20px;
  font-size: 28px;
  padding: 8px;
  cursor: pointer;
  color: #fff;
  z-index: 11000;
}

/* Instructions Panel */
#instructionsPanel {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.8);
  color: #fff;
  display: none;
  z-index: 11000;
  padding: 20px;
  overflow-y: auto;
}

#instructionsContent {
  max-width: 600px;
  margin: 50px auto;
  background: #222;
  padding: 20px;
  border-radius: 8px;
  text-align: left;
}

#instructionsContent h2 { margin-top: 0; text-align: center; }
#instructionsContent ul { list-style: none; padding: 0; }
#instructionsContent li { margin-bottom: 10px; font-size: 18px; line-height: 1.6; }

#closeInstructions {
  margin-top: 20px;
  padding: 8px 16px;
  font-size: 16px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

/* Game Title Styling */
#gameTitle {
  font-family: 'Press Start 2P', cursive, sans-serif;
  font-size: 72px;
  text-align: center;
  margin-bottom: 20px;
  animation: colorCycle 3s infinite;
  text-shadow: 3px 3px 8px rgba(0,0,0,0.5);
}

#gameTitle .title-line { display: block; }
#gameTitle .title-line.title-line-burst { margin-left: 20px; }

.finalScoreLabel {
  font-family: 'Press Start 2P', cursive;
  font-size: 32px;
  color: #fff;
  text-shadow: 2px 2px 5px #000;
}

/* Coin Display in bottom right */
#coinDisplay {
  position: fixed;
  bottom: 10px;
  right: 10px;
  font-size: 24px;
  color: #fff;
  z-index: 1000;
  font-family: 'VT323', monospace;
  text-shadow: 0 0 5px #000;
}

/* Mystery Reward Display as power‑up tabs on lower left */
#mysteryRewardDisplay {
  position: fixed;
  bottom: 10px;
  left: 10px;
  z-index: 1000;
}

.powerup-tabs {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.powerup-tab {
  background-color: rgba(0, 0, 0, 0.7);
  border: 1px solid #fff;
  color: #fff;
  padding: 8px 12px;
  border-radius: 8px;
  font-family: 'VT323', monospace;
  font-size: 20px;
  cursor: pointer;
  box-shadow: 2px 2px 6px rgba(0,0,0,0.5);
  transition: transform 0.2s, background-color 0.3s;
}

.powerup-tab:hover {
  background-color: rgba(255,255,255,0.2);
  transform: scale(1.05);
}
