/* General styles */
@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

/* Thank You Screen Styles */
#thankYouScreen {
  background: radial-gradient(circle at center, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.98) 100%);
  z-index: 200; /* Higher than other overlays */
}

.thank-you-content {
  max-width: 800px;
  padding: 40px;
  background: rgba(0, 0, 0, 0.7);
  border: 4px solid #FFD700;
  border-radius: 20px;
  box-shadow: 0 0 30px rgba(255, 215, 0, 0.5),
              inset 0 0 20px rgba(255, 215, 0, 0.3);
  text-align: center;
}

.thank-you-content h1 {
  font-size: 3rem;
  color: #FFD700;
  text-shadow: 0 0 10px #FFD700, 
               0 0 20px #FFD700,
               3px 3px 0 #8B8000,
               5px 5px 0 #000;
  margin-bottom: 2rem;
  letter-spacing: 3px;
  animation: titleGlow 2s infinite alternate;
}

.thank-you-content p {
  font-size: 1.5rem;
  margin: 1.5rem 0;
  color: #00FFFF;
  text-shadow: 0 0 5px #00FFFF;
}

#continueBtn {
  margin-top: 3rem;
  font-size: 1.5rem;
  padding: 1rem 2rem;
  background-color: #4CAF50;
  color: white;
  border: none;
  border-radius: 8px;
  box-shadow: 0 0 15px #4CAF50,
              0 5px 0 #2E7D32;
  transition: all 0.2s;
  cursor: pointer;
}

#continueBtn:hover {
  background-color: #45a049;
  transform: translateY(-3px);
  box-shadow: 0 0 20px #4CAF50,
              0 8px 0 #2E7D32;
}

#continueBtn:active {
  transform: translateY(2px);
  box-shadow: 0 0 10px #4CAF50,
              0 2px 0 #2E7D32;
}

/* Fullscreen styles handled by transform scale */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
}

body {
  font-family: 'Press Start 2P', Arial, sans-serif;
  background-color: #121212;
  color: #e0e0e0;
  margin: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  touch-action: none;
}

#gameWrapper {
  position: relative;
  transform-origin: center center;
  margin: auto;
}

#gameContainer {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  width: 1350px;
  height: 900px;
  margin: 0 auto;
  padding: 0;
}

body {
  background-color: #000000;
  color: #00ff41;
}

#gameCanvas {
  border: 4px solid #00ffff;  /* Cyan border */
  background-color: #000000;
  box-shadow: 0 0 20px rgba(0, 255, 255, 0.5);
  border-radius: 20px 20px 8px 8px;
  overflow: hidden;
}

#gameTitle {
  color: #00ffff;  /* Neon cyan */
  text-shadow: 0 0 10px #00ffff, 0 0 20px #00ffff;
}

#hud {
  background: rgba(0, 0, 0, 0.7);
  border: 2px solid #00ff41;
  box-shadow: 0 0 10px rgba(0, 255, 65, 0.5);
}

button {
  background-color: #000000;
  color: #00ffff;
  border: 2px solid #00ffff;
  box-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

button:hover {
  background-color: #00ffff;
  color: #000000;
  box-shadow: 0 0 20px rgba(0, 255, 255, 0.8);
}

#gameTitle {
  position: relative; /* Change from absolute to relative */
  top: auto; /* Reset positioning */
  left: auto; /* Reset positioning */
  margin-bottom: 20px; /* Add some space below the title */
  text-align: center; /* Center the text */
  font-size: 32px;
  color: #FFD700;
  text-shadow: 3px 3px 0 #8B8000, 5px 5px 0 #000;
  letter-spacing: 3px;
  white-space: nowrap;
}

