* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', sans-serif;
}

body {
  background: #050608;
  color: #f4f6fc;
  overflow: hidden;
}

canvas {
  display: block;
}

.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(5, 6, 8, 0.92);
  z-index: 5;
  transition: opacity 0.3s ease;
}

.overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.panel {
  padding: 2.5rem 3rem;
  text-align: center;
  background: rgba(13, 16, 23, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(10px);
}

.panel h1 {
  font-size: 2rem;
  margin-bottom: 0.75rem;
}

.panel p {
  margin-bottom: 0.5rem;
  color: rgba(244, 246, 252, 0.78);
}

.panel .hint {
  font-size: 0.9rem;
  margin-top: 0.25rem;
}

button {
  margin-top: 1.5rem;
  padding: 0.75rem 2rem;
  border: none;
  background: #ff4444;
  color: #fff;
  font-size: 1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s ease;
}

button:hover {
  background: #ff6b6b;
}

/* Map Selection */
.map-selection {
  margin: 1rem 0;
  text-align: center;
}

.map-label {
  color: #999;
  font-size: 0.85rem;
  margin-bottom: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.map-options {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  max-width: 680px;
  margin: 0 auto;
}

.map-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.8rem 1.2rem;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 120px;
}

.map-option:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
}

.map-option.selected,
.map-option:has(input:checked) {
  background: rgba(77, 159, 255, 0.15);
  border-color: #4d9fff;
}

.map-option input {
  display: none;
}

.map-option .map-name {
  font-size: 1rem;
  font-weight: 500;
  color: #fff;
  margin-bottom: 0.25rem;
}

.map-option .map-desc {
  font-size: 0.75rem;
  color: #888;
}

.hud {
  position: absolute;
  top: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 2rem;
  padding: 0.6rem 1.4rem;
  background: rgba(5, 6, 8, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  z-index: 4;
  opacity: 0;
  transition: opacity 0.2s ease;
}

body.playing .hud {
  opacity: 1;
}

/* Weapon HUD - Bottom Right */
.weapon-hud {
  position: absolute;
  bottom: 2rem;
  right: 2rem;
  padding: 0.6rem 1.2rem;
  background: rgba(5, 6, 8, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  z-index: 4;
  opacity: 0;
  transition: opacity 0.2s ease;
  font-size: 1.1rem;
  color: #4d9fff;
  font-weight: 500;
}

body.playing .weapon-hud {
  opacity: 1;
}

/* Mini Map */
.mini-map {
  position: absolute;
  top: 1.5rem;
  right: 2rem;
  width: 160px;
  height: 160px;
  background: transparent;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  z-index: 4;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.5), inset 0 0 20px rgba(0, 0, 0, 0.3);
}

body.playing .mini-map {
  opacity: 1;
}

/* Pickup Message */
.pickup-message {
  position: absolute;
  bottom: 5rem;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.5rem 1rem;
  background: rgba(0, 0, 0, 0.7);
  border-radius: 4px;
  z-index: 4;
  opacity: 0;
  transition: opacity 0.3s ease;
  font-size: 1rem;
  color: #44ff66;
  font-weight: 500;
  pointer-events: none;
}

.pickup-message.visible {
  opacity: 1;
}

/* Weapon Slots HUD - Bottom Left */
.weapon-slots {
  position: absolute;
  bottom: 2rem;
  left: 2rem;
  display: flex;
  gap: 0.5rem;
  z-index: 4;
  opacity: 0;
  transition: opacity 0.2s ease;
}

body.playing .weapon-slots {
  opacity: 1;
}

.weapon-slots .slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.4rem 0.6rem;
  background: rgba(5, 6, 8, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  min-width: 50px;
  transition: all 0.15s ease;
}

.weapon-slots .slot.active {
  border-color: #4d9fff;
  background: rgba(77, 159, 255, 0.15);
}

.weapon-slots .slot.locked {
  opacity: 0.4;
}

.weapon-slots .slot .key {
  font-size: 0.7rem;
  color: #888;
  margin-bottom: 0.2rem;
}

.weapon-slots .slot.active .key {
  color: #4d9fff;
}

.weapon-slots .slot .name {
  font-size: 0.75rem;
  color: #ccc;
  font-weight: 500;
}

.crosshair {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 18px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 4;
  opacity: 0;
  transition: opacity 0.2s ease;
}

body.playing .crosshair {
  opacity: 1;
}

.crosshair span {
  position: absolute;
  background: #ffffff;
}

.crosshair span:first-child {
  width: 2px;
  height: 18px;
  left: 8px;
}

.crosshair span:last-child {
  width: 18px;
  height: 2px;
  top: 8px;
}

/* Blood Overlay Canvas */
#bloodOverlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 3;
  opacity: 0;
  transition: opacity 0.15s ease;
}

body.playing #bloodOverlay {
  opacity: 1;
}

/* Damage Flash Effect */
#damageFlash {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 20%, rgba(180, 0, 0, 0.6) 100%);
  pointer-events: none;
  z-index: 6;
  opacity: 0;
  transition: opacity 0.08s ease-out;
}

