/* 휴대폰(터치) 전용 — PC 화면은 그대로 둔다. 방탈출 공통 파일(직거래·용산동 1996 같은 내용).
   원칙: 가로 화면에서 플레이. 무대가 작아서(폭 약 700px) 글씨·버튼·소지품을 1.5배 안팎으로 키우고,
   클로즈업은 무대를 거의 꽉 채우도록 확대한다. 세로로 들면 돌려 달라는 안내를 띄운다. */

#rotate, #fs-btn { display: none; }

@media (pointer: coarse) {
  #stage { touch-action: manipulation; -webkit-touch-callout: none; }
}

@media (pointer: coarse) and (max-height: 600px) {
  /* 윗줄 */
  #hud { font-size: 1.8cqw; gap: 1.4cqw; padding: 1.2cqw 2cqw; }
  #police { font-size: 1.6cqw; }
  #era { font-size: 2.6cqw; }
  #clock b { font-size: 2.6cqw; }
  #clock small { font-size: 1.3cqw; }
  .hud-btn { font-size: 1.75cqw; padding: .8cqw 1.7cqw; }
  #tip { font-size: 1.8cqw; padding: .5cqw 1.2cqw; }
  .nav { width: 7cqw; height: 16cqw; font-size: 7cqw; }
  #evt { font-size: 2.2cqw; padding: 1.1cqw 2.6cqw; bottom: 22cqw; }

  /* 소지품 */
  /* 너무 키우면 화면 아래쪽 살펴볼 곳을 덮는다(용산동 '집 옆 구석') → 한 칸 5.6cqw(약 39px) */
  #inv { min-height: 6.4cqw; gap: .7cqw; padding: .4cqw .7cqw; max-width: 92cqw; border-radius: 1.2cqw; bottom: .6cqw; }
  .it { width: 5.6cqw; height: 5.6cqw; border-radius: .8cqw; }
  .it .tip { font-size: 1.6cqw; padding: .45cqw .9cqw; }

  /* 설명·자막 */
  #texts { width: 88cqw; bottom: 8.6cqw; gap: .9cqw; }
  #msg { max-width: 84cqw; font-size: 2.05cqw; padding: 1.1cqw 2cqw; border-radius: 1.1cqw; }
  #sub { max-width: 88cqw; font-size: 2.3cqw; padding: 1cqw 1.6cqw; border-radius: .8cqw; }
  #cu:not(.hidden) ~ #texts #msg { font-size: 1.85cqw; padding: .9cqw 1.6cqw; }

  /* 클로즈업: 윗줄 아래부터 무대를 꽉 채우게 확대 (안쪽 퍼즐·폰 화면이 같이 커진다).
     74% x 1.18 = 폭 87cqw, 높이 49cqw → 윗줄(약 6.3cqw) 밑 6.4cqw부터 바닥까지. 닫기는 오른쪽 빈 여백에. */
  #cu { padding-top: 6.4cqw; }
  #cu-inner { transform: scale(1.18); transform-origin: 50% 0; }
  #cu-close { top: 6.6cqw; right: .8cqw; width: 5.2cqw; height: 5.2cqw; font-size: 2.4cqw; z-index: 26; background: rgba(0,0,0,.8); }
  .btn { font-size: 1.3cqw; }
  .ptxt { font-size: 1.25cqw; }
  .ptitle { font-size: 1.3cqw; }
  .note { font-size: 1.6cqw; }
  .phone .sbar { font-size: 1cqw; }
  .notif, .lock-msg, .small-date { font-size: 1.05cqw; }
  .bar { font-size: 1.15cqw; }
  .list .row { font-size: 1.02cqw; }
  .list .row span { font-size: .92cqw; }
  .thread .bub, .said, .choices .btn { font-size: 1.05cqw; }
  .app { font-size: 1.05cqw; }
  .pdot { width: 2.7cqw; height: 2.7cqw; }
  .keys button { font-size: 1.8cqw; }
  .wp, .wp-grid button { font-size: 1.15cqw; }
  .chatpanel .bub { font-size: 1.35cqw; }

  /* 제목·메뉴·힌트·엔딩 */
  .ov { max-width: 86cqw; }
  .ov h2 { font-size: 4cqw; }
  .ov p { font-size: 2cqw; }
  .ov .small { font-size: 1.6cqw; }
  .ov .btn { font-size: 2cqw; padding: 1.1cqw 2.4cqw; }
  .box { padding: 1.4cqw 2cqw; }
  .stat { font-size: 1.8cqw; }
  .credit { font-size: 1.5cqw; }

  /* 컷신 */
  .card { padding: 0 6%; }
  .card .big { font-size: 4.8cqw; }
  .card .mid { font-size: 2.8cqw; }
  .card .txt { font-size: 2.4cqw; }
  .cine-skip { font-size: 1.7cqw; padding: .8cqw 1.6cqw; }
  .cine-hint { font-size: 1.5cqw; }

  /* 주소창 없애기(안드로이드) — 무대 옆 검은 여백에 둔다 */
  #fs-btn { display: grid; place-items: center; position: fixed; left: 14px; top: 12px; z-index: 200; width: 40px; height: 40px; padding: 0; border-radius: 50%;
    border: 1px solid rgba(255,255,255,.3); background: rgba(10,10,14,.7); color: #fff; font-size: 18px; line-height: 1; opacity: .85; }
  #fs-btn.hidden { display: none; }
}

/* 세로로 들었을 때: 돌려 달라는 안내 */
@media (pointer: coarse) and (orientation: portrait) and (max-width: 600px) {
  #rotate { display: flex; position: fixed; inset: 0; z-index: 300; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
    background: #07080c; color: #f3eee4; text-align: center; padding: 24px; font-family: var(--body); }
  #rotate .ph { width: 54px; height: 92px; border: 3px solid #f3eee4; border-radius: 12px; position: relative; animation: turn 2.2s ease-in-out infinite; }
  #rotate .ph::after { content: ''; position: absolute; left: 50%; bottom: 7px; width: 14px; height: 3px; margin-left: -7px; border-radius: 2px; background: #f3eee4; }
  #rotate b { font-size: 19px; }
  #rotate span { font-size: 14px; color: #a9a295; line-height: 1.6; }
  #rotate a { margin-top: 6px; font-size: 14px; color: #8cc8ff; }
  #rotate span b { font-size: inherit; color: #f3eee4; }
  #rotate .go { margin-top: 6px; padding: 15px 26px; border-radius: 999px; border: 0; background: #f3eee4; color: #07080c;
    font-size: 17px; font-weight: 700; font-family: inherit; cursor: pointer; box-shadow: 0 8px 30px rgba(0,0,0,.5); }
  #rotate .go:active { transform: scale(.97); }
  @keyframes turn { 0%, 20% { transform: rotate(0); } 50%, 80% { transform: rotate(-90deg); } 100% { transform: rotate(0); } }
}