/* New title particle effect */
.title-particle-rain {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

.title-particle-rain .particle {
  position: absolute;
  background-color: #FFD700;
  border-radius: 50%;
  pointer-events: none;
  animation: rainFall linear infinite;
  opacity: 0.8;
  filter: drop-shadow(0 0 5px #FFD700);
}

/* Particle sizes and positions */
.title-particle-rain .particle:nth-child(1) {
  width: 3px;
  height: 3px;
  left: 5%;
  animation-duration: 6s;
  animation-delay: 0s;
}

.title-particle-rain .particle:nth-child(2) {
  width: 4px;
  height: 4px;
  left: 15%;
  animation-duration: 7s;
  animation-delay: 1s;
}

.title-particle-rain .particle:nth-child(3) {
  width: 2px;
  height: 2px;
  left: 25%;
  animation-duration: 8s;
  animation-delay: 2s;
}

.title-particle-rain .particle:nth-child(4) {
  width: 3px;
  height: 3px;
  left: 35%;
  animation-duration: 6.5s;
  animation-delay: 0.5s;
}

.title-particle-rain .particle:nth-child(5) {
  width: 4px;
  height: 4px;
  left: 45%;
  animation-duration: 7.5s;
  animation-delay: 1.5s;
}

.title-particle-rain .particle:nth-child(6) {
  width: 2px;
  height: 2px;
  left: 55%;
  animation-duration: 8.5s;
  animation-delay: 2.5s;
}

.title-particle-rain .particle:nth-child(7) {
  width: 3px;
  height: 3px;
  left: 65%;
  animation-duration: 6s;
  animation-delay: 0.7s;
}

.title-particle-rain .particle:nth-child(8) {
  width: 4px;
  height: 4px;
  left: 75%;
  animation-duration: 7s;
  animation-delay: 1.7s;
}

.title-particle-rain .particle:nth-child(9) {
  width: 2px;
  height: 2px;
  left: 85%;
  animation-duration: 8s;
  animation-delay: 2.7s;
}

.title-particle-rain .particle:nth-child(10) {
  width: 3px;
  height: 3px;
  left: 95%;
  animation-duration: 6.5s;
  animation-delay: 0.3s;
}

@keyframes rainFall {
  0% {
    transform: translateY(-50px) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 0.8;
  }
  90% {
    opacity: 0.8;
  }
  100% {
    transform: translateY(calc(100vh + 50px)) rotate(360deg);
    opacity: 0;
  }
}

#hud {
  position: absolute;
  top: 0;
  right: 0;
  width: 200px;
  font-size: 16px;
  color: #ffffff;
  background: rgba(0, 0, 0, 0.85);
  padding: 20px;
  border-radius: 8px;
  border: 2px solid #00ffff;
  display: flex;
  flex-direction: column;
  gap: 15px;
  box-shadow: 0 0 15px rgba(0, 255, 255, 0.3);
}

#hud span {
  display: inline-block;
  white-space: nowrap;
  text-shadow: 0 0 8px #ffffff;
}

#controlsIndicator {
  position: absolute;
  top: 220px;
  right: 0;
  font-size: 14px;
  color: #ffffff;
  background: rgba(0, 0, 0, 0.85);
  padding: 20px;
  border-radius: 8px;
  border: 2px solid #00ffff;
  width: 200px;
  text-align: left;
  line-height: 1.8;
  box-shadow: 0 0 15px rgba(0, 255, 255, 0.3);
}

.section-title {
  color: #FFD700;
  font-size: 16px;
  text-transform: uppercase;
  margin: 15px 0 10px 0;
  padding-bottom: 5px;
  border-bottom: 1px solid #FFD700;
  text-shadow: 0 0 10px #FFD700;
}

#controlsIndicator div {
  margin: 8px 0;
  padding: 3px 0;
}

#controlsIndicator span {
  color: #FFD700;
  text-shadow: 0 0 8px #FFD700;
}

#controlsIndicator span + span {
  color: #00ffff;
  margin-left: 10px;
  text-shadow: 0 0 8px #00ffff;
}

#pauseIndicator {
  color: #FFD700;
  font-size: 18px;
  text-shadow: 0 0 15px #FFD700;
  letter-spacing: 2px;
}

/* High Score Display */
#highScoreContainer {
  position: absolute;
  top: 500px;
  left: 0;
  width: 220px;
  font-size: 14px;
  color: #ffffff;
  background: rgba(0, 0, 0, 0.85);
  padding: 15px;
  border-radius: 8px;
  border: 2px solid #FFD700;
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
  z-index: 10;
}

