.game-burst-balloon {
  --stage-ink: #09204a;
  --stage-blue: #1356a3;
  --stage-blue-dark: #071f4a;
  --stage-gold: #ffd45a;
  --stage-green: #20a66b;
  display: flex;
  flex-direction: column;
  width: 100%;
}

.portal-page.is-game-focus .mini-game-card:has(.game-burst-balloon) {
  --game-card-play-min-height: 452px;
  --game-card-play-max-height: 780px;
  --game-stage-play-min-height: 300px;
}

.game-burst-balloon .game-hud {
  gap: 6px;
  padding: 8px;
  border-bottom: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), transparent 38%),
    linear-gradient(180deg, #155fb5 0%, #0b3474 58%, #071f4a 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    inset 0 -4px 0 rgba(2, 11, 32, 0.2),
    0 6px 0 rgba(7, 31, 74, 0.12);
}

.game-burst-balloon .game-hud-item {
  min-height: 34px;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 5px 8px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.18), transparent 60%),
    rgba(6, 20, 51, 0.38);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 3px 0 rgba(3, 13, 35, 0.22);
}

.game-burst-balloon .game-hud-item + .game-hud-item {
  border-left: 1px solid rgba(255, 255, 255, 0.18);
}

.game-burst-balloon .game-hud-label {
  color: var(--stage-gold);
  font-size: 9px;
  line-height: 1;
  letter-spacing: 0;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.28);
}

.game-burst-balloon .game-hud-value {
  color: #ffffff;
  font-size: 18px;
  line-height: 1;
  text-shadow:
    0 2px 0 rgba(0, 0, 0, 0.26),
    0 0 14px rgba(255, 212, 90, 0.22);
}

.game-burst-balloon .game-stage {
  min-height: 280px;
  border-top: 1px solid rgba(255, 255, 255, 0.72);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(4, 27, 64, 0.1) 52%, rgba(2, 15, 41, 0.34)),
    var(--burst-stage-background, url("/assets/games/burst-balloon/carnival-sky-stage.jpg")) center 48% / cover no-repeat,
    linear-gradient(180deg, #bdeeff, #fef0b9);
  box-shadow:
    inset 0 10px 18px rgba(255, 255, 255, 0.24),
    inset 0 -18px 28px rgba(7, 31, 74, 0.22);
}

.game-burst-balloon .game-stage::before {
  z-index: 0;
  inset: auto 0 0;
  height: 92px;
  border-radius: 0;
  background:
    linear-gradient(180deg, transparent 0%, rgba(7, 31, 74, 0.14) 28%, rgba(7, 31, 74, 0.38) 100%),
    radial-gradient(ellipse at center bottom, rgba(255, 212, 90, 0.34), transparent 70%);
  filter: none;
}

.game-burst-balloon .game-stage::after {
  z-index: 1;
  background:
    radial-gradient(circle at 18% 18%, rgba(255, 255, 255, 0.3), transparent 17%),
    radial-gradient(circle at 82% 12%, rgba(255, 212, 90, 0.28), transparent 18%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.02) 0%, transparent 56%, rgba(7, 31, 74, 0.16) 100%);
}

.portal-page.is-game-focus .game-burst-balloon .game-stage {
  height: clamp(292px, calc(100svh - 330px), 380px);
  min-height: 292px;
}

@supports (height: 100dvh) {
  .portal-page.is-game-focus .game-burst-balloon .game-stage {
    height: clamp(292px, calc(100dvh - 330px), 380px);
  }
}

.portal-page.is-game-focus .game-burst-balloon.is-countdown .game-stage,
.portal-page.is-game-focus .game-burst-balloon.is-playing .game-stage,
.portal-page.is-game-focus .game-burst-balloon.is-completing .game-stage {
  height: clamp(318px, calc(100svh - 236px), 560px);
  min-height: var(--game-stage-play-min-height);
}

@supports (height: 100dvh) {
  .portal-page.is-game-focus .game-burst-balloon.is-countdown .game-stage,
  .portal-page.is-game-focus .game-burst-balloon.is-playing .game-stage,
  .portal-page.is-game-focus .game-burst-balloon.is-completing .game-stage {
    height: clamp(318px, calc(100dvh - 236px), 560px);
  }
}

