:root {
  color-scheme: dark;
  --bg: #101116; --panel: #17181f; --surface: #1d1e27; --edge: #2c2e3a;
  --text: #f0edf4; --dim: #aaabbc; --muted: #8b8ca1; --accent: #c6afff; --deep: #241c36;
  --sans: "Inter", "Segoe UI", sans-serif; --mono: "IBM Plex Mono", Consolas, monospace;
  font: 14px/1.5 var(--sans); color: var(--text); background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, select, textarea { font: inherit; }
button, a, select { -webkit-tap-highlight-color: transparent; }
a { color: var(--accent); text-decoration: none; }
button { cursor: pointer; color: inherit; }
button:disabled { opacity: .45; cursor: not-allowed; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
.top { height: 70px; padding: 0 max(5vw, calc((100vw - 1480px)/2)); display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #22232e; background: #121319; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-size: 16px; font-weight: 720; white-space: nowrap; }
.brand-sign { color: #1a1124; background: #c9afff; border-radius: 8px; width: 32px; height: 32px; display: grid; place-content: center; font-size: 19px; }
.brand-small { font: 10px var(--mono); letter-spacing: .14em; color: var(--muted); margin-left: 1px; }
.account, .project-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.account { color: var(--muted); font-size: 12px; }
#account-link { color: var(--dim); border: 1px solid var(--edge); border-radius: 7px; padding: 6px 10px; }
main { margin: auto; width: min(1480px, 90%); padding: 38px 0 52px; }
footer { margin: auto; width: min(1480px, 90%); border-top: 1px solid var(--edge); padding-block: 12px 22px; font-size: 11px; }
footer a { color: var(--muted); }
.privacy { max-width: 660px; display: grid; gap: 14px; }
.privacy p { color: var(--dim); }
.title-bar { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 25px; }
.context { color: var(--accent); font: 10px var(--mono); letter-spacing: .16em; font-weight: 600; }
h1 { font-size: clamp(27px, 3vw, 46px); line-height: 1.12; letter-spacing: -.04em; font-weight: 690; margin-top: 8px; overflow-wrap: anywhere; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 36px; padding: 7px 12px; border: 1px solid transparent; border-radius: 7px; font-weight: 610; font-size: 12px; text-align: center; }
.button.primary { background: #cbb7ff; color: #1f152e; }
.button.outline { background: #191a22; border-color: var(--edge); color: var(--text); }
.button.subtle { background: #28223a; border-color: #39304e; color: #ddcaff; }
.button:hover:not(:disabled) { filter: brightness(1.16); }
.layout { display: grid; grid-template-columns: minmax(0, 2.25fr) minmax(300px, 1fr); align-items: start; gap: 19px; }
.layout.play-only { display: block; max-width: 1050px; margin-inline: auto; }
.playtest, .workspace { border: 1px solid var(--edge); background: var(--panel); border-radius: 11px; overflow: hidden; min-width: 0; }
.panel-title { display: flex; align-items: center; gap: 8px; min-height: 47px; padding: 0 13px; background: #191a22; }
.panel-title strong { font-size: 13px; }
.indicator { width: 7px; height: 7px; border-radius: 50%; background: #91ebc6; box-shadow: 0 0 8px #91ebc648; }
.room-label { border-left: 1px solid #343541; padding-left: 9px; margin-right: auto; color: var(--dim); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quiet { background: transparent; border: 0; color: var(--dim); border-radius: 5px; padding: 4px 6px; white-space: nowrap; }
.quiet:hover { background: #ffffff12; color: white; }
.game-menu { display: inline-flex; align-items: center; gap: 5px; }
.game-menu img { width: 17px; height: 17px; object-fit: contain; }
#restart { font-size: 21px; line-height: 1; }
.stage { position: relative; isolation: isolate; display: block; overflow: hidden; aspect-ratio: 16 / 9; background: #222134; cursor: crosshair; }
.backdrop, .hotspots { position: absolute; inset: 0; }
.backdrop { z-index: -2; background: center / 100% 100% no-repeat; }
.backdrop.motel { background-image: url("/art/motel.jpg"); }
.backdrop.blueprint { background: linear-gradient(transparent 75%, #121722 75%), repeating-linear-gradient(0deg, #222943 0 1px, transparent 1px 28px), repeating-linear-gradient(90deg, #222943 0 1px, #171f33 1px 28px); }
.backdrop.night { background: radial-gradient(circle at 60% 21%, #fad1ba 0 3%, #ab6db777 3.1%, transparent 18%), linear-gradient(0deg, #201c2d 0 28%, #513247 28% 37%, #18243d 37%, #101729); }
.backdrop.orbit { background: radial-gradient(ellipse at 65% 46%, #b192ea 0 11%, #7c528e 12%, transparent 13%), radial-gradient(circle at 25% 25%, #dbe9f4 0 .2%, transparent .4%), radial-gradient(circle at 68% 18%, #eadef8 0 .15%, transparent .3%), linear-gradient(0deg,#242a45 0 29%,#4d5871 29% 30%,#141a31 30% 82%,#2c344e 82%); }
.backdrop.custom { background: center / 100% 100% no-repeat; }
.backdrop-animation { display: block; width: 100%; height: 100%; }
.depth-layer { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.scene-prop { position: absolute; display: block; transform: translate(-50%, -100%); }
.spot-art.depth-actor { inset: auto; transform: translate(-50%, -50%); }
.spot { position: absolute; transform: translate(-50%, -50%); display: grid; place-items: center; border: 1px dashed transparent; border-radius: 7px; background: transparent; min-width: 24px; min-height: 22px; z-index: 2; padding: 0; }
.spot:hover, .spot:focus-visible, .show-spots .spot { border-color: #eddcffaa; background: #b99cf917; }
.spot .pin { color: #ead9ff; background: #241b38dd; border: 1px solid #d2b8ffbb; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; line-height: 1; box-shadow: 0 2px 12px #000; pointer-events: none; }
.spot:hover .pin, .spot:focus-visible .pin { background: #ceafff; color: #251834; }
.spot-art { position: absolute; inset: 0; pointer-events: none; }
.spot-art img { width: 100%; height: 100%; object-fit: contain; }
.spot-art + .pin { position: relative; }
.sprite { position: absolute; width: calc(21% * var(--actor-width-scale, 1)); height: 44%; transform: translate(-50%, -100%); transform-origin: center bottom; pointer-events: none; z-index: 1; display: grid; align-items: end; justify-items: center; }
.sprite:after { content: ""; position: absolute; bottom: -3%; width: 80%; height: 8%; left: 10%; background: #050509a0; border-radius: 50%; filter: blur(2px); z-index: -1; }
.sprite img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; object-position: bottom; }
.sprite.can-face { width: calc(23% * var(--actor-width-scale, 1)); }
.figure { width: 67%; height: 91%; position: relative; transform-origin: bottom center; filter: drop-shadow(0 0 2px #1e112b); }
.sprite > .walk-art { visibility: hidden; }
.sprite.walk-cycle > :is(.idle-art, .idle-overlay, .expression-frame) { visibility: hidden; }
.sprite.walk-cycle > .walk-art { visibility: visible; }
.sprite.can-face :is(img, canvas) { transform: scaleX(var(--walk-direction, 1)); }
.figure i, .figure b, .figure span, .figure em { display: block; position: absolute; }
.figure i { width: 53%; height: 29%; left: 25%; top: 4%; background: #e8c9b3; border: 2px solid #332138; border-radius: 43% 47% 42% 38%; box-shadow: inset 0 6px 0 #563548; }
.figure b { left: 21%; width: 62%; height: 36%; top: 31%; border-radius: 27% 28% 10% 10%; background: linear-gradient(90deg, #8060bf 0 42%, #dac6fc 43% 58%, #9475cd 59%); border: 2px solid #36294a; }
.figure span, .figure em { top: 65%; height: 32%; width: 23%; border-bottom: 4px solid #140e25; background: #4d3c68; border-radius: 0 0 22% 22%; }
.figure span { left: 25%; } .figure em { left: 54%; }
.subtitle { position: absolute; bottom: 4%; left: 50%; transform: translateX(-50%); width: max-content; max-width: 86%; padding: 7px 11px; background: #101017e8; color: #faf6ff; border: 1px solid #ffffff27; border-radius: 6px; text-align: center; font-size: clamp(10px, 1.1vw, 15px); z-index: 3; pointer-events: none; box-shadow: 0 6px 18px #0006; overflow-wrap: anywhere; }
.subtitle:empty { display: none; }
.voice-preview { display: block; margin-top: 3px; color: #ccc3d7; font-style: normal; }
.speaker { color: #d2bcff; font-weight: 700; }
.game-tools { display: flex; gap: 12px; justify-content: space-between; padding: 11px 12px; background: #191a22; border-top: 1px solid #ffffff10; min-height: 66px; }
.verbs, .items { display: flex; gap: 6px; align-items: stretch; flex-wrap: wrap; }
.verb, .item { display: grid; place-items: center; gap: 1px; min-width: 58px; min-height: 42px; background: #20212b; border: 1px solid #30313f; border-radius: 6px; padding: 4px 7px; font-size: 10px; color: var(--dim); }
.verb span:first-child, .item span:first-child { font-size: 16px; line-height: 1; }
.verb.active, .item.active { color: #e5d7ff; background: #302542; border-color: #69548c; }
.verb:hover, .item:hover { border-color: #805eae; }
.inventory-label { padding-inline: 5px; margin-inline-start: -5px; color: var(--text); font-size: 13px; font-weight: 700; }
.item { flex: none; width: 62px; height: 62px; min-width: 62px; min-height: 62px; padding: 2px; grid-template: minmax(0, 1fr) / minmax(0, 1fr); }
.item-icon { display: grid; place-items: center; width: 100%; height: 100%; grid-template: minmax(0, 1fr) / minmax(0, 1fr); }
.item img { display: block; width: 100%; height: 100%; min-width: 0; min-height: 0; object-fit: contain; }
.item-icon svg { width: 28px; height: 28px; }
.play-hint { padding: 9px 13px; border-top: 1px solid #262832; font-size: 11px; color: var(--muted); min-height: 34px; }
.tabs { display: flex; gap: 15px; padding: 0 15px; min-height: 47px; overflow-x: auto; border-bottom: 1px solid var(--edge); background: #191a22; }
.tabs button { background: none; border: 0; border-bottom: 2px solid transparent; padding: 0 1px; color: var(--dim); font-weight: 580; font-size: 12px; }
.tabs button.active { color: #e0ceff; border-color: #c3a4ff; }
.editor { padding: 17px; max-height: 75vh; overflow: auto; min-height: 420px; }
.editor h2, dialog h2 { font-size: 17px; letter-spacing: -.015em; }
.editor h3 { font-size: 13px; }
.editor p, dialog p { font-size: 12px; color: var(--dim); }
.heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.heading p { margin-top: 4px; }
.director-card { border: 1px solid #3a3050; background: radial-gradient(ellipse at top left,#302544,#211e2d 75%); border-radius: 8px; padding: 15px; margin-bottom: 17px; }
.director-card h2 { color: #f4eaff; margin-bottom: 5px; }
.director-card p { color: #c7bed9; margin-bottom: 12px; }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.direction-scene { margin-bottom: 11px; font-size: 11px; color: #c7bed9; overflow-wrap: anywhere; }
.direction-scene strong { color: #f2eaff; }
.director-card .direction-result { margin: 0; overflow-wrap: anywhere; }
.director-log { display: grid; gap: 8px; max-height: 32vh; overflow: auto; margin-block: 10px; }
.director-log:empty { display: none; }
.director-message { padding: 8px 10px; border: 1px solid var(--edge); border-radius: 6px; background: var(--panel); overflow-wrap: anywhere; }
.director-message.user { background: #342648; }
.director-message p { margin: 4px 0 0; white-space: pre-wrap; }
.caption { color: var(--muted); font: 9px var(--mono); letter-spacing: .09em; margin: 12px 0 7px; }
.divider { border: 0; border-top: 1px solid var(--edge); margin: 15px 0; }
.stack { display: grid; gap: 9px; }
.row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.between { justify-content: space-between; }
.entry { border: 1px solid var(--edge); border-radius: 7px; padding: 9px; background: var(--surface); }
.entry strong, .entry span { overflow-wrap: anywhere; min-width: 0; }
.entry p { margin-top: 4px; }
.entry.active { border-color: #755b9c; }
.entry button { flex: 0 0 auto; }
label { display: grid; gap: 4px; color: #d1cbdf; font-size: 11px; }
input:not([type=checkbox]), select, textarea { width: 100%; min-width: 0; background: #101116; border: 1px solid #383a48; border-radius: 5px; color: var(--text); padding: 7px 8px; font-size: 12px; }
input[type=checkbox] { accent-color: #c9afff; }
textarea { resize: vertical; min-height: 64px; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
details { padding: 7px 0; }
summary { color: var(--dim); cursor: pointer; margin-bottom: 6px; }
dialog { background: var(--panel); color: var(--text); border: 1px solid #3d3d4e; padding: 22px; border-radius: 11px; width: min(520px, 92vw); max-height: 88vh; overflow: auto; }
dialog::backdrop { background: #0b0912ba; }
.close { position: absolute; right: 9px; top: 5px; font-size: 23px; }
#dialog-body { display: grid; gap: 12px; }
#notice { position: fixed; z-index: 5; right: max(5vw, 14px); bottom: 22px; max-width: min(450px, 90vw); background: #262034; border: 1px solid #72578f; padding: 9px 13px; border-radius: 7px; color: #f2e9ff; font-size: 12px; box-shadow: 0 8px 25px #0008; overflow-wrap: anywhere; }
#notice.error { border-color: #b96b84; }
@media (max-width: 940px) {
  main { width: 94%; }
  .top { padding-inline: 3%; }
  .layout { grid-template-columns: minmax(0, 1.6fr) minmax(284px, 1fr); gap: 12px; }
  .editor { padding: 13px; }
}
@media (max-width: 680px) {
  .top { height: 58px; } main { padding-top: 23px; }
  .layout { grid-template-columns: minmax(0, 1fr); }
  .editor { max-height: none; min-height: 0; }
  .title-bar { align-items: flex-start; flex-direction: column; margin-bottom: 14px; }
  .game-tools { gap: 5px; padding: 8px; flex-wrap: wrap; }
  .verb { min-width: 48px; } .account #save-status { display: none; }
  .room-label { font-size: 10px; }
}

.studio-shell {
  height: 100dvh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  background: radial-gradient(ellipse at 18% 16%, #292121 0, #14141b 55%, #101116 100%);
  --accent: #f2c88c;
  --edge: #39343f;
}
.studio-shell .top { height: clamp(44px, 7vh, 62px); padding-inline: max(3vw, calc((100% - 1480px) / 2)); }
.brand-sign { color: #362315; background: #f2c88c; box-shadow: inset 0 0 0 1px #ffe8be; }
.studio-shell main {
  width: min(1480px, 94%);
  min-height: 0;
  height: 100%;
  padding: clamp(8px, 2.2vh, 28px) 0 8px;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
}
.studio-shell footer { width: min(1480px, 94%); display: flex; justify-content: space-between; padding: 5px 0; }
.title-bar { align-items: center; flex-flow: row wrap; gap: 8px 16px; margin-bottom: clamp(6px, 1.6vh, 18px); }
h1 { font: 650 clamp(25px, 4.1vh, 43px)/1.05 Georgia, serif; letter-spacing: -.035em; margin-top: 3px; color: #fff2e1; }
.context { color: #e8b881; }
.button.primary { background: #f2c88c; color: #2f2018; }
.button.outline { background: #22212a; }
.layout { grid-row: 3; min-height: 0; grid-template-columns: minmax(0, 2.2fr) minmax(270px, 1fr); align-items: stretch; }
.layout.play-only { display: grid; grid-template-columns: minmax(0, 1fr); width: min(100%, 1080px); }
.playtest, .workspace { min-height: 0; box-shadow: 0 14px 38px #09080e65; }
.playtest { display: flex; flex-direction: column; }
.workspace { display: grid; grid-template-rows: auto minmax(0, 1fr); }
.panel-title { min-height: 42px; flex-shrink: 0; }
.stage { flex: 1 1 0; min-height: 0; aspect-ratio: auto; background: #17131b; }
.stage { container-type: size; }
.stage-frame { position: absolute; inset: 50% auto auto 50%; translate: -50% -50%; width: min(100cqw, calc(100cqh * var(--stage-ratio, 1.5))); height: min(100cqh, calc(100cqw / var(--stage-ratio, 1.5))); isolation: isolate; overflow: hidden; }
.game-tools { flex-shrink: 0; padding: 7px 10px; min-height: 54px; }
.verb.active, .item.active { color: #ffe4b8; background: #39302b; border-color: #987046; }
.play-hint { flex-shrink: 0; min-height: 0; margin: 0; padding: 5px 10px; }
.editor { min-height: 0; max-height: none; scrollbar-width: none; }
.director-log, dialog, .tabs { scrollbar-width: none; }
.tabs { min-height: 41px; }
.tabs button.active { color: #ffe1b6; border-color: #f2c88c; }
.director-card { background: radial-gradient(ellipse at top left,#352b2e,#221f2a 80%); border-color: #4a3e45; }
.character-spot > .pin { opacity: 0; }
.character-spot { z-index: 0; }
.character-spot:hover > .pin, .character-spot:focus-visible > .pin, .show-spots .character-spot > .pin { opacity: 1; }
.performance-frame, .expression-frame, .idle-overlay, .idle-motion-frame { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.performance-frame { z-index: 1; }
.director-playtest-frame { position: fixed; left: -10000px; top: 0; width: 1000px; height: 760px; border: 0; }
.director-playtest-runtime :is(.top, .title-bar, #workspace, #mobile-view, footer, .panel-title, .game-tools, .play-hint) { display: none !important; }
.director-playtest-runtime, .director-playtest-runtime main, .director-playtest-runtime #layout, .director-playtest-runtime .playtest { display: block; width: 100%; height: 100%; margin: 0; padding: 0; }
.director-playtest-runtime, .director-playtest-runtime main { height: 100dvh; }
.director-playtest-runtime #stage { width: 100%; height: 100%; }
.spot-art .registered-standing, .sprite .registered-standing { inset: auto auto 0 50%; width: auto; height: 100%; translate: -50% 0; }
.sprite.scene-player-bundle > .idle-art { inset: auto auto 0 50%; width: auto; height: 100%; translate: -50% 0; }
.sprite.scene-player-bundle > :is(.performance-frame, .regional-expression) { inset: auto auto 0 50%; width: auto; height: 100%; translate: -50% 0; }
.idling-drawn > .idle-art, .performing > .idle-motion-frame, .walk-cycle > .idle-motion-frame { visibility: hidden; }
.mouth-overlay > .idle-art { visibility: visible; }
.mouth-overlay > :is(.idle-motion-frame, .expression-frame) { visibility: hidden; }
.mouth-overlay > .performance-frame { z-index: 2; }
.performing.regional-performance > .idle-art { visibility: visible; }
.performing.regional-performance.idling-drawn > .idle-art { visibility: hidden; }
.performing.regional-performance > .idle-motion-frame { visibility: visible; }
.regional-performance > .performance-frame { z-index: 3; }
.mouth-overlay.regional-performance > :is(.idle-motion-frame, .expression-frame) { visibility: visible; }
.mouth-overlay.regional-performance.idling-drawn > .idle-art { visibility: hidden; }
.mouth-overlay.replacing-mouth > .idle-art { visibility: hidden; }
.regional-expression { z-index: 4; }
.mouth-overlay > .regional-expression { visibility: visible; }
.moving > .regional-expression, .performing:not(.regional-performance) > .regional-expression { visibility: hidden; }
.sprite.can-face .registered-standing { transform: scaleX(var(--walk-direction, 1)); }
.idle-overlay { z-index: 2; }
.sprite :is(.performance-frame, .expression-frame, .idle-overlay) { object-position: bottom; }
:is(.performing, .expressing) > .idle-art { visibility: hidden; }
@media (prefers-reduced-motion: reduce) { .idle-overlay { display: none; } }
.conversation #sprite, .conversation .pin { display: none; }
.conversation .spot { pointer-events: none; }
.conversation-choices {
  position: absolute; right: 4%; top: 50%; translate: 0 -50%; z-index: 3;
  display: grid; gap: clamp(4px, 1vw, 11px); width: 37%; max-height: 75%;
  overflow: auto; scrollbar-width: thin;
}
.conversation-choice {
  text-align: left; color: #fff1df; background: #201a21ed; border: 1px solid #b78d64;
  border-radius: 7px; padding: clamp(6px, 1vw, 13px); font-size: clamp(10px, 1.4vw, 16px);
  line-height: 1.22; text-decoration: none;
}
.conversation-choice:hover, .conversation-choice:focus-visible { background: #45332c; border-color: #f2c88c; }
.conversation-choice[aria-busy="true"] { color: #dfcbb6; background: #362c32; border-color: #dfbd8c; }
.conversation-choice[aria-busy="true"]::after { content: "Playing · click to stop"; display: block; margin-top: .3em; font-size: .75em; font-weight: normal; opacity: .85; }
.conversation-exit { position: absolute; top: 4%; right: 4%; z-index: 4; }
.conversation-exit > button { min-height: 29px; padding: 5px 10px; }
.stage-frame.room-loading::after { content: ""; position: absolute; inset: 0; z-index: 100; background: #000; }
.subtitle.thought { font-style: italic; }
.conversation .subtitle { left: 34%; max-width: 61%; }
.cutscene .spot { pointer-events: none; }
.cutscene .spot:disabled, .conversation .spot:disabled { opacity: 1; }
.scripted-stage > .game-tools, .scripted-stage > .play-hint { display: none; }
.skip-cutscene { position: absolute; z-index: 5; top: 4%; right: 4%; padding: 6px 10px; }
.button.start-intro { position: absolute; z-index: 4; inset: 50% auto auto 50%; translate: -50% -50%; width: 57.4%; height: 46.2%;
  display: grid; place-items: center; padding: 0; border: 2px solid #e7c78c; border-radius: clamp(12px, 2cqw, 32px);
  background: linear-gradient(145deg, #221a2bdf, #402834e9); color: #fff1ca; box-shadow: 0 12px 46px #100b17b0;
  font: 800 clamp(18px, 4.9cqw, 77px)/1 var(--sans); letter-spacing: .025em; text-transform: uppercase; }
.button.start-intro:hover { background: linear-gradient(145deg, #32233bf2, #553640f4); }
.stage-fullscreen-toggle { position: absolute; z-index: 5; right: 0; bottom: 0; display: grid; place-items: end;
  width: 44px; height: 44px; padding: 0 5px 5px 0; cursor: pointer; }
.start-intro:not([hidden]) + .stage-fullscreen-toggle { display: none; }
.mobile-view { display: none; }
@media (max-width: 680px), (max-height: 575px) and (max-width: 950px) {
  .studio-shell main { width: calc(100% - 20px); }
  .studio-shell .top { padding-inline: 11px; }
  .title-bar { gap: 5px 12px; }
  .title-bar h1 { margin-top: 0; }
  .title-bar .project-actions { gap: 5px; }
  .title-bar .button { min-height: 30px; padding: 4px 7px; font-size: 11px; }
  .layout { grid-template-columns: minmax(0, 1fr); }
  .layout:not(.show-editor) .workspace, .layout.show-editor .playtest { display: none; }
  .mobile-view { display: flex; gap: 4px; margin-bottom: 7px; }
  .mobile-view button { flex: 1; padding: 5px; border-radius: 6px; border: 1px solid var(--edge); background: #201e27; }
  .mobile-view button[aria-pressed="true"] { background: #3a302a; border-color: #9a754d; color: #ffdeb0; }
  .panel-title { min-height: 38px; padding-inline: 6px; gap: 5px; }
  .panel-title .quiet { font-size: 11px; padding-inline: 4px; }
  #restart { font-size: 19px; }
  .panel-title strong { font-size: 11px; }
  .game-tools { min-height: 0; padding: 5px; gap: 5px; }
  .verb { min-width: 37px; min-height: 35px; }
  .subtitle { font-size: clamp(11px, 3.1vw, 14px); bottom: 5%; }
  .studio-shell footer { padding-block: 2px; }
  .brand-small { display: none; }
}

/* Play is the public default; creation is a deliberate separate mode. */
body { user-select: none; -webkit-user-select: none; }
input, textarea, [contenteditable="true"] { user-select: text; -webkit-user-select: text; }
img { -webkit-user-drag: none; }
.play-mode #workspace, .play-mode #project-actions, .play-mode #mobile-view, .play-mode #save-status { display: none !important; }
.play-mode #layout { display: grid; grid-template-columns: minmax(0, 1fr); width: min(100%, 1200px); margin-inline: auto; }
.play-mode .top { height: 52px; background: transparent; }
.play-mode .context, .play-mode .panel-title > .indicator { display: none; }
.play-mode .title-bar { justify-content: center; text-align: center; }
.play-mode .brand { font-weight: 500; color: var(--dim); }
.panel-title { flex-wrap: wrap; gap: 6px 10px; }
.panel-title .room-label { flex: 1; }
#stage-frame { touch-action: manipulation; -webkit-touch-callout: none; }
.spot, .spot:hover { border-color: transparent; background: transparent; cursor: inherit; }
.stage-frame.pointer-hotspot { cursor: var(--interaction-cursor, url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Cpath d='M7 3l18 13-9 2-4 9z' fill='%23ffe3b0' stroke='%232a202d' stroke-width='2'/%3E%3Ccircle cx='24' cy='7' r='4' fill='%23c6afff' stroke='%232a202d' stroke-width='2'/%3E%3C/svg%3E") 7 3, pointer); }
.stage-frame.pointer-blocked { cursor: default; }
.spot .pin, .spot:hover .pin, .character-spot:hover > .pin { opacity: 0; }
.spot:focus-visible, .show-spots .spot, .reveal-spots .spot { border-color: #eddcffaa; background: #b99cf917; }
.spot:focus-visible .pin, .show-spots .spot .pin, .reveal-spots .spot .pin { opacity: 1; }
.interaction-menu { position: absolute; z-index: 40; min-width: 150px; max-width: calc(100% - 12px); max-height: calc(100% - 12px); overflow-y: auto; padding: 6px; border: 1px solid #a88a65; border-radius: 12px; background: #211e29f5; box-shadow: 0 12px 32px #0009; backdrop-filter: blur(12px); }
.interaction-title { display: block; padding: 6px 10px; color: #d4c7ba; font-size: 14px; }
.interaction-option { display: block; width: 100%; text-align: left; border: 0; border-radius: 7px; padding: 10px 12px; min-height: 42px; background: #2e2835; color: #fff1df; font-size: 16px; margin-block: 3px; }
.interaction-option:hover, .interaction-option:focus-visible { background: #554331; }
#inventory-panel { display: block; position: absolute; z-index: 35; bottom: 12px; left: 50%; transform: translateX(-50%); width: min(92%, 650px); min-inline-size: 0; min-height: 104px; margin: 0; padding: 12px 16px 16px; background: #211e29f5; border: 1px solid #75604c; border-radius: 12px; box-shadow: 0 12px 32px #0009; touch-action: none; }
:is(#inventory-swipe-edge, #fullscreen-toolbar-swipe-edge) { display: none; }
@media (any-pointer: coarse) {
  #inventory-swipe-edge, .game-fullscreen #fullscreen-toolbar-swipe-edge { display: block; position: absolute; z-index: 2; inset: auto 0 0; height: 26px; touch-action: none; }
  .game-fullscreen #fullscreen-toolbar-swipe-edge { inset: 0 0 auto; }
}
#inventory-pages { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 6px; color: var(--dim); font-size: 12px; }
#inventory-pages button { width: 32px; height: 28px; padding: 0; font-size: 22px; line-height: 1; }
#inventory-pages button[aria-disabled="true"] { opacity: .4; cursor: default; }
/* A narrow body target leaves surrounding props reachable while an item is armed. */
.inventory-player-target { position: absolute; z-index: 34; width: auto; min-width: 22px; max-width: calc(8% * var(--actor-width-scale, 1)); aspect-ratio: 2 / 5; transform: translate(-50%, -100%); transform-origin: center bottom; clip-path: inset(15% 0 27% round 40%); border: 0; background: transparent; }
.inventory-player-target:focus-visible { background: #b99cf930; }
.stage-frame.using-inventory-item, .stage-frame.using-inventory-item :is(.spot, .item, .inventory-player-target) { cursor: crosshair; }
.subtitle { position: static; flex: 0 0 auto; transform: none; width: auto; max-width: none; min-height: 46px; margin: 0; padding: 10px 18px; border: 0; border-top: 1px solid var(--edge); border-radius: 0; box-shadow: none; text-align: center; font-size: 16px; background: #17181f; }
.subtitle:empty { display: block; }
.subtitle.overlay-caption { position: absolute; bottom: 4%; left: 50%; transform: translateX(-50%); max-width: 86%; width: max-content; background: #101017e8; border-radius: 6px; }
.play-hint { color: var(--dim); font-size: 14px; text-align: center; padding: 8px; }
@media (max-width: 680px) { .panel-title .room-label { flex-basis: 100%; order: 2; font-size: 14px; } .panel-title .quiet { font-size: 14px; min-height: 36px; } .play-hint { font-size: 12px; } .subtitle { font-size: 15px; padding: 8px 12px; } }

.reveal-spots .spot[aria-hidden="true"] { border-color: transparent; background: transparent; }
.reveal-spots .spot[aria-hidden="true"] .pin { opacity: 0; }

/* Window controls are fixed-size icons; captions never resize the play surface. */
.top .account { width: 100%; justify-content: flex-end; }
#browse-games { margin-right: auto; }
#creative-mode, #browse-games { font-size: 14px; white-space: nowrap; }
.panel-title { flex-wrap: nowrap; justify-content: flex-end; gap: 4px; padding: 4px 8px; min-height: 44px; }
.panel-title .icon-button { display: inline-grid; place-items: center; flex: 0 0 36px; width: 36px; height: 36px; padding: 7px; white-space: nowrap; border-radius: 6px; }
.icon-button svg { display: block; width: 21px; height: 21px; }
.icon-button:hover, .icon-button:focus-visible { background: #32333e; }
.icon-button[aria-pressed="false"] { color: var(--muted); }
.icon-button.stage-fullscreen-toggle { background: transparent; color: white; }
.stage-fullscreen-toggle:focus-visible { outline: 2px solid white; outline-offset: -4px; }
.subtitle-slot { flex: 0 0 76px; min-height: 0; background: var(--panel); }
.subtitle { height: 76px; min-height: 76px; max-height: 76px; overflow-y: auto; padding: 12px 18px; font: 400 15px/1.5 var(--sans); font-style: normal; color: var(--dim); background: var(--panel); text-align: left; pointer-events: auto; }
.subtitle:empty { display: block; }
.subtitle[hidden] { display: block !important; visibility: hidden; }
.subtitle .speaker { color: var(--text); font-weight: 700; }
:is(#subtitles-toggle, #inventory-toggle) { color: #a9a8b5; }
:is(#subtitles-toggle[aria-pressed="true"], #inventory-toggle[aria-expanded="true"]) {
  color: #ece8dc; --toggle-icon-fill: currentColor; --toggle-icon-detail: #17181f;
}
#subtitles-toggle svg { width: 20px; height: 18px; }
:is(#subtitles-toggle, #inventory-toggle) svg rect { fill: var(--toggle-icon-fill, #24252d); }
:is(#subtitles-toggle, #inventory-toggle) svg path:last-child { stroke: var(--toggle-icon-detail, currentColor); }
.subtitle.thought { font-style: normal; }
@media (max-width: 680px) {
 .panel-title { padding: 3px 4px; gap: 2px; }
 .panel-title .icon-button { flex-basis: 36px; padding: 7px; }
 .subtitle-slot { flex-basis: 88px; }
 .subtitle { height: 88px; min-height: 88px; max-height: 88px; padding: 9px 12px; font-size: 14px; }
 .top .account { gap: 6px; flex-wrap: nowrap; }
 #creative-mode, #browse-games { font-size: 12px; padding-inline: 5px; }
 #account-link { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
html.game-fullscreen, .game-fullscreen body { width: 100%; height: 100%; background: #07070a; overflow: hidden; }
.game-fullscreen .studio-shell { display: block; }
.game-fullscreen :is(.top, .title-bar, #mobile-view, #workspace, footer, .play-hint) { display: none !important; }
.game-fullscreen .studio-shell main, .game-fullscreen #layout { position: static; display: block; width: 100%; height: 100%; padding: 0; margin: 0; max-width: none; }
.game-fullscreen .playtest { position: fixed; inset: 0; width: 100dvw; height: 100dvh; border: 0; border-radius: 0; }
.game-fullscreen .stage { flex: 1; background: #07070a; }
.game-fullscreen .panel-title { position: absolute; inset: 0 0 auto; z-index: 100; min-height: 48px; background: #17181ff2; transform: translateY(-100%); transition: transform .16s ease-out; }
.game-fullscreen.show-game-toolbar .panel-title, .game-fullscreen .panel-title:focus-within,
.game-fullscreen .autoplay-toolbar .panel-title { transform: translateY(0); }
.game-fullscreen .autoplay-toolbar .panel-title { transition: none; }
#autoplay[aria-pressed="true"] { color: #fff1be; }
#autoplay-cursor { position: fixed; top: 0; left: 0; z-index: 200; width: 23px; height: 30px; pointer-events: none; transition: transform .28s ease-in-out; filter: drop-shadow(0 2px 2px #000a); }
#autoplay-cursor span, #autoplay-cursor::before { position: absolute; inset: 0; clip-path: polygon(0 0, 100% 64%, 59% 69%, 72% 94%, 55% 100%, 39% 74%, 0 98%); }
#autoplay-cursor::before { content: ""; background: #13121a; }
#autoplay-cursor span { inset: 2px 4px 5px 2px; background: #fff1be; }
#autoplay-cursor::after { content: ""; position: absolute; left: -11px; top: -11px; width: 22px; height: 22px; border: 2px solid #fff1be; border-radius: 50%; opacity: 0; }
#autoplay-cursor.clicked::after { animation: autoplay-click .25s ease-out; }
@keyframes autoplay-click { from { opacity: 1; transform: scale(.35); } to { opacity: 0; transform: scale(1.3); } }
@media (prefers-reduced-motion: reduce) {
  #autoplay-cursor { transition: none; }
  #autoplay-cursor.clicked::after { animation: none; }
}
.game-fullscreen .subtitle-slot { display: none; }
.subtitle.overlay-caption { position: absolute; z-index: 36; inset: auto auto var(--caption-bottom, 4%) 50%; transform: translateX(-50%); width: max-content; height: auto; min-height: 0; max-height: min(28%, calc(100% - var(--caption-bottom, 4%) - 4px)); max-width: min(86%, calc(100% - 88px)); padding: 7px 11px; border: 1px solid #ffffff27; border-radius: 6px; box-shadow: 0 6px 18px #0006; background: #101017e8; color: #faf6ff; text-align: center; font-size: clamp(14px, 2.5vh, 22px); transition: bottom .18s ease-out; }
@media (prefers-reduced-motion: reduce) { .subtitle.overlay-caption { transition: none; } }
.game-fullscreen .subtitle.thought { font-style: normal; }
.game-fullscreen .subtitle .speaker { color: #d2bcff; font-weight: 700; }
.subtitle.overlay-caption:empty, .subtitle.overlay-caption[hidden] { display: none !important; }
.fullscreen-rotated .playtest { inset: auto; left: 50%; top: 50%; width: 100dvh; height: 100dvw; transform: translate(-50%, -50%) rotate(90deg); }
.chapter-placeholder .stage, .chapter-placeholder .backdrop { background: white; cursor: default; }
.chapter-placeholder .depth-layer { display: none; }
.game-card { display: grid; gap: 6px; color: var(--text); margin-block: 10px; padding: 16px; }
.game-card span, .draft-detail { color: var(--dim); font-size: 14px; }
.draft-detail { margin: 4px 0 0; }
@media (max-width: 680px) {
 .studio-shell .top { height: 68px; }
 .top .account { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 1px 8px; }
 #browse-games { grid-column: 1; grid-row: 2; justify-self: start; padding-block: 1px; }
 #creative-mode { grid-column: 1; grid-row: 1; justify-self: start; }
 #account-link { grid-column: 2; grid-row: 1 / span 2; }
}
.fullscreen-rotated dialog { position: fixed; inset: auto; left: 50%; top: 50%; margin: 0; width: min(90dvh,600px); max-width: 90dvh; max-height: 90dvw; transform: translate(-50%,-50%) rotate(90deg); }
