/* Bubble shooter (js/games/bubble-shooter.js). Kit styles: css/game.css.
 * The board is one canvas; the script reads --bs-field / --bs-aim (and the theme's --ink,
 * --ink-muted, --line-strong, --accent) for its colours. Bubbles keep their own colours. */

.bs-room {
  position: absolute; inset: 0; overflow: hidden; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  background: var(--surface-100);
  --bs-field: var(--surface-200); --bs-aim: rgba(255, 255, 255, .78);
}
:root[data-theme="light"] .bs-room {
  background: var(--surface-300); background: color-mix(in srgb, var(--toy-blue) 22%, var(--surface-300));
  --bs-field: #FFFFFF; --bs-aim: rgba(17, 17, 17, .62);
}
.bs-canvas { position: absolute; left: 0; top: 0; touch-action: none; cursor: crosshair; }
.bs-canvas:focus { outline: none; }
.bs-canvas:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: -3px; border-radius: var(--radius-md, 12px); }

/* the next bubble: one tap swaps it into the launcher */
.bs-swap {
  position: absolute; z-index: 3; display: flex; align-items: flex-end; justify-content: center;
  min-width: var(--tap-min); padding: 0; border: 0; border-radius: var(--radius-lg); background: transparent; color: var(--ink-muted); cursor: pointer;
}
.bs-swap:hover .bs-swap-label, .bs-swap:focus-visible .bs-swap-label { color: var(--ink); }
.bs-swap:focus-visible { outline: 3px solid var(--focus-ring, var(--accent)); outline-offset: 2px; }
.bs-swap-label { font-size: .85rem; font-weight: 500; line-height: 1; }

/* shots left before the ceiling comes down: counted, never a clock */
.bs-info { position: absolute; z-index: 2; margin: 0; display: flex; flex-direction: column; gap: 2px; font-size: .85rem; line-height: 1.25; color: var(--ink-muted); pointer-events: none; }
.bs-info b { font-size: 1rem; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.bs-info.is-warn b { color: var(--caution); }

/* out of room: a calm card with Undo first */
.bs-full {
  position: absolute; left: 50%; bottom: max(16px, env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 8;
  width: min(30rem, calc(100% - 24px)); display: flex; flex-direction: column; gap: var(--space-3);
  padding: var(--space-4) var(--space-5); border-radius: var(--radius-lg);
  background: var(--surface-200); border: 1.5px solid var(--accent); box-shadow: var(--shadow-float); color: var(--ink);
}
.bs-full[hidden] { display: none; }
.bs-full-text { margin: 0; font-size: .95rem; line-height: 1.4; }
.bs-full-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.bs-full .icon { width: 1.1rem; height: 1.1rem; }
