/* ============================================================
   platform.css — PC / 모바일 화면·안내 분리 (본편·전설의 배낭 공용)
   body.plat-pc / body.plat-mobile 은 platform_mode.js 가 붙입니다.
   ============================================================ */
/* 안내 문구: 한쪽 모드에서만 보이게 */
body.plat-mobile .pc-only { display: none !important; }
body.plat-pc .mob-only { display: none !important; }
/* 키보드 키 배지(<kbd>)는 모바일에선 의미 없음 */
body.plat-mobile kbd { display: none !important; }
/* PC 모드: 모바일 조작판은 절대 보이지 않음 */
body.plat-pc #mobile-ctl { display: none !important; }
/* 마우스로만 쓰는 창 크기 조절 손잡이는 모바일에서 숨김 */
body.plat-mobile .rz-handle { display: none !important; }
body.plat-mobile #hint-bar, body.plat-mobile .controls-hint { display: none !important; }
body.plat-pc .mc-x { display: none !important; }

/* ----- 모바일 조작판 ----- */
body.plat-mobile #mobile-ctl .mc-b { font-size: 18px; }
body.plat-mobile #mobile-ctl .mc-b.big { right: 4px; bottom: 6px; }
#mobile-ctl .mc-menu { position: absolute; right: calc(6px + env(safe-area-inset-right)); top: 6px; transform: none; display: grid !important; grid-template-columns: repeat(4, 38px); gap: 4px; pointer-events: none; }
#mobile-ctl .mc-m { width: 38px; height: 38px; border-radius: 10px; font-size: 16px; position: relative; pointer-events: auto; }
#mobile-ctl .mc-m.on { background: rgba(255, 215, 94, .55); border-color: #ffd75e; }
#mobile-ctl .mc-more { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(420px, 86vw); display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 12px; border-radius: 14px; background: rgba(14, 17, 38, .94); border: 1px solid rgba(160, 175, 255, .4); box-shadow: 0 12px 40px rgba(0, 0, 0, .6); pointer-events: auto; }
#mobile-ctl .mc-more.hidden { display: none; }
#mobile-ctl .mc-more button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, .22); background: rgba(40, 46, 90, .8); color: #e8ecff; font: 700 12px sans-serif; }
#mobile-ctl .mc-more button span { font-size: 22px; }
#mobile-ctl .mc-more button:active { background: rgba(255, 215, 94, .45); }
#mobile-ctl .mc-cancel { position: absolute; left: 50%; bottom: 20px; transform: translateX(-50%); padding: 10px 22px; border-radius: 999px; border: 2px solid #ff9a9a; background: rgba(120, 30, 40, .85); color: #fff; font: 800 15px sans-serif; pointer-events: auto; }
#mobile-ctl .mc-cancel.hidden { display: none; }

/* ----- 창 닫기 ✕ (모바일) ----- */
.mc-x { position: absolute; top: 6px; right: 8px; width: 36px; height: 36px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .35); background: rgba(160, 50, 60, .85); color: #fff; font: 800 16px sans-serif; z-index: 5; padding: 0; line-height: 1; cursor: pointer; }
body.plat-mobile .panel h3 { padding-right: 46px; }

/* ----- 모바일: 파티 창은 조이스틱과 겹치지 않게 왼쪽 위로 ----- */
body.plat-mobile #party-list { bottom: auto !important; top: 206px !important; left: 8px !important; max-height: 120px; transform-origin: top left; transform: scale(.9); }
body.plat-mobile #itemlog { top: 52px !important; right: 60px; left: auto !important; }
body.plat-mobile .party-out { min-width: 30px; min-height: 26px; }
/* 모바일에서 터치하기 쉬운 크기 */
body.plat-mobile button, body.plat-mobile .btn-sub, body.plat-mobile .cls-btn, body.plat-mobile .diff-btn { min-height: 34px; }
body.plat-mobile #confirm-btns button { min-height: 44px; min-width: 96px; font-size: 15px; }
body.plat-mobile #toast { max-width: 76vw; font-size: 13px; }

/* ----- 지도 모드 조작 막대 (모바일 확대/축소/내 위치) ----- */
#map-bar { position: absolute; right: 12px; bottom: 14px; display: none; gap: 6px; z-index: 60; }
body.plat-mobile #map-bar.on { display: flex; }
#map-bar button { width: 44px; height: 44px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, .35); background: rgba(20, 24, 48, .85); color: #fff; font: 800 20px sans-serif; }
#map-bar .mb-close { background: rgba(160, 50, 60, .85); }
#map-bar .mb-pc { display: none; }

