.bubble-game {
  --bs-ink: #253f3a;
  --bs-soft-ink: #486460;
  --bs-accent: #246452;
  background: radial-gradient(ellipse at 10% 5%, #fff1e4, transparent 50%),
    radial-gradient(ellipse at 90% 26%, #e9def7, transparent 45%), #f9f5ee;
  color: var(--bs-ink);
}
.bs-skip, .bs-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.bs-skip:focus {
  z-index: 100;
  width: auto;
  height: auto;
  padding: .75rem;
  background: white;
  clip-path: none;
}
.bs-layout {
  font-family: var(--ui2-font-family);
  width: min(100%, 980px);
  margin: 0 auto;
  padding: clamp(12px, 2.6vw, 36px) clamp(12px, 3vw, 28px) 34px;
}
.bs-heading {
  display: grid;
  gap: 5px;
  align-content: start;
}
.bs-back {
  width: max-content;
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  color: var(--bs-accent);
  font-size: 13px;
  font-weight: 750;
  text-decoration: none;
}
.bs-heading h1 {
  font-size: clamp(27px, 5vw, 54px);
  line-height: 1.1;
  letter-spacing: -.035em;
  margin: 0;
}
.bs-levels {
  display: grid;
  grid-template-columns: repeat(5, minmax(44px, 1fr));
  gap: 6px;
  margin: 8px 0 0;
}
.bs-layout button {
  color: var(--bs-ink);
  background: #fffdf9;
  border: 1px solid #cdcec1;
  border-radius: 14px;
  min-width: 44px;
  min-height: 44px;
  padding: 0 12px;
  font: inherit;
  font-size: 14px;
  font-weight: 750;
  cursor: pointer;
  touch-action: manipulation;
}
.bs-layout button:hover:not(:disabled) { border-color: var(--bs-accent); }
.bs-layout button:disabled {
  background: #eeeae3;
  color: #726e67;
  cursor: default;
}
.bs-layout button[aria-current], #bs-continue {
  border-color: var(--bs-accent);
  background: var(--bs-accent);
  color: #fff;
}
.bs-layout :focus-visible {
  outline: 3px solid #346f60;
  outline-offset: 2px;
}
.bs-game { min-width: 0; margin-top: 7px; }
.bs-hud {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 5px;
  margin: 0 auto 7px;
}
.bs-hud > div {
  min-width: 0;
  min-height: 51px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 1px;
  border-radius: 14px;
  background: #fffffff2;
  border: 1px solid #e8dfd4;
  padding: 3px 2px;
}
.bs-hud span {
  font-size: clamp(11px, 2.9vw, 14px);
  font-weight: 700;
  color: var(--bs-soft-ink);
  line-height: 1.2;
}
.bs-hud strong {
  font-size: 19px;
  line-height: 1.08;
  font-variant-numeric: tabular-nums;
}
.bs-token {
  min-width: 23px;
  height: 23px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 15px !important;
  background: #eeeee7;
}
.bs-token[data-color="A"] { background: #f8b6ac; color: #813640; }
.bs-token[data-color="B"] { background: #e0c2f4; color: #623a79; }
.bs-token[data-color="C"] { background: #b3e1f0; color: #294f69; }
.bs-token[data-color="D"] { background: #fbe29e; color: #614413; }
.bs-sink {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  padding: 6px;
  background: linear-gradient(180deg, #e4c2a2 0 8px, #e0c6b1 8px 10px, #fbf0e5 10px, #f1ece8 65%, #dfefe9);
  border: 1px solid #d6bba4;
  box-shadow: 0 7px 20px #724b4420, inset 0 2px #fff9;
}
#bs-board {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 324 / 420;
  cursor: crosshair;
  outline-offset: -4px;
  border-radius: 14px;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.bs-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 5px 0 0;
  gap: 8px;
}
.bs-controls p {
  margin: 0;
  padding: 0 3px;
  font-size: clamp(11px, 3vw, 15px);
  font-weight: 700;
  color: var(--bs-soft-ink);
}
.bs-result {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: end center;
  padding: 18px;
  background: linear-gradient(transparent 24%, #355c5269);
}
.bs-result[hidden] { display: none; }
.bs-result-card {
  padding: 18px;
  width: min(100%, 300px);
  text-align: center;
  border-radius: 18px;
  background: #fffdf6;
  box-shadow: 0 8px 24px #264e4a24;
}
.bs-result h2 { font-size: clamp(20px, 4vw, 27px); margin: 0; }
.bs-result p { margin: 5px 0 12px; }
.bs-help {
  margin-top: 12px;
  padding: 14px;
  border-radius: 18px;
  background: #fffdfa;
  border: 1px solid #e8dfd4;
}
.bs-help h2 { margin: 0; font-size: 19px; }
.bs-help ol {
  padding-left: 23px;
  margin: 7px 0 0;
  font-size: 14px;
  line-height: 1.55;
}
.bs-help li + li { margin-top: 5px; }
.bs-help img { display: none; }
@media (max-width: 779px) {
  .bs-layout { max-width: min(478px, calc((100svh - 205px) * .7714 + 38px)); min-width: min(300px, 100%); }
}
@media (max-width: 380px) and (max-height: 630px) {
  .bs-layout { padding-top: 7px; }
  .bs-back { min-height: 22px; }
  .bs-heading { gap: 3px; }
  .bs-hud > div { min-height: 46px; }
}
@media (min-width: 780px) {
  .bs-layout {
    display: grid;
    grid-template-columns: minmax(280px, 415px) minmax(300px, 390px);
    grid-template-rows: auto auto 1fr;
    column-gap: clamp(24px, 5vw, 64px);
    row-gap: 18px;
    justify-content: center;
  }
  .bs-game { grid-row: 1 / 4; grid-column: 1; margin-top: 0; }
  .bs-heading { grid-row: 1; grid-column: 2; gap: 7px; }
  .bs-levels { grid-row: 2; grid-column: 2; margin: 0; }
  .bs-help { grid-row: 3; grid-column: 2; align-self: start; margin-top: 0; }
  .bs-help img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 12px;
    margin-top: 14px;
  }
}

.bs-level-note { margin: 0 0 8px; color: var(--bs-soft-ink); font-size: 14px; line-height: 1.45; }