.highScoreParticle {
  position: absolute;
  width: 4px;
  height: 4px;
  background-color: #FFD700;
  border-radius: 50%;
  animation: highScorePop 1s ease-out forwards;
  pointer-events: none;
  z-index: 20;
}

@keyframes highScorePop {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  100% {
    transform: scale(3);
    opacity: 0;
  }
}
  


#highScoreDisplay {
  font-size: 24px;
  color: #FFD700;
  text-shadow: 0 0 10px #FFD700;
  text-align: center;
  margin-top: 10px;
  font-family: 'Press Start 2P', Arial, sans-serif;
  animation: pulse-gold 1.5s infinite;
}

@keyframes pulse-gold {
  0% { text-shadow: 0 0 5px #FFD700; }
  50% { text-shadow: 0 0 20px #FFD700; }
  100% { text-shadow: 0 0 5px #FFD700; }
}

/* Power-up styles enhancement */
.power-green, 
.power-blue, 
.power-yellow, 
.power-purple {
  font-weight: bold;
  padding: 4px 8px;
  border-radius: 4px;
  margin: 2px 0;
  letter-spacing: 1px;
}

.power-green + span,
.power-blue + span,
.power-yellow + span,
.power-purple + span {
  font-size: 13px;
  letter-spacing: 0.5px;
}

/* Active effects display */
#activeEffects {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.power-up-name {
  color: #00ffff;
  text-shadow: 0 0 5px #00ffff;
  font-size: 14px;
  letter-spacing: 1px;
  padding: 5px;
  border-radius: 4px;
  display: none;
  margin: 3px 0;
  animation: pulse 1.5s infinite;
}

.power-up-name.active {
  display: block;
}

/* Level Complete Message */
.level-message {
  position: absolute;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -60%);
  font-size: 32px;
  color: #FFD700;
  text-shadow: 3px 3px 0 #8B8000, 5px 5px 0 #000;
  letter-spacing: 3px;
  white-space: nowrap;
  z-index: 100;
  opacity: 0;
  transition: opacity 0.5s;
}
.level-message {
    position: fixed;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -60%);
    font-size: 48px;
    color: #FFD700;
    text-shadow: 0 0 10px #FFD700, 0 0 20px #FFD700, 3px 3px 0 #000;
    letter-spacing: 3px;
    text-align: center;
    opacity: 0;
    z-index: 100;
    pointer-events: none;
    animation: messageFade 2s ease-out;
    width: 100%;
    padding: 0 20px;
    box-sizing: border-box;
}

@keyframes messageFade {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
    20% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); }
    80% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(1.3); }
}

#resetBtn {
  position: absolute;
  top: 0;
  left: 0;
  width: 200px;
  padding: 12px;
  font-size: 14px;
  background-color: #f44336;
  box-shadow: 0 4px 0 #d32f2f;
  margin-left: 0;
}

#hud span {
  display: inline-block;
  white-space: nowrap;
}

#pauseIndicator {
  color: #FFD700;
  display: none;
  width: 100%;
  text-align: center;
  margin-top: 5px;
}

#pauseIndicator:not(.hidden) {
  display: block;
  animation: pulse 1s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 5px currentColor;
        opacity: 0.8;
    }
    50% {
        box-shadow: 0 0 20px currentColor;
        opacity: 1;
    }
    100% {
        box-shadow: 0 0 5px currentColor;
        opacity: 0.8;
    }
}

.shield-effect {
    color: #FFFF00;
    text-shadow: 0 0 5px #FFFF00;
    background: rgba(255, 255, 0, 0.1);
}

.base-shield-effect {
    color: #00FFFF;
    text-shadow: 0 0 5px #00FFFF;
    background: rgba(0, 255, 255, 0.1);
}

.magic-effect {
    color: #FF00FF;
    text-shadow: 0 0 5px #FF00FF;
    background: rgba(255, 0, 255, 0.1);
}

.rapid-effect {
    color: #FF4500;
    text-shadow: 0 0 5px #FF4500;
    background: rgba(255, 69, 0, 0.1);
}

/* Button Styles */
button {
  padding: 12px 24px;
  font-size: 18px;
  font-family: 'Press Start 2P', Arial, sans-serif;
  cursor: pointer;
  border: none;
  background-color: #4CAF50;
  color: white;
  border-radius: 8px;
  margin-top: 20px;
  transition: all 0.3s;
  box-shadow: 0 4px 0 #2E7D32;
}

