/* ═══════════════════════════════════════════════════
   games.css — 게임별 스테이지 스타일
   ═══════════════════════════════════════════════════ */

/* ── 공통 ─────────────────────────────────────── */
.scene-pad small { font-size: .8em; font-weight: 500; color: var(--text-2); }
/* 선택된 칸 — 색 + 빗금 + 안쪽 윤곽선 (색만으로 구분하지 않음) */
.sel-hatch { background-image: repeating-linear-gradient(45deg, rgba(255,255,255,.38) 0 4px, transparent 4px 9px) !important; box-shadow: inset 0 0 0 2px var(--text); }

/* ═══ GAME 01 · 버블티 ═══════════════════════════ */
.bt { gap: 14px; }
.bt-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; flex: 0 0 auto; }
.bt-customer { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }
.bt-face { font-size: 46px; line-height: 1; margin-left: 8px; }
.bt-face .ico, .rc-face .ico { width: 56px; height: 56px; vertical-align: 0; color: var(--text); }
.cf-cust-face .ico { width: 40px; height: 40px; vertical-align: 0; color: var(--text); }
.bt-bags { display: flex; gap: 10px; }
.bt-bag { width: 176px; padding: 10px 12px; border: 1.5px solid var(--line-2); border-radius: 10px; background: var(--surface-2); }
.bt-bag.on { border-color: var(--c); box-shadow: 2px 2px 0 var(--c); background: #fff; }
.bt-bag-name { font-size: 13px; font-weight: 700; }
.bt-bag-name .ico { color: var(--c); }
.bt-bag-name small { color: var(--text-3); }
.bt-bag-bar { height: 9px; border-radius: 99px; background: var(--surface-3); border: 1px solid var(--line); overflow: hidden; margin: 7px 0 6px; }
.bt-bag-bar div { height: 100%; background: var(--c); transition: width .3s ease; }
.bt-bag-left { font-size: 14px; color: var(--text-2); }
.bt-bag-left .frac { font-size: 18px; color: var(--text); }
.bt-mid { flex: 1 1 auto; min-height: 0; display: flex; align-items: center; justify-content: center; position: relative; }
.bt-measure, .bt-quiz { width: 100%; max-width: 920px; text-align: center; }
.bt-mlabel { font-size: 16px; font-weight: 600; margin-bottom: 14px; display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; }
.bt-bar { display: flex; gap: 3px; justify-content: center; margin: 0 auto; padding: 8px; border: 1.5px solid var(--text); border-radius: 10px; background: var(--surface-2); width: fit-content; max-width: 100%; }
.bt-cell { width: 30px; height: 60px; border-radius: 5px; background: #fff; border: 1.5px solid var(--line-2); cursor: pointer; transition: background .1s ease; }
.bt-cell.on { background: var(--c); border-color: var(--c); background-image: repeating-linear-gradient(45deg, rgba(255,255,255,.38) 0 4px, transparent 4px 9px); box-shadow: inset 0 0 0 2px var(--text); }
.bt-cell.gone { background: repeating-linear-gradient(45deg, var(--surface-3) 0 4px, transparent 4px 8px); cursor: default; }
.bt-amount { margin-top: 16px; font-size: 16px; font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 12px; }
.bt-amount .frac { color: var(--c); }
.bt-choices { display: flex; gap: 14px; justify-content: center; }
.bt-choice { display: inline-flex; align-items: center; gap: 12px; padding: 14px 24px; border: 1.5px solid var(--text); border-radius: 12px; background: #fff; cursor: pointer; box-shadow: 3px 3px 0 var(--text); font-family: inherit; }
.bt-choice:hover { background: var(--surface-2); }
.bt-choice:active { transform: translate(1px,1px); box-shadow: 2px 2px 0 var(--text); }
.bt-ck { font-family: var(--mono); font-size: 12px; font-weight: 700; padding: 3px 7px; border-radius: 5px; background: var(--surface-3); }
.bt-choice .frac { color: var(--text); }
.bt-foot { flex: 0 0 auto; font-size: 14.5px; color: var(--text-2); text-align: center; }
.bt-foot b { color: var(--red); }
.bt-rainbow { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); font-size: 120px; animation: rainbow 1.4s ease forwards; pointer-events: none; }
.bt-rainbow .ico { width: 1em; height: 1em; vertical-align: 0; color: var(--c); }
@keyframes rainbow { 0% { opacity: 0; transform: translate(-50%,-50%) scale(.4) } 30% { opacity: 1; transform: translate(-50%,-50%) scale(1.1) } 100% { opacity: 0; transform: translate(-50%,-80%) scale(1.3) } }

/* ═══ GAME 02 · 블록 깨기 ═══════════════════════ */
.bk { flex-direction: row; gap: 40px; align-items: stretch; justify-content: center; }
.bk-side { flex: 0 0 210px; display: flex; flex-direction: column; gap: 14px; justify-content: center; }
.bk-target-box, .bk-next { padding: 14px; border: 1.5px solid var(--text); border-radius: 12px; background: #fff; box-shadow: 3px 3px 0 var(--text); text-align: center; }
.bk-target { margin: 10px 0 6px; color: var(--c); }
.bk-rule { font-size: 14.5px; color: var(--text-2); display: flex; align-items: center; justify-content: center; gap: 4px; flex-wrap: wrap; }
.bk-rule .frac { font-size: 18px; color: var(--text); }
.bk-next #bk-card-preview { margin-top: 10px; display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 56px; }
.bk-op-big { font-family: var(--serif); font-size: 34px; font-weight: 700; }
.bk-bomb-big { font-size: 40px; color: var(--red); }
.bk-bomb-big .ico, .bk-card.bomb .ico { width: 1em; height: 1em; vertical-align: 0; }
.bk-board-wrap { flex: 0 1 auto; min-width: 0; display: flex; align-items: center; justify-content: center; }
.bk-board {
  --cols: 6; --rows: 7; --cell: 64px;
  position: relative;
  display: grid; grid-template-columns: repeat(var(--cols), var(--cell)); grid-template-rows: repeat(var(--rows), var(--cell));
  gap: 0;
  border: 2px solid var(--text); background: #fff;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: var(--cell) var(--cell);
}
.bk-cell { display: flex; align-items: center; justify-content: center; }
.bk-cell.block { background: color-mix(in srgb, var(--c) 18%, #fff); box-shadow: inset 0 0 0 2px var(--c); color: var(--text); }
.bk-cell.pop { animation: bkpop .6s ease forwards; }
.bk-cell.miss { animation: bkmiss .5s ease; }
.bk-cell.boom { animation: bkboom .7s ease; }
@keyframes bkpop { 50% { background: #ffe05c } 100% { background: #fff } }
@keyframes bkmiss { 25% { background: rgba(200,56,58,.25) } 75% { background: rgba(200,56,58,.25) } }
@keyframes bkboom { 30% { background: #ffb347 } 100% { background: #fff } }
.bk-card {
  position: absolute; left: calc(var(--c) * var(--cell)); top: calc(var(--r) * var(--cell));
  width: var(--cell); height: var(--cell);
  display: flex; align-items: center; justify-content: center; gap: 2px;
  background: var(--text); color: #fff; border-radius: 6px;
  transition: left .12s ease, top .12s linear;
  z-index: 5; box-shadow: 0 4px 0 rgba(0,0,0,.25);
}
.bk-card .frac .fd { border-color: #fff; }
.bk-card.bomb { background: var(--red); font-size: 30px; }
.bk-op { font-family: var(--serif); font-size: 22px; font-weight: 700; }

/* ═══ GAME 03 · 정육점 ══════════════════════════ */
.bc { gap: 18px; }
.bc-top { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; flex: 0 0 auto; }
.bc-order { padding: 14px 18px; border: 1.5px solid var(--text); border-radius: 12px; background: #fff; box-shadow: 3px 3px 0 var(--text); }
.bc-order-text { margin-top: 10px; display: flex; align-items: center; gap: 8px; font-size: 18px; font-weight: 700; }
.bc-order-text .frac { color: var(--c); }
.bc-order-text small { font-size: 15px; margin-left: 6px; }
.bc-table { padding: 12px 16px; border: 1.5px dashed var(--line-2); border-radius: 12px; background: var(--surface-2); }
.bc-table div { margin-top: 8px; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 18px; font-size: 14.5px; }
.bc-table .frac { font-size: 18px; }
.bc-meat-wrap { --den: 5; flex: 1 1 auto; min-height: 0; position: relative; display: flex; align-items: center; padding: 0 10px; }
.bc-meat { width: 100%; height: clamp(110px, 19vh, 150px); display: flex; border: 3px solid #7a3b2e; border-radius: 80px; overflow: hidden; background: #f3c9b8; }
.bc-seg { flex: 1 1 0; background: repeating-linear-gradient(90deg, #ef9d8a 0 12px, #f6bfae 12px 26px); border-right: 3px solid #7a3b2e; position: relative; }
.bc-seg:last-child { border-right: 0; }
.bc-seg.sold { background: #fff; opacity: .55; }
.bc-knife { position: absolute; top: 4%; bottom: 4%; left: 0; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; pointer-events: none; z-index: 3; }
.bc-knife .ico { width: 52px; height: 52px; vertical-align: 0; color: var(--text); }
.bc-knife i { flex: 1 1 auto; width: 3px; background: var(--text); border-radius: 2px; margin-top: -6px; }
.bc-cutmark { position: absolute; top: 18%; bottom: 18%; width: 4px; transform: translateX(-50%); background: var(--good); z-index: 2; border-radius: 2px; }
.bc-cutmark.bad { background: repeating-linear-gradient(180deg, var(--red) 0 8px, transparent 8px 14px); }
.bc-cutmark::before { position: absolute; top: -26px; left: 50%; transform: translateX(-50%); font-size: 20px; font-weight: 800; }
.bc-cutmark.ok::before { content: "○"; color: var(--good); }
.bc-cutmark.bad::before { content: "✕"; color: var(--red); }
.bc-answer { position: absolute; top: 12%; bottom: 12%; width: 3px; transform: translateX(-50%); background: var(--good); z-index: 2; }
.bc-answer::after { content: "정답"; position: absolute; bottom: -24px; left: 50%; transform: translateX(-50%); white-space: nowrap; font-size: 13px; font-weight: 800; color: var(--good); }
.bc-answer[hidden] { display: none; }
.bc-meat-wrap::after {
  content: ""; position: absolute; left: 10px; right: 10px; top: calc(50% - clamp(55px, 9.5vh, 75px) - 16px); height: 12px;
  background-image: linear-gradient(90deg, var(--text) 2px, transparent 2px);
  background-size: calc((100% - 6px) / var(--den)) 100%; background-position: 0 0; pointer-events: none; opacity: .6;
}
.bc-foot { flex: 0 0 auto; font-size: 14.5px; color: var(--text-2); text-align: center; }

/* ═══ GAME 04 · 가래떡 ══════════════════════════ */
.rc { gap: 12px; }
.rc-town { font-size: 14px; color: var(--text-3); font-weight: 600; letter-spacing: .02em; flex: 0 0 auto; }
.rc-town .ico { color: var(--c); margin-right: 3px; }
.rc-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; flex: 0 0 auto; }
.rc-customer { display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.rc-face { font-size: 46px; line-height: 1; margin-left: 8px; }
.rc-timer { width: 220px; padding: 12px 14px; border: 1.5px solid var(--text); border-radius: 12px; background: #fff; box-shadow: 3px 3px 0 var(--text); }
.rc-timer-bar { height: 12px; margin-top: 8px; border: 1px solid var(--line-2); border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.rc-timer-bar div { height: 100%; background: var(--c); width: 100%; transition: width .1s linear; }
.rc-timer-num { margin-top: 6px; font-family: var(--mono); font-size: 18px; font-weight: 700; text-align: right; }
.rc-board-wrap { flex: 1 1 auto; min-height: 0; display: flex; align-items: center; gap: 22px; }
.rc-board { flex: 1 1 auto; position: relative; display: flex; gap: 4px; padding: 18px; border: 3px solid #8a5a3c; border-radius: 22px; background: #d9b48f; height: clamp(110px, 19vh, 150px); }
.rc-board.slide { animation: rcslide .6s ease; }
@keyframes rcslide { from { transform: translateX(60px); opacity: .3 } to { transform: none; opacity: 1 } }
.rc-piece { flex: 1 1 0; background: #fff; border: 2px solid #c9c2b6; border-radius: 8px; cursor: pointer; transition: background .1s ease; }
.rc-piece.cut { background: color-mix(in srgb, var(--c) 40%, #fff); border-color: var(--text); background-image: repeating-linear-gradient(45deg, rgba(255,255,255,.5) 0 4px, transparent 4px 9px); box-shadow: inset 0 0 0 2px var(--text); }
.rc-piece.sold { opacity: .25; }
.rc-piece.gone { visibility: hidden; }
.rc-board { --den: 10; }
.rc-knife { position: absolute; top: -18px; left: calc(18px + (100% - 36px) * var(--n) / var(--den) - 2px); transform: translateX(-50%); font-size: 34px; line-height: 1; pointer-events: none; transition: left .12s ease; z-index: 3; color: var(--text); }
.rc-knife .ico { width: 44px; height: 44px; vertical-align: 0; color: var(--text); }
.rc-shelf { flex: 0 0 140px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.rc-mini { width: 120px; height: 18px; border-radius: 9px; background: #fff; border: 2px solid #c9c2b6; }
.rc-foot { flex: 0 0 auto; font-size: 15px; color: var(--text-2); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rc-foot .frac { color: var(--text); }

/* ═══ GAME 05 · 카페 ════════════════════════════ */
.cf { flex-direction: row; gap: 18px; }
.cf-queue { flex: 0 0 230px; display: flex; flex-direction: column; gap: 10px; }
.cf-cust { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1.5px solid var(--line-2); border-radius: 12px; background: var(--surface-2); width: 100%; text-align: left; cursor: pointer; font-family: inherit; color: inherit; }
.cf-cust:hover { border-color: var(--text); }
.cf-cust.on { border-color: var(--text); background: #fff; box-shadow: 3px 3px 0 var(--text); }
.cf-cust.alien { border-color: #7a4bb5; }
.cf-cust-face { font-size: 34px; line-height: 1; }
.cf-cust-body { flex: 1 1 auto; min-width: 0; font-size: 14px; }
.cf-cust-body small { color: #7a4bb5; font-weight: 800; }
.cf-pat { display: block; height: 7px; margin-top: 6px; border-radius: 99px; background: var(--surface-3); border: 1px solid var(--line); overflow: hidden; }
.cf-pat-fill { display: block; height: 100%; background: var(--warn); transition: width .1s linear; }
.cf-need { margin-top: 14px; font-size: 15px; font-weight: 600; color: var(--text-2); }
.cf-need em { font-style: normal; color: var(--red); font-weight: 800; }
.cf-empty { font-size: 13px; color: var(--text-3); padding: 10px 4px; }
.cf-center { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; }
.cf-order .bubble { font-size: 17px; }
.cf-order .bubble small { font-size: 15px; }
.cf-cup-wrap { display: flex; align-items: center; gap: 22px; }
.cf-cup { width: 100px; height: 170px; display: flex; flex-direction: column; gap: 3px; padding: 6px; border: 3px solid var(--text); border-top-width: 5px; border-radius: 8px 8px 22px 22px; background: #fff; }
.cf-cell { flex: 1 1 0; border-radius: 4px; background: var(--surface-2); border: 1px dashed var(--line-2); }
.cf-cell.on { background: var(--c); border: 2px solid var(--text); background-image: repeating-linear-gradient(45deg, rgba(255,255,255,.38) 0 4px, transparent 4px 9px); }
.cf-cup-label { font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.cf-cup-label .frac { color: var(--c); }
.cf-shelf { flex: 0 0 230px; display: flex; flex-direction: column; gap: 6px; min-height: 0; overflow: hidden; }
.cf-item { display: flex; align-items: center; gap: 10px; padding: 5px 10px; border: 1.5px solid var(--text); border-radius: 10px; background: #fff; font-size: 14px; width: 100%; text-align: left; cursor: pointer; font-family: inherit; color: inherit; box-shadow: 2px 2px 0 var(--text); }
.cf-item:hover { background: var(--surface-2); }
.cf-item:active { transform: translate(1px,1px); box-shadow: 1px 1px 0 var(--text); }
.cf-item.empty { border-style: dashed; box-shadow: none; background: var(--surface-2); }
.cf-item.empty b::after { content: " · 없음"; color: var(--red); font-weight: 800; }
.cf-item-body { flex: 1 1 auto; min-width: 0; }
.cf-item-key { font-family: var(--mono); font-size: 11.5px; font-weight: 700; padding: 3px 7px; border-radius: 5px; background: var(--surface-3); border: 1px solid var(--line-2); color: var(--text-2); }
.cf-item-emoji { font-size: 22px; line-height: 1; }
.cf-item-emoji .ico { width: 30px; height: 30px; vertical-align: 0; color: var(--c); }
.cf-item small { display: block; font-size: 11.5px; color: var(--text-3); }

@media (max-width: 1180px) {
  .bk-board { --cell: 52px; }
  .bt-cell { width: 22px; height: 50px; }
  .cf-queue { flex-basis: 190px; }
  .cf-shelf { flex-basis: 170px; }
}
