body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background: #111;
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  overflow: hidden;
}

#game-container {
  width: 100vw;
  height: 100vh;
  background: #1a1a2e;
  position: relative;
  overflow: hidden;
  background-image: 
    linear-gradient(45deg, rgba(0, 0, 0, 0.05) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(0, 0, 0, 0.05) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(0, 0, 0, 0.05) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(0, 0, 0, 0.05) 75%);
  background-size: 40px 40px;
  background-position: 0 0, 0 20px, 20px -20px, -20px 0px;
  background-color: #f0f0f0;
}

#player {
  width: 20px;
  height: 20px;
  background: #2ecc71;
  position: absolute;
  border-radius: 50%;
  transition: transform 0.1s;
  box-shadow: 0 0 15px rgba(46, 204, 113, 0.6);
}

#boss {
  width: 50px;
  height: 50px;
  background: #e74c3c;
  position: absolute;
  border-radius: 10px;
  transform-origin: center;
  box-shadow: 0 0 25px rgba(231, 76, 60, 0.6);
}

.projectile {
  position: absolute;
  background: #e74c3c;
  border-radius: 50%;
  width: 10px;
  height: 10px;
  box-shadow: 0 0 8px rgba(231, 76, 60, 0.6);
}

.spiral-projectile {
  background: #f1c40f;
  box-shadow: 0 0 8px rgba(241, 196, 15, 0.6);
}

.laser-beam {
  background: #9b59b6;
  height: 5px;
  width: 100vh;
  box-shadow: 0 0 12px rgba(155, 89, 182, 0.6);
}

.cross-projectile {
  background: #1abc9c;
  box-shadow: 0 0 10px rgba(26, 188, 156, 0.6);
  width: 12px;
  height: 12px;
}

.rain-projectile {
  background: #3498db;
  box-shadow: 0 0 8px rgba(52, 152, 219, 0.6);
  width: 8px;
  height: 15px;
  border-radius: 4px;
}

.burst-projectile {
  background: #e67e22;
  box-shadow: 0 0 10px rgba(230, 126, 34, 0.6);
  width: 8px;
  height: 8px;
}

.wave-projectile {
  background: #27ae60;
  box-shadow: 0 0 9px rgba(39, 174, 96, 0.6);
  width: 10px;
  height: 10px;
  clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
}

.raygun-projectile {
  background: #2ecc71;
  box-shadow: 0 0 14px rgba(46, 204, 113, 0.6);
  width: 6px;
  height: 16px;
  border-radius: 3px;
  transform-origin: center;
}

.bouncing-projectile {
  background: #9b59b6;
  box-shadow: 0 0 12px rgba(155, 89, 182, 0.8);
  width: 12px;
  height: 12px;
  border-radius: 4px;
}

.boxing-projectile {
  background: #e74c3c;
  box-shadow: 0 0 15px rgba(231, 76, 60, 0.8);
  width: 14px;
  height: 14px;
  clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%);
}

.fake-safe-projectile {
  background: #f1c40f;
  box-shadow: 0 0 10px rgba(241, 196, 15, 0.6);
  width: 8px;
  height: 8px;
}

.trap-projectile {
  background: #c0392b;
  box-shadow: 0 0 20px rgba(192, 57, 43, 1);
  width: 16px;
  height: 16px;
  clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
}

#health-bar {
  position: absolute;
  top: 30px;
  left: 30px;
  width: 300px;
  height: 10px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 5px;
  overflow: hidden;
  z-index: 100;
}

#health-fill {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #2ecc71, #27ae60);
  transition: width 0.2s;
  border-radius: 5px;
}

#game-over {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: #2c3e50;
  background: rgba(255, 255, 255, 0.95);
  padding: 40px 60px;
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(10px);
  z-index: 1000;
  animation: fadeIn 0.5s ease;
  min-width: 300px;
}

#game-over h1 {
  margin: 0 0 20px 0;
  font-size: 2.5em;
  font-weight: 700;
  color: #2c3e50;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

#game-over p {
  font-size: 1.2em;
  margin-bottom: 15px;
  color: #34495e;
  line-height: 1.5;
}

#game-over .stats {
  background: rgba(0, 0, 0, 0.05);
  padding: 15px;
  border-radius: 10px;
  margin: 20px 0;
  text-align: left;
}

#game-over .stat-item {
  margin: 10px 0;
  display: flex;
  justify-content: space-between;
  font-size: 1.1em;
}

#game-over button {
  padding: 15px 40px;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  background: #2ecc71;
  color: white;
  border: none;
  border-radius: 8px;
  margin-top: 20px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(46, 204, 113, 0.3);
}

#game-over button:hover {
  background: #27ae60;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(46, 204, 113, 0.4);
}

#game-over button:active {
  transform: translateY(0);
}

.phase2 #boss {
  background: #8e44ad;
  box-shadow: 0 0 35px rgba(142, 68, 173, 0.8);
  transition: all 1s ease;
}

.phase3 #boss {
  background: #c0392b;
  box-shadow: 0 0 45px rgba(192, 57, 43, 1);
  transition: all 1s ease;
  animation: phase3Pulse 2s infinite;
}

.screen-flash {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: white;
  z-index: 999;
  pointer-events: none;
  animation: flash 0.5s ease-out;
  opacity: 0;
}

@keyframes flash {
  0% { opacity: 0; }
  50% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

@keyframes phase3Pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translate(-50%, -60%); }
  to { opacity: 1; transform: translate(-50%, -50%); }
}

#timer {
  position: absolute;
  top: 30px;
  right: 30px;
  color: #2c3e50;
  font-size: 24px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.9);
  padding: 10px 20px;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  z-index: 100;
}

#audio-controls {
  position: absolute;
  bottom: 30px;
  right: 30px;
  z-index: 100;
}

#music-toggle {
  background: rgba(255, 255, 255, 0.9);
  border: none;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

#music-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

#music-toggle:active {
  transform: scale(0.95);
}

.music-on, .music-off {
  transition: opacity 0.3s ease;
}

#dialogue-box {
  position: absolute;
  bottom: 50px;
  left: 50%;
  transform: translateX(-50%);
  width: 80%;
  max-width: 800px;
  background: white;
  border: 5px solid #444;
  border-radius: 10px;
  padding: 20px;
  font-family: 'Determination Mono', monospace;
  font-size: 24px;
  color: #000;
  z-index: 1000;
  display: none;
  animation: fadeIn 0.5s ease;
}

#dialogue-text {
  margin: 0;
  min-height: 80px;
}

#dialogue-continue {
  position: absolute;
  bottom: 10px;
  right: 20px;
  animation: bounce 1s infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

.hidden {
  display: none;
}

@font-face {
  font-family: 'Determination Mono';
  src: url('https://cdn.jsdelivr.net/npm/determination-mono@1.0.0/DTM-Mono.woff2') format('woff2');
}