/* A single responsive layout: right-hand inventory, speech below the scene. */
#game{--rail:154px;--edge:14px}
#game:not(.ending-screen) .world-frame{right:calc(var(--rail) + var(--edge))}
#game:not(.ending-screen) .stage-wrap{bottom:0}
#game:not(.ending-screen) .stage{width:max(100%,177.6833dvh)}
#game:not(.ending-screen) .inventory{left:auto;right:5px;top:73px;bottom:110px;width:var(--rail);height:auto;display:flex;flex-direction:column;gap:4px;padding:28px 17px 22px;border:0;border-image:none;background:var(--inventory-rail) center/100% 100% no-repeat;overflow:hidden}
#game .inventory .slots{width:100%;height:auto;min-height:0;flex:1;display:flex;flex-direction:column;gap:5px;overflow:hidden;padding:0 2px}
#game .inventory .slot{width:100%;flex:0 0 100px;min-height:0;height:100px;overflow:visible;border:0;border-radius:3px}
#game .inventory .item{padding:10px 3px 2px;gap:5px;min-height:0;justify-content:center;background:transparent}
#game .inventory .inventory-art{height:54px;width:calc(54px * var(--object-ratio,1));max-width:85px;filter:drop-shadow(0 2px 2px #0008)}
#game .inventory .item-name{max-width:100%;font:12px/1.3 Georgia,serif;overflow-wrap:anywhere;color:#f5e5c7}
#game .inventory .empty{margin:auto 0;width:100%;text-align:center;font:italic 13px/1.5 Georgia;white-space:normal;color:#d9c7a9}
#game .belt-tools{width:100%;flex:none;display:grid;grid-template-columns:1fr 1.15fr 1fr;gap:0}
#game .bag-control,#game .bag-control:hover,#game .bag-control:focus-visible{width:100%;height:38px;min-height:38px;padding:0;border:0;border-radius:0;background-color:transparent;background-position:center;background-repeat:no-repeat;background-size:32px;filter:drop-shadow(0 2px 2px #0009)}
#game .bag-previous,#game .bag-next,#game .bag-previous:hover,#game .bag-next:hover{background-image:url('./bag-arrow.svg')}
#game .bag-next{transform:scaleX(-1)}
#game .bag-open,#game .bag-open:hover{background-image:url('./bag-open.svg')}
#game .bag-control:hover{filter:drop-shadow(0 0 3px #e6c389)}
#game .bag-control:disabled{opacity:.22;filter:none;cursor:default}
.inventory-page{font:11px/1 Georgia;color:#c6ac80;text-align:center;flex:none}
#game .examine,#game .examine:hover,#game .examine:focus-visible{position:absolute;right:-2px;top:0;width:35px;min-height:35px;height:35px;z-index:2;border:0;background:transparent url('./inspect.svg') center/25px 25px no-repeat;border-radius:4px;opacity:1;filter:drop-shadow(0 2px 2px #000)}
#game .examine:hover,#game .examine:focus-visible{background-color:#ead3a21a;outline:1px solid #d6ba7e}
#game:not(.ending-screen) .inspector{left:22px;right:calc(var(--rail) + 24px);bottom:20px;top:auto;transform:none;width:auto;max-height:43dvh;border:1px solid #cdb58455;border-radius:5px;background:linear-gradient(120deg,#111c25f5,#111c25ed);backdrop-filter:blur(8px);z-index:11}
#game:not(.ending-screen) .panel-content{padding:21px 28px 20px;min-height:0;overflow:auto}
#game .inspector h2{font-size:22px;margin:0 30px 9px 0;line-height:1.2}
#game .panel-copy{font:16px/1.65 Georgia;margin:8px 0 12px}
#game .inspector .eyebrow{font-size:10px;margin:0 0 5px}
#game .dialogue-open .portrait{float:left;width:64px;height:64px;margin:0 16px 9px 0}
.dialogue-choices{clear:both;display:flex;flex-wrap:wrap;gap:6px 12px;padding-top:8px;border-top:1px solid #cdb58430}
#game .dialogue-choices .choice{width:auto;flex:1 1 280px;margin:0;padding:8px 11px;font:14px/1.45 Georgia;min-height:42px;background:#1a2732b0}
#game:not(.ending-screen) .inspector.item-open,#game:not(.ending-screen) .inspector.puzzle-open,#game:not(.ending-screen) .inspector.comparison-open{left:22px;right:calc(var(--rail) + 24px);bottom:20px;top:80px;width:auto;max-height:none;transform:none}
#game .inspector.item-open .panel-content{display:grid;grid-template-columns:minmax(220px,1fr) minmax(220px,1fr);gap:6px 22px}
#game .item-open .eyebrow,#game .item-open h2{grid-column:1/-1}
#game .item-open .object-viewer{grid-column:1;grid-row:3/8;height:100%;min-height:230px;max-height:60dvh}
#game .item-open .object-controls,#game .item-open .panel-copy,#game .item-open .primary,#game .item-open .fine{grid-column:2}
#game .verb-line{left:15px;right:15px;bottom:7px;font-size:12px}
#game .pan-controls{left:4px;right:4px;top:45%;bottom:auto}
#game .map-trigger{right:4px;bottom:8px;width:75px;height:80px}
#game .save-state{bottom:1px;right:10px;font-size:8px}
.bag-dialog[open]{border:0;border-image:none;background:var(--inventory-skin) center/100% 100% no-repeat;width:min(820px,95vw);padding:55px 80px 60px;min-height:300px;max-height:90dvh}
.bag-dialog h2{text-align:center;font-size:25px;margin:0 0 20px;padding:0}
.bag-dialog .bag-grid{grid-template-columns:repeat(4,minmax(0,1fr));min-width:0;max-height:56dvh;overflow:auto;padding:4px}
.bag-dialog .bag-empty{grid-column:1/-1;text-align:center;white-space:normal;font:italic 16px/1.6 Georgia;margin:30px 0}
.bag-dialog>.primary{display:block;margin:20px auto 0}
.glossary-term,.glossary-term:hover,.glossary-term:focus-visible{display:inline;min-height:0;padding:0;margin:0;border:0;border-radius:0;background:none;color:inherit;font:inherit;text-align:inherit;text-decoration:underline dotted #d9bc7e;text-underline-offset:4px;cursor:help;white-space:normal}
.glossary-term:hover,.glossary-term:focus-visible{color:#ffe4af}
/* Keep an elided article and its defined word on the same printed line. */
.glossary-word{white-space:nowrap;overflow-wrap:normal;word-break:normal}
.glossary-word .glossary-term{white-space:inherit}
.glossary-tip{position:fixed;z-index:200;padding:14px 17px;border:1px solid #b8a47b;border-radius:5px;background:#17242b;color:#fff0d2;font:15px/1.55 Georgia;box-shadow:0 10px 35px #000a;pointer-events:none;text-align:left}
.ambient-grid{pointer-events:none}.ambient-grid .traced-surface{pointer-events:auto}
@media(max-width:650px){#game{--rail:104px;--edge:3px}#game:not(.ending-screen) .inventory{top:73px;bottom:108px;right:0;padding:22px 10px 18px}#game .inventory .slot{height:91px;flex-basis:91px}#game .inventory .inventory-art{height:44px;max-width:66px}#game .inventory .item-name{font-size:11px}#game .inventory .empty{font-size:12px}#game .examine,#game .examine:hover,#game .examine:focus-visible{width:30px;height:30px;min-height:30px;background-size:23px;right:-3px;top:-2px}#game .bag-control,#game .bag-control:hover{background-size:27px;height:34px;min-height:34px}#game:not(.ending-screen) .inspector{left:7px;right:calc(var(--rail) + 6px);bottom:18px;max-height:49dvh}#game:not(.ending-screen) .panel-content{padding:18px 14px 16px}#game .panel-copy{font-size:14px;line-height:1.6}#game .inspector h2{font-size:20px}#game .dialogue-open .portrait{width:42px;height:42px;margin-right:9px}#game .dialogue-choices .choice{font-size:13px;padding:8px;flex-basis:100%}#game:not(.ending-screen) .inspector.item-open,#game:not(.ending-screen) .inspector.puzzle-open,#game:not(.ending-screen) .inspector.comparison-open{left:8px;right:8px;top:75px;bottom:16px;z-index:20}#game .inspector.item-open .panel-content{display:block}#game .item-open .object-viewer{height:235px;min-height:180px}.bag-dialog[open]{padding:45px 34px 50px}.bag-dialog .bag-grid{grid-template-columns:repeat(2,minmax(0,1fr))}#game .place-label{max-width:calc(100% - 24px);top:15px;left:14px}#game .place-label h1{font-size:21px}#game .game-head{right:6px;top:12px}#game .commands button{font-size:12px;padding:7px 11px}}
@media(max-height:520px) and (orientation:landscape){#game{--rail:122px}#game:not(.ending-screen) .inventory{top:60px;bottom:85px;padding:16px 14px 12px}#game .inventory .slot{height:76px;flex-basis:76px}#game .inventory .inventory-art{height:38px}#game .inventory .item-name{font-size:10px}#game .bag-control,#game .bag-control:hover{height:30px;min-height:30px}#game .map-trigger{height:65px}#game:not(.ending-screen) .inspector{max-height:55dvh;bottom:15px}#game .panel-copy{font-size:14px;line-height:1.5}#game:not(.ending-screen) .panel-content{padding:14px 20px}#game .dialogue-open .portrait{width:45px;height:45px}#game .dialogue-choices .choice{font-size:12px;flex-basis:200px;padding:5px 8px;min-height:34px}#game:not(.ending-screen) .inspector.item-open,#game:not(.ending-screen) .inspector.puzzle-open,#game:not(.ending-screen) .inspector.comparison-open{top:55px;bottom:10px}.bag-dialog[open]{padding:35px 70px;min-height:230px}}
#game .journal-trigger{position:absolute;right:83px;bottom:6px;width:66px;height:76px;border:0;background-color:transparent;background-size:contain;background-repeat:no-repeat;background-position:center;z-index:22;filter:drop-shadow(0 3px 3px #0008);padding:0;min-height:0}
#game .journal-trigger:hover,#game .journal-trigger:focus-visible{background-color:transparent;transform:rotate(-4deg) translateY(-3px);filter:drop-shadow(0 4px 4px #000b) brightness(1.13)}
#adventure .casebook-dialog{width:min(860px,94vw);max-height:90dvh;background:#e3cfaa url('/adventures/manuscrit/map-parchment.webp') center/cover;color:#302217;padding:30px clamp(20px,5vw,48px);border:2px solid #62462f;border-radius:8px}
.casebook-tabs{display:flex;gap:10px;margin-bottom:18px}.casebook-tabs button{flex:1;border-color:#785333;background:#78533318;color:#302217}.casebook-tabs button[aria-pressed=true]{background:#78533336;border-bottom:3px solid #62462f}
.casebook-person,.casebook-quest{padding:15px 0;border-bottom:1px solid #78533345;display:flow-root}.casebook-person .portrait{width:64px;height:76px;float:left;margin:0 14px 14px 0}.casebook-person h3,.casebook-quest h3{margin:0 0 5px;font-size:23px}.casebook-role{margin:0 0 20px}.casebook-exchange{clear:both;margin:10px 0}.casebook-exchange summary{cursor:pointer;font-weight:600;line-height:1.6}.casebook-exchange p{font-size:16px;line-height:1.75;margin:8px 8px 18px}.casebook-body .journal-note{border-color:#78533345;color:#302217}.casebook-dialog .glossary-term{color:inherit}
@media(max-width:650px){#game .journal-trigger{right:73px;width:55px;height:65px;bottom:5px}.casebook-tabs{gap:5px}.casebook-tabs button{font-size:14px;padding:8px}.casebook-person h3{font-size:21px}}
