/* =============================================
   BALLOON POP — style.css
   Working version with pause/home button
============================================= */

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  user-select: none;
  -webkit-user-select: none;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
  background: #0a0818;
  font-family: 'Baloo 2', cursive;
}

body { display: block; }

#confetti {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

#c {
  position: fixed;
  inset: 0;
  z-index: 2;
  cursor: crosshair;
  touch-action: none;
}

.hud {
  position: fixed;
  top: max(14px, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  display: flex;
  gap: 12px;
  pointer-events: none;
}

.hud-block {
  background: rgba(255,255,255,0.12);
  border: 1.5px solid rgba(255,255,255,0.22);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 18px;
  padding: 6px 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 88px;
}

.hud-timer {
  background: rgba(255,70,70,0.18);
  border-color: rgba(255,100,100,0.35);
}

.hud-timer.urgent .hud-val {
  color: #ff4040;
  animation: pulse-red 0.45s ease-in-out infinite;
}

@keyframes pulse-red {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}

.hud-label {
  font-size: 0.46rem;
  font-weight: 700;
  letter-spacing: 3px;
  color: rgba(255,255,255,0.5);
  text-transform: uppercase;
}

.hud-val {
  font-size: 1.6rem;
  font-weight: 900;
  color: #fff;
  line-height: 1.1;
}

.hud-timer .hud-val { color: #ff8080; }

.combo-banner {
  position: fixed;
  top: 90px;
  left: 50%;
  transform: translateX(-50%) scale(0);
  z-index: 25;
  font-size: clamp(1.2rem, 5vw, 2.2rem);
  font-weight: 900;
  color: #fff;
  text-shadow: 0 0 20px currentColor;
  pointer-events: none;
  opacity: 0;
  transition: transform 0.12s cubic-bezier(0.34,1.56,0.64,1), opacity 0.2s;
  white-space: nowrap;
}

.combo-banner.show {
  transform: translateX(-50%) scale(1);
  opacity: 1;
}

.overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(5,5,20,0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  touch-action: manipulation;
}

.overlay.hidden { display: none; }

.overlay-inner {
  background: rgba(255,255,255,0.08);
  border: 1.5px solid rgba(255,255,255,0.15);
  border-radius: 32px;
  padding: 36px 40px 30px;
  text-align: center;
  max-width: 360px;
  width: 88%;
  animation: pop-in 0.4s cubic-bezier(0.34,1.56,0.64,1);
}

@keyframes pop-in {
  from { transform: scale(0.6); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.title-icon {
  font-size: 4rem;
  line-height: 1;
  margin-bottom: 4px;
  animation: bop 1s ease-in-out infinite;
}

@keyframes bop {
  0%, 100% { transform: translateY(0) rotate(-5deg) scale(1); }
  50% { transform: translateY(-12px) rotate(5deg) scale(1.1); }
}

.game-title {
  font-size: clamp(2rem, 7vw, 2.8rem);
  font-weight: 900;
  line-height: 1;
  margin-bottom: 14px;
  background: linear-gradient(135deg, #ff6fd8, #ffd36f, #6ff9ff, #a8ff78);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.intro-text {
  font-size: clamp(0.82rem, 2.5vw, 0.96rem);
  color: rgba(255,255,255,0.75);
  line-height: 1.9;
  margin-bottom: 22px;
}

.intro-text b { color: #fff; }

.play-btn {
  display: inline-block;
  background: linear-gradient(135deg, #ff6fd8, #ff4fa0);
  color: #fff;
  font-family: 'Baloo 2', cursive;
  font-size: 1.25rem;
  font-weight: 900;
  border: none;
  border-radius: 50px;
  padding: 15px 44px;
  cursor: pointer;
  box-shadow: 0 0 30px rgba(255,80,180,0.5);
  letter-spacing: 1px;
  touch-action: manipulation;
  transition: transform 0.1s;
}

.play-btn:hover { transform: scale(1.05); }
.play-btn:active { transform: scale(0.93); }

.gameover-score {
  color: rgba(255,255,255,0.65);
  font-size: 0.9rem;
  margin-bottom: 4px;
}

.gameover-score strong {
  display: block;
  font-size: 2.6rem;
  font-weight: 900;
  color: #fff;
  background: linear-gradient(135deg, #ff6fd8, #ffd36f);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.1;
}

.gameover-score.new-best strong {
  background: linear-gradient(135deg, #6ff9ff, #a8ff78);
  -webkit-background-clip: text;
  background-clip: text;
}

.home-btn {
  position: fixed;
  top: max(14px, env(safe-area-inset-top));
  right: max(14px, env(safe-area-inset-right));
  z-index: 100;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 8px 15px;
  border-radius: 999px;
  background: rgba(255,255,255,0.86);
  border: 3px solid rgba(255,255,255,0.96);
  color: #7957c8;
  font-family: 'Baloo 2', system-ui, sans-serif;
  font-size: 1rem;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 7px 24px rgba(50,90,80,0.18);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  touch-action: manipulation;
  cursor: pointer;
}

.home-btn:hover,
.home-btn:focus-visible {
  transform: translateY(-2px) scale(1.03);
  background: rgba(255,255,255,0.96);
  outline: none;
}

.home-btn:active {
  transform: scale(0.94);
}

.home-icon {
  font-size: 1.25rem;
  line-height: 1;
}

@media (max-width: 520px) {
  .hud { gap: 7px; }
  .hud-block { min-width: 70px; padding: 6px 12px; }
  .home-btn { min-width: 52px; width: 52px; height: 52px; padding: 0; border-radius: 50%; justify-content: center; }
  .home-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
  }
}
