/* 솔루나 2 (3D) — 화면 꾸미기 */
:root {
  --sol: #ffd257; --sol-deep: #f0961e;
  --luna: #b3c0ff; --luna-deep: #6570e6;
  --ink: #f4f2ff; --dim: rgba(244, 242, 255, 0.66);
  --panel: rgba(14, 16, 48, 0.86); --line: rgba(255, 255, 255, 0.14);
  --accent: #7cf0ff;
  --display: 'Jua', 'Pretendard', 'Apple SD Gothic Neo', 'Malgun Gothic', system-ui, sans-serif;
  --body: 'Pretendard', 'Apple SD Gothic Neo', 'Malgun Gothic', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #070820; color: var(--ink); font-family: var(--body);
  touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
#view { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
.hidden { display: none !important; }
.sol { color: var(--sol); }
.luna { color: var(--luna); }
button { font-family: inherit; }

/* 아이콘 (선 그림, f = 채움) */
.ic { width: 1.15em; height: 1.15em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -0.2em; flex: none; }
.ic .f { fill: currentColor; stroke: none; }
kbd { display: inline-block; min-width: 1.7em; padding: 1px 5px; margin: 0 1px; border-radius: 6px; font: 700 11px/1.5 var(--body); text-align: center;
  background: rgba(255, 255, 255, 0.12); border: 1px solid rgba(255, 255, 255, 0.22); border-bottom-width: 2px; color: var(--ink); }

/* ── 게임 중 글자 ── */
#hud { position: fixed; top: 12px; left: 50%; transform: translateX(-50%); z-index: 6; display: flex; align-items: center; gap: 6px;
  padding: 5px 6px 5px 6px; border-radius: 18px; background: rgba(10, 12, 40, 0.62); border: 1px solid var(--line);
  backdrop-filter: blur(8px); white-space: nowrap; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3); }
.hud-stage { display: flex; align-items: center; gap: 8px; padding: 4px 12px 4px 6px; font-weight: 800; font-size: 15px; }
.hud-stage b { font: 400 15px var(--display); padding: 3.5px 9px 0.5px; /* Jua 숫자는 글자 칸 위쪽에 붙어 있어 아래 여백을 줄여 가운데로 */ border-radius: 10px; background: linear-gradient(135deg, var(--sol), var(--luna)); color: #1a1638; }
.hud-gems { display: flex; gap: 6px; }
.gem { display: flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 12px; background: rgba(255, 255, 255, 0.06); font-weight: 800; font-size: 15px; }
.gem .gi { display: inline-flex; font-size: 16px; }
.gem.sol { color: var(--sol); } .gem.luna { color: var(--luna); }
.gem b { color: var(--ink); font-variant-numeric: tabular-nums; }
.pips { display: inline-flex; gap: 3px; }
.pips i { width: 7px; height: 7px; border-radius: 50%; background: rgba(255, 255, 255, 0.18); }
.pips i.on { background: currentColor; box-shadow: 0 0 6px currentColor; }
.gem.done { background: rgba(255, 255, 255, 0.14); }
.hud-time { display: flex; align-items: center; gap: 6px; padding: 4px 10px; font-weight: 700; font-size: 15px; color: var(--dim); font-variant-numeric: tabular-nums; }
.hud-pause { width: 34px; height: 34px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.08); color: var(--ink);
  display: grid; place-items: center; cursor: pointer; font-size: 15px; }
.hud-pause:hover { background: rgba(255, 255, 255, 0.18); }
body.touch .hud-pause { display: none; }

#hint { position: fixed; top: 70px; left: 50%; transform: translate(-50%, -8px); z-index: 6; max-width: min(640px, calc(100% - 32px));
  padding: 10px 18px; border-radius: 14px; background: rgba(10, 12, 40, 0.72); border: 1px solid var(--line); backdrop-filter: blur(6px);
  font-size: 14px; line-height: 1.5; text-align: center; opacity: 0; transition: opacity .4s, transform .4s; pointer-events: none; }
#hint.show { opacity: 1; transform: translate(-50%, 0); }
#toast { position: fixed; top: 40%; left: 50%; transform: translate(-50%, -50%) scale(.94); z-index: 40; padding: 11px 20px; border-radius: 14px;
  background: rgba(40, 12, 50, 0.85); border: 1px solid rgba(255, 140, 200, 0.35); font-weight: 800; opacity: 0; transition: opacity .25s, transform .25s; pointer-events: none; }
#toast.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
#help { position: fixed; bottom: 12px; left: 50%; transform: translateX(-50%); z-index: 6; display: flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: 14px; background: rgba(10, 12, 40, 0.55); border: 1px solid var(--line); font-size: 12px; white-space: nowrap; color: var(--dim); }
#help .sol, #help .luna { font-weight: 800; }
#help .sep { width: 1px; height: 14px; background: var(--line); margin: 0 6px; }
#viewMode.on kbd { background: rgba(124, 240, 255, 0.3); border-color: var(--accent); }

/* 스테이지 시작 카드 */
#intro { position: fixed; left: 50%; top: 38%; transform: translate(-50%, -50%); z-index: 8; text-align: center; pointer-events: none;
  animation: introAnim 2.6s ease forwards; text-shadow: 0 4px 20px rgba(0, 0, 0, 0.6); }
@keyframes introAnim { 0% { opacity: 0; transform: translate(-50%, -40%) scale(.92); } 14% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  78% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 100% { opacity: 0; transform: translate(-50%, -58%) scale(1.02); } }
.i-world { font-weight: 800; font-size: 13px; letter-spacing: 0.25em; color: var(--accent); }
.i-num { font: 400 64px/1 var(--display); margin-top: 6px; background: linear-gradient(135deg, var(--sol), var(--luna)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.i-name { font: 400 34px/1.2 var(--display); margin-top: 2px; }
.i-tag { display: inline-block; margin-top: 10px; font-size: 12px; font-weight: 800; padding: 3px 10px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, 0.35); color: var(--dim); }

/* ── 겹쳐 뜨는 화면 공통 ── */
.screen { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 14px;
  background: rgba(5, 6, 22, 0.55); backdrop-filter: blur(4px); animation: fadein .2s ease-out; overflow: auto; }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
.panel { position: relative; padding: 24px 26px; border-radius: 26px; background: var(--panel); border: 1px solid var(--line);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.08); text-align: center; width: min(400px, 100%);
  animation: pop .25s cubic-bezier(.2, 1.4, .4, 1); }
