@import url("https://fonts.googleapis.com/css2?family=Black+Ops+One&display=swap");

:root {
  --ui-font: "Black Ops One", cursive;
  --wood-dark: #3e2723;
  --wood-light: #5d4037;
  --gold: #ffd700;
}

body {
  margin: 0;
  overflow: hidden;
  background-color: #111;
  font-family: var(--ui-font);
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  width: 100vw;
  color: white;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

#game-container {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  background-color: #000;
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.8);
}

canvas {
  display: block;
  image-rendering: auto;
  background-color: #87ceeb;
}

.ui-layer {
  position: absolute;
  pointer-events: none;
  padding: 15px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  z-index: 10;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.top-bar,
.bottom-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.bottom-bar {
  align-items: flex-end;
}

.ui-text-only {
  color: var(--gold);
  font-size: 28px;
  text-shadow: 3px 3px 0 #000, -1px -1px 0 #3e2723;
  letter-spacing: 2px;
}

.ui-box-bottom {
  background: rgba(62, 39, 35, 0.95);
  border: 3px solid #8d6e63;
  padding: 10px 15px;
  border-radius: 8px;
  min-width: 90px;
  text-align: center;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
}

.active-powerup {
  color: #00e676;
  font-size: 16px;
  text-shadow: 1px 1px 0 #000;
  margin-top: 5px;
  height: 20px;
  font-weight: bold;
}

.heart {
  color: #c0392b;
  font-size: 28px;
  text-shadow: 2px 2px 2px #000;
  margin-right: 4px;
  transition: transform 0.2s, opacity 0.2s;
  display: inline-block;
}
.heart.dead {
  color: #444;
  opacity: 0.3;
  transform: scale(0.8);
}

.ammo-display {
  letter-spacing: -2px;
  font-size: 26px;
  color: var(--gold);
}

.btn-ui {
  pointer-events: auto;
  background: linear-gradient(to bottom, #8d6e63, #3e2723);
  border: 2px solid #a1887f;
  color: var(--gold);
  font-family: inherit;
  font-size: 24px;
  width: 55px;
  height: 55px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  border-radius: 12px;
  box-shadow: 0 4px 0 #2d1e18, 0 5px 10px rgba(0, 0, 0, 0.5);
  z-index: 30;
  margin-left: 12px;
  transition: transform 0.1s, box-shadow 0.1s;
}
.btn-ui:active {
  transform: translateY(4px);
  box-shadow: 0 0 0 #2d1e18, inset 0 2px 5px rgba(0, 0, 0, 0.5);
}

/* --- NUKE BUTTON STYLES --- */
.nuke-btn {
  pointer-events: auto;
  background: radial-gradient(circle, #ff5e5e 0%, #c0392b 100%);
  border: 3px solid #e74c3c;
  color: #000;
  font-family: inherit;
  font-size: 32px;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 15px #ff0000, 0 5px 0 #922b21;
  display: flex;
  justify-content: center;
  align-items: center;
  animation: pulse-red 1s infinite;
  margin-bottom: 10px;
  transition: transform 0.1s;
}
.nuke-btn:active {
  transform: translateY(5px);
  box-shadow: 0 0 5px #ff0000, inset 0 5px 10px rgba(0, 0, 0, 0.5);
}
@keyframes pulse-red {
  0% {
    transform: scale(1);
    box-shadow: 0 0 10px #ff0000;
  }
  50% {
    transform: scale(1.1);
    box-shadow: 0 0 25px #ff0000;
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 10px #ff0000;
  }
}

#pauseOverlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  color: white;
  font-size: 60px;
  text-shadow: 5px 5px 0 #000;
  pointer-events: none;
  backdrop-filter: blur(4px);
  z-index: 15;
  letter-spacing: 5px;
}

.menu-screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(20, 20, 20, 0.96);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  pointer-events: all;
  z-index: 20;
}

.hidden {
  display: none !important;
}

h1 {
  color: var(--gold);
  text-shadow: 4px 4px 0 #000, 0 0 20px rgba(255, 215, 0, 0.5);
  margin-bottom: 10px;
  text-align: center;
  font-size: 3.5rem;
  letter-spacing: 3px;
  line-height: 1.1;
  text-transform: uppercase;
}
h2 {
  color: #bdc3c7;
  margin-bottom: 50px;
  text-align: center;
  font-size: 1.4rem;
  font-weight: normal;
  padding: 0 20px;
  max-width: 80%;
}

.menu-btn {
  background: linear-gradient(to bottom, #e67e22, #d35400);
  border: 3px solid #f39c12;
  color: #fff;
  padding: 20px 50px;
  font-family: inherit;
  font-size: 26px;
  cursor: pointer;
  margin-top: 20px;
  box-shadow: 0 6px 0 #a04000, 0 10px 20px rgba(0, 0, 0, 0.4);
  text-shadow: 2px 2px 0 #a04000;
  border-radius: 8px;
  transition: transform 0.1s, box-shadow 0.1s;
  text-transform: uppercase;
}
.menu-btn:active {
  transform: translateY(6px);
  box-shadow: 0 0 0 #a04000, inset 0 2px 5px rgba(0, 0, 0, 0.5);
}

.reload-msg {
  position: absolute;
  top: 60%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #e74c3c;
  font-size: 36px;
  font-weight: bold;
  text-shadow: 3px 3px 0 #000, 0 0 10px #e74c3c;
  pointer-events: none;
  white-space: nowrap;
  z-index: 12;
  animation: pulse 0.5s infinite alternate;
}
@keyframes pulse {
  from {
    opacity: 0.6;
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.1);
  }
}

.floating-text {
  position: absolute;
  color: #fff;
  font-size: 24px;
  font-weight: bold;
  pointer-events: none;
  text-shadow: 2px 2px 0 #000;
  animation: floatUp 1s cubic-bezier(0.215, 0.61, 0.355, 1) forwards;
  z-index: 11;
}

@keyframes floatUp {
  0% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
  100% {
    transform: translateY(-80px) scale(1.5);
    opacity: 0;
  }
}

#bossHud {
  transition: opacity 0.5s;
}