button:hover {
  background-color: #45a049;
  transform: translateY(-2px);
  box-shadow: 0 6px 0 #2E7D32;
}

button:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #2E7D32;
}

/* Overlay screens */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: white;
  text-align: center;
  z-index: 10;
  padding: 20px;
}

.overlay.hidden {
  display: none;
}

/* Timer styles */
#activeEffects {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.power-up-name {
  color: #00ffff;
  text-shadow: 0 0 5px #00ffff;
  font-size: 14px;
  letter-spacing: 1px;
  padding: 5px;
  border-radius: 4px;
  display: none;
  margin: 3px 0;
  animation: pulse 1.5s infinite;
}

.power-up-name.active {
  display: block;
}

.timer-item {
  display: none !important;
}

@keyframes blink {
  0% { opacity: 0.3; }
  50% { opacity: 1; }
  100% { opacity: 0.3; }
}

.shield-timer {
  background: rgba(255, 255, 0, 0.2);
  color: #FFFF00;
  text-shadow: 0 0 5px #FFFF00;
}

.base-shield-timer {
  background: rgba(0, 255, 255, 0.2);
  color: #00FFFF;
  text-shadow: 0 0 5px #00FFFF;
}

.magic-timer {
  background: rgba(255, 0, 255, 0.2);
  color: #FF00FF;
  text-shadow: 0 0 5px #FF00FF;
}

/* Power Up Info */
#powerUpInfo {
  position: absolute;
  top: 80px;
  left: 0;
  width: 220px;
  font-size: 14px;
  color: #ffffff;
  background: rgba(0, 0, 0, 0.85);
  padding: 15px;
  border-radius: 8px;
  border: 2px solid #00ffff;
  box-shadow: 0 0 15px rgba(0, 255, 255, 0.3);
}

/* Color classes for power-ups */
.power-green { color: #00FF00; text-shadow: 0 0 5px #00FF00; }
.power-yellow { color: #FFFF00; text-shadow: 0 0 5px #FFFF00; }
.power-blue { color: #00FFFF; text-shadow: 0 0 5px #00FFFF; }
.power-purple { color: #FF00FF; text-shadow: 0 0 5px #FF00FF; }

/* Start Screen Styles */
#gameWrapper {
  display: none; /* Hide the game initially */
}

#startScreen {
  background-color: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(5px);
  z-index: 100;
}

#startScreen h1 {
  font-size: 4rem;
  color: #FFD700;
  text-shadow: 
    0 0 10px #FFD700,
    0 0 20px #FFD700,
    0 0 30px #FFD700,
    3px 3px 0 #8B8000,
    5px 5px 0 #000;
  margin-bottom: 2rem;
  letter-spacing: 5px;
  animation: titleGlow 2s infinite alternate;
  position: relative;
  padding: 20px 40px;
  background: linear-gradient(145deg, rgba(139,0,0,0.3) 0%, rgba(184,134,11,0.3) 100%);
  border-radius: 15px;
  border: 3px solid #FFD700;
  box-shadow: 
    0 0 25px rgba(255, 215, 0, 0.5),
    inset 0 0 15px rgba(255, 215, 0, 0.3);
  transform-style: preserve-3d;
}

#startScreen h1::before {
  content: "";
  position: absolute;
  top: -5px;
  left: -5px;
  right: -5px;
  bottom: -5px;
  background: linear-gradient(145deg, 
    rgba(255,215,0,0.1) 0%, 
    rgba(255,215,0,0.3) 50%, 
    rgba(255,215,0,0.1) 100%);
  border-radius: 20px;
  z-index: -1;
  filter: blur(10px);
  animation: pulseBorder 3s infinite alternate;
}

.title-particles {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  z-index: -1;
}

.title-particles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.title-particles .particle {
  position: absolute;
  background-color: #FFD700;
  border-radius: 50%;
  pointer-events: none;
  animation: floatParticle 8s infinite linear;
}