@supports selector(:has(*)) {
  .portal-page.is-game-focus .game-burst-balloon.is-countdown .game-stage,
  .portal-page.is-game-focus .game-burst-balloon.is-playing .game-stage,
  .portal-page.is-game-focus .game-burst-balloon.is-completing .game-stage {
    height: auto;
    min-height: var(--game-stage-play-min-height);
  }
}

.game-burst-balloon.is-playing .game-stage {
  touch-action: none;
}

.game-burst-balloon.is-finished .game-stage {
  height: auto;
  min-height: 0;
  touch-action: auto;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(255, 248, 230, 0.94)),
    #ffffff;
}

.game-burst-balloon.is-finished .game-overlay {
  position: static;
  display: block;
  padding: 12px 16px;
  background: #ffffff;
  backdrop-filter: none;
}

.game-burst-balloon.is-finished .game-overlay-panel {
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  text-align: left;
}

.game-burst-balloon.is-finished .game-overlay-panel h2 {
  margin: 0;
  color: var(--color-primary);
  font-size: 14px;
  line-height: 1.2;
}

.stage-decor,
.stage-cloud,
.stage-prize {
  pointer-events: none;
}

.stage-decor {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
}

.stage-cloud {
  position: absolute;
  width: 92px;
  height: 28px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.66);
  box-shadow:
    18px -8px 0 rgba(255, 255, 255, 0.56),
    42px 2px 0 rgba(255, 255, 255, 0.42);
  filter: blur(0.4px);
}

.stage-cloud--left {
  top: 20px;
  left: -36px;
}

.stage-cloud--right {
  top: 54px;
  right: -28px;
  transform: scale(0.82);
}

.stage-prize {
  position: absolute;
  width: 28px;
  height: 28px;
  border: 2px solid rgba(255, 255, 255, 0.72);
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.9) 0 10%, transparent 12%),
    linear-gradient(135deg, #fff1a6 0%, #ffd45a 42%, #e69b12 100%);
  box-shadow:
    inset 0 -3px 0 rgba(140, 74, 0, 0.28),
    0 9px 18px rgba(7, 31, 74, 0.2);
  opacity: 0.78;
}

.stage-prize--one {
  top: 88px;
  left: 10%;
}

.stage-prize--two {
  top: 34px;
  right: 14%;
  transform: scale(0.72);
}

.game-burst-balloon .game-overlay {
  z-index: 6;
  background:
    radial-gradient(circle at 50% 30%, rgba(255, 255, 255, 0.55), transparent 44%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(7, 31, 74, 0.22));
  backdrop-filter: none;
}

.game-burst-balloon .game-overlay-panel {
  width: min(284px, 100%);
  padding: 16px 16px 18px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 248, 230, 0.84)),
    rgba(255, 255, 255, 0.88);
  box-shadow:
    0 14px 28px rgba(7, 31, 74, 0.18),
    0 0 0 6px rgba(255, 255, 255, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
  text-align: center;
}

.game-burst-balloon .game-overlay-panel h2 {
  margin: 5px 0 var(--space-2);
  color: var(--color-text);
  font-size: 26px;
  font-weight: 950;
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.72);
}

.game-burst-balloon .game-overlay-panel p {
  margin: 0 0 var(--space-4);
  color: var(--color-muted-strong);
  font-size: 14px;
  font-weight: 700;
}

.burst-ready-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 0 11px;
  border-radius: 999px;
  color: #ffffff;
  background: linear-gradient(180deg, #ff4450, #bc1620);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  box-shadow:
    0 5px 0 rgba(188, 22, 32, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.32);
}

.burst-ready-cluster {
  position: relative;
  width: 96px;
  height: 60px;
  margin: 9px auto 2px;
}

.burst-ready-balloon {
  position: absolute;
  bottom: 2px;
  width: 34px;
  height: 42px;
  border: 2px solid rgba(255, 255, 255, 0.74);
  border-radius: 54% 54% 48% 48%;
  box-shadow:
    inset -6px -9px 0 rgba(0, 0, 0, 0.13),
    0 7px 14px rgba(7, 31, 74, 0.18);
}

