#room-stage, #room-return[hidden], #room-stage [hidden] { display:none }
#desktop-surface { position:fixed; inset:0; overflow:hidden; transform-origin:0 0 }
html[data-room] { background:#30231c }
html[data-room] #room-stage { display:block; position:fixed; inset:0; color:#fff4dc; overflow:hidden; touch-action:manipulation }
html[data-room] #desktop-surface { z-index:1; pointer-events:none; will-change:transform }
html[data-room="loading"] #desktop-surface { visibility:hidden }
#room-stage { font-family:"Segoe UI","Microsoft YaHei UI",sans-serif }
#room-view { position:fixed; inset:0; width:100%; height:100% }

html[data-room="loading"] #room-view { visibility:hidden }
#room-objects, #room-shelf, #room-skip { position:fixed; z-index:2 }
#room-objects { inset:0; pointer-events:none }
#room-objects button { position:absolute; left:0; top:0; padding:0; border:0; background:transparent; touch-action:manipulation; color:#fff3da; pointer-events:auto; border-radius:12px; -webkit-tap-highlight-color:transparent }
#room-objects button:focus-visible { outline:2px solid #ffdf99; outline-offset:4px }
#room-objects span { position:absolute; left:50%; bottom:0; transform:translate(-50%,65%); white-space:nowrap; border:1px solid #ffe0a75e; background:#36251fe6; color:#fff1d6; border-radius:20px; padding:5px 11px; font-size:12px; letter-spacing:.08em; opacity:0; transition:opacity .2s }
#room-objects button[data-active] span, #room-objects button:focus-visible span { opacity:1 }
@media (hover:none) { #room-objects span { opacity:.92 } }
#room-stage button:focus-visible, #room-return:focus-visible { outline:2px solid #ffc76c; outline-offset:3px }
#room-skip, #room-return { right:max(15px,env(safe-area-inset-right)); bottom:max(16px,env(safe-area-inset-bottom)); padding:7px 12px; color:#fff3dd; background:#352b24b8; border:1px solid #e1c7a054; border-radius:20px; font-size:12px }
#room-return { position:fixed; z-index:2147483001; bottom:64px; }
.mobile #room-return { bottom:max(20px,env(safe-area-inset-bottom)) }
.mobile.in-app #room-return { display:none }
#room-shelf { left:50%; bottom:max(16px,env(safe-area-inset-bottom)); transform:translateX(-50%); width:min(480px,calc(100% - 24px)); padding:13px 16px; background:linear-gradient(125deg,#30221bf2,#4c3427ed); border:1px solid #c9a97d99; box-shadow:0 10px 38px #27171066,inset 0 1px #e5cca825; border-radius:13px }
.shelf-head { display:flex; align-items:center; gap:8px; padding-bottom:9px; border-bottom:1px solid #ebcca639 }
.shelf-head strong { font:600 18px Georgia,"SimSun",serif; margin-right:auto }
.shelf-head button { color:#f9e7c9; border:1px solid #d9ba8759; border-radius:6px; background:#ffedc909; padding:5px 9px }
.record-browser { display:flex; align-items:center; gap:3px; margin-top:8px }
.record-browser > button { flex:0 0 26px; min-height:44px; padding:0; color:#f9e7c9; font:22px Georgia,serif; background:transparent; border:0 }
.record-browser > button:disabled { opacity:.22; cursor:default }
#room-records { flex:1; min-width:0; display:flex; overflow-x:auto; scrollbar-width:thin; scrollbar-color:#a88a62 transparent; gap:4px }
#room-records button { flex:0 0 82px; min-width:0; display:grid; justify-items:center; gap:4px; padding:5px 1px; background:none; border:1px solid transparent; border-radius:6px; color:#e4ccb0; font-size:12px }
#room-records span { max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap }
#room-records canvas { width:36px; height:36px; filter:drop-shadow(0 2px 2px #1a100d) }
#room-records button[aria-pressed="true"] { background:#f9ddad15; border-color:#d7af795c; color:#ffe9b5 }
@media (prefers-reduced-motion:reduce) { #room-stage * { transition:none!important } }

#queue-editor { margin-top:6px; font-size:12px }
#queue-editor summary { cursor:pointer; width:max-content; padding:4px 0 }
#room-shelf { box-sizing:border-box; max-height:52dvh; overflow:auto }
.shelf-head strong { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap }
.shelf-head button { flex-shrink:0 }
.queue-actions { display:flex; align-items:center; gap:6px; margin:7px 0; flex-wrap:wrap }
.queue-actions button,.queue-import,.queue-actions select,.shelf-head button { border:1px solid #a5855e; border-radius:7px; background:linear-gradient(#523d2f,#3c2c22); color:#f8e6c8; font:inherit; padding:6px 9px; cursor:pointer }
.queue-actions select { min-width:90px; flex:1; color-scheme:dark }
.queue-actions option { background:#39291f }
.queue-actions button:disabled { opacity:.42; cursor:default }
.queue-import { position:relative; overflow:hidden }
.queue-import input { position:absolute; inset:0; width:100%; height:100%; opacity:0; cursor:pointer }
.queue-import:focus-within { outline:2px solid #ffc76c }
#queue-status { display:block; color:#ebd2ab }
@media (min-width:1000px) and (min-aspect-ratio:4/3) {
  #room-shelf { width:clamp(270px,28vw,400px); left:auto; right:16px; transform:none; max-height:82dvh }
}
#room-preview[data-focus][data-closeup] .preview-frame { top:0; left:0; transform-origin:0 0; transform:var(--closeup) }
#room-preview[data-closeup] .preview-object { visibility:hidden }
#room-preview[data-closeup] [data-preview=box] { visibility:visible; color:transparent; text-shadow:none }

#room-preview, #room-progress { display:none }
html[data-room="loading"] #room-preview { display:block; position:absolute; inset:0; overflow:hidden; background:#392d25 }
.preview-frame { position:absolute; left:50%; top:50%; width:max(100vw,177.778vh); aspect-ratio:16/9; transform:translate(-50%,-50%); background:url(arrival.webp) center/100% 100%; transition:transform .24s ease; animation:room-arrival .42s ease-out; }
@media (orientation:portrait) {
  .preview-frame { width:max(100vw,50vh); aspect-ratio:1/2; background-image:url(arrival-portrait.webp) }
}
.preview-object { position:absolute; display:grid; place-items:end center; box-sizing:border-box; color:white; font-size:13px; font-family:inherit; text-decoration:none; text-shadow:0 1px 4px black; background:transparent; border:0; cursor:pointer }
[data-preview="laptop"] { inset:48% 60% 13% 12% }
[data-preview="box"] { inset:37% 15% 16% 56% }
@media (orientation:portrait) {
  [data-preview="laptop"] { inset:49% 62% 36% 4% }
  [data-preview="box"] { inset:45% 7% 37% 57% }
}
#room-preview[data-focus] .preview-frame { transform:translate(-50%,-50%) scale(1.07); transition:transform .24s ease }
#room-preview[data-focus=laptop] .preview-frame { transform-origin:25% 60% }
#room-preview[data-focus=box] .preview-frame { transform-origin:73% 55% }
#preview-wait { border:none; border-radius:1em; padding:.6em 1em }
html[data-room="loading"] #room-progress:not([hidden]) { display:grid; position:absolute; z-index:2; pointer-events:none; left:max(16px,env(safe-area-inset-left)); bottom:max(20px,env(safe-area-inset-bottom)); gap:5px; color:white; text-shadow:0 1px 4px black; font-size:12px; animation:room-status-in .3s .5s both }
#room-progress progress { width:100px; height:4px; accent-color:#eec58a }
@keyframes room-arrival { from {filter:brightness(.78)} to {filter:brightness(1)} }
@keyframes room-status-in { from {opacity:0} to {opacity:1} }
@media (prefers-reduced-motion:reduce) { #room-progress { animation:none!important } #room-preview .preview-frame { transition:none; animation:none } }

#room-view { touch-action:none }
#disc-seek-hint { color:#d9bf98;font-size:12px;margin-bottom:8px }
#disc-seek-time { display:block;color:#ffe2a5;font:600 20px "Segoe UI",sans-serif;font-variant-numeric:tabular-nums;margin-bottom:8px }
#disc-seek-time[hidden] { display:none }

#room-objects [data-object="chime"] { cursor:grab; touch-action:none }
#room-objects [data-object="chime"]:active { cursor:grabbing }

#room-objects [data-object="christmas"] { cursor:pointer }
#christmas-viewer { position:fixed; inset:0; margin:auto; width:min(1180px,calc(100vw - 36px)); height:min(880px,calc(100dvh - 36px)); max-width:none; max-height:none; padding:0; border:1px solid #c1a77a88; border-radius:15px; background:#14252a; color:#f0e2c7; box-shadow:0 25px 100px #100c09b3; overflow:hidden }
#christmas-viewer::backdrop { background:#1d181366; backdrop-filter:blur(7px) }
#christmas-viewer[open] { display:flex; flex-direction:column; animation:christmas-unfold .35s ease-out }
.christmas-bar { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:12px 20px; font:14px Georgia,"SimSun",serif; letter-spacing:.1em; border-bottom:1px solid #d2b47a30 }
#christmas-close { border:1px solid #b79a6d66; border-radius:20px; padding:7px 13px; font:13px "Microsoft YaHei",sans-serif; color:inherit; background:#e6cd9510; cursor:pointer }
#christmas-close:focus-visible { outline:2px solid #eac785; outline-offset:3px }
#christmas-content { flex:1; min-height:0; background:#14252a }
#christmas-content iframe { display:block; width:100%; height:100%; border:0 }
@keyframes christmas-unfold { from { opacity:0; transform:translateY(20px) scale(.97) } to { opacity:1; transform:none } }
@media(max-width:600px) { #christmas-viewer { width:100vw; height:100dvh; border:0; border-radius:0 } .christmas-bar { padding:10px 14px } }
@media(prefers-reduced-motion:reduce) { #christmas-viewer[open] { animation:none } }