.title-particles .particle:nth-child(1) {
  width: 6px;
  height: 6px;
  top: 20%;
  left: 10%;
  animation-delay: 0s;
  opacity: 0.8;
}

.title-particles .particle:nth-child(2) {
  width: 4px;
  height: 4px;
  top: 60%;
  left: 15%;
  animation-delay: 1s;
  opacity: 0.6;
}

.title-particles .particle:nth-child(3) {
  width: 5px;
  height: 5px;
  top: 30%;
  right: 10%;
  animation-delay: 2s;
  opacity: 0.7;
}

.title-particles .particle:nth-child(4) {
  width: 3px;
  height: 3px;
  top: 70%;
  right: 15%;
  animation-delay: 3s;
  opacity: 0.5;
}

.title-particles .particle:nth-child(5) {
  width: 4px;
  height: 4px;
  top: 10%;
  left: 50%;
  animation-delay: 4s;
  opacity: 0.6;
}

.title-particles .particle:nth-child(6) {
  width: 5px;
  height: 5px;
  bottom: 10%;
  left: 50%;
  animation-delay: 5s;
  opacity: 0.7;
}

@keyframes floatParticle {
  0% {
    transform: translateY(0) translateX(0);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    transform: translateY(-100px) translateX(20px);
    opacity: 0;
  }
}

@keyframes floatParticle {
  0%, 100% {
    transform: translate(0, 0) scale(1);
    opacity: 0.3;
  }
  50% {
    transform: translate(20px, -20px) scale(1.2);
    opacity: 0.8;
  }
}

@keyframes titleGlow {
  from {
    text-shadow: 
      0 0 10px #FFD700,
      0 0 20px #FFD700,
      3px 3px 0 #8B8000,
      5px 5px 0 #000;
    box-shadow: 
      0 0 25px rgba(255, 215, 0, 0.5),
      inset 0 0 15px rgba(255, 215, 0, 0.3);
  }
  to {
    text-shadow: 
      0 0 15px #FFD700,
      0 0 30px #FFD700,
      0 0 45px #FFD700,
      3px 3px 0 #8B8000,
      5px 5px 0 #000;
    box-shadow: 
      0 0 35px rgba(255, 215, 0, 0.7),
      inset 0 0 25px rgba(255, 215, 0, 0.5);
  }
}

@keyframes pulseBorder {
  0% {
    opacity: 0.5;
    transform: translateZ(-10px);
  }
  100% {
    opacity: 1;
    transform: translateZ(0);
  }
}

#startScreen p {
  font-size: 1.2rem;
  margin: 1rem 0;
  color: #00FFFF;
  text-shadow: 0 0 5px #00FFFF;
}

#startBtn {
  margin-top: 2rem;
  font-size: 1.5rem;
  padding: 1rem 2rem;
  background-color: #FF4500;
  color: white;
  border: none;
  border-radius: 8px;
  box-shadow: 
    0 0 10px #FF4500,
    0 5px 0 #D03400;
  transition: all 0.2s;
}

#startBtn:hover {
  transform: translateY(-3px);
  box-shadow: 
    0 0 15px #FF4500,
    0 8px 0 #D03400;
}

#startBtn:active {
  transform: translateY(2px);
  box-shadow: 
    0 0 5px #FF4500,
    0 2px 0 #D03400;
}

/* Game Over Screen Styles */
#gameOverScreen {
  background: radial-gradient(circle at center, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.95) 100%);
  backdrop-filter: blur(10px);
  z-index: 100;
  overflow: hidden;
}

#gameOverTitle {
  position: relative;
  z-index: 101;
}

.sword-slash {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 600px;
  height: 4px;
  background: linear-gradient(90deg, 
    rgba(255,255,255,0) 0%, 
    rgba(255,255,255,0.9) 50%,
    rgba(255,255,255,0) 100%);
  transform: translate(-50%, -50%) rotate(-15deg);
  z-index: 100;
  animation: slashFade 2.5s ease-out forwards;
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.8));
}

@keyframes slashFade {
  0% { opacity: 0; transform: translate(-50%, -50%) rotate(-15deg) scaleX(0); }
  15% { opacity: 1; transform: translate(-50%, -50%) rotate(-15deg) scaleX(1); }
  85% { opacity: 1; transform: translate(-50%, -50%) rotate(-15deg) scaleX(1); }
  100% { opacity: 0; transform: translate(-50%, -50%) rotate(-15deg) scaleX(1); }
}

