@import url("https://fonts.googleapis.com/css2?family=Play:wght@400;700&display=swap");

body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  height: 100vh;
  width: 100vw;
  margin: 0;
  background-color: #000;
  overflow: hidden; /* no scroll */
}

/* Big container that will be scaled to fit viewport */
.game-root {
  position: relative;
  width: 1250px; /* design width (matches canvas) */
  transform-origin: top center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* HUD sits above canvas as a normal block */
.hud {
  position: relative;
  margin: 10px auto 0px;
  height: 45px; /* design HUD height */
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 8px;
  width: 100%;
  text-align: center;
}

/* Smaller yellow timer inside HUD, override any absolute rules */
#hud .timer {
  position: relative;
  top: auto;
  left: auto;
  transform: none;
  color: #ffd700; /* yellow */
  font-family: "Play", sans-serif; /* apply Play only to the timer */
  font-size: 24px;
  font-weight: 700;
}
/* Smaller white level text inside HUD */
#hud .desc {
  position: relative;
  left: auto;
  bottom: auto;
  transform: none;
  color: #fff; /* white */
  font-family: sans-serif;
  font-size: 24px;
  font-weight: 700;
}
/* Separator */
.hud .sep {
  color: #fff;
  font-size: 24px;
  line-height: 1;
}

/* Canvas block below HUD */
.game-container {
  width: 1250px;
  height: 700px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#gameCanvas {
  display: block;
  width: 1250px; /* keep designed size; visual scaling happens on .game-root */
  height: 700px;
  border: 1px solid black;
}

/* existing timer rule (kept for compatibility outside HUD) */
.timer {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  font-family: sans-serif;
  font-size: 75px;
  font-weight: bold;
}

/* existing desc rule (kept for compatibility outside HUD) */
.desc {
  position: absolute;
  bottom: 27px;
  left: 40%;
  font-family: sans-serif;
  font-size: 50px;
  font-weight: bold;
}

/* HUD hearts */
#hud .hearts,
.hearts {
  font-size: 24px;
  line-height: 1;
  letter-spacing: 2px; /* a bit of spacing between hearts */
  display: inline-block;
  vertical-align: middle;
}

/* Explosion animations */
@keyframes explode {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.5);
    opacity: 0.5;
  }
  100% {
    transform: scale(2);
    opacity: 0;
  }
}

.exploding {
  position: absolute;
  background-size: cover;
  animation: explode 0.5s forwards;
  pointer-events: none;
}

/* NEW: only for green-square explosion to avoid cropping */
.exploding-green {
  position: absolute;
  background-size: contain; /* show full sprite, no crop */
  background-repeat: no-repeat; /* don’t tile */
  background-position: center; /* keep centered as it scales */
  transform-origin: center; /* scale from center */
  image-rendering: pixelated; /* crisp scaling for pixel art */
  z-index: 9999; /* ensure it renders above everything */
}

#nextLevelButton {
  margin: 0 auto;
}

/* Settings row under welcome buttons (global, used outside themed versions too) */
.settings-row {
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.settings-label {
  color: #222;
  font-weight: 600;
  font-size: 14px;
}
