@font-face{font-family:Cinzel;src:url(fonts/Cinzel-Variable.ttf) format('truetype');font-weight:400 900;font-display:swap}
@font-face{font-family:Lora;src:url(fonts/Lora-Variable.ttf) format('truetype');font-weight:400 700;font-display:swap}
:root{--page:#efe4c8;--ink:#302c22;--edge:#a68a4e;--dark:#182b29;--accent:#d6b56b;--title:Cinzel,Georgia,serif;--prose:Lora,Georgia,serif}
body,button,input,select,textarea{font-family:var(--prose)}
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible{outline:2px solid #f2cc74;outline-offset:4px}
button:disabled{opacity:.5;cursor:default}
button{touch-action:manipulation}
h1,h2,.menu-subtitle,.eyebrow,.journal-tabs button,.objective-line h3,#world-speaker{font-family:var(--title)}
.menu-content{max-width:620px;padding:32px 46px 35px;background:linear-gradient(90deg,#182824f5,#172823e3 90%,#1125204d);border-left:1px solid #c4a46166;box-shadow:inset 5px 0 0 #0f191799,inset 8px 0 0 #ba9c5138,15px 0 60px #0d171854}
.menu h1{font-family:var(--title);font-size:clamp(40px,4.8vw,72px);line-height:1.14;letter-spacing:-1.8px;font-weight:500;color:#ead7a3;text-shadow:0 2px 1px #070d0b,0 -1px #f5e6bf44}
.menu h1 em{font:inherit;font-size:.8em;color:#c1a56c;letter-spacing:.1em}
.menu .eyebrow{font-size:10px;letter-spacing:2.2px;line-height:1.8}
.menu-subtitle{font-size:12px;letter-spacing:.14em}
.menu-copy{font-family:var(--prose);line-height:1.85;font-size:14px}
.menu .primary{font-family:var(--title);font-size:12px;letter-spacing:.08em;min-height:48px;background:linear-gradient(105deg,#dcc38b,#b79a60);border:1px solid #f0d7a2;color:#2d2b21;box-shadow:inset 0 0 0 3px #f0d9a05c,0 4px 15px #06100c66}
.menu .text-button{min-height:42px;font-size:12px}
.hud-header{padding:18px 25px;gap:16px;align-items:flex-start;background:linear-gradient(#101f24e0,#11222155 78%,transparent)}
.chapter-heading{max-width:min(44vw,580px)}
.chapter-heading h2{font-size:clamp(16px,1.8vw,25px);font-weight:500;line-height:1.3}
.chapter-heading .eyebrow{font-size:8px;letter-spacing:1.2px;line-height:1.65}
.hud-tools{gap:6px;flex-wrap:wrap;justify-content:flex-end;max-width:450px}
.icon-button{font-family:var(--title);font-size:9px;min-height:36px;padding:9px 12px;background:#132c2cce;border:1px solid #b5a16b66;color:#e6d5a9;letter-spacing:.4px;box-shadow:inset 0 0 0 2px #cdb4760c}
.brand-button{width:48px;flex-shrink:0}
.objective-card{top:125px;left:25px;width:286px;padding:17px 19px 14px 24px;border:1px solid #a58a51;box-shadow:0 8px 28px #101a1d38,inset 0 0 0 3px #bfaa7533;background:linear-gradient(100deg,#f1e7cfee,#e9dbbde8)}
.objective-card .eyebrow{font-family:var(--title);font-size:8px}
.objective-line h3{font-size:14px;line-height:1.55;font-weight:600;letter-spacing:.1px}
.objective-card>p{font:11px/1.8 var(--prose);color:#62563e}
.journal,.settings,.world-conversation{color:var(--ink);background:linear-gradient(90deg,#e2d4ae 0%,#f2e9d3 3%,#f3ead6 48.7%,#e3d3ae 50%,#f2e8d1 51.3%,#eee3c8 96%,#c6b17e 100%);border:1px solid #8d7440;box-shadow:0 20px 100px #06101b99,inset 0 0 0 5px #b49a6033;border-radius:2px}
.journal{width:min(1030px,calc(100vw - 42px));max-height:88dvh;padding:0}
.dialog-header{padding:28px 36px 22px;border-bottom:1px solid #ac925747;background:linear-gradient(110deg,#f0e6cd88,#d9c49466)}
.dialog-header h2{font-size:clamp(22px,3vw,34px);font-weight:500}
.dialog-header .eyebrow{font-size:9px;letter-spacing:2.2px}
.close-button{min-width:44px;min-height:44px;font:25px var(--prose);color:#6a572d}
.journal-tabs{background:#dfcda660;padding:0 28px;gap:5px;display:flex;flex-wrap:wrap}
.journal-tabs button{min-height:46px;font-size:11px;padding:14px 17px;border-bottom:2px solid transparent;color:#625135}
.journal-tabs button.active{background:#243a37;color:#eedcaa;border-bottom:2px solid #bca063}
#journal-content{padding:26px 36px 30px;font:14px/1.85 var(--prose)}
#journal-content h3{font-family:var(--title);font-weight:600;line-height:1.45}
.chapter-choice{border:1px solid #aa925c42;background:#fff9e52e;padding:14px 16px;margin:8px 0;box-shadow:inset 3px 0 #c1a36566}
.chapter-choice strong{font:500 13px/1.5 var(--title)}
.chapter-choice small{font:10px/1.7 var(--prose);margin-top:4px}
.chapter-choice.current{border-color:#8a723e;background:#dbca9a66}
.record-card,.cast-card,.world-story-grid article,.world-people article{background:#fff7df42;border-color:#b29b65a1;box-shadow:inset 0 0 0 3px #fff9e12b;padding:20px}
.record-card h3{font-size:17px;line-height:1.4}
.record-card p,.history-copy,.world-introduction p{font:14px/1.85 var(--prose)}
.record-card button,.world-story-grid button,.world-journal-actions button{font:11px/1.55 var(--title);border:1px solid #a58c53;background:#ddca9e;color:#3c3728;min-height:44px}
.history-title{font:500 28px/1.4 var(--title)}
.history-status,.small-note,.journal-footnote{font-family:var(--prose);line-height:1.8}
.record-search,.chapter-search{display:grid;gap:6px;margin:20px 0;font:11px var(--title)}
.record-search input,.chapter-search input{min-height:44px;background:#f7efdc9c;border:1px solid #a9915c;color:#453a25;padding:10px 13px;font:14px var(--prose);width:100%}
.world-conversation{padding:24px 30px;width:min(640px,calc(100vw - 28px))}
.world-conversation .dialog-header{padding:0 0 12px;background:none}
.world-conversation #world-text{font:17px/1.85 var(--prose)}
.dialogue{background:linear-gradient(110deg,#eee4ccf7,#e9dcbbed);color:#302c23;border:1px solid #a88e50;box-shadow:0 10px 40px #0b17194d}
.dialogue #speaker{color:#795b2c;font-family:var(--title)}
#dialogue-text{font:17px/1.85 var(--prose);color:#393025}
.dialogue-footer{border-top:1px solid #ac92574d;color:#766446}
.dialogue button{font-family:var(--title);font-size:10px;min-height:42px;color:#463b26}
.chapter-banner h2,.chapter-complete h2{font-family:var(--title);line-height:1.25}
.chapter-complete{background:linear-gradient(110deg,#172f2df2,#182a29ef);border:1px solid #c8ad68;max-height:65dvh;overflow:auto}
.chapter-complete p{font-family:var(--prose);line-height:1.8}
.chapter-complete button{font-family:var(--title);font-size:11px;min-height:42px}
.encounter-panel{top:125px;right:25px;width:270px;background:linear-gradient(110deg,#18302fef,#132729ec);color:#ebdfc3;border:1px solid #af9258;box-shadow:inset 0 0 0 3px #d6c28a12;font:11px/1.7 var(--prose)}
.encounter-panel .eyebrow{color:#e0c486;font-family:var(--title);font-size:9px}
.encounter-buttons button{min-height:36px;background:#24423c;color:#e6d6ac;border-color:#a18c555c;font:9px var(--title)}
.encounter-panel small{font-family:var(--prose);color:#c1b391;font-size:9px}
.encounter-meters{font:9px var(--title)}
#battle-brief{position:absolute;right:25px;top:355px;width:270px;padding:15px 18px;background:#142b2be8;border:1px solid #aa8e54;pointer-events:auto;color:#edddbb;font:11px/1.7 var(--prose)}
#battle-phase{font:9px var(--title);color:#d8ba78;letter-spacing:1.2px}
#battle-task{margin:8px 0 12px}
#battle-orders{display:grid;grid-template-columns:1fr 1fr;gap:6px}
#battle-orders button{min-height:38px;background:#28443d;color:#ecd9aa;border:1px solid #a58a5555;font:9px var(--title)}
#action-cross{position:absolute;right:24px;bottom:92px;width:164px;height:164px;pointer-events:none;color:#ead7a8}
#action-cross button{pointer-events:auto;position:absolute;width:48px;height:48px;padding:3px;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:3px;color:#ead8ab;background:linear-gradient(135deg,#294740ed,#122a29f5);border:1px solid #b79b5c;box-shadow:inset 0 0 0 3px #d9bd7412,0 3px 10px #07151566;font:8px var(--title);border-radius:3px}
#action-cross button:hover{background:#36584d}
#action-cross button kbd{border:0;padding:0;font:8px var(--prose);color:#c8c4ac}
#cross-toggle{left:58px;top:58px;transform:rotate(45deg)}
#cross-toggle span,#cross-toggle small{transform:rotate(-45deg)}
#cross-toggle span{font-size:22px;line-height:1}
#cross-toggle small{font:7px var(--title);line-height:1}
#action-cross #touch-act{left:58px;top:0}
#action-cross #touch-jump{left:116px;top:58px}
#cross-quiet{left:0;top:58px}
#cross-world{left:58px;top:116px}
#action-cross:not(.expanded){width:112px;height:54px;bottom:100px}
#action-cross:not(.expanded) #cross-toggle{left:60px;top:2px}
#action-cross:not(.expanded) #touch-act{left:0;top:2px}
#action-cross:not(.expanded) #touch-jump,#action-cross:not(.expanded) #cross-quiet,#action-cross:not(.expanded) #cross-world{display:none}
#action-cross #combat-actions{margin:0}
#action-cross #combat-actions [data-encounter-action=heavy]{left:58px;top:0}
#action-cross #combat-actions [data-encounter-action=attack]{left:116px;top:58px}
#action-cross #guard-action{left:0;top:58px}
#action-cross #combat-actions [data-encounter-action=evade]{left:58px;top:116px}
#action-cross #combat-actions [data-encounter-action=lock]{left:116px;top:0;font-size:7px}
#action-cross #combat-actions [data-encounter-action=recover]{left:0;top:116px;font-size:7px}
#action-cross.combat:not(.expanded) #combat-actions button{display:none}
.hud-footer{padding:20px 25px;pointer-events:none}
.hud-footer .camera-switch{pointer-events:auto}
.camera-switch button{font-family:var(--title);font-size:9px;min-height:38px}
#control-hint{font:9px var(--prose)}
.interaction{bottom:100px;max-width:min(420px,calc(100vw - 38px));background:#17332df0;color:#eed9a6;border-color:#c5aa67}
.interaction button{font:11px/1.5 var(--title)}
.toast{font:12px/1.75 var(--prose);max-width:540px;box-shadow:0 5px 20px #08161455}
body[data-presentation=plates]{--page:#d6bb75;--ink:#352910;--edge:#a37b2c;--accent:#e5c77f}
body[data-presentation=plates] .journal,body[data-presentation=plates] .world-conversation,body[data-presentation=plates] .settings{background:repeating-linear-gradient(0deg,#b8944b09 0,#b8944b09 1px,transparent 1px,transparent 4px),linear-gradient(105deg,#a6813e 0%,#d8b86d 2%,#efd795 8%,#e7c77e 45%,#e5c67e 72%,#ebd18e 94%,#b28b46 100%);border:1px solid #f2d48c;box-shadow:0 22px 90px #080b0ecc,inset 0 0 0 5px #684b2455,inset 0 0 0 7px #e1c28099}
body[data-presentation=plates] .dialog-header{background:linear-gradient(100deg,#cba24c55,#f6d79033);border-color:#7856245c}
body[data-presentation=plates] .dialog-header h2,body[data-presentation=plates] #journal-content h3{text-shadow:0 1px #ffe6aa6b,0 -1px #6c4b2f22;color:#46320f}
body[data-presentation=plates] .journal-tabs{background:#966d2d33}
body[data-presentation=plates] .journal-tabs button.active{background:#55401f;color:#f4d992;border-color:#f2ce7d}
body[data-presentation=plates] .record-card,body[data-presentation=plates] .world-story-grid article,body[data-presentation=plates] .world-people article{background:#ffe5a51c;border-color:#8d682c77;box-shadow:inset 0 0 0 3px #efd69933}
body[data-presentation=plates] .objective-card{background:linear-gradient(110deg,#e4c67deb,#c5a257ef);border-color:#f2d48c;box-shadow:inset 0 0 0 3px #805d2b33,0 5px 28px #1222284d}
body[data-presentation=plates] .dialogue{background:linear-gradient(100deg,#e9ce87f5,#c7a35bf2);border-color:#edcf83}
body[data-presentation=plates] .chapter-heading h2{color:#f0d69b}
body[data-presentation=plates] .world-conversation #world-text{color:#382c17}
@media(max-width:900px){.hud-header{gap:10px}.hud-tools{max-width:280px}.chapter-heading{max-width:45vw}.icon-button{padding:8px;font-size:8px}.menu-content{padding:25px 28px}.objective-card{width:250px}.encounter-panel{width:245px}#battle-brief{width:245px}}
@media(max-width:700px){.hud-header{padding:12px 14px;gap:9px;display:grid;grid-template-columns:34px 1fr}.brand-button{width:34px;padding:0}.brand-button img{width:33px}.chapter-heading{max-width:none}.chapter-heading h2{font-size:14px;line-height:1.35}.chapter-heading .eyebrow{font-size:6px}.hud-tools{grid-column:1/-1;max-width:none;width:100%;display:flex;flex-wrap:wrap;gap:4px;justify-content:flex-start}.icon-button{min-height:32px;padding:7px 8px;font-size:8px}.hud-tools kbd{display:none}.objective-card{left:14px;top:139px;width:220px;max-width:calc(100vw - 28px);padding:12px 14px 10px 21px}.objective-line h3{font-size:12px}.objective-card>p{font-size:10px;line-height:1.65;margin:6px 0 10px}.objective-top{margin-bottom:7px}.objective-card .eyebrow{font-size:7px}.objective-card #objective-count{font-size:8px}.menu-content{padding:20px 23px;background:#132b27e8}.menu h1{font-size:42px;letter-spacing:-1.1px}.menu-copy{font-size:12px}.menu .eyebrow{font-size:8px}.menu .ornament img{width:80px;height:auto}.menu .ornament{margin:8px auto}.menu .build-note{font-size:7px;line-height:1.8}.menu .text-button{min-height:36px;font-size:10px}.menu .primary{min-height:44px;font-size:10px}.journal{width:calc(100vw - 24px);max-height:92dvh}.dialog-header{padding:18px 18px 14px}.dialog-header h2{font-size:21px}.dialog-header .eyebrow{font-size:7px;letter-spacing:1.4px}#journal-content{padding:18px;font-size:12px}.journal-tabs{padding:0 10px;gap:1px}.journal-tabs button{min-height:42px;padding:11px 9px;font-size:8px}.record-card,.world-story-grid article{padding:16px}.record-card p,.history-copy,.world-introduction p{font-size:12px}.history-title{font-size:21px}.record-card h3{font-size:15px}.world-conversation{padding:18px}.world-conversation #world-text{font-size:14px}.dialogue{bottom:245px;padding:17px 20px;width:calc(100% - 26px);max-height:42dvh;overflow:auto}#dialogue-text{font-size:14px;line-height:1.8}.dialogue .eyebrow{font-size:9px}.dialogue-footer{gap:10px;flex-wrap:wrap}.dialogue button{font-size:8px}.encounter-panel{top:auto;bottom:245px;left:auto;right:14px;width:170px;max-height:160px;padding:10px;font-size:9px}.encounter-meters{grid-template-columns:1fr;gap:5px}.encounter-meters label{flex-direction:row}.encounter-meters meter{width:65%}.encounter-panel .encounter-buttons{grid-template-columns:1fr 1fr}.encounter-panel .encounter-buttons button{font-size:7px;min-height:32px}.encounter-panel .encounter-buttons [data-encounter-action=crouch],.encounter-panel .encounter-buttons [data-encounter-action=distract]{display:none}#battle-brief{top:auto;bottom:420px;right:14px;width:170px;padding:10px;font-size:9px}#battle-orders button{font-size:7px;min-height:34px}#action-cross{right:15px;bottom:63px;transform-origin:bottom right;transform:scale(.92)}#action-cross:not(.expanded){bottom:70px}.hud-footer{padding:12px 14px}.camera-switch button{padding:8px 9px;font-size:7px;min-height:32px}.camera-switch kbd{display:none}#control-hint{display:none}.touch-controls{left:14px;bottom:66px}.touch-walk button{width:43px;height:43px;min-width:43px;background:#18382fea;border:1px solid #ae9259;box-shadow:inset 0 0 0 3px #d9bd7412}.interaction{bottom:235px;min-width:175px}.interaction button{font-size:9px;padding:11px 15px}.toast{font-size:10px;bottom:280px;max-width:calc(100vw - 32px)}.chapter-complete{bottom:175px;width:calc(100vw - 28px);padding:22px 20px}.chapter-complete h2{font-size:23px}.chapter-complete p{font-size:12px}.chapter-complete button{font-size:9px;min-height:40px}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{scroll-behavior:auto!important;transition:none!important}}
[hidden]{display:none!important}

/* The encounter and task share a flowing column so long orders never overlap. */
#encounter-stack{position:absolute;right:25px;top:125px;width:270px;display:grid;gap:10px;max-height:calc(100dvh - 325px);overflow-y:auto;pointer-events:auto;scrollbar-width:thin;scrollbar-color:#a58a55 #18302f}
#encounter-stack .encounter-panel,#encounter-stack #battle-brief{position:static;inset:auto;width:100%;max-height:none;overflow:visible}
#battle-orders{display:block;border-top:1px solid #a58a5544;padding-top:8px}
#battle-orders summary{cursor:pointer;min-height:30px;display:flex;align-items:center;gap:8px;font:9px var(--title);color:#e6cd96;list-style:revert}
#battle-orders>div{display:grid;grid-template-columns:1fr 1fr;gap:6px;margin-top:6px}
#battle-orders button{min-height:44px}
#battle-task{margin-bottom:8px}
@media(max-width:900px){#encounter-stack{width:245px}}
@media(max-width:700px){#encounter-stack{right:14px;top:auto;bottom:245px;width:170px;max-height:calc(100dvh - 550px);min-height:130px}#encounter-stack .encounter-panel,#encounter-stack #battle-brief{padding:10px}#battle-orders summary{min-height:36px}#battle-orders button{font-size:7px}.encounter-buttons button{min-height:40px}}

@media(max-width:700px){
  .objective-card{top:var(--hud-header-bottom,160px);width:calc(100vw - 28px);max-height:174px;overflow-y:auto}
  .objective-card>p{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}
  #encounter-stack{max-height:max(130px,calc(100dvh - var(--hud-header-bottom,160px) - 440px))}
}
@media(max-width:700px) and (max-height:700px){
  .objective-card{max-height:110px;padding:8px 12px}.objective-card>p{display:none}.objective-top{margin-bottom:3px}.objective-line h3{font-size:11px}
  #encounter-stack{bottom:190px;max-height:140px;width:160px}
}

#encounter-toggle{display:none}
@media(max-width:700px){
  #encounter-stack{width:145px}
  #encounter-toggle{display:block;width:100%;min-height:44px;background:transparent;border:0;border-bottom:1px solid #b79b5c55;color:#ead8ab;font:8px var(--title);text-align:left;padding:3px 0 8px}
  #encounter-stack .encounter-panel:not(.details-open)>:not(#encounter-toggle):not(.encounter-meters){display:none}
  #encounter-stack:has(.details-open){width:170px}
  #encounter-stack .encounter-meters{margin-top:6px}
  .encounter-panel.details-open .encounter-buttons [data-encounter-action=crouch],.encounter-panel.details-open .encounter-buttons [data-encounter-action=distract]{display:block}
}

/* Keep completion choices distinct and touchable on narrow screens. */
@media(max-width:700px){.chapter-complete>.text-button{display:block;width:100%;max-width:100%;min-height:44px;white-space:normal;text-align:left}}

/* Keep the native journal header and controls outside its one scroll body. */
#journal[open]{display:flex;flex-direction:column;overflow:hidden}
#journal>.dialog-header{flex:0 0 auto;gap:12px}
#journal>.dialog-header>div{min-width:0}
#journal>.dialog-header .close-button{flex:0 0 44px}
#journal>.journal-tabs{position:static;flex:0 0 auto;background:#e9d9b8}
body[data-presentation=plates] #journal>.journal-tabs{background:#dfc17d}
#journal-scroll{min-height:0;flex:1 1 auto;overflow-y:auto;overscroll-behavior:contain;scroll-padding-block:16px}
#journal-scroll:focus-visible{outline:2px solid #947136;outline-offset:-3px}
@media(max-width:700px){#journal>.journal-tabs{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:1px;padding:0 10px}#journal>.journal-tabs button{min-height:44px;min-width:0;padding:10px 6px;font-size:10px;line-height:1.35;white-space:normal}#journal>.dialog-header h2{line-height:1.3}}
