body {
  height: 100vh;
  background: linear-gradient(45deg, #1a1a2e, #16213e);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  overflow: hidden;
}
/* Retro Gaming Styles */
@import url("https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap");

.start-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(45deg, #1a1a2e, #16213e);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.retro-container {
  text-align: center;
  padding: 20px;
}

.retro-title {
  font-family: "Press Start 2P", cursive;
  color: #ffd700;
  font-size: 2em;
  margin-bottom: 20px;
}

.retro-border {
  border: 2px solid #ffd700;
  padding: 2px;
  background: #000;
}

.retro-content {
  border: 2px solid #ff0000;
  padding: 20px;
  background: #000;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.character-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}

.character-container {
  position: relative;
  padding: 10px;
  background: rgba(0, 0, 0, 0.5);
  border: 2px solid #ffd700;
  border-radius: 5px;
}

#characterCanvas {
  image-rendering: pixelated;
  transform: scale(1);
  margin: 0;
  border: none;
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
}

.character-label {
  font-family: "Press Start 2P", cursive;
  color: #ffd700;
  font-size: 0.8em;
  text-shadow: 2px 2px 0px #ff0000;
  letter-spacing: 2px;
  padding: 5px 10px;
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid #ffd700;
  border-radius: 3px;
}

.controls-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.retro-button {
  font-family: "Press Start 2P", cursive;
  background: #000;
  color: #ffd700;
  border: 2px solid #ffd700;
  padding: 8px 15px;
  font-size: 0.8em;
  cursor: pointer;
  transition: all 0.2s;
}

.retro-button:hover {
  background: #ffd700;
  color: #000;
}

.retro-button.small {
  padding: 5px 10px;
  font-size: 0.7em;
}

.retro-instructions {
  font-family: "Press Start 2P", cursive;
  color: #fff;
  font-size: 0.8em;
  line-height: 1.8;
  text-align: center;
  background: rgba(0, 0, 0, 0.7);
  padding: 10px 20px;
  border: 1px solid #ffd700;
  border-radius: 3px;
}

.retro-instructions p {
  margin: 5px 0;
  text-shadow: 2px 2px 0px #ff0000;
}

@keyframes glow {
  from {
    text-shadow: 0 0 5px #ffd700, 0 0 10px #ffd700, 0 0 15px #ff0000;
  }
  to {
    text-shadow: 0 0 10px #ffd700, 0 0 20px #ffd700, 0 0 30px #ff0000;
  }
}

/* Hide start screen when game starts */
.start-screen.hidden {
  display: none;
}

.game-container {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.game-controls {
  position: absolute;
  top: 20px;
  right: 20px;
  display: flex;
  gap: 10px;
  z-index: 100;
}

#canvas1 {
  border: 4px solid #ffd700;
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
  background: #000;
}

/* Pause Screen */
#pauseScreen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.pause-content {
  background: #000;
  border: 4px solid #ffd700;
  padding: 30px;
  text-align: center;
  min-width: 300px;
}

.pause-title {
  font-family: "Press Start 2P", cursive;
  color: #ffd700;
  font-size: 1.5em;
  margin-bottom: 30px;
  text-shadow: 4px 4px 0px #ff0000;
}

.pause-buttons {
  display: flex;
  gap: 20px;
  justify-content: center;
  margin-top: 30px;
}

.pause-buttons .retro-button {
  min-width: 120px;
}

/* Volume Controls in Pause Menu */
#pauseScreen .volume-controls {
  margin: 20px 0;
  padding: 15px;
  background: rgba(0, 0, 0, 0.5);
  border: 2px solid #ffd700;
  border-radius: 8px;
}

#pauseScreen .volume-controls-container {
  margin-top: 10px;
}

#pauseScreen .volume-slider-container {
  margin: 10px 0;
}

#pauseScreen .volume-text {
  font-size: 0.7em;
}

#gameOverScreen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

#gameOverScreen h1 {
  color: #ff0000;
  font-family: "Press Start 2P", cursive;
  font-size: 3em;
  margin-bottom: 1em;
}

#gameOverScreen button {
  font-family: "Press Start 2P", cursive;
  padding: 10px 20px;
  font-size: 1em;
  background-color: #ff0000;
  color: #ffd700;
  border: 2px solid #ffd700;
  cursor: pointer;
  transition: all 0.2s;
}

#gameOverScreen button:hover {
  background-color: #ffd700;
  color: #ff0000;
}

#gameUI {
  position: fixed;
  top: 20px;
  left: 20px;
  display: flex;
  gap: 20px;
  z-index: 100;
  background-color: rgba(0, 0, 0, 0.7);
  padding: 10px;
  border-radius: 5px;
}

#livesDisplay {
  color: #ffd700;
  font-family: "Press Start 2P", cursive;
  font-size: 1em;
  display: flex;
  align-items: center;
  gap: 5px;
}

#timerDisplay {
  color: #ffd700;
  font-family: "Press Start 2P", cursive;
  font-size: 1em;
  display: flex;
  align-items: center;
  gap: 5px;
  text-shadow: 2px 2px 0px #ff0000;
}

