/* Vector scene shell: one 8:5 artwork plane; controls stay outside reading text. */
:root{color:#f3e7ce;background:#30251e;--paper:#eee0c1;--ink:#3e3125;--teal:#75563d;--red:#a95037;--muted:#b4a083}
body{overflow:auto}.immersive-shell{height:100svh;height:100dvh;min-height:360px;display:flex;flex-direction:column;position:relative;background:#30251e;overflow:hidden}
.game-hud{min-height:58px;height:auto;flex:none;z-index:3;padding:8px 20px;gap:14px;border-bottom:1px solid #aa8f64;background:#443225;color:#f3e7ce}
.game-hud .brand{gap:10px}.game-hud .seal{width:30px;height:36px;font-size:18px}.game-hud .brand h1{font-size:22px;letter-spacing:3px;color:#f0dbb2;white-space:nowrap}
.hud-status{display:flex;align-items:center;gap:12px;margin:auto;font:12px system-ui,sans-serif;color:#d4c5a6}.hud-status strong{font:18px Georgia,serif;color:#f2dfb8;white-space:nowrap}.hud-status .funds{color:#edc883;border-left:1px solid #b7a07955;padding-left:12px}
.game-hud .header-right{gap:6px}.game-hud .plain{color:#f2dfb8;border-color:#b5a37b66;font:12px system-ui,sans-serif;background:#513d2e;min-height:40px}
.world-frame{flex:1;min-height:0;display:flex;flex-direction:column;position:relative;overflow:auto}
.immersive-stage{position:relative;width:100%;height:auto;min-height:140px;flex:1;aspect-ratio:auto;background:#d8c7a2;overflow:hidden;border:0;box-shadow:none}
.world-host{position:absolute;inset:0;width:100%;height:100%;overflow:hidden}.world-host canvas{display:block!important;width:100%!important;height:100%!important;max-width:none!important;max-height:none!important;margin:0!important;object-fit:cover}
.scene-heading{pointer-events:none;top:14px;left:18px;padding:8px 16px 10px 12px;background:linear-gradient(90deg,#30251ed9,#30251e00);border-left:2px solid #d3b473;z-index:1}
.scene-heading h2{font-size:22px;letter-spacing:2px;margin:4px 0 0}.scene-heading small{font:10px system-ui,sans-serif;color:#ead7b0;letter-spacing:1px}
.scene-objective{position:absolute;right:18px;top:14px;width:min(240px,31%);background:#30251edc;border:1px solid #ceb27b66;padding:9px 12px;pointer-events:none}.scene-objective small{font:9px system-ui,sans-serif;color:#dec18b}.scene-objective p{font:12px/1.5 system-ui,sans-serif;color:#eee3c6;margin:4px 0 0}
.scene-view-toggle{position:absolute;left:16px;bottom:12px;z-index:2;min-height:36px;background:#443225ec;border:1px solid #cfb780;color:#f4e7c6;padding:7px 11px;font:11px system-ui,sans-serif;border-radius:4px}
.game-dock{flex:none;display:flex;align-items:center;justify-content:center;gap:4px;background:#443225;padding:6px 10px;border-top:1px solid #a98e66;z-index:3;overflow-x:auto}
.game-dock button{border:1px solid transparent;background:none;color:#e8d7b4;padding:9px 12px;min-height:42px;border-radius:4px;font:13px system-ui,sans-serif;white-space:nowrap;flex:none}
.game-dock button:hover:not(:disabled),.game-dock button.active{background:#ba9e5e24;color:#fff0ce;border-color:#c3a36b55}.game-dock button.primary{background:#a64a39;color:#ffeac1;border-color:#deaa65;margin-left:8px;padding:9px 18px}
.art-credit{flex:none;height:17px;text-align:center;background:#30251e;color:#c0ad8c;font:8px/17px system-ui,sans-serif;white-space:nowrap;overflow:hidden}
.scene-hotspots{z-index:1}.scene-hotspot{background:#513d2ee8;padding:7px 12px;border-radius:18px;border:1px solid #dfc797;box-shadow:0 3px 13px #30251e60;font:11px system-ui,sans-serif;min-height:38px;max-width:30%;white-space:normal}.scene-hotspot:before{border-radius:50%;width:5px;height:5px;background:#f5d695;bottom:-8px;border:0}.scene-hotspot:disabled{opacity:.5}
.people-layer{position:absolute;inset:auto 16px 10px auto;display:flex;justify-content:flex-end;align-items:flex-end;gap:8px;pointer-events:none;z-index:1}
.person-token{position:relative!important;left:auto!important;top:auto!important;transform:none!important;pointer-events:auto;display:flex;align-items:center;gap:5px;background:#eee0c1ee;border:1px solid #bca071;border-radius:5px;padding:3px 6px 3px 3px;box-shadow:0 4px 14px #30251e55;min-height:44px}
.person-token img{height:56px;width:42px;display:block;object-fit:contain}.person-token span{color:#573f28;font:11px system-ui,sans-serif;white-space:nowrap}.person-token:hover{background:#fff1cf}
.scene-dialogue{position:relative;flex:none;width:100%;max-height:38dvh;overflow:auto;inset:auto;transform:none;padding:12px 22px;background:linear-gradient(125deg,#f4e7c9,#e4d2af);color:#42301f;border:0;border-top:1px solid #b49457;box-shadow:none;z-index:2}
.scene-dialogue>small{font:10px system-ui,sans-serif;letter-spacing:1px;color:#8b5632}.dialogue-line{font-size:15px;line-height:1.65;white-space:pre-wrap;margin:6px 0 9px;overflow-wrap:anywhere}
.dialogue-choices{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end;position:sticky;bottom:-12px;background:#ecdcba;padding:6px 0}
.dialogue-choices button,.scene-dialogue>button{border:1px solid #a8956b;background:#f4e7c9;color:#5c432b;font:12px system-ui,sans-serif;padding:8px 13px;border-radius:3px;min-height:38px;margin-right:5px}
.dialogue-choices .primary,.scene-dialogue>button.primary{color:#f8e9c8;background:#75563d;border-color:#75563d}.welcome-dialogue{padding:9px 18px}.welcome-dialogue .dialogue-line{font-size:13px;margin:4px 0 7px}.feedback-dialogue{max-height:18dvh;padding:8px 18px}.feedback-dialogue .dialogue-line{font-size:12px;margin-bottom:0}
.action-drawer{position:absolute;right:14px;top:70px;bottom:78px;width:min(540px,calc(100% - 28px));background:#f3e5c8fb;border:1px solid #ba9d66;z-index:5;overflow:auto;box-shadow:0 15px 70px #30251e99;color:#473522;border-radius:5px;padding:14px 18px 24px}
.drawer-tools{position:sticky;top:-14px;background:#f1e2c5;z-index:1;padding:9px 0 12px;border-bottom:1px solid #c5b18c}.drawer-close{border:0;border-left:3px solid #99553b;background:#e5d2ac;color:#62432b;padding:10px 15px;min-height:44px;font:12px system-ui,sans-serif}
.action-drawer .dashboard{padding:5px 0}.action-drawer .section-head{display:block}.action-drawer .section-head p{max-width:none;margin-top:7px}.action-drawer .character-grid{grid-template-columns:1fr}.action-drawer .actions{grid-template-columns:1fr 1fr}.action-drawer .sidebar{padding:12px 0;background:transparent;border:0;display:block}.action-drawer .keeper-card{display:none}.action-drawer .plain{color:#67482d}.action-drawer .log-list{max-height:none}.action-drawer>.action{width:100%;margin:5px 0}
.keeper-art,.dialogue-art{width:100%;max-height:32vh;object-fit:contain;display:block;margin:0 auto 14px;background:#e8d7b6;border:1px solid #bda472}.archive-line{white-space:pre-wrap;font:14px/1.9 system-ui,sans-serif;margin:16px 0;border-bottom:1px solid #d7c49e;padding-bottom:16px}.portrait:has(img){height:112px;width:84px;border-radius:2px}.portrait img{object-fit:contain}
.compact-battle{padding:0}.compact-battle .section-head{margin-bottom:7px}.compact-battle .section-head h2{font-size:18px}.compact-battle .section-head p{font-size:11px}.compact-battle .combat-bars{margin:6px 0 10px;gap:20px}.compact-battle .combat-bars .stat strong{font-size:18px}.compact-battle .actions{display:flex;flex-wrap:wrap;gap:7px}.compact-battle .action{flex:1;min-width:120px;min-height:48px;padding:7px 10px}.compact-battle .action strong{font-size:13px}.compact-battle .action small{font-size:10px}.compact-battle .notice,.compact-battle .brief{margin:4px 0;font-size:11px;line-height:1.4;padding:4px}.compact-battle .ending-page{font-size:14px;line-height:1.8;margin:9px 0}.modal-overlay{z-index:20}.toast{z-index:30}.scene-dialogue .plain{color:#5d442c}
@media(max-width:720px){.game-hud{padding:7px 9px;gap:6px;min-height:54px}.game-hud .seal{display:none}.game-hud .brand h1{font-size:17px;letter-spacing:1px}.hud-status{gap:5px;font-size:9px;flex-wrap:wrap;justify-content:center}.hud-status strong{font-size:13px}.hud-status .funds{padding-left:5px}.game-hud .header-right{gap:3px}.game-hud .plain{font-size:11px;padding:7px;min-height:38px}.scene-heading{left:10px;top:10px;padding:6px 10px}.scene-heading h2{font-size:18px}.scene-objective{display:none}.scene-hotspot{font-size:10px;padding:6px 8px;min-height:36px}.person-token img{width:31px;height:42px}.person-token span{font-size:9px}.people-layer{right:9px;bottom:8px;gap:5px}.person-token{gap:3px;padding-right:4px}.scene-view-toggle{left:10px;bottom:9px;font-size:10px;padding:6px 8px}.scene-dialogue{padding:10px 13px;max-height:40dvh}.dialogue-line{font-size:14px}.dialogue-choices button,.scene-dialogue>button{font-size:11px;min-height:40px}.game-dock{justify-content:flex-start;gap:2px;padding:5px 7px}.game-dock button{font-size:11px;padding:8px 10px}.game-dock button.primary{margin-left:4px;padding:8px 12px}.art-credit{height:14px;line-height:14px;font-size:7px}.action-drawer{top:63px;bottom:73px;left:9px;right:9px;width:auto;padding:12px 14px}.action-drawer .stats{display:grid}.action-drawer .sidebar .divider,.action-drawer .sidebar .brief,.action-drawer .sidebar .journal-preview{display:block}.compact-battle .actions{display:grid;grid-template-columns:1fr 1fr}.compact-battle .action{min-width:0}}
@media(orientation:portrait){.immersive-shell{min-height:540px}.world-frame{justify-content:flex-start}.immersive-stage{flex:1;min-height:260px}.world-host canvas{object-fit:cover}.people-layer{left:8px;right:8px;justify-content:center}.scene-view-toggle{top:12px;right:10px;left:auto;bottom:auto}.scene-dialogue{max-height:35dvh}.scene-heading h2{font-size:18px}}
@media(max-height:520px) and (orientation:landscape){.immersive-shell{min-height:280px}.game-hud{min-height:43px;padding:4px 12px}.game-hud .brand h1{font-size:17px}.game-hud .seal{display:none}.game-hud .plain{min-height:34px;padding:5px 10px}.hud-status strong{font-size:14px}.immersive-stage{min-height:90px}.scene-heading{top:8px;left:12px;padding:4px 9px}.scene-heading h2{font-size:16px}.scene-objective{display:none}.person-token img{height:36px;width:28px}.person-token span{font-size:10px}.person-token{min-height:40px}.scene-dialogue{max-height:43dvh;padding:7px 15px}.dialogue-line{font-size:12px;line-height:1.5;margin:4px 0}.welcome-dialogue{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.welcome-dialogue>small{display:none}.welcome-dialogue .dialogue-line{flex:1;margin:0;min-width:180px;font-size:12px}.scene-dialogue>button,.dialogue-choices button{min-height:34px;padding:6px 10px;font-size:11px}.game-dock{padding:3px 10px}.game-dock button{min-height:36px;font-size:11px;padding:6px 10px}.art-credit{height:13px;line-height:13px;font-size:7px}.action-drawer{top:50px;bottom:61px}.feedback-dialogue{max-height:20dvh}.scene-view-toggle{min-height:32px;font-size:10px}.compact-battle .section-head h2{font-size:14px}.compact-battle .notice,.compact-battle .brief{font-size:9px}.compact-battle .action{min-height:40px}.compact-battle .action small{font-size:9px}}
@media(prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important}}

.scene-fit-toggle{position:absolute;top:14px;right:16px;z-index:2;min-height:36px;background:#443225ed;border:1px solid #ccb27c;border-radius:4px;color:#f4e7c6;padding:7px 10px;font:11px system-ui,sans-serif}.scene-objective{top:58px}.immersive-stage[data-fit=contain] .world-host canvas{object-fit:contain}.immersive-stage[data-fit=contain]{background:#554633}@media(orientation:portrait){.scene-view-toggle{top:54px}.scene-fit-toggle{top:12px;right:10px}}@media(max-height:520px) and (orientation:landscape){.scene-fit-toggle{top:8px;right:12px;min-height:30px;font-size:10px}}
