/* BZ 반응 — 시안(docs/기획문서/시안/bz-reaction)의 스타일을 .exp-bz 아래로 옮김. 사이트 공용 클래스(.btn .read 등)와 이름이 겹치지 않게 접두를 붙였다. */
.exp-bz { --blue: #46a9e0; --org: #ff9f43; --chip: #141b30; --steel: #475170; --steel2: #8592b8; --bgs: #0b1020; }
.exp-bz .lab { display: grid; grid-template-columns: 960px 300px; gap: 20px; align-items: start; }

/* 무대: 480x270 도트를 2배로 + 읽는 층(960x540) */
.exp-bz .stage-box { position: relative; width: 960px; height: 540px; background: var(--bgs); box-shadow: 0 0 0 3px var(--steel), 0 0 0 6px #000; overflow: hidden; }
.exp-bz .stage-box canvas { position: absolute; left: 0; top: 0; width: 960px; height: 540px; display: block; }
.exp-bz #stage { image-rendering: pixelated; }
.exp-bz #hud { pointer-events: none; }
.exp-bz #stage.tool-drop { cursor: crosshair; }
.exp-bz #stage.tool-dish { cursor: crosshair; touch-action: none; }

/* 영상의 알약 칩 */
.exp-bz .pill { position: absolute; font-weight: 700; font-size: 14px; color: var(--c, var(--text)); background: var(--chip); border: 2px solid var(--c, var(--text)); border-radius: 999px; padding: 3px 12px; white-space: nowrap; line-height: 1.2; }
.exp-bz .pill i { display: inline-block; width: 9px; height: 9px; margin-right: 7px; background: var(--c); }
.exp-bz .pill.dim { opacity: .35; }
.exp-bz .caption { position: absolute; left: 60px; right: 60px; bottom: 10px; text-align: center; font-weight: 700; font-size: 21px; line-height: 1.35; padding: 8px 14px; background: rgba(7,10,20,.78); text-shadow: 2px 2px 0 #000; min-height: 50px; pointer-events: none; }
.exp-bz .caption b { color: var(--gold); }
.exp-bz .slam { position: absolute; left: 50%; top: 150px; transform: translateX(-50%); font-weight: 700; font-size: 40px; color: #fff; text-shadow: 3px 3px 0 #000; padding: 6px 22px; border: 4px solid var(--c, #fff); background: rgba(7,10,20,.85); display: none; pointer-events: none; white-space: nowrap; }
.exp-bz .slam.on { display: block; animation: bz-slam .35s steps(5) both; }
.exp-bz .slam small { display: block; font-size: 15px; font-weight: 400; text-align: center; color: var(--sub); }
@keyframes bz-slam { from { transform: translateX(-50%) scale(1.5); opacity: 0; } to { transform: translateX(-50%) scale(1); opacity: 1; } }
.exp-bz .title-card { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: 18px; text-align: center; pointer-events: none; background: rgba(11,16,32,.6); animation: bz-titleOut .4s steps(4) 2.4s forwards; }
.exp-bz .title-card .big { font-weight: 700; font-size: 62px; line-height: 1.25; text-shadow: 5px 5px 0 #000; animation: bz-titleIn .5s steps(5) both; }
.exp-bz .title-card em { font-style: normal; color: var(--gold); }
.exp-bz .title-card .row { display: flex; gap: 10px; justify-content: center; }
.exp-bz .title-card .pill { position: static; font-size: 17px; padding: 4px 16px; }
@keyframes bz-titleIn { from { transform: scale(1.3); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes bz-titleOut { to { opacity: 0; visibility: hidden; } }
.exp-bz .busy { position: absolute; left: 0; right: 0; top: 0; z-index: 2; text-align: center; font-weight: 700; font-size: 18px; color: var(--gold); background: rgba(7,10,20,.85); padding: 8px; pointer-events: none; }

/* 조작판 */
.exp-bz .panel { min-width: 0; padding: 12px 14px 14px; }
.exp-bz .tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 10px; }
.exp-bz .tabs button { font: 700 14px var(--pix); color: var(--text); background: var(--chip); border: 2px solid var(--steel); border-radius: 999px; padding: 7px 4px; cursor: pointer; min-height: 40px; }
.exp-bz .tabs button small { font-size: 11px; opacity: .85; }
.exp-bz .tabs button[aria-selected=true] { color: #07101c; background: var(--cyan); border-color: var(--cyan); }
.exp-bz .param { margin: 0 0 9px; }
.exp-bz .param .head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.exp-bz .param label { font-size: 14px; font-weight: 700; }
.exp-bz .param .help { font-family: var(--read); font-size: 11px; color: var(--sub); margin: 0; line-height: 1.3; }
.exp-bz .param .val { display: flex; align-items: center; gap: 3px; }
.exp-bz .param input[type=number] { width: 88px; height: 30px; font: 700 14px var(--pix); text-align: right; color: var(--gold); background: var(--bg2); border: 2px solid var(--steel); padding: 0 6px; }
.exp-bz .param .unit { color: var(--gold); font-size: 13px; font-weight: 700; min-width: 8px; }
.exp-bz input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 24px; background: transparent; cursor: pointer; margin: 0; }
.exp-bz input[type=range]::-webkit-slider-runnable-track { height: 8px; background: var(--bg2); border: 2px solid var(--steel); }
.exp-bz input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 22px; margin-top: -9px; background: var(--cyan); border: 3px solid #12507a; border-radius: 3px; }
.exp-bz input[type=range]::-moz-range-track { height: 8px; background: var(--bg2); border: 2px solid var(--steel); }
.exp-bz input[type=range]::-moz-range-thumb { width: 14px; height: 20px; background: var(--cyan); border: 3px solid #12507a; border-radius: 3px; }
.exp-bz input:focus-visible, .exp-bz button:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.exp-bz .presets { display: flex; flex-wrap: wrap; gap: 5px; }
.exp-bz .presets button { font: 700 12px var(--pix); color: var(--text); background: var(--chip); border: 2px solid var(--steel); border-radius: 999px; padding: 3px 9px; min-height: 30px; cursor: pointer; }
.exp-bz .presets button[aria-pressed=true] { color: #07101c; background: var(--gold); border-color: var(--gold); }
.exp-bz .presets button small { font-size: 11px; opacity: .85; }
.exp-bz .row-btns { display: flex; flex-wrap: wrap; gap: 5px; margin: 0 0 8px; }
.exp-bz .bzb { font: 700 13px var(--pix); color: var(--text); background: var(--chip); border: 3px solid var(--steel); border-radius: 999px; padding: 6px 10px; min-height: 40px; cursor: pointer; }
.exp-bz .bzb.go { color: #07101c; background: var(--gold); border-color: var(--gold); }
.exp-bz .bzb[aria-pressed=true] { color: #07101c; background: var(--cyan); border-color: var(--cyan); }
.exp-bz .bzb.sm { font-size: 12.5px; padding: 5px 10px; min-height: 36px; border-width: 2px; }
.exp-bz .bzb:active { transform: translate(1px, 1px); }
.exp-bz .hint { font-family: var(--read); font-size: 12px; color: var(--sub); line-height: 1.4; margin: 6px 0 0; }
.exp-bz [hidden] { display: none !important; }

/* 계산 결과 판 */
.exp-bz .bzread { margin-top: 14px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.exp-bz .bzread .cell { background: var(--panel); border: 3px solid var(--steel); padding: 8px 10px; min-width: 0; }
.exp-bz .bzread .k { font-size: 12px; color: var(--sub); }
.exp-bz .bzread .v { font-size: 22px; font-weight: 700; color: var(--gold); line-height: 1.25; }
.exp-bz .bzread .ref { font-family: var(--read); font-size: 11px; color: var(--steel2); }
.exp-bz .hud-m { display: none; }

/* 무대를 줄여 보여 줄 때(가로 1340px 미만): 판은 무대 아래, 무대는 폭에 맞춤 */
@media (max-width: 1340px) {
  .exp-bz .lab { grid-template-columns: minmax(0, 1fr); }
  .exp-bz .panel { width: auto; max-width: 560px; }
  .exp-bz .stage-wrap { width: 100%; aspect-ratio: 16 / 9; position: relative; }
  .exp-bz .stage-box { transform-origin: 0 0; transform: scale(var(--k, 1)); position: absolute; }
}
/* 무대 위 글자가 화면에서 11px 밑으로 내려가는 폭(app.js가 .mini를 붙임, 무대 배율 0.8 미만):
   무대 안 칩은 숨기고 아래 HUD 칸으로 옮기고, 자막·알림은 화면 기준 일정한 크기로 키운다. */
.exp-bz.mini .pill.inside { display: none; }
.exp-bz.mini .caption { display: none; }
.exp-bz .cap-m { display: none; }
.exp-bz.mini .cap-m { display: block; margin-top: 10px; padding: 10px 12px; background: var(--panel); border: 3px solid var(--steel); font-weight: 700; font-size: 14px; line-height: 1.5; }
.exp-bz .cap-m b { color: var(--gold); }
.exp-bz.mini .slam { font-size: calc(18px / var(--k, 1)); top: 28%; }
.exp-bz.mini .slam small { display: none; }
.exp-bz.mini .title-card .big { font-size: calc(26px / var(--k, 1)); }
.exp-bz.mini .title-card .pill { font-size: calc(12px / var(--k, 1)); padding: 2px 10px; }
.exp-bz.mini .busy { font-size: calc(13px / var(--k, 1)); padding: 4px; }
.exp-bz.mini .hud-m { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 10px; }
.exp-bz .hud-m .pill { position: static; text-align: center; font-size: 13px; padding: 6px; border-radius: 10px; }
.exp-bz .hud-m .pill b { display: block; font-size: 20px; color: var(--c); }
@media (max-width: 700px) {
  .exp-bz .bzread { grid-template-columns: 1fr 1fr; }
  .exp-bz .panel { max-width: none; }
}
@media (prefers-reduced-motion: reduce) { .exp-bz .slam.on, .exp-bz .title-card .big { animation: none; } .exp-bz .title-card { animation: bz-titleOut .01s linear 2.4s forwards; } }