.panel.wide { width: min(620px, 100%); }
@keyframes pop { from { transform: scale(.94); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.panel h2 { margin: 2px 0 14px; font: 400 26px var(--display); display: flex; align-items: center; justify-content: center; gap: 8px; }
.menu-list { display: grid; gap: 9px; }
.hrow { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }

/* 큰 단추: 두께가 있는 입체 단추. 아래쪽 그림자 띠가 단추의 옆면, 누르면 쑥 들어간다 */
.hbtn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; padding: 13px 18px; border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.24); color: var(--ink); font-size: 16px; font-weight: 800;
  background: linear-gradient(180deg, rgba(120, 128, 220, 0.34) 0%, rgba(52, 56, 130, 0.5) 55%, rgba(34, 36, 96, 0.62) 100%);
  box-shadow: 0 5px 0 #121436, 0 12px 20px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.35), inset 0 -2px 0 rgba(0, 0, 0, 0.2);
  cursor: pointer; touch-action: manipulation; transition: transform .1s, box-shadow .1s, filter .12s; position: relative; transform: translateY(0); }
.hbtn:hover { transform: translateY(-2px); filter: brightness(1.12);
  box-shadow: 0 7px 0 #121436, 0 16px 26px rgba(0, 0, 0, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.4), inset 0 -2px 0 rgba(0, 0, 0, 0.2); }
.hbtn:active { transform: translateY(4px); box-shadow: 0 1px 0 #121436, 0 4px 8px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.25), inset 0 2px 6px rgba(0, 0, 0, 0.25); }
.hbtn .lbl { font: 400 19px var(--display); letter-spacing: 0.02em; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.35); }
.hbtn .ic { filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.35)); }
.hbtn small { position: absolute; right: 16px; font-size: 12px; font-weight: 700; color: var(--dim); }
.hbtn.primary { border: 1px solid rgba(255, 255, 255, 0.55); color: #2a1c46;
  background: linear-gradient(180deg, #fff3c4 0%, #ffd863 38%, #e6c9ff 75%, #c3ccff 100%);
  box-shadow: 0 6px 0 #8a6a3c, 0 6px 0 1px rgba(60, 40, 90, 0.5), 0 16px 28px rgba(255, 200, 110, 0.28), inset 0 2px 0 rgba(255, 255, 255, 0.85), inset 0 -3px 0 rgba(120, 80, 160, 0.25); }
.hbtn.primary .lbl { text-shadow: 0 1px 0 rgba(255, 255, 255, 0.7); }
.hbtn.primary .ic { filter: none; }
.hbtn.primary small { color: rgba(42, 28, 70, 0.7); }
.hbtn.primary:hover { box-shadow: 0 8px 0 #8a6a3c, 0 8px 0 1px rgba(60, 40, 90, 0.5), 0 20px 34px rgba(255, 200, 110, 0.4), inset 0 2px 0 rgba(255, 255, 255, 0.85), inset 0 -3px 0 rgba(120, 80, 160, 0.25); }
.hbtn.primary:active { box-shadow: 0 2px 0 #8a6a3c, 0 6px 10px rgba(255, 200, 110, 0.2), inset 0 2px 6px rgba(120, 80, 40, 0.3); }
.hbtn.sm { padding: 10px 12px; font-size: 14px; }
.hbtn.sm .lbl { font-size: 16px; }
.hbtn.ghost { background: rgba(255, 255, 255, 0.04); border-color: rgba(255, 255, 255, 0.14); color: var(--dim); box-shadow: 0 4px 0 rgba(10, 12, 40, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.1); }
.hbtn.danger { border-color: rgba(255, 120, 150, 0.55); color: #ffc0d0; width: auto; background: linear-gradient(180deg, rgba(255, 110, 150, 0.28), rgba(140, 40, 80, 0.45)); box-shadow: 0 4px 0 #3a0c22, inset 0 1px 0 rgba(255, 255, 255, 0.25); }
.ibtn { width: 42px; height: 42px; border-radius: 14px; border: 1px solid rgba(255, 255, 255, 0.24); color: var(--ink);
  background: linear-gradient(180deg, rgba(120, 128, 220, 0.34), rgba(34, 36, 96, 0.62)); box-shadow: 0 4px 0 #121436, inset 0 1px 0 rgba(255, 255, 255, 0.3);
  display: grid; place-items: center; font-size: 18px; cursor: pointer; touch-action: manipulation; transition: transform .1s, box-shadow .1s; }
.ibtn:hover { transform: translateY(-1px); filter: brightness(1.15); }
.ibtn:active { transform: translateY(3px); box-shadow: 0 1px 0 #121436, inset 0 1px 0 rgba(255, 255, 255, 0.2); }
/* 입체 글자 (창 제목 등): 여러 겹 그림자로 두께를 낸다 */
.panel h2, .sel-head h2, .c-stage, .i-name, .world-banner .wt {
  text-shadow: 0 1px 0 #b9a8ff, 0 2px 0 #9d8af0, 0 3px 0 #826fd8, 0 4px 0 #6855bb, 0 5px 0 #4f3f9a, 0 8px 14px rgba(0, 0, 0, 0.55); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
#logo3d { width: 100%; height: clamp(150px, 27vh, 240px); margin: 4px 0 2px; cursor: pointer; }

/* ── 홈 ── */
#title { background: radial-gradient(ellipse 34% 40% at 20% 76%, rgba(6, 7, 26, 0.45), rgba(6, 7, 26, 0) 100%); backdrop-filter: none;
  place-items: stretch; padding: 0; animation: fadein .5s ease-out; }
.home { display: flex; flex-direction: column; justify-content: center; gap: 30px; width: min(440px, 100%); padding: 6vh 0 6vh 7vw; }
.eyebrow { font-size: 13px; font-weight: 800; letter-spacing: 0.18em; color: var(--accent); margin-bottom: 6px; text-shadow: 0 1px 2px #000, 0 0 10px rgba(0, 0, 0, 0.8); }
@keyframes bob { 0%, 100% { transform: rotate(-8deg) translateY(0); } 50% { transform: rotate(-4deg) translateY(-6px); } }
.logo-sub { margin-top: 12px; font: 400 clamp(20px, 2.4vw, 28px) var(--display); letter-spacing: 0.08em; }
.logo-sub .dot { color: var(--accent); margin: 0 4px; }
.logo-en { margin-top: 4px; font-size: 12px; font-weight: 800; letter-spacing: 0.3em; color: rgba(244, 242, 255, 0.85); text-shadow: 0 1px 2px #000, 0 0 10px rgba(0, 0, 0, 0.8); }
.home-menu { display: grid; gap: 10px; width: min(330px, 100%); }
.hlink { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 8px; color: var(--dim); font-size: 13px; font-weight: 700; text-decoration: none; }
.hlink:hover { color: var(--ink); }
.home-foot { position: fixed; right: 18px; bottom: 14px; display: flex; gap: 12px; align-items: center; font-size: 12px; color: var(--dim); }
.home-foot .tag { padding: 3px 10px; border-radius: 999px; border: 1px solid rgba(124, 240, 255, 0.55); color: #a8f6ff; font-weight: 800; }
body.title-on #hud, body.title-on #help, body.title-on #touchUI, body.title-on #ctrlBg, body.title-on #hint, body.title-on #intro { display: none !important; }

/* ── 스테이지 선택 ── */
#menu { place-items: start center; background: rgba(5, 6, 22, 0.72); }
.select { width: min(880px, 100%); padding: 10px 4px 20px; animation: pop .25s ease-out; }
.sel-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.sel-head h2 { flex: 1; min-width: 0; margin: 0; font: 400 clamp(21px, 6.4vw, 30px) var(--display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 2px 4px 7px 0; }
.total { font-weight: 800; color: var(--sol); padding: 7px 14px; border-radius: 12px; background: rgba(255, 210, 87, 0.12); border: 1px solid rgba(255, 210, 87, 0.3); }
.tabs { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; margin-bottom: 12px; }
.tab { padding: 8px 4px 7px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.05); color: var(--dim); cursor: pointer;
  display: grid; grid-template-rows: auto 1fr auto; justify-items: center; align-items: center; gap: 5px; font-weight: 800; font-size: 12px; touch-action: manipulation; }
.tab .sw { width: 100%; max-width: 64px; height: 8px; border-radius: 4px; }
.tab .tn { max-width: 100%; font-size: 12.5px; line-height: 1.2; text-align: center; word-break: keep-all; overflow-wrap: anywhere; }
.tab .tm { display: flex; align-items: center; gap: 5px; }
.tab .tno { min-width: 18px; padding: 1px 5px; border-radius: 6px; background: rgba(255, 255, 255, 0.1); font-size: 10.5px; color: var(--dim); }
.tab.on .tno { background: rgba(255, 255, 255, 0.2); color: var(--ink); }
.tab .ts { font-size: 11px; color: var(--sol); }
.tab.on { background: rgba(255, 255, 255, 0.16); color: var(--ink); border-color: rgba(255, 255, 255, 0.45); }
.world-banner { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 2px 12px; padding: 14px 18px; border-radius: 18px; margin-bottom: 12px; border: 1px solid var(--line); }
.world-banner .wn { grid-column: 1 / -1; font-weight: 800; font-size: 11px; letter-spacing: 0.2em; color: var(--accent); }
.world-banner .wt { font: 400 26px var(--display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.world-banner .wst { font-weight: 800; color: var(--sol); white-space: nowrap; }
.cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.scard { position: relative; text-align: left; padding: 8px; border-radius: 18px; border: 1px solid var(--line); background: rgba(14, 16, 48, 0.85);
  color: var(--ink); cursor: pointer; touch-action: manipulation; transition: transform .14s, border-color .14s, box-shadow .14s; }
.scard:hover { transform: translateY(-3px); border-color: rgba(255, 255, 255, 0.5); box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4); }
.scard canvas { display: block; width: 100%; aspect-ratio: 3 / 2; border-radius: 12px; }
.scard .sn { display: flex; align-items: center; gap: 8px; margin: 8px 4px 2px; }
.scard .sn b { font: 400 16px var(--display); padding: 3px 8px 0; border-radius: 8px; background: rgba(255, 255, 255, 0.12); white-space: nowrap; flex: none; }
.scard .sn { min-width: 0; }
.scard .sn span { font-weight: 800; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scard .sm { display: flex; justify-content: space-between; align-items: center; margin: 2px 4px; font-size: 12px; color: var(--dim); }
.scard .badge { position: absolute; top: 14px; left: 14px; font-size: 10px; font-weight: 900; padding: 2px 7px; border-radius: 999px; background: rgba(124, 240, 255, 0.9); color: #08203a; }
.scard.cur { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(124, 240, 255, 0.35); }
.scard.next::after { content: attr(data-next); position: absolute; top: 14px; right: 14px; font-size: 10px; font-weight: 900; padding: 2px 7px; border-radius: 999px; background: var(--sol); color: #2a1c00; }
.st { color: rgba(255, 255, 255, 0.2); letter-spacing: -1px; }
.st.on { color: var(--sol); text-shadow: 0 0 8px rgba(255, 210, 87, 0.5); }
.rule { margin: 14px 0 0; text-align: center; font-size: 12px; color: var(--dim); }
.rule .st { margin-left: 10px; }

/* ── 일시정지 ── */
.p-head { display: flex; align-items: center; justify-content: center; gap: 8px; font-weight: 800; font-size: 14px; color: var(--dim); }
.p-num { font: 400 15px var(--display); padding: 3px 9px 0; border-radius: 9px; background: linear-gradient(135deg, var(--sol), var(--luna)); color: #1a1638; }

/* ── 설정 ── */
.opt { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 2px; border-bottom: 1px solid rgba(255, 255, 255, 0.07); text-align: left; font-weight: 800; font-size: 14px; }
.seg { display: inline-flex; padding: 3px; gap: 3px; border-radius: 12px; background: rgba(0, 0, 0, 0.25); }
.seg button { font-size: 13px; font-weight: 800; color: var(--dim); background: transparent; border: 0; padding: 7px 11px; border-radius: 9px; cursor: pointer; touch-action: manipulation; }
.seg button.on { background: rgba(255, 255, 255, 0.92); color: #1a1638; }
#settings .hbtn.primary, #howto .hbtn.primary { margin-top: 16px; }

/* ── 조작법 ── */
.how { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; text-align: left; }
.hcard { padding: 12px 14px; border-radius: 16px; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); }
.hcard.sol { border-color: rgba(255, 210, 87, 0.35); } .hcard.luna { border-color: rgba(179, 192, 255, 0.4); }
.hcard .who { font: 400 20px var(--display); display: flex; align-items: center; gap: 6px; }
.hcard.sol .who { color: var(--sol); } .hcard.luna .who { color: var(--luna); }
.hcard .who small { font: 700 11px var(--body); color: var(--dim); }
.hcard p { margin: 8px 0 0; font-size: 13px; }
.touch-row { display: none; }
body.touch .touch-row { display: block; }
body.touch .key-row { display: none; }
.rules { margin: 14px 0 0; padding: 12px 14px 12px 30px; border-radius: 16px; background: rgba(0, 0, 0, 0.2); text-align: left; font-size: 13px; line-height: 1.55; }
.rules li { margin: 3px 0; }

/* ── 클리어 ── */
.clear-card { padding-top: 34px; width: min(420px, 100%); }
.ribbon { position: absolute; top: -16px; left: 50%; transform: translateX(-50%); padding: 7px 22px; border-radius: 12px; font-weight: 900; font-size: 14px; letter-spacing: 0.25em;
  color: #1a1638; background: linear-gradient(135deg, var(--sol), var(--luna)); box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35); white-space: nowrap; }
.c-stage { font: 400 24px var(--display); }
.c-stage span:first-child { color: var(--accent); }
.c-stars { font-size: 52px; line-height: 1.1; margin: 6px 0 2px; }
.c-stars .st { display: inline-block; margin: 0 2px; transform: scale(0.4); opacity: 0; animation: starIn .45s cubic-bezier(.2, 1.6, .4, 1) forwards; }
.c-stars .st:nth-child(1) { animation-delay: .25s; } .c-stars .st:nth-child(2) { animation-delay: .55s; } .c-stars .st:nth-child(3) { animation-delay: .85s; }
@keyframes starIn { to { transform: scale(1); opacity: 1; } }
.c-badge { display: inline-block; margin-bottom: 6px; padding: 3px 12px; border-radius: 999px; font-weight: 900; font-size: 13px; background: #ff7fb0; color: #2a0614; animation: pop .4s 1s both; }
.stats { display: grid; grid-template-columns: 1fr auto; gap: 7px 14px; margin: 10px 4px; padding: 12px 16px; border-radius: 16px; background: rgba(0, 0, 0, 0.22); text-align: left; font-size: 14px; }
.stats dt { color: var(--dim); font-weight: 700; display: flex; align-items: center; gap: 6px; }
.stats dd { margin: 0; font-weight: 800; font-variant-numeric: tabular-nums; text-align: right; }
.c-rule { font-size: 12px; color: var(--dim); margin: 6px 0 12px; }
.clear-card .btns { display: grid; gap: 9px; }

/* 홈 오른쪽 위: 언어·음악·전체 화면 */
.corner { position: fixed; top: max(14px, env(safe-area-inset-top)); right: 16px; z-index: 31; display: flex; gap: 8px; }
.cbtn { display: flex; align-items: center; gap: 6px; height: 38px; padding: 0 14px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, 0.24); box-shadow: 0 4px 0 #121436, inset 0 1px 0 rgba(255, 255, 255, 0.3); transition: transform .1s, box-shadow .1s;
  background: rgba(10, 12, 40, 0.6); color: var(--ink); font-weight: 800; font-size: 13px; cursor: pointer; backdrop-filter: blur(6px); touch-action: manipulation; }
.cbtn.icon { width: 38px; padding: 0; justify-content: center; font-size: 16px; }
.cbtn:hover { background: rgba(255, 255, 255, 0.16); transform: translateY(-1px); }
.cbtn:active { transform: translateY(3px); box-shadow: 0 1px 0 #121436; }
.cbtn.off { color: var(--dim); }
.install-tip { margin: 0; font-size: 12px; color: var(--dim); text-align: center; }
.credits-btn { width: auto; margin: 14px auto 0; }

/* ── 엔딩 크레딧 (1편과 같은 화면) ── */
#screen-credits { position: fixed; inset: 0; z-index: 45; background: transparent; cursor: default; } /* 뒤의 3D 게임 화면이 보이도록 (글자 캔버스가 처음엔 밤하늘로 가린다) */
body.credits-on #hud, body.credits-on #help, body.credits-on #touchUI, body.credits-on #ctrlBg, body.credits-on #hint, body.credits-on #netBadge,
body.credits-on #intro, body.credits-on #toast, body.credits-on #finale, body.credits-on .corner, body.credits-on .stick,
body.credits-on .jbtn, body.credits-on .dpad, body.credits-on .tbtn { display: none !important; }
#credits-cv { position: absolute; inset: 0; width: 100%; height: 100%; }
#cr-hint, #cr-ff { position: absolute; left: 50%; transform: translateX(-50%); margin: 0; font-size: 13px; letter-spacing: 0.08em; color: rgba(223, 229, 255, 0.75);
  opacity: 0; transition: opacity 0.6s; pointer-events: none; white-space: nowrap; }
#cr-hint { bottom: max(14px, calc(env(safe-area-inset-bottom) + 6px)); }
#cr-ff { top: max(12px, calc(env(safe-area-inset-top) + 6px)); color: #f2cf7a; font-weight: 700; }
#cr-hint.show, #cr-ff.show { opacity: 1; }
#cr-skip { position: absolute; right: max(14px, calc(env(safe-area-inset-right) + 8px)); bottom: max(10px, calc(env(safe-area-inset-bottom) + 4px));
  padding: 7px 14px; border-radius: 999px; font: inherit; font-size: 13px; font-weight: 700; letter-spacing: 0.06em;
  color: rgba(244, 246, 255, 0.8); background: rgba(20, 24, 60, 0.55); border: 1px solid rgba(242, 207, 122, 0.35); cursor: pointer; }
#cr-skip:hover { color: #fff; border-color: rgba(242, 207, 122, 0.8); }

/* ── 불러오기·화면 전환 ── */
/* 처음 불러오기 화면: 별이 반짝이는 밤하늘 + 둥실 떠 있는 솔·루나 아이콘 + 입체 글씨 로고 + 빛나는 막대 */
#loading { position: fixed; inset: 0; z-index: 60; overflow: hidden; display: grid; place-items: center; transition: opacity .5s;
  background: radial-gradient(ellipse 90% 60% at 50% 38%, #23236a 0%, #12123e 45%, #070820 80%); }
#loading.out { opacity: 0; pointer-events: none; }
.ld-stars { position: absolute; inset: -10%; pointer-events: none; background-repeat: repeat; }
.ld-stars.s1 { background-image: radial-gradient(1.4px 1.4px at 12% 18%, #fff 50%, transparent 51%), radial-gradient(1.2px 1.2px at 68% 12%, #fff 50%, transparent 51%),
  radial-gradient(1.6px 1.6px at 84% 46%, #fff3c4 50%, transparent 51%), radial-gradient(1.1px 1.1px at 32% 64%, #fff 50%, transparent 51%),
  radial-gradient(1.3px 1.3px at 52% 84%, #dfe4ff 50%, transparent 51%), radial-gradient(1px 1px at 92% 78%, #fff 50%, transparent 51%);
  background-size: 260px 260px; animation: ldTwinkle 3.2s ease-in-out infinite; }
.ld-stars.s2 { background-image: radial-gradient(1px 1px at 22% 40%, #fff 50%, transparent 51%), radial-gradient(1.5px 1.5px at 76% 28%, #c9d2ff 50%, transparent 51%),
  radial-gradient(1px 1px at 44% 10%, #fff 50%, transparent 51%), radial-gradient(1.2px 1.2px at 62% 58%, #ffe9a8 50%, transparent 51%),
  radial-gradient(1px 1px at 8% 88%, #fff 50%, transparent 51%);
  background-size: 190px 190px; animation: ldTwinkle 4.4s ease-in-out -1.6s infinite; opacity: .7; }
@keyframes ldTwinkle { 50% { opacity: .35; } }
/* 아래 지평선 빛: 해 빛깔 → 달 빛깔 */
.ld-glow { position: absolute; left: 50%; bottom: -42vh; width: 150vmax; height: 72vh; transform: translateX(-50%); border-radius: 50%; pointer-events: none;
  background: radial-gradient(ellipse at 50% 35%, rgba(255, 210, 87, 0.2), rgba(179, 192, 255, 0.1) 35%, transparent 62%); filter: blur(28px); }
.ld-main { position: relative; display: grid; justify-items: center; gap: 14px; padding: 0 24px; animation: ldIn .7s cubic-bezier(.2, .9, .3, 1.1) both; }
@keyframes ldIn { from { opacity: 0; transform: translateY(14px) scale(.97); } }
.ld-icon { width: 112px; height: 112px; border-radius: 28px; overflow: hidden; margin-bottom: 4px; animation: ldFloat 3s ease-in-out infinite;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.14), 0 14px 30px rgba(0, 0, 0, 0.45), 0 0 46px rgba(255, 210, 87, 0.28), 0 0 80px rgba(179, 192, 255, 0.22); }
.ld-icon img { display: block; width: 100%; height: 100%; }
@keyframes ldFloat { 50% { transform: translateY(-8px) rotate(-1.5deg); } }
.ld-logo { font: 400 58px/1 var(--display); display: flex; align-items: flex-start; letter-spacing: 0.01em;
  text-shadow: 0 1px 0 #b9a8ff, 0 2px 0 #9d8af0, 0 3px 0 #826fd8, 0 4px 0 #6855bb, 0 5px 0 #4f3f9a, 0 9px 16px rgba(0, 0, 0, 0.55); }
.ld-logo .sol { color: var(--sol); } .ld-logo .luna { color: var(--luna); }
.ld-logo .two { font-size: 0.48em; margin-left: 0.18em; padding: 0.1em 0.3em 0.02em; border-radius: 0.3em; color: #1a1638; text-shadow: none;
  background: linear-gradient(135deg, var(--sol), var(--luna)); transform: rotate(-8deg); box-shadow: 0 4px 0 rgba(30, 20, 80, 0.6); }
.ld-sub { font: 700 12.5px var(--body); letter-spacing: 0.32em; color: rgba(244, 242, 255, 0.72); margin: 2px 0 10px; padding-left: 0.32em; }
.ld-bar { position: relative; width: min(240px, 64vw); height: 10px; border-radius: 6px; background: rgba(255, 255, 255, 0.09);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.06); overflow: hidden; }
.ld-bar i { position: relative; display: block; height: 100%; width: 5%; border-radius: 6px; transition: width .35s ease;
  background: linear-gradient(90deg, var(--sol), #ffe9a8 45%, var(--luna)); box-shadow: 0 0 12px rgba(255, 220, 140, 0.6); overflow: hidden; }
.ld-bar i::after { content: ''; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, 0.75) 50%, transparent 80%);
  transform: translateX(-100%); animation: ldShine 1.4s ease-in-out infinite; }
@keyframes ldShine { to { transform: translateX(100%); } }
.ld-text { min-height: 1.4em; font-size: 13px; font-weight: 600; color: var(--dim); letter-spacing: 0.02em; }
@media (prefers-reduced-motion: reduce) { .ld-icon, .ld-stars, .ld-bar i::after, .ld-main { animation: none; } }
#fader { position: fixed; inset: 0; z-index: 55; background: #05051a; opacity: 0; pointer-events: none; transition: opacity .28s ease; }
#fader.on { opacity: 1; }

/* ── 휴대폰 조작 ── */
#touchUI { display: none; }
body.touch #touchUI { display: block; }
body.touch #help, body.touch .key-only { display: none; }
.stick { position: fixed; z-index: 10; border-radius: 50%; pointer-events: none; border: 2px solid rgba(var(--c), 0.6);
  background: radial-gradient(circle, rgba(var(--c), 0.08) 0%, rgba(var(--c), 0.2) 100%); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25); }
.stick.sol, .jbtn.sol { --c: 255, 210, 87; }
.stick.luna, .jbtn.luna { --c: 179, 192, 255; }
.stick .knob { position: absolute; left: 50%; top: 50%; width: 44%; height: 44%; margin: -22% 0 0 -22%; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff, rgb(var(--c)) 55%); box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45); opacity: 0.92; }
.stick.active { border-color: rgba(var(--c), 0.95); }
.stick .lab { position: absolute; left: 50%; top: -22px; transform: translateX(-50%); font: 400 14px var(--display); color: rgba(var(--c), 0.95); text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8); white-space: nowrap; }
.jbtn { position: fixed; z-index: 10; border-radius: 50%; pointer-events: none; display: grid; place-items: center; border: 2px solid rgba(var(--c), 0.75);
  background: rgba(var(--c), 0.18); color: rgb(var(--c)); font: 400 16px var(--display); text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8); transition: transform .06s, background .06s; }
.jbtn.on { background: rgba(var(--c), 0.55); color: #1a1530; transform: scale(0.92); }
.tbtn { position: fixed; z-index: 11; width: 46px; height: 42px; border-radius: 14px; border: 1px solid var(--line); background: rgba(10, 12, 40, 0.65);
  color: #fff; font-size: 17px; display: grid; place-items: center; touch-action: manipulation; backdrop-filter: blur(4px); }
.tbtn.on { color: var(--accent); border-color: var(--accent); }
body.touch.portrait #view { height: var(--viewH, 100%); }
body.touch.portrait #ctrlBg { display: block; }
#ctrlBg { display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; background: linear-gradient(#0d0f33, #07081f); border-top: 1px solid var(--line); }
body.touch #hint { font-size: 13px; top: 64px; }
body.touch #hud { top: max(8px, env(safe-area-inset-top)); }

/* 입체 느낌: 탭·스테이지 카드·휴대폰 단추·리본 */
.tab { box-shadow: 0 3px 0 #121436, inset 0 1px 0 rgba(255, 255, 255, 0.18); transition: transform .1s, box-shadow .1s; }
.tab:hover { transform: translateY(-1px); }
.tab.on { transform: translateY(2px); box-shadow: 0 1px 0 #121436, inset 0 2px 5px rgba(0, 0, 0, 0.3); }
.scard { box-shadow: 0 6px 0 #0c0d2c, 0 12px 22px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.12); }
.scard:hover { transform: translateY(-3px); box-shadow: 0 9px 0 #0c0d2c, 0 18px 30px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.15); }
.scard:active { transform: translateY(4px); box-shadow: 0 2px 0 #0c0d2c; }
.tbtn { box-shadow: 0 4px 0 #0a0b26, inset 0 1px 0 rgba(255, 255, 255, 0.25); transition: transform .08s, box-shadow .08s; }
.tbtn:active { transform: translateY(3px); box-shadow: 0 1px 0 #0a0b26; }
.hud-pause { box-shadow: 0 3px 0 #0a0b26, inset 0 1px 0 rgba(255, 255, 255, 0.25); }
.ribbon { box-shadow: 0 4px 0 #6b4e9c, 0 10px 22px rgba(0, 0, 0, 0.35); }

/* ── 좁은 화면 ── */
@media (max-width: 760px) {
  #hud { gap: 3px; padding: 4px; }
  .hud-stage span { display: none; }
  .hud-stage { padding: 2px 4px; }
  .gem { padding: 4px 8px; font-size: 14px; }
  .pips { display: none; }
  .hud-time { padding: 2px 6px; font-size: 13px; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tabs { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .how { grid-template-columns: 1fr; }
  #title { background: linear-gradient(180deg, rgba(6, 7, 26, 0.25) 0%, rgba(6, 7, 26, 0.05) 32%, rgba(6, 7, 26, 0.08) 55%, rgba(6, 7, 26, 0.8) 75%); }
  .home { width: 100%; padding: calc(max(14px, env(safe-area-inset-top)) + 52px) 22px 4vh; justify-content: space-between; align-items: center; text-align: center; gap: 12px; }
  #logo3d { height: clamp(120px, 19vh, 175px); }
  .home-menu { width: min(340px, 100%); }
  .home-foot { left: 0; right: 0; justify-content: center; bottom: 8px; }
}
@media (max-height: 520px) {
  .home { gap: 14px; padding-top: 3vh; padding-bottom: 3vh; }
  #logo3d { height: clamp(100px, 24vh, 150px); }
  .home-menu { gap: 7px; }
  .hbtn { padding: 9px 14px; }
}

/* ── 정식판: 잠긴 스테이지 ── */
.scard.locked { cursor: not-allowed; }
.scard.locked canvas { filter: grayscale(0.85) brightness(0.45); }
.scard.locked .sn, .scard.locked .sm { opacity: 0.55; }
.scard.locked:hover { transform: none; }
.scard .lock { position: absolute; left: 50%; top: 36%; transform: translate(-50%, -50%); width: 42px; height: 42px; padding: 9px; border-radius: 50%;
  background: rgba(10, 12, 40, 0.75); border: 1px solid rgba(255, 255, 255, 0.25); color: #dfe3ff; }
.scard .lock svg, .tab .ts svg { width: 100%; height: 100%; display: block; }
.tab.locked { opacity: 0.6; }
.tab.locked .ts { width: 12px; height: 12px; color: var(--dim); }

/* ── 월드 탭: 월드마다 하늘빛 바탕·그림·빛 알갱이 ── */
.tab.wtab { position: relative; overflow: hidden; color: #d6dbff; border-color: var(--a5);
  background: linear-gradient(165deg, var(--s1), var(--s0) 82%); }
.tab.wtab::before, .tab.wtab::after { content: ''; position: absolute; inset: 0; pointer-events: none; transition: opacity .2s; }
.tab.wtab::before { background: radial-gradient(120% 60% at 50% 125%, var(--s2), transparent 72%); opacity: 0.4; }
.tab.wtab::after { background: var(--specks); opacity: 0.55; }
.tab.wtab > * { position: relative; z-index: 1; }
.tab.wtab .wi { width: 24px; height: 24px; color: var(--a); opacity: 0.8; filter: drop-shadow(0 0 4px var(--a5)); transition: transform .2s; }
.tab.wtab .wi .ic { width: 100%; height: 100%; display: block; }
.tab.wtab .tn { text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55); }
.tab.wtab:hover .wi { transform: translateY(-1px) scale(1.06); }
.tab.wtab.on { color: #fff; border-color: var(--a);
  box-shadow: 0 1px 0 #121436, inset 0 0 0 1px var(--a5), inset 0 -12px 20px -10px var(--a), 0 0 16px -3px var(--a); }
.tab.wtab.on::before { opacity: 0.6; }
.tab.wtab.on::after { opacity: 1; }
.tab.wtab.on .wi { opacity: 1; filter: drop-shadow(0 0 7px var(--a)); animation: wiFloat 2.4s ease-in-out infinite; }
.tab.wtab.on .tno { background: var(--a5); color: #fff; }
.tab.wtab.locked { opacity: 0.78; filter: saturate(0.75) brightness(0.85); }
.tab.wtab.locked .wi { opacity: 0.7; }
.tab.wtab.locked .tn { opacity: 0.8; }
@keyframes wiFloat { 50% { transform: translateY(-2px); } }
.world-banner { position: relative; overflow: hidden; }
.world-banner > span { position: relative; z-index: 1; }
.world-banner .wbg { position: absolute; z-index: 0; right: -14px; top: -18px; width: 118px; height: 118px; transform: rotate(-12deg);
  color: var(--a); opacity: 0.12; pointer-events: none; }
.world-banner .wbg .ic { width: 100%; height: 100%; display: block; }
@media (prefers-reduced-motion: reduce) { .tab.wtab.on .wi { animation: none; } }
.scard.shake { animation: shake .35s; }
@keyframes shake { 20% { transform: translateX(-6px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(3px); } }
.home-foot .tag.hidden { display: none; }

/* ── 클리어 창: 새 월드 알림 / 모든 스테이지 클리어 ── */
.c-note { margin: 2px 0 8px; padding: 7px 14px; border-radius: 12px; font-weight: 900; font-size: 14px; color: #1a1638;
  background: linear-gradient(135deg, var(--sol), var(--luna)); box-shadow: 0 3px 0 #6b4e9c; animation: pop .4s 1.2s both; }

/* ── 모든 스테이지 클리어 연출 (불꽃은 3D 하늘에서 터진다) ── */
#finale { position: fixed; inset: 0; z-index: 35; pointer-events: none; display: grid; place-items: center; animation: fnOut 3.6s forwards; }
#finale.hidden { display: none; }
.fn-flash { position: absolute; inset: 0; background: radial-gradient(circle at 50% 45%, #fffbe8, rgba(255, 240, 200, 0.6) 40%, rgba(255, 255, 255, 0) 75%); animation: fnFlash .9s ease-out forwards; }
.fn-text { position: relative; text-align: center; animation: fnText 3.6s cubic-bezier(.2, 1.4, .4, 1) forwards; }
.fn-text b { display: block; font: 400 clamp(34px, 7vw, 76px)/1.1 var(--display); background: linear-gradient(135deg, #fff3c8, var(--sol) 45%, var(--luna)); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 4px 0 #3c2a6e) drop-shadow(0 0 24px rgba(255, 210, 120, 0.55)); }
.fn-text span { display: block; margin-top: 8px; font-weight: 900; letter-spacing: 0.5em; font-size: clamp(12px, 1.6vw, 16px); color: #fff3d0; text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6); }
@keyframes fnFlash { 0% { opacity: 0; } 12% { opacity: 1; } 100% { opacity: 0; } }
@keyframes fnText { 0% { opacity: 0; transform: scale(.6); } 18% { opacity: 1; transform: scale(1); } 85% { opacity: 1; transform: scale(1.04); } 100% { opacity: 0; transform: scale(1.08); } }
@keyframes fnOut { 0%, 80% { background: rgba(5, 5, 26, 0); } 100% { background: rgba(5, 5, 26, 0.75); } }

/* ── 휴대폰 버튼 방식: 고정 화살표 넷 ── */
.dpad { position: fixed; z-index: 10; pointer-events: none; display: none; }
body.touch.ctrl-buttons .dpad { display: block; }
body.ctrl-buttons .stick { display: none !important; }
.dpad.sol { --c: 255, 210, 87; } .dpad.luna { --c: 179, 192, 255; }
.dpad .ar { position: absolute; width: 36%; height: 36%; border-radius: 30%; border: 2px solid rgba(var(--c), 0.65); background: rgba(10, 12, 40, 0.45);
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.35); transition: transform .06s, background .06s; }
.dpad .ar::after { content: ''; position: absolute; left: 50%; top: 50%; width: 32%; height: 32%; border: solid rgba(var(--c), 0.95); border-width: 0 3px 3px 0; }
.dpad .u { left: 32%; top: 0; } .dpad .u::after { transform: translate(-50%, -25%) rotate(-135deg); }
.dpad .d { left: 32%; bottom: 0; } .dpad .d::after { transform: translate(-50%, -75%) rotate(45deg); }
.dpad .l { left: 0; top: 32%; } .dpad .l::after { transform: translate(-25%, -50%) rotate(135deg); }
.dpad .r { right: 0; top: 32%; } .dpad .r::after { transform: translate(-75%, -50%) rotate(-45deg); }
.dpad .ar.on { background: rgba(var(--c), 0.55); transform: translateY(2px); box-shadow: 0 1px 0 rgba(0, 0, 0, 0.35); }
body:not(.touch) .touch-opt { display: none; }

/* ── 멈춤 창 위에서 조는 솔·루나 ── */
.pals { position: absolute; right: 30px; top: -60px; width: 110px; height: 62px; cursor: pointer; }

/* ── 불러오기 화면 로고의 2 ── */
.ld-logo .two { display: inline-block; font-size: 0.5em; vertical-align: super; padding: 0.06em 0.3em 0.02em; border-radius: 0.32em; color: #1a1638;
  background: linear-gradient(135deg, var(--sol), var(--luna)); transform: rotate(-8deg); }

/* ── 온라인으로 함께 ── */
.online-card { width: min(440px, 100%); }
.online-card .sel-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.online-card .sel-head h2 { margin: 0; flex: 1; justify-content: flex-start; }
.on-sec { margin: 12px 0; display: grid; gap: 10px; }
.on-note { margin: 0; font-size: 13.5px; line-height: 1.55; color: var(--dim); text-align: center; word-break: keep-all; }
.on-note.err { color: #ffb4b4; }
.on-kind { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.on-kind button { padding: 12px; border-radius: 16px; border: 2px solid var(--line); background: rgba(255, 255, 255, 0.06); color: var(--ink);
  font: 800 16px var(--body); cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; }
.on-kind button.on.sol { border-color: #ffd257; background: rgba(255, 210, 87, 0.16); }
.on-kind button.on.luna { border-color: #b3c0ff; background: rgba(179, 192, 255, 0.16); }
.on-code { font: 400 46px var(--display); letter-spacing: 0.18em; text-align: center; color: #ffe39a; margin: 4px 0; user-select: all; }
.on-join { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.on-join input { min-width: 0; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: rgba(0, 0, 0, 0.25); color: var(--ink);
  font: 400 22px var(--display); letter-spacing: 0.2em; text-transform: uppercase; text-align: center; }
.on-join .hbtn { width: auto; }
/* 로비: 방 만들기 / 참가하기를 서로 다른 칸으로 */
.on-intro { margin: 2px 0 12px; }
.on-box { display: grid; gap: 12px; padding: 14px; border-radius: 20px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.04); }
.on-box + .on-box { margin-top: 12px; }
.on-box.host { background: linear-gradient(160deg, rgba(255, 210, 87, 0.10), rgba(179, 192, 255, 0.06)); border-color: rgba(255, 210, 87, 0.28); }
.on-box.join { background: linear-gradient(160deg, rgba(179, 192, 255, 0.10), rgba(120, 130, 220, 0.04)); border-color: rgba(179, 192, 255, 0.26); }
.on-bh { display: flex; align-items: center; gap: 10px; text-align: left; }
.on-bh b { display: block; font: 400 18px var(--display); color: var(--ink); }
.on-bh small { display: block; margin-top: 2px; font-size: 12.5px; line-height: 1.4; color: var(--dim); word-break: keep-all; }
.on-ic { flex: none; width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; font: 800 17px var(--body); color: #1a1638; }
.on-box.host .on-ic { background: linear-gradient(135deg, #ffe39a, #ffd257); }
.on-box.join .on-ic { background: linear-gradient(135deg, #d6dcff, #b3c0ff); }
.on-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #7cf0a0; box-shadow: 0 0 8px #7cf0a0; }
.on-dot.wait { background: #ffd257; box-shadow: 0 0 8px #ffd257; animation: onBlink 1.2s ease-in-out infinite; }
.on-dot.off { background: #ff8a8a; box-shadow: 0 0 8px #ff8a8a; }
@keyframes onBlink { 50% { opacity: 0.3; } }
#netBadge { position: fixed; top: 58px; /* 실제 자리는 main3d.js placeNetBadge()가 HUD 바로 아래로 */ left: 50%; transform: translateX(-50%); z-index: 6; padding: 4px 12px; border-radius: 12px;
  background: rgba(10, 12, 40, 0.62); border: 1px solid var(--line); font-size: 12px; font-weight: 700; color: var(--ink); white-space: nowrap;
  display: flex; align-items: center; gap: 7px; pointer-events: none; }
body.title-on #netBadge { display: none; }
.beta { display: inline-block; padding: 2px 6px; border-radius: 6px; font: 800 10px var(--body); letter-spacing: 0.08em; vertical-align: middle;
  color: #1a1638; background: linear-gradient(135deg, #ffe39a, #bfc9ff); text-shadow: none; -webkit-text-stroke: 0; filter: none; }
/* 온라인: 친구 캐릭터의 조작 장치는 숨긴다 (내 것 한 벌만) */
body.net-sol #stick-1, body.net-sol #jump-1, body.net-sol #dpad-1,
body.net-luna #stick-0, body.net-luna #jump-0, body.net-luna #dpad-0 { display: none !important; }
/* ── 온라인 감정표현 ── */
#emoBtn { position: fixed; right: 14px; top: 38%; z-index: 7; width: 46px; height: 46px; border-radius: 16px; border: 1px solid var(--line);
  background: rgba(14, 16, 48, 0.72); backdrop-filter: blur(6px); font-size: 24px; line-height: 1; cursor: pointer;
  box-shadow: 0 3px 0 #0a0b26, inset 0 1px 0 rgba(255, 255, 255, 0.2); -webkit-tap-highlight-color: transparent; }
#emoBtn.on { background: rgba(255, 227, 154, 0.25); border-color: #ffe39a; }
#emoPick { position: fixed; right: 70px; top: 38%; z-index: 7; transform: translateY(calc(-50% + 23px)); display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px;
  padding: 8px; border-radius: 18px; background: rgba(14, 16, 48, 0.86); border: 1px solid var(--line); backdrop-filter: blur(8px);
  animation: emoIn .16s ease-out; }
#emoPick button { width: 56px; padding: 6px 0 5px; border: 0; border-radius: 12px; background: rgba(255, 255, 255, 0.07); color: var(--ink); cursor: pointer;
  display: grid; justify-items: center; gap: 2px; -webkit-tap-highlight-color: transparent; }
#emoPick button:hover, #emoPick button:active { background: rgba(255, 255, 255, 0.18); }
#emoPick .e { font-size: 26px; line-height: 1.1; }
#emoPick small { font-size: 10.5px; font-weight: 700; color: var(--dim); }
#emoPick kbd { display: none; }
body:not(.touch) #emoPick kbd { display: block; font: 700 9px var(--body); color: var(--dim); opacity: .7; }
@keyframes emoIn { from { opacity: 0; transform: translateY(calc(-50% + 23px)) scale(.92); } }
#emoLayer { position: fixed; inset: 0; z-index: 5; pointer-events: none; }
.emo { position: absolute; left: 0; top: 0; padding: 4px 9px 5px; border-radius: 16px; background: #fff; color: #1a1638; font-size: 26px; line-height: 1.15;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35); white-space: nowrap; will-change: transform; }
.emo::after { content: ''; position: absolute; left: 50%; bottom: -7px; margin-left: -7px; border: 7px solid transparent; border-bottom: 0; border-top-color: #fff; }
.emo.sol { box-shadow: 0 0 0 2px #ffd257, 0 4px 12px rgba(0, 0, 0, 0.35); }
.emo.luna { box-shadow: 0 0 0 2px #b3c0ff, 0 4px 12px rgba(0, 0, 0, 0.35); }
.emo i { display: block; font-style: normal; animation: emoPop .35s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes emoPop { from { transform: scale(.3); } }
body.title-on #emoBtn, body.title-on #emoPick, body.title-on #emoLayer,
body.credits-on #emoBtn, body.credits-on #emoPick, body.credits-on #emoLayer { display: none !important; }
/* 로딩 막대 위를 걷는 1편 솔·루나 (main3d.js drawLoadWalk) */
.ld-track { position: relative; padding-top: 40px; margin-top: 4px; }
#ldWalk { position: absolute; top: 0; left: -44px; width: calc(100% + 88px); height: 44px; pointer-events: none; }
