/* Scoped entrance styles: no layout or material changes inside #Stage. */
/* The inherited scroller can mount before the module locks its controller.
   Scope these overrides to the black entrance so its native bar never leaks
   through. Removing the state restores the engine's own styles unchanged. */
html:is([data-bubble-entry="idle"], [data-bubble-entry="pending"], [data-bubble-entry="burst"], [data-bubble-entry="failed"]),
html:is([data-bubble-entry="idle"], [data-bubble-entry="pending"], [data-bubble-entry="burst"], [data-bubble-entry="failed"]) :is(body, #Stage, .FXScroll) {
  overflow: hidden !important;
  overscroll-behavior: none !important;
  scrollbar-width: none !important;
}
html:is([data-bubble-entry="idle"], [data-bubble-entry="pending"], [data-bubble-entry="burst"], [data-bubble-entry="failed"]) {
  --baropacity: 0 !important;
}
html:is([data-bubble-entry="idle"], [data-bubble-entry="pending"], [data-bubble-entry="burst"], [data-bubble-entry="failed"])::-webkit-scrollbar,
html:is([data-bubble-entry="idle"], [data-bubble-entry="pending"], [data-bubble-entry="burst"], [data-bubble-entry="failed"]) :is(body, #Stage, .FXScroll)::-webkit-scrollbar {
  display: none !important;
}
html[data-bubble-entry]:not([data-bubble-entry="revealed"]):not([data-bubble-entry="done"]) #Stage,
html[data-bubble-entry]:not([data-bubble-entry="revealed"]):not([data-bubble-entry="done"]):not([data-bubble-entry="failed"]) .soundtrack-toggle {
  visibility: hidden !important;
}
html:not([data-bubble-entry]) .bubble-entry,
.bubble-entry[hidden] { display: none !important; }
.bubble-entry {
  --orb-size: clamp(52px, 6.8vw, 88px);
  position: fixed;
  inset: 0;
  z-index: 2000000;
  display: grid;
  place-items: center;
  background: #000;
  color: #eeecf1;
  touch-action: none;
}
.bubble-entry-inner {
  position: relative;
  transform: translateY(-12px);
  text-align: center;
  opacity: 0;
  animation: bubble-arrive 1.4s ease .2s forwards;
}
.bubble-enter { margin: 0 auto; }
.bubble-sound-note {
  position: absolute;
  top: 100%;
  left: 50%;
  width: max-content;
  max-width: calc(100vw - 32px);
  transform: translateX(-50%);
  margin: 30px 0 0;
  color: #999;
  font: 12px/1.5 'nbarchitekt', monospace;
  letter-spacing: .02em;
}
html[data-bubble-entry="burst"] .bubble-sound-note,
html[data-bubble-entry="revealed"] .bubble-sound-note { visibility: hidden; }
@keyframes bubble-arrive { to { opacity: 1; } }
.bubble-enter {
  position: relative;
  display: flex;
  align-items: center;
  padding: 16px;
  border: 0;
  border-radius: 50%;
  background: none;
  color: inherit;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.bubble-enter:focus-visible { outline: 1px solid #dcdbf7; outline-offset: 18px; }
.bubble-enter:disabled { cursor: default; }
.bubble-enter[hidden], .bubble-load-error[hidden] { display: none !important; }
.bubble-orb {
  display: block;
  position: relative;
  width: var(--orb-size);
  height: var(--orb-size);
  transform: translate3d(var(--orb-x, 0px), var(--orb-y, 0px), 0) scale(var(--orb-scale, 1));
  will-change: transform;
  pointer-events: none;
}
.bubble-orb-canvas, .bubble-orb-fallback {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.bubble-orb-fallback {
  inset: 6%;
  width: 88%;
  height: 88%;
  border-radius: 50%;
  background: #aabce5 url('./reference.png') center/136% no-repeat;
  box-shadow: inset -3px -2px 7px #e3c0dd70, 0 10px 10px -6px #000b;
}
.bubble-orb-canvas {
  inset: calc((1 - var(--overscan, 1.6))*50%);
  width: calc(var(--overscan, 1.6)*100%);
  height: calc(var(--overscan, 1.6)*100%);
  filter: drop-shadow(0 7px 6px #000b);
  opacity: 0;
}
.bubble-entry[data-renderer="webgl"] .bubble-orb-fallback { opacity: 0; }
.bubble-entry[data-renderer="webgl"] .bubble-orb-canvas { opacity: 1; }
.bubble-particles { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; }
/* Keep hit testing on this transparent shield until the droplets finish. */
.bubble-entry.leaving { background: transparent; }
.bubble-entry-status { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.bubble-load-error { max-width: 430px; padding: 24px; font: 16px/1.6 'nbarchitekt', monospace; }
.bubble-load-error button, .bubble-load-error a { color: inherit; font: inherit; }
.bubble-load-error button { border: 1px solid #999; background: none; padding: 8px 18px; margin-right: 20px; cursor: pointer; }
html[data-bubble-entry="failed"] .soundtrack-toggle { z-index: 2000001; }
html[data-bubble-entry="failed"] .bubble-entry-inner { display: none; }
@media(max-width: 600px) {
  .bubble-entry { --orb-size: min(16.4vw, 70px); }
  .bubble-entry-inner { transform: translateY(-8px); }
}
@media(prefers-reduced-motion: reduce) {
  .bubble-entry-inner { animation: none; opacity: 1; }
  .bubble-orb { transform: none !important; will-change: auto; }
}
