/* V2 — Bubble Bobble mechanics additions on top of V1 styles */

/* ============ BUBBLE ============ */
.bubble {
  position: absolute;
  width: 44px; height: 44px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 28%, rgba(255,255,255,0.7) 0%, rgba(255,255,255,0.1) 18%, transparent 35%),
    radial-gradient(circle at 50% 50%, rgba(232,193,112,0.18) 0%, rgba(212,168,75,0.35) 60%, rgba(212,168,75,0.5) 100%);
  border: 1.5px solid rgba(232,193,112,0.85);
  box-shadow:
    0 0 12px rgba(212,168,75,0.55),
    inset 0 0 14px rgba(255,255,255,0.18);
  pointer-events: none;
  will-change: transform, opacity;
  z-index: 18;
}
.bubble::before {
  /* second highlight */
  content: '';
  position: absolute;
  top: 16%; left: 22%;
  width: 28%; height: 18%;
  border-radius: 50%;
  background: rgba(255,255,255,0.5);
  filter: blur(0.5px);
}
.bubble::after {
  /* deco inner ring */
  content: '';
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  border: 0.8px dashed rgba(232,193,112,0.4);
}
.bubble.trapping {
  animation: bubble-wiggle 0.6s ease-in-out infinite;
}
@keyframes bubble-wiggle {
  0%, 100% { transform: scale(1) rotate(0deg); }
  25% { transform: scale(1.06, 0.94) rotate(-2deg); }
  50% { transform: scale(0.96, 1.04) rotate(0deg); }
  75% { transform: scale(1.04, 0.96) rotate(2deg); }
}
.bubble.popping {
  animation: bubble-pop 0.32s ease-out forwards;
}
@keyframes bubble-pop {
  0% { transform: scale(1); opacity: 1; }
  60% { transform: scale(1.4); opacity: 0.6; }
  100% { transform: scale(0.4); opacity: 0; }
}

.bubble-trapped {
  position: absolute;
  inset: 8px;
  opacity: 0.85;
  filter: drop-shadow(0 0 4px rgba(212,168,75,0.5)) saturate(0.6);
  transform: scale(0.7);
}

