/* 🎮 의왕 VR 체험공간 미니게임 3종 (js/vr-games.js) — 2026-10-30 */
.gm-bg { position: fixed; inset: 0; z-index: 120; background: rgba(8,6,30,.8); display: flex; align-items: center; justify-content: center; padding: 12px; }
.gm { position: relative; background: #fff; color: var(--ink); border-radius: 26px; width: min(1200px, 100%); height: min(780px, 100%); display: flex; flex-direction: column; overflow: hidden; border-top: 10px solid var(--c); animation: pop .3s cubic-bezier(.2,1.4,.4,1); }
.gm-head { display: flex; align-items: center; gap: 10px; padding: 10px 16px; }
.gm-head .em { font-size: 36px; }
.gm-head h2 { flex: 1; font-size: clamp(20px, 2.4vw, 28px); }
.gm-x { background: var(--mute); border-radius: 999px; width: 44px; height: 44px; font-size: 19px; }
.gm-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 14px; padding: 0 16px 16px; }
.gm-stage { position: relative; border-radius: 20px; overflow: hidden; min-height: 0; display: grid; place-items: center; }
.gm-side { display: flex; flex-direction: column; gap: 12px; min-height: 0; overflow: auto; }
.gm-card { background: #F7F5FF; border-radius: 18px; padding: 14px 16px; }
.gm-card.ctr { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.gm-card .ms { font-weight: 800; font-size: 13px; color: var(--c); letter-spacing: .1em; }
.gm-card .mt { font-weight: 800; font-size: 19px; line-height: 1.4; margin-top: 2px; word-break: keep-all; }
.gm-card small { color: var(--ink-soft); font-weight: 600; font-size: 14px; word-break: keep-all; }
.gm-card .btn { font-size: 16px; padding: .5em 1em; width: 100%; }
@media (max-width: 820px) {
  .gm-body { grid-template-columns: minmax(0, 1fr); overflow: auto; }
  .gm-stage { min-height: min(62vh, 520px); }
}
.pad { display: grid; grid-template-columns: repeat(3, 58px); grid-template-rows: repeat(3, 58px); gap: 6px; }
.pad button { border-radius: 14px; background: var(--c); color: #fff; font-size: 22px; box-shadow: 0 4px 0 rgba(0,0,0,.25); }
.pad button:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0,0,0,.25); }
.gm-win { position: absolute; inset: 0; z-index: 20; background: rgba(20,15,60,.55); display: grid; place-items: center; padding: 16px; }
.gm-win .card { background: #fff; border-radius: 28px; padding: 28px 30px; text-align: center; width: min(480px, 100%); animation: pop .4s cubic-bezier(.2,1.4,.4,1); }
.gm-win .big { font-size: 80px; line-height: 1; }
.gm-win h3 { font-size: 34px; color: var(--c); margin: 8px 0 4px; }
.gm-win p { color: var(--ink-soft); font-weight: 600; font-size: 18px; word-break: keep-all; }
.gm-win .card { max-height: 100%; overflow: auto; }

/* 🏆 오늘의 랭킹 */
.gm-nick { position: absolute; inset: 0; z-index: 12; background: rgba(8,6,30,.72); display: grid; place-items: center; padding: 16px; }
.nk-card { background: #fff; border-radius: 26px; padding: 24px 26px; width: min(420px, 100%); text-align: center; animation: pop .35s cubic-bezier(.2,1.4,.4,1); }
.nk-card .big { font-size: 52px; line-height: 1.1; }
.nk-card h3 { font-size: 26px; color: var(--c); margin: 6px 0 4px; }
.nk-card p { color: var(--ink-soft); font-weight: 600; font-size: 15px; margin-bottom: 12px; word-break: keep-all; }
.nk-in { width: 100%; font: inherit; font-size: 22px; font-weight: 800; text-align: center; padding: 12px 14px; border-radius: 14px; border: 3px solid var(--line); outline: none; margin-bottom: 10px; }
.nk-in:focus { border-color: var(--c); }
.nk-go { width: 100%; font-size: 20px; }
.nk-top { margin-top: 12px; font-size: 15px; font-weight: 700; color: var(--ink-soft); }
.nk-top b { color: #C77F00; }
.timer { margin-top: 10px; background: #fff; border-radius: 14px; padding: 8px 12px; font-size: 18px; font-weight: 800; }
.timer .tm { font-size: 26px; color: var(--c); font-variant-numeric: tabular-nums; }
.timer .who { color: var(--ink-soft); font-size: 15px; }
.rank-box { margin: 12px 0 4px; text-align: left; }
.rank-box h4 { font-size: 18px; text-align: center; margin-bottom: 6px; }
.rank-me { text-align: center; font-size: 17px !important; color: var(--ink) !important; margin-bottom: 8px; }
.rank-list { list-style: none; display: flex; flex-direction: column; gap: 4px; }
.rank-list li { display: flex; align-items: center; gap: 10px; background: #F7F5FF; border-radius: 12px; padding: 6px 12px; font-size: 16px; }
.rank-list li.me { background: #FFF1B8; outline: 3px solid var(--gold, #FFD23F); }
.rank-list .no { width: 30px; text-align: center; font-weight: 900; font-size: 18px; }
.rank-list b { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-list .tm { font-weight: 800; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.rank-empty, .rank-note { text-align: center; font-size: 15px !important; }
.rank-note { background: #FFF6CC; border-radius: 12px; padding: 8px 12px; margin: 10px 0 4px; }

/* ── 1. 비밀의 방 ── */
.esc { background: #F6D9C4; }
.esc .wall { position: absolute; inset: 0 0 30% 0; background: repeating-linear-gradient(90deg, #F3CDB3 0 60px, #EFC4A7 60px 120px); }
.esc .floor { position: absolute; left: 0; right: 0; bottom: 0; height: 30%; background: repeating-linear-gradient(90deg, #A8683F 0 90px, #9A5D36 90px 92px); border-top: 10px solid #7A4526; }
.esc .hs { position: absolute; z-index: 2; transition: filter .2s, transform .2s; }
.esc .hs:hover { filter: drop-shadow(0 0 12px #FFF8A0) brightness(1.08); transform: scale(1.05); }
.esc .hs.got::after { content: '✔'; position: absolute; top: -8px; right: -8px; width: 26px; height: 26px; border-radius: 50%; background: #25A24A; color: #fff; font-size: 15px; font-weight: 800; display: grid; place-items: center; box-shadow: 0 2px 0 #16702F; }
.esc .clock { left: 10%; top: 9%; width: clamp(64px, 11vmin, 96px); aspect-ratio: 1; border-radius: 50%; background: #fff; border: 7px solid #6B3A22; }
.esc .clock .h1 { position: absolute; left: 50%; top: 18%; width: 4px; height: 34%; background: #333; transform: translateX(-50%); }
.esc .clock .h2 { position: absolute; left: 50%; top: 50%; width: 30%; height: 4px; background: #E5527F; transform-origin: left; transform: rotate(-30deg); }
.esc .shelf { position: absolute; left: 5%; bottom: 30%; width: 22%; height: 44%; background: #8A4F2C; border-radius: 6px 6px 0 0; padding: 8px; display: grid; grid-template-rows: 1fr 1fr 1fr; gap: 8px; }
.esc .shelf .row { background: #5A2F18; display: flex; align-items: flex-end; gap: 3px; padding: 0 6px; }
.esc .shelf .row > i { width: 14%; border-radius: 2px; }
.esc .shelf .book { position: relative; width: 16%; height: 88%; }
.esc .shelf .book i { display: block; width: 100%; height: 100%; background: #25A24A; border-radius: 2px; transform: rotate(8deg); }
.esc .frame { right: 9%; top: 12%; width: clamp(110px, 18vmin, 160px); aspect-ratio: 1.4; background: #fff; border: 10px solid #C89A3A; transform: rotate(6deg); overflow: hidden; }
.esc .frame:hover { transform: rotate(6deg) scale(1.05); }
.esc .frame i { position: absolute; inset: 0; background: radial-gradient(circle at 70% 28%, #FFD23F 0 12%, transparent 13%), linear-gradient(#9FD2FF 60%, #7CC56F 60%); }
.esc .plant { position: absolute; right: 8%; bottom: 29%; font-size: clamp(60px, 11vmin, 100px); line-height: 1; }
.esc .door { position: absolute; left: 40%; width: 20%; bottom: 30%; height: 58%; background: #6B3A22; border-radius: 10px 10px 0 0; border: 8px solid #4D2614; }
.esc .memo { position: absolute; left: 50%; top: 12%; transform: translateX(-50%) rotate(-3deg); background: #FFFBE0; padding: 6px 8px; border-radius: 4px; box-shadow: 0 4px 10px rgba(0,0,0,.25); text-align: center; width: 86%; }
.esc .memo small { font-weight: 800; font-size: 12px; color: #6A4A2A; }
.esc .memo div { display: flex; justify-content: center; gap: 4px; margin-top: 3px; }
.esc .memo b { width: 16px; height: 16px; border-radius: 50%; }
.esc .lock { position: absolute; right: -12%; top: 48%; width: 50px; height: 56px; border-radius: 12px; background: #FFD23F; box-shadow: 0 4px 0 #B08D00; font-size: 26px; z-index: 2; }
.esc .lock::after { content: ''; position: absolute; inset: -6px; border-radius: 16px; border: 3px solid #FFD23F; animation: lockPulse 1.4s ease-out infinite; }
@keyframes lockPulse { from { transform: scale(.9); opacity: .8; } to { transform: scale(1.5); opacity: 0; } }
.esc .rug { left: 50%; bottom: 4%; transform: translateX(-50%); width: min(300px, 40%); height: 15%; border-radius: 50%; background: repeating-radial-gradient(ellipse, #7A3FA0 0 10px, #9C5CC4 10px 20px); border: 5px solid #5A2A7A; }
.esc .rug:hover { transform: translateX(-50%) scale(1.05); }
.esc .clue { position: absolute; left: 50%; top: 16px; transform: translateX(-50%); z-index: 5; background: #fff; border-radius: 18px; padding: 10px 18px 10px 10px; display: flex; align-items: center; gap: 12px; box-shadow: 0 10px 30px rgba(60,40,130,.3); font-weight: 800; font-size: clamp(15px, 1.8vw, 19px); white-space: nowrap; animation: pop .3s; }
.esc .clue span { width: 46px; height: 46px; border-radius: 12px; color: #fff; display: grid; place-items: center; font-size: 28px; }
.esc .keypad-bg { position: absolute; inset: 0; z-index: 10; background: rgba(40,15,30,.6); display: grid; place-items: center; }
.esc .keypad { background: #2A1F3D; border-radius: 24px; padding: 20px; width: min(310px, 92%); box-shadow: 0 20px 50px rgba(0,0,0,.5); }
.esc .keypad.shake { animation: shake .4s; }
@keyframes shake { 25% { transform: translateX(-12px); } 75% { transform: translateX(12px); } }
.esc .keypad p { color: #fff; font-weight: 800; font-size: 19px; text-align: center; }
.esc .slots { display: flex; gap: 8px; justify-content: center; margin: 12px 0 16px; }
.esc .slots span { width: 54px; height: 62px; border-radius: 12px; background: #130E20; border: 3px solid; color: #fff; font-size: 36px; font-weight: 900; display: grid; place-items: center; }
.esc .keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.esc .keys button { height: 52px; border-radius: 14px; background: #3B2D55; color: #fff; font-size: 22px; font-weight: 800; box-shadow: 0 4px 0 rgba(0,0,0,.35); }
.esc .keys button:nth-child(10), .esc .keys button:nth-child(12) { font-size: 15px; background: #4A3A66; }
.gm-side .rowb { display: flex; justify-content: space-between; align-items: baseline; }
.gm-side .cnt { font-weight: 800; color: var(--ink-soft); }
.gm-side .inv { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0; }
.gm-side .inv div { aspect-ratio: 1.2; border-radius: 16px; border: 2.5px dashed #D9D3F0; display: grid; place-items: center; align-content: center; font-size: 30px; font-weight: 900; color: #D9D3F0; background: #fff; }
.gm-side .inv div.got { border-style: solid; border-width: 3px; }
.gm-side .inv b { font-size: 40px; line-height: 1; } .gm-side .inv small { font-size: 12px; }
.gm-side .hint { margin-top: 8px; font-weight: 600; font-size: 15px; color: var(--ink-soft); line-height: 1.55; word-break: keep-all; }

/* ── 2. 어둠 속 미로 ── */
.maze { background: #0B1F12; }
.mz-board { position: relative; }
.mz-board > .mz { position: absolute; background: #163A22; display: grid; place-items: center; }
.mz-board > .mz.wall { background: #2F8A4A; border-radius: 4px; box-shadow: inset 0 -4px 0 rgba(0,0,0,.25); }
.mz .star { font-size: calc(var(--cell) * .7); line-height: 1; animation: float 1.6s ease-in-out infinite; }
.mz .exit { width: 90%; height: 90%; border-radius: 6px; background: #5A4A1A; color: #E8D9A0; font-weight: 800; font-size: calc(var(--cell) * .3); display: grid; place-items: center; }
.mz .exit.open { background: #FFD23F; color: #3A2A00; box-shadow: 0 0 14px #FFD23F; }
.mz-me { position: absolute; z-index: 2; transition: left .12s, top .12s; }
.mz-me::before { content: ''; position: absolute; inset: 11%; border-radius: 50%; background: #fff; border: 3px solid #25A24A; }
.mz-me i { position: absolute; top: 36%; width: 12%; height: 20%; background: #222; border-radius: 4px; }
.mz-me i:first-child { left: 30%; } .mz-me i:last-child { right: 30%; }
.mz-dark { position: absolute; inset: -2px; z-index: 3; pointer-events: none; }
.mz-msg { position: absolute; top: 16px; left: 50%; transform: translateX(-50%); z-index: 5; background: #FFD23F; color: #3A2A00; padding: 10px 20px; border-radius: 14px; font-weight: 800; font-size: 19px; white-space: nowrap; animation: pop .3s; }
.stars3 { display: flex; gap: 8px; margin: 12px 0 6px; }
.stars3 span { flex: 1; height: 50px; border-radius: 14px; border: 2.5px dashed #D9D3F0; display: grid; place-items: center; font-size: 26px; filter: grayscale(1); opacity: .35; background: #fff; }
.stars3 span.got { border: 3px solid #F0B400; background: #FFF6CC; filter: none; opacity: 1; animation: pop .4s; }

/* ── 3. 메타버스 마을 ── */
.town { background: #7CC56F; }
.tw-board { position: relative; border-radius: 16px; overflow: hidden; background: linear-gradient(#9AD889, #86CC75); }
.tw-board::before { content: ''; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.12) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.12) 1px, transparent 1px); background-size: var(--cell) var(--cell); }
.tw-board > * { position: absolute; }
.tw-board .road { background: #E9D8B0; }
.tw-board .pond { border-radius: 50%; background: #6FC0EF; border: 4px solid #4AA3D6; }
.tw-board .tree { display: grid; place-items: center; font-size: calc(var(--cell) * .9); line-height: 1; }
.tw-board .bld { display: flex; flex-direction: column; align-items: center; z-index: 1; }
.bld .roof { width: 100%; height: 30%; background: #4F3A9E; clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.bld .wallb { position: relative; width: 100%; flex: 1; background: var(--bc); border-radius: 0 0 6px 6px; }
.bld .wallb::after { content: ''; position: absolute; left: 38%; width: 24%; bottom: 0; height: 52%; background: rgba(0,0,0,.3); border-radius: 6px 6px 0 0; }
.bld .star { position: absolute; top: 4px; right: 6px; font-size: calc(var(--cell) * .5); display: none; }
.bld.done .star { display: block; animation: pop .4s; }
.bld .nm { position: absolute; bottom: calc(var(--cell) * -.55); background: rgba(255,255,255,.92); border-radius: 8px; padding: 1px 8px; font-weight: 800; font-size: clamp(11px, calc(var(--cell) * .3), 15px); white-space: nowrap; color: #2A2150; }
.tw-board .npc { display: grid; place-items: center; z-index: 2; }
.npc i, .tw-me i { width: 74%; height: 74%; border-radius: 50% 50% 42% 42%; border: 3px solid #fff; box-shadow: 0 3px 0 rgba(0,0,0,.2); position: relative; }
.npc i::before, .npc i::after, .tw-me i::before, .tw-me i::after { content: ''; position: absolute; top: 34%; width: 13%; height: 20%; background: #222; border-radius: 4px; }
.npc i::before, .tw-me i::before { left: 28%; } .npc i::after, .tw-me i::after { right: 28%; }
.npc span { position: absolute; bottom: 100%; background: #fff; border-radius: 8px; padding: 1px 8px; font-size: 12px; font-weight: 800; white-space: nowrap; color: #2A2150; }
.tw-me { display: grid; place-items: center; z-index: 4; transition: left .15s, top .15s; }
.tw-me i { background: var(--av); width: 84%; height: 84%; transform: scaleX(var(--dir, 1)); box-shadow: 0 0 0 3px #2A2150, 0 4px 0 rgba(0,0,0,.2); }
.tw-me .me-tag { position: absolute; bottom: 102%; background: #2A2150; color: #fff; border-radius: 8px; padding: 0 8px; font-size: 12px; font-weight: 800; }
/* 문 앞에 가면 크게 반짝이는 안내 + 문마다 통통 튀는 💬 */
.talk-hint { left: 50%; bottom: 10px; transform: translateX(-50%); z-index: 6; background: #FFD23F; color: #2A2150; padding: 12px 20px; border-radius: 16px; font-weight: 900; font-size: clamp(17px, 2vw, 22px); white-space: nowrap;
  border: 3px solid #2A2150; box-shadow: 0 6px 0 #2A2150; animation: hintPulse 1s ease-in-out infinite; }
@keyframes hintPulse { 50% { transform: translateX(-50%) scale(1.06); } }
.door-mark { z-index: 3; display: grid; place-items: center; font-size: calc(var(--cell) * .75); pointer-events: none; animation: doorBounce 1s ease-in-out infinite; filter: drop-shadow(0 2px 2px rgba(0,0,0,.3)); }
@keyframes doorBounce { 50% { transform: translateY(-30%); } }
kbd { display: inline-block; min-width: 1.7em; padding: 2px 7px; margin: 0 1px; border-radius: 8px; background: #fff; border: 2px solid #2A2150; border-bottom-width: 4px; font: inherit; font-weight: 900; font-size: .9em; text-align: center; color: #2A2150; }
kbd.space { min-width: 6em; background: #FFF6CC; }
.howto { width: 100%; display: flex; flex-direction: column; gap: 8px; text-align: left; }
.howto div { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-weight: 800; font-size: 16px; background: #fff; border-radius: 12px; padding: 8px 10px; }
.howto .n { width: 24px; height: 24px; border-radius: 50%; background: var(--c); color: #fff; display: grid; place-items: center; font-size: 14px; flex: none; }
.town .talk { position: absolute; left: 16px; right: 16px; bottom: 16px; z-index: 8; background: #fff; border-radius: 22px; padding: 16px 18px; box-shadow: 0 10px 30px rgba(0,0,0,.25); display: flex; gap: 14px; align-items: flex-start; animation: pop .3s; }
.talk .face { width: 70px; height: 70px; flex: none; border-radius: 18px; display: grid; place-items: center; font-size: 40px; }
.talk small { font-weight: 800; font-size: 15px; }
.talk p { font-weight: 800; font-size: clamp(17px, 2vw, 21px); margin: 4px 0 10px; word-break: keep-all; }
.talk p.ok { color: #1E8A3C; } .talk p.no { color: var(--red); }
.talk .opts { display: flex; flex-wrap: wrap; gap: 8px; }
.talk .opts .btn { font-size: 16px; padding: .5em 1em; }
.talk .ghost2 { background: none; color: var(--ink-soft); box-shadow: none; }
.checks { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.checks div { display: flex; align-items: center; gap: 10px; font-weight: 800; color: var(--ink-soft); }
.checks span { width: 26px; height: 26px; border-radius: 8px; border: 2px dashed #D9D3F0; display: grid; place-items: center; background: #fff; }
.checks .got { color: var(--ink); } .checks .got span { background: #25A24A; border: 0; } .checks .got span::after { content: '✔'; color: #fff; font-size: 15px; }
.avs { display: flex; gap: 8px; }
.avs button { width: 42px; height: 42px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1.5px #D9D3F0; }
.avs button.on { box-shadow: 0 0 0 4px #2A2150; }
