.bubble-field {
  position: fixed;
  z-index: 2;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  contain: strict;
}
.foam-bubble {
  position: absolute;
  width: var(--diameter);
  aspect-ratio: 1;
  translate: -50% -50%;
}
.foam-bubble::before, .foam-bubble::after {
  content: '';
  position: absolute;
  border-radius: 50%;
}
.foam-bubble::before {
  inset: 0;
  background:
    radial-gradient(ellipse at 29% 18%, #fffffff2 0 2%, transparent 8%),
    radial-gradient(ellipse at 75% 80%, #e2ba8c52, transparent 25%),
    radial-gradient(circle at 42% 37%, transparent 46%, #bbe8d522 68%, #80b5a677 88%, #e6faecaa 97%);
  box-shadow: inset 1px 1px 1px #fff9, inset -1px -1px 2px #548d8055, 0 0 0 1px #56887955;
}
.foam-bubble::after {
  inset: 8%;
  border: 1px solid transparent;
  border-left-color: #fffc;
  border-bottom-color: #ffffff47;
  transform: rotate(25deg);
}
.foam-bubble.is-popping::before { animation: foam-film-break .2s ease-out both; }
.foam-bubble.is-popping::after {
  inset: 0;
  border: 2px dashed #86bcaa;
  animation: foam-ring-break .2s ease-out both;
}
@keyframes foam-film-break { to { opacity: 0; transform: scale(.72); } }
@keyframes foam-ring-break { to { opacity: 0; transform: scale(1.35); } }

.bubble-station {
  position: fixed;
  z-index: 3;
  right: max(.7rem, env(safe-area-inset-right));
  bottom: max(.7rem, env(safe-area-inset-bottom));
  display: flex;
  align-items: flex-end;
  gap: .05rem;
  pointer-events: none;
}
.bubble-station button {
  display: grid;
  place-items: center;
  pointer-events: auto;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.bubble-pump {
  width: 3.3rem; height: 3.3rem; padding: .12rem;
  border: 1px solid #edf5e5; border-radius: 50%;
  background: #1d493e;
  box-shadow: 0 2px 9px #133e342b, inset 0 0 0 3px #87a69544;
}
.bubble-pump svg { width: 90%; height: 90%; }
.bubble-pump:active svg { transform: translateY(1px) scale(.94); }
.bubble-pause { position: relative; width: 2rem; height: 2rem; padding: 0; border: 1px solid #adc8ba; border-radius: 50%; background: #f0f6ec; color: #214d40; }
.bubble-pause span { height: .65rem; width: .48rem; border-inline: 2px solid currentColor; }
.bubble-pause.is-paused span { width: 0; height: 0; border: .32rem solid transparent; border-right: 0; border-left: .5rem solid currentColor; }
.bubble-help { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.bubble-pump:focus-visible ~ .bubble-help {
  right: 0; bottom: calc(100% + .5rem); width: 15.3rem; height: auto; padding: .55rem .8rem;
  border-radius: .4rem; clip-path: none; background: #163d32; color: #f4f9ec; font-size: .79rem;
}
.site-footer { padding-bottom: max(4.7rem, calc(4rem + env(safe-area-inset-bottom))); }
@media (prefers-reduced-motion: reduce) { .bubble-station .bubble-pause { display: none; } }
@media print { .bubble-field, .bubble-station { display: none; } }
