.bubble-play { --game-play-width: 542px; }
.bubble-toolbar, .bubble-stats, .bubble-controls, .bubble-actions, .bubble-victory-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}
.bubble-toolbar, .bubble-stats, .bubble-status { color: var(--game-secondary); font-size: 14px; line-height: 1.6; }
.bubble-toolbar select { min-width: 0; max-width: 100%; }
.bubble-stats { margin: 12px 0 9px; gap: 5px 18px; font-variant-numeric: tabular-nums; }
.bubble-stats > span { display: inline-flex; align-items: center; gap: 4px; }
.bubble-stats strong { color: var(--game-ink); }
.bubble-board {
  display: block;
  box-sizing: border-box;
  width: min(100%, 336px);
  max-height: min(63vh, 421px);
  margin-inline: auto;
  border: 1px solid #8ea7c8;
  border-radius: 12px;
  background:
    radial-gradient(ellipse at 50% 82%, #c3e8f4, transparent 63%),
    radial-gradient(circle at 48% 18%, #ffffff 4%, #e8f2fc 48%, #dae8f9 100%);
  box-shadow: 0 3px 0 #5578a31e, inset 0 0 13px #8daed526;
  touch-action: none;
  cursor: crosshair;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
html[data-theme=dark] .bubble-board {
  border-color: #486686;
  background: radial-gradient(ellipse at 50% 83%, #335070, #252f48 70%, #232943);
}
.bubble-board:focus-visible { outline: 2px solid #4a80c3; outline-offset: 2px; }
.bubble-board[data-firing], .bubble-board[data-ended] { cursor: default; }
#aim[data-hidden], #launch[data-hidden] { display: none; }
.bubble-body, .bubble-swatch { fill: var(--bubble-fill); background: var(--bubble-fill); }
[data-color=A] { --bubble-fill: #4a90ce; --bubble-edge: #286299; --bubble-icon: #f1faff; }
[data-color=B] { --bubble-fill: #de735e; --bubble-edge: #a44841; --bubble-icon: #fff2e9; }
[data-color=C] { --bubble-fill: #4d9b8a; --bubble-edge: #247062; --bubble-icon: #f3fff8; }
[data-color=D] { --bubble-fill: #e3a650; --bubble-edge: #9d6529; --bubble-icon: #4d3520; }
[data-color=E] { --bubble-fill: #a083c9; --bubble-edge: #694f98; --bubble-icon: #fffbff; }
.bubble-body { stroke: var(--bubble-edge); stroke-width: .026; }
.bubble-shine { fill: none; stroke: #fff; stroke-width: .043; stroke-linecap: round; opacity: .52; }
.bubble-symbol { fill: none; stroke: var(--bubble-icon); stroke-width: .064; stroke-linecap: round; stroke-linejoin: round; opacity: .88; }
.bubble-swatch {
  display: inline-grid;
  place-items: center;
  width: 19px;
  height: 19px;
  box-sizing: border-box;
  border: 1px solid var(--bubble-edge);
  border-radius: 50%;
  color: var(--bubble-icon);
  font: normal 650 12px/1 system-ui, sans-serif;
}
.bubble-swatch[hidden] { display: none; }
.bubble-aim-path { fill: none; stroke: #3f63aa; stroke-width: .043; stroke-linecap: round; stroke-dasharray: .11 .13; }
.bubble-aim-stop { fill: #8da9e536; stroke: #385eac; stroke-width: .049; }
html[data-theme=dark] .bubble-aim-path, html[data-theme=dark] .bubble-aim-stop { stroke: #a2bdff; }
.bubble-launcher { fill: #555b87; stroke: #2f3e68; stroke-width: .045; }
.bubble-limit { fill: none; stroke: #a24856; stroke-width: .031; stroke-dasharray: .14 .09; }
.bubble-limit-label { fill: #984b54; font: 600 .23px system-ui,sans-serif; }
html[data-theme=dark] .bubble-limit, html[data-theme=dark] .bubble-limit-label { stroke: #f8a1a9; fill: #f8c4c9; }
html[data-theme=dark] .bubble-limit { fill: none; }
.bubble-controls { margin-top: 11px; }
body[data-fourhao-game=bubble-pop] .bubble-controls button { min-height: 44px; min-width: 44px; }
.bubble-actions { margin-top: 8px; }
.bubble-status { min-height: 1.6em; margin: 8px 0 0; text-align: center; }
.bubble-status[data-warning] { color: #a24856; }
html[data-theme=dark] .bubble-status[data-warning] { color: #f8c4c9; }
#show-victory[hidden], #next-level[hidden] { display: none; }
.bubble-victory {
  box-sizing: border-box;
  width: min(420px, calc(100% - 32px));
  max-height: calc(100% - 32px);
  margin: auto;
  padding: 0;
  border: 1px solid var(--game-line);
  border-radius: 14px;
  color: var(--game-secondary);
  background: var(--game-surface);
  box-shadow: 0 18px 54px #14243840;
  overscroll-behavior: contain;
}
.bubble-victory::backdrop { background: #1326348c; }
.bubble-victory-body { padding: 24px clamp(18px, 6vw, 32px); text-align: center; }
.bubble-victory h2 { margin: 0; color: var(--game-accent); font-size: 22px; line-height: 1.45; }
.bubble-victory p { margin: 9px 0 16px; line-height: 1.65; }
@media (max-width: 560px) { .bubble-board { max-height: none; } }
@media (prefers-reduced-motion: no-preference) {
  .bubble-victory[open] { animation: bubble-result-in 220ms ease-out; }
  @keyframes bubble-result-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
  }
}