.blood-particle {
  position: absolute;
  width: 6px;
  height: 6px;
  background-color: #8a0303;
  border-radius: 50%;
  z-index: 99;
  animation: bloodDrop 3s ease-out forwards;
  filter: drop-shadow(0 0 3px #ff0000);
}

@keyframes bloodDrop {
  0% { 
    transform: translateY(0) scale(1);
    opacity: 1;
  }
  100% { 
    transform: translateY(100px) scale(0.5);
    opacity: 0;
  }
}

#gameOverScreen::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    linear-gradient(45deg, 
      rgba(255,0,0,0.1) 0%, 
      rgba(255,69,0,0.1) 20%, 
      rgba(255,215,0,0.1) 40%, 
      rgba(0,255,255,0.1) 60%, 
      rgba(138,43,226,0.1) 80%, 
      rgba(255,0,255,0.1) 100%);
  animation: gradientBG 15s ease infinite;
  background-size: 400% 400%;
  z-index: -1;
}

@keyframes gradientBG {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

#gameOverScreen h1 {
  font-size: 4rem;
  color: #FF4500;
  text-shadow: 
    3px 3px 0 #8B0000,
    5px 5px 0 #000;
  margin-bottom: 2rem;
  letter-spacing: 5px;
}

.skull-icon {
  position: absolute;
  top: 2%; /* Changed from 10% to move it even higher */
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 120px;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><path fill="%23FF4500" d="M50 10c-22 0-40 18-40 40 0 8 3 15 7 21l-7 19h80l-7-19c4-6 7-13 7-21 0-22-18-40-40-40zm0 10c16 0 30 14 30 30 0 16-14 30-30 30-16 0-30-14-30-30 0-16 14-30 30-30zm-20 15c-3 0-5 2-5 5s2 5 5 5 5-2 5-5-2-5-5-5zm40 0c-3 0-5 2-5 5s2 5 5 5 5-2 5-5-2-5-5-5zm-40 25c-4 0-7 3-7 7s3 7 7 7h40c4 0 7-3 7-7s-3-7-7-7h-40z"/></svg>');
  background-size: contain;
  background-repeat: no-repeat;
  filter: drop-shadow(0 0 15px #FF4500);
  animation: skullPulse 1.5s infinite alternate;
  z-index: 101;
  opacity: 1;
}

.skull-icon::before {
  content: "";
  position: absolute;
  top: 15%;
  left: 15%;
  width: 70%;
  height: 70%;
  background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 70%);
  border-radius: 50%;
  z-index: -1;
}

.skull-icon::after {
  content: "";
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 5px;
  background: rgba(0,0,0,0.3);
  border-radius: 50%;
  filter: blur(2px);
}

@keyframes skullPulse {
  0% {
    transform: translateX(-50%) scale(1) rotate(0deg);
    filter: drop-shadow(0 0 15px #FF4500);
  }
  50% {
    transform: translateX(-50%) scale(1.2) rotate(-5deg);
    filter: drop-shadow(0 0 30px #FF4500);
  }
  100% {
    transform: translateX(-50%) scale(1) rotate(0deg);
    filter: drop-shadow(0 0 15px #FF4500);
  }
}

@keyframes gameOverGlow {
  from {
    text-shadow: 
      0 0 10px #FF4500,
      0 0 20px #FF4500,
      3px 3px 0 #8B0000,
      5px 5px 0 #000;
  }
  to {
    text-shadow: 
      0 0 15px #FF4500,
      0 0 30px #FF4500,
      0 0 45px #FF4500,
      3px 3px 0 #8B0000,
      5px 5px 0 #000;
  }
}

#gameOverScreen p {
  font-size: 1.5rem;
  margin: 1.5rem 0;
  color: #FFD700;
  text-shadow: 0 0 5px #FFD700;
}

#gameOverReason {
  font-size: 1.8rem;
  color: #FF6347;
  text-shadow: 0 0 8px #FF6347;
  margin-bottom: 2rem;
  animation: blink 1.5s infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

#finalScore, #finalLevel {
  font-size: 1.8rem;
  color: #00FFFF;
  text-shadow: 0 0 8px #00FFFF;
  display: inline-block;
  padding: 0 10px;
}

#restartBtn {
  margin-top: 2rem;
  font-size: 1.5rem;
  padding: 1rem 2rem;
  background-color: #FF4500;
  color: white;
  border: none;
  border-radius: 8px;
  box-shadow: 
    0 0 15px #FF4500,
    0 5px 0 #D03400;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}

#restartBtn::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    to bottom right,
    rgba(255,255,255,0.3) 0%,
    rgba(255,255,255,0) 60%
  );
  transform: rotate(30deg);
  animation: shine 3s infinite;
}

