#compact-hud[hidden]{display:none}
#room:has(#welcome:not([hidden])) #compact-hud{visibility:hidden}
.compact-room .room-title{display:none}
/* 11-20 폰 게임 HUD — 색은 첫 화면과 같은 두 색: 갈색 #6b4a2f · 크림 #fbf6ea(판 #fffaf0e6), 보조 글자 #7a6650 · 본문 #3d2c1e
   버튼: 알약 99px · 그림자 0 3px 0 #6b4a2f40 · 누르면 3px 눌림 0.12초 / 탭·아이콘은 누르면 살짝 튕김 */
#compact-hud{--brown:#6b4a2f;--cream:#fbf6ea;--panel:#fffaf0e6;--sub:#7a6650;--ink:#3d2c1e;--glow:#ffd88a;
  position:absolute;inset:0;z-index:4;pointer-events:none;font-family:"Pretendard Variable","Noto Sans KR",sans-serif;color:var(--ink)}
#compact-hud button,#compact-hud a,#compact-hud summary,#compact-hud .mascot-chat,#compact-hud .hud-sheet,#compact-hud #room-count{pointer-events:auto}
#compact-hud svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round;display:block;flex:none}
#compact-hud header,#compact-hud .visit-route,#compact-hud .places,#compact-hud .controls,#compact-hud .pad,#compact-hud footer,#compact-hud .mascot-chat,#compact-hud .mascot-chat-launch,#compact-hud .sound-toggle,#compact-hud #entry-panel,#compact-hud #cancel-handoff,#compact-hud #status{position:static;inset:auto;transform:none;margin:0;max-width:none;min-width:0;width:auto}
@keyframes hud-pop{0%{transform:scale(1)}35%{transform:scale(.88)}70%{transform:scale(1.08)}100%{transform:scale(1)}}
#compact-hud .hud-pop{animation:hud-pop .28s ease-out}
@media(prefers-reduced-motion:reduce){#compact-hud .hud-pop{animation:none}}

/* 위: 함께 있는 손님(왼쪽) · 둥근 아이콘(오른쪽) */
#compact-hud .hud-top{position:absolute;top:max(10px,env(safe-area-inset-top));left:max(10px,env(safe-area-inset-left));right:max(10px,env(safe-area-inset-right));display:flex;align-items:flex-start;justify-content:space-between;gap:8px}
#compact-hud #room-count{position:static!important;transform:none!important;top:auto!important;left:auto!important;max-width:150px!important;min-height:36px!important;padding:0 12px!important;border-radius:99px!important;background:var(--panel)!important;color:var(--brown)!important;border:1.5px solid var(--brown)!important;box-shadow:0 3px 0 #6b4a2f40!important;font:750 12px/1.2 "Pretendard Variable",sans-serif!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
#compact-hud .hud-icons{display:flex;gap:6px;flex-wrap:nowrap}
#compact-hud .hud-icon,#compact-hud #room-say-toggle,#compact-hud .sound-toggle{width:44px!important;height:44px!important;min-width:44px!important;min-height:44px!important;padding:0!important;border-radius:50%!important;border:1.5px solid var(--brown)!important;background:var(--panel)!important;color:var(--brown)!important;box-shadow:0 3px 0 #6b4a2f40!important;display:inline-flex!important;align-items:center;justify-content:center;font-size:0!important;position:static!important;order:0!important;cursor:pointer}
#compact-hud .hud-icon[hidden],#compact-hud #room-say-toggle[hidden]{display:none!important}
#compact-hud .hud-icon.on{background:var(--brown)!important;color:var(--cream)!important}
#compact-hud .hud-icon:active,#compact-hud .sound-toggle:active{transform:translateY(3px);box-shadow:none!important}

/* 안내 = 게임식 토스트(위에서 내려왔다 사라짐) */
#compact-hud .hud-toast{position:absolute;top:calc(max(10px,env(safe-area-inset-top)) + 54px);left:50%;transform:translate(-50%,-14px);opacity:0;transition:transform .25s ease,opacity .25s ease;max-width:min(320px,calc(100% - 24px));pointer-events:none}
#compact-hud .hud-toast.show{transform:translate(-50%,0);opacity:1}
#compact-hud #status{display:block;padding:9px 16px;border-radius:16px;background:var(--panel);color:var(--ink);border:1.5px solid var(--brown);box-shadow:0 4px 14px #3d2c1e1f;font:700 13px/1.45 "Pretendard Variable",sans-serif;text-align:center;white-space:normal;overflow-wrap:anywhere;max-height:none}
@media(prefers-reduced-motion:reduce){#compact-hud .hud-toast{transition:none}}

/* 째멍이 대화(말풍선) */
#compact-hud .hud-conversation{position:absolute;left:12px;right:12px;bottom:calc(var(--tabh) + 190px);max-height:32dvh;overflow:auto;overscroll-behavior:contain;border-radius:16px}
#compact-hud .mascot-chat{max-height:none;width:100%;box-sizing:border-box;padding:12px;overflow:visible;font-size:13px;line-height:1.5;box-shadow:0 4px 14px #3d2c1e1f}
#compact-hud .mascot-chat-actions{gap:4px}
#compact-hud .mascot-chat-actions button,#compact-hud .mascot-chat-actions a{padding:8px 10px;min-height:44px;box-sizing:border-box}
#compact-hud .mascot-chat-actions small{font-size:10px;line-height:1.4}

/* 아래 묶음: 퀘스트 칩 → 이동 → 탭 */
#compact-hud{--tabh:calc(66px + env(safe-area-inset-bottom))}
#compact-hud .hud-bottom{position:absolute;left:0;right:0;bottom:0;display:flex;flex-direction:column;gap:8px}
#compact-hud .hud-tools{display:flex;gap:6px;flex-wrap:wrap;justify-content:flex-start;padding:0 12px}
#compact-hud .hud-tools button,#compact-hud .hud-quest{min-height:40px;padding:0 14px 0 12px;border-radius:99px;border:1.5px solid var(--brown);background:var(--panel);color:var(--brown);box-shadow:0 3px 0 #6b4a2f40;font:750 13px/1.2 "Pretendard Variable",sans-serif;max-width:100%;box-sizing:border-box;cursor:pointer}
#compact-hud .hud-quest{position:relative;padding-left:30px;background:#fffaf0f2}
#compact-hud .hud-quest::before{content:"!";position:absolute;left:8px;top:50%;width:16px;height:16px;margin-top:-8px;border-radius:50%;background:var(--brown);color:var(--cream);font:800 11px/16px sans-serif;text-align:center;box-shadow:0 0 0 3px #ffd88a66;animation:hud-quest 1.6s ease-in-out infinite}
@keyframes hud-quest{0%,100%{box-shadow:0 0 0 2px #ffd88a55}50%{box-shadow:0 0 0 7px #ffd88a00}}
@media(prefers-reduced-motion:reduce){#compact-hud .hud-quest::before{animation:none}}
#compact-hud .hud-tools button:active,#compact-hud .hud-quest:active{transform:translateY(3px);box-shadow:none}
#compact-hud .hud-tools button[hidden],#compact-hud .hud-quest[hidden]{display:none}
#compact-hud #entry-panel{padding:0;background:none;box-shadow:none;border:0}
#compact-hud #entry-panel button{background:var(--brown);color:var(--cream)}
#compact-hud .hud-movement{padding:0 12px}
#compact-hud .hud-tools:not(:empty){margin-bottom:22px}   /* 11-20 터치 폰 확인: 조이스틱 손잡이를 끝까지 위로 밀면 위 칩 아래 끝에 약 17px 겹침 → 칩과 이동 사이를 띄움 */
#compact-hud .controls{position:relative;display:flex;align-items:flex-end;justify-content:space-between;gap:8px;padding:0;pointer-events:none;min-height:112px}
#compact-hud .controls>p{display:none}
#compact-hud .pad{display:grid;grid-template-columns:repeat(3,44px);grid-template-rows:repeat(2,44px);gap:4px;pointer-events:auto}
#compact-hud .pad button{min-width:44px;width:44px;min-height:44px;height:44px;padding:0;border-radius:12px;border:1.5px solid var(--brown);background:var(--panel);color:var(--brown);box-shadow:0 3px 0 #6b4a2f40}
#compact-hud .pad button:first-child{grid-column:2;grid-row:1}#compact-hud .pad button:nth-child(2){grid-column:1;grid-row:2}#compact-hud .pad button:nth-child(3){grid-column:2;grid-row:2}#compact-hud .pad button:nth-child(4){grid-column:3;grid-row:2}
#compact-hud #interact{min-height:46px;min-width:0;max-width:180px;padding:0 18px;border-radius:99px;border:0;background:var(--brown);color:var(--cream);box-shadow:0 3px 0 #3d2c1e66;font:750 13px/1.3 "Pretendard Variable",sans-serif;pointer-events:auto}
#compact-hud #interact:active{transform:translateY(3px);box-shadow:none}
#compact-hud .rx-joy{border-color:#fffaf0cc;background:#6b4a2f22}

/* 고정 탭 5개 — 가운데(LP 듣기·창가 읽기)는 크게 떠 있는 동그라미 */
#compact-hud .hud-tabbar{display:grid;grid-template-columns:repeat(5,1fr);align-items:end;height:var(--tabh);padding:0 6px env(safe-area-inset-bottom);box-sizing:border-box;background:var(--cream);border-top:1.5px solid #6b4a2f33;box-shadow:0 -4px 16px #3d2c1e14;pointer-events:auto}
#compact-hud .hud-tabbar button{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;height:64px;padding:0;border:0;background:none;color:var(--sub);font:750 11px/1 "Pretendard Variable",sans-serif;cursor:pointer;min-width:0}
#compact-hud .hud-tabbar button[aria-expanded=true]{color:var(--brown)}
#compact-hud .hud-tabbar .hud-main{color:var(--brown)}
#compact-hud .hud-ring{display:flex;align-items:center;justify-content:center;width:58px;height:58px;margin-top:-30px;border-radius:50%;background:var(--brown);color:var(--cream);box-shadow:0 3px 0 #3d2c1e66,0 0 0 5px var(--cream),0 0 0 7px #ffd88a99}
#compact-hud .hud-ring svg{width:30px;height:30px}
#compact-hud .hud-main:active .hud-ring{transform:translateY(3px);box-shadow:0 0 0 5px var(--cream),0 0 0 7px #ffd88a99}
#compact-hud:has(.hud-sheet:not([hidden])) .hud-tools,#compact-hud:has(.hud-sheet:not([hidden])) .hud-movement{visibility:hidden}
#compact-hud .hud-badge{position:absolute;top:6px;left:calc(50% + 6px);min-width:18px;height:18px;padding:0 4px;border-radius:99px;background:var(--brown);color:var(--cream);font:800 10px/18px sans-serif;font-style:normal;box-sizing:border-box}
#compact-hud .hud-badge[hidden]{display:none}

/* 매장 이동 판(원래 안내판·경로·지금 내 손에는·매장 소개를 한곳에) */
#compact-hud .hud-sheet{position:absolute;left:8px;right:8px;bottom:calc(var(--tabh) + 8px);max-height:62dvh;overflow:auto;overscroll-behavior:contain;padding:12px 12px 14px;border-radius:16px;background:var(--cream);border:1.5px solid var(--brown);box-shadow:0 8px 28px #3d2c1e33;z-index:2}
#compact-hud .hud-sheet[hidden]{display:none}
#compact-hud .hud-sheet-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px;font-size:15px;color:var(--brown)}
#compact-hud .hud-sheet-close{box-shadow:none!important}
#compact-hud header{display:flex;flex-wrap:wrap;align-items:center;gap:8px;padding:0 0 8px;width:100%;border-bottom:1px solid #6b4a2f22;margin-bottom:8px}
#compact-hud .wordmark{font-size:15px;line-height:1.25;color:var(--ink)}
#compact-hud .wordmark span{font-size:10px;color:var(--sub)}
#compact-hud .top-actions,#compact-hud .header-actions{display:flex;gap:6px;flex-wrap:wrap;margin-left:auto}
#compact-hud header button{min-height:40px;padding:0 12px;font-size:12px;border-radius:99px}
#compact-hud .sample-link{display:none}
#compact-hud .visit-route{padding:0;background:none;border:0;box-shadow:none}
#compact-hud .visit-route p{display:flex;align-items:center;flex-wrap:wrap;gap:6px;margin:0 0 8px;font-size:12px}
#compact-hud .visit-route b{overflow-wrap:anywhere}
#compact-hud .visit-route div,#compact-hud .places{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}
#compact-hud .visit-route button,#compact-hud .places button,#compact-hud .hud-next button{min-height:46px;padding:6px 10px;font:750 13px/1.25 "Pretendard Variable",sans-serif;white-space:normal;border-radius:99px;border:1.5px solid var(--brown);background:var(--panel);color:var(--brown);box-shadow:0 3px 0 #6b4a2f40}
#compact-hud .visit-route button:active,#compact-hud .places button:active{transform:translateY(3px);box-shadow:none}
#compact-hud .hud-next{margin-bottom:8px}
#compact-hud footer{display:flex;gap:6px;flex-wrap:wrap;justify-content:space-between;align-items:center;margin-top:10px;font-size:11px}
#compact-hud footer>span{display:none}
#compact-hud footer button,#compact-hud footer a{min-height:40px;padding:0 10px;box-sizing:border-box;display:inline-flex;align-items:center}
body:has(dialog[open]) #compact-hud .sound-toggle{visibility:hidden}
/* 가로로 눕힌 폰(높이 500 이하): 탭을 낮게, 대화는 오른쪽 위 */
@media(max-height:500px) and (min-width:501px){
  #compact-hud{--tabh:calc(54px + env(safe-area-inset-bottom))}
  #compact-hud .hud-tabbar button{height:52px}
  #compact-hud .hud-ring{width:46px;height:46px;margin-top:-18px}#compact-hud .hud-ring svg{width:24px;height:24px}
  #compact-hud .hud-conversation{left:auto;width:min(360px,45vw);top:64px;bottom:auto;max-height:calc(100dvh - 140px)}
  #compact-hud .controls{min-height:96px}
}

/* 11-20 퀘스트 칩을 오른쪽 위로 접기(우님 「중요 부분을 가려」) — 아이콘 줄 아래 둥근 「!」, 누르면 왼쪽 아래로 세로 펼침 */
#compact-hud .hud-quests{position:absolute;top:calc(max(10px,env(safe-area-inset-top)) + 54px);right:max(10px,env(safe-area-inset-right));display:flex;flex-direction:column;align-items:flex-end;gap:8px;z-index:3}
#compact-hud .hud-quests[hidden],#compact-hud .hud-quest-list[hidden]{display:none}
#compact-hud .hud-quest-toggle{position:relative;width:44px;height:44px;border-radius:50%;border:1.5px solid var(--brown);background:var(--panel);color:var(--brown);box-shadow:0 3px 0 #6b4a2f40;font:800 18px/1 "Pretendard Variable",sans-serif;cursor:pointer;padding:0}
#compact-hud .hud-quest-toggle[aria-expanded=true]{background:var(--brown);color:var(--cream)}
#compact-hud .hud-dot{position:absolute;top:-2px;right:-2px;width:11px;height:11px;border-radius:50%;background:#d6452f;box-shadow:0 0 0 2px var(--cream)}
#compact-hud .hud-dot[hidden]{display:none}
#compact-hud .hud-quest-list{display:flex;flex-direction:column;align-items:flex-end;gap:6px;max-width:min(240px,calc(100vw - 24px))}
#compact-hud .hud-quest-list button{min-height:40px;padding:0 14px 0 12px;border-radius:99px;border:1.5px solid var(--brown);background:#fffaf0f2;color:var(--brown);box-shadow:0 3px 0 #6b4a2f40;font:750 13px/1.2 "Pretendard Variable",sans-serif;max-width:100%;box-sizing:border-box;cursor:pointer;white-space:nowrap}
#compact-hud .hud-quest-list .hud-quest{padding-left:30px}
#compact-hud .hud-quest-list button[hidden]{display:none}
#compact-hud .hud-quest-toggle b{font-size:19px;font-weight:800;line-height:1}   /* 아이콘 공통 font-size:0 때문에 「!」가 안 보였음 */
#compact-hud .hud-icon.hud-quest-toggle[aria-expanded=true]{background:var(--brown)!important;color:var(--cream)!important}
/* 11-20 판을 든 동안: 조이스틱 줄 위 가운데 「청음하러 가기」 큰 알약 + 작은 버튼(작은 폰에서도 보이게) */
#compact-hud .hud-held{display:flex;flex-direction:column;align-items:center;gap:6px;padding:0 12px;pointer-events:none}
#compact-hud .hud-held[hidden]{display:none}
body:has(dialog[open]) #compact-hud .hud-held{display:none}
#compact-hud .hud-held button{pointer-events:auto;cursor:pointer;font-family:"Pretendard Variable",sans-serif}
#compact-hud .hud-held-main{min-height:52px;min-width:min(240px,calc(100vw - 48px));padding:0 26px;border-radius:99px;border:0;background:var(--brown);color:var(--cream);font-size:16px;font-weight:800;box-shadow:0 4px 0 #3d2c1e66,0 0 0 4px #ffd88a66;animation:hud-held 1.8s ease-in-out infinite}
@keyframes hud-held{0%,100%{box-shadow:0 4px 0 #3d2c1e66,0 0 0 3px #ffd88a55}50%{box-shadow:0 4px 0 #3d2c1e66,0 0 0 9px #ffd88a00}}
@media(prefers-reduced-motion:reduce){#compact-hud .hud-held-main{animation:none}}
#compact-hud .hud-held-main:active,#compact-hud .hud-held-more button:active{transform:translateY(3px);box-shadow:none}
#compact-hud .hud-held-more{display:flex;gap:6px;flex-wrap:wrap;justify-content:center}
#compact-hud .hud-held-more button{min-height:38px;padding:0 13px;border-radius:99px;border:1.5px solid var(--brown);background:var(--panel);color:var(--brown);font-size:12.5px;font-weight:750;box-shadow:0 3px 0 #6b4a2f40}
#compact-hud .hud-held-more button[hidden]{display:none}
/* 11-20 판 든 동안 버튼이 캐릭터를 가리던 것 → 조이스틱 줄 오른쪽(넘겨보기 자리) 한 줄: 큰 알약 + ⋯(누르면 위로 사장님께·돌려놓기·사진) */
#compact-hud .hud-bottom{position:absolute}
#compact-hud .hud-held{position:absolute;right:12px;bottom:calc(var(--tabh) + 8px);flex-direction:row;align-items:center;gap:6px;padding:0;z-index:2}
#compact-hud:has(.hud-held:not([hidden])) #interact{visibility:hidden}
#compact-hud .hud-held-main{min-height:48px;min-width:0;padding:0 18px;font-size:15px;white-space:nowrap}
#compact-hud .hud-held-toggle{width:44px;height:44px;border-radius:50%;border:1.5px solid var(--brown);background:var(--panel);color:var(--brown);font-size:20px;font-weight:800;line-height:1;box-shadow:0 3px 0 #6b4a2f40;padding:0}
#compact-hud .hud-held-toggle[aria-expanded=true]{background:var(--brown);color:var(--cream)}
#compact-hud .hud-held-more{position:absolute;right:0;bottom:56px;flex-direction:column;align-items:flex-end;gap:6px}
#compact-hud .hud-held-more[hidden]{display:none}

/* 11-22 최종 검수: 손님이 직접 연 「매장 이동」 메뉴는 자동으로 뜬 카드(오늘의 한 장·방문 도장 z-index 20)보다 위. 카드는 daily-pick.mjs가 메뉴를 보면 접음 */
#compact-hud .hud-sheet{z-index:25}

/* 11-23 전체 점검 ①: 판을 들면 위 줄에 📷가 끼어 ⚙ 설정이 화면 밖으로 밀렸음 → 폰 위 줄의 📷는 빼고(판 든 동안 아래 「⋯」 메뉴에 같은 「📸 사진」이 있음), 단추 줄은 줄어들지 않게·닉네임 칩이 대신 줄어듦 */
#compact-hud .hud-icons{flex:0 0 auto}
#compact-hud .hud-icons [data-proxy="photo"]{display:none!important}
#compact-hud .hud-count{flex:1 1 auto;min-width:0;overflow:hidden}
#compact-hud .hud-count>*{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

#compact-hud{--tabh:calc(52px + env(safe-area-inset-bottom))}
#compact-hud .hud-tabbar button{height:50px}
#compact-hud .hud-ring{width:30px;height:30px;margin-top:0;box-shadow:none}
#compact-hud .hud-ring svg{width:22px;height:22px}
#compact-hud .hud-tabbar:has(>.rx-tok.on){grid-template-columns:repeat(6,minmax(0,1fr))}
#compact-hud .hud-tabbar .rx-tok:not(.on){display:none}
#room header .rx-tok,#compact-hud .hud-tabbar .rx-tok{position:static;transform:none}
#room #rx-feedback-nudge{position:static;inset:auto;transform:none;animation:none;max-width:100%;pointer-events:auto}

#room .rx-tok-pop{pointer-events:none;display:none;position:static}
#room .rx-tok-pop.show{display:block}
#compact-hud .hud-tabbar .rx-tok-pop.show{position:absolute;inset:auto 6px 100% auto}
body:has(.compact-room) .rx-daily-mini,body:has(.compact-room) .rx-quest-mini{display:none}
