/* Inhabited haven: illustrations are scenery; every interaction remains HTML. */
body[data-progression="xp"] .scene-board{display:flex;flex-direction:column;gap:6px;padding:0;min-height:0}
.scene-board .patron-board-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap;flex:none}
.scene-board .patron-board-heading h2{font:24px/28px Georgia,serif;margin:0}
.quest-rank-choice{display:flex;gap:4px;align-items:center;font:14px/20px system-ui}
.quest-rank-choice button{min-width:32px;min-height:30px;padding:3px 7px}
.quest-rank-choice button[aria-pressed="true"]{background:#d6b77c;color:#201c11;border-color:#ffe3a5}
.tavern-scene{position:relative;isolation:isolate;flex:1;min-height:240px;overflow:hidden;border:1px solid #b99a60;border-radius:10px;background:linear-gradient(#09100c15,#070d0bb8),url('assets/tavern-v1.png') center 55%/cover}
.scene-services{position:absolute;inset:10px 10px auto;display:flex;gap:8px;justify-content:space-between;z-index:3}
.scene-services button{background:#1b2b20ef;min-height:34px;font-size:14px;border-color:#d3b773;box-shadow:0 2px 5px #0009}
.scene-patrons{position:absolute;inset:48px 2% 5px;display:flex;align-items:end;justify-content:space-around;gap:2%}
.scene-person{position:relative;flex:1;min-width:0;max-width:195px;height:100%;display:flex;flex-direction:column;align-items:center;justify-content:end;background:none!important;border:0!important;border-radius:7px;padding:0!important;box-shadow:none!important}
.scene-person>.patron-portrait{position:static!important;inset:auto!important;height:calc(100% - 76px)!important;max-height:190px!important;width:100%!important;max-width:180px;object-fit:contain!important;object-position:center bottom;filter:drop-shadow(0 4px 4px #000)}
.scene-patron-label{display:flex;flex-direction:column;justify-content:center;align-items:center;flex:none;min-height:76px;width:100%;gap:2px;padding:4px 3px;background:#14271eed;border:1px solid #c2a86e;border-radius:7px;font:14px/17px system-ui;text-align:center}
.scene-patron-label>strong{display:flex;gap:4px;align-items:center;color:#ffe6ae;font:700 18px/20px Georgia,serif}
.scene-patron-label>strong .tv-emblem{width:22px;height:22px}
.scene-patron-label>small{font-size:12px;line-height:15px}
.scene-person:hover .patron-portrait,.scene-person:focus-visible .patron-portrait{filter:drop-shadow(0 0 8px #d6be79);transform:translateY(-3px)}
.scene-person:focus-visible{outline:3px solid #cfff99!important;outline-offset:1px}
.scene-note{margin:0!important;font:12px/16px system-ui;flex:none;text-align:center}
.scene-board .quest-town-tools{margin:0;padding:2px 5px;min-height:30px;flex:none}
@media(max-width:700px) and (min-height:501px){
 .scene-board .patron-board-heading h2{font-size:20px;line-height:24px}
 .quest-rank-choice{width:100%;justify-content:center}
 .tavern-scene{min-height:350px}
 .scene-services{inset:6px 5px auto;gap:4px}.scene-services button{padding:3px 5px;font-size:12px;min-height:30px}
 .scene-patrons{inset:44px 5px 5px;display:grid;grid-template-columns:1fr 1fr;grid-template-rows:minmax(0,1fr) minmax(0,1fr);gap:7px}
 .scene-person{max-width:none;display:grid;grid-template-columns:40% 60%;align-items:center;width:100%;height:100%}
 .scene-person>.patron-portrait{height:100%!important;max-height:140px!important;max-width:none;grid-column:1;grid-row:1}
 .scene-patron-label{grid-column:2;grid-row:1;min-height:110px;font-size:14px;line-height:17px}
 .scene-patron-label>strong{font-size:17px}
}
@media(max-height:500px){
 .scene-board .patron-board-heading h2{font-size:20px;line-height:24px}
 .scene-board .quest-town-tools{display:none}
 .tavern-scene{min-height:160px}
 .scene-services{inset:3px 5px auto;gap:4px}.scene-services button{min-height:27px;padding:2px 6px;font-size:12px}
 .scene-patrons{inset:33px 5px 3px;gap:6px}.scene-patron-label{min-height:68px;font-size:12px;line-height:14px;gap:0;padding:2px}
 .scene-patron-label>strong{font-size:16px;line-height:18px}.scene-patron-label>small{font-size:12px;line-height:14px}
 .scene-person>.patron-portrait{height:calc(100% - 68px)!important;max-height:85px!important}
 .quest-rank-choice button{min-width:28px;min-height:26px;padding:2px 5px}.scene-note{display:none}
}
/* Threat is one tall accepted-time meter. Its rank caps, its damage does not. */
body[data-progression="xp"][data-view="expedition"] #game{width:calc(100% - 66px)}
body[data-progression="xp"] #resources{grid-template-columns:110px minmax(0,1fr) 50px}
body[data-progression="xp"] #resources #threatInfo{position:fixed;right:8px;top:92px;bottom:72px;width:54px;height:auto;max-height:none;min-height:160px;padding:5px 4px;display:flex;flex-direction:column;gap:4px;z-index:6;background:linear-gradient(#30211b,#151d16);border:1px solid #d4a268}
body[data-progression="xp"] #threatInfo>.threat-value{display:flex;flex-direction:column;gap:0;flex:none;font-size:12px;line-height:15px}
body[data-progression="xp"] #threatInfo>.threat-value b{font-size:25px;line-height:28px}
body[data-progression="xp"] #threatInfo>.threat-value>.icon{width:23px;height:23px}
.threat-column{position:relative;display:block;flex:1;width:24px;min-height:60px;border:1px solid #a57d50;background:#120c0b;border-radius:10px;overflow:visible;margin:6px 10px 4px 0}
.threat-column>.threat-fill{position:absolute;bottom:0;left:0;right:0;background:linear-gradient(to top,#795b31,#dd943d,#f5d791);border-radius:8px;transition:height .35s ease}
.threat-column>.threat-grade{position:absolute;right:-16px;font:12px/14px system-ui;color:#d7c4a5;transform:translateY(50%);z-index:1}
.threat-column>.threat-grade.reached{color:#fff5c0;font-weight:700}
#threatInfo>.threat-bonus{font:12px/14px system-ui;display:block;flex:none}
.enemy-rank{position:absolute;left:4px;top:2px;z-index:4;padding:0 4px;border:1px solid #bba675;background:#1a261bec;border-radius:4px;font:12px/16px system-ui;color:#ffedc2}
.enemy-signature{display:block;font:12px/15px system-ui;color:#f5daa8}
@media(max-width:700px) and (min-height:501px){body[data-progression="xp"][data-view="expedition"] #game{width:calc(100% - 48px)}body[data-progression="xp"] #resources #threatInfo{width:41px;right:3px;top:132px;bottom:69px;padding:3px 2px}.threat-column{width:16px;margin-right:10px}body[data-progression="xp"] #threatInfo>.threat-value b{font-size:21px;line-height:23px}body[data-progression="xp"] #resources{grid-template-columns:68px minmax(0,1fr) 25px;gap:5px}.secondary-resources{gap:10px!important}}
@media(max-height:500px){body[data-progression="xp"] #resources #threatInfo{top:53px;bottom:52px;width:45px;right:4px;min-height:140px}body[data-progression="xp"][data-view="expedition"] #game{width:calc(100% - 52px);grid-template-columns:minmax(0,1fr) minmax(0,1.2fr) 155px;gap:4px 7px}.threat-value>.icon{display:none!important}.enemy-signature{font-size:12px;line-height:14px}}
body[data-progression="xp"]:not([data-view="expedition"]) #resources #threatInfo{position:static;height:48px;min-height:0;width:auto;display:block}
body[data-progression="xp"]:not([data-view="expedition"]) .threat-column{display:none}
@media(prefers-reduced-motion:reduce){.threat-column>.threat-fill{transition:none}.scene-person .patron-portrait{transition:none;transform:none!important}}

.quest-spoils{display:flex;gap:10px;flex:1 1 100%;justify-content:center}
.quest-spoils button{display:flex;align-items:center;justify-content:center;gap:8px;flex:1;min-height:38px;font-size:16px}
.quest-spoils .icon{height:30px;width:30px}
.loot-layout footer:has(.quest-spoils){flex-wrap:wrap}

#enemyPaging{display:inline-flex;align-items:center;gap:3px;font:12px/16px system-ui}#enemyPaging[hidden]{display:none}#enemyPaging button{min-height:22px;height:22px;padding:0 5px;font-size:16px}
body[data-progression="xp"] #enemyEventNotice{width:100%;min-height:24px;font:12px/15px system-ui;padding:2px 3px;white-space:normal}
@media(max-width:700px), (max-height:500px){body[data-progression="xp"] .encounter .section-line{gap:3px;justify-content:space-between}body[data-progression="xp"] .encounter .section-line h2{font-size:14px;line-height:18px}body[data-progression="xp"] #turnLabel{display:none}}

/* Full-frame art and service anchors share the same contained16:9 coordinate plane. */
.tavern-scene{container-type:size;background:#111c15}
.scene-background{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;pointer-events:none}
.scene-services{inset:auto;left:50%;top:50%;width:min(100cqw,177.78cqh);height:min(100cqh,56.25cqw);transform:translate(-50%,-50%);display:block;pointer-events:none}
.scene-services>button{position:absolute;transform:translate(-50%,-50%);pointer-events:auto;white-space:nowrap}
.scene-services>.service-0{left:38%;top:35%}.scene-services>.service-1{left:85%;top:43%}.scene-services>.service-2{left:15%;top:43%}
.scene-patrons{inset:auto 2% 5px;height:190px}.scene-person>.patron-portrait{max-height:112px!important}
@media(max-width:700px) and (min-height:501px){.scene-background{object-position:center top}.scene-services{top:0;transform:translateX(-50%)}.scene-services>button{max-width:80px;min-width:70px;font-size:12px;line-height:14px;white-space:normal}.scene-patrons{inset:102px 5px 5px;height:auto}.scene-person>.patron-portrait{max-height:110px!important}}
@media(max-height:500px){.scene-services{inset:3px 5px auto;width:auto;height:auto;transform:none;display:flex;gap:4px;justify-content:space-between}.scene-services>button{position:static;transform:none;white-space:nowrap}.scene-patrons{inset:33px 5px 3px;height:auto}.scene-person>.patron-portrait{max-height:85px!important}}

.cleared-site{display:flex;flex-direction:column;justify-content:center;align-items:center;gap:8px;padding:8px;text-align:center;max-width:100%;overflow:auto}.cleared-site h3,.cleared-site p{margin:0}.cleared-site p{font-size:12px}.cleared-site button{padding:6px 8px}.loot-choice-receipt{margin:0;font-size:12px}
