* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background-color: #2e19ff;
}

.square {
  border: 100px solid #810044;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(0deg);
}

.hud {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  text-align: center;
  color: #fff;
  font-family: system-ui, sans-serif;
  user-select: none;
}

.hud__instructions {
  margin-bottom: 10px;
  font-size: 1.1rem;
  opacity: 0.85;
}

.hud__stat {
  margin-top: 8px;
  font-size: 0.9rem;
  opacity: 0.7;
}

.meter {
  width: 260px;
  height: 14px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.15);
  overflow: hidden;
}

.meter__fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #810044, #b9ff73);
  transition: width 0.05s linear;
}

.win-banner {
  position: fixed;
  top: 38%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.7);
  z-index: 30;
  font-size: 3rem;
  font-weight: normal;
  color: #b9ff73;
  text-shadow: 0 0 20px rgba(185, 255, 115, 0.8);
  font-family: "Luckiest Guy", system-ui, sans-serif;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.win-banner.is-visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

body.is-winning {
  animation: screen-shake 0.1s linear infinite;
}

/* Fully opaque takeover: while exploding, this covers the squares, HUD and
   faster-prompts entirely so the strobe/blast is the only thing on screen. */
.explosion {
  position: fixed;
  inset: 0;
  z-index: 25;
  pointer-events: none;
  opacity: 0;
  background-color: #fff;
}

.explosion.is-visible {
  opacity: 1;
}

.explosion.is-exploding {
  animation: explosion-strobe 0.56s steps(1, end) infinite;
}

.explosion::after {
  content: "";
  position: fixed;
  top: 50%;
  left: 50%;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 10px solid rgba(255, 255, 255, 0.9);
  mix-blend-mode: difference;
  transform: translate(-50%, -50%) scale(0);
  opacity: 0;
}

.explosion.is-exploding::after {
  animation: explosion-ring 1s cubic-bezier(0.1, 0.7, 0.25, 1) forwards;
}

@keyframes explosion-strobe {
  0% { background-color: #ffffff; }
  25% { background-color: #ff1f3d; }
  50% { background-color: #fde047; }
  75% { background-color: #ff00c8; }
  100% { background-color: #2e19ff; }
}

@keyframes explosion-ring {
  0% { transform: translate(-50%, -50%) scale(0); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(150); opacity: 0; }
}

@keyframes screen-shake {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-6px, 4px); }
  50% { transform: translate(5px, -6px); }
  75% { transform: translate(-4px, -3px); }
  100% { transform: translate(6px, 5px); }
}

.faster-prompt {
  position: fixed;
  transform: translate(-50%, -50%) scale(0.2);
  font-family: "Luckiest Guy", system-ui, sans-serif;
  font-weight: normal;
  font-size: 2rem;
  color: #fde047;
  text-shadow: 0 0 12px rgba(249, 115, 22, 0.85), 0 0 4px rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  user-select: none;
  white-space: nowrap;
  z-index: 15;
  transition: opacity 0.3s ease;
}

.faster-prompt.is-visible {
  opacity: 0.9;
}

.reload-control {
  position: fixed;
  top: 64%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.7);
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.reload-control.is-visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  pointer-events: auto;
}

.reload-control__button {
  font-size: 3.2rem;
  line-height: 1;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.6);
  background: rgba(0, 0, 0, 0.4);
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}

.reload-control__button:hover {
  transform: scale(1.08);
  background: rgba(0, 0, 0, 0.55);
}

.reload-control__button:active {
  transform: scale(0.94);
}

.reload-control__caption {
  font-family: "Luckiest Guy", system-ui, sans-serif;
  font-weight: normal;
  font-size: 1.2rem;
  color: #fff;
  text-shadow: 0 0 12px rgba(0, 0, 0, 0.6);
  user-select: none;
}