#damageFlash.active {
  animation: damageFlashAnim 0.35s ease-out forwards;
}

@keyframes damageFlashAnim {
  0% {
    opacity: 0.85;
  }

  100% {
    opacity: 0;
  }
}

/* Round Announcement */
#roundAnnounce {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 7;
  opacity: 0;
  transition: opacity 0.4s ease;
}

#roundAnnounce.visible {
  opacity: 1;
}

/* Hide round announcement when main overlay is visible - using body class */
body:not(.playing) #roundAnnounce {
  opacity: 0 !important;
  visibility: hidden;
}

#roundAnnounce span {
  font-size: 4rem;
  font-weight: 700;
  color: #ff4444;
  text-shadow: 0 0 30px rgba(255, 68, 68, 0.8), 0 4px 20px rgba(0, 0, 0, 0.6);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  animation: roundPulse 0.6s ease-out;
}

@keyframes roundPulse {
  0% {
    transform: scale(0.6);
    opacity: 0;
  }

  50% {
    transform: scale(1.1);
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Round display in HUD */
#roundDisplay {
  color: #ff6b6b;
  font-weight: 600;
}

/* Pause Menu Styles */
.pause-panel {
  min-width: 280px;
}

.pause-panel h1 {
  margin-bottom: 1.5rem;
}

.menu-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.menu-buttons button {
  width: 100%;
  margin-top: 0;
}

#toggleMusicButton {
  background: #4488ff;
}

#toggleMusicButton:hover {
  background: #66aaff;
}

#toggleMusicButton.off {
  background: #666;
}

#toggleMusicButton.off:hover {
  background: #888;
}

#quitButton {
  background: #666;
}

#quitButton:hover {
  background: #888;
}

body.paused .hud {
  opacity: 0.3;
}

body.paused .crosshair {
  opacity: 0.3;
}

body.paused .mini-map {
  opacity: 0.3;
}

/* Death Stats Screen */
.death-panel {
  min-width: 340px;
  border: 2px solid rgba(255, 60, 60, 0.5);
  box-shadow: 0 0 60px rgba(180, 0, 0, 0.4), 0 24px 48px rgba(0, 0, 0, 0.7);
}

.death-panel h1 {
  color: #ff3333;
  font-size: 2.8rem;
  text-shadow: 0 0 20px rgba(255, 50, 50, 0.8);
  margin-bottom: 1.5rem;
  letter-spacing: 0.2em;
}

.death-stats {
  margin: 1.5rem 0;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  padding: 0.6rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

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

.stat-label {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.95rem;
}

.stat-value {
  color: #fff;
  font-weight: 600;
  font-size: 1rem;
}

.death-buttons {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.death-buttons button {
  flex: 1;
  margin-top: 0;
}

#deathMenuButton {
  background: #555;
}

#deathMenuButton:hover {
  background: #777;
}

/* Settings Menu */
.settings-panel {
  min-width: 380px;
}

.settings-panel h1 {
  margin-bottom: 1.5rem;
}

.settings-list {
  margin: 1rem 0;
}

.setting-row {
  display: flex;
  align-items: center;
  padding: 0.8rem 0;
  gap: 1rem;
}

.setting-row label {
  flex: 1;
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.95rem;
}

.setting-row input[type="range"] {
  flex: 1.5;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
  cursor: pointer;
}

.setting-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  background: #ff4444;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.setting-row input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.setting-row input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  background: #ff4444;
  border-radius: 50%;
  border: none;
  cursor: pointer;
}

.setting-value {
  min-width: 50px;
  text-align: right;
  color: #4d9fff;
  font-weight: 500;
  font-size: 0.9rem;
}

#closeSettingsButton {
  width: 100%;
  margin-top: 1rem;
}

#settingsButton {
  background: #3a6ea5;
}

#settingsButton:hover {
  background: #4a8ec5;
}

/* Boss Health Bar */
.boss-health-bar {
  position: absolute;
  bottom: 6rem;
  left: 50%;
  transform: translateX(-50%);
  width: 400px;
  z-index: 4;
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.boss-health-bar:not(.hidden) {
  opacity: 1;
}

body.playing .boss-health-bar:not(.hidden) {
  opacity: 1;
}

.boss-name {
  text-align: center;
  font-size: 1.3rem;
  font-weight: 700;
  color: #ff4444;
  text-shadow: 0 0 10px rgba(255, 50, 50, 0.7);
  margin-bottom: 0.4rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.boss-health-container {
  height: 14px;
  background: rgba(0, 0, 0, 0.7);
  border: 2px solid rgba(255, 60, 60, 0.6);
  border-radius: 7px;
  overflow: hidden;
  box-shadow: 0 0 15px rgba(255, 50, 50, 0.3);
}

.boss-health-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #ff2222, #ff4444, #ff6666);
  border-radius: 5px;
  transition: width 0.2s ease;
  box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.2);
}
