* { box-sizing: border-box; }
:root { --app-header-height: 56px; color-scheme: dark; font-family: 'Segoe UI', Arial, sans-serif; color: #eceee9; background: #151917; font-synthesis: none; }
body { margin: 0; }
[hidden] { display: none !important; }
button, input, select { font: inherit; }
button { cursor: pointer; color: #e5e9e1; border: 1px solid #414a41; background: #252c27; border-radius: 6px; min-height: 38px; padding: 8px 13px; font-size: 13px; transition: background .15s, border-color .15s; }
button:hover { background: #333e34; border-color: #6b7b63; }
button:disabled { opacity: .35; cursor: default; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid #c5db9b; outline-offset: 3px; }
button.quiet { background: transparent; border-color: transparent; }
button.quiet:hover { background: #29322b; }
input[type=text], input:not([type]) { color: inherit; min-width: 0; border: 1px solid transparent; border-radius: 4px; background: transparent; }
input[type=text]:hover, input:not([type]):hover { border-color: #414a41; }
input[type=text]:focus, input:not([type]):focus { background: #1b211c; }
.app-header { height: var(--app-header-height); padding: 0 28px; display: flex; align-items: center; gap: 14px; border-bottom: 1px solid #30372f; }
.brand { white-space: nowrap; font-size: 17px; line-height: 1.2; letter-spacing: .12em; color: #e1cea9; font-weight: 600; }
.brand span { font-weight: 300; color: #edf0e8; }
.app-header nav { display: flex; flex-shrink: 0; gap: 4px; margin-left: auto; }
.app-header nav button { min-height: 32px; padding: 6px 10px; }
.workspace { display: grid; grid-template-columns: 350px minmax(0, 1fr); height: calc(100dvh - var(--app-header-height)); min-height: 430px; }
.workspace.is-empty { grid-template-columns: 1fr; }
.editor { overflow-y: auto; border-right: 1px solid #30372f; background: #1b201c; scrollbar-width: thin; }
.editor-toolbar { position: sticky; top: 0; z-index: 3; padding: 12px 14px; display: flex; justify-content: space-between; align-items: center; background: #1b201cf5; backdrop-filter: blur(12px); }
.editor-toolbar > span { font-size: 12px; color: #adb5a8; }
.editor-toolbar button { min-height: 32px; padding: 6px 10px; font-size: 12px; }
.rooms { padding: 0 12px; }
.room { padding: 2px 0 10px; border-bottom: 1px solid #353d33; margin-bottom: 8px; border-radius: 6px; }
.room-head { display: flex; align-items: center; gap: 5px; padding: 2px 2px 6px; }
.room-name { padding: 5px 3px; width: 100%; font-weight: 500; font-size: 13px; }
.room-count { color: #879380; font-size: 10px; white-space: nowrap; }
.icon-button { padding: 3px; min-width: 28px; min-height: 28px; font-size: 14px; }
.artwork { display: grid; grid-template-columns: 68px minmax(0, 1fr); align-items: center; gap: 8px; padding: 7px 8px; margin: 0 0 5px; background: #242b25; border: 1px solid #394137; border-radius: 5px; }
.artwork[draggable=true] { cursor: grab; }
.artwork.is-dragging { opacity: .45; }
.artwork.is-over { border-top: 3px solid #c5db9b; }
.room.is-over { background: #35412e; }
.thumb { display: block; width: auto; height: auto; max-width: 68px; max-height: 60px; object-fit: contain; border-radius: 2px; justify-self: center; align-self: center; }
.artwork-content { min-width: 0; }
.image-name { font-size: 12px; line-height: 18px; width: 100%; padding: 2px 3px; text-overflow: ellipsis; }
.finish-select { display: block; width: 100%; min-width: 0; margin-top: 3px; padding: 4px; font-size: 10px; }
.artwork-actions { display: grid; grid-template-columns: minmax(0, 1fr) repeat(3, 25px); align-items: center; gap: 2px; margin-top: 3px; }
.room-select { grid-column: 1; width: 100%; min-width: 0; padding: 4px; font-size: 10px; }
.artwork-actions .icon-button { min-width: 25px; font-size: 14px; color: #b8c4b0; }
.artwork-actions [data-action="image-up"] { grid-column: 2; }
.artwork-actions [data-action="image-down"] { grid-column: 3; }
.artwork-actions [data-action="delete-image"] { grid-column: 4; }
.empty-room { padding: 20px 8px; text-align: center; color: #8c9b84; border: 1px dashed #485440; border-radius: 5px; font-size: 12px; }
.add-room { display: block; width: calc(100% - 28px); margin: 4px 14px 22px; text-align: left; }
.preview { min-width: 0; min-height: 0; display: flex; flex-direction: column; padding: 30px; justify-content: center; }
.empty-state { flex: 1; display: grid; place-items: center; }
.drop-zone { display: flex; flex-direction: column; align-items: center; justify-content: center; width: min(680px, 100%); min-height: 400px; padding: 55px 20px; border: 1px dashed #5c6654; background: radial-gradient(ellipse at center, #242c25, #191e1a 75%); border-radius: 12px; }
.drop-zone:hover { border-color: #b7cc96; background: #212921; }
.gallery-mark { width: 155px; margin-bottom: 35px; stroke: #c5cbb3; stroke-width: 1.2; }
.gallery-mark rect { fill: #2c342b; }
.drop-zone strong { font-size: 23px; font-weight: 400; letter-spacing: -.02em; }
.drop-zone > span { font-size: 13px; color: #c1cbb5; margin-top: 9px; }
.drop-zone small { font-size: 11px; color: #8e9b85; margin-top: 32px; }
.viewer { width: 100%; min-height: 0; max-width: 1500px; margin: auto; display: flex; flex-direction: column; border: 1px solid #3d453a; border-radius: 8px; overflow: hidden; background: #101411; }
.stage { position: relative; aspect-ratio: 16 / 9; min-height: 0; background: #191d1b; }
#canvas-host { position: absolute; inset: 0; }
#canvas-host canvas { display: block; width: 100%; height: 100%; }
.tour-credits { position: absolute; bottom: 6.5%; right: 2.5%; font-size: 9px; line-height: 1.25; text-align: right; color: #c1c8bb; text-shadow: 0 1px 5px #000; pointer-events: none; }
.music-credit { white-space: nowrap; }
.loading, .preview-error { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; padding: 30px; background: #151917df; font-size: 14px; color: #dce7cd; }
.controls { display: flex; align-items: center; gap: 14px; padding: 12px 15px; background: #1b211c; }
#play { min-width: 87px; }
#seek { min-width: 0; flex: 1; accent-color: #c5db9b; height: 30px; }
#time-label { font-size: 11px; color: #aebaa5; font-variant-numeric: tabular-nums; white-space: nowrap; }
#fullscreen { font-size: 22px; padding: 2px; min-width: 30px; }
.export-bar { display: flex; align-items: flex-end; justify-content: flex-end; gap: 16px; width: 100%; max-width: 1500px; margin: 22px auto 0; font-size: 12px; }
.music-picker { display: grid; gap: 7px; margin-right: auto; min-width: 0; }
.field-label { font-size: 11px; color: #aebaa5; }
.music-picker select { width: 100%; max-width: 260px; text-overflow: ellipsis; }
select { border: 1px solid #414c3b; border-radius: 5px; padding: 9px; background: #232b24; color: #d8e1cf; font-size: 12px; }
.primary { background: #c5db9b; border-color: #c5db9b; color: #1a2614; padding: 11px 21px; font-weight: 600; }
.primary:hover { background: #d9edb3; }
.primary span { margin-left: 17px; }
.drop-overlay { position: fixed; inset: 12px; border: 2px dashed #c5db9b; background: #202d22ed; z-index: 30; border-radius: 12px; display: grid; place-content: center; font-size: 26px; pointer-events: none; }
.notice { position: fixed; left: 50%; transform: translateX(-50%); bottom: 22px; z-index: 50; display: flex; align-items: center; gap: 15px; max-width: min(650px, calc(100% - 28px)); width: max-content; padding: 12px 14px 12px 20px; background: #e5eadc; color: #192217; border-radius: 8px; box-shadow: 0 8px 40px #0008; font-size: 13px; }
.notice button { color: #263a1a; border-color: #b3bfa7; background: transparent; }
#notice-text { white-space: pre-line; }
dialog { width: min(390px, calc(100% - 28px)); padding: 0; border: 1px solid #5b684e; border-radius: 12px; background: #1d261e; color: #ecf1e6; }
dialog::backdrop { background: #090f0bd9; backdrop-filter: blur(4px); }
.export-dialog-inner { display: grid; gap: 18px; padding: 28px; }
dialog h2 { font-size: 21px; font-weight: 400; margin: 0; }
dialog p { font-size: 13px; color: #becbb1; margin: 0; }
progress { width: 100%; height: 7px; accent-color: #c5db9b; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); }
.viewer:fullscreen { max-width: none; height: 100%; border: 0; border-radius: 0; justify-content: center; }
.viewer:fullscreen .stage { flex: 1; aspect-ratio: auto; }
@media (max-width: 1100px) { .workspace { grid-template-columns: 305px minmax(0,1fr); } .preview { padding: 20px; } .app-header { padding-inline: 20px; } .tour-credits { font-size: 7px; } }
@media (max-width: 760px) {
  .app-header { padding: 4px 15px; }
  .brand { font-size: 14px; }
  .app-header nav button { font-size: 12px; }
  .workspace { height: auto; min-height: calc(100dvh - var(--app-header-height)); display: flex; flex-direction: column; }
  .preview { order: -1; padding: 16px; }.editor { border-right: 0; border-top: 1px solid #343e30; overflow: visible; }
  .editor-toolbar { top: 0; }.empty-state { min-height: calc(100dvh - var(--app-header-height) - 55px); }
  .drop-zone { min-height: 350px; }.drop-zone strong { font-size: 21px; }.drop-zone small { font-size: 10px; }
  .controls { gap: 9px; padding: 9px; }#time-label { font-size: 10px; }#play { min-width: 68px; padding: 7px; }
  .tour-credits { font-size: 6px; }
  .export-bar { margin-top: 14px; gap: 10px; flex-wrap: wrap; }.primary { padding-inline: 14px; }
  .music-picker { flex: 1 0 100%; }.music-picker select { max-width: none; }
  .rooms { display: grid; grid-template-columns: repeat(auto-fit,minmax(280px,1fr)); gap: 10px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
