/* V1.4 · readable storybook UI. The main game stays within one screen.
   Every content-heavy modal has a real, keyboard/touch-scrollable body and a fixed footer. */
:root{--chapter-ink:#2a2119;--chapter-copper:#95652e;--chapter-gold:#d7b374;--chapter-cream:#f5e7cc;--chapter-deep:#19231e}
button{touch-action:manipulation}
button:focus-visible,.dialog-body:focus-visible,.roster-grid:focus-visible{outline:3px solid #ffcd74;outline-offset:3px}
/* more spacious reading proportions even on shorter laptop viewports */
.veil{overflow-y:auto!important;overscroll-behavior:contain;padding:clamp(6px,1.2vw,16px)!important;align-items:center!important;justify-content:center!important}
.veil .dialog{height:min(92dvh,860px)!important;max-height:calc(100dvh - 12px)!important;min-height:0!important;max-width:1400px;width:min(1280px,100%);overflow:hidden!important;display:grid!important;grid-template-rows:minmax(0,1fr)!important;background:var(--chapter-deep);box-shadow:0 30px 100px #050b0bed}
.veil .dialog:has(.dialog-art-wrap){grid-template-columns:minmax(0,39fr) minmax(0,61fr)!important}
.veil .dialog:not(:has(.dialog-art-wrap)){grid-template-columns:minmax(0,1fr)!important}
.veil .dialog .dialog-art-wrap{min-width:0;min-height:0;overflow:hidden;height:100%!important;position:relative}
.veil .dialog .dialog-banner{width:100%!important;height:100%!important;max-height:none!important;object-fit:cover;object-position:center;display:block}
.veil .dialog .dialog-content{height:100%;max-height:none!important;min-height:0!important;min-width:0;overflow:hidden!important;display:flex!important;flex-direction:column!important;padding:0!important;background:linear-gradient(125deg,#fcf3de,#eddbb7);border:0;outline:0}
.veil .dialog-heading{flex:0 0 auto;background:linear-gradient(155deg,#f5e5c5,#e7cf9e);border-bottom:2px solid #ae8852;padding:clamp(12px,1.7vw,21px) clamp(17px,2.2vw,29px) 10px}
.veil .dialog-heading .eyebrow{color:#7e5432!important;letter-spacing:1.25px!important;font:800 clamp(9px,.8vw,11px)/1.4 system-ui,sans-serif!important;margin:0 0 4px}
.veil .dialog-heading h2{font-family:'Palatino Linotype','Book Antiqua',Palatino,Georgia,serif!important;font-size:clamp(24px,2.35vw,36px)!important;font-weight:700!important;letter-spacing:-.6px;line-height:1.15!important;margin:0!important;border:0!important;padding:0!important;color:var(--chapter-ink)!important}
.veil .dialog-body{flex:1 1 0;min-height:0!important;min-width:0;overflow-y:auto!important;overflow-x:hidden!important;overscroll-behavior:contain!important;-webkit-overflow-scrolling:touch;scrollbar-width:auto;scrollbar-color:#9d7741 #e9d5ad;touch-action:pan-y;padding:16px clamp(17px,2.2vw,29px) 22px}
.veil .dialog-body::-webkit-scrollbar{width:12px}
.veil .dialog-body::-webkit-scrollbar-thumb{background:#987446;border:3px solid #ead7b2;border-radius:12px}
.veil .dialog-body::-webkit-scrollbar-track{background:#ead7b2}
.veil .dialog-footer{flex:0 0 auto;min-height:44px;border-top:2px solid #ad8b55;background:#e8d0a5;display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:7px 12px;padding:8px 14px;box-shadow:0 -6px 15px #5d44231c;z-index:2}
.veil .dialog-reading-tools{display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.veil .reader-label{font:800 9px/1.3 system-ui,sans-serif;color:#745334;letter-spacing:.7px;margin-right:4px}
.veil .dialog-reading-tools button{border:1px solid #997346;border-radius:3px;background:#f5e5c6;color:#513921;font:700 11px/1.2 system-ui,sans-serif;min-height:32px;padding:6px 10px;cursor:pointer}
.veil .dialog-reading-tools button:hover{background:#fff7e6}
.veil .dialog-footer .dialog-actions{padding:0!important;margin:0!important;display:flex;flex-wrap:wrap;justify-content:flex-end;gap:6px}
.veil .dialog-footer .dialog-actions .btn{margin:0;padding:8px 12px;min-height:32px;font-size:11px}
.veil .dialog-body p,.veil .dialog-body .prose{font-family:'Palatino Linotype','Book Antiqua',Palatino,Georgia,serif!important;font-size:clamp(15px,1.17vw,17px)!important;line-height:1.62!important;color:#3d2d1e!important;margin-bottom:13px!important;white-space:normal;overflow-wrap:break-word}
.veil .dialog-body h3{font:700 clamp(19px,1.4vw,24px)/1.22 'Palatino Linotype',Palatino,Georgia,serif!important;color:#49331d;margin:12px 0 10px!important}
/* illustrated encounter panels */
.veil .story-narration{margin:0 0 15px!important;border-left:4px solid #a9793e!important;background:#fff6e3;padding:18px 20px!important;box-shadow:inset 0 0 0 1px #e1c69c}
.veil .story-narration-label{font:800 10px/1.4 system-ui,sans-serif!important;letter-spacing:1.5px;margin-bottom:8px;color:#7b4d28}
.veil .story-narration p{font:clamp(16px,1.24vw,19px)/1.62 'Palatino Linotype',Palatino,Georgia,serif!important;margin:0!important}
.veil .story-history{font:italic clamp(14px,1.09vw,16px)/1.55 'Palatino Linotype',Palatino,Georgia,serif!important;color:#70553a;padding-left:15px;margin:12px 0 16px!important}
.veil .story-dialogue{grid-template-columns:122px minmax(0,1fr)!important;gap:12px!important;margin:12px 0!important;min-height:94px!important;background:#ead5ae;border:1px solid #b28b51;overflow:hidden}
.veil .story-speaker{padding:10px 7px!important;gap:6px!important;justify-content:center}
.veil .story-speaker img{width:64px!important;height:61px!important;object-fit:cover;border-radius:4px;box-shadow:0 3px 9px #6d523659}
.veil .story-speaker strong{font:700 14px/1.16 'Palatino Linotype',Palatino,Georgia,serif!important;white-space:normal;overflow-wrap:anywhere}
.veil .story-speaker small{font:800 9px/1.2 system-ui,sans-serif!important;letter-spacing:.5px}
.veil .story-dialogue blockquote{font:italic clamp(15px,1.2vw,18px)/1.55 'Palatino Linotype',Palatino,Georgia,serif!important;padding:13px 15px 13px 0!important;color:#44301e!important;overflow-wrap:break-word}
.veil .decision-heading{margin:19px 0 10px;padding-top:13px;border-top:2px solid #ba9660;display:flex;flex-wrap:wrap;gap:4px}
.veil .decision-heading span{font:800 12px/1.4 system-ui,sans-serif!important;letter-spacing:1.2px}
.veil .decision-heading small{display:inline!important;font:12px/1.4 Georgia,serif;color:#775535}
.veil .decision-list{display:grid!important;grid-template-columns:1fr!important;gap:10px!important;margin-bottom:10px}
.veil button.story-choice{width:100%;min-height:80px!important;padding:14px 16px!important;overflow:visible!important;white-space:normal!important;text-align:left!important;align-items:flex-start!important;gap:13px!important}
.veil .choice-index{flex:0 0 31px;height:31px;font:800 13px/1 system-ui,sans-serif}
.veil .choice-copy{gap:4px!important;flex:1;min-width:0;overflow:visible!important}
.veil .choice-copy strong{font:700 clamp(15px,1.12vw,17px)/1.35 'Palatino Linotype',Palatino,Georgia,serif!important;white-space:normal!important}
.veil .choice-copy>span{font:clamp(13px,1vw,15px)/1.42 'Palatino Linotype',Palatino,Georgia,serif!important;white-space:normal!important}
.veil .choice-copy em{font:700 11px/1.4 system-ui,sans-serif!important;white-space:normal!important;overflow-wrap:anywhere}
.veil .choice-locked{font-size:11px!important;color:#843b2c}
.veil .outcome-dossier{padding:20px;background:#fff6e4}
.veil .outcome-dossier p{font-size:17px!important;line-height:1.62!important}
.veil .outcome-effects{margin:16px 0!important}
.veil .outcome-effects span{font:700 12px/1.4 system-ui,sans-serif;padding:7px 9px}
/* story screens & road controls are internally scrollable, never cropped at the page edge */
.road-base .story-note,.road-base .road-controls{overflow-y:auto!important;overflow-x:hidden!important;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#9c7b4d transparent}
.road-base .story-note p,.road-base .story-note blockquote{font-size:clamp(12px,1vw,14px)!important;line-height:1.42!important}
.wagon-ledger,.party-left{overflow-y:auto!important;scrollbar-width:thin;scrollbar-color:#b69a6a #1e2a22}
.intro-paper p{font:clamp(15px,1.2vw,19px)/1.6 'Palatino Linotype',Palatino,Georgia,serif!important}
.intro-paper h1{font-family:'Palatino Linotype',Palatino,Georgia,serif!important}
.market-painting{position:relative;height:clamp(100px,18vh,205px);margin:4px 0 17px;overflow:hidden;border:2px solid #967548;background:#25332b}
.market-painting img{width:100%;height:100%;object-fit:cover;display:block}
.market-painting span{position:absolute;bottom:8px;left:9px;padding:6px 8px;background:#11201ee0;color:#f7dfb5;font:800 10px system-ui,sans-serif;letter-spacing:1.3px}
/* Mobile: a compact scenic masthead with a generous readable story region. */
@media(max-width:759px){
 .veil{padding:4px!important;align-items:center!important}
 .veil .dialog{height:calc(100dvh - 8px)!important;max-height:calc(100dvh - 8px)!important;grid-template-columns:minmax(0,1fr)!important;grid-template-rows:clamp(90px,17dvh,145px) minmax(0,1fr)!important}
 .veil .dialog:not(:has(.dialog-art-wrap)){grid-template-rows:minmax(0,1fr)!important}
 .veil .dialog .dialog-art-wrap{width:100%;height:100%!important}
 .veil .dialog .dialog-banner{width:100%!important;height:100%!important;object-position:center 48%}
 .veil .dialog-heading{padding:9px 15px 8px}
 .veil .dialog-heading h2{font-size:clamp(22px,6.5vw,27px)!important}
 .veil .dialog-heading .eyebrow{font-size:9px!important}
 .veil .dialog-body{padding:11px 15px 20px;scrollbar-width:thin}
 .veil .dialog-footer{padding:6px 9px;gap:5px}
 .veil .reader-label{font-size:8px}
 .veil .dialog-reading-tools{gap:4px}
 .veil .dialog-reading-tools button{padding:5px 7px;min-height:31px;font-size:10px}
 .veil .dialog-footer .dialog-actions .btn{min-height:31px;padding:6px 8px;font-size:10px}
 .veil .story-narration{padding:13px 14px!important;margin:0 0 12px!important}
 .veil .story-narration p{font-size:16px!important;line-height:1.55!important}
 .veil .story-dialogue{grid-template-columns:82px minmax(0,1fr)!important;gap:8px!important;min-height:85px!important}
 .veil .story-speaker{padding:7px 4px!important}
 .veil .story-speaker img{width:45px!important;height:48px!important}
 .veil .story-speaker strong{font-size:11px!important}
 .veil .story-speaker small{font-size:8px!important}
 .veil .story-dialogue blockquote{font-size:15px!important;line-height:1.46!important;padding:10px 7px 10px 0!important}
 .veil .dialog-body p,.veil .dialog-body .prose{font-size:15px!important;line-height:1.55!important}
 .veil button.story-choice{min-height:78px!important;padding:12px!important}
 .veil .choice-copy strong{font-size:15px!important}
 .veil .choice-copy>span{font-size:13px!important}
 .veil .decision-heading small{display:block!important}
 .intro-paper p{font-size:14px!important;line-height:1.52!important}
 .road-base .story-note p,.road-base .story-note blockquote{font-size:12px!important}
}
@media(max-width:390px){
 .veil .dialog-footer .reader-label{display:none}
 .veil .dialog-footer .dialog-actions .btn{font-size:9px}
 .veil .dialog-reading-tools button{font-size:9px}
}
@media(prefers-reduced-motion:reduce){.veil *{scroll-behavior:auto!important;transition:none!important}}
/* Critical mobile fix: out-specificify the two-column desktop :has() grid rule. */
@media(max-width:759px){
 .veil .dialog:has(.dialog-art-wrap){grid-template-columns:minmax(0,1fr)!important;grid-template-rows:clamp(90px,17dvh,145px) minmax(0,1fr)!important}
 .veil .dialog:not(:has(.dialog-art-wrap)){grid-template-columns:minmax(0,1fr)!important;grid-template-rows:minmax(0,1fr)!important}
}
