/* Interface ownership: the old dock is optional; every expanded state has an exit. */
#game-shell .control-panel-header{display:flex;align-items:center;justify-content:space-between;gap:12px;position:sticky;top:-8px;z-index:2;background:#211b14;padding:6px 0;margin-bottom:8px;font:14px system-ui}
#game-shell .control-panel-header button{min-height:44px;min-width:100px;padding:8px;font:14px system-ui;touch-action:manipulation}
body[data-controls=stick].hud-collapsed #game-shell .control-panel-header{display:none}
#game-shell .scene-top{pointer-events:none;z-index:60}
#game-shell .hud-tools,#game-shell #world-weather{pointer-events:auto}
#game-shell .hud-tools{display:flex;gap:6px}
#game-shell .hud-tools button{width:44px;height:44px;min-width:44px;min-height:44px;padding:4px;pointer-events:auto}
body:not(.hud-collapsed) #game-shell #control-panel,body[data-controls=arrows] #game-shell #control-panel{position:fixed;top:auto;bottom:0;left:0;right:0;width:auto;height:auto;min-height:0;max-height:48dvh;display:block;overflow:auto;overscroll-behavior:contain;padding:8px 12px;box-sizing:border-box}
body[data-controls=stick].hud-collapsed #game-shell #control-panel{min-height:0;height:0;background:none;border:0;box-shadow:none}
#game-shell #story-peek{display:flex;align-items:flex-start;box-sizing:border-box;width:min(var(--story-width,100vw),calc(100vw - 24px))!important;min-height:44px!important;height:min(var(--story-height,60px),30dvh)!important;max-height:30dvh!important;padding:8px 10px!important;gap:8px;text-align:left}
#game-shell #story-peek #narration{display:-webkit-box;-webkit-box-orient:vertical;white-space:normal;font:500 var(--story-font,16px)/1.35 Georgia,serif!important;-webkit-line-clamp:var(--story-lines,2);line-clamp:var(--story-lines,2);flex:1;min-width:0;max-height:100%;overflow:hidden;text-overflow:clip}
#game-shell #story-peek>span:last-child{flex:none;font:18px system-ui}
body[data-controls=stick].hud-collapsed #game-shell #story-peek{right:auto;left:max(12px,env(safe-area-inset-left))}
body:not(.hud-collapsed) #game-shell #story-peek,body[data-controls=arrows] #game-shell #story-peek{position:fixed;left:12px;right:auto;bottom:calc(var(--dock-height,240px) + 8px);top:auto}
body[data-controls=stick].hud-collapsed #game-shell .world-tools{bottom:calc(var(--edge-b) + 232px + min(var(--story-height,60px),30dvh))}
body[data-controls=stick].inside-inn.hud-collapsed #game-shell .world-tools{bottom:calc(var(--edge-b) + 130px + min(var(--story-height,60px),30dvh))}
.story-setting{display:grid;grid-template-columns:1fr auto;gap:4px;margin:12px 0;font:15px/1.4 system-ui}
.story-setting input{grid-column:1/-1;width:100%;min-height:44px;margin:0;accent-color:#c5aa73;touch-action:pan-x}
#story-sample{font:var(--story-font,16px)/1.35 Georgia,serif;width:min(100%,var(--story-width));height:min(var(--story-height),30dvh);overflow:auto;background:#151b13;border:1px solid #8c805a;padding:8px;box-sizing:border-box}
#modal .full-world-description{font:var(--story-font,16px)/1.5 Georgia,serif;user-select:text}
#modal[open],#game-drawer[open]{display:flex;flex-direction:column;overflow:hidden;max-height:calc(100dvh - 16px)!important}
#modal .modal-header,#game-drawer .drawer-header,#modal .dialog-return,#game-drawer .dialog-return{flex-shrink:0}
#modal-body,#drawer-body{min-height:0;overflow:auto;overflow-wrap:anywhere}
@media(orientation:landscape){
 body:not(.hud-collapsed) #game-shell #control-panel,body[data-controls=arrows] #game-shell #control-panel{left:auto;right:12px;top:84px;bottom:auto;width:min(340px,46vw);max-height:calc(100dvh - 96px)}
 body[data-hud-side=left]:not(.hud-collapsed) #game-shell #control-panel,body[data-hud-side=left][data-controls=arrows] #game-shell #control-panel{left:12px;right:auto}
 body:not(.hud-collapsed) #game-shell #story-peek,body[data-controls=arrows] #game-shell #story-peek{top:84px;bottom:auto;max-width:calc(100vw - min(340px,46vw) - 48px)!important}
 body[data-hud-side=left]:not(.hud-collapsed) #game-shell #story-peek,body[data-hud-side=left][data-controls=arrows] #game-shell #story-peek{left:auto;right:12px}
}
@media(orientation:landscape) and (max-height:600px){
 body[data-controls=stick].hud-collapsed #game-shell #story-peek{top:76px;bottom:auto;max-width:calc(100vw - 180px)!important}
 body[data-controls=stick].inside-inn.hud-collapsed #game-shell #story-peek{top:auto;bottom:calc(var(--edge-b) + 64px);max-width:calc(100vw - 216px)!important}
 body[data-controls=stick].hud-collapsed #game-shell .world-tools{bottom:calc(var(--edge-b) + 65px)}
 body[data-controls=stick].inside-inn.hud-collapsed #game-shell .world-tools{bottom:calc(var(--edge-b) + 72px + min(var(--story-height,44px),30dvh))}
}

#fps-reticle{position:fixed;left:50%;top:50%;transform:translate(-50%,-50%);z-index:35;pointer-events:none;color:#e6dece;font:22px/1 monospace;text-shadow:0 1px 3px #000}
#fps-reticle[data-target=true]{color:#e9ac75}
#fps-reticle[hidden]{display:none}
.menu-actions .wiki-menu-link{display:flex;flex-direction:column;justify-content:center;gap:4px;min-height:64px;padding:12px 14px;text-align:left;border:1px solid var(--line);border-radius:4px;color:var(--text);text-decoration:none;background:var(--panel)}.menu-actions .wiki-menu-link strong{color:var(--gold)}.menu-actions .wiki-menu-link small{font-size:.8rem;color:var(--muted)}.menu-actions .wiki-menu-link:hover{border-color:var(--gold)}
