/* Z-DAY · 미니게임 공통 연출 (MG KIT, 규칙은 js/mgkit.js 맨 위)
 *  어둡게 깐 장면 사진 · 비네팅 · 회색 실루엣 · 아래 가장자리의 손 · 위쪽 얇은 시간 줄
 *  상태 색: 진행 중 --mgk-ink · 성공 --mgk-amber · 실패 --mgk-ox
 */
:root { --mgk-ink: #c9c4bc; --mgk-amber: #d4a24c; --mgk-ox: #7a2222; --mgk-sil: #6d727a; }

/* ---------- 무대 ---------- */
.mgk-stage {
  position: relative; isolation: isolate; overflow: hidden;
  width: 100%; height: min(54vh, 430px); min-height: 300px;
  border-radius: 14px; background: #07080a;
  touch-action: none; user-select: none; -webkit-user-select: none;
}
.mgk-photo {
  position: absolute; inset: -4%; z-index: 0;
  background-size: cover; background-repeat: no-repeat;
  filter: brightness(0.36) saturate(0.5) contrast(1.05);
}
.mgk-vignette {
  position: absolute; inset: 0; z-index: 5; pointer-events: none;
  background: radial-gradient(ellipse 75% 70% at 50% 45%, transparent 40%, rgba(0, 0, 0, 0.55) 72%, rgba(0, 0, 0, 0.94) 100%);
}
.mgk-hand { position: absolute; z-index: 6; bottom: -3%; pointer-events: none; }
.mgk-hand svg { display: block; width: 100%; height: auto; filter: drop-shadow(0 -4px 14px rgba(0, 0, 0, 0.7)); }
.mgk-hand-handTorch { right: -6%; width: 64%; }
.mgk-hand-handSleeve { left: -6%; width: 54%; animation: mgk-sleeve var(--pace, 0.5s) ease-in-out infinite alternate; }
.mgk-hand-handsRope { left: 10%; width: 80%; }
@keyframes mgk-sleeve { to { translate: 6px 8px; } }

/* 남은 시간: 위쪽 얇은 줄 (숫자 없음) */
.mgk-time { position: absolute; top: 0; left: 0; right: 0; height: 3px; z-index: 8; background: rgba(255, 255, 255, 0.07); }
.mgk-time i { display: block; height: 100%; background: var(--mgk-ink); opacity: 0.65; transform-origin: left center; transition: transform 0.1s linear, background-color 0.3s; }
.mgk-time.low i { background: var(--mgk-ox); opacity: 1; }

/* 한 번 반짝 · 한 번 흔들림 · 성공 · 실패 */
.mgk-stage::after { content: ""; position: absolute; inset: 0; z-index: 9; pointer-events: none; opacity: 0; }
.mgk-stage.mgk-good { animation: mgk-good 0.35s ease-out; }
.mgk-stage.mgk-bump { animation: mgk-shake 0.3s linear; }
.mgk-stage.mgk-bump::after { background: radial-gradient(ellipse at 50% 50%, transparent 50%, rgba(122, 34, 34, 0.6) 100%); animation: mgk-edge 0.45s ease-out; }
.mgk-stage.mgk-win::after { background: radial-gradient(ellipse at 50% 50%, rgba(212, 162, 76, 0.42), transparent 68%); animation: mgk-win 1s ease-out forwards; }
.mgk-stage.mgk-lose { animation: mgk-shake 0.45s linear; }
.mgk-stage.mgk-lose::after { background: radial-gradient(ellipse at 50% 50%, transparent 42%, rgba(122, 34, 34, 0.55) 82%, rgba(80, 18, 18, 0.9) 100%); animation: mgk-lose 0.6s ease-out forwards; }
@keyframes mgk-shake { 20% { translate: -7px 0; } 40% { translate: 6px 2px; } 60% { translate: -4px -1px; } 80% { translate: 3px 0; } }
@keyframes mgk-good { 40% { box-shadow: inset 0 0 40px rgba(212, 162, 76, 0.3); } }
@keyframes mgk-edge { 0% { opacity: 1; } 100% { opacity: 0; } }
@keyframes mgk-win { 0% { opacity: 0; } 25% { opacity: 1; } 100% { opacity: 0.35; } }
@keyframes mgk-lose { to { opacity: 1; } }

/* 버튼: 어둡고 얇은 선 */
.mgk-pads { display: flex; gap: 10px; justify-content: center; margin-top: 10px; }
.mgk-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 76px; min-height: 56px; padding: 0 18px;
  border: 1px solid rgba(201, 196, 188, 0.28); border-radius: 12px;
  background: rgba(12, 13, 15, 0.88); color: var(--mgk-ink);
  font: 600 16px/1 var(--font-body); letter-spacing: 0.02em; cursor: pointer;
  touch-action: manipulation;
}
.mgk-btn:hover:not(:disabled) { border-color: rgba(201, 196, 188, 0.6); }
.mgk-btn.hit, .mgk-btn:active:not(:disabled) { border-color: var(--mgk-amber); color: var(--mgk-amber); }
.mgk-btn:focus-visible { outline: 2px solid var(--mgk-amber); outline-offset: 2px; }
.mgk-btn:disabled { opacity: 0.4; }
.mgk-wide { flex: 1; max-width: 340px; margin: 10px auto 0; display: flex; width: 100%; }
.mgk-pads .mgk-wide { margin-top: 0; }
.mgk-arrow { width: 28px; height: 28px; }
.mg.mg-run .run-verdict, .mg.mg-swipe .run-verdict { margin-top: 8px; text-align: center; }
.mg.mg-run .run-verdict.ok, .mg.mg-swipe .run-verdict.ok { color: var(--mgk-amber) !important; }
.mg.mg-run .run-verdict.fail, .mg.mg-swipe .run-verdict.fail { color: #b5524a !important; }
.mgk-demo { display: inline-flex; align-items: center; gap: 6px; color: var(--mgk-sil); }
.mgk-demo svg:first-child { width: 48px; height: 48px; }
.mgk-demo .mgk-arrow { color: var(--mgk-ink); }

/* ---------- 피하며 달리기 ---------- */
.run-floorplane { position: absolute; left: -35%; right: -35%; bottom: -6%; height: 70%; z-index: 1; perspective: 240px; perspective-origin: 50% 0; }
.run-floorplane i {
  position: absolute; inset: 0; transform: rotateX(60deg); transform-origin: 50% 100%;
  background:
    repeating-linear-gradient(to bottom, rgba(222, 216, 206, 0.2) 0 2px, rgba(0, 0, 0, 0.25) 2px 5px, transparent 5px 26px),
    linear-gradient(to bottom, rgba(0, 0, 0, 0.85), rgba(46, 46, 50, 0.4));
  background-size: 100% 26px, 100% 100%;
  animation: run-steps var(--pace, 0.5s) linear infinite;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 35%);
  mask-image: linear-gradient(to bottom, transparent, #000 35%);
}
.run-street .run-floorplane i {
  background:
    linear-gradient(90deg, transparent 49.4%, rgba(222, 216, 206, 0.22) 49.4% 50.6%, transparent 50.6%),
    repeating-linear-gradient(to bottom, rgba(255, 255, 255, 0.03) 0 1px, transparent 1px 13px),
    linear-gradient(to bottom, rgba(0, 0, 0, 0.85), rgba(40, 40, 44, 0.45));
  background-size: 100% 40px, 100% 13px, 100% 100%;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 35%), repeating-linear-gradient(to bottom, #000 0 100%);
}
@keyframes run-steps { to { background-position: 0 26px, 0 0; } }
.run-street .run-floorplane i { animation-name: run-road; }
@keyframes run-road { to { background-position: 0 40px, 0 13px, 0 0; } }
.mg.done .run-floorplane i, .run-arrived .run-floorplane i { animation-play-state: paused; }
.run-rails { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; pointer-events: none; }
.run-rails path { fill: none; stroke: rgba(200, 196, 188, 0.22); stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linecap: round; }
.run-beam { position: absolute; inset: 0; z-index: 3; pointer-events: none; background: radial-gradient(circle at 52% 46%, rgba(255, 236, 205, 0.24) 0, rgba(255, 236, 205, 0.08) 16%, transparent 34%); transition: background 0.6s; }
.run-street .run-beam { background: radial-gradient(ellipse 60% 40% at 50% 38%, rgba(190, 196, 206, 0.09), transparent 70%); }
.run-slow .mgk-photo { filter: brightness(0.28) saturate(0.45) blur(1.2px); }
.run-landing .mgk-photo, .run-landing .run-floorplane, .run-landing .run-rails { animation: run-land 0.35s ease-out; }
.run-landing .run-big { animation: run-num 0.35s ease-out; }
@keyframes run-land { 40% { translate: 0 -14px; } }
@keyframes run-num { from { translate: 0 12px; opacity: 0.2; } }

/* 장애물: 어둠 속에서 작게 → 크게 (--t 0~1). 손은 난간 · 벽 쪽에서 뻗어 나옴 */
.run-obs { position: absolute; inset: 0; z-index: 4; pointer-events: none; --t: 0; }
.run-sil {
  position: absolute; left: 50%; top: calc(38% + var(--t) * 24%); width: 36%;
  transform: translate(-50%, -50%) scale(calc(0.14 + var(--t) * 1.05));
  color: var(--mgk-sil); opacity: calc(0.25 + var(--t) * 0.75);
  filter: blur(calc((1 - var(--t)) * 1.6px)) drop-shadow(0 8px 12px rgba(0, 0, 0, 0.7));
}
.run-sil svg { display: block; width: 100%; height: auto; }
.run-obs[data-from="R"] .run-sil { left: calc(60% + var(--t) * 24%); top: calc(44% + var(--t) * 8%); }
.run-obs[data-from="L"] .run-sil { left: calc(40% - var(--t) * 24%); top: calc(44% + var(--t) * 8%); }
.run-obs[data-from="R"] .run-sil svg { transform: scaleX(-1); }
.run-cue {
  position: absolute; top: 30%; width: 48px; height: 48px; display: grid; place-items: center;
  border: 1px solid rgba(201, 196, 188, 0.55); border-radius: 50%; background: rgba(8, 9, 11, 0.6);
  color: var(--mgk-ink); opacity: 0; transition: opacity 0.12s;
}
.run-cue .mgk-arrow { width: 30px; height: 30px; }
.run-cue[data-dir="L"] { left: 20%; }
.run-cue[data-dir="R"] { right: 20%; }
.run-cue[data-dir="U"] { left: calc(50% - 24px); top: 15%; }
.run-obs.cue-on .run-cue { opacity: 1; }

/* 층 표시 · 남은 거리 (진행 막대와 같은 값) */
.run-hud { position: absolute; top: 14px; left: 0; right: 0; z-index: 7; display: grid; justify-items: center; gap: 2px; pointer-events: none; }
.run-big { font: 400 46px/1 var(--font-display); color: #efe8de; letter-spacing: 0.02em; text-shadow: 0 2px 14px rgba(0, 0, 0, 0.8); }
.run-sub { font: 500 13px/1.3 var(--font-body); color: rgba(222, 216, 206, 0.75); }
.run-prog { width: 46%; height: 2px; margin-top: 6px; background: rgba(255, 255, 255, 0.12); }
.run-prog i { display: block; height: 100%; background: var(--mgk-ink); transform-origin: left center; transform: scaleX(0); transition: transform 0.2s; }
.run-arrived .run-big, .run-arrived .run-prog i { color: var(--mgk-amber); background-color: var(--mgk-amber); }
.run-arrived .run-big { background: none; }

/* 성공: 15층 문 · 손전등 빛이 흐린 문 번호에 멈춤 / 실패: 손전등이 깜빡이다 꺼짐 */
.run-door { position: absolute; left: 50%; top: 46%; width: 24%; z-index: 3; transform: translate(-50%, -50%); color: #3a3d43; opacity: 0; transition: opacity 0.6s 0.1s; }
.run-door svg { display: block; width: 100%; height: auto; }
.run-door .mgk-doornum { filter: blur(0.4px); }
.run-street .run-door { display: none; }
.run-arrived .run-door { opacity: 1; }
.run-arrived .run-obs { display: none; }
.run-stairs.run-arrived .run-beam { background: radial-gradient(circle at 50% 33%, rgba(255, 236, 205, 0.4) 0, rgba(255, 236, 205, 0.12) 7%, transparent 18%); }
.torch-off .run-beam { animation: torch-off 1s steps(1, end) forwards; }
.torch-off .mgk-photo { filter: brightness(0.14) saturate(0.4); transition: filter 0.6s 0.6s; }
@keyframes torch-off { 0% { opacity: 1; } 15% { opacity: 0.15; } 30% { opacity: 0.9; } 45% { opacity: 0.1; } 60% { opacity: 0.55; } 75%, 100% { opacity: 0; } }

/* ---------- 줄 당기기 ---------- */
.mgk-rope .mgk-photo { filter: brightness(0.42) saturate(0.35) contrast(1.05); }
.rp-sky { position: absolute; inset: 0 0 45% 0; z-index: 1; pointer-events: none; background: linear-gradient(to bottom, rgba(150, 152, 156, 0.3), rgba(80, 82, 86, 0.05)); }
.rp-smoke i { position: absolute; z-index: 1; width: 44%; height: 24%; border-radius: 50%; background: radial-gradient(ellipse, rgba(112, 112, 114, 0.4), transparent 70%); filter: blur(10px); animation: rp-smoke 10s ease-in-out infinite alternate; pointer-events: none; }
.rp-smoke i:nth-child(1) { left: 4%; top: 4%; }
.rp-smoke i:nth-child(2) { left: 56%; top: 0; animation-delay: -4s; }
.rp-smoke i:nth-child(3) { left: 30%; top: 14%; width: 30%; animation-delay: -7s; }
@keyframes rp-smoke { to { translate: 7% -5%; scale: 1.18; } }
.rp-load {
  position: absolute; left: 50%; z-index: 2; width: 36%; top: calc(22% + var(--lvl, 0) * 22%);
  transform: translateX(-50%) translateX(calc(var(--sway, 0) * 1.2%)) rotate(calc(var(--sway, 0) * 1.4deg + var(--tilt, 0deg))) scale(calc(0.6 + var(--lvl, 0) * 0.32));
  transform-origin: 50% 0; transition: top 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.rp-chute svg { display: block; width: 110%; margin: 0 -5%; height: auto; }
.rp-crate { margin-top: -8%; }
.rp-crate svg { display: block; width: 100%; height: auto; filter: drop-shadow(0 10px 14px rgba(0, 0, 0, 0.7)); }
.rp-spill i { position: absolute; left: 42%; top: 78%; width: 9%; height: 7%; background: #2b3027; border-radius: 2px; opacity: 0; }
.rp-spill i:nth-child(2) { left: 56%; width: 7%; background: #3a3d36; }
.rp-spill i:nth-child(3) { left: 30%; width: 6%; height: 10%; background: #26291f; }
.rp-rope { position: absolute; inset: 0; z-index: 3; width: 100%; height: 100%; pointer-events: none; }
.rp-line { fill: none; stroke: #8f8c85; stroke-width: 3; vector-effect: non-scaling-stroke; stroke-linecap: round; transition: stroke 0.12s; }
.rp-glow .rp-line { stroke: var(--mgk-amber); filter: drop-shadow(0 0 5px rgba(212, 162, 76, 0.85)); }
.rp-taut .rp-line { stroke-width: 2.4; }
.rp-rail { position: absolute; left: -2%; right: -2%; top: 70%; height: 2.6%; z-index: 3; background: linear-gradient(#3b3d42, #17181b); box-shadow: 0 8px 20px rgba(0, 0, 0, 0.65); }
.rp-rail i { position: absolute; top: 100%; width: 2.4%; height: 1200%; background: linear-gradient(#25272b, #101114); }
.rp-rail i:nth-child(1) { left: 12%; }
.rp-rail i:nth-child(2) { left: 48.8%; }
.rp-rail i:nth-child(3) { left: 85%; }
/* 보조 게이지: 얇게, 판정 구간과 정확히 같은 자리 (표시의 가운데 = 판정 값) */
.rp-gauge { position: absolute; right: 14px; top: 16%; bottom: 36%; width: 3px; z-index: 7; border-radius: 2px; background: rgba(255, 255, 255, 0.12); }
.rp-zone { position: absolute; left: -2px; right: -2px; border-radius: 2px; background: rgba(212, 162, 76, 0.38); }
.rp-mark { position: absolute; left: -6px; width: 15px; height: 2px; background: var(--mgk-ink); transform: translateY(50%); }
.rp-glow .rp-mark { background: var(--mgk-amber); }
/* 당김 · 미끄러짐 · 끌어올림 · 떨어뜨림 */
.rp-wind .mgk-hand { animation: rp-wind 0.42s ease-out; }
.rp-slip .mgk-hand { animation: rp-slip 0.35s ease-out; }
@keyframes rp-wind { 40% { translate: 0 14px; } }
@keyframes rp-slip { 30% { translate: 0 -10px; } 60% { translate: 0 6px; } }
.rp-over .rp-load { top: 50%; z-index: 4; --tilt: 0deg; transition: top 0.5s cubic-bezier(0.2, 0.8, 0.2, 1); }
.rp-drop .rp-load { --tilt: 26deg; top: 30%; transition: top 0.6s ease-in; }
.rp-drop .rp-spill i { animation: rp-fall 1s ease-in forwards; }
.rp-drop .rp-spill i:nth-child(2) { animation-delay: 0.12s; }
.rp-drop .rp-spill i:nth-child(3) { animation-delay: 0.22s; }
@keyframes rp-fall { 0% { opacity: 1; } 100% { opacity: 0; translate: 12px 180px; rotate: 140deg; } }
.rp-drop .rp-rope { opacity: 0.25; transition: opacity 0.4s; }
.rp-drop .mgk-hand { translate: 0 10px; transition: translate 0.3s; }

@media (prefers-reduced-motion: reduce) {
  .run-floorplane i, .rp-smoke i, .mgk-hand-handSleeve { animation: none !important; }
  .mgk-stage.mgk-lose, .mgk-stage.mgk-bump { animation: none; }
}
/* 예전 줄 당기기 · 배트 버튼 모양(game.css)을 덮음 */
.mgk-btn.mg-swipe { min-height: 56px; }
.mgk-btn.run-bat { min-height: 52px; padding: 0 18px; border: 1px solid rgba(201, 196, 188, 0.28); border-radius: 12px; background: rgba(12, 13, 15, 0.88); color: var(--mgk-ink); font: 600 15px/1 var(--font-body); box-shadow: none; }
/* PC: 무대 폭을 줄여 손 · 실루엣 크기가 휴대폰과 비슷하게 */
.mgk-stage { max-width: 520px; margin-left: auto; margin-right: auto; }
.mgk-hand-handTorch { width: min(64%, 330px); }
.mgk-hand-handSleeve { width: min(54%, 280px); }
.mgk-hand-handsRope { left: 0; right: 0; margin: 0 auto; width: min(80%, 400px); }

/* ---------- 공통: 끝나면 시간 줄이 사라짐 · 첫 안내 손가락 ---------- */
.mg.done .mgk-time { opacity: 0; transition: opacity 0.3s; }
.dm-finger svg { display: block; width: 26px; height: 34px; color: #d8d2c8; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6)); }
.dm-breath.mgk-demo-breath { background: none !important; border: 1.5px solid rgba(235, 232, 226, 0.6); box-shadow: 0 0 14px rgba(235, 232, 226, 0.2); }
.dm-door.mgk-demo-door { position: absolute; left: 50%; top: 8px; width: 120px; height: 40px; margin-left: -60px; background: linear-gradient(90deg, #202328 0 70%, rgba(150, 150, 140, 0.3) 70%); animation: dm-door 1.2s ease-in-out infinite; }
@keyframes dm-door { 50% { background: linear-gradient(90deg, #202328 0 88%, rgba(150, 150, 140, 0.3) 88%); } }
.demo-mash .dm-finger { animation: dm-tap 0.5s steps(1) infinite; }
.dm-st.mgk-demo { position: absolute; left: 50%; top: 6px; margin-left: -12px; }
.dm-st.mgk-demo svg { width: 24px; height: 48px; color: var(--mgk-sil); }
.demo-stealth .dm-finger { animation: dm-press 2.4s steps(1) infinite; }
/* 손 · 소매 실루엣 위치 */
.mgk-hand-handMouth { left: 0; right: 0; margin: 0 auto; width: min(62%, 320px); }
.mgk-hand-handsPush { left: 0; right: 0; margin: 0 auto; width: min(96%, 470px); }
.mgk-hand-handPhone { left: 0; right: 0; margin: 0 auto; width: min(96%, 470px); z-index: 7; }
.mgk-hand-handRadio { left: -4%; width: min(58%, 300px); z-index: 7; }
.mgk-hand-handPoint { right: -4%; width: min(60%, 310px); z-index: 7; animation: kp-tremble 0.24s steps(2) infinite; }
@keyframes kp-tremble { 50% { translate: 1px -1px; } }

/* ---------- 숨 고르기 ---------- */
.mgk-hold .mgk-photo { filter: brightness(0.34) saturate(0.45); }
.hd-dark { position: absolute; inset: 0; z-index: 4; pointer-events: none; background: radial-gradient(ellipse calc(80% - var(--near, 0) * 32%) calc(72% - var(--near, 0) * 28%) at 50% 46%, transparent 45%, rgba(0, 0, 0, 0.92) 100%); }
.hd-gap { position: absolute; left: 6%; right: 6%; top: 70%; height: 3px; z-index: 3; overflow: hidden; background: linear-gradient(90deg, transparent, rgba(220, 210, 190, 0.3) 18%, rgba(220, 210, 190, 0.3) 82%, transparent); filter: blur(0.5px); }
.hd-shadow { position: absolute; top: -3px; left: -30%; width: 24%; height: 9px; background: radial-gradient(ellipse, rgba(0, 0, 0, 0.95), transparent 70%); opacity: 0; }
.hd-shadow.pass { animation: hd-pass 1.4s ease-in-out; }
@keyframes hd-pass { 0% { left: -30%; opacity: 0; } 15%, 85% { opacity: 1; } 100% { left: 106%; opacity: 0; } }
.hd-breath { position: absolute; left: 50%; top: 42%; z-index: 5; width: min(44%, 190px); aspect-ratio: 1; transform: translate(-50%, -50%) scale(0.5); pointer-events: none; transition: transform 0.1s linear; }
.hd-ring { position: absolute; inset: 0; border-radius: 50%; border: 1.5px solid rgba(235, 232, 226, 0.36); box-shadow: 0 0 18px rgba(235, 232, 226, 0.08), inset 0 0 18px rgba(235, 232, 226, 0.05); transition: border-color 0.2s, box-shadow 0.2s; }
.hd-mist { position: absolute; inset: 14%; border-radius: 50%; background: radial-gradient(circle, rgba(235, 232, 226, 0.12), transparent 70%); filter: blur(4px); transition: background 0.2s; }
.mgk-hold.down .hd-ring { border-color: rgba(245, 240, 230, 0.78); box-shadow: 0 0 28px rgba(245, 240, 230, 0.28), inset 0 0 22px rgba(245, 240, 230, 0.16); }
.mgk-hold.down .hd-mist { background: radial-gradient(circle, rgba(245, 240, 230, 0.26), transparent 70%); }
.mgk-hold.wrong .hd-ring { border-color: rgba(160, 70, 64, 0.65); }
.hd-cue { position: absolute; left: 0; right: 0; top: 61%; z-index: 6; margin: 0; text-align: center; font: 600 14px/1 var(--font-body); letter-spacing: 0.1em; color: rgba(235, 232, 226, 0.7); }
.hd-noise { position: absolute; right: 14px; top: 18%; bottom: 36%; width: 3px; z-index: 7; border-radius: 2px; background: rgba(255, 255, 255, 0.12); }
.hd-noise i { position: absolute; left: 0; right: 0; bottom: 0; height: calc(var(--noise, 0) * 100%); border-radius: 2px; background: var(--mgk-ink); background: color-mix(in srgb, var(--mgk-ox) calc(var(--noise, 0) * 100%), var(--mgk-ink)); }
.hd-btn.down { border-color: rgba(245, 240, 230, 0.75); color: #f3ede4; }

/* ---------- 연타: 문 막기 ---------- */
.mgk-mash .mgk-photo { filter: brightness(0.3) saturate(0.4); }
.ms-gap { position: absolute; z-index: 4; top: 4%; bottom: 0; right: 8%; width: 40%; pointer-events: none; }
.ms-light { position: absolute; z-index: 2; top: 4%; bottom: 0; right: 8%; width: 40%; background: linear-gradient(90deg, rgba(140, 138, 128, 0.26), rgba(20, 20, 20, 0.05)); border-right: 12px solid #111214; }
.ms-door { position: absolute; z-index: 3; top: 4%; bottom: 0; left: 4%; right: calc(8% + 12px + (1 - var(--g, 0)) * 28%); background: linear-gradient(90deg, #15171a, #1f2226 72%, #2a2e34); box-shadow: inset -2px 0 0 rgba(255, 255, 255, 0.08), 10px 0 20px rgba(0, 0, 0, 0.75); transition: right 0.12s ease-out; }
.ms-knob { position: absolute; right: 9%; top: 50%; width: 8px; height: 24px; border-radius: 3px; background: #3a3e45; }
.ms-claw { position: absolute; width: 58%; color: var(--mgk-sil); opacity: calc(1 - var(--g, 0) * 0.85); transform: translateX(calc(var(--g, 0) * 70%)); filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.7)); transition: transform 0.12s ease-out; }
.ms-claw svg { display: block; width: 100%; height: auto; transform: scaleX(-1); }
.ms-claw.c1 { top: 18%; right: -14%; }
.ms-claw.c2 { top: 38%; right: -6%; }
.ms-claw.c3 { top: 58%; right: -18%; }
.ms-shove .ms-door { animation: ms-shove 0.16s ease-out; }
.ms-shove .mgk-hand { animation: ms-push 0.16s ease-out; }
@keyframes ms-shove { 40% { translate: -4px 0; } }
@keyframes ms-push { 40% { translate: 0 6px; } }
.ms-strain .mgk-hand { translate: 0 calc((1 - var(--g, 0)) * 14px); transition: translate 0.12s; }
.ms-strain-line { position: absolute; left: 22%; right: 22%; top: 14%; height: 2px; z-index: 6; background: rgba(255, 255, 255, 0.12); }
.ms-strain-line i { display: block; height: 100%; background: var(--mgk-ink); transform-origin: left center; transform: scaleX(var(--g, 0)); transition: transform 0.12s; }
.mgk-win .ms-strain-line i { background: var(--mgk-amber); }
.mgk-lose .ms-door { right: calc(8% + 12px + 34%); transition: right 0.4s ease-in; }
.mgk-win .ms-door { box-shadow: inset -2px 0 0 rgba(212, 162, 76, 0.6), 10px 0 20px rgba(0, 0, 0, 0.75); }
html body .mgk-btn.mg-btn { min-height: 56px !important; border-radius: 12px !important; border: 1px solid rgba(201, 196, 188, 0.28) !important; background: rgba(12, 13, 15, 0.88) !important; color: var(--mgk-ink) !important; font: 600 16px/1 var(--font-body) !important; }
html body .mgk-btn.mg-btn:active:not(:disabled) { border-color: var(--mgk-amber) !important; color: var(--mgk-amber) !important; transform: none; }

/* ---------- 무궁화 꽃 · 선착장 ---------- */
.mgk-stealth .mgk-photo { filter: brightness(0.32) saturate(0.4) contrast(1.05); }
.mgk-stealth .st-zombie { position: absolute; z-index: 3; width: 14%; color: #1d2024; transform: translate(-50%, -50%); filter: drop-shadow(0 0 1px rgba(200, 195, 185, 0.35)) drop-shadow(0 8px 10px rgba(0, 0, 0, 0.8)); }
.mgk-stealth .st-zombie svg { display: block; width: 100%; height: auto; overflow: visible; transition: transform 0.35s ease; }
.mgk-stealth .zh { transition: transform 0.35s ease; transform-box: fill-box; transform-origin: 50% 100%; }
.mgk-stealth .zf circle { fill: rgba(232, 228, 220, 0.85); opacity: 0; transition: opacity 0.2s; }
.mgk-stealth[data-phase="back"] .st-zombie svg { animation: st-sway 2.4s ease-in-out infinite; }
@keyframes st-sway { 50% { transform: rotate(2.5deg); } }
.mgk-stealth[data-phase="twitch"] .zh { transform: rotate(-38deg) translateX(-2px); }
.mgk-stealth[data-phase="twitch"] .zf circle:first-child { opacity: 0.6; }
.mgk-stealth[data-phase="look"] .st-zombie svg { transform: scaleX(-1) scale(1.08); }
.mgk-stealth[data-phase="look"] .zf circle { opacity: 1; }
.mgk-stealth[data-phase="look"] .st-zombie { color: #2a2d33; filter: drop-shadow(0 0 1.5px rgba(215, 210, 200, 0.5)) drop-shadow(0 8px 10px rgba(0, 0, 0, 0.8)); }
.st-squeeze { position: absolute; inset: 0; z-index: 4; pointer-events: none; box-shadow: inset 0 0 0 0 rgba(0, 0, 0, 0); transition: box-shadow 0.35s ease; }
.mgk-stealth[data-phase="twitch"] .st-squeeze { box-shadow: inset 0 0 50px 14px rgba(0, 0, 0, 0.75); }
.mgk-stealth[data-phase="look"] .st-squeeze { box-shadow: inset 0 0 70px 26px rgba(0, 0, 0, 0.88); }
.mgk-stealth.moving[data-phase="look"] .st-squeeze { box-shadow: inset 0 0 70px 26px rgba(80, 18, 18, 0.75); }
.st-prog { position: absolute; left: 10%; right: 10%; bottom: 7%; height: 2px; z-index: 6; background: rgba(255, 255, 255, 0.14); }
.st-prog i { display: block; height: 100%; background: var(--mgk-ink); transform-origin: left center; transform: scaleX(0); transition: transform 0.1s linear; }
.mgk-win .st-prog i { background: var(--mgk-amber); }
.mgk-stealth .st-alert { position: absolute; left: 0; right: 0; top: 7%; z-index: 7; margin: 0; text-align: center; color: #d9b6b0; font: 600 14px/1.4 var(--font-body); text-shadow: 0 1px 6px #000; }
.st-go.down { border-color: rgba(201, 196, 188, 0.75); color: #efe8de; }

/* ---------- 단어 조각: 휴대폰 · 무전기 ---------- */
.mgk-words .mgk-photo { filter: brightness(0.26) saturate(0.4) blur(2px); }
.wd-device { position: absolute; z-index: 5; left: 50%; transform: translateX(-50%); }
.wd-phone { top: 6%; bottom: 8%; width: min(74%, 300px); border-radius: 26px; padding: 10px; background: #0b0c0e; box-shadow: 0 0 0 2px #1c1e22, 0 18px 40px rgba(0, 0, 0, 0.8); }
.wd-screen { position: relative; display: grid; grid-template-rows: auto 1fr auto auto; height: 100%; border-radius: 18px; overflow: hidden; background: linear-gradient(#111317, #0c0d10); }
.wd-top { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px 8px; border-bottom: 1px solid rgba(255, 255, 255, 0.06); color: #d9d3c9; font: 600 14px/1 var(--font-body); }
.wd-batt { position: relative; width: 24px; height: 11px; border: 1px solid rgba(220, 214, 204, 0.6); border-radius: 2px; --lv: 1; }
.wd-batt::after { content: ""; position: absolute; right: -4px; top: 3px; width: 2px; height: 4px; background: rgba(220, 214, 204, 0.6); }
.wd-batt i { position: absolute; left: 1px; top: 1px; bottom: 1px; width: calc((100% - 2px) * var(--lv)); background: var(--mgk-amber); }
.wd-batt.low { border-color: rgba(160, 70, 64, 0.9); animation: wd-blink 0.8s steps(1) infinite; }
.wd-batt.low i { background: #9a3b33; }
@keyframes wd-blink { 50% { opacity: 0.35; } }
.wd-msgs { position: relative; display: flex; flex-direction: column; justify-content: flex-end; gap: 8px; padding: 10px 12px; }
.wd-inmsg { align-self: flex-start; max-width: 80%; margin: 0; padding: 7px 11px; border-radius: 12px 12px 12px 4px; background: #1d2025; color: #a9a39a; font: 500 13px/1.4 var(--font-body); }
.wd-out { align-self: flex-end; min-height: 34px; max-width: 86%; margin: 0; padding: 7px 11px; border-radius: 12px 12px 4px 12px; background: rgba(212, 162, 76, 0.14); border: 1px solid rgba(212, 162, 76, 0.22); color: #f1ebe2; font: 600 16px/1.4 var(--font-body); }
.wd-caret { display: inline-block; width: 2px; height: 1em; margin-left: 2px; vertical-align: -0.12em; background: #efe8de; animation: wd-blink 1s steps(1) infinite; }
.wd-ph { position: absolute; right: 14px; bottom: 56px; color: rgba(220, 214, 204, 0.35); font: 500 11px/1 var(--font-body); }
.wd-typing .wd-ph { display: none; }
.wd-suggest { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid rgba(255, 255, 255, 0.08); background: #15171b; }
.wd-chip { position: relative; min-height: 46px; padding: 0 6px; border: 0; border-right: 1px solid rgba(255, 255, 255, 0.07); border-bottom: 1px solid rgba(255, 255, 255, 0.07); background: transparent; color: #e6e0d6; font: 600 15px/1.2 var(--font-body); cursor: pointer; touch-action: manipulation; }
.wd-chip small { position: absolute; top: 3px; left: 5px; color: rgba(220, 214, 204, 0.38); font: 500 10px/1 var(--font-body); }
.wd-chip:active:not(:disabled), .wd-chip:focus-visible { background: rgba(255, 255, 255, 0.06); outline: none; }
.wd-chip.used { color: rgba(220, 214, 204, 0.25); }
.wd-chip.wrong { animation: wd-no 0.25s linear; color: #c07068; }
@keyframes wd-no { 25% { translate: -3px 0; } 75% { translate: 3px 0; } }
.wd-keys { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; padding: 6px 8px 14px; background: #121418; }
.wd-keys i { height: 16px; border-radius: 3px; background: #1d2025; }
.wd-crack { position: absolute; inset: 10px; width: calc(100% - 20px); height: calc(100% - 20px); pointer-events: none; z-index: 2; }
.wd-crack path { fill: none; stroke: rgba(230, 226, 218, 0.28); stroke-width: 1; vector-effect: non-scaling-stroke; }
/* 무전기 */
.wd-radio { top: 10%; width: min(56%, 230px); height: 62%; border-radius: 22px 22px 16px 16px; padding: 14px 14px 12px; background: linear-gradient(#1a1c20, #121417); box-shadow: 0 0 0 1px #23262b, 0 18px 40px rgba(0, 0, 0, 0.8); display: grid; grid-template-rows: 1fr auto; gap: 10px; }
.wd-grill { border-radius: 10px; background: repeating-linear-gradient(#0c0d0f 0 3px, #1e2125 3px 6px); opacity: 0.9; }
.wd-lcd { position: relative; min-height: 64px; padding: 8px 10px; border-radius: 6px; background: #1a1d16; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06); }
.wd-lcd .wd-out { background: none; border: 0; padding: 14px 0 0; max-width: none; color: #cfc8b4; font: 600 15px/1.3 var(--font-body); }
.wd-lcd .wd-ph { left: 10px; right: auto; bottom: auto; top: 8px; }
.wd-sig { position: absolute; right: 8px; top: 7px; display: flex; align-items: flex-end; gap: 2px; height: 12px; --lv: 1; }
.wd-sig i { width: 3px; background: rgba(207, 200, 180, 0.25); }
.wd-sig i:nth-child(1) { height: 3px; background: rgba(207, 200, 180, calc(0.25 + 0.7 * clamp(0, var(--lv) * 5, 1))); }
.wd-sig i:nth-child(2) { height: 5px; background: rgba(207, 200, 180, calc(0.25 + 0.7 * clamp(0, (var(--lv) - 0.2) * 5, 1))); }
.wd-sig i:nth-child(3) { height: 7px; background: rgba(207, 200, 180, calc(0.25 + 0.7 * clamp(0, (var(--lv) - 0.4) * 5, 1))); }
.wd-sig i:nth-child(4) { height: 9px; background: rgba(207, 200, 180, calc(0.25 + 0.7 * clamp(0, (var(--lv) - 0.6) * 5, 1))); }
.wd-sig i:nth-child(5) { height: 12px; background: rgba(207, 200, 180, calc(0.25 + 0.7 * clamp(0, (var(--lv) - 0.8) * 5, 1))); }
.wd-sig.low i:nth-child(1) { background: #9a3b33; animation: wd-blink 0.8s steps(1) infinite; }
.wd-ptt { position: absolute; left: -6px; top: 34%; width: 6px; height: 46px; border-radius: 3px 0 0 3px; background: #2a2d32; }
.wd-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 10px; }
.wd-row .wd-chip { min-height: 52px; border: 1px solid rgba(201, 196, 188, 0.22); border-radius: 8px; background: linear-gradient(#17191c, #101114); }

/* ---------- 지하철 키패드 ---------- */
.mgk-keypad .mgk-photo { filter: brightness(0.28) saturate(0.4) blur(1.5px); }
.mgk-keypad .kp-sign { position: absolute; left: 0; right: 0; top: 6%; z-index: 4; margin: 0; text-align: center; color: rgba(220, 214, 204, 0.6); font: 500 12px/1.4 var(--font-body); }
.mgk-keypad .kp-sign b { display: block; margin-top: 2px; color: #d9d3c6; font: 400 28px/1.1 var(--font-display); letter-spacing: 0.18em; text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8); opacity: 0.88; }
.kp-panel { position: absolute; left: 50%; top: 23%; z-index: 5; width: min(70%, 260px); padding: 16px 16px 18px; transform: translateX(-50%); border-radius: 8px; background: repeating-linear-gradient(100deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 4px), linear-gradient(160deg, #4a4e54, #2d3035 55%, #23262a); box-shadow: 0 0 0 1px #1a1c1f, inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 20px 40px rgba(0, 0, 0, 0.75); }
.kp-leds { display: flex; justify-content: center; gap: 10px; margin: 0 0 12px; }
.kp-leds i { width: 8px; height: 8px; border-radius: 50%; background: #3a2c1a; box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.6); }
.kp-leds i.on { background: var(--mgk-amber); box-shadow: 0 0 8px rgba(212, 162, 76, 0.85); }
.mg.kp-wrong .kp-leds i { background: #7a2222; box-shadow: 0 0 8px rgba(122, 34, 34, 0.8); }
.mgk-keypad .kp-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; width: auto; margin: 0; }
.mgk-keypad .kp-key { min-height: 46px; border: 0; border-radius: 6px; color: #d6d0c5; font: 600 20px/1 var(--font-body); cursor: pointer; touch-action: manipulation; background: repeating-linear-gradient(80deg, rgba(255, 255, 255, 0.03) 0 1px, transparent 1px 3px), linear-gradient(#5a5e65, #3b3f45); box-shadow: 0 3px 0 #17191c, inset 0 1px 0 rgba(255, 255, 255, 0.18); transition: translate 0.1s; }
.mgk-keypad .kp-key.pressed { box-shadow: 0 1px 0 #17191c, inset 0 2px 4px rgba(0, 0, 0, 0.5); color: #efe8de; }
.mgk-keypad .kp-key:disabled { opacity: 0.6; }
.kp-screw { position: absolute; width: 6px; height: 6px; border-radius: 50%; background: radial-gradient(circle at 40% 40%, #6b6f75, #2a2c30); }
.kp-screw.s1 { left: 6px; top: 6px; }
.kp-screw.s2 { right: 6px; top: 6px; }
.kp-screw.s3 { left: 6px; bottom: 6px; }
.kp-screw.s4 { right: 6px; bottom: 6px; }
.kp-jolt .kp-panel { animation: kp-jolt 0.12s linear; }
@keyframes kp-jolt { 50% { translate: 0 1px; } }

@media (prefers-reduced-motion: reduce) {
  .mgk-hand-handPoint, .hd-shadow.pass, .wd-batt.low, .wd-caret { animation: none !important; }
}
/* 모든 MG KIT 미니게임: 결과 글씨는 호박색 · 검붉은색 (초록 빛 없음) */
.mg:has(.mgk-stage) .run-verdict.ok { color: var(--mgk-amber) !important; text-shadow: 0 0 16px rgba(212, 162, 76, 0.4) !important; }
.mg:has(.mgk-stage) .run-verdict.fail { color: #b5524a !important; text-shadow: 0 0 16px rgba(122, 34, 34, 0.5) !important; }
