body.play-screen { --pine:#234439; --ink:#263c35; --brass:#c4a26e; --line:#b8c3b2; --paper:#f8f5ed; --muted:#52604e; overflow:hidden; background:#dfe5d7; }
.play-screen main { width:100%; max-width:none; margin:0; padding:0; }
#temple-space { position:fixed; inset:var(--play-top,0px) 0 auto; height:var(--play-height,100dvh); overflow:hidden; color:var(--ink); }
.play-brand { position:fixed; z-index:6; top:calc(var(--play-top,0px) + env(safe-area-inset-top,0px) + 14px); left:20px; margin:0; padding:0; border:0; pointer-events:none; }
.play-brand .brand { pointer-events:auto; gap:8px; font-size:22px; color:#fbf6e7; padding:5px 13px 5px 7px; background:#263f34; border-radius:6px; text-shadow:none; box-shadow:0 3px 12px #00000024; }
.play-brand .brand svg { width:31px; height:31px; }
.space-heading { position:absolute; z-index:7; top:calc(env(safe-area-inset-top,0px) + 14px); right:20px; margin:0; }
.entry-actions { display:flex; gap:6px; align-items:center; }
.entry-actions button { min-height:44px; padding:8px 13px; border-radius:6px; color:#253d31; background:#f9f5e9; box-shadow:0 2px 9px #00000020; font-weight:650; }
.entry-actions #profile-toggle { display:inline-flex; gap:7px; align-items:center; }
.entry-actions svg { width:18px; height:18px; flex:none; }
#profile-label { max-width:150px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.entry-actions #room-toggle { background:#2b493a; color:#fff7e6; }
#help-toggle { display:grid; place-items:center; width:44px; padding:0; }
#help-toggle svg { width:23px; height:23px; }
.entry-actions button:hover, .entry-actions button[aria-expanded=true] { background:#dce4d2; color:#253d31; }
.entry-actions #room-toggle:hover { background:#42634b; color:#fff7e6; }
.entry-panel { position:absolute; z-index:12; top:74px; right:20px; width:min(420px,calc(100% - 40px)); padding:22px; margin:0; border:0; border-radius:10px; background:#f7f3e7; box-shadow:0 10px 36px #00000035; display:grid; grid-template-columns:1.15fr 1fr; gap:14px; }
.entry-panel label { display:grid; gap:5px; font-size:13px; font-weight:650; }
.entry-panel input, .entry-panel select, #room-link, #chat-input { min-width:0; width:100%; height:46px; border:1px solid #a5af9d; border-radius:5px; padding:8px 10px; background:#fffdf5; caret-color:#315143; }
.entry-panel p { grid-column:1/-1; font-size:13px; line-height:1.65; color:#50604b; margin:0; }
.form-actions { grid-column:1/-1; display:flex; gap:8px; }
.form-actions .primary { flex:1; }
#profile-status:empty, #chat-status:empty { display:none; }
.space-studio { position:absolute; inset:0; }
.space-stage { position:absolute; inset:0; overflow:hidden; isolation:isolate; background:#dfe5d7; }
#temple-canvas { display:block; width:100%; height:100%; min-height:0; touch-action:none; outline-offset:-4px; }
#temple-canvas:focus-visible { outline:3px solid #c29c63; }
.space-topline { position:absolute; z-index:3; inset:calc(env(safe-area-inset-top,0px) + 77px) 20px auto; display:flex; align-items:start; justify-content:space-between; gap:12px; pointer-events:none; }
#connection, .companions { display:inline-flex; align-items:center; gap:6px; background:#fbf6e9; color:#294333; font-size:12px; min-height:30px; padding:4px 10px; border-radius:4px; line-height:1.5; }
#connection { max-width:min(64%,440px); }
#connection::before { content:""; width:6px; height:6px; border-radius:50%; flex:none; background:#6c8657; }
.companions { pointer-events:auto; min-height:44px; padding:5px 10px; background:#2c4638; color:#fff9e8; }
.companions:hover { background:#44624a; }
.companions svg { width:16px; height:16px; }
.renderer-message { position:absolute; inset:0; z-index:5; display:flex; align-items:center; justify-content:center; flex-direction:column; gap:12px; text-align:center; padding:30px; color:#2b4134; background:#e0e7d8; }
.renderer-message p { max-width:32em; margin:0; }
.space-controls { position:absolute; z-index:3; left:24px; right:24px; bottom:calc(env(safe-area-inset-bottom,0px) + 84px); display:flex; align-items:end; justify-content:space-between; gap:14px; pointer-events:none; }
.space-controls button { pointer-events:auto; }
.dpad { --size:142px; position:relative; width:var(--size); height:var(--size); flex:none; touch-action:none; pointer-events:auto; user-select:none; -webkit-user-select:none; border-radius:50%; background:radial-gradient(ellipse at 32% 23%,#40584a,#243b32 73%); color:#f5e8ca; box-shadow:0 4px 12px #1c281e38; }
.dial { position:absolute; inset:0; width:100%; height:100%; stroke:#be9e6c; stroke-width:1; pointer-events:none; }
.dial circle:nth-child(2) { stroke-width:2; }
.dial circle:nth-child(3) { stroke:#7b805e; }
.dial-thumb { transform:translate(var(--dial-x,0px),var(--dial-y,0px)); }
.dial .needle { fill:#d6b477; }
.dpad button { position:absolute; display:grid; place-items:center; width:46px; height:46px; min-width:44px; min-height:44px; padding:0; color:inherit; border-radius:50%; touch-action:none; user-select:none; -webkit-user-select:none; }
.dpad button[data-dir="0,-1"] { top:2px; left:calc(50% - 23px); }
.dpad button[data-dir="0,1"] { bottom:2px; left:calc(50% - 23px); }
.dpad button[data-dir="-1,0"] { left:2px; top:calc(50% - 23px); }
.dpad button[data-dir="1,0"] { right:2px; top:calc(50% - 23px); }
.dpad button svg { width:23px; height:23px; stroke-width:2.3; transition:scale 120ms ease-out; }
.dpad [data-dir="-1,0"] svg { rotate:-90deg; }.dpad [data-dir="1,0"] svg { rotate:90deg; }.dpad [data-dir="0,1"] svg { rotate:180deg; }
@media (hover:hover) { .dpad button:hover:not(:disabled) { background:#66735b; } }
.dpad button:active:not(:disabled),.dpad button.is-held:not(:disabled) { background:#d8bf8e; color:#253b31; }.dpad button:active svg { scale:.86; }.dpad button:focus-visible { outline:2px solid #f9e4b3; outline-offset:-3px; }
.mat-action { display:flex; flex-direction:column; align-items:end; gap:7px; max-width:42%; }
.mat-action button { min-height:46px; padding:9px 16px; font-size:14px; border-radius:5px; }
.mat-action .primary { background:#223d33; color:#fff8e9; }.mat-action .primary:hover:not(:disabled) { background:#3e5844; }.mat-action .outline { background:#fff7e6; color:#2e4136; border:0; }
.mat-action button:disabled { opacity:1; background:#ede8d9; color:#555e50; }
.dog-actions { display:flex; align-items:stretch; gap:4px; width:216px; max-width:100%; padding:4px; border-radius:7px; background:#f9f5e9; box-shadow:0 3px 12px #18372824; pointer-events:auto; }
.mat-action .dog-actions button { flex:1; min-width:44px; padding:7px 2px; font-size:12px; white-space:nowrap; }
.mat-action .dog-actions button[data-active=true] { background:#d6e3d0; color:#253d31; }
#dog-active-state, #reindeer-active-state { max-width:100%; padding:5px 8px; border-radius:4px; background:#fbf7eb; color:#354738; font-size:12px; line-height:1.5; text-align:right; }
.reindeer-actions { width:184px; }
#avatar-count { padding:2px 7px; border-radius:3px; font-size:12px; background:#fbf7eb; color:#354738; font-variant-numeric:tabular-nums; }
.camera-toolbar { position:absolute; z-index:4; left:50%; bottom:calc(env(safe-area-inset-bottom,0px) + 16px); transform:translateX(-50%); display:flex; align-items:center; gap:4px; width:max-content; max-width:calc(100% - 100px); padding:4px; color:#334c3c; background:#f1eee0; border-radius:7px; box-shadow:0 3px 12px #18372824; }
.camera-toolbar > div, .camera-manual-controls { display:flex; align-items:center; flex-wrap:nowrap; }
.camera-toolbar button { display:flex; align-items:center; justify-content:center; gap:5px; min-width:44px; min-height:44px; padding:7px 11px; font-size:13px; white-space:nowrap; border-radius:4px; transition:background-color 120ms, color 120ms; }
.camera-toolbar button svg { width:19px; height:19px; flex:none; }
.camera-toolbar button:hover:not(:disabled):not([aria-disabled=true]):not([aria-pressed=true]) { background:#dce0d0; }
.camera-toolbar button:focus-visible { outline:2px solid #315d44; outline-offset:2px; }
.camera-toolbar button:active:not(:disabled):not([aria-disabled=true]):not([aria-pressed=true]) { background:#ced5c4; }
.camera-presets button[aria-pressed=true] { color:#fff9e9; background:#31573f; }
.camera-presets button[aria-pressed=true]:hover { background:#264633; }
.camera-presets button[aria-pressed=true]:active { background:#203d2b; }
@media(prefers-reduced-motion:no-preference) { .camera-toolbar button:active:not(:disabled):not([aria-disabled=true]) { transform:scale(.97); } }
.camera-presets button[aria-disabled=true] { color:#606b5b; background:transparent; cursor:help; }
#camera-adjust { width:44px; padding:7px; border-left:1px solid #d0d5c5; border-radius:0 4px 4px 0; }
#camera-adjust[aria-expanded=true] { background:#dce0d0; }
#camera-adjust-panel { position:absolute; bottom:calc(100% + 8px); left:50%; transform:translateX(-50%); padding:4px; border-radius:7px; background:#f1eee0; box-shadow:0 5px 18px #18372832; }
#camera-adjust-panel[hidden] { display:none; }
.camera-manual-controls button { width:44px; padding:5px; }
.camera-manual-controls button span { display:none; }
#chat-section { display:contents; }
#chat-toggle { position:absolute; z-index:4; bottom:calc(env(safe-area-inset-bottom,0px) + 16px); right:24px; display:inline-flex; gap:7px; align-items:center; justify-content:center; min-height:54px; min-width:92px; padding:8px 16px; border-radius:7px; background:#2b4939; color:#fff7df; font-size:14px; font-weight:650; box-shadow:0 3px 12px #18372824; }
#chat-toggle svg { width:20px; height:20px; }#chat-toggle:hover { background:#42604a; }#chat-toggle[aria-expanded=true] { background:#d6e0ca; color:#264434; }
#chat-unread { min-width:18px; font:600 12px/18px Pretendard,sans-serif; text-align:center; padding:0 4px; border-radius:50%; color:#3e382a; background:#dac49a; }
#chat-panel { position:absolute; z-index:9; right:24px; top:calc(env(safe-area-inset-top,0px) + 138px); width:340px; max-width:calc(100% - 48px); bottom:calc(env(safe-area-inset-bottom,0px) + 88px); display:flex; flex-direction:column; border-radius:10px; overflow:hidden; background:#f5f1e6; color:#273d30; box-shadow:0 8px 32px #17332735; }
.chat-heading { display:flex; align-items:center; justify-content:space-between; gap:8px; padding:10px 12px 0 18px; }.chat-heading h2 { font-size:23px; margin:0; }
#chat-close { display:grid; place-items:center; width:44px; height:44px; border-radius:5px; }#chat-close svg { width:20px; height:20px; }#chat-close:hover { background:#e0e6d5; }
#chat-mute { align-self:start; padding:4px 0; margin:0 18px; min-height:32px; font-size:12px; text-decoration:underline; text-underline-offset:4px; }
#chat-mute[aria-pressed=true] { color:#79572a; }
.chat-privacy { margin:0; padding:1px 18px 10px; font-size:12px; line-height:1.55; color:#52644e; }
.chat-scroll { flex:1; min-height:0; overflow-y:auto; overscroll-behavior:contain; padding:10px 18px; border-top:1px solid #d0d6c5; scrollbar-color:#939d87 #e9e8dc; }
#chat-empty { margin:8px 0; font-size:14px; color:#4b6046; }#chat-log { list-style:none; margin:0; padding:0; }
#chat-log li { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:baseline; gap:2px 8px; padding:3px 0 12px; overflow-wrap:anywhere; font-size:14px; line-height:1.5; }
#chat-log li strong { color:#48614e; font-size:12px; }#chat-log li[data-self=true] strong { color:#79552c; }#chat-log li > span { grid-column:1/-1; grid-row:2; white-space:pre-wrap; }
#chat-log time { grid-column:2; grid-row:1; color:#586453; white-space:nowrap; font-size:12px; font-variant-numeric:tabular-nums; }
.chat-rules { padding:0 0 8px; }.chat-rules summary { min-height:36px; padding:6px 0; font-size:12px; border:0; text-decoration:underline; text-underline-offset:3px; }.chat-rules p { margin:4px 0 10px; font-size:12px; line-height:1.65; color:#52644e; }.chat-rules a { font-size:inherit; }
#chat-log .chat-report { grid-column:1/-1; grid-row:3; justify-self:start; min-height:40px; padding:6px 0; color:#52644e; font-size:12px; text-decoration:underline; text-underline-offset:3px; }
.chat-compose { padding:8px 12px 12px; border-top:1px solid #d0d6c5; }.chat-phrases { display:flex; flex-wrap:wrap; gap:3px; }.chat-phrases button { min-height:40px; padding:3px 7px; font-size:12px; text-decoration:underline; text-underline-offset:4px; text-decoration-color:#9aa28d; }.chat-phrases button:hover { background:#e3e4d6; }
#chat-form { display:flex; gap:6px; }#chat-input { flex:1; width:0; padding-inline:10px; }#chat-send { flex:none; min-width:48px; min-height:46px; padding:6px 12px; border-radius:5px; background:var(--pine); color:#fff8ea; font-weight:600; }#chat-status { font-size:12px; margin:6px 0 0; color:#455445; }
.play-drawer { position:absolute; z-index:11; top:calc(env(safe-area-inset-top,0px) + 74px); bottom:calc(env(safe-area-inset-bottom,0px) + 20px); right:20px; width:390px; max-width:calc(100% - 40px); padding:17px 22px 24px; border-radius:10px; background:#f7f3e8; overflow-y:auto; overscroll-behavior:contain; scrollbar-color:#939d87 #e9e8dc; box-shadow:0 8px 34px #17332735; }
.drawer-top { position:sticky; top:-17px; z-index:1; display:flex; align-items:center; justify-content:space-between; gap:12px; background:#f7f3e8; padding:0 0 10px; }.drawer-top h2 { margin:0; font-size:24px; }.drawer-top button { min-height:44px; padding:4px 8px; text-decoration:underline; text-underline-offset:4px; }
.play-drawer p { font-size:14px; color:#455a43; line-height:1.8; margin:12px 0; }.menu-actions { display:grid; gap:10px; margin-top:20px; }.menu-actions a { text-align:center; }.sound-choice { display:block; min-height:44px; font-size:14px; }
#people { list-style:none; margin:18px 0 0; padding:0; }#people li { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:7px; font-size:14px; overflow-wrap:anywhere; padding:12px 0; border-top:1px solid #ced5c1; }#people li button { min-height:44px; padding:7px 9px; font-size:12px; background:#e2e7d5; border-radius:5px; }#people li button[aria-pressed=true] { background:#365541; color:#fff8e7; }
.stage-caption { position:absolute; z-index:2; left:190px; right:190px; bottom:calc(env(safe-area-inset-bottom,0px) + 95px); margin:0; text-align:center; color:#284332; font-size:13px; font-weight:650; pointer-events:none; text-shadow:0 1px 4px #f8f6e9; }
.space-under { position:absolute; z-index:4; left:24px; bottom:calc(env(safe-area-inset-bottom,0px) + 18px); font-size:12px; }.space-under #move-help { display:none; }.space-under > div { display:flex; flex-wrap:wrap; gap:5px; }.space-under button { padding:6px 9px; min-height:44px; border-radius:4px; background:#f8f4e7; color:#314b39; font-size:12px; text-underline-offset:4px; }
.scene-intro {
  position:absolute;
  z-index:3;
  top:calc(env(safe-area-inset-top,0px) + 118px);
  left:20px;
  max-width:min(65%,500px);
  padding:6px 10px;
  border-radius:4px;
  color:#355038;
  background:#f6f2e4;
  pointer-events:none;
}
.scene-intro h1 { margin:0; font-size:1rem; line-height:1.25; }
.scene-intro p { margin:2px 0 0; font-size:.8125rem; line-height:1.4; }#space-status:empty { display:none; }
#link-fallback { position:absolute; z-index:14; top:75px; left:50%; transform:translateX(-50%); width:min(480px,calc(100% - 40px)); padding:18px; border-radius:9px; background:#f9f5e9; box-shadow:0 8px 28px #00000038; font-size:13px; }
#legacy-records { position:fixed; z-index:20; inset:calc(var(--play-top,0px) + 12px) max(20px,calc((100vw - 1050px)/2)) 12px; padding:0 28px 28px; background:#f7f3e8; border-radius:12px; overflow:auto; overscroll-behavior:contain; box-shadow:0 12px 50px #17332760; }
#legacy-records:not([open]) { display:none; }#legacy-records > summary { padding:16px 0; padding-right:165px; font-size:18px; position:sticky; top:0; z-index:2; background:#f7f3e8; }#legacy-records .records-close { position:sticky; z-index:3; float:right; top:5px; margin-top:-55px; min-height:44px; padding:7px 10px; background:#2b4a39; color:#fff7e6; border-radius:5px; font-size:12px; }#legacy-records .intro { padding:30px 0; }#legacy-records .intro h1 { font-size:38px; }#legacy-records .records { gap:40px; }
.play-screen > footer { display:none; }.play-screen dialog { z-index:30; max-height:calc(var(--play-height,100dvh) - 36px); overflow:auto; }
@media (max-width:850px) {
  .camera-toolbar { left:24px; transform:none; }.camera-toolbar #camera-adjust-panel { left:0; transform:none; }
  .space-under { left:50%; bottom:calc(env(safe-area-inset-bottom,0px) + 80px); transform:translateX(-50%); }.space-under #leave-room { position:absolute; width:1px; height:1px; padding:0; margin:0; min-height:0; clip-path:inset(50%); overflow:hidden; } .space-under #leave-room:focus { position:static; width:auto; height:auto; min-height:44px; clip-path:none; }
  .space-heading { right:12px; }.play-brand { left:12px; }.play-brand .brand { font-size:19px; padding-right:10px; gap:4px; }.play-brand .brand svg { width:26px; height:26px; }
  .entry-actions button { padding:8px 10px; font-size:13px; }#profile-label { max-width:95px; }.entry-actions #room-toggle { font-size:0; width:44px; min-width:44px; padding:10px; }.entry-actions #room-toggle::before { content:""; display:block; width:20px; height:20px; background:currentColor; mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M10 7H7a5 5 0 0 0 0 10h3m4-10h3a5 5 0 0 1 0 10h-3M8 12h8' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'%2F%3E%3C/svg%3E") center/contain; }
}
@media (max-width:600px) {
  .play-brand { top:calc(var(--play-top,0px) + env(safe-area-inset-top,0px) + 10px); }.play-brand .brand { padding-left:4px; font-size:18px; }.space-heading { top:calc(env(safe-area-inset-top,0px) + 10px); }.entry-actions { gap:4px; }.entry-actions #profile-toggle { gap:4px; padding-inline:8px; }#profile-label { max-width:73px; }
  .space-topline { inset:calc(env(safe-area-inset-top,0px) + 65px) 12px auto; gap:6px; }#connection { font-size:12px; padding:4px 7px; max-width:64%; }.companions { font-size:12px; min-height:36px; padding:5px 8px; gap:5px; }.companions svg { width:14px; height:14px; }
  .scene-intro { left:12px; top:calc(env(safe-area-inset-top,0px) + 107px); max-width:calc(100% - 24px); }.space-controls { left:12px; right:12px; bottom:calc(env(safe-area-inset-bottom,0px) + 76px); gap:8px; }.dpad { --size:130px; }.dpad button { width:44px; height:44px; }.dpad button[data-dir="0,-1"],.dpad button[data-dir="0,1"] { left:calc(50% - 22px); }.dpad button[data-dir="-1,0"],.dpad button[data-dir="1,0"] { top:calc(50% - 22px); }
  .mat-action { max-width:calc(100% - 140px); gap:5px; }.mat-action button { min-height:44px; padding:8px 10px; font-size:12px; }#avatar-count { font-size:12px; padding:2px 5px; }.camera-toolbar { left:12px; bottom:calc(env(safe-area-inset-bottom,0px) + 12px); }.camera-toolbar .camera-presets button { padding-inline:8px; }.camera-toolbar > div { gap:0; }
  #chat-toggle { right:12px; bottom:calc(env(safe-area-inset-bottom,0px) + 12px); min-height:52px; min-width:64px; padding:7px 10px; font-size:13px; gap:4px; }#chat-toggle svg { width:18px; height:18px; }
  #chat-panel { top:calc(env(safe-area-inset-top,0px) + 145px); bottom:calc(env(safe-area-inset-bottom,0px) + 224px); left:12px; right:12px; width:auto; max-width:none; min-height:260px; }.chat-heading { padding-top:4px; }.chat-heading h2 { font-size:21px; }#chat-mute { min-height:27px; }.chat-privacy { padding-bottom:6px; font-size:12px; }.chat-phrases button { min-height:32px; font-size:12px; }.chat-compose { padding-top:4px; }#chat-status { font-size:12px; }
  .stage-caption { left:150px; right:12px; bottom:calc(env(safe-area-inset-bottom,0px) + 224px); font-size:12px; text-align:right; }.entry-panel { top:65px; right:12px; width:calc(100% - 24px); padding:18px; }.play-drawer { top:65px; right:12px; bottom:12px; max-width:calc(100% - 24px); padding-inline:18px; }.drawer-top h2 { font-size:23px; }
  #legacy-records { inset:calc(var(--play-top,0px) + 6px) 6px 6px; padding-inline:16px; }#legacy-records > summary { font-size:15px; padding-right:120px; }#legacy-records .records-close { font-size:12px; padding:6px 8px; }#legacy-records .intro h1 { font-size:32px; }.play-screen dialog { margin:12px; max-width:calc(100% - 24px); }
}
@media (max-width:360px) {
  .play-brand .brand span { font-size:16px; }.play-brand .brand svg { width:24px; height:24px; }#profile-label { max-width:48px; }.entry-actions #profile-toggle svg { display:none; }.camera-toolbar { padding:3px; gap:2px; }.camera-toolbar .camera-presets button { padding-inline:6px; font-size:12px; }#chat-toggle { min-width:58px; padding-inline:7px; }
}
@media (max-height:600px) and (min-width:601px) {
  .space-controls { bottom:75px; }.dpad { --size:118px; }.stage-caption { display:none; }.scene-intro { max-width:45%; }.play-drawer { top:70px; bottom:12px; }#chat-panel { top:75px; bottom:80px; }.chat-heading { padding-top:3px; }.chat-privacy { font-size:12px; padding-bottom:5px; }#chat-mute { min-height:25px; }.chat-phrases button { min-height:32px; }.chat-compose { padding:4px 10px 8px; }
}
@media (max-height:600px) and (max-width:600px) {
  #chat-panel { top:60px; bottom:70px; min-height:0; }.chat-privacy,.chat-phrases,#chat-mute { display:none; }.chat-heading { padding:0 8px 0 12px; }.chat-heading h2 { font-size:18px; }.chat-compose { padding:5px 8px 8px; }.chat-scroll { padding:5px 12px; }
}
@media(prefers-reduced-motion:reduce) { .dpad button svg, .camera-toolbar button { transition:none; }.camera-toolbar button:active { transform:none; } }

#public-notice { position:absolute; z-index:2; top:calc(env(safe-area-inset-top,0px) + 156px); left:20px; max-width:calc(100% - 40px); margin:0; padding:4px 8px; border-radius:3px; font-size:12px; background:#f4f1e2; color:#445c41; pointer-events:none; }
@media(max-width:600px) { #public-notice { left:12px; top:calc(env(safe-area-inset-top,0px) + 145px); max-width:calc(100% - 24px); font-size:12px; } }


.space-utilities { display:flex; gap:6px; align-items:start; flex:none; pointer-events:auto; }
.space-topline #connection { max-width:min(440px,calc(100% - 235px)); }
#sound-toggle { display:inline-flex; align-items:center; justify-content:center; gap:7px; min-width:104px; min-height:44px; padding:7px 12px; border-radius:4px; background:#fbf6e9; color:#294333; font-size:13px; }
#sound-toggle svg { width:20px; height:20px; flex:none; }
#sound-toggle:hover, #sound-toggle[aria-expanded=true] { background:#dce4d2; }
#sound-toggle[data-playing=true] { background:#d9c49a; color:#303d2a; }
#sound-toggle[data-playing=true] #sound-icon-off { display:none; }
#sound-panel .sound-intro { margin:0 0 18px; }
.sound-part { padding:17px 0 18px; border-top:1px solid #c8d1bd; }
.sound-part h3 { margin:0 0 12px; font-size:20px; }
#sound-panel .sound-part p { margin:-4px 0 13px; font-size:13px; }
.moktak-hit { display:flex; align-items:center; justify-content:center; gap:12px; width:100%; min-height:72px; padding:10px 15px; margin-bottom:9px; border-radius:7px; background:#6b4f35; color:#fff6e5; font-size:16px; font-weight:650; box-shadow:0 3px 10px #00000020; }
.moktak-hit svg { width:40px; height:40px; }
.moktak-hit:hover { background:#7b5d3c; }.moktak-hit:active { background:#4d3c2c; transform:translateY(1px); }
.sound-play { width:100%; min-height:46px; padding:8px 12px; border-radius:5px; background:#2c4b39; color:#fff7e5; font-size:14px; font-weight:650; }
.sound-play:hover { background:#43634b; }.sound-play[aria-pressed=true] { background:#d4ddc7; color:#2a4433; }
.sound-play:disabled { opacity:.6; }
.sound-slider { display:block; margin-top:16px; font-size:13px; font-weight:600; }
.sound-slider > span { display:flex; justify-content:space-between; gap:12px; align-items:baseline; }
.sound-slider output { color:#52634a; font-weight:400; font-variant-numeric:tabular-nums; }
#sound-panel .sound-slider input { display:block; width:100%; height:44px; margin:2px 0 0; padding:0; accent-color:#31543e; cursor:pointer; }
.sound-ending { display:flex; align-items:center; justify-content:space-between; gap:12px; padding-top:14px; border-top:1px solid #c8d1bd; }
.sound-ending .sound-choice { flex:1; display:flex; align-items:center; gap:8px; font-size:13px; line-height:1.6; }
.sound-ending input { width:18px; height:18px; flex:none; accent-color:#31543e; }
#sound-stop { min-height:44px; flex:none; padding:8px 11px; border-radius:5px; font-size:13px; }
#sound-stop:disabled { opacity:.5; cursor:default; }
#sound-panel #sound-status { margin:12px 0; font-size:13px; color:#3f583f; }
.sound-credits { margin-top:12px; border-top:1px solid #c8d1bd; padding-top:5px; }
.sound-credits summary { min-height:44px; padding:10px 0; font-size:13px; }
#sound-panel .sound-credits p { font-size:12px; line-height:1.7; margin:5px 0 10px; }
.sound-credits a { text-underline-offset:3px; }
@media (max-width:600px) {
  .space-topline #connection { max-width:calc(100% - 160px); min-height:44px; }
  .space-utilities .companions { min-height:44px; }
  #sound-toggle { min-width:44px; width:44px; padding:0; }
  #sound-indicator { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
  #sound-panel { top:65px; }
}
@media (max-height:600px) {
  #sound-panel { top:65px; }
  #sound-panel .sound-intro { margin-bottom:10px; font-size:13px; }
  .sound-part { padding-block:13px; }.sound-slider { margin-top:10px; }
}
@media (prefers-reduced-motion:reduce) { .moktak-hit:active { transform:none; } }

.chant-loop { display:flex; align-items:center; gap:8px; min-height:44px; font-size:13px; line-height:1.6; margin-top:6px; }
.chant-loop input { width:18px; height:18px; flex:none; accent-color:#31543e; }

/* A small, steady doorway to earned items keeps the 3D space in the foreground. */
.wallet-chip { position:absolute; z-index:4; top:calc(env(safe-area-inset-top,0px) + 195px); left:20px; display:inline-flex; align-items:center; gap:9px; min-height:44px; padding:7px 12px; border-radius:5px; background:#fbf6e9; color:#294333; font-size:13px; font-variant-numeric:tabular-nums; box-shadow:0 3px 12px #18372824; }
.wallet-chip svg { width:21px; height:21px; flex:none; }
.wallet-chip strong { font-weight:700; }
.wallet-unit { font-size:12px; }
.wallet-link { margin-left:2px; padding-left:9px; border-left:1px solid #c6cbb9; font-size:12px; font-weight:600; }
.wallet-chip:hover, .wallet-chip[aria-expanded=true] { background:#dbe4ce; }
.wallet-chip:active { background:#cad7b9; }
#shop-panel { width:420px; }
.wallet-summary { display:grid; grid-template-columns:1.1fr 1fr; gap:18px; padding:15px 0; margin:0; border-top:1px solid #c8d1bd; border-bottom:1px solid #c8d1bd; }
.wallet-summary > div { display:block; padding:0; border:0; }
.wallet-summary dt { margin:0 0 6px; font-size:12px; font-weight:500; color:#52604e; }
.wallet-summary dd { display:flex; gap:5px; align-items:baseline; margin:0; color:#294333; font-size:22px; line-height:1.4; font-variant-numeric:tabular-nums; }
.wallet-summary dd > span:last-child { font-size:12px; }
#shop-panel .shop-rule { margin:12px 0 3px; font-size:13px; line-height:1.6; }
#shop-panel .shop-private-note { margin:0 0 10px; font-size:12px; line-height:1.6; color:#52604e; }
.shop-items { list-style:none; margin:0; padding:0; }
.shop-item { display:grid; grid-template-columns:88px minmax(0,1fr) 64px; align-items:center; gap:12px; padding:12px 0; border-top:1px solid #c8d1bd; }
.shop-item-image { display:block; width:88px; height:96px; object-fit:contain; border-radius:8px; background:#e5e7da; }
.shop-item[data-kind=outfit] .shop-item-image { padding:2px; background:#e9e5d9; }
.shop-item-copy { min-width:0; }
.shop-item h3 { margin:0; font:600 17px/1.45 Pretendard,sans-serif; color:#263c35; overflow-wrap:anywhere; }
.shop-cost { display:block; margin-top:5px; color:#615030; font-size:12px; font-weight:650; font-variant-numeric:tabular-nums; }
.shop-item button { min-height:44px; min-width:64px; max-width:64px; padding:8px 5px; border-radius:5px; background:#2c4b39; color:#fff7e5; font-size:13px; line-height:1.5; font-weight:600; }
.shop-item button:hover:not(:disabled) { background:#43634b; }
.shop-item[data-state=owned] button { background:#e0e7d5; color:#294333; }
.shop-item[data-state=equipped] button, .shop-item button:disabled { background:#e5e5d8; color:#58614f; }
.shop-item[data-state=equipped] .shop-cost { color:#31543e; }
.shop-item button:disabled { cursor:default; }
.shop-loading { padding:18px 0; color:#52604e; font-size:13px; }
#shop-status, #wallet-storage-note { overflow-wrap:anywhere; }
#shop-panel #shop-status { margin:12px 0 0; color:#31543e; font-size:13px; }
#shop-status:empty, #wallet-storage-note:empty { display:none; }
.wallet-recovery { margin-top:12px; padding-top:8px; border-top:1px solid #c8d1bd; }
.wallet-recovery > summary { min-height:44px; padding:10px 0; color:#294333; cursor:pointer; font:600 14px/1.6 Pretendard,sans-serif; }
.wallet-recovery > summary:focus-visible { outline:3px solid #997641; outline-offset:3px; }
#shop-panel .wallet-recovery p { margin:8px 0 12px; font-size:12px; line-height:1.75; }
.wallet-recovery-actions { display:flex; flex-wrap:wrap; gap:8px; }
#wallet-backup, .wallet-import { position:relative; display:inline-flex; align-items:center; justify-content:center; min-height:44px; padding:8px 11px; margin:0; border:1px solid #a8b29d; border-radius:5px; background:#fffaf0; color:#294333; font-size:12px; line-height:1.5; font-weight:600; cursor:pointer; }
#wallet-backup:hover, .wallet-import:hover { background:#dce4d2; }
.wallet-import input { position:absolute; inset:0; width:100%; height:100%; margin:0; padding:0; opacity:0; cursor:pointer; }
.wallet-import:focus-within { outline:3px solid #997641; outline-offset:3px; }
#shop-panel .wallet-warning { color:#675032; }
#sweep-status { display:block; max-width:250px; padding:5px 8px; border-radius:3px; background:#fbf7eb; color:#354738; font-size:12px; line-height:1.6; text-align:right; }
#sweep-start[data-active=true] { background:#725331; }
#shop-panel ::selection { color:#fff9ed; background:#3b5b42; }
#shop-panel button:focus-visible, .wallet-chip:focus-visible, .mat-action button:focus-visible { outline:3px solid #997641; outline-offset:3px; }
@media(max-width:600px) {
  .wallet-chip { top:calc(env(safe-area-inset-top,0px) + 192px); left:12px; padding-inline:10px; gap:7px; }
  #shop-panel { top:65px; left:12px; right:12px; width:auto; }
  .shop-item { grid-template-columns:76px minmax(0,1fr) 60px; gap:10px; }
  .shop-item-image { width:76px; height:88px; }
  .shop-item h3 { font-size:16px; }
  .shop-item button { min-width:60px; max-width:60px; }
  .wallet-summary { gap:13px; }
  #sweep-status { max-width:100%; }
}
@media(max-height:500px) and (min-width:601px) {
  .wallet-chip { top:calc(env(safe-area-inset-top,0px) + 14px); left:50%; transform:translateX(-50%); }
  #shop-panel { top:65px; }
  .wallet-summary { padding-block:10px; }
}

#wallet-previous { margin-top: 16px; }
#wallet-previous select { width: 100%; min-height: 44px; margin: 8px 0; }
#wallet-previous button { width: 100%; min-height: 44px; }

#space-status:empty { display: none; }
.help-steps { list-style: none; padding: 0; margin: 6px 0 18px; }
.help-steps li { padding: 6px 0; color: #455a43; font-size: 14px; line-height: 1.7; }
.help-steps strong { display: inline-block; min-width: 76px; color: #294333; font-weight: 650; }

.market-chip { position:absolute; z-index:4; top:calc(env(safe-area-inset-top,0px) + 245px); left:20px; display:flex; align-items:center; gap:7px; min-height:44px; max-width:110px; padding:7px 10px; border-radius:5px; color:#fff4d7; background:#64502f; font-size:13px; }
.wallet-chip { gap:5px; padding-inline:10px; max-width:110px; }
.wallet-chip .wallet-link { display:none; }
.market-chip svg { width:20px; height:20px; }
.market-chip:hover,.market-chip[aria-expanded=true] { background:#7c6034; }
@media (max-height:600px) and (min-width:601px) {
  .wallet-chip { top:calc(env(safe-area-inset-top,0px) + 14px); left:168px; transform:none; }
  .market-chip { top:calc(env(safe-area-inset-top,0px) + 14px); left:286px; }
}
@media (max-height:600px) and (min-width:601px) and (max-width:850px) {
  .wallet-chip { left:142px; }
  .market-chip { left:260px; }
}
@media (max-height:600px) and (min-width:601px) and (max-width:700px) {
  .market-chip { width:44px; justify-content:center; padding:7px; font-size:0; }
}
.market-nearby { position:absolute; z-index:5; right:22px; bottom:calc(env(safe-area-inset-bottom,0px) + 300px); display:flex; flex-direction:column; align-items:end; gap:6px; max-width:230px; }
.market-nearby button,.snack-actions button { min-height:44px; padding:8px 12px; background:#fff4dc; color:#3a4934; border-radius:5px; font-size:13px; box-shadow:0 3px 12px #18372824; }
.market-nearby button:hover { background:#e9dfc4; }
.snack-actions { position:absolute; z-index:5; right:22px; top:calc(env(safe-area-inset-top,0px) + 115px); display:flex; align-items:center; flex-wrap:wrap; justify-content:end; gap:6px; max-width:260px; padding:6px; border-radius:7px; background:#f5ecda; color:#364835; }
.snack-actions > span { width:100%; text-align:right; padding:0 5px; font-size:12px; }
.snack-actions button { box-shadow:none; background:#3b513b; color:#fff8e7; }
#market-panel { color:#263c35; }
#market-panel h3 { font:600 19px/1.5 Pretendard,sans-serif; margin:24px 0 10px; }
#market-panel #market-position { font-size:12px; line-height:1.7; color:#645231; padding-bottom:14px; border-bottom:1px solid #c8c9b8; }
#market-panel .market-small,#market-panel #inventory-empty { font-size:12px; line-height:1.7; margin:7px 0 12px; }
.market-menu-heading { display:flex; justify-content:space-between; align-items:baseline; gap:12px; }
.market-menu-heading h3 { margin-bottom:4px!important; }
#market-balance { font-variant-numeric:tabular-nums; font-weight:700; color:#66502b; }
#market-menu,#snack-inventory,#public-wishes { list-style:none; padding:0; margin:0; }
#market-menu li,#snack-inventory li { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:13px 0; border-bottom:1px solid #d3d4c3; }
#market-menu li strong { display:block; font-size:16px; }
#market-menu li span { display:block; margin-top:4px; font-size:12px; color:#665435; }
#market-panel button { min-height:44px; font-size:13px; }
#market-menu button,#snack-inventory button,.wish-buttons button { flex:none; padding:8px 11px; border-radius:5px; background:#3c553e; color:#fff8e7; }
#market-panel button:disabled { background:#e0e0d2; color:#56604e; cursor:default; }
.npc-conversation { padding-bottom:18px; border-bottom:1px solid #c5cab7; }
#market-panel .npc-conversation h3 { margin:3px 0 8px; font:600 24px/1.5 'Nanum Myeongjo',serif; }
#market-panel #npc-line { min-height:3.6em; margin-top:8px; }
#npc-choices { display:flex; flex-wrap:wrap; gap:6px; }
#npc-choices button { padding:8px 9px; border-radius:5px; background:#e3e7d7; color:#324c37; }
.wish-form { padding-top:4px; }
.wish-form > label { display:block; margin:12px 0 5px; font-size:13px; font-weight:600; }
.wish-form input[type=text],.wish-form select { width:100%; min-height:44px; padding:10px; border:1px solid #a7b19a; border-radius:5px; background:#fffaf0; color:#263c35; font:400 14px/1.65 Pretendard,sans-serif; caret-color:#34573f; }
.wish-form textarea { resize:vertical; }
.wish-form input[type=text]::placeholder { color:#616a55; }
.wish-form .wish-public-choice { display:flex; align-items:center; gap:8px; min-height:44px; }
.wish-public-choice input { width:18px; height:18px; accent-color:#35563f; }
.wish-buttons { display:flex; flex-wrap:wrap; gap:8px; }
.wish-buttons #wish-delete { background:#e3e3d3; color:#374b34; }
.wish-buttons button { min-height:44px; }
.wish-buttons #wish-release { background:#65502d; color:#fff8e7; }
.wish-buttons #wish-save,.wish-buttons #wish-watch { background:#e3e3d3; color:#374b34; }
.lantern-live { padding-top:8px; }
#lantern-live-list { list-style:none; padding:0; margin:0; }
#lantern-live-list li { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:8px 0; border-bottom:1px solid #d6d7c6; font-size:13px; }
#lantern-live-list button { min-height:44px; padding:8px 12px; border-radius:5px; background:#e3e3d3; color:#374b34; }
#lantern-watch-nearby { background:#65502d; color:#fff8e7; }
#lantern-watch-nearby:hover { background:#4f3f25; }
#lantern-live-list button:focus-visible { outline:3px solid #997641; outline-offset:3px; }
.shared-wishes { border-top:1px solid #c5cab7; margin-top:24px; }
.shared-wishes summary { cursor:pointer; min-height:44px; padding:12px 0; font-size:14px; }
#public-wishes li { border-bottom:1px solid #d3d4c3; padding-bottom:8px; overflow-wrap:anywhere; }
#public-wishes button { padding:4px 0; text-decoration:underline; text-underline-offset:4px; color:#64502f; }
#market-panel #market-status { position:sticky; top:0; z-index:2; background:#f7f3e8; padding:12px 0; font-size:13px; color:#34543d; }
#market-status:empty { display:none; }
#market-panel button:focus-visible,.market-chip:focus-visible,.market-nearby button:focus-visible,.snack-actions button:focus-visible,#market-panel input[type=text]:focus-visible,#market-panel select:focus-visible { outline:3px solid #997641; outline-offset:3px; }
@media(max-width:600px) {
  .market-chip { top:calc(env(safe-area-inset-top,0px) + 242px); left:12px; font-size:12px; padding-inline:10px; }
  .market-nearby { right:12px; bottom:calc(env(safe-area-inset-bottom,0px) + 278px); max-width:calc(100% - 155px); }
  .market-nearby button { font-size:12px; padding-inline:9px; }
  .snack-actions { top:calc(env(safe-area-inset-top,0px) + 245px); right:12px; max-width:170px; }
  .snack-actions button { padding:7px 9px; font-size:12px; }
  #market-panel { top:65px; left:12px; right:12px; width:auto; }
}
@media(max-height:600px) { .market-nearby { bottom:210px; } .snack-actions { top:110px; } }

.play-brand .brand { min-height:44px; }
@media (max-height:600px) and (min-width:601px) { .market-nearby { top:128px; bottom:auto; right:12px; max-width:calc(100% - 180px); flex-direction:row; flex-wrap:wrap; align-items:center; justify-content:flex-end; } }

.winter-settings { margin-top:16px; padding-top:8px; border-top:1px solid #c5cab7; }
.winter-settings label { display:flex; align-items:center; gap:9px; min-height:44px; font-size:14px; }
#snow-toggle { width:20px; height:20px; accent-color:#315e4b; }
#snow-toggle:focus-visible { outline:3px solid #997641; outline-offset:3px; }
.winter-settings p { margin:3px 0 0; }
