.bubble-launch {
  width: min(100%, 348px);
  min-width: 0;
  margin: 16px auto 0;
  color: #3f215f;
}

.bubble-launch-hud {
  display: flex;
  justify-content: space-between;
  gap: 7px;
  margin: 0 0 9px;
  font-size: .88rem;
  font-weight: 750;
}
.bubble-launch-hud > span { display: flex; align-items: center; gap: 7px; min-width: 0; }
.bubble-launch-hud b { padding: 3px 8px; border-radius: 99px; color: #4a237d; background: #eedfff; font-variant-numeric: tabular-nums; white-space: nowrap; }

.bubble-launch-field {
  position: relative;
  display: block;
  container-type: inline-size;
  isolation: isolate;
  width: 100%;
  aspect-ratio: 5 / 6;
  overflow: hidden;
  touch-action: none;
  user-select: none;
  border: 1px solid #7448bb;
  border-radius: 23px;
  background: radial-gradient(ellipse at 50% 5%, #9758cc, transparent 65%), linear-gradient(160deg, #6340a7 4%, #43267d 67%, #291651);
  box-shadow: inset 0 0 0 3px #d8ace54f, 0 4px 0 #d9bde8, 0 10px 23px #44227428;
}
.bubble-launch:not(.is-demo) .bubble-launch-field { cursor: crosshair; }
.bubble-launch-field::before {
  position: absolute; inset: 0; z-index: -1; content: '';
  background: radial-gradient(circle, #fbdaff55 0 1px, transparent 1.6px) 0 0 / 29px 29px,
    radial-gradient(circle, #ffd5f077 0 2px, transparent 2.5px) 14px 15px / 61px 59px;
  mask-image: linear-gradient(150deg, #000, transparent 76%);
}
.bubble-launch-rails { position: absolute; inset: 5% 6% 6%; border: solid #dfc1ff5c; border-width: 0 2px; border-radius: 15px; }
.bubble-launch-rails::after { position: absolute; bottom: 5%; left: 8%; width: 84%; height: 9%; content: ''; border-top: 1px solid #dac2f366; border-radius: 50%; }

.bubble-launch-field :is(.bubble-launch-target, .bubble-launch-foam, .bubble-launch-marble, .bubble-launch-base, .bubble-flight-guide i) {
  position: absolute;
  top: var(--bubble-y);
  left: var(--bubble-x);
  transform: translate(-50%, -50%);
}
.bubble-launch-target, .bubble-launch-foam {
  display: grid;
  place-items: center;
  z-index: 1;
  width: 12.2%;
  aspect-ratio: 1;
  border: 1px solid #fffc;
  border-radius: 50%;
  color: #78395a;
  font-size: clamp(.69rem, 6cqw, 1.15rem);
  font-weight: 900;
  line-height: 1;
  box-shadow: inset 0 -4px 7px #8731633b, 0 3px 8px #2b1b626e;
}
.bubble-launch-target { background: radial-gradient(circle at 28% 23%, #fff9ed 0 9%, transparent 11%), radial-gradient(circle at 34% 24%, #fddce9, #fb8fbd 70%, #e55d99); }
.bubble-launch-target:nth-of-type(2n) { color: #226f70; background: radial-gradient(circle at 28% 23%, #fcffed 0 9%, transparent 11%), radial-gradient(circle at 34% 24%, #caffd7, #72e1bb 71%, #4ac3a8); }
.bubble-launch-target:nth-of-type(3n) { color: #3d4d95; background: radial-gradient(circle at 28% 23%, #f9fbff 0 9%, transparent 11%), radial-gradient(circle at 34% 24%, #d1f4ff, #85c6fa 71%, #5e92e3); }
.bubble-launch-target.is-bank { color: #8a4f27; border: 2px double #fff2ad; background: radial-gradient(circle at 28% 23%, #fffbe5 0 9%, transparent 11%), radial-gradient(circle at 34% 24%, #fff6bc, #ffcd6e 71%, #efa741); }
.bubble-launch-target.is-popped { opacity: 0; animation: bubble-launch-pop .47s ease-out both; }
@keyframes bubble-launch-pop {
  0% { opacity: 1; transform: translate(-50%, -50%) scale(.9); }
  30% { opacity: .9; transform: translate(-50%, -50%) scale(1.2); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.57); }
}
.bubble-launch-foam {
  width: 13.6%;
  color: #4b3e62;
  background: repeating-linear-gradient(140deg, #ac9abf 0 4px, #d2c6dd 4px 8px);
  border: 1px solid #f1e8f9a8;
  box-shadow: inset 0 -4px 7px #46356550, 0 3px 7px #2e165066;
}
.bubble-flight-guide { position: absolute; inset: 0; pointer-events: none; }
.bubble-flight-guide i { width: max(2px, 1.2%); aspect-ratio: 1; border-radius: 50%; background: #ffebbc; box-shadow: 0 0 4px #ffd48492; }
.bubble-launch-marble {
  z-index: 4;
  width: 4.8%;
  aspect-ratio: 1;
  border: 1px solid #fffaf0;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 26%, #fffad3 0%, #ffcf6a 69%, #e89933);
  box-shadow: 0 0 9px #ffe7a7b9;
}
.bubble-launch-base {
  z-index: 2;
  display: grid;
  place-items: center;
  width: 16%;
  aspect-ratio: 1.22;
  border: 1px solid #fff4bf;
  border-radius: 54% 54% 43% 43%;
  background: linear-gradient(160deg, #ffe29f, #f8a949);
  box-shadow: inset 0 -4px 0 #a0574650, 0 4px 6px #1a133756;
}
.bubble-launch-base i { width: 41%; aspect-ratio: 1; border: 1px solid #fff6ca; border-radius: 50%; background: radial-gradient(circle at 33% 23%, #fff7dc, #fecc72 70%); }

.bubble-launch-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin-top: 13px;
}
.bubble-launch-aim { display: grid; min-width: 0; color: #634480; font-size: .88rem; }
.bubble-launch-aim > span { font-weight: 750; }
.bubble-launch-aim b { color: #482569; margin-inline-start: 3px; }
.bubble-launch-aim input { margin: 0; width: 100%; min-width: 0; min-height: 40px; cursor: pointer; accent-color: #7544ce; }
.bubble-launch-fire { min-height: 47px; min-width: 74px; }
.bubble-launch-fire[aria-disabled='true'] { cursor: wait; opacity: .65; }
.bubble-launch-status { min-height: 1.5em; margin: 1px 0 0; color: #653a85; font-size: .84rem; font-weight: 800; }

.bubble-launch-preview { width: min(100%, 110px, calc((var(--preview-height, 138px) - 16px) * .833)); margin-inline: auto; }
.bubble-launch-preview .bubble-launch-field { border-radius: 12px; box-shadow: inset 0 0 0 1px #d8ace54f, 0 2px 0 #7d54aa77; }
.bubble-launch-preview .bubble-launch-rails { border-width: 0 1px; }
.bubble-launch-preview :is(.bubble-launch-target, .bubble-launch-foam) { font-size: clamp(.29rem, 7cqw, .46rem); border-width: 1px; }
.bubble-launch-preview .bubble-flight-guide i { width: max(1px, 1.2%); }

@media (prefers-reduced-motion: reduce) {
  .bubble-launch-target.is-popped { animation: none; }
}
