.screen-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100cqw;
  height: 100cqh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 20;
  background-color: rgba(10, 4, 22, 0.4);
  transition: opacity var(--transition-slow) ease-in-out;
}

.victory-title {
  font-family: var(--font-display);
  font-size: 8cqh;
  font-weight: bold;
  color: var(--color-gold-bright);
  text-shadow: 0 0 10px rgba(0, 0, 0, 0.9), 0 0 20px var(--color-purple-magical);
  margin-bottom: 3cqh;
  text-align: center;
  animation: float 5s ease-in-out infinite;
  display: flex;
  justify-content: center;
  align-items: center;
}

.game-title {
  margin-top: -6cqh;
  margin-bottom: 8cqh;
  animation: float 5s ease-in-out infinite;
  display: flex;
  justify-content: center;
  align-items: center;
}

.game-title-image {
  width: 40cqw;
  height: auto;
  filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.75));
}

.start-button {
  width: 32cqw;
  height: 17cqh;
  background-image: url('../../assets/images/ui/start-btn.webp');
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  border: none;
  background-color: transparent;
  cursor: pointer;
  outline: none;
  position: relative;
  top: -9cqh;
  transition: transform var(--transition-fast) cubic-bezier(0.175, 0.885, 0.32, 1.275), filter var(--transition-fast);
  filter: drop-shadow(0 0 12px rgba(255, 215, 0, 0.4));
  animation: start-button-pulse 2s ease-in-out infinite;
}

.start-button:hover {
  animation: none;
  transform: scale(1.1);
  filter: drop-shadow(0 0 25px rgba(255, 215, 0, 0.8)) brightness(1.15);
}

.start-button:active {
  animation: none;
  transform: scale(0.95);
}

.dialogue-bubble {
  position: absolute;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  padding: 3.2cqw 3.2cqw 4.5cqw 3.2cqw;
  box-sizing: border-box;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  pointer-events: auto;
  opacity: 0;
  transform: scale(0.8) translateY(2cqh);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.dialogue-bubble.visible {
  opacity: 1;
  transform: scale(1) translateY(0);
}

.dialogue-bubble.mooshak-style {
  background-image: url('../../assets/images/ui/speech-bubble-2.webp');
  width: 18cqw;
  aspect-ratio: 1;
  color: #ffffff;
}

.dialogue-bubble.ganesha-style {
  background-image: url('../../assets/images/ui/speech-bubble-2.webp');
  width: 20cqw;
  aspect-ratio: 1;
  color: #ffffff;
}


.dialogue-bubble.bubble-mooshak {
  left: 58cqw;
  bottom: 45cqh;
}

.scene-hallwayreveal .dialogue-bubble.bubble-mooshak,
.scene-ganeshaintroduction .dialogue-bubble.bubble-mooshak,
.scene-gameplay .dialogue-bubble.bubble-mooshak,
.scene-completion .dialogue-bubble.bubble-mooshak {
  left: 8cqw;
  bottom: 37cqh;
  background-image: url('../../assets/images/ui/speech-bubble-1.webp');
}

.dialogue-bubble.bubble-ganesha {
  left: 49cqw;
  bottom: 43cqh;
}

.dialogue-bubble.bubble-fallback {
  left: 50cqw;
  transform: translate(-50%, -50%);
  top: 30cqh;
}

.dialogue-text {
  font-family: var(--font-body);
  font-size: 2.3cqh;
  font-weight: 600;
  line-height: 1.4;
  width: 100%;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}





.game-helper-text {
  position: absolute;
  top: 6cqh;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-display);
  font-size: 3.2cqh;
  color: var(--color-text-light);
  background: rgba(10, 4, 22, 0.75);
  padding: 1.5cqh 4cqw;
  border-radius: 4cqh;
  border: 2px solid var(--color-magic-blue);
  box-shadow: 0 0 20px rgba(0, 229, 255, 0.3);
  text-align: center;
  z-index: 15;
  pointer-events: none;
}

.ending-overlay {
  background-color: transparent !important;
}

