/* Wayang Bayang: a carved panggung frame round a lamp-lit kelir, on Rehat's cream paper. */
.page {
  --bb-wood: #5A2E17;
  --bb-wood-2: #8A4B22;
  --bb-brass: #C99A3B;
  --bb-ink: #1E140C;
  --bb-cloth-edge: #B98A50;
}
.game-title, .panel h2, .banner h2 { font-family: var(--font-round); font-weight: 600; }

/* stage */
.board-wrap { display: block; container-type: inline-size; }
.bb-stage { background: linear-gradient(180deg, var(--bb-wood-2), var(--bb-wood)); border-radius: var(--radius-lg); padding: clamp(8px, 2.4cqw, 18px); box-shadow: var(--shadow-card); }
.bb-kelir { display: block; width: 100%; height: auto; aspect-ratio: 5 / 3; border-radius: var(--radius-sm); outline: 2px solid var(--bb-cloth-edge); touch-action: none; user-select: none; -webkit-user-select: none; cursor: default; }
.bb-kelir:focus-visible { outline: 3px solid var(--color-focus); outline-offset: 2px; }
.bb-ghost { opacity: .16; }
.bb-ghost path { fill: var(--bb-ink); }
.bb-shadow path { fill: var(--bb-ink); fill-opacity: .9; }
.bb-shadow { cursor: grab; }
.bb-selpath { fill: none; stroke: var(--bb-brass); stroke-width: 2.5; stroke-linejoin: round; pointer-events: none; }
.bb-hintpath { fill: none; stroke: var(--bb-brass); stroke-width: 2.5; stroke-dasharray: 8 6; pointer-events: none; }
.bb-stage.is-done .bb-ghost { opacity: 0; transition: opacity var(--dur-3) var(--ease); }

/* rail */
.bb-rail { display: flex; gap: 8px; justify-content: center; margin-top: 10px; padding: 8px; border-radius: var(--radius-md); background: rgba(0, 0, 0, .18); overflow-x: auto; }
.bb-slot { display: grid; justify-items: center; gap: 2px; min-width: 64px; padding: 6px 8px; border: 1px solid transparent; border-radius: var(--radius-sm); background: rgba(255, 246, 223, .12); color: #F6E7C8; font: 600 12px/1.2 var(--font-body); cursor: pointer; }
.bb-slot svg { width: auto; height: 44px; }
.bb-slot svg path { fill: #F6E7C8; }
.bb-slot.is-up { opacity: .45; }
.bb-slot.is-sel { border-color: var(--bb-brass); opacity: 1; }
.bb-slot:focus-visible { outline: 3px solid var(--color-focus); outline-offset: 2px; }

/* tools */
.bb-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center; margin-top: var(--space-3); }
.bb-depth { display: flex; align-items: center; gap: 8px; flex: 1 1 260px; max-width: 420px; font: 600 13px var(--font-body); color: var(--color-text-muted); }
.bb-depth input { flex: 1; accent-color: var(--bb-brass); min-height: 44px; }
.bb-tool { min-width: 44px; min-height: 44px; font-size: 20px; }
@media (max-width: 560px) {
  .bb-depth { flex-basis: 100%; max-width: none; }
}

/* setup list */
.bb-scenes { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.bb-scene { width: 100%; display: grid; grid-template-columns: 2em 1fr auto; grid-template-areas: 'n title best' 'n teach best'; align-items: center; gap: 0 10px; padding: 10px 12px; border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-surface); color: var(--color-text); text-align: left; cursor: pointer; }
.bb-scene:hover { box-shadow: var(--shadow-card-hover); }
.bb-scene.is-last { border-color: var(--color-accent); }
.bb-scene__n { grid-area: n; font: 600 18px var(--font-round); color: var(--color-text-muted); }
.bb-scene__title { grid-area: title; font-weight: 700; }
.bb-scene__teach { grid-area: teach; font-size: 13px; color: var(--color-text-muted); }
.bb-scene__best { grid-area: best; font-variant-numeric: tabular-nums; color: var(--color-good); white-space: nowrap; }

/* story card */
.bb-story { text-align: left; max-width: 60ch; margin: var(--space-2) auto var(--space-3); }
.bb-story__text { margin: 0 0 var(--space-2); }
.bb-story__note { margin: 0; padding: var(--space-2) var(--space-3); border-left: 3px solid var(--bb-brass); background: var(--color-surface-2); border-radius: var(--radius-sm); font-size: 14px; }
.bb-sound { min-width: 44px; }

@media (prefers-reduced-motion: reduce) {
  .bb-stage.is-done .bb-ghost { transition: none; }
}
