:root {
  --bg: #1f2230; --paper: #f3efe6; --ink: #2b2a33; --muted: #6f6d78; --gold: #c9a96a; --gold-ink: #7a5f2a;
  --glass: rgba(26, 28, 40, .72); --glass-ink: #ece8df; --glass-muted: #b4b0c2; --line: rgba(255,255,255,.12);
  --font: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard", "Noto Sans KR", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--glass-ink); font-family: var(--font); -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; }
#app { position: fixed; inset: 0; }
#scene { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
[hidden] { display: none !important; }

/* 부팅 */
.boot { position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 24px; background: var(--paper); color: #4a4856; text-align: center; }
.boot .mark { color: #9a8358; display: flex; margin-bottom: 4px; }
.boot .mark svg { width: 34px; height: 34px; stroke-width: 1; }
.boot h1 { margin: 0; padding-left: 6px; font-size: 28px; font-weight: 500; letter-spacing: 6px; color: #3a3845; }
.boot h1.small { padding: 0; font-size: 21px; letter-spacing: 0; }
.boot p { margin: 0; color: #86838f; font-size: 12.5px; line-height: 1.7; }
.boot .sub { letter-spacing: 1px; color: #9a8358; }
.boot .dot { width: 4px; height: 4px; margin-top: 14px; background: #b49868; border-radius: 50%; animation: breathe 1.8s ease-in-out infinite; }
.boot.ready .dot { display: none; }
.boot-enter { margin-top: 16px; min-height: 44px; padding: 0 22px; border: 1px solid #c9b791; border-radius: 999px; background: #fff; color: #5b4a24; cursor: pointer; }
.boot-enter:hover { background: #fbf6ea; }
@keyframes breathe { 50% { opacity: .25; } }

/* 상단 */
.hud-top { position: absolute; top: max(10px, env(safe-area-inset-top)); left: 12px; right: 12px; z-index: 10; display: flex; align-items: center; gap: 8px; pointer-events: none; }
.hud-top > * { pointer-events: auto; }
.brand { display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 9px; border-radius: 999px; background: var(--glass); backdrop-filter: blur(10px); border: 1px solid var(--line); }
.brand .mark { display: flex; color: var(--gold); }
.brand .mark svg { width: 20px; height: 20px; }
.brand .name { font-weight: 600; letter-spacing: 2px; }
.brand small { color: var(--glass-muted); font-size: 11.5px; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--glass); backdrop-filter: blur(10px); cursor: pointer; }
.chip svg { width: 18px; height: 18px; }
.chip.icon { width: 36px; padding: 0; justify-content: center; }
.chip:hover { border-color: rgba(255,255,255,.3); }
.chip b { font-weight: 600; }
#sound-btn[aria-pressed="false"] .wave { opacity: .25; }
.tools { margin-left: auto; display: flex; gap: 6px; }

/* 안내 */
.toast { position: absolute; top: calc(max(10px, env(safe-area-inset-top)) + 48px); left: 50%; transform: translateX(-50%); z-index: 12; max-width: min(92vw, 420px); padding: 8px 14px; border-radius: 999px; background: var(--glass); border: 1px solid var(--line); backdrop-filter: blur(10px); font-size: 13px; text-align: center; }
.worship-banner { position: absolute; top: calc(max(10px, env(safe-area-inset-top)) + 48px); left: 50%; transform: translateX(-50%); z-index: 11; display: flex; gap: 10px; align-items: center; padding: 8px 10px 8px 14px; border-radius: 999px; background: rgba(201,169,106,.92); color: #2b2412; font-size: 13px; }
.worship-banner button { border: 0; border-radius: 999px; padding: 6px 12px; background: #2b2412; color: #f3e9cf; cursor: pointer; }

/* 하단 */
.hud-bottom { position: absolute; left: 0; right: 0; bottom: max(12px, env(safe-area-inset-bottom)); z-index: 10; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 0 12px; pointer-events: none; }
.hud-bottom > * { pointer-events: auto; }
.hint { margin: 0; font-size: 11.5px; color: var(--glass-muted); text-shadow: 0 1px 2px rgba(0,0,0,.5); text-align: center; pointer-events: none; }
.travel { display: flex; gap: 10px; align-items: center; padding: 6px 8px 6px 14px; border-radius: 999px; background: var(--glass); border: 1px solid var(--line); font-size: 13px; }
.travel button { border: 1px solid var(--line); border-radius: 999px; background: transparent; padding: 4px 10px; cursor: pointer; }
.actions { display: flex; gap: 8px; padding: 8px; border-radius: 22px; background: var(--glass); border: 1px solid var(--line); backdrop-filter: blur(12px); }
.action { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 72px; padding: 8px 10px; border: 1px solid transparent; border-radius: 16px; background: rgba(255,255,255,.04); cursor: pointer; font-size: 12px; }
.action .ic { font-size: 20px; line-height: 1; }
.action kbd { position: absolute; top: 5px; right: 7px; font: 10px/1 ui-monospace, monospace; color: var(--glass-muted); }
.action:hover { background: rgba(255,255,255,.1); }
.action.is-active { border-color: var(--gold); background: rgba(201,169,106,.18); }
.action:disabled { opacity: .45; cursor: default; }

/* 시트 */
.sheet { width: min(92vw, 420px); max-height: 82vh; margin: auto; padding: 0; border: 1px solid var(--line); border-radius: 18px; background: #262a3a; color: var(--glass-ink); overflow: auto; }
.sheet::backdrop { background: rgba(10,10,20,.45); }
.sheet header { position: sticky; top: 0; display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; background: #262a3a; border-bottom: 1px solid var(--line); }
.sheet h2 { margin: 0; font-size: 15px; font-weight: 600; }
.sheet h3 { margin: 0; font-size: 13.5px; font-weight: 600; }
.sheet .close { width: 32px; height: 32px; border: 0; border-radius: 50%; background: rgba(255,255,255,.06); cursor: pointer; font-size: 18px; }
.sheet section { padding: 10px 16px 16px; }
.sheet section + section { border-top: 1px solid var(--line); }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; font-size: 13px; }
.row span small { display: block; color: var(--glass-muted); font-size: 11.5px; }
.row.head p { margin: 2px 0 0; color: var(--glass-muted); font-size: 11.5px; }
.row input[type=range] { width: 46%; accent-color: var(--gold); }
.row input[type=text] { flex: 1; min-width: 0; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: rgba(0,0,0,.25); color: inherit; font-size: 12px; }
.pill { min-height: 32px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.06); cursor: pointer; font-size: 12.5px; white-space: nowrap; }
.pill[aria-pressed="true"] { background: var(--gold); color: #2b2412; border-color: var(--gold); }
.pill:disabled { opacity: .5; cursor: default; }
.status { margin: 4px 0 0; color: var(--glass-muted); font-size: 12px; }
details { font-size: 13px; padding: 6px 0; }
details p { margin: 6px 0 0; color: var(--glass-muted); font-size: 12px; line-height: 1.7; }
.people, .servers { list-style: none; margin: 0; padding: 0; }
.people li { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.people li small { color: var(--glass-muted); }
.servers li { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; }
.servers button { min-height: 36px; padding: 0 14px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.06); cursor: pointer; }
.servers button:disabled { opacity: .5; cursor: default; }
.servers small { color: var(--glass-muted); font-size: 12px; }
.btns { display: flex; gap: 8px; margin: 10px 0; }
#share-image { width: 100%; border-radius: 12px; margin-top: 8px; }

@media (max-width: 520px) {
  .brand .name { display: none; }
  .hint { display: none; }
  .action { min-width: 60px; padding: 8px 6px; font-size: 11px; }
  .action kbd { display: none; }
}
@media (prefers-reduced-motion: reduce) { .boot .dot { animation: none; } }