.result-text-image {
  background-image: url('../../assets/images/ui/result-txt.webp');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  width: 60cqw;
  height: 40cqh;
  animation: pulse-dance 3s ease-in-out infinite;
}




.hidden {
  display: none !important;
}

.debug-panel {
  display: none;
  position: absolute;
  top: 2cqh;
  left: 2cqw;
  background: rgba(10, 4, 22, 0.9);
  border: 2px solid #00e5ff;
  border-radius: 8px;
  padding: 1.5cqh 1.5cqw;
  color: #fff;
  z-index: 10000;
  font-family: 'Outfit', sans-serif;
  font-size: 1.6cqh;
  pointer-events: auto;
  flex-direction: column;
  gap: 1cqh;
  min-width: 220px;
  box-shadow: 0 0 15px rgba(0, 229, 255, 0.4);
}

.debug-title {
  font-weight: bold;
  color: #ffd700;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  padding-bottom: 0.5cqh;
  margin-bottom: 0.5cqh;
  font-size: 1.8cqh;
  letter-spacing: 1px;
}

.debug-row {
  display: flex;
  justify-content: space-between;
}

.debug-row span {
  font-family: monospace;
  color: #00e5ff;
  font-weight: bold;
}

.debug-actions {
  display: flex;
  gap: 1cqw;
  margin-top: 1cqh;
}

.debug-btn {
  flex: 1;
  background: #00e5ff;
  border: none;
  padding: 0.8cqh 1cqw;
  border-radius: 4px;
  color: #0a0416;
  font-weight: bold;
  cursor: pointer;
  font-size: 1.4cqh;
  transition: background 0.2s, transform 0.1s;
}

.debug-btn:hover {
  background: #ffd700;
  transform: scale(1.05);
}

.debug-btn:active {
  transform: scale(0.95);
}

/* Debug target circle pointing to Ganesha mouth coordinates */
.debug-target-circle {
  position: absolute;
  width: 4cqw;
  height: 4cqw;
  min-width: 16px;
  min-height: 16px;
  border: 0.3cqw solid #ffd700;
  background-color: rgba(255, 215, 0, 0.3);
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, 50%);
  z-index: 99999;
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.8), inset 0 0 8px rgba(255, 215, 0, 0.5);
  display: none;
  animation: debug-pulse 1.5s ease-in-out infinite;
}

/* Pulsing animation for the debug circle to make it clearly visible */
@keyframes debug-pulse {
  0% {
    transform: translate(-50%, 50%) scale(1);
    opacity: 0.8;
  }

  50% {
    transform: translate(-50%, 50%) scale(1.2);
    opacity: 1;
    box-shadow: 0 0 25px rgba(255, 215, 0, 1), inset 0 0 12px rgba(255, 215, 0, 0.7);
  }

  100% {
    transform: translate(-50%, 50%) scale(1);
    opacity: 0.8;
  }
}

/* Debug hitbox circle representing Ganesha's actual eating radius */
.debug-ganesha-hitbox {
  --ganesha-hitbox-radius: 7;
  position: absolute;
  /* Use cqw for both width & height so the visual hitbox is a perfect circle */
  width: calc(var(--ganesha-hitbox-radius) * 2cqw);
  height: calc(var(--ganesha-hitbox-radius) * 2cqw);
  border: 0.4cqw dashed #ff3b30;
  background-color: rgba(255, 59, 48, 0.15);
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, 50%);
  z-index: 99998;
  opacity: 0;
  /* Use opacity instead of display:none so getBoundingClientRect() still works when hidden */
  transition: opacity 0.2s ease;

  /* ADJUST HITBOX CENTER POSITION HERE: */
  left: 52cqw;
  bottom: 36cqh;

  box-shadow: 0 0 10px rgba(255, 59, 48, 0.5);
}

.debug-ganesha-hitbox.visible {
  opacity: 1;
}

.brand-logo {
  position: fixed;
  top: 4vh;
  left: 4vw;
  width: 12vw;
  height: auto;
  z-index: 100;
  pointer-events: none;
  filter: drop-shadow(0 0 8px rgba(0, 0, 0, 0.5));
}