* { margin: 0; padding: 0; box-sizing: border-box; }
html, body {
  width: 100%;
  height: 100%;
  background: #211b2e;
  overflow: hidden;
  font-family: system-ui, "PingFang SC", sans-serif;
}
body {
  display: flex;
  align-items: center;
  justify-content: center;
}
canvas#cv {
  display: block;
  touch-action: none;
  max-width: 100%;
  max-height: 100%;
}

.gf-shell-wrap,
.ag-shell-wrap {
  position: relative;
  display: block;
}

/* Sibling chrome overlays the game — do not steal width/height from the canvas */
.bf-stage {
  position: relative;
  display: block;
  max-width: 100vw;
  max-height: 100vh;
  line-height: 0;
}

.bf-sib-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 56px;
  border: 0;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.35);
  color: #fff8f0;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  z-index: 30;
  flex-shrink: 0;
  pointer-events: auto;
}

.bf-sib-prev { left: 6px; }
.bf-sib-next { right: 6px; }

.bf-sib-btn:active {
  background: rgba(0, 0, 0, 0.5);
}

.bf-sib-dots {
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  display: flex;
  gap: 7px;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.4);
  z-index: 30;
  line-height: 1;
  pointer-events: auto;
}

.bf-sib-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
}

.bf-sib-dot.on {
  background: #fff4e0;
  transform: scale(1.25);
}

.bf-sib-dot.has-save:not(.on) {
  box-shadow: 0 0 0 1.5px rgba(255, 224, 138, 0.7);
}

/* Per-sibling page chrome (jelly / wood / ice) */
html[data-bf-theme="jelly"] body { background: #211b2e; }
html[data-bf-theme="wood"] body { background: #1e1610; }
html[data-bf-theme="ice"] body { background: #101c24; }

html[data-bf-theme="jelly"] .bf-sib-btn { color: #fff8f0; background: rgba(196, 122, 166, 0.35); }
html[data-bf-theme="wood"] .bf-sib-btn { color: #f5e6d0; background: rgba(196, 120, 74, 0.4); }
html[data-bf-theme="ice"] .bf-sib-btn { color: #e8f8fc; background: rgba(126, 200, 224, 0.4); }

html[data-bf-theme="jelly"] .bf-sib-dot.on { background: #ffe08a; }
html[data-bf-theme="wood"] .bf-sib-dot.on { background: #e8a060; }
html[data-bf-theme="ice"] .bf-sib-dot.on { background: #a0e0f0; }

@media (max-width: 480px) {
  .bf-sib-btn {
    width: 32px;
    height: 48px;
    font-size: 22px;
  }
  .bf-sib-prev { left: 4px; }
  .bf-sib-next { right: 4px; }
}
