:root {
  --ink: #3b3328;
  --muted: #8a7f6e;
  --paper: #f0ece4;
  --glass: rgba(255, 251, 243, 0.72);
  --line: rgba(110, 90, 60, 0.18);
  --green: #4f7d4a;
  --orange: #d9772f;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #cfe0ea; color: var(--ink);
  font-family: Pretendard, -apple-system, 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif; -webkit-font-smoothing: antialiased; }
#app canvas { display: block; touch-action: none; }
.hidden { display: none !important; }
button { font: inherit; }

/* ---------- 대기 화면 ---------- */
.loading { position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--paper); transition: opacity 0.7s ease; }
.loading.fade { opacity: 0; pointer-events: none; }
.ld-icon { width: 44px; height: 34px; margin-bottom: 18px; fill: none; stroke: #8f8466; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.ld-icon .bell rect { fill: #8f8466; stroke: none; }
.ld-icon .bell { animation: lift 1.4s ease-in-out infinite; transform-origin: 32px 35px; }
@keyframes lift { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
.loading h1 { margin: 0; font-size: 26px; font-weight: 800; letter-spacing: 0.24em; color: #4b4436; padding-left: 0.24em; }
.loading p { margin: 14px 0 0; font-size: 13px; color: var(--muted); letter-spacing: 0.02em; }
.loading p::after { content: ''; display: inline-block; width: 1.2em; text-align: left; animation: dots 1.4s steps(4) infinite; }
@keyframes dots { 0% { content: ''; } 25% { content: '.'; } 50% { content: '..'; } 75% { content: '...'; } }
.ld-bar { width: 120px; height: 2px; margin-top: 22px; border-radius: 2px; background: rgba(110, 90, 60, 0.12); overflow: hidden; }
.ld-bar i { display: block; height: 100%; width: 0; background: #b3a27a; transition: width 0.3s ease; }

/* ---------- 입장 화면 ---------- */
.entry { position: fixed; inset: 0; z-index: 40; display: flex; align-items: center; justify-content: center; padding: 16px;
  background: linear-gradient(180deg, rgba(240, 236, 228, 0.25), rgba(60, 50, 35, 0.35)); overflow-y: auto; }
.entry-card { width: min(420px, 100%); padding: 22px 22px 18px; border-radius: 22px; background: rgba(250, 247, 240, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.8); box-shadow: 0 20px 60px rgba(40, 30, 20, 0.3); backdrop-filter: blur(12px); }
.entry-badge { display: inline-block; padding: 4px 10px; border-radius: 99px; background: #e9e1cf; color: #6a5d43; font-size: 12px; font-weight: 600; }
.entry h2 { margin: 10px 0 4px; font-size: 22px; font-weight: 800; }
.entry .sub { margin: 0 0 14px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.nick { display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 700; color: var(--muted); }
.nick input { padding: 11px 12px; border-radius: 12px; border: 1px solid var(--line); background: #fff; font: inherit; font-size: 15px; color: var(--ink); outline: none; }
.nick input:focus { border-color: var(--green); }
.nick .nickRow { display: flex; gap: 6px; }
.nick .nickRow input { flex: 1; min-width: 0; }
#nickDice { flex: none; padding: 0 12px; border-radius: 12px; border: 1px solid var(--line); background: #fff4e2; font: inherit; font-size: 13px; font-weight: 800; color: #b4531f; cursor: pointer; }
#nickDice:active { transform: scale(0.96); }
.look { display: flex; gap: 12px; align-items: center; margin: 14px 0; }
#lookPreview { width: 120px; height: 140px; border-radius: 16px; background: linear-gradient(180deg, #dbe9f1, #efe7d6); flex: none; }
.lookOpts { display: flex; flex-direction: column; gap: 10px; flex: 1; min-width: 0; }
.row { display: flex; flex-direction: column; gap: 5px; }
.row > span { font-size: 12px; font-weight: 700; color: var(--muted); }
.seg { display: flex; gap: 4px; }
.seg button { flex: 1; padding: 7px 0; border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--ink); font-size: 13px; font-weight: 600; cursor: pointer; }
.seg button.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.sw { display: flex; gap: 6px; flex-wrap: wrap; }
.sw button { width: 24px; height: 24px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); cursor: pointer; padding: 0; }
.sw button.on { box-shadow: 0 0 0 2px var(--ink); }
.enterBtn { width: 100%; padding: 14px; border: 0; border-radius: 14px; background: var(--green); color: #fff; font-size: 16px; font-weight: 800; cursor: pointer; }
.enterBtn:hover { filter: brightness(1.07); }

/* ---------- 서버 ---------- */
.svTitle { margin: 2px 0 8px; font-size: 12px; font-weight: 700; color: var(--muted); }
.svTitle small { font-weight: 500; margin-left: 4px; }
.servers { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-bottom: 14px; }
.servers button { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 7px 0; border-radius: 10px; border: 1px solid var(--line);
  background: #fff; color: var(--ink); font-size: 13px; font-weight: 800; cursor: pointer; }
.servers button small { font-size: 10px; font-weight: 600; color: var(--muted); }
.servers button.on { background: var(--green); border-color: var(--green); color: #fff; }
.servers button.on small { color: #e3f0dd; }
.servers button.full { opacity: 0.45; }
.room { border: 0; padding: 3px 9px; border-radius: 99px; background: rgba(110, 90, 60, 0.1); color: var(--ink); font-size: 12.5px; font-weight: 700; cursor: pointer; }
.room:hover { background: rgba(110, 90, 60, 0.18); }
.cnt { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.serverPop { width: 300px; padding: 12px 12px 0; border-radius: 14px; background: rgba(250, 247, 240, 0.97); border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(40, 30, 20, 0.2); }
.spTitle { font-size: 13px; font-weight: 800; margin-bottom: 8px; }
.spTitle small { font-weight: 500; color: var(--muted); margin-left: 4px; }

/* ---------- HUD ---------- */
.hud { position: fixed; z-index: 10; display: flex; gap: 8px; }
.tl { top: 16px; left: 16px; flex-direction: column; align-items: flex-start; }
.tr { top: 16px; right: 16px; flex-wrap: wrap; justify-content: flex-end; max-width: calc(100vw - 32px); }
.brand { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 14px; background: var(--glass); border: 1px solid var(--line);
  backdrop-filter: blur(10px); font-size: 14px; }
.brand .logo { color: var(--green); }
.alt { display: flex; align-items: baseline; gap: 3px; padding: 8px 14px; border-radius: 14px; background: var(--glass); border: 1px solid var(--line); backdrop-filter: blur(10px); }
.alt b { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.alt small { font-size: 11px; color: var(--muted); }
.alt .where { margin-left: 8px; font-size: 12px; font-weight: 600; color: var(--green); }
.pill { display: inline-flex; align-items: center; padding: 8px 13px; border-radius: 12px; border: 1px solid var(--line); background: var(--glass);
  backdrop-filter: blur(10px); color: var(--ink); text-decoration: none; font-size: 12.5px; font-weight: 700; cursor: pointer; }
.pill.dark { background: #2a241c; color: #fff; border-color: transparent; }
.pill.green { background: var(--green); color: #fff; border-color: transparent; }

.workout { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 11; display: flex; align-items: center; gap: 12px;
  padding: 8px 8px 8px 16px; border-radius: 16px; background: rgba(42, 36, 28, 0.88); color: #fff; font-size: 14px; font-weight: 700; }
.workout b { font-variant-numeric: tabular-nums; font-size: 16px; }
.workout .reps { color: #f3c96b; }
.workout button { border: 0; border-radius: 10px; padding: 7px 12px; background: rgba(255, 255, 255, 0.16); color: #fff; font-weight: 700; cursor: pointer; }

.help { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 10; padding: 10px 40px 10px 16px; border-radius: 14px;
  background: var(--glass); border: 1px solid var(--line); backdrop-filter: blur(10px); font-size: 12.5px; color: #5a4f3e; white-space: nowrap; }
.help .x { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 14px; }

.toast { position: fixed; left: 50%; top: 22%; transform: translate(-50%, -8px); z-index: 12; padding: 12px 20px; border-radius: 14px;
  background: rgba(42, 36, 28, 0.86); color: #fff; font-size: 15px; font-weight: 700; text-align: center; line-height: 1.5;
  opacity: 0; pointer-events: none; transition: opacity 0.35s, transform 0.35s; max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast small { display: block; font-size: 12px; font-weight: 500; color: #e8dcc4; }

/* ---------- 3D 위 라벨 ---------- */
/* 이름표 = 작은 어두운 알약 · 말풍선 = 흰 바탕 + 검은 테두리 + 아래 꼬리 (한눈에 구분) */
.nameTag { padding: 2px 8px; border-radius: 6px; background: rgba(28, 24, 20, 0.72); color: #fff; font-size: 11px; font-weight: 700;
  white-space: nowrap; transform: translateY(-4px); letter-spacing: -0.01em; }
.nameTag.me { background: var(--orange); color: #fff; border: 2px solid #fff; }
.nameTag.npc { background: rgba(70, 52, 30, 0.82); color: #ffe7b0; }
.bubble { position: relative; padding: 7px 12px; border-radius: 14px; background: #fff; color: #1f1a14; font-size: 13px; font-weight: 700; white-space: nowrap;
  border: 2px solid #2a241c; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  translate: 0 calc(-50% - 22px); /* 이름표 바로 위로 띄움 (CSS2D 위치 transform 과 따로 적용돼서 안 겹침) */ animation: bubbleIn 0.25s ease-out; }
@keyframes bubbleIn { from { opacity: 0; } to { opacity: 1; } } /* (transform 애니메이션 금지 — 3D 라벨 위치가 깨짐) */
.bubble::after { content: ""; position: absolute; left: 50%; bottom: -9px; margin-left: -7px; border: 7px solid transparent; border-top-color: #2a241c; border-bottom: 0; }
@keyframes pop { from { transform: scale(0.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.signTag { padding: 4px 10px; border-radius: 8px; background: rgba(60, 45, 28, 0.85); color: #fff3d6; font-size: 12px; font-weight: 700; white-space: nowrap; }
.useTag { padding: 3px 8px; border-radius: 8px; background: rgba(79, 125, 74, 0.92); color: #fff; font-size: 11px; font-weight: 700; white-space: nowrap; opacity: 0; transition: opacity 0.2s; }
.useTag.show { opacity: 1; }

@media (max-width: 640px) {
  .help { display: none; }
  .serverPop { width: calc(100vw - 32px); }
  .tr .pill:not(.green):not(.dark) { display: none; } /* NS 홈페이지 버튼은 휴대폰에서도 보이게 (2026-11-06) */
  .workout { top: auto; bottom: 18px; }
}

/* ---------- 알림판 ---------- */
.noticePanel { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 30; width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 40px); overflow-y: auto;
  padding: 16px; border-radius: 18px; background: #a77d52; border: 6px solid #6b4a2e; box-shadow: 0 20px 60px rgba(40, 30, 20, 0.45); }
.npHead { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; color: #fff3d6; font-size: 18px; font-weight: 900; }
.npHead .x { border: 0; background: rgba(0, 0, 0, 0.2); color: #fff; width: 30px; height: 30px; border-radius: 50%; cursor: pointer; font-size: 14px; }
.npList { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.npCard { display: flex; flex-direction: column; gap: 4px; padding: 12px; border-radius: 4px; box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25); color: #333; font-size: 12.5px; }
.npCard:nth-child(odd) { transform: rotate(-1deg); }
.npCard:nth-child(even) { transform: rotate(1.2deg); }
.npCard b { font-size: 15px; }

/* ---------- 스쿼트 대결 ---------- */
.duel { position: fixed; left: 50%; bottom: 70px; transform: translateX(-50%); z-index: 15; display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 14px 20px; border-radius: 20px; background: rgba(42, 36, 28, 0.9); color: #fff; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3); min-width: 260px; }
.dTitle { font-size: 13px; font-weight: 700; color: #f3c96b; }
.dTitle span { margin-left: 6px; color: #fff; font-variant-numeric: tabular-nums; }
.dScore { display: flex; align-items: center; gap: 14px; font-size: 14px; }
.dScore b { font-size: 30px; font-weight: 900; font-variant-numeric: tabular-nums; }
.dScore i { font-style: normal; font-size: 22px; opacity: 0.6; }
.dBtn { width: 100%; padding: 14px; border: 0; border-radius: 14px; background: #d9772f; color: #fff; font-size: 20px; font-weight: 900; cursor: pointer; user-select: none; touch-action: manipulation; }
.dBtn:active { transform: scale(0.96); }
.dBtn small { font-size: 11px; opacity: 0.75; margin-left: 4px; }

/* ---------- NS 프로틴 시음회 팝업 ---------- */
.tastePanel { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 30; width: min(620px, calc(100vw - 32px)); max-height: calc(100vh - 40px); overflow-y: auto;
  padding: 16px; border-radius: 20px; background: #fbf8f0; border: 1px solid var(--line); box-shadow: 0 20px 60px rgba(40, 30, 20, 0.4); }
.tpHead { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 12px; padding: 12px 14px; border-radius: 14px; background: #2f6b3c; color: #fff; }
.tpHead b { display: block; font-size: 18px; font-weight: 900; color: #f2d75e; }
.tpHead small { font-size: 12px; color: #e3f0dd; }
.tpHead .x { border: 0; background: rgba(0, 0, 0, 0.2); color: #fff; width: 30px; height: 30px; border-radius: 50%; cursor: pointer; flex: none; }
.tpGrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.tpItem { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 6px; border-radius: 14px; border: 2px solid transparent; background: #fff;
  box-shadow: 0 2px 8px rgba(40, 30, 20, 0.08); cursor: pointer; font: inherit; font-size: 11.5px; font-weight: 600; color: var(--ink); line-height: 1.3; }
.tpItem img { width: 70px; height: 70px; object-fit: contain; }
.tpItem:hover { border-color: rgba(47, 107, 60, 0.35); }
.tpItem.on { border-color: #2f6b3c; background: #eef5ea; }
.tpDetail { display: flex; gap: 14px; align-items: center; margin-top: 12px; padding: 14px; border-radius: 16px; background: #fff; border: 2px solid #2f6b3c; }
.tpDetail img { width: 110px; height: 110px; object-fit: contain; flex: none; }
.tpInfo { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.tpInfo .deal { align-self: flex-start; padding: 2px 8px; border-radius: 99px; background: #d9772f; color: #fff; font-size: 11px; font-weight: 800; }
.tpInfo b { font-size: 15px; }
.tpInfo strong { font-size: 18px; color: #c0392b; }
.tpBtns { display: flex; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.tpBtns button { flex: 1; min-width: 120px; padding: 12px; border: 0; border-radius: 12px; font: inherit; font-size: 14px; font-weight: 800; cursor: pointer; }
.tpDrink { background: #2f6b3c; color: #fff; }
.tpBuy { background: #2a241c; color: #fff; }
@media (max-width: 480px) { .tpDetail { flex-direction: column; text-align: center; } .tpInfo .deal { align-self: center; } }

/* ---------- 약수터 게이지 · 터짐 ---------- */
.energy { flex-basis: 100%; display: flex; flex-direction: column; gap: 3px; align-self: flex-end; width: 168px; max-width: 168px; margin-left: auto; padding: 6px 9px; border-radius: 11px;
  background: var(--glass); border: 1px solid var(--line); backdrop-filter: blur(10px); }
.energy-top { display: flex; justify-content: space-between; font-size: 12px; font-weight: 700; }
.energy-top b { font-variant-numeric: tabular-nums; color: #2a6fb0; }
.energy .bar { height: 8px; border-radius: 99px; background: rgba(110, 90, 60, 0.12); overflow: hidden; }
.energy .bar i { display: block; height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, #7fc8ee, #3f9ad8, #2f6b3c); transition: width 0.2s linear; }
.energy small { font-size: 10.5px; color: var(--muted); }
.energy.full .bar i { animation: glow 0.6s ease-in-out infinite alternate; }
@keyframes glow { to { filter: brightness(1.4); } }
.banner { position: fixed; left: 50%; top: 26%; transform: translate(-50%, -50%); z-index: 20; text-align: center; pointer-events: none;
  font-size: clamp(30px, 6vw, 56px); font-weight: 900; color: #fff; text-shadow: 0 3px 0 #2a6fb0, 0 0 24px rgba(63, 154, 216, 0.9); line-height: 1.2; }
.banner span { font-size: clamp(14px, 2.4vw, 20px); font-weight: 700; text-shadow: 0 2px 6px rgba(0, 0, 0, 0.5); }
.banner.go { animation: burst 0.6s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes burst { from { transform: translate(-50%, -50%) scale(0.3); opacity: 0; } to { transform: translate(-50%, -50%) scale(1); opacity: 1; } }
.prodPanel { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 30; width: min(340px, calc(100vw - 32px)); display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 20px 18px 16px; border-radius: 20px; background: #fbf8f0; border: 2px solid #3f9ad8; box-shadow: 0 20px 60px rgba(40, 30, 20, 0.4); text-align: center; }
.prodPanel .x { position: absolute; right: 10px; top: 10px; border: 0; background: rgba(0, 0, 0, 0.08); width: 30px; height: 30px; border-radius: 50%; cursor: pointer; }
.prodPanel .ppTag { font-size: 12px; font-weight: 800; color: #2a6fb0; }
.prodPanel img { width: 150px; height: 150px; object-fit: contain; }
.prodPanel .deal { padding: 2px 8px; border-radius: 99px; background: #d9772f; color: #fff; font-size: 11px; font-weight: 800; }
.prodPanel b { font-size: 15px; }
.prodPanel strong { font-size: 18px; color: #c0392b; }
.prodPanel .tpBtns { width: 100%; }
/* 이름표 구분 (2026-11-05): 색만 다르게 — 나 = 주황 · 접속자(진짜 사람) = 파랑 · NPC = 흐린 갈색 (배지 없음) */
.nameTag.peer { background: #2b6fd6; color: #fff; border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35); }
.nameTag.npc { background: rgba(60, 50, 40, 0.6); color: #e9dcc2; font-weight: 600; font-size: 10px; }
.nameTag.muscle { background: #2a241c; color: #f3c96b; border-color: #d9772f; }
.nameTag.peer.muscle { background: #2b6fd6; color: #fff; border-color: #f3c96b; }
.nameTag.npc.muscle { background: rgba(60, 50, 40, 0.6); color: #f3c96b; }
@media (max-width: 640px) {
  .nameTag.peer { font-size: 12px; padding: 2px 7px; }
  .nameTag.npc { font-size: 9px; padding: 1px 6px; }
}

/* ---------- v3: 내 운동시간 게이지 · 노래 · 아래 바로가기 ---------- */
.energy.work .energy-top b#workTime { color: #b4531f; }
.energy.work .energy-top b#workLv { color: #2a241c; margin-left: 4px; font-size: 11px; padding: 1px 6px; border-radius: 6px; background: #f3c96b; }
.energy.work .bar i { background: linear-gradient(90deg, #f3c96b, #d9772f, #b4531f); }
.music { position: fixed; right: 14px; bottom: 16px; z-index: 11; display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 12px; border-radius: 14px;
  max-width: min(360px, calc(100vw - 32px)); background: rgba(255, 252, 245, 0.92); box-shadow: 0 6px 18px rgba(40, 30, 20, 0.18); font-size: 12px; font-weight: 700; }
.music.hidden { display: none; }
.music .track { color: #8a7a64; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.music.playing .track { color: #2a241c; }
.mbtn { border: 0; border-radius: 10px; padding: 6px 11px; background: #3f8f4f; color: #fff; font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.mbtn.next { background: rgba(80, 60, 40, 0.1); color: #2a241c; padding: 6px 8px; }
.music .eq { display: inline-flex; gap: 2px; align-items: flex-end; height: 14px; }
.music .eq i { width: 3px; height: 4px; border-radius: 2px; background: #3f8f4f; }
.music.playing .eq i { animation: eqv 0.9s ease-in-out infinite alternate; }
.music.playing .eq i:nth-child(2) { animation-delay: -0.3s; } .music.playing .eq i:nth-child(3) { animation-delay: -0.6s; }
@keyframes eqv { from { height: 3px; } to { height: 14px; } }
.mtoggle { display: none; width: 30px; height: 30px; border: 0; border-radius: 10px; background: #3f8f4f; color: #fff; font-size: 15px; cursor: pointer; }
.yt { position: fixed; right: 14px; bottom: 64px; z-index: 11; width: 200px; height: 113px; border-radius: 10px; overflow: hidden; opacity: 0.01; pointer-events: none; }
.yt.tapme { opacity: 1; pointer-events: auto; box-shadow: 0 0 0 3px #d9772f; }
.yt.hidden { display: none; }
.actionBar { position: fixed; left: 50%; bottom: 62px; transform: translateX(-50%); z-index: 11; display: flex; gap: 8px; }
.actionBar.hidden { display: none; }
.actionBar button { border: 0; border-radius: 14px; padding: 10px 14px; background: rgba(36, 30, 24, 0.88); color: #fff3d6; font: inherit; font-size: 13px; font-weight: 800; cursor: pointer;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25); white-space: nowrap; }
.actionBar button:hover { background: rgba(60, 48, 36, 0.92); }
.actionBar button.on { background: #d9772f; color: #fff; }
.actionBar button:disabled { opacity: 0.5; cursor: default; }
@media (max-width: 640px) {
  .actionBar { bottom: 10px; gap: 5px; width: calc(100vw - 20px); justify-content: center; }
  .actionBar button { padding: 9px 8px; font-size: 11.5px; flex: 1; }
  .workout { bottom: 64px !important; }
  .mtoggle { display: inline-grid; place-items: center; }
  .music { bottom: auto; top: 150px; right: 10px; padding: 4px; gap: 6px; }
  .music .track { max-width: 118px; font-size: 11px; }
  .music.collapsed .track, .music.collapsed .mbtn, .music.collapsed .eq { display: none; }
  .yt { top: 190px; bottom: auto; right: 10px; }
}

/* 게이지 창 작게 (설명 줄 숨김) */
.energy small { display: none; }
.energy-top { font-size: 11px !important; }
.energy .bar { height: 6px !important; }
.energy.work .energy-top b#workLv { font-size: 10px; padding: 0 4px; }

/* 휴대폰 세로 화면: 위쪽 HUD 가 겹치지 않게 (오른쪽 묶음은 왼쪽 HUD 아래로) */
@media (max-width: 640px) {
  .tr { top: 92px !important; right: 10px !important; gap: 5px; max-width: 180px !important; }
  .tr > a.pill.dark { padding: 5px 10px; font-size: 11px; white-space: nowrap; }
  .tr #skipBtn { padding: 5px 10px; font-size: 11px; }
  .energy { width: 150px !important; max-width: 150px !important; padding: 5px 8px !important; }
  .music { top: 210px !important; }
  .yt { top: 250px !important; }
}
@media (max-width: 640px) { .energy.work .energy-top b#workLv { display: none; } .energy-top { white-space: nowrap; } }
@media (max-width: 640px) { .workout { gap: 8px; padding: 8px 10px; max-width: calc(100vw - 24px); } .workout span, .workout b, .workout button { white-space: nowrap; } .workout #workoutName { max-width: 46vw; overflow: hidden; text-overflow: ellipsis; } }
@media (max-width: 640px) { #springArrow { white-space: normal !important; text-align: center; font-size: 11px !important; max-width: calc(100vw - 30px); top: 74px !important; } }

/* 접속자에게 이모티콘 보내기 */
#emoPicker { position: fixed; left: 50%; bottom: 120px; transform: translateX(-50%); z-index: 30; width: min(320px, 92vw); padding: 10px 12px 12px; border-radius: 16px;
  background: rgba(255, 250, 240, 0.97); box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3); font-family: inherit; }
#emoPicker.hidden { display: none; }
#emoPicker .epHead { display: flex; align-items: center; justify-content: space-between; font-size: 13px; color: #2a241c; margin-bottom: 8px; }
#emoPicker .x { border: 0; background: none; font-size: 15px; cursor: pointer; color: #6b5a44; }
#emoPicker .epGrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
#emoPicker .epGrid button { border: 0; border-radius: 12px; background: #efe6d2; font-size: 26px; padding: 6px 0; cursor: pointer; }
#emoPicker .epGrid button:hover { background: #f3c96b; }
/* 머리 위에 뜨는 이모티콘 (바깥 div 는 3D 위치용이라 애니메이션은 안쪽에만) */
.emoFloat { pointer-events: none; translate: 0 calc(-50% - 46px); display: flex; flex-direction: column; align-items: center; }
.emoFloat span { font-size: 34px; line-height: 1; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.35)); animation: emoUp 2.4s ease-out forwards; }
.emoFloat small { font-size: 10px; font-weight: 800; color: #fff; background: rgba(28, 24, 20, 0.7); padding: 1px 6px; border-radius: 6px; animation: emoFade 2.4s ease-out forwards; }
@keyframes emoUp { 0% { transform: translateY(14px) scale(0.4); opacity: 0; } 15% { transform: translateY(0) scale(1.25); opacity: 1; } 30% { transform: scale(1); } 80% { opacity: 1; } 100% { transform: translateY(-26px); opacity: 0; } }
@keyframes emoFade { 0%, 80% { opacity: 1; } 100% { opacity: 0; } }
/* 서버별 접속자 목록 */
.svPeople { margin-top: 10px; max-height: 190px; overflow: auto; font-size: 12px; text-align: left; }
.svPeople .svHead { font-weight: 800; color: #6b5a44; margin-bottom: 6px; }
.svPeople .svRow { display: flex; gap: 8px; padding: 5px 6px; border-radius: 8px; align-items: baseline; }
.svPeople .svRow.cur { background: rgba(63, 143, 79, 0.12); }
.svPeople .svRow b { flex: none; width: 34px; color: #2f6b3c; }
.svPeople .svRow div { display: flex; flex-wrap: wrap; gap: 4px; }
.svPeople .svRow span { padding: 1px 7px; border-radius: 99px; background: rgba(110, 90, 60, 0.12); color: #2a241c; font-weight: 700; }
.svPeople .svRow span.me { background: #d9772f; color: #fff; }
.svPeople .svRow em { font-style: normal; color: #8a7a64; }
.svPeople .svEmpty { color: #8a7a64; }

/* 서버 바꾸기 창: 한 줄에 한 서버 (번호 · 인원 · 접속자 이름) */
#serverGrid2 { grid-template-columns: 1fr; gap: 4px; max-height: 60vh; overflow: auto; }
#serverGrid2 button { flex-direction: row; justify-content: flex-start; align-items: baseline; gap: 8px; padding: 7px 10px; text-align: left; }
#serverGrid2 button small { flex: none; }
#serverGrid2 .svNames { flex: 1; min-width: 0; font-size: 11px; font-weight: 600; color: #2a241c; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#serverGrid2 .svNames.empty { color: var(--muted); font-weight: 500; }
#serverGrid2 button.on .svNames { color: #fff; }

/* 서버 접속자 목록 창 */
#svMembers { position: fixed; inset: 0; z-index: 35; display: flex; align-items: center; justify-content: center; background: rgba(20, 16, 12, 0.35); font-family: inherit; }
#svMembers.hidden { display: none; }
#svMembers .smCard { width: min(320px, 90vw); max-height: 70vh; display: flex; flex-direction: column; padding: 14px; border-radius: 16px; background: #fffaf0; box-shadow: 0 16px 40px rgba(0, 0, 0, 0.3); }
#svMembers .smHead { display: flex; justify-content: space-between; align-items: center; font-size: 15px; color: #2a241c; margin-bottom: 10px; }
#svMembers .x { border: 0; background: none; font-size: 16px; cursor: pointer; color: #6b5a44; }
#svMembers .smList { list-style: none; margin: 0 0 12px; padding: 0; overflow: auto; }
#svMembers .smList li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; font-size: 14px; font-weight: 700; color: #2a241c; }
#svMembers .smList li:nth-child(odd) { background: rgba(110, 90, 60, 0.07); }
#svMembers .smList li span { width: 22px; height: 22px; border-radius: 99px; display: grid; place-items: center; background: #efe6d2; font-size: 11px; color: #6b5a44; }
#svMembers .smList li.me { background: rgba(217, 119, 47, 0.15); color: #b4531f; }
#svMembers .smList li.empty { color: #8a7a64; font-weight: 500; }
#svMembers .smGo { border: 0; border-radius: 12px; padding: 11px; background: #3f8f4f; color: #fff; font: inherit; font-weight: 800; font-size: 14px; cursor: pointer; }

/* 레벨 창 누르면 레벨 설명 팝업 */
#workBox { cursor: pointer; pointer-events: auto; }
#workBox:active { transform: scale(0.97); }
#workBox .energy-top span::after { content: ' ⓘ'; color: #d9772f; font-weight: 900; }
/* 휴대폰: "내 운동시간" 글자 대신 레벨 이름(Lv1 헬린이)을 보여 줌 */
@media (max-width: 640px) {
  .energy.work .energy-top span { font-size: 0; }
  .energy.work .energy-top b#workLv { display: inline-block !important; font-size: 10px; margin-left: 0; }
  #workBox .energy-top span::after { font-size: 10px; }
}
/* 입장 화면: 머리 · 상의 · 하의 종류 고르기 (색 대신) */
.chips { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px; }
.chips button { padding: 6px 4px; border-radius: 9px; border: 1px solid var(--line); background: #fff; font: inherit; font-size: 12px; font-weight: 800; color: var(--ink); cursor: pointer; white-space: nowrap; }
.chips button.on { background: #2b241c; color: #fff; border-color: #2b241c; }
@media (max-width: 640px) { .chips button { font-size: 11px; padding: 5px 2px; } }
/* 닉네임 중복 안내 */
#nickMsg { display: none; color: #c0392b; font-size: 12px; font-weight: 800; margin-top: 2px; }
/* 스토어 창 (게임 위 · 위쪽 [게임으로 돌아가기]) */
#storeView { position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; background: #fff; }
#storeView.hidden { display: none; }
#storeView .svBar { flex: none; display: flex; align-items: center; gap: 8px; padding: 8px 10px; padding-top: max(8px, env(safe-area-inset-top)); background: #2a241c; color: #fff3d6; }
#storeView .svBack { flex: none; border: 0; border-radius: 10px; padding: 9px 14px; background: #3f8f4f; color: #fff; font: inherit; font-size: 14px; font-weight: 800; cursor: pointer; }
#storeView b { flex: 1; min-width: 0; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#storeView .svNew { flex: none; color: #f3c96b; font-size: 12px; font-weight: 700; text-decoration: none; }
#storeView iframe { flex: 1; width: 100%; border: 0; }
/* 휴대폰: 서버 · 해발 창 작게, PT 중엔 알림을 아래로 (PT 창과 안 겹치게) */
@media (max-width: 640px) {
  .hud.tl { top: 10px; left: 10px; gap: 5px; }
  .brand { padding: 5px 9px; gap: 5px; font-size: 12px; border-radius: 11px; }
  .room { font-size: 11px; padding: 2px 7px; }
  .cnt { font-size: 10.5px; }
  .alt { padding: 4px 9px; border-radius: 11px; }
  .alt b { font-size: 16px; }
  .alt small { font-size: 10px; }
  .alt .where { font-size: 11px; margin-left: 5px; }
  .tr { top: 76px !important; }
  body.ptOn .toast { top: auto; bottom: 118px; max-width: calc(100vw - 32px); }
  #storeView .svBack { padding: 8px 12px; font-size: 13px; }
}
/* 닉네임 중복확인 버튼 */
#nickCheck { flex: none; padding: 0 11px; border-radius: 12px; border: 0; background: #2b241c; font: inherit; font-size: 13px; font-weight: 800; color: #fff; cursor: pointer; white-space: nowrap; }
#nickCheck:active { transform: scale(0.96); }
#nickCheck[data-busy] { opacity: 0.6; }
#nickMsg.ok { color: #2f8a3e; }
@media (max-width: 640px) { #nickCheck, #nickDice { padding: 0 8px; font-size: 12px; } }

/* 2026-11-06 사용자: 해발 · 등산로 표시와 약수터 게이지 삭제 */
.alt, #energyBox { display: none !important; }
/* 2026-11-06 사용자: 약수터 게이지는 운동할 때만 화면 위 가운데 팝업 (다 차면 안 나옴) */
#energyBox.pop { display: flex !important; position: fixed; top: 64px; left: 0; right: 0; margin: 0 auto; width: 240px !important; max-width: calc(100vw - 32px) !important; z-index: 12; animation: pop 0.25s ease-out; box-shadow: 0 8px 24px rgba(40, 30, 20, 0.25); }
#energyBox.pop small { display: block; margin-top: 4px; font-size: 11px; }
#energyBox.pop .bar { height: 9px !important; }
@media (max-width: 640px) { #energyBox.pop { top: 120px; width: 210px !important; } }
/* 2026-11-06 사용자: 휴대폰 — 홈페이지 · 입구 · 레벨 · 음악 버튼을 오른쪽 맨 위로 */
@media (max-width: 640px) {
  .tr { top: 10px !important; right: 8px !important; max-width: 138px !important; gap: 4px; }
  .tr > a.pill.dark, .tr #skipBtn { padding: 4px 8px; font-size: 10.5px; }
  .tr .energy { width: 138px !important; max-width: 138px !important; }
  .music { top: 76px !important; right: 8px !important; } /* 2026-11-06 사용자: 음악 버튼 조금 더 위로 (오른쪽 버튼 묶음 바로 밑) */
  .yt { top: 116px !important; }
}
/* 좁은 휴대폰(360px 등): 왼쪽 서버 표시와 오른쪽 버튼이 안 겹치게 조금 더 작게 */
@media (max-width: 380px) {
  .brand { padding: 4px 7px !important; gap: 4px !important; font-size: 11px !important; }
  .room { font-size: 10px !important; padding: 2px 5px !important; }
  .cnt { font-size: 9.5px !important; }
  .tr { max-width: 118px !important; }
  .tr .energy { width: 118px !important; max-width: 118px !important; }
  .tr > a.pill.dark, .tr #skipBtn { padding: 4px 6px; font-size: 10px; }
}