.burst-ready-balloon::before {
  content: "";
  position: absolute;
  top: 7px;
  left: 9px;
  width: 8px;
  height: 13px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.6);
  transform: rotate(26deg);
}

.burst-ready-balloon--red {
  left: 8px;
  background: linear-gradient(135deg, #ff6b74, #e62129 58%, #a90f18);
  transform: rotate(-12deg);
}

.burst-ready-balloon--gold {
  left: 31px;
  bottom: 10px;
  z-index: 1;
  width: 40px;
  height: 49px;
  background: linear-gradient(135deg, #fff09d, #f4bd35 58%, #bd7100);
}

.burst-ready-balloon--blue {
  right: 7px;
  background: linear-gradient(135deg, #5adfff, #1d73d8 58%, #0b3474);
  transform: rotate(12deg);
}

.countdown-value {
  display: block;
  min-height: 72px;
  color: #0b3474;
  font-size: 64px;
  line-height: 1;
  font-weight: 950;
  text-shadow:
    0 3px 0 #ffd45a,
    0 7px 0 rgba(188, 22, 32, 0.18),
    0 0 22px rgba(255, 255, 255, 0.86);
}

.game-burst-balloon.is-countdown .game-overlay-panel {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 242, 176, 0.92)),
    #ffffff;
  box-shadow:
    0 18px 30px rgba(7, 31, 74, 0.26),
    0 0 0 8px rgba(255, 255, 255, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.96);
}

.game-burst-balloon .balloon {
  --balloon-main: #e62129;
  --balloon-hi: #ff747b;
  --balloon-shade: #aa1119;
  position: absolute;
  left: 0;
  bottom: 0;
  z-index: 3;
  display: block;
  width: 52px;
  height: 62px;
  border: 2px solid rgba(255, 255, 255, 0.78);
  border-radius: 52% 52% 48% 48%;
  background:
    radial-gradient(circle at 35% 25%, rgba(255, 255, 255, 0.9) 0 8%, transparent 10%),
    linear-gradient(135deg, var(--balloon-hi) 0%, var(--balloon-main) 56%, var(--balloon-shade) 100%);
  box-shadow:
    inset -10px -15px 0 rgba(0, 0, 0, 0.13),
    inset 4px 5px 0 rgba(255, 255, 255, 0.16),
    0 12px 20px rgba(7, 31, 74, 0.22),
    0 0 0 5px rgba(255, 255, 255, 0.22);
  cursor: pointer;
  will-change: transform, opacity;
  touch-action: manipulation;
}

.game-burst-balloon .balloon::before {
  content: "";
  position: absolute;
  top: 12px;
  left: 14px;
  width: 11px;
  height: 20px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.5);
  transform: rotate(25deg);
}

.game-burst-balloon .balloon::after {
  content: "";
  position: absolute;
  bottom: -11px;
  left: 50%;
  width: 15px;
  height: 15px;
  background: linear-gradient(135deg, var(--balloon-main), var(--balloon-shade));
  clip-path: polygon(50% 0, 100% 78%, 50% 100%, 0 78%);
  transform: translateX(-50%);
  box-shadow: inset -2px -2px 0 rgba(0, 0, 0, 0.12);
}

.game-burst-balloon .balloon--gold {
  --balloon-main: #f4bd35;
  --balloon-hi: #fff09d;
  --balloon-shade: #b96800;
}

.game-burst-balloon .balloon--teal {
  --balloon-main: #1aa86b;
  --balloon-hi: #72e5ae;
  --balloon-shade: #0f5f3b;
}

.game-burst-balloon .balloon--blue {
  --balloon-main: #2a88df;
  --balloon-hi: #72deff;
  --balloon-shade: #113a7d;
}

.game-burst-balloon .balloon--rose {
  --balloon-main: #e62129;
  --balloon-hi: #ff747b;
  --balloon-shade: #9b1018;
}

.game-burst-balloon .balloon.is-popped {
  pointer-events: none;
  opacity: 0;
  transform: scale(1.22) !important;
  transition:
    opacity 130ms ease,
    transform 130ms ease;
}