#timerDisplay::before {
  content: "⏱";
  color: #ff0000;
}

#scoreDisplay {
  color: #ffd700;
  font-family: "Press Start 2P", cursive;
  font-size: 1em;
  display: flex;
  align-items: center;
  gap: 5px;
  text-shadow: 2px 2px 0px #ff0000;
}

#scoreDisplay::before {
  content: "⭐";
  color: #ff0000;
}

#livesDisplay::before {
  content: "❤";
  color: #ff0000;
}

.hidden {
  display: none !important;
}

/* Animations */
@keyframes pulse {
  0% {
    transform: scale(1);
    text-shadow: 0 0 10px #ff0000;
  }
  50% {
    transform: scale(1.1);
    text-shadow: 0 0 20px #ff0000;
  }
  100% {
    transform: scale(1);
    text-shadow: 0 0 10px #ff0000;
  }
}

/* Mobile Controls */
.mobile-controls {
  display: none;
  position: fixed;
  bottom: 20px;
  left: 0;
  right: 0;
  padding: 10px;
  z-index: 100;
}

.d-pad {
  display: flex;
  gap: 20px;
  justify-content: center;
}

.mobile-button {
  font-family: "Press Start 2P", cursive;
  background: rgba(0, 0, 0, 0.7);
  color: #ffd700;
  border: 2px solid #ffd700;
  padding: 15px 25px;
  font-size: 1.2em;
  cursor: pointer;
  transition: all 0.2s;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.mobile-button:active {
  background: #ffd700;
  color: #000;
}

.mobile-button.jump {
  position: fixed;
  right: 20px;
  bottom: 20px;
  padding: 15px 30px;
}

.mobile-instructions {
  display: none;
}

/* Mobile Layout */
@media screen and (max-width: 1024px) {
  .phone {
    display: none;
  }

  .mobile-controls {
    display: flex;
  }

  .mobile-instructions {
    display: block;
  }

  #gameUI {
    position: fixed;
    top: 10px;
    left: 10px;
    right: 10px;
    padding: 5px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 5px;
    background-color: rgba(0, 0, 0, 0.7);
    border-radius: 5px;
  }

  #gameUI .retro-button {
    padding: 5px 10px;
    font-size: 0.7em;
    margin: 0;
  }

  #livesDisplay,
  #timerDisplay,
  #scoreDisplay {
    font-size: 0.8em;
    margin: 0;
  }

  .game-container {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
  }

  #canvas1 {
    width: 100%;
    height: 100%;
    object-fit: contain;
  }
}

/* Volume Controls */
.volume-controls {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 20px;
  padding: 10px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 8px;
}

.volume-controls-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.volume-slider-container {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 100%;
}

.volume-slider-container label {
  font-family: "Press Start 2P", cursive;
  font-size: 12px;
  color: #fff;
  text-shadow: 2px 2px 0 #000;
}

.volume-slider {
  -webkit-appearance: none;
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: #4a4a4a;
  outline: none;
  cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  transition: background 0.2s;
}

.volume-slider::-webkit-slider-thumb:hover {
  background: #e0e0e0;
}

.volume-text {
  color: white;
  font-family: "Press Start 2P", cursive;
  font-size: 0.6em;
  min-width: 60px;
  text-shadow: 1px 1px 0px #ff0000;
}

.button.small {
  padding: 8px 12px;
  font-size: 16px;
}

/* Mute button states */
.button.small.muted .button-text {
  content: "🔇";
}

#testSoundButton,
#pauseTestSoundButton {
  background: #4a90e2;
  border: 2px solid #2c5282;
  color: white;
  padding: 8px 16px;
  font-family: "Press Start 2P", cursive;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
  text-shadow: 2px 2px 0 #000;
  box-shadow: 2px 2px 0 #000;
}

#testSoundButton:hover,
#pauseTestSoundButton:hover {
  background: #357abd;
  transform: translateY(-2px);
}

#testSoundButton:active,
#pauseTestSoundButton:active {
  transform: translateY(0);
  box-shadow: 1px 1px 0 #000;
}

/* Level Completion Screen */
.completion-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.completion-content {
  background: #000;
  border: 4px solid #ffd700;
  padding: 30px;
  text-align: center;
  min-width: 300px;
  animation: glow 2s infinite;
}

.completion-content h2 {
  font-family: "Press Start 2P", cursive;
  color: #ffd700;
  font-size: 1.5em;
  margin-bottom: 20px;
  text-shadow: 4px 4px 0px #ff0000;
}

.completion-content p {
  font-family: "Press Start 2P", cursive;
  color: #fff;
  font-size: 1em;
  margin: 15px 0;
  text-shadow: 2px 2px 0px #ff0000;
}

.completion-content .retro-button {
  margin: 10px;
  min-width: 150px;
}

@keyframes glow {
  0% {
    box-shadow: 0 0 10px #ffd700, 0 0 20px #ffd700;
  }
  50% {
    box-shadow: 0 0 20px #ffd700, 0 0 40px #ffd700;
  }
  100% {
    box-shadow: 0 0 10px #ffd700, 0 0 20px #ffd700;
  }
}
