/* Night glass: warm rooms, quiet dark controls, one clear active state. */
:root{color-scheme:dark;--paper:#181c1b;--ink:#f0f0e9;--line:#ffffff16;--rust:#e98f73;--glass:rgba(17,22,21,.78);--muted:#b3bcb5;--selected:#dee8dd}
body{background:#111615;color:#f0f0e9}button,a,input,select{outline-color:#b9d4c0!important}button:focus-visible,a:focus-visible,input:focus-visible{outline:2px solid #b9d4c0!important;outline-offset:3px}
.vignette{background:linear-gradient(180deg,#07100d24,transparent 30%,transparent 65%,#07100d50)}
.brand,.round-btn,.pill,.preview-tag,.small-actions,.room-nav,#chat-panel,#emote-tray,.camera-tools button,#secondary-action,#bath-actions button,#motion-row button,#locker-actions button,#snack-fun button,#studio-motions button,#studio-angles button{background:var(--glass);color:#edf1e9;border:1px solid #ffffff1a;box-shadow:0 6px 24px #00000014;backdrop-filter:blur(20px) saturate(115%);-webkit-backdrop-filter:blur(20px) saturate(115%)}
.brand{border-radius:14px}.brand b,.brand-mark{color:#ed967b}.brand small{color:#c4cbc2;letter-spacing:.25em}.round-btn,.pill,.preview-tag{box-shadow:none}.top-tools .preview-tag{font-size:11px}
.room-heading{background:linear-gradient(120deg,#131b18d6,#131b1878);border:1px solid #ffffff13;backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px);color:#f2f2e9;border-radius:16px;padding:14px 17px}
.room-heading h1{color:#f2f2e9;font-size:23px;font-weight:650;letter-spacing:-.055em}.room-heading p,.room-heading .eyebrow,#room-population{color:#bcc5bc}.room-heading .divider{color:#8c998d}#branch-open{color:#e0e9de;border-color:#8a9b8e}#npc-open,#yardog-btn{background:#ffffff0c;color:#d9e5d7;border:1px solid #ffffff0e;box-shadow:none}
#climate{color:#f1f0df;text-shadow:0 2px 18px #10251d80}#climate b{font-weight:400}#climate span{color:#e3e9dc}.room-status #sound-btn.active,.room-status #sound-btn[aria-checked=true]{background:#223e33d9;color:#d6ebd8;border-color:#b9e8c22b}
#bath-tabs{background:#070e0b50;border:1px solid #ffffff12;padding:4px;border-radius:20px}#bath-tabs button{background:transparent;color:#c6d0c7;border-radius:15px}#bath-tabs button.active{background:var(--selected);color:#1b3023;box-shadow:none}
.small-actions{padding:4px;border-radius:17px}.small-actions button{background:transparent;color:#dde5dd;font-weight:450!important}.small-actions button:hover{background:#ffffff12}.small-actions button.active,.small-actions button[aria-checked=true],#motion-toggle[aria-expanded=true],#emote-btn[aria-expanded=true]{background:#e0e9dd;color:#203326}.actions{gap:8px}.action-primary{background:#dbe7db;color:#1e3425;box-shadow:0 5px 18px #0002;border:1px solid #ffffff30;font-weight:650!important}.action-primary:hover{background:#edf4e7}.action-primary:disabled{background:#c2d1c1;color:#3a4d3e}.action-primary #action-key{border-color:#20332635;color:#425647}
.room-nav{border-radius:20px;padding:7px}.room-nav button{background:transparent;color:#c4cec5;border-radius:13px}.room-nav button>b{font-weight:500}.room-nav button>small{color:#97a69a}.room-nav button.selected{background:var(--selected);color:#1e3425;box-shadow:none}.room-nav button.selected>small{color:#526756}.room-nav button:hover:not(.selected){background:#ffffff0b}.talk-dot{background:#c58e73}.bottom-caption{color:#c4cdc4}.bottom-caption button{background:transparent;color:#cad4c8}.bottom-caption a{color:#d2dfcc}
#chat-toggle{padding:10px 17px;font-size:11px}#chat-panel{border-radius:17px}#chat-title,.chat-meta{color:#b9c9b8}#chat-close,#chat-info{background:transparent;color:#c4d2c0}#chat-input{background:#080f0c65;color:#f2f4ed;border:1px solid #ffffff16;border-radius:12px}#chat-input::placeholder{color:#8f9f93}#chat-form button{background:#ccdfca;color:#193322}.chat-line{color:#dae2d8}.chat-line b{color:#a9d1ae}#chat-messages:empty:before{color:#98a89b}#world-bubble,.peer-emote{background:#17231ee8;color:#ecf4e7;border:1px solid #ffffff20}#first-tip,#toast{background:#17281ff0;color:#e5f0df;border:1px solid #ffffff24;box-shadow:0 10px 35px #0002}#my-status,#gesture-hint{background:#121d17a6;color:#c6d7c5;border:1px solid #ffffff12;backdrop-filter:blur(12px)}
dialog,dialog#branches,dialog#egg-game,dialog#settings,dialog#sleep-dialog{background:#19201cf5;color:#edf0e6;border:1px solid #ffffff21;box-shadow:0 25px 100px #0007;backdrop-filter:blur(28px);-webkit-backdrop-filter:blur(28px)}dialog::backdrop{background:#050d098a;backdrop-filter:blur(7px)}dialog h2,dialog h3,dialog label{color:#eef0e7}dialog p,dialog .prototype-note,.dialog-kicker,.eyebrow{color:#a8b9a8}dialog .close{background:#ffffff0b;color:#cfdbcc;border:1px solid #ffffff13}dialog .dialog-action,.primary-button{background:#d1e1ce;color:#1b3521;box-shadow:none;border:0}dialog a{color:#bfdbbf}dialog input:not([type=range]):not([type=checkbox]),dialog select,#entry-form input:not([type=checkbox]){background:#0e1712;color:#e2eadf;border-color:#ffffff24}input[type=range],input[type=checkbox]{accent-color:#a9c7ab}.quiet-note,.help-cards article,.visit-options button,.room-option{background:#ffffff08;color:#c0cdbb;border-color:#ffffff14}.help-cards h3{color:#d3e3cb}.help-cards article>b{color:#93b393}.help-cards p{color:#a5b6a3}.npc-face{color:#c5d9b7;background:#243526}
#welcome.branch-dialog{background:#171e1beF;border:1px solid #ffffff20;box-shadow:0 25px 100px #0008}#welcome::backdrop{background:#0d1712ed}.welcome-panel{background:linear-gradient(135deg,#222a23f0,#111a16ee)}#welcome .entry-title h2,#welcome #entry-character{color:#ecf0e5}#welcome .entry-title p,#welcome .welcome-footer,.entry-steps,.entry-bottom>span:first-child{color:#95a692}.entry-stamp,#entry-live,.entry-bottom b{color:#a4b7a0}.ticket-icon{background:#ffffff09;color:#ee9b7b}.entry-topline,.entry-bottom,.entry-steps{border-color:#ffffff14}.entry-steps .active{color:#c9e1c1}.entry-steps .active b{background:#a8c4a5;color:#1b3320}.entry-branch-choice{background:#ffffff06;border-color:#ffffff1e}.entry-branch-choice:hover{background:#ffffff0c;border-color:#9eb197}.entry-branch-choice strong{color:#e5efdf}.entry-branch-choice>span,.entry-branch-choice>b,.entry-branch-choice small{color:#9caf97}#entry-start-room legend{color:#a6b89e}#entry-start-room span{background:#ffffff04;border-color:#ffffff14;color:#94a58c}#entry-start-room input:checked+span{background:#c8d9bc;color:#20321b;border-color:#c8d9bc;box-shadow:none}.entry-sound>span,.entry-sound strong{color:#d1ddc7}.entry-sound small{color:#8fa487}.entry-sound input{background:#465641}.entry-sound input:checked{background:#8baa7c}.entry-sound input:before{background:#edf4e5}#welcome .dialog-action{background:#c9ddbd;color:#1c3318;box-shadow:none}#welcome .dialog-action:hover{background:#e0ecd5}.entry-round-stamp{color:#d28e70;border-color:#a96b4c}
.branch-card{background:#ffffff06;color:#d3dfc8;border-color:#ffffff18;box-shadow:none}.branch-card.selected{outline:1px solid #b1cea1;background:#9abd7d24;color:#e4f0d9}.branch-card:hover:not(:disabled){border-color:#a1bd90}.branch-meter{background:#ffffff13}.branch-meter i{background:linear-gradient(90deg,#669b88,#b8ce8c)}.branch-state,.branch-count small,.branch-summary{color:#9eb391}.branch-pages button{background:#ffffff08;color:#a6b99a}.branch-pages button[aria-current=page]{background:#bed5aa;color:#26381c}.branch-card.full{background:#412921;color:#dbab8f}#entry-choose-done{background:#c9ddbd;color:#1c3318}#welcome .invite-notice{background:#ffffff08;color:#bbcfac}#entry-error{background:#63352870;color:#f3bda5}
.reveal-orbit{background:radial-gradient(#7c987d44,transparent 70%);border-color:#94af8960}.reveal-eyebrow,.reveal-line{color:#b3c5a8}.entry-ticket{background:#ffffff06;border-color:#ffffff25}.entry-ticket>span,.entry-ticket small{color:#9db58f}.entry-ticket strong{color:#d8e8cb}.rarity-badge{background:#33442c;color:#d1e8c0;border-color:#60724e}.rarity-badge[data-rarity='유니크']{background:#47344c;color:#e7ceec;border-color:#795d83}.rarity-badge[data-rarity='신화']{background:#534125;color:#f6dfa8;border-color:#9b7f47}.rarity-badge[data-rarity='울트라레어']{background:#304657;color:#c2ddee;border-color:#567a91}
#egg-game .egg-hint,#egg-progress{color:#d2dfc7}#egg-tap{background:transparent!important;border:0!important}#egg-meter::-webkit-progress-bar{background:#ffffff12}#egg-meter::-webkit-progress-value{background:#bad4a7}#sleep-dialog select{background:#111b15;color:#d8e7cd;border-color:#ffffff24}
@container(max-width:680px){.room-heading{padding:11px 13px;max-width:calc(100% - 91px)}.room-heading h1{font-size:18px}.brand{padding:8px 10px}.small-actions{padding:3px}.small-actions button{padding:8px 9px;min-height:37px}.room-nav{padding:5px}.room-nav button{min-height:54px}.room-nav button>b{font-size:10px}#chat-panel{max-height:190px}.chat-open #snack-fun,.chat-open .actions{display:none}#chat-messages{max-height:70px}.bottom-caption{display:none}#first-tip{bottom:auto;top:235px;max-width:calc(100% - 35px)}#my-status{background:#121d17a6;color:#c6d7c5}.room-status #climate{display:flex;flex-direction:column;align-items:center;justify-content:center;width:38px;height:38px;background:#17231ec9;border:1px solid #ffffff18;border-radius:12px;text-shadow:none}.room-status #climate b{font-size:18px;line-height:1}.room-status #climate span{display:none}}
@media(max-width:700px){#welcome[open]{border-radius:0;border:0}.welcome-panel{background:#171f19}.top-tools .preview-tag{font-size:9px}}
@media(prefers-reduced-transparency:reduce){:root{--glass:#17201a}.room-heading,dialog{background:#17201a}}

#room-desc{color:#bdc8b8}

/* Stable composer: keyboard changes its inset, not the 3D canvas size. */
#chat-panel{contain:layout paint;background:#18231ef5;backdrop-filter:none;-webkit-backdrop-filter:none;animation:none;margin:0;z-index:30}
#chat-close{margin-left:auto;flex:none;width:40px;height:40px}#chat-info{margin-left:0}#chat-input{font-size:16px;touch-action:manipulation}#chat-form button{touch-action:manipulation}
.chat-open .bottom-ui{bottom:calc(var(--keyboard-inset,0px) + max(12px,env(safe-area-inset-bottom)));z-index:30}
.chat-open .brand,.chat-open .round-btn,.chat-open .pill,.chat-open .room-heading,.chat-open .room-nav{backdrop-filter:none;-webkit-backdrop-filter:none;background:#17231ef0}
.chat-open.keyboard-open .room-nav,.chat-open.keyboard-open #share-room{display:none}
.chat-open .actions,.chat-open #snack-fun,.chat-open #motion-row,.chat-open #emote-tray{display:none!important}
#chat-feedback{font-size:11px;color:#e8c2a8;margin:7px 5px 0}#chat-feedback:empty{display:none}
#fortune-result{background:#eee5cf;color:#283b2d}#fortune-result h3{color:#263a29}#fortune-result p{color:#485a44}#fortune-result .lucky-details{color:#506044}
#milk-dialog{background:#20291f}#milk-dialog h2{color:#f5e3a0}#milk-dialog p{color:#d5ddcd}
#entry-portrait{clip-path:none;overflow:visible;filter:drop-shadow(0 8px 16px #0003)}
#entry-portrait-status{color:#d9e4d1;font-size:14px;line-height:1.7;margin:14px 0}#entry-portrait-retry[hidden]{display:none}#entry-continue:disabled{opacity:.55;cursor:wait}
#snack-fun{flex-wrap:wrap;max-width:560px}#snack-fun button{font-size:11px}
#snack-game{text-align:center}#snack-tap{width:min(240px,100%);height:260px;background:none;border:0;padding:15px;touch-action:manipulation;position:relative}#snack-tap:active{transform:scale(.96)}#snack-tap svg{width:100%;height:100%;overflow:visible}#snack-meter{width:85%;accent-color:#bdd6ad;height:9px}#snack-progress{color:#d9e4cd}
#snack-game[data-kind=hotbar] .ramen-art,#snack-game[data-kind=ramen] .hotbar-art{display:none}
#snack-game [data-bite-piece]{transition:opacity .12s,transform .12s}#snack-game[data-bites='4'] .food-stick{opacity:0}#snack-tap:disabled{opacity:1}

#loading{background:#142019;color:#edf2e9;z-index:50}#loading strong{color:#f4f6ef;font-family:inherit;font-weight:650;font-size:22px}#loading>span:last-child{color:#b9cdb7;font-size:13px;letter-spacing:.06em}.loading-mark{color:#ee9b7b}
#room-desc,.room-heading p{color:#cbd8c8}.dialog-kicker{color:#bdcdb6}dialog p{color:#c1cebb}.reveal-line,.reveal-eyebrow{color:#c7d5bf!important}#welcome .entry-title p{color:#bdcbb6}#welcome .welcome-footer{color:#afc1a8}.entry-ticket small{color:#b6c6ab}#chat-messages:empty:before{color:#b6c7b8}#snack-game[data-bites='4'] .hotbar-art{opacity:0}

#egg-tap:disabled{opacity:1;cursor:default}
#egg-tap svg{overflow:visible}.egg-shell-whole{transition:opacity .15s}.egg-cracks path{opacity:0;stroke-dasharray:250;stroke-dashoffset:250;transition:stroke-dashoffset .25s ease,opacity .15s}.egg-cracks path.visible{opacity:1;stroke-dashoffset:0}.egg-shard{opacity:0;transform-box:fill-box;transform-origin:center}
.egg-hit svg{animation:egg-knock .22s ease-out}.egg-broken .egg-shell-whole,.egg-broken .egg-cracks{opacity:0}.egg-broken .egg-shard{animation:egg-shatter .7s cubic-bezier(.15,.65,.35,1) forwards}.egg-broken .peeled-egg{filter:drop-shadow(0 0 9px #fff4c41f)}
@keyframes egg-knock{0%{transform:rotate(0) scale(1)}25%{transform:rotate(-3deg) scale(.95,1.02)}55%{transform:rotate(3deg) scale(1.02,.98)}100%{transform:rotate(0) scale(1)}}
@keyframes egg-shatter{0%{opacity:1;transform:translate(0,0) rotate(0)}40%{opacity:1}100%{opacity:0;transform:translate(var(--sx),var(--sy)) rotate(var(--sr))}}
@media(prefers-reduced-motion:reduce){.egg-cracks path,.egg-shell-whole{transition:none}.egg-hit svg,.egg-broken .egg-shard{animation:none}.egg-broken .egg-shard{opacity:0}}

.entry-ticket small{grid-column:1/-1;font-size:11px;line-height:1.65;color:#c6d7bc}.entry-ticket strong{grid-row:1}
/* Compact controls keep the scene legible; camera actions expand on demand. */
.room-status{gap:7px;max-width:170px}.room-status .pill{min-height:42px}.camera-tools[hidden]{display:none!important}
#camera-toggle{font-size:14px}#camera-controls{padding:5px;gap:5px;border-radius:15px;background:#18231ef5}
#emote-tray:not([hidden]){display:grid;grid-template-columns:repeat(3,minmax(58px,1fr));gap:6px;width:min(320px,100%);padding:10px;border-radius:18px}
#emote-tray button{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;min-height:60px;background:#ffffff08;color:#f1f1e7;border-radius:12px;padding:8px}
#emote-tray button span{font-size:25px;line-height:1.1}#emote-tray button small{font-size:11px;color:#cfdbca}
#chat-panel:not([hidden]){display:flex;flex-direction:column;position:absolute;left:50%;transform:translateX(-50%);max-width:none;max-height:none;box-sizing:border-box;padding:12px;z-index:40;overflow:hidden;border:1px solid #b9cbb74d;background:#18231e}
#chat-panel .chat-meta{flex-shrink:0;min-height:40px;font-size:12px;gap:8px}#chat-messages{flex:1;min-height:30px;max-height:none;overflow-y:auto;overscroll-behavior:contain;touch-action:pan-y;overflow-wrap:anywhere}
#chat-form{display:flex;gap:7px;flex-shrink:0;margin-top:10px}#chat-input{min-width:0;flex:1;height:46px}#chat-form button{min-width:46px;min-height:46px}
.chat-open .bottom-ui,.chat-open .room-status,.chat-open .room-heading,.chat-open #my-status,.chat-open #gesture-hint,.chat-open #world-bubble{display:none!important}
.chat-open #world{pointer-events:none}.chat-open .topbar{pointer-events:none;opacity:.35}.chat-open.keyboard-open .topbar{visibility:hidden}
#private-fun:not([hidden]){display:flex;gap:7px;flex-wrap:wrap;justify-content:center}#private-fun button{background:#34394de8;color:#eee7ee;padding:12px;border:1px solid #d5c4de44;border-radius:15px;font-size:12px;min-height:44px}
@container(max-width:680px){
 .room-status{top:123px!important;right:12px!important;display:grid!important;grid-template-columns:44px 44px;gap:6px!important;width:94px;max-width:94px}
 .room-status #climate{width:44px!important;height:44px!important;grid-column:1/-1;justify-self:end}
 .room-status .pill{width:44px!important;height:44px!important;min-height:44px;padding:0!important;font-size:0!important;border-radius:14px;display:grid;place-items:center}
 .room-status #clock-open:before{content:'◷';font-size:22px}.room-status #sound-symbol{font-size:23px}.room-status #sound-label,.room-status #timer-btn{display:none!important}
 .room-status #camera-toggle{grid-column:2;font-size:22px!important}.room-status #camera-toggle span{display:none}
 #camera-controls{position:absolute;right:0;top:150px;display:flex;flex-direction:row}#camera-controls button{width:44px!important;height:44px!important;margin:0!important}
 .chat-open .room-status{display:none!important}.room-heading{max-width:calc(100% - 126px)}
}
#party-dialog{width:min(480px,calc(100% - 24px));max-height:calc(100dvh - 32px);overflow-y:auto;overscroll-behavior:contain;background:#222433;color:#f0eaf2}#party-dialog h2{font-size:26px;padding-right:35px}#party-dialog p{color:#cbc5d4}#party-dialog .dialog-action{background:#d0c5df;color:#2d2b3c}#party-dialog textarea{display:block;width:100%;box-sizing:border-box;resize:vertical;background:#141823;color:#f1edf2;border:1px solid #79758c;border-radius:12px;font:16px/1.5 sans-serif;padding:12px;margin:7px 0 15px}#party-dialog label{font-size:13px}#roulette-window{display:flex;flex-direction:column;align-items:center;gap:20px;padding:25px 10px;margin:24px 0;border:1px solid #b0a1c355;border-radius:22px;background:linear-gradient(#373348,#191c28);overflow:hidden}#roulette-window>span{color:#e4bf8b}#roulette-value{font-size:27px;min-height:42px;text-align:center;color:#f3e3bc}#roulette-window small{color:#bbb0c6}.rolling #roulette-value{filter:blur(.6px)}#ladder-board{width:100%;height:auto;display:block;background:#181d2b;border-radius:14px}.ladder-rail,.ladder-rung{stroke:#535b74;stroke-width:3}.ladder-trace{fill:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:round}#ladder-names,#ladder-outcomes{display:flex;justify-content:space-between;gap:5px;font-size:11px;margin:12px 0;color:#e1d9e8}#ladder-names span,#ladder-outcomes span{flex:1;text-align:center;overflow-wrap:anywhere}#ladder-result{white-space:pre-line;line-height:1.9;padding:12px;background:#ffffff08;border-radius:12px;user-select:text}#party-copy{width:100%;padding:12px;background:transparent;color:#d6cbdd;border:1px solid #ffffff26;border-radius:12px}#party-feedback{font-size:12px;line-height:1.6}
#calm-exit{position:absolute;bottom:max(24px,env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);z-index:45;min-height:44px;background:#17231ed9;white-space:nowrap}
.calm-mode .topbar,.calm-mode .room-heading,.calm-mode .room-status,.calm-mode .bottom-ui,.calm-mode #my-status,.calm-mode #gesture-hint,.calm-mode #first-tip,.calm-mode #world-bubble,.calm-mode #quick-chat,.calm-mode #chat-panel,.calm-mode .peer-speech,.calm-mode .peer-emote{display:none!important}
button:focus-visible,a:focus-visible{outline:2px solid #dfd4a6;outline-offset:3px}button{touch-action:manipulation}

/* One icon only: remove the legacy second mobile clock glyph. */
.room-status #clock-open::after{content:none!important;display:none!important}

#egg-game[data-taps="6"] .egg-cracks,#egg-game[data-taps="6"] .egg-shell-whole{display:none!important;opacity:0!important}

#shelter-actions{display:flex;justify-content:center;gap:8px;margin:8px 0}#shelter-actions button,#shelter-visit{border:1px solid #ffffff20;background:#152c2ce6;color:#d6ece6;border-radius:22px;padding:11px 16px;cursor:pointer}#shelter-actions button[aria-pressed=true]{background:#c7e2db;color:#173632}#shelter-visit{margin:4px auto 8px;display:block}

/* Composer stays above history, away from host toolbars and mobile keyboards. */
#chat-panel #chat-form{margin:8px 0 0;flex-shrink:0}#chat-panel #chat-input{color:#f5f7ee;-webkit-text-fill-color:#f5f7ee;caret-color:#d8efca;opacity:1;background:#10201b;font-size:16px}#chat-panel #chat-feedback{flex-shrink:0;margin:4px 0;min-height:0}#chat-panel #chat-messages{padding-top:10px;border-top:1px solid #ffffff20}#restroom-actions{display:flex;gap:6px;flex-wrap:wrap;justify-content:center}#restroom-actions[hidden]{display:none}#restroom-actions button{border:1px solid #ffffff25;background:#111d19de;color:#edf0e5;border-radius:22px;padding:10px 14px;font:inherit;min-height:42px}
/* The input is always available; history opens independently. */
#quick-chat{position:absolute;left:50%;transform:translateX(-50%);z-index:42;display:grid;grid-template-columns:minmax(0,1fr) auto;gap:7px;align-items:center;width:min(420px,calc(100% - 24px));padding:7px;background:#102019f5;border:1px solid #b4ccb04d;border-radius:19px;box-shadow:0 8px 28px #0003}
#quick-chat[hidden]{display:none}#quick-chat #chat-form{display:flex;gap:6px;min-width:0;margin:0}#quick-chat #chat-input{min-width:0;height:43px;font:16px/1.4 sans-serif;color:#f5f7ee;-webkit-text-fill-color:#f5f7ee;caret-color:#d9edca;background:#172c23;border:1px solid #adcaa333;padding:9px 11px;opacity:1}#quick-chat #chat-form button{width:40px;flex:0 0 40px;min-height:43px;background:#d0e3c4;color:#173921;border-radius:12px;font-size:22px}#quick-chat #chat-toggle{grid-column:2;grid-row:1;font-size:11px;padding:9px 10px;min-height:43px;white-space:nowrap;background:#ffffff10;color:#d9e8d3;border:0;border-radius:11px}#quick-chat #chat-feedback{grid-column:1/-1;color:#f4d3b6;font-size:12px;margin:0;padding:0 5px}#quick-chat #chat-feedback:empty{display:none}
.chat-typing .bottom-ui,.chat-typing .room-heading,.chat-typing .room-status,.chat-typing #my-status,.chat-typing #gesture-hint{display:none!important}
#chat-panel .chat-line{font-size:15px;line-height:1.55;background:#ffffff0b;border:1px solid #ffffff12;border-radius:14px;padding:10px 12px;color:#f2f5ed}#chat-panel .chat-line b{display:block;font-size:11px;font-weight:600;margin:0 0 4px;color:#b9d6ac}
#world-bubble,.peer-speech,.peer-emote{position:absolute;z-index:12;transform:translate(-50%,-100%);pointer-events:none;max-width:min(260px,calc(100% - 24px));background:#14251efa;color:#f7faef;border:1px solid #d3e6bd99;border-radius:18px;padding:12px 15px;box-shadow:0 5px 20px #0006;font-size:16px;line-height:1.5;word-break:break-word;text-shadow:none;white-space:pre-wrap}
#world-bubble::after,.peer-speech::after{content:'';position:absolute;bottom:-7px;left:calc(50% - 7px);width:12px;height:12px;transform:rotate(45deg);background:#14251e;border-right:1px solid #d3e6bd99;border-bottom:1px solid #d3e6bd99}.peer-speech b{display:block;color:#c1daa9;font-size:11px;margin-bottom:4px}.peer-speech span{display:block}.peer-emote,#world-bubble.emote{font-size:29px;padding:7px 12px}.chat-open #world-bubble{display:block!important}.chat-open #world-bubble[hidden]{display:none!important}
#snack-fun,#private-fun{max-width:100%;flex-wrap:wrap;justify-content:center}#social-menu-toggle{font-size:12px;padding:10px 15px}

/* Keep controls inside an iPhone's visible safe area, including short landscape. */
#app{min-height:0!important;--safe-top:env(safe-area-inset-top,0px);--safe-right:env(safe-area-inset-right,0px);--safe-bottom:env(safe-area-inset-bottom,0px);--safe-left:env(safe-area-inset-left,0px)}
.topbar{top:calc(16px + var(--safe-top));left:calc(14px + var(--safe-left));right:calc(14px + var(--safe-right))}
.bottom-ui{bottom:calc(12px + var(--safe-bottom));max-width:calc(100% - 24px - var(--safe-left) - var(--safe-right))}
#quick-chat{overflow-y:auto;overscroll-behavior:contain;touch-action:pan-y}
#quick-chat #chat-input{height:44px}#quick-chat #chat-form button{width:44px;flex-basis:44px;min-height:44px}#quick-chat #chat-toggle{min-height:44px}
.history-compact #quick-chat #chat-toggle{display:block!important;font-size:10px;white-space:normal;max-width:80px;line-height:1.3}
#chat-panel .chat-meta{min-height:44px}#chat-close,#chat-info{min-width:44px;min-height:44px}
.chat-typing .topbar{visibility:hidden;pointer-events:none}
@media(pointer:coarse){.round-btn,.small-actions button,#bath-tabs button,#motion-row button,#locker-actions button,#npc-open,#yardog-btn{min-width:44px;min-height:44px}.top-tools{gap:5px}}
@container(max-width:680px){.room-heading{top:calc(96px + var(--safe-top));left:calc(18px + var(--safe-left))}.room-status{top:calc(123px + var(--safe-top))!important;right:calc(12px + var(--safe-right))!important}}
@media(max-height:500px) and (min-width:480px){
 .topbar{top:calc(8px + var(--safe-top))}.brand{padding:6px 10px}.brand b{font-size:16px}.brand small,.preview-tag{display:none}
 .room-heading{top:calc(72px + var(--safe-top));left:calc(12px + var(--safe-left));padding:8px 11px;max-width:40%}.room-heading h1{font-size:16px;margin:5px 0}.room-heading p,.room-heading .eyebrow{display:none}
 .room-heading #npc-open,.room-heading #yardog-btn{margin-top:4px;padding:7px 9px;min-height:44px}
 #bath-tabs{margin-top:5px;flex-wrap:wrap}#bath-tabs button{min-height:36px;padding:6px 8px}
 .room-status{top:calc(74px + var(--safe-top))!important;right:calc(12px + var(--safe-right))!important;display:flex!important;flex-direction:row;align-items:center;gap:6px;max-width:none;width:auto}
 .room-status #climate,.room-status .pill{height:44px;width:44px;min-height:44px;padding:0;display:grid;place-items:center;border-radius:14px;font-size:0}.room-status #climate b{font-size:20px}.room-status #humidity,.room-status #sound-label,.room-status #timer-btn,.room-status #camera-toggle span{display:none!important}
 .room-status #clock-open:before{content:'◷';font-size:22px}.room-status #sound-symbol,.room-status #camera-toggle{font-size:22px!important}
 #camera-controls{position:absolute;top:50px;right:0;flex-direction:row}#camera-controls button{min-width:44px;min-height:44px}
 .bottom-ui{bottom:calc(8px + var(--safe-bottom));gap:5px;max-height:46%;overflow-y:auto;overscroll-behavior:contain}
 .room-nav{padding:3px;gap:3px}.room-nav button{display:flex;min-height:44px;padding:6px;gap:6px}.room-nav button>span{font-size:20px}.room-nav button>b{font-size:11px}.room-nav button>small,.bottom-caption,#my-status,#gesture-hint{display:none}
 .small-actions{padding:2px}.small-actions button{min-height:44px;padding:7px 12px}.action-primary{min-height:44px;padding:8px 14px}.actions{gap:6px}
 .chat-open .room-status,.chat-typing .room-status{display:none!important}
}

.bottom-ui{left:calc(50% + (var(--safe-left) - var(--safe-right))/2)}
/* Long Korean action labels keep their touch target on narrow phones. */
#motion-row,#bath-actions,#locker-actions,#shelter-actions{display:flex;flex-wrap:wrap;justify-content:center;gap:6px;max-width:100%}
#motion-row button,#bath-actions button,#locker-actions button{max-width:100%;white-space:normal;overflow-wrap:anywhere}

/* Mobile movement: two short rows; extra actions open only when requested. */
#motion-row{padding:10px;border:1px solid #ffffff24;border-radius:18px;background:#15231ff5;align-items:center}
#motion-row button{min-width:44px;min-height:44px;margin:0;padding:8px 11px;font-size:12px}
#motion-row #bath-tabs,#motion-row #bath-actions,#motion-row #locker-actions,#motion-row #shelter-actions,#motion-row #restroom-actions{flex-basis:100%;margin:0;justify-content:center}
#motion-row #photo-btn svg{width:17px;height:17px}#motion-row #clock-open{font-size:12px}#motion-row #clock-open:before{content:none}
#wide-exit{position:absolute;top:calc(12px + var(--safe-top));left:calc(12px + var(--safe-left));z-index:35;min-height:44px;padding:9px 13px;font-size:12px}
.wide-view .topbar,.wide-view .room-heading,.wide-view .room-status,.wide-view .actions,.wide-view #my-status,.wide-view #gesture-hint,.wide-view #first-tip,.wide-view #demo-label,.wide-view .bottom-caption{display:none!important}
.wide-view .bottom-ui{max-height:none;overflow:visible}
.chat-open #wide-exit,.chat-typing #wide-exit,.calm-mode #wide-exit{display:none!important}
.compact-ui .bottom-ui{width:calc(var(--control-visible-width,100%) - 16px - var(--safe-left) - var(--safe-right));max-width:740px;left:calc(var(--control-center,50%) + (var(--safe-left) - var(--safe-right))/2);bottom:calc(8px + var(--safe-bottom) + var(--control-bottom-inset,0px));gap:5px;max-height:none;overflow:visible;pointer-events:none}
.compact-ui .bottom-ui>*,.compact-ui .actions button{pointer-events:auto}
.compact-ui .actions{display:flex;flex-wrap:nowrap;gap:4px;width:100%;min-height:44px}
.compact-ui .small-actions{display:contents}
.compact-ui .actions button{height:44px;min-height:44px;min-width:44px;padding:6px 9px;border:1px solid #ffffff24;border-radius:13px;background:#15231fe8;color:#e4ece0;font-size:11px;line-height:1.25}
.compact-ui #sit-btn{order:1}.compact-ui #lie-btn{order:2}.compact-ui #primary-action{order:3;flex:1;min-width:44px;max-width:none;background:#dbe7db;color:#1e3425;padding:6px 8px;gap:0}.compact-ui #motion-toggle{order:4;min-width:48px}.compact-ui #social-menu-toggle{order:5;width:44px;padding:4px;font-size:10px}
.compact-ui #primary-text{min-width:0;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.compact-ui #primary-action .action-icon,.compact-ui #action-key{display:none}
.compact-ui .small-actions button.active,.compact-ui #motion-toggle[aria-expanded=true],.compact-ui #social-menu-toggle[aria-expanded=true]{background:#dbe7db;color:#1e3425}
.compact-ui .room-nav{grid-template-columns:repeat(6,minmax(44px,1fr));width:100%;padding:3px;gap:2px;border-radius:15px;overflow-x:auto;overscroll-behavior:contain;touch-action:pan-x}
.compact-ui .room-nav button{display:flex;flex-direction:column;justify-content:center;align-items:center;gap:1px;min-width:44px;height:44px;min-height:44px;padding:3px 1px;border-radius:11px}
.compact-ui .room-nav button>span{font-size:16px;line-height:17px}.compact-ui .room-nav button>b{font-size:9px;line-height:12px;white-space:nowrap}.compact-ui .room-nav button>small,.compact-ui .bottom-caption{display:none}.compact-ui .room-nav .talk-dot{width:3px;height:3px;right:6px;top:5px}
.compact-ui .bottom-ui>#motion-row,.compact-ui .bottom-ui>#snack-fun,.compact-ui .bottom-ui>#private-fun,.compact-ui .bottom-ui>#emote-tray{position:absolute;left:0;bottom:calc(100% + 8px);width:100%;max-width:none;max-height:min(320px,calc(var(--control-visible-height,100dvh) - 160px));margin:0;padding:10px;overflow-y:auto;overscroll-behavior:contain;touch-action:pan-y;z-index:32;background:#15231ff5;border:1px solid #b5c9b34d;border-radius:18px;box-shadow:0 8px 25px #0004}
.compact-ui.talking .bottom-ui>#motion-row,.compact-ui.talking .bottom-ui>#snack-fun,.compact-ui.talking .bottom-ui>#private-fun,.compact-ui.talking .bottom-ui>#emote-tray{max-height:min(280px,calc(var(--control-visible-height,100dvh) - 240px))}
.compact-ui #motion-row:not([hidden]){display:flex;gap:6px;flex-wrap:wrap}.compact-ui #motion-row button,.compact-ui #snack-fun button,.compact-ui #private-fun button{min-height:44px;min-width:44px;font-size:12px;padding:8px 11px;margin:0}
.compact-ui #motion-row #walk-btn{display:block}.compact-ui #emote-tray button{min-height:52px;height:auto}.compact-ui #emote-tray button span{font-size:22px}.compact-ui #emote-tray button small{font-size:10px}
.compact-ui #my-status{right:calc(12px + var(--safe-right));bottom:calc(115px + var(--safe-bottom) + var(--control-bottom-inset,0px));max-width:65%;padding:2px 4px;border:0;background:none;backdrop-filter:none;font-size:9px;line-height:12px;text-shadow:0 1px 3px #000;pointer-events:none}
.compact-ui .topbar{top:calc(12px + var(--safe-top));left:calc(12px + var(--safe-left));right:calc(12px + var(--safe-right));gap:8px;align-items:center}
.compact-ui .brand{min-height:44px;padding:6px 8px;gap:5px}.compact-ui .brand b{font-size:12px}.compact-ui .brand-mark{font-size:18px}.compact-ui .brand small{display:none}
.compact-ui .top-tools{gap:4px}.compact-ui .round-btn{width:44px;height:44px;min-width:44px;min-height:44px}.compact-ui .round-btn svg{width:16px;height:16px}.compact-ui .top-tools #locker-open{min-height:44px;max-width:68px;margin:0;padding:5px 7px;font-size:10px}.compact-ui #mobile-view{display:none!important}
.compact-ui .room-heading{top:calc(68px + var(--safe-top));left:calc(12px + var(--safe-left));padding:6px 9px;max-width:calc(100% - 124px)}
.compact-ui .room-heading h1{font-size:16px;line-height:1.25;margin:2px 0}.compact-ui .room-heading .eyebrow{font-size:9px;gap:4px}.compact-ui #branch-open{min-height:44px;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.compact-ui #room-desc,.compact-ui #mode-label,.compact-ui #room-population,.compact-ui .room-heading .divider{display:none}
.compact-ui .room-status{top:calc(77px + var(--safe-top))!important;right:calc(12px + var(--safe-right))!important;display:flex!important;flex-direction:row;gap:5px!important;width:93px;max-width:93px}
.compact-ui .room-status #timer-btn{display:none!important}.compact-ui .room-status #sound-symbol{font-size:18px}.compact-ui .room-status #camera-toggle{font-size:18px!important}
.compact-ui #camera-controls{top:50px;right:0}.compact-ui #camera-controls button{min-width:44px;min-height:44px;font-size:18px}
.compact-ui #first-tip{top:calc(154px + var(--safe-top));font-size:10px}
.compact-ui .room-status .pill{width:44px!important;height:44px!important;min-height:44px;padding:0!important;font-size:0!important;border-radius:13px;display:grid;place-items:center}
.compact-ui .room-status #sound-label,.compact-ui .room-status #camera-toggle span{display:none!important}
.compact-ui .top-tools #locker-open{display:block}.compact-ui #motion-row #emote-btn span{display:inline}
.compact-ui.chat-open .room-status,.compact-ui.chat-typing .room-status,.compact-ui.wide-view .room-status,.compact-ui.calm-mode .room-status{display:none!important}

/* Keep room temperature readable and the rest timer available in the menu. */
.compact-ui .room-status{flex-wrap:wrap}
.compact-ui .room-status #climate{display:flex!important;flex-direction:row;justify-content:flex-end;align-items:center;flex:0 0 93px;order:-1;width:93px!important;height:24px!important;min-height:24px;padding:0 3px;border:0;background:none;text-shadow:0 1px 3px #071510}
.compact-ui .room-status #climate b{font-size:17px;line-height:24px}
.compact-ui .room-status #climate span{display:none}
.compact-ui #camera-controls{top:79px}
#motion-row #timer-btn{width:auto;font-size:12px}
