/* ─── Equilibrium Run Styles ──────────────────────────────────────────── */

body {
  background: #0f172a;
  margin: 0;
  overflow-x: hidden;
}

#gameContainer {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: calc(100vh - 80px);
}

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

/* HUD Overlay */
.game-hud {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  pointer-events: none;
  z-index: 10;
  font-family: 'Outfit', sans-serif;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

.hud-distance {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: 1px;
  background: rgba(0, 0, 0, 0.35);
  padding: 4px 18px;
  border-radius: 12px;
  backdrop-filter: blur(4px);
}

.hud-biome {
  position: absolute;
  top: 16px;
  left: 16px;
  font-size: 0.85rem;
  font-weight: 600;
  background: rgba(0, 0, 0, 0.35);
  padding: 4px 12px;
  border-radius: 8px;
  backdrop-filter: blur(4px);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.hud-wind {
  position: absolute;
  top: 16px;
  right: 16px;
  font-size: 1.4rem;
  font-weight: 700;
  background: rgba(0, 0, 0, 0.35);
  padding: 4px 14px;
  border-radius: 8px;
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  gap: 6px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.hud-wind.active {
  opacity: 1;
}

.hud-wind .wind-arrow {
  display: inline-block;
  transition: transform 0.3s ease;
  font-size: 1.6rem;
}

.hud-tutorial-hint {
  position: absolute;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1rem;
  font-weight: 600;
  background: rgba(0, 0, 0, 0.5);
  padding: 8px 20px;
  border-radius: 10px;
  backdrop-filter: blur(4px);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.5s ease;
  text-align: center;
}

.hud-tutorial-hint.visible {
  opacity: 1;
}

/* Game Container */
.game-container {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.game-container .game-touch-capture {
  touch-action: none;
  width: 100%;
  height: 100%;
}

/* Canvas fill responsive */
.game-container canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
  touch-action: none;
}

/* Mobile Buttons */
.mobile-controls {
  position: absolute;
  bottom: 20px;
  left: 0;
  right: 0;
  display: none;
  justify-content: space-between;
  padding: 0 20px;
  pointer-events: none;
  z-index: 20;
}

@media (hover: none) and (pointer: coarse) {
  .mobile-controls {
    display: flex;
  }
}

.mobile-btn {
  width: 64px;
  height: 64px;
  min-width: 44px;
  min-height: 44px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(4px);
  color: #fff;
  font-size: 1.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  touch-action: none;
  transition: background 0.15s ease, transform 0.1s ease;
}

.mobile-btn:active {
  background: rgba(255, 255, 255, 0.25);
  transform: scale(0.92);
}

/* Game Over Overlay */
.game-over-overlay {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  font-family: 'Outfit', sans-serif;
  color: #fff;
}

.game-over-overlay.visible {
  display: flex;
}

.game-over-title {
  font-size: 2.8rem;
  font-weight: 800;
  margin-bottom: 8px;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.game-over-distance {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 6px;
  opacity: 0.85;
}

.game-over-biome {
  font-size: 1rem;
  font-weight: 400;
  margin-bottom: 24px;
  opacity: 0.7;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.game-over-restart-btn {
  padding: 14px 40px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  font-family: 'Outfit', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  cursor: pointer;
  pointer-events: auto;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.35);
  margin-bottom: 16px;
}

.game-over-restart-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(245, 158, 11, 0.5);
}

.game-over-restart-btn:active {
  transform: scale(0.96);
}

.game-over-ad-placeholder {
  width: 300px;
  height: 60px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  opacity: 0.5;
  margin-top: 8px;
}

/* Biome-specific HUD colors during transition handled via JS */

/* Responsive */
@media (max-width: 480px) {
  .hud-distance {
    font-size: 1.6rem;
    top: 12px;
    padding: 2px 14px;
  }

  .hud-biome {
    font-size: 0.7rem;
    top: 12px;
    left: 10px;
  }

  .hud-wind {
    font-size: 1.1rem;
    top: 12px;
    right: 10px;
    padding: 2px 10px;
  }

  .game-over-title {
    font-size: 2rem;
  }

  .mobile-btn {
    width: 54px;
    height: 54px;
    font-size: 1.5rem;
  }

  .hud-tutorial-hint {
    font-size: 0.85rem;
    padding: 6px 14px;
    bottom: 70px;
  }
}
