/* Shared compact controls; artwork echoes the existing brass magnifier. */
#game .commands{display:flex;align-items:center;gap:5px}
#game .commands .hud-icon{width:36px;height:36px;min-height:36px;padding:0;border:0;background-color:#111923b3;background-position:center;background-size:25px;background-repeat:no-repeat;border-radius:4px;filter:drop-shadow(0 2px 2px #0008)}
#game .commands .hud-icon:hover,#game .commands .hud-icon:focus-visible{background-color:#40362b;outline:1px solid #c4a56e}
#game .commands .hud-fullscreen{background-image:url('./fullscreen.svg')}#game .commands .hud-sound{background-image:url('./sound.svg')}
.hud-sound[data-muted=true]::after{content:'';position:absolute;width:24px;height:2px;background:#bca680;transform:translate(-50%,-50%) rotate(-48deg);box-shadow:0 0 2px #121c23}
#game #options{min-height:34px;padding:7px 11px;font-size:13px}
#adventure .options-dialog{width:min(355px,91vw);padding:22px;max-height:85dvh}
.options-dialog h2{font-size:24px;margin:0 0 15px}.options-dialog .options-grid{display:grid;grid-template-columns:1fr 1fr;gap:7px}.options-dialog .options-grid button{margin:0;min-height:41px;font-size:13px;padding:8px}.options-dialog .fine{font-size:12px}
#adventure .sound-dialog{width:min(460px,94vw);padding:22px}.sound-dialog h2{font-size:25px;margin-top:0}.sound-dialog .audio-row{grid-template-columns:75px minmax(0,1fr) 44px;gap:9px}
#game .look-detail{display:inline-flex;align-items:center;gap:7px;background:transparent;border-color:#b39a6566;padding:5px 9px;min-height:32px;font:13px Georgia}
#game .look-detail::before{content:'';display:inline-block;width:20px;height:20px;background:url('./inspect.svg') center/contain no-repeat}
#adventure .detail-dialog{width:min(610px,94vw);max-height:88dvh;padding:22px}.detail-dialog .document-art{padding:0}.detail-dialog .scenic-detail{height:min(300px,48dvh);min-height:0}.detail-dialog h2{font-size:24px;margin:0 0 15px}
/* Generic overlay button margins must never insert gaps into running prose. */
#adventure .glossary-term,#adventure .glossary-term:hover,#adventure .glossary-term:focus-visible{display:inline;min-height:0;padding:0;margin:0;border:0;background:none;font:inherit;vertical-align:baseline;letter-spacing:inherit}
.glossary-tip{display:flex;align-items:start;gap:13px;max-height:calc(100dvh - 24px);overflow:auto;pointer-events:auto}
.glossary-visual{flex:none;display:block;width:104px;height:90px;background-repeat:no-repeat;background-color:#192630;border:1px solid #aa91675c;border-radius:4px}
.glossary-definition{min-width:0;flex:1}
/* Reserved shelf: no scene content sits underneath the inventory. */
#game{--shelf:142px;--rail:0px;--edge:0px;background:#281c15}
#game:not(.ending-screen) .world-frame{right:0;bottom:var(--shelf)}
#game:not(.ending-screen) .stage-wrap{inset:0}
#game:not(.ending-screen) .stage{height:100%;width:calc((100dvh - var(--shelf))*1.776833);margin-inline:0;left:max(0px,calc((100% - (100dvh - var(--shelf))*1.776833)/2))}
#game:not(.ending-screen) .inventory{top:auto;bottom:5px;left:8px;right:160px;width:auto;height:calc(var(--shelf) - 10px);display:flex;flex-direction:row;align-items:stretch;gap:8px;padding:15px 9% 15px;background:#33251c var(--inventory-skin) center/100% 100% no-repeat;border:0;border-radius:9px;box-shadow:0 -2px 10px #0006}
#game .inventory .slots{display:flex;flex-direction:row;align-items:stretch;justify-content:flex-start;gap:7px;flex:1;min-width:0;height:100%;overflow:hidden}
#game .inventory .slot{width:var(--slot-width);height:100%;flex:0 0 var(--slot-width);overflow:hidden}
#game .inventory .item{height:100%;width:100%;grid-template-rows:52px minmax(0,1fr);gap:3px;padding:3px 2px}
#game .inventory .inventory-art{height:50px;max-height:50px;max-width:80px}
#game .inventory .item-name{font-size:12px;line-height:1.25}
#game .belt-tools{width:67px;flex:0 0 67px;display:grid;grid-template-columns:1fr 1fr;grid-template-rows:1fr 1fr;align-content:center;gap:0}
#game .bag-open{grid-column:1/-1;grid-row:1}#game .bag-previous{grid-column:1;grid-row:2}#game .bag-next{grid-column:2;grid-row:2}
#game .bag-control,#game .bag-control:hover{height:36px;min-height:36px;background-size:29px;align-self:center}
#game .inventory-page{position:absolute;right:51px;bottom:9px;font-size:10px}
#game .inventory .empty{width:100%;max-width:100%;margin:auto 0;text-align:center;color:#f2dfbd}
#game .map-trigger{right:7px;bottom:24px;width:73px;height:83px}#game .journal-trigger{right:86px;bottom:25px;width:65px;height:80px}
#game:not(.ending-screen) .inspector{left:18px;right:18px;bottom:calc(var(--shelf) + 10px);max-height:min(43dvh,calc(100dvh - var(--shelf) - 80px))}
#game:not(.ending-screen) .inspector.item-open,#game:not(.ending-screen) .inspector.puzzle-open,#game:not(.ending-screen) .inspector.comparison-open{left:18px;right:18px;top:70px;bottom:calc(var(--shelf) + 10px);max-height:none}
#game .save-state{bottom:7px;right:10px}
@media(max-width:650px){#game{--shelf:144px}#game:not(.ending-screen) .inventory{left:3px;right:105px;padding:15px 22px 18px;gap:3px}#game .inventory .item{grid-template-rows:47px minmax(0,1fr)}#game .inventory .inventory-art{height:45px;max-height:45px;max-width:65px}#game .inventory .item-name{font-size:11px}#game .belt-tools{width:49px;flex-basis:49px}#game .bag-control,#game .bag-control:hover{background-size:24px}#game .inventory-page{right:32px;bottom:8px}#game .journal-trigger{right:50px;bottom:37px;width:50px;height:63px}#game .map-trigger{right:1px;bottom:37px;width:49px;height:63px}#game .save-state{font-size:7px;max-width:101px;text-align:center}#game:not(.ending-screen) .inspector{left:6px;right:6px;bottom:calc(var(--shelf) + 7px)}#game:not(.ending-screen) .inspector.item-open,#game:not(.ending-screen) .inspector.puzzle-open,#game:not(.ending-screen) .inspector.comparison-open{left:6px;right:6px;top:65px;bottom:calc(var(--shelf) + 7px)}}
@media(max-height:520px) and (orientation:landscape){#game{--shelf:108px}#game:not(.ending-screen) .inventory{right:135px;padding:12px 7% 10px}#game .inventory .item{grid-template-rows:34px minmax(0,1fr);gap:2px}#game .inventory .inventory-art{height:32px;max-height:32px}#game .inventory .item-name{font-size:10px;line-height:1.2}#game .bag-control,#game .bag-control:hover{height:28px;min-height:28px;background-size:25px}#game .map-trigger{bottom:20px;width:62px;height:68px}#game .journal-trigger{right:71px;bottom:20px;width:57px;height:66px}#game:not(.ending-screen) .inspector{max-height:calc(100dvh - var(--shelf) - 65px)}#game:not(.ending-screen) .inspector.item-open,#game:not(.ending-screen) .inspector.puzzle-open,#game:not(.ending-screen) .inspector.comparison-open{top:52px}}
@media(max-width:650px){#game .commands{gap:2px}#game .commands .hud-icon{width:32px;height:34px;min-height:34px;background-size:22px}#game #options{padding:6px 8px;font-size:12px}#game .place-label{max-width:calc(100% - 146px)}#game .place-label h1{font-size:18px}.glossary-visual{width:82px;height:78px}}

#game .explained-choice{display:grid;grid-template-columns:minmax(0,1fr);width:100%;height:max-content;min-height:0;align-self:start;text-align:left;white-space:normal;margin:9px 0;padding:12px 16px}
#game .choice-description{display:block;margin-top:6px;font:14px/1.5 Georgia,serif;color:#e1dfd1;white-space:normal}
.bag-dialog[open]{display:flex;flex-direction:column;overflow:hidden;min-height:0;padding-bottom:110px}.bag-dialog h2,.bag-dialog>.primary{flex:none}.bag-dialog .bag-content{flex:1 1 auto;min-height:0;max-height:calc(90dvh - 280px);overflow:auto;padding:4px}.bag-dialog .bag-content .bag-grid{overflow:visible;max-height:none}.bag-placed{margin:15px 0 0;border-top:1px solid #b59b6a66;padding:10px 0 8px;color:#e8d9bd}.bag-placed h3{font:18px Georgia,serif;margin:0 0 7px}.bag-placed-item{display:flex;align-items:center;gap:13px;padding:5px 0}.bag-placed-item .bag-art{height:48px;width:48px}.bag-placed-item strong{display:block;font:15px Georgia,serif}.bag-placed-item small{display:block;max-width:450px;white-space:normal;font:13px/1.5 Georgia,serif;color:#d4c8b4}
@media(max-width:650px){.bag-dialog[open]{padding-bottom:80px}.bag-dialog .bag-content{max-height:calc(90dvh - 235px)}}
@media(max-height:520px) and (orientation:landscape){.bag-dialog[open]{padding:28px 45px 66px}.bag-dialog .bag-content{max-height:calc(90dvh - 180px)}}
@media(max-width:650px) and (orientation:portrait){
 .bag-dialog.has-portrait-bag[open]{display:flex;flex-direction:column;width:min(95vw,60dvh);height:min(142.5vw,90dvh);max-height:none;min-height:0;background-image:var(--inventory-portrait-skin);padding:clamp(44px,17vw,72px) clamp(30px,10vw,45px) clamp(42px,12vw,54px)}
 .bag-dialog.has-portrait-bag h2{font-size:23px;margin:0 0 16px}
 .bag-dialog.has-portrait-bag .bag-content{flex:1;min-height:0;max-height:none;scrollbar-width:thin;scrollbar-color:#9e8054 #12191b}
 .bag-dialog.has-portrait-bag .bag-grid{gap:9px}
 .bag-dialog.has-portrait-bag .bag-art{height:58px;width:calc(58px * var(--object-ratio,1))}
 .bag-dialog.has-portrait-bag>.primary{flex:none;margin:14px auto 0}
 .bag-dialog.has-portrait-bag .bag-placed h3{font-size:16px}.bag-dialog.has-portrait-bag .bag-placed-item{gap:8px}.bag-dialog.has-portrait-bag .bag-placed-item strong{font-size:14px}.bag-dialog.has-portrait-bag .bag-placed-item small{font-size:12px}
}

#game .exchange-pages{display:flex;align-items:center;gap:12px;justify-content:flex-end}#game .exchange-pages button{margin:0}

#adventure .glossary-term,#adventure .glossary-term:hover,#adventure .glossary-term:focus-visible{text-transform:inherit;font-variant:inherit}
/* Shared exit, kept inside the existing game menus and start/end screens. */
.worlds-exit{margin-block:1rem;max-width:100%}.worlds-exit-link{display:inline-flex;align-items:center;min-height:44px;padding:.5rem .25rem;color:inherit;text-decoration:underline;text-underline-offset:.2em;white-space:normal}.worlds-exit-link:focus-visible{outline:2px solid currentColor;outline-offset:3px}.worlds-exit [role=alert]{margin-block:.5rem;font-size:.9em;line-height:1.5}
