/* 泡泡戳戳樂 */
.bubble-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
#modes { display: flex; gap: 8px; }
.bubble-right { display: flex; gap: 8px; align-items: center; }
.chip { font: inherit; font-weight: 700; cursor: pointer; color: var(--ink); padding: 6px 14px; border: var(--line); border-radius: 999px; background: var(--white); }
.chip.on { background: var(--kids); color: #fff; }
.bubble-field {
  position: relative; height: min(70vh, 520px); overflow: hidden; touch-action: manipulation;
  background: linear-gradient(var(--sky-pale), var(--white)); border: var(--line); border-radius: 20px;
}

/* 泡泡（原本的樣子）：每顆就是它對應的顏色。外層負責往上飄，內層負責破掉的動畫 */
.bubble {
  position: absolute; bottom: -130px; padding: 0; cursor: pointer; border: 0; background: none; border-radius: 50%;
  animation-name: bubble-rise; animation-timing-function: linear; animation-fill-mode: forwards;
  touch-action: manipulation;
}
.bubble-ball {
  display: block; width: 100%; height: 100%; border-radius: 50%;
  border: 3px solid rgba(34, 48, 74, .55);
  background: radial-gradient(circle at 32% 28%, rgba(255, 255, 255, .95) 0 12%, transparent 14%), radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--c) 35%, transparent), var(--c));
}
@keyframes bubble-rise { from { transform: translate(0, 0); } 50% { transform: translate(18px, calc(-1 * min(35vh, 320px))); } to { transform: translate(-10px, calc(-1 * min(70vh, 520px) - 140px)); } }

/* 破掉的動畫：先被戳扁，再撐破消失，同時噴出同色水珠、一圈漣漪、飄出顏色或數字 */
.bubble.popped { animation-play-state: paused; pointer-events: none; }
.bubble.popped .bubble-ball { animation: bubble-burst .3s ease-out forwards; }
@keyframes bubble-burst {
  0% { transform: scale(1, 1); opacity: 1; }
  30% { transform: scale(1.14, .8); opacity: 1; }
  55% { transform: scale(1.3, 1.26); opacity: .9; }
  100% { transform: scale(1.5, 1.5); opacity: 0; }
}
.bf-ring { position: absolute; width: var(--size); height: var(--size); margin: calc(var(--size) / -2) 0 0 calc(var(--size) / -2); border-radius: 50%; border: 4px solid var(--c); pointer-events: none; animation: bf-ring .55s ease-out forwards; }
@keyframes bf-ring { from { transform: scale(.6); opacity: .9; } to { transform: scale(1.7); opacity: 0; border-width: 1px; } }
.bf-drop { position: absolute; width: var(--s); height: var(--s); margin: calc(var(--s) / -2) 0 0 calc(var(--s) / -2); border-radius: 50%; background: var(--c); border: 2px solid rgba(34, 48, 74, .45); pointer-events: none; animation: bf-drop .7s cubic-bezier(.2, .6, .4, 1) forwards; }
@keyframes bf-drop { 0% { transform: translate(0, 0) scale(1); opacity: 1; } 100% { transform: translate(var(--dx), calc(var(--dy) + 60px)) scale(.3); opacity: 0; } }
.bf-label { position: absolute; transform: translate(-50%, -50%); font-family: var(--font-display); font-size: 2.2rem; white-space: nowrap; pointer-events: none; -webkit-text-stroke: 1.5px var(--ink); paint-order: stroke fill; text-shadow: 2px 2px 0 var(--ink); animation: bf-label 1.05s ease-out forwards; }
@keyframes bf-label { 0% { transform: translate(-50%, -30%) scale(.5); opacity: 0; } 20% { transform: translate(-50%, -60%) scale(1.15); opacity: 1; } 70% { opacity: 1; } 100% { transform: translate(-50%, -160%) scale(1); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .bf-drop, .bf-ring { display: none; } }