@keyframes shine {
  0% { transform: rotate(30deg) translate(-30%, -30%); }
  100% { transform: rotate(30deg) translate(30%, 30%); }
}

#restartBtn:hover {
  transform: translateY(-3px);
  box-shadow: 
    0 0 20px #FF4500,
    0 8px 0 #D03400;
}

#restartBtn:active {
  transform: translateY(2px);
  box-shadow: 
    0 0 10px #FF4500,
    0 2px 0 #D03400;
}

/* Particle effects for game over screen */
#gameOverScreen::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(circle at 20% 30%, rgba(255,0,0,0.1) 0%, transparent 30%),
    radial-gradient(circle at 80% 70%, rgba(0,255,255,0.1) 0%, transparent 30%);
  pointer-events: none;
  animation: float 20s linear infinite;
}

@keyframes float {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-5%, 5%); }
  50% { transform: translate(5%, -5%); }
  75% { transform: translate(-5%, 5%); }
  100% { transform: translate(0, 0); }
}

@media (max-width: 768px) {
  #gameOverScreen h1 {
    font-size: 2.5rem;
  }
  #gameOverReason, #finalScore, #finalLevel {
    font-size: 1.2rem;
  }
  #restartBtn {
    font-size: 1.2rem;
    padding: 0.8rem 1.5rem;
  }
}

/* Responsive layout relies entirely on transform: scale now */

/* Mobile Layout Styles (triggered by JS in portrait orientation) */
.mobile-layout #gameContainer {
  width: 850px;
  height: 1300px;
  justify-content: center;
  padding-top: 10px;
  gap: 15px;
}

.mobile-layout #gameTitle {
  position: relative;
  margin-bottom: 0;
  order: 1;
}

.mobile-layout #hud {
  position: relative;
  top: auto;
  right: auto;
  width: 832px;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: space-around;
  order: 2;
  padding: 10px;
  box-sizing: border-box;
}

.mobile-layout #gameCanvas {
  order: 3;
  margin-top: 0;
}

.mobile-layout #powerUpInfo {
  position: relative;
  top: auto;
  left: auto;
  width: 832px;
  order: 4;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-around;
  align-items: center;
  padding: 10px;
  box-sizing: border-box;
}
.mobile-layout #powerUpInfo br {
  display: none;
}
.mobile-layout #powerUpInfo .section-title {
  width: 100%;
  text-align: center;
  margin-top: 0;
  margin-bottom: 10px;
}
.mobile-layout #activeEffects {
  width: 100%;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.mobile-layout #controlsIndicator {
  position: relative;
  top: auto;
  right: auto;
  width: 832px;
  order: 5;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-around;
  padding: 10px;
  box-sizing: border-box;
}
.mobile-layout #controlsIndicator .section-title {
  width: 100%;
  text-align: center;
  margin-top: 0;
  margin-bottom: 10px;
}

.mobile-layout #highScoreContainer {
  position: relative;
  top: auto;
  left: auto;
  width: 832px;
  order: 6;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 30px;
  padding: 10px;
  box-sizing: border-box;
}
.mobile-layout #highScoreContainer .section-title {
  margin: 0;
  border-bottom: none;
}
.mobile-layout #highScoreDisplay {
  margin-top: 0;
}

.mobile-layout #resetBtn {
  position: relative;
  top: auto;
  left: auto;
  width: auto;
  padding: 15px 40px;
  order: 7;
  margin: 0;
}