/* 코인랜드 타운 — 모바일 앱 모드 (?app=1 · 폭 760px 이하 · 홈 화면 설치 실행)
   디자인 보드와 동일한 배치: 상단 장소+시세 / 좌 조이스틱 / 우 큰 행동 버튼 / 하단 탭 5개 / 정보는 바텀시트 */
html.app, html.app body { height: 100%; overflow: hidden; overscroll-behavior: none; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
html.app #stage { position: fixed; inset: 0; touch-action: none; }
html.app #top, html.app #ticker, html.app #side, html.app #chat, html.app #hint, html.app #clQuick, html.app #kkFloat, html.app #mNav, html.app #joy { display: none !important; }
html.app #side.aopen { display: block !important; position: fixed !important; left: 0 !important; right: 0 !important; top: auto !important; bottom: 0 !important; width: auto !important; max-height: 74vh !important; border-radius: 26px 26px 0 0 !important; padding: 14px 16px calc(20px + env(safe-area-inset-bottom)) !important; z-index: 40 !important; overflow: auto !important; }
html.app #chat.aopen { display: flex !important; flex-direction: column; position: fixed !important; left: 0 !important; right: 0 !important; bottom: 0 !important; top: auto !important; width: auto !important; height: 62vh !important; border-radius: 26px 26px 0 0 !important; padding-bottom: env(safe-area-inset-bottom) !important; z-index: 40 !important; }
html.app #chat.aopen #chatlist { flex: 1; height: auto !important; }
#aHud, #aJoy, #aAct, #aTabs, #aDim { display: none; }
html.app #aHud, html.app #aTabs { display: flex; }
html.app #aJoy { display: block; }
.aglass { background: rgba(12,16,26,.74); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border: 1px solid rgba(255,255,255,.1); color: #fff; }
#aHud { position: fixed; top: calc(10px + env(safe-area-inset-top)); left: 12px; right: 12px; z-index: 30; flex-direction: column; gap: 8px; font-family: "Pretendard Variable", Pretendard, sans-serif; pointer-events: none; }
#aHud .row { display: flex; gap: 8px; align-items: center; }
#aHud .place { flex: 1; min-width: 0; border-radius: 16px; padding: 8px 12px; display: flex; align-items: center; gap: 9px; pointer-events: auto; }
#aHud .place canvas { width: 28px; height: 28px; image-rendering: pixelated; flex: none; }
#aHud .place b { display: block; font-size: 14.5px; font-weight: 900; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#aHud .place small { display: block; font-size: 11px; opacity: .65; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#aHud .ib { width: 44px; height: 44px; border-radius: 14px; font-size: 18px; display: grid; place-items: center; pointer-events: auto; }
#aHud .tick { height: 30px; border-radius: 10px; display: flex; align-items: center; gap: 14px; padding: 0 12px; font-size: 12px; font-weight: 700; white-space: nowrap; overflow: hidden; }
#aHud .tick .u { color: #ff5a68; } #aHud .tick .d { color: #4c9bff; }
#aJoy { position: fixed; left: 20px; bottom: calc(104px + env(safe-area-inset-bottom)); width: 124px; height: 124px; border-radius: 50%; background: rgba(255,255,255,.12); border: 1.5px solid rgba(255,255,255,.28); z-index: 30; touch-action: none; }
#aJoy b { position: absolute; left: 50%; top: 50%; width: 54px; height: 54px; margin: -27px 0 0 -27px; border-radius: 50%; background: rgba(255,255,255,.9); box-shadow: 0 4px 14px rgba(0,0,0,.35); }
#aAct { position: fixed; right: 16px; bottom: calc(104px + env(safe-area-inset-bottom)); z-index: 30; flex-direction: column; align-items: flex-end; gap: 8px; font-family: "Pretendard Variable", Pretendard, sans-serif; }
html.app #aAct.on { display: flex; }
#aAct .lab { border-radius: 12px; padding: 6px 11px; font-size: 12px; font-weight: 800; max-width: 62vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#aAct .lab i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
#aAct .big { width: 96px; height: 96px; border-radius: 50%; background: #22d17a; border: 4px solid rgba(255,255,255,.35); color: #08140d; font: 900 14px/1.2 "Pretendard Variable", Pretendard, sans-serif; box-shadow: 0 10px 24px rgba(34,209,122,.45); padding: 6px; word-break: keep-all; }
#aAct .big:active { transform: scale(.94); }
#aAct .sub { border-radius: 999px; padding: 9px 14px; font: 800 12.5px "Pretendard Variable", Pretendard, sans-serif; }
html.app #act { display: none !important; }
#aTabs { position: fixed; left: 0; right: 0; bottom: 0; height: calc(78px + env(safe-area-inset-bottom)); padding: 8px 6px env(safe-area-inset-bottom); z-index: 31; border-radius: 22px 22px 0 0; background: rgba(10,13,22,.92); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-top: 1px solid rgba(255,255,255,.08); }
#aTabs button { flex: 1; background: none; border: 0; color: rgba(255,255,255,.5); font: 800 11px "Pretendard Variable", Pretendard, sans-serif; display: flex; flex-direction: column; align-items: center; gap: 3px; }
#aTabs button i { font-style: normal; font-size: 22px; line-height: 1; filter: grayscale(1); }
#aTabs button.on { color: #fff; } #aTabs button.on i { filter: none; }
#aTabs button.on::after { content: ""; width: 18px; height: 3px; border-radius: 2px; background: #22d17a; }
#aDim { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 39; }
html.app #aDim.on { display: block; }
html.app #modal { align-items: flex-end !important; padding: 0 !important; z-index: 60 !important; }
html.app .mbox { width: 100% !important; max-width: 100% !important; max-height: 86vh !important; border-radius: 26px 26px 0 0 !important; padding-bottom: calc(18px + env(safe-area-inset-bottom)) !important; }
html.app #roomBar { top: calc(100px + env(safe-area-inset-top)) !important; left: 12px !important; right: 12px !important; width: auto !important; transform: none !important; z-index: 29 !important; padding: 8px 10px !important; }
html.app #roomBar small { display: none; }
html.app #toasts { top: calc(150px + env(safe-area-inset-top)) !important; left: 12px; right: 12px; }
html.app #bikeBtn { bottom: calc(240px + env(safe-area-inset-bottom)) !important; }
html.app .sheet { max-height: 92vh; }
html.app #species { grid-template-columns: repeat(4,1fr) !important; }
@media (orientation: landscape) and (max-height: 520px) {
  html.app #aTabs { left: auto; right: 12px; top: 12px; bottom: auto; height: 48px; border-radius: 16px; padding: 4px; }
  html.app #aTabs button { flex: none; width: 52px; } html.app #aTabs button span { display: none; } html.app #aTabs button.on::after { display: none; }
  html.app #aHud { right: 300px; } html.app #aHud .tick { display: none; }
  html.app #aJoy { bottom: 24px; left: 40px; } html.app #aAct { bottom: 24px; right: 40px; }
  html.app #roomBar { top: 64px !important; right: auto !important; width: 360px !important; }
}
