/* ==========================================================================
   SQUID CHAOS — Escape the Memeverse | Game Engine & Canvas Styling
   ========================================================================== */

.game-stage-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.5rem 1rem 1.5rem;
  min-height: calc(100vh - 80px);
}

/* Top In-Game Bar */
.game-top-bar {
  background: rgba(28, 28, 46, 0.85);
  backdrop-filter: blur(10px);
  border: 1px solid var(--color-card-border);
  border-radius: 16px 16px 0 0;
  z-index: 10;
}

.hud-world-tag {
  color: var(--color-cyan);
  background: rgba(54, 228, 255, 0.1);
  border: 1px solid rgba(54, 228, 255, 0.3);
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  font-weight: 700;
  letter-spacing: 1px;
}

.hud-score {
  font-size: 1.75rem;
  line-height: 1;
  text-shadow: 0 0 10px rgba(198, 255, 61, 0.4);
}

.hud-multiplier-pill {
  background: linear-gradient(135deg, var(--color-purple), var(--color-pink));
  color: #fff;
  font-weight: 800;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.85rem;
  box-shadow: 0 0 12px rgba(255, 79, 216, 0.4);
  transition: transform 0.15s ease;
}

.hud-multiplier-pill.bump {
  transform: scale(1.3) rotate(5deg);
}

.hud-coins-pill {
  background: rgba(255, 210, 63, 0.15);
  border: 1px solid rgba(255, 210, 63, 0.4);
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-weight: 700;
}

.heart-icon {
  font-size: 1.25rem;
  opacity: 0.25;
  filter: grayscale(1);
  transition: all 0.2s ease;
}

.heart-icon.active {
  opacity: 1;
  filter: grayscale(0);
  text-shadow: 0 0 10px rgba(239, 68, 68, 0.6);
}

/* Boss HUD Health Bar */
.boss-hud-bar {
  background: rgba(16, 16, 25, 0.95);
  border-left: 1px solid var(--color-card-border);
  border-right: 1px solid var(--color-card-border);
  padding: 0.5rem 0;
  z-index: 9;
}

.boss-progress-track {
  height: 10px;
  background-color: #222233;
  border-radius: 6px;
  overflow: hidden;
}

#boss-progress-fill {
  background: linear-gradient(90deg, #ff0055, #ff5500);
  box-shadow: 0 0 10px rgba(255, 0, 85, 0.8);
  transition: width 0.2s ease-out;
}

/* Meme Frenzy Meter Strip */
.frenzy-meter-container {
  position: relative;
  width: 100%;
  z-index: 8;
}

.frenzy-progress-track {
  height: 6px;
  background-color: #1a1a2b;
  border-radius: 0;
}

.frenzy-progress-fill {
  background: linear-gradient(90deg, var(--color-cyan), var(--color-lime), var(--color-pink));
  transition: width 0.1s linear;
}

.frenzy-active-badge {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 79, 216, 0.9);
  color: #fff;
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 800;
  padding: 0.25rem 1rem;
  border-radius: 999px;
  letter-spacing: 1px;
  box-shadow: 0 0 20px rgba(255, 79, 216, 0.7);
  animation: pulse-frenzy 0.8s infinite alternate;
  z-index: 15;
}

@keyframes pulse-frenzy {
  0% { transform: translateX(-50%) scale(1); }
  100% { transform: translateX(-50%) scale(1.08); }
}

/* Active Powerups Badges Overlay */
.hud-powerups-overlay {
  position: absolute;
  top: 60px;
  left: 20px;
  z-index: 12;
  pointer-events: none;
}

.powerup-hud-pill {
  background: rgba(16, 16, 25, 0.85);
  border: 1px solid var(--color-cyan);
  padding: 0.25rem 0.6rem;
  border-radius: 8px;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-heading);
  box-shadow: var(--glow-cyan);
  animation: slide-in-powerup 0.2s ease-out;
}

@keyframes slide-in-powerup {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Canvas Viewport */
.canvas-viewport {
  width: 100%;
  height: 520px;
  background-color: #0b0b12;
  border: 1px solid var(--color-card-border);
  border-top: none;
  border-radius: 0 0 16px 16px;
  overflow: hidden;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.7);
}

#game-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* Floating Effects Layer */
.game-fx-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 14;
}

.near-miss-toast {
  position: absolute;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--color-lime);
  text-shadow: 0 0 10px rgba(0, 0, 0, 0.9), 0 0 20px var(--color-lime);
  pointer-events: none;
  animation: float-near-miss 0.9s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  white-space: nowrap;
}

@keyframes float-near-miss {
  0% {
    opacity: 0;
    transform: translate(-50%, 0) scale(0.6) rotate(-5deg);
  }
  20% {
    opacity: 1;
    transform: translate(-50%, -20px) scale(1.2) rotate(2deg);
  }
  80% {
    opacity: 1;
    transform: translate(-50%, -45px) scale(1) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -70px) scale(0.8);
  }
}

/* Game Modal Overlays (Pause, Game Over, Victory) */
.game-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(11, 11, 18, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 25;
  animation: fade-in-overlay 0.2s ease-out;
}

@keyframes fade-in-overlay {
  from { opacity: 0; }
  to { opacity: 1; }
}

.game-dialog-card {
  background: var(--color-card);
  border: 1px solid var(--color-card-border);
  border-radius: 20px;
  width: 90%;
  max-width: 440px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
}

.game-over-icon,
.victory-icon {
  font-size: 3rem;
  line-height: 1;
}

/* Mobile Touch Controls */
.mobile-touch-bar {
  background: rgba(28, 28, 46, 0.9);
  border: 1px solid var(--color-card-border);
  border-radius: 16px;
  margin-top: 1rem;
}

.touch-control-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 90px;
  height: 75px;
  border-radius: 16px;
  border: 2px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  transition: all 0.1s ease;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

.touch-control-btn:active {
  transform: scale(0.92);
}

.touch-btn-jump {
  border-color: var(--color-lime);
  background: rgba(198, 255, 61, 0.15);
  color: var(--color-lime);
  box-shadow: 0 0 15px rgba(198, 255, 61, 0.2);
}

.touch-btn-slide {
  border-color: var(--color-cyan);
  background: rgba(54, 228, 255, 0.15);
  color: var(--color-cyan);
  box-shadow: 0 0 15px rgba(54, 228, 255, 0.2);
}