/* ----- 던전 나가기 버튼 (왼쪽) — 두 모드 공통 ----- */
#dgn-exit { position: absolute; left: 10px; top: 152px; z-index: 40; display: none; padding: 10px 12px; border-radius: 12px; border: 2px solid rgba(160, 230, 255, .8); background: rgba(14, 40, 70, .88); color: #dff6ff; font: 800 13px sans-serif; box-shadow: 0 6px 18px rgba(0, 0, 0, .5); cursor: pointer; }
#dgn-exit.on { display: block; }
#dgn-exit:hover { background: rgba(30, 80, 130, .95); }
#dgn-exit.warn { border-color: #ffd75e; color: #fff3c0; }
body.plat-mobile #dgn-exit { top: 150px; left: calc(10px + env(safe-area-inset-left)); padding: 12px 14px; font-size: 14px; }

/* ----- 도움말 알림 (튜토리얼 이후 가끔 뜨는 한 줄 팁) ----- */
#tip-pill { position: absolute; left: 50%; bottom: 52px; transform: translate(-50%, 8px); max-width: min(560px, 80%); padding: 8px 16px; border-radius: 14px; background: rgba(16, 22, 48, .92); border: 1px solid rgba(138, 216, 255, .55); color: #cfeaff; font: 600 12.5px/1.45 sans-serif; text-align: center; opacity: 0; pointer-events: none; transition: opacity .5s, transform .5s; z-index: 30; white-space: pre-line; }
#tip-pill.on { opacity: 1; transform: translate(-50%, 0); }
body.plat-mobile #tip-pill { bottom: 150px; }

/* ----- 이벤트 로그 (알림이 겹쳐 빨리 지나가지 않게 쌓아서 보여줌) ----- */
#evlog { position: absolute; right: 12px; bottom: 134px; width: 290px; max-height: 190px; overflow: hidden; -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 30px); mask-image: linear-gradient(to bottom, transparent 0, #000 30px); display: flex; flex-direction: column; justify-content: flex-end; gap: 3px; z-index: 28; pointer-events: none; font: 600 11.5px/1.35 sans-serif; }
#evlog .ev { padding: 4px 9px; border-radius: 8px; background: rgba(13, 16, 36, .82); border-left: 3px solid var(--c, #8ad8ff); color: #e6ecff; animation: evIn .25s ease-out; white-space: pre-line; }
#evlog .ev.old { opacity: .55; }
#evlog .ev.fade { opacity: 0; transition: opacity .6s; }
@keyframes evIn { from { opacity: 0; transform: translateX(-10px); } to { opacity: 1; transform: none; } }
body.plat-mobile #evlog { left: auto; right: 62px; bottom: auto; top: 112px; width: 220px; max-height: 120px; font-size: 10.5px; justify-content: flex-start; }
#evlog.collapsed { display: none; }

/* ----- 실시간 창 안내 / 피격 경고 ----- */
body.menu-live #game-wrap.hit-flash::after { content: ''; position: absolute; inset: 0; border: 4px solid rgba(255, 60, 60, .75); pointer-events: none; z-index: 120; animation: hitFlash .5s ease-out forwards; }
@keyframes hitFlash { from { opacity: 1; } to { opacity: 0; } }
.live-pill { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; font: 700 10px sans-serif; color: #ffd0d0; background: rgba(160, 40, 50, .55); border: 1px solid rgba(255, 120, 120, .5); vertical-align: middle; }
.live-pill.freeze { color: #cfe8ff; background: rgba(40, 80, 140, .55); border-color: rgba(140, 190, 255, .5); }

/* ----- 믹서기 ----- */
#mixer { width: min(620px, 92%); left: 50%; top: 50%; transform: translate(-50%, -50%); }

#confirm-msg { white-space: pre-line; line-height: 1.5; }
#live-pill { font-size: 12px; }
body.plat-mobile .close-hint { display: none; }

/* ---- 검의 전설(본편) 모바일: 미니맵 툴바가 메뉴 역할 → 중복 메뉴 숨김, 퀘스트 창은 접어서 버튼과 안 겹치게 ---- */
body.main-game.plat-mobile #mobile-ctl .mc-menu, body.main-game.plat-mobile #mobile-ctl .mc-more { display: none !important; }
body.main-game.plat-mobile #quest-tracker { right: auto; left: 8px; top: 86px; width: 190px; font-size: 11px; opacity: .92; }
body.main-game.plat-mobile #quest-tracker.collapsed { opacity: .8; }
body.main-game.plat-mobile #party-list { top: 160px !important; }