/* ============ ROOM LAYOUT ============ */
.room-stage {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.room-scaler {
  position: relative;
  /* dimensions set inline based on scale */
}

.room {
  position: absolute;
  top: 0; left: 0;
  width: 1120px;
  height: 720px;
  transform-origin: top left;
  background:
    radial-gradient(ellipse at 50% 50%, #1a1410 0%, #0a0908 75%);
  border: 3px solid var(--gold);
  box-shadow:
    inset 0 0 60px rgba(0,0,0,0.9),
    0 0 0 1px var(--gold-deep),
    0 0 40px rgba(212,168,75,0.2);
  overflow: hidden;
}

/* Deco brick walls — left/right */
.room-wall {
  position: absolute;
  top: 0; bottom: 0;
  width: 24px;
  background:
    repeating-linear-gradient(0deg,
      var(--gold-deep) 0, var(--gold-deep) 22px,
      var(--gold) 22px, var(--gold) 24px,
      var(--gold-deep) 24px, var(--gold-deep) 46px,
      #5a4310 46px, #5a4310 48px);
  border: 1px solid var(--gold);
}
.room-wall.left { left: 0; }
.room-wall.right { right: 0; }

.room-ceiling, .room-floor {
  position: absolute;
  left: 0; right: 0;
  height: 30px;
  background:
    linear-gradient(180deg, #1a1410, #0a0805),
    repeating-linear-gradient(90deg,
      transparent 0, transparent 28px,
      rgba(212,168,75,0.4) 28px, rgba(212,168,75,0.4) 30px);
  border: 1px solid var(--gold);
}
.room-ceiling { top: 0; border-bottom: 3px solid var(--gold); }
.room-floor { bottom: 0; border-top: 3px solid var(--gold); }

.room-ceiling::before, .room-floor::before {
  /* deco zigzag */
  content: '';
  position: absolute;
  left: 24px; right: 24px;
  top: 50%;
  height: 8px;
  transform: translateY(-50%);
  background: repeating-linear-gradient(
    -45deg,
    transparent 0, transparent 8px,
    rgba(212,168,75,0.6) 8px, rgba(212,168,75,0.6) 11px,
    transparent 11px, transparent 19px,
    rgba(212,168,75,0.6) 19px, rgba(212,168,75,0.6) 22px);
}

/* Decorative arches in background */
.room-bg-arch {
  position: absolute;
  top: 30px; bottom: 30px;
  width: 200px;
  border: 1px solid rgba(212,168,75,0.3);
  border-bottom: none;
  border-radius: 50% 50% 0 0 / 30% 30% 0 0;
}
.room-bg-arch::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 100%,
    rgba(212,168,75,0.08) 0%, transparent 60%);
  border-radius: 50% 50% 0 0 / 30% 30% 0 0;
}

/* Sunburst behind */
.room-bg-sun {
  position: absolute;
  top: 80px; left: 50%;
  transform: translateX(-50%);
  width: 400px; height: 400px;
  pointer-events: none;
  opacity: 0.5;
}

/* ============ ROOM PLATFORMS (different style — deco terraces) ============ */
.room-plat {
  position: absolute;
  background: linear-gradient(180deg, #2a1f12 0%, #15110d 100%);
  border-top: 3px solid var(--gold);
  border-bottom: 1px solid #000;
  box-shadow:
    inset 0 4px 0 rgba(212,168,75,0.18),
    0 4px 0 rgba(0,0,0,0.5);
}
.room-plat::before {
  content: '';
  position: absolute;
  top: -3px; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg,
    var(--gold-deep), var(--gold-bright) 50%, var(--gold-deep));
  box-shadow: 0 0 6px var(--gold);
}
.room-plat::after {
  /* fluted deco */
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 4px;
  background: repeating-linear-gradient(90deg,
    transparent 0, transparent 6px,
    var(--gold-deep) 6px, var(--gold-deep) 8px);
  opacity: 0.6;
}

/* ============ FRUIT / TREATS (post-pop reward) ============ */
.fruit {
  position: absolute;
  width: 26px; height: 26px;
  z-index: 14;
  animation: fruit-bob 1.6s ease-in-out infinite;
}
@keyframes fruit-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}
.fruit.collected {
  animation: fruit-collect 0.5s ease-out forwards;
}
@keyframes fruit-collect {
  to { transform: translateY(-50px) scale(1.6); opacity: 0; }
}

/* ============ ROOM HEADER ============ */
.room-header {
  position: absolute;
  top: 38px; left: 50%;
  transform: translateX(-50%);
  text-align: center;
  z-index: 30;
  pointer-events: none;
}
.room-act {
  font-family: 'Cinzel', serif;
  font-size: 11px;
  letter-spacing: 0.6em;
  color: var(--gold-bright);
  text-shadow: 0 0 8px rgba(212,168,75,0.6);
  text-transform: uppercase;
  margin-bottom: 4px;
}
.room-title {
  font-family: 'Limelight', serif;
  font-size: 22px;
  letter-spacing: 0.2em;
  color: var(--cream-bright);
  text-shadow: 0 0 12px rgba(212,168,75,0.4);
}

/* ============ NEXT-ROOM TRANSITION ============ */
.room-clear-banner {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 80;
  background: rgba(10,9,8,0.5);
  animation: banner-fade 1.6s ease-out forwards;
  pointer-events: none;
}
@keyframes banner-fade {
  0% { opacity: 0; }
  20% { opacity: 1; }
  80% { opacity: 1; }
  100% { opacity: 0; }
}
.room-clear-card {
  background: linear-gradient(180deg, #1a1410, #0a0805);
  border: 2px solid var(--gold);
  padding: 22px 50px;
  text-align: center;
  font-family: 'Limelight', serif;
  color: var(--cream-bright);
  position: relative;
  box-shadow: 0 0 0 4px var(--noir-black), 0 0 24px rgba(212,168,75,0.4);
}
.room-clear-card .label {
  font-family: 'Cinzel', serif;
  font-size: 11px;
  letter-spacing: 0.5em;
  color: var(--gold-bright);
  margin-bottom: 6px;
}
.room-clear-card .num {
  font-size: 36px;
  letter-spacing: 0.1em;
}

/* ============ DEDICATED MOBILE ============ */
@media (max-width: 768px) {
  .room { border-width: 2px; }
  .room-title { font-size: 14px; }
  .room-act { font-size: 8px; letter-spacing: 0.4em; }
}
