/* Speech bubbles for the Chapadmalal beach scene (scene.js). Uses the app's theme tokens. */
.stage { position: relative; }
.stage .fallback[hidden], .stage canvas[hidden] { display: none; }

.stage .bubble {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 3;
  max-width: min(78%, 270px);
  padding: 7px 12px;
  background: var(--surface);
  color: var(--ink);
  border: 2px solid var(--ink);
  border-radius: 16px;
  box-shadow: 0 3px 0 var(--ink);
  font-family: inherit;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.25;
  text-align: center;
  text-wrap: balance;
  pointer-events: none;
  transform-origin: var(--tail, 50%) 100%;
  animation: chapa-bubble-in .32s cubic-bezier(.2, 1.6, .4, 1) both, chapa-bubble-out .35s ease-in 2.2s forwards;
}
.stage .bubble::after {
  content: "";
  position: absolute;
  left: var(--tail, 50%);
  bottom: -8px;
  width: 12px;
  height: 12px;
  margin-left: -7px;
  background: var(--surface);
  border-right: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  transform: rotate(45deg);
}
.stage .bubble.below { transform-origin: var(--tail, 50%) 0; }
.stage .bubble.below::after { bottom: auto; top: -8px; transform: rotate(225deg); }
.stage .bubble.center { transform-origin: 50% 50%; font-size: 15px; }
.stage .bubble.center::after { display: none; }

/* first discovery of an egg */
.stage .bubble.is-new { border-color: var(--coral); box-shadow: 0 3px 0 var(--coral); }
.stage .bubble.is-new::after { border-color: var(--coral); }
.stage .bubble.is-new::before {
  content: "\2605";
  position: absolute;
  top: -11px;
  right: -7px;
  font-size: 17px;
  line-height: 1;
  color: var(--sun);
  text-shadow: 0 1px 0 var(--ink);
}

@keyframes chapa-bubble-in { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes chapa-bubble-out { to { opacity: 0; transform: translateY(-4px); } }

@media (prefers-reduced-motion: reduce) {
  .stage .bubble { animation: none; }
}
