/* 미니 게임 존 공용 틀(9차) — 작은 업라이트 캐비닛: 간판 · 경품 줄 · 화면(2D 캔버스) · 점수판. 밝은 매장 톤(키트 --ak-*)
   폰 먼저(390×844 한 손) — 위 키트 알약 줄(약 58px) 아래부터 하단 바(--ak-bb-h) 위까지를 캐비닛 하나가 채운다. */
:root { --f-sign: "Black Han Sans", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif; color-scheme: light; }
html, body { margin: 0; height: 100%; overflow: hidden; overscroll-behavior: none; }
body { background: var(--ak-bg, #f4f5f7); color: var(--ak-fg, #16181d); font-family: var(--ak-body, "IBM Plex Sans KR", system-ui, sans-serif); font-size: 15px; line-height: 1.5; }
button { font-family: inherit; }
button:focus-visible, a:focus-visible { outline: 3px solid var(--ak-on, #0b74c4); outline-offset: 2px; }

/* 매장 벽 — 옅은 줄무늬 + 바닥 */
.mn-room { position: relative; box-sizing: border-box; height: calc(100vh - var(--ak-bb-h, 72px)); height: calc(100svh - var(--ak-bb-h, 72px));
  padding: calc(56px + env(safe-area-inset-top, 0px)) 10px 8px; display: flex; justify-content: center;
  background: linear-gradient(transparent 82%, #e6e2da 82%), repeating-linear-gradient(90deg, #f7f4ee 0 46px, #f1ede5 46px 48px); }
/* 캐비닛 — 대 색(--c1 몸통 · --c2 장식) */
.mn-cab { position: relative; display: flex; flex-direction: column; width: 100%; max-width: 520px; min-height: 0; box-sizing: border-box;
  background: linear-gradient(180deg, var(--c1, #ff6aa8), color-mix(in srgb, var(--c1, #ff6aa8) 80%, #000)); border-radius: 22px 22px 10px 10px;
  padding: 6px 8px 8px; box-shadow: 0 10px 24px rgba(16,24,40,.18), inset 0 2px 0 rgba(255,255,255,.35); }
.mn-cab::before, .mn-cab::after { content: ""; position: absolute; top: 18px; bottom: 0; width: 6px; background: var(--c2, #ffd166); opacity: .85; }
.mn-cab::before { left: -3px; border-radius: 6px 0 0 6px; } .mn-cab::after { right: -3px; border-radius: 0 6px 6px 0; }
/* 간판 */
.mn-marq { position: relative; flex: none; height: 44px; margin: 0 4px 5px; border-radius: 14px; overflow: hidden;
  background: radial-gradient(120% 140% at 50% 0%, #fff8, transparent 60%), linear-gradient(90deg, var(--c2, #ffd166), color-mix(in srgb, var(--c2, #ffd166) 70%, #fff), var(--c2, #ffd166));
  display: flex; align-items: center; justify-content: center; gap: 10px; box-shadow: inset 0 -3px 0 rgba(0,0,0,.12); }
.mn-marq b { font: 400 25px/1 var(--f-sign); color: #1b1d26; letter-spacing: .02em; text-shadow: 0 2px 0 #fff8; white-space: nowrap; }
.mn-marq small { font-size: 12px; font-weight: 700; color: #1b1d26b0; white-space: nowrap; }
:lang(ja) .mn-marq b, :lang(en) .mn-marq b { font-family: var(--ak-body, system-ui); font-weight: 900; font-size: 22px; }
.mn-marq i { position: absolute; top: 4px; width: 7px; height: 7px; border-radius: 50%; background: #fff; box-shadow: 0 0 6px #fff; animation: mnBulb 1.2s infinite; }
@keyframes mnBulb { 50% { opacity: .35; } }
/* 경품 줄 — 문턱 점수와 그림 3개(누르면 경품 보기) */
.mn-prz { flex: none; display: flex; gap: 6px; margin: 0 2px 6px; }
.mn-prz button { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; padding: 3px 6px 3px 3px; border: 0; border-radius: 12px; cursor: pointer;
  background: #ffffffe8; box-shadow: inset 0 -2px 0 rgba(0,0,0,.08); color: var(--ak-fg, #16181d); text-align: left; min-height: 44px; }
.mn-prz img, .mn-prz .ph { width: 36px; height: 36px; flex: none; border-radius: 9px; object-fit: contain; background: #f4f1ea; }
.mn-prz .ph { display: grid; place-items: center; font-size: 10px; letter-spacing: -1px; color: #d39b00; }
.mn-prz span { min-width: 0; line-height: 1.15; }
.mn-prz b { display: block; font-size: 14px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; letter-spacing: -.02em; }
.mn-prz small { display: block; font-size: 11px; color: var(--ak-dim, #5a616e); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mn-prz button.got { background: #fff6cf; box-shadow: inset 0 0 0 2px var(--ak-coin, #ffc531); }
.mn-prz button.next b { color: var(--ak-accent, #e0245e); }
.mn-prz button { position: relative; }
.mn-prz button.only { background: linear-gradient(135deg, #fff8dc, #ffe9a8); box-shadow: inset 0 0 0 2px #e0a800; }
.mn-prz button > i { position: absolute; top: -7px; right: 4px; padding: 1px 6px; border-radius: 8px; background: #e0a800; color: #fff; font-size: 10px; font-weight: 800; line-height: 1.4; font-style: normal; white-space: nowrap; pointer-events: none; }
/* 화면 — 검은 테 안에 캔버스(게임이 정한 가로세로 비) */
.mn-scr { position: relative; flex: 1; min-height: 0; border-radius: 16px; background: #1d2030; padding: 8px; box-shadow: inset 0 0 0 3px #0e1018, inset 0 6px 14px #0008; display: flex; align-items: center; justify-content: center; overflow: hidden; }
#cv { display: block; border-radius: 8px; background: #fbfaf7; touch-action: none; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
/* 점수판 — 읽는 숫자(테두리 없는 글자) */
.mn-hud { flex: none; display: flex; justify-content: space-around; align-items: baseline; gap: 6px; margin-top: 6px; padding: 4px 6px 3px; border-radius: 12px; background: #ffffffe8; min-height: 36px; }
.mn-hud div { display: flex; align-items: baseline; gap: 5px; min-width: 0; }
.mn-hud span { font-size: 12px; color: var(--ak-dim, #5a616e); white-space: nowrap; }
.mn-hud b { font: 800 22px/1.05 var(--ak-body, system-ui); font-variant-numeric: tabular-nums; }
.mn-hud .goal b { color: var(--ak-accent, #e0245e); }
.mn-hud .sub b { font-size: 16px; color: var(--ak-on, #0b74c4); }
.mn-hud .sub:empty { display: none; }
/* 화면 크게(카메라 「화면 크게」) — 간판·경품 줄을 접는다 */
.mn-room.big .mn-marq, .mn-room.big .mn-prz { display: none; }
.mn-room.big .mn-cab { max-width: 760px; padding-top: 8px; }

/* 결과 · 안내 */
.mn-toast { position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%); text-align: center; pointer-events: none; transition: opacity .25s; max-width: 92%; z-index: 3; word-break: keep-all; }
.mn-toast[hidden] { display: block; opacity: 0; }
.mn-toast b { display: block; font: 400 clamp(34px, 9vw, 58px)/1.05 var(--f-sign); color: var(--ak-accent, #e0245e); text-shadow: 0 2px 0 #fff, 0 0 16px #fff, 0 0 4px #fff; }
.mn-toast.dim b { color: var(--ak-fg, #16181d); font-size: clamp(24px, 6vw, 36px); }
.mn-toast > span { display: inline-block; margin-top: 8px; background: #ffffffee; color: var(--ak-fg, #16181d); padding: 6px 14px; border-radius: 12px; font-size: 14px; box-shadow: var(--ak-sh2, 0 4px 14px rgba(16,24,40,.12)); white-space: pre-line; }
:lang(ja) .mn-toast b, :lang(en) .mn-toast b { font-family: var(--ak-body, system-ui); font-weight: 900; }
.mn-slots { position: absolute; left: 12px; right: 12px; bottom: 12px; display: flex; flex-direction: column; align-items: center; gap: 6px; z-index: 4; pointer-events: none; }
.mn-slots > * { pointer-events: auto; max-width: 300px; }
.mn-slots > :empty { display: none; }
#camSlot { position: absolute; left: 0; bottom: 14px; width: 0; height: 0; z-index: 6; }

/* 하단 바 조작 칸 — 채운 분홍 큰 버튼 1~2개 */
.mn-ctl { display: flex; gap: 8px; align-items: stretch; }
.mn-go { min-width: 132px; min-height: 50px; padding: 4px 16px; border: 0; border-radius: var(--ak-r, 14px); background: var(--ak-accent, #e0245e); color: #fff; font-size: 17px; font-weight: 800; line-height: 1.1; box-shadow: 0 3px 0 var(--ak-accent-dk, #b0174a); cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; touch-action: manipulation; }
.mn-go small { font-size: 12px; font-weight: 700; opacity: .92; display: flex; align-items: center; gap: 3px; }
.mn-go:active, .mn-go.down { transform: translateY(2px); box-shadow: 0 1px 0 var(--ak-accent-dk, #b0174a); }
.mn-go:disabled { opacity: .5; cursor: default; }
.mn-go.sub { min-width: 0; background: var(--ak-surface, #fff); color: var(--ak-fg, #16181d); box-shadow: inset 0 0 0 2px var(--ak-line2, #cdd2da), 0 2px 0 var(--ak-line2, #cdd2da); }
.mn-go.sub.on { background: var(--ak-on, #0b74c4); color: #fff; box-shadow: 0 3px 0 #08568f; }
.mn-go[hidden] { display: none; }

/* 데스크톱 — 캐비닛 옆 매장 여백, 화면을 조금 더 크게 */
@media (min-width: 900px) { .mn-room { padding-top: 64px; } .mn-cab { max-width: 560px; } .mn-marq { height: 52px; } .mn-marq b { font-size: 30px; } }
/* 가로 폰 — 간판·경품 줄 접기 */
@media (max-height: 480px) { .mn-marq, .mn-prz { display: none; } .mn-room { padding-top: calc(48px + env(safe-area-inset-top, 0px)); } .mn-hud { margin-top: 4px; min-height: 28px; } .mn-hud b { font-size: 18px; } }
@media (prefers-reduced-motion: reduce) { .mn-marq i { animation: none; } }
/* 점수판 한 줄 유지 — 폰(좁은 폭)·ja/en 의 긴 글자에서 줄이 넘치지 않게 */
.mn-hud { flex-wrap: nowrap; overflow: hidden; }
.mn-hud .sub { min-width: 0; flex-shrink: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: var(--ak-on, #0b74c4); font-weight: 700; display: block; }
@media (max-width: 430px) { .mn-hud { gap: 4px; padding: 4px 4px 3px; } .mn-hud span { font-size: 11px; } .mn-hud b { font-size: 19px; } .mn-hud .sub { font-size: 12px; } }