.pop-burst {
  position: absolute;
  z-index: 5;
  width: 1px;
  height: 1px;
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.pop-ring {
  position: absolute;
  inset: -18px;
  border: 3px solid rgba(255, 212, 90, 0.86);
  border-radius: 50%;
  animation: burst-ring 520ms ease-out forwards;
}

.pop-score {
  position: absolute;
  left: -12px;
  top: -24px;
  min-width: 28px;
  color: #ffffff;
  font-size: 14px;
  font-weight: 950;
  text-align: center;
  text-shadow:
    0 2px 0 rgba(188, 22, 32, 0.42),
    0 0 10px rgba(255, 212, 90, 0.72);
  animation: burst-score 560ms ease-out forwards;
}

.pop-spark {
  position: absolute;
  left: -4px;
  top: -4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 0 12px rgba(255, 212, 90, 0.95);
  animation: burst-spark 520ms ease-out forwards;
}

.pop-spark--one {
  --spark-x: -28px;
  --spark-y: -18px;
  background: #ffd45a;
}

.pop-spark--two {
  --spark-x: 28px;
  --spark-y: -22px;
  background: #ffffff;
}

.pop-spark--three {
  --spark-x: -20px;
  --spark-y: 22px;
  background: #ff6b74;
}

.pop-spark--four {
  --spark-x: 22px;
  --spark-y: 18px;
  background: #72deff;
}

.game-burst-balloon .burst-ready-copy {
  color: var(--color-muted-strong);
}

.game-burst-balloon:not(.is-playing):not(.is-countdown):not(.is-finished) .game-overlay {
  place-items: start center;
  padding-top: 24px;
  padding-bottom: 30px;
}

.game-burst-balloon [data-start] {
  min-width: 118px;
}

@keyframes burst-ring {
  0% {
    opacity: 0.95;
    transform: scale(0.35);
  }

  100% {
    opacity: 0;
    transform: scale(1.65);
  }
}

@keyframes burst-score {
  0% {
    opacity: 0;
    transform: translateY(8px) scale(0.82);
  }

  22% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform: translateY(-26px) scale(1.05);
  }
}

@keyframes burst-spark {
  0% {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }

  100% {
    opacity: 0;
    transform: translate3d(var(--spark-x), var(--spark-y), 0) scale(0.2);
  }
}

.stage-prize--one {
  animation: prize-float 4200ms ease-in-out infinite;
}

.stage-prize--two {
  animation: prize-float 5000ms ease-in-out infinite reverse;
}

@keyframes prize-float {
  0%,
  100% {
    translate: 0 0;
  }

  50% {
    translate: 0 7px;
  }
}

@media (max-width: 374px) {
  .portal-page.is-game-focus .mini-game-card:has(.game-burst-balloon) {
    --game-card-play-min-height: 430px;
    --game-stage-play-min-height: 274px;
  }

  .game-burst-balloon .game-stage {
    min-height: 256px;
  }

  .portal-page.is-game-focus .game-burst-balloon .game-stage {
    height: clamp(302px, calc(100svh - 292px), 340px);
    min-height: 302px;
  }

  @supports (height: 100dvh) {
    .portal-page.is-game-focus .game-burst-balloon .game-stage {
      height: clamp(302px, calc(100dvh - 292px), 340px);
    }
  }

  .game-burst-balloon .game-overlay-panel {
    width: min(264px, 100%);
    padding: 12px 14px 14px;
  }

  .game-burst-balloon .game-overlay-panel h2 {
    margin: 3px 0 6px;
    font-size: 22px;
  }

  .game-burst-balloon .game-overlay-panel p {
    margin-bottom: 10px;
    font-size: 12px;
    line-height: 1.3;
  }

  .burst-ready-cluster {
    width: 84px;
    height: 48px;
    margin: 7px auto 0;
  }

  .burst-ready-balloon {
    width: 28px;
    height: 35px;
  }

  .burst-ready-balloon--gold {
    left: 28px;
    bottom: 7px;
    width: 34px;
    height: 42px;
  }

  .game-burst-balloon [data-start] {
    min-width: 110px;
    min-height: 50px;
  }

  .game-burst-balloon:not(.is-playing):not(.is-countdown):not(.is-finished) .game-overlay {
    padding-top: 14px;
    padding-bottom: 16px;
  }
}
