/* The connected playtest uses one short-screen combat composition. */
@media (min-width:1101px) and (max-height:760px){
 body[data-connected-balance178="true"][data-story="true"][data-style="hybrid"][data-view="expedition"][data-phase="battle"][data-formation="ranks3"]:is([data-party-size="3"],[data-party-size="4"],[data-party-size="5"],[data-party-size="6"]){
  --story-two-row-h20:clamp(120px,calc((100dvh - 366px)/2),186px)!important;
 }
}

/* The illustrated Forest condition uses its full portrait in the result card. */
body[data-connected-balance178="true"][data-style="hybrid"] .response23-layer .response23-forest-card>img{
 display:block;width:100%;height:min(260px,38dvh);max-height:none;min-height:210px;padding:4px;
 background:#142723;border:2px solid #596d60;object-fit:contain;filter:none;
}
body[data-connected-balance178="true"]:has(#cycleScoutPanel:not([hidden])) #playerHud{visibility:hidden!important}

/* The short laptop view gives primary decisions readable space in the clearing. */
@media (min-width:1101px) and (max-height:760px){
 body[data-story="true"][data-style="hybrid"][data-view="expedition"][data-phase="battle"] #storyGoalHost17{width:480px!important}
 body[data-story="true"][data-style="hybrid"][data-view="expedition"][data-phase="battle"] #storyGoalHost17 .story-goal17{font-size:17px!important}
 body[data-story="true"][data-style="hybrid"][data-view="expedition"][data-phase="battle"] #storyGoalHost17 .story-goal17>span{font-size:19px!important}
 body[data-story="true"][data-style="hybrid"][data-view="expedition"][data-phase="battle"] #game :is(.enemy,.hero) .hybrid-unit-name{font-size:16px!important;line-height:17px!important}
 body[data-story="true"][data-style="hybrid"][data-view="expedition"][data-phase="battle"] #game :is(.enemy,.hero) .hp{font-size:16px!important;line-height:18px!important}
 body[data-story="true"][data-style="hybrid"][data-view="expedition"][data-phase="battle"] #fieldActions .deck-counters36{font-size:16px!important;line-height:19px!important}
 body[data-story="true"][data-style="hybrid"][data-view="expedition"][data-phase="battle"] #storyFuel17:has(.story-danger-track308){top:310px!important}
 body[data-story="true"][data-style="hybrid"][data-view="expedition"][data-phase="battle"] .story-danger-track308{width:168px!important;font-size:16px!important}
 body[data-story="true"][data-style="hybrid"][data-view="expedition"][data-phase="battle"] .story-danger-track308 :is(.story-danger-heading308,.story-danger-row308)>b{font-size:19px!important}
 body[data-story="true"][data-style="hybrid"][data-view="expedition"][data-phase="battle"] .story-danger-track308 .story-danger-row308>small{font-size:13px!important}
}

/* Keep Quest previews in the top band while retaining their icon-led rewards. */
@media (min-width:1101px) and (max-height:760px){
 body[data-connected-balance178="true"][data-story="true"][data-style="hybrid"] #tavern[data-composed-tavern="true"] .composed-quest-summary{
  top:47px!important;right:auto!important;transform:none!important;height:84px!important;width:220px!important;max-width:220px!important;padding:3px 5px!important;overflow:hidden!important;
 }
 body[data-connected-balance178="true"][data-story="true"][data-style="hybrid"] #tavern .composed-patron-target[data-patron-name="Orin"]>.composed-quest-summary{left:calc(50vw - 464px)!important}
 body[data-connected-balance178="true"][data-story="true"][data-style="hybrid"] #tavern .composed-patron-target[data-patron-name="Mara"]>.composed-quest-summary{left:calc(50vw - 228px)!important}
 body[data-connected-balance178="true"][data-story="true"][data-style="hybrid"] #tavern .composed-patron-target[data-patron-name="Bram"]>.composed-quest-summary{left:calc(50vw + 8px)!important}
 body[data-connected-balance178="true"][data-story="true"][data-style="hybrid"] #tavern .composed-patron-target[data-patron-name="Tess"]>.composed-quest-summary{left:calc(50vw + 244px)!important}
 body[data-connected-balance178="true"][data-story="true"][data-style="hybrid"] #tavern[data-composed-tavern="true"] .composed-quest-summary .quest-summary-title{height:23px!important}
 body[data-connected-balance178="true"][data-story="true"][data-style="hybrid"] #tavern[data-composed-tavern="true"] .composed-quest-summary .quest-summary-title strong{font-size:15px!important;line-height:18px!important;white-space:nowrap!important;overflow:hidden;text-overflow:ellipsis}
 body[data-connected-balance178="true"][data-story="true"][data-style="hybrid"] #tavern[data-composed-tavern="true"] .composed-quest-summary .quest-summary-rewards{margin-top:1px!important;flex-wrap:wrap!important;gap:0 5px!important;height:auto!important;font:700 14px/16px var(--fantasy-copy)!important}
 body[data-connected-balance178="true"][data-story="true"][data-style="hybrid"] #tavern[data-composed-tavern="true"] .composed-quest-summary .quest-summary-bonus{flex-basis:100%;font-size:13px;line-height:15px}
 body[data-connected-balance178="true"][data-story="true"][data-style="hybrid"] #tavern[data-composed-tavern="true"] .composed-quest-summary .reward-choice-alt78{flex-direction:row!important;gap:5px;font-size:12px!important}
 body[data-connected-balance178="true"][data-story="true"][data-style="hybrid"] #tavern[data-composed-tavern="true"] .composed-quest-summary .reward-choice-alt78>strong{font-size:11px!important;white-space:nowrap}
 body[data-connected-balance178="true"][data-story="true"][data-style="hybrid"] #tavern[data-composed-tavern="true"] .composed-quest-summary .reward-choice-list78{flex-wrap:nowrap!important;gap:3px!important}
 body[data-connected-balance178="true"][data-story="true"][data-style="hybrid"] #tavern[data-composed-tavern="true"] .composed-quest-summary .reward-choice-list78>span>span{display:none!important}
 body[data-connected-balance178="true"][data-story="true"][data-style="hybrid"] #tavern[data-composed-tavern="true"] .composed-quest-summary .reward-choice-list78 .icon{width:12px!important;height:12px!important;min-width:12px!important}
 body[data-connected-balance178="true"][data-story="true"][data-style="hybrid"] #tavern[data-composed-tavern="true"] .composed-quest-summary .reward-choice-list78 b{font-size:12px!important}
 body[data-connected-balance178="true"] #storyOpening18 .spoken-scene21__speech{
  position:fixed!important;box-sizing:border-box!important;left:204px!important;right:auto!important;bottom:16px!important;width:min(800px,calc(100vw - 220px))!important;max-width:none!important;max-height:calc(100dvh - 92px)!important;height:230px!important;min-height:0!important;overflow-y:auto!important;padding:10px 16px!important;
 }
 body[data-connected-balance178="true"] #storyOpening18 .spoken-scene21__portrait-plane{
  position:fixed!important;left:8px!important;bottom:8px!important;width:180px!important;height:180px!important;
 }
}

/* First-play speech owns a stable frame; controls remain inside it. */
body[data-connected-balance178="true"] #storyOpening18 .spoken-scene21__speech{grid-template-rows:auto minmax(0,1fr) auto!important;align-content:stretch!important}
body[data-tutorial-four="true"] #hartwellDialogue23:not(.overlay){position:fixed!important;inset:0!important;z-index:180!important;pointer-events:none!important;background:transparent!important}
body[data-tutorial-four="true"] #hartwellDialogue23:not(.overlay) .spoken-scene21{position:fixed!important;inset:0!important;pointer-events:none!important;background:transparent!important}
body[data-tutorial-four="true"] #hartwellDialogue23:not(.overlay) :is(.spoken-scene21__backdrop,.spoken-scene21__backfill){display:none!important}
@media(min-width:900px){
 body[data-tutorial-four="true"] #hartwellDialogue23:not(.overlay) .spoken-scene21__speech{left:100px!important;right:auto!important;top:auto!important;bottom:200px!important;width:300px!important;max-width:300px!important;height:250px!important;max-height:250px!important;overflow:hidden!important;grid-template-rows:auto minmax(0,1fr) auto!important;align-content:stretch!important;gap:8px!important;pointer-events:auto!important}
 body[data-tutorial-four="true"] #hartwellDialogue23:not(.overlay) .spoken-scene21__portrait-plane{inset:auto auto 290px 6px!important;width:88px!important;height:108px!important}
 body[data-tutorial-four="true"] #hartwellDialogue23:not(.overlay) .spoken-scene21__actions{position:static!important;inset:auto!important;grid-row:3!important;grid-column:2!important;justify-self:end!important;align-self:end!important;margin:0!important;pointer-events:auto!important}
 body[data-tutorial-four="true"] #hartwellDialogue23:not(.overlay) .spoken-scene21__words{font-size:20px!important;line-height:25px!important;overflow:auto!important}
}
@media(min-width:701px) and (orientation:landscape){
/* Four equal choices, each with a distinct portrait/name and its own larger role emblem. */
body #storyOpening18 .refuge-choice-details23 button[data-starter]{position:relative!important;display:grid!important;grid-template-columns:44px minmax(0,1fr) 48px!important;grid-template-rows:28px 24px minmax(48px,1fr)!important;gap:4px 8px!important;padding:10px!important;min-height:134px!important;align-items:start!important;text-align:left!important}
body #storyOpening18 .refuge-choice-details23 .refuge-class-glyph23{grid-column:1!important;grid-row:1/3!important;width:44px!important;height:48px!important;object-fit:contain!important}
body #storyOpening18 .refuge-choice-details23 .refuge-role-glyph23{grid-column:3!important;grid-row:1/3!important;justify-self:end!important;align-self:start!important;width:44px!important;height:44px!important;object-fit:contain!important}
body #storyOpening18 .refuge-choice-details23 button[data-starter]>strong{grid-column:2!important;grid-row:1!important;font-size:19px!important;line-height:24px!important;white-space:nowrap!important}
body #storyOpening18 .refuge-choice-details23 button[data-starter]>small{grid-column:2!important;grid-row:2!important;font-size:16px!important;line-height:20px!important;white-space:nowrap!important}
body #storyOpening18 .refuge-choice-details23 button[data-starter]>span{grid-column:1/-1!important;grid-row:3!important;font-size:16px!important;line-height:20px!important}
body #storyOpening18 .refuge-choice-details23 button[data-starter]:focus-visible{outline:4px solid #eedca0!important;outline-offset:3px!important}
}

/* The HOME track uses only native public route progress and known Forest cards. */
.story-home-timeline477 .story-timeline-resources477{display:flex;justify-content:space-between;gap:8px;font:700 16px/20px Georgia,serif}
.story-home-timeline477 .story-timeline-resources477 span{display:flex;align-items:center;gap:3px}
.story-home-timeline477 .story-home-heading477{display:flex;align-items:center;gap:5px;font:700 18px/22px Georgia,serif;color:#f5dc91}
.story-home-timeline477 ol{list-style:none;margin:4px 0;padding:0 0 0 9px;border-left:2px solid #a18e67;display:grid;gap:5px}
.story-home-timeline477 li{display:grid;grid-template-columns:24px 1fr;gap:6px;align-items:start;font:16px/19px Georgia,serif}
.story-home-timeline477 li>b{display:grid;place-items:center;border:1px solid #b09a6a;border-radius:50%;width:23px;height:23px;background:#2c3027}
.story-home-timeline477 li.current>b{background:#e2c783;color:#25251b}.story-home-timeline477 li.home{color:#d5f0be}.story-home-timeline477 li.unknown{color:#c0b7a4}
.story-home-timeline477 li span>strong{display:block;font-size:16px;color:#e8e5a6}.story-home-timeline477>small{display:block;font:14px/18px Georgia,serif}
@media(min-width:900px){body[data-story="true"][data-style="hybrid"][data-view="expedition"][data-phase="battle"] #storyFuel17:has(.story-home-timeline477){top:240px!important}body[data-story="true"][data-style="hybrid"][data-view="expedition"][data-phase="battle"] .story-home-timeline477{width:190px!important;padding:10px!important;gap:5px}}
@media(max-width:899px){.story-home-timeline477 ol{display:flex;border-left:0;border-top:2px solid #a18e67;padding:4px 0 0}.story-home-timeline477 li{flex:1;min-width:0;grid-template-columns:24px minmax(0,1fr)}.story-home-timeline477 .story-timeline-resources477{float:right}.story-home-timeline477 li span{font-size:14px;line-height:16px}}

.hero-protection477{position:absolute;right:3px;top:29px;z-index:6;display:flex;align-items:center;gap:3px;padding:3px 5px;background:#25372bed;border:1px solid #bac989;border-radius:4px;color:#edf4d8;font:700 18px/22px Georgia,serif;pointer-events:none}.hero-protection477 .icon{width:18px;height:18px}.hero-protection477 small{display:flex;align-items:center;font:700 16px/20px Georgia,serif;color:#f0b7a6;border-left:1px solid #9d9471;padding-left:4px}
/* Reserve a right rail once the ordinary enemy row fills. */
@media(min-width:1400px){
 body[data-story=true][data-style=hybrid][data-progression=xp][data-view=expedition][data-phase=battle][data-cycle-phase]:has(.story-home-timeline477,.threat-clock490) #game>.encounter{left:auto!important;right:192px!important}
 body[data-story=true][data-style=hybrid][data-view=expedition][data-phase=battle] #storyFuel17:has(.story-home-timeline477){top:180px!important}
 body[data-story=true][data-style=hybrid][data-view=expedition][data-phase=battle] #storyFuel17 .story-home-timeline477{width:165px!important}
}

/* Raised pot478. Keep the controls above the bowl and project its fire through the 60% cover transform. */
@media(min-width:900px){
body[data-raised-pot478="true"][data-story="true"][data-style="hybrid"][data-progression="xp"][data-view="expedition"][data-phase="battle"][data-cycle-phase][data-hand-fan24="true"] #game #fieldActions .fire-source{left:calc(50vw - 76px)!important;top:calc(60dvh - max(1.75vw,5.25dvh) - 158px)!important;bottom:auto!important;width:152px!important;height:66px!important;}
body[data-raised-pot478="true"][data-story="true"][data-style="hybrid"][data-progression="xp"][data-view="expedition"][data-phase="battle"][data-cycle-phase][data-hand-fan24="true"] .world-art::after{top:calc(60dvh + max(.75vw,2.25dvh));}
}

/* One current Threat clock. HOME remains its own exit-readiness cue. */
body[data-threat490=true][data-phase=battle] #storyFuel17{position:fixed!important;inset:0!important;width:0!important;height:0!important;padding:0!important;pointer-events:none!important}
.threat-clock490{position:fixed;right:16px;bottom:145px;width:142px;box-sizing:border-box;padding:9px;background:#17251fef;border:2px solid #a18b60;color:#f2e3b7;display:grid;gap:4px;text-align:center;font:16px/19px Georgia,serif;box-shadow:0 4px 10px #0009;pointer-events:auto}
.threat-clock490 strong,.threat-clock490 b{display:flex;align-items:center;justify-content:center;gap:4px;font-size:16px}.threat-clock490 small{font:14px/17px Georgia,serif}.threat490-levels{display:flex;flex-direction:column;gap:3px;margin:3px 20px}.threat490-levels i{height:8px;background:#31372e;border:1px solid #817352}.threat490-levels i.lit{background:#a8683f;border-color:#e1ad68}.threat-clock490.fire-out{border-color:#b75041}.cold-risk490{color:#c5edf4;border-top:1px solid #7c8774;padding-top:4px}.home-route490{position:fixed;top:88px;left:calc(50% - 80px);width:160px;box-sizing:border-box;padding:8px;background:#17251fef;border:1px solid #a18b60;display:grid;gap:4px;text-align:center;pointer-events:auto;font:16px/19px Georgia,serif;color:#ede4b9}.home-route490 strong{display:flex;justify-content:center;align-items:center;gap:5px}.home-route490 small{font:14px/17px Georgia,serif}
@media(min-width:1400px){body:has(#game>.objective-npc) .home-route490{left:auto;right:16px;top:132px;width:142px}}
@media(max-width:899px){.threat-clock490{right:8px;bottom:132px;width:122px;padding:6px}.threat490-levels{margin:0 15px}.threat490-levels i{height:5px}.home-route490{top:60px}}
@media(max-width:599px){
 .threat-clock490{top:48px;bottom:auto;left:8px;right:8px;width:auto;padding:4px 7px;grid-template-columns:1fr 1fr;gap:1px 8px;font:12px/14px Georgia,serif}
 .threat-clock490 strong,.threat-clock490 b{font-size:13px;line-height:15px}
 .threat-clock490 small{font-size:12px;line-height:14px}
 .threat-clock490 .icon{width:14px;height:14px}
 .threat-clock490>small:nth-last-child(2){display:none}
 .threat-clock490 .threat490-levels{display:none}
 .threat-clock490 .cold-risk490{grid-column:1/-1;padding-top:1px}
 .home-route490{top:110px;left:8px;right:8px;width:auto;padding:3px 6px;display:flex;justify-content:space-between;align-items:center;font-size:13px;line-height:16px}
 .home-route490 .icon{width:14px;height:14px}
 .home-route490 small{font-size:12px;line-height:14px}
 body #game .cold-marker490{position:fixed;top:110px;left:8px;right:8px;width:auto;margin:0;padding:2px 5px;font:12px/14px Georgia,serif;z-index:8}
 body #game .has-cold490 .guard-target193 .main-mana429{display:none}
 body:has(.home-route490) #game .cold-marker490{right:calc(50% + 4px)}
 body:has(.cold-marker490) .home-route490{left:calc(50% + 4px);display:grid;gap:0;padding:2px 5px;font-size:12px;line-height:14px}
 body:has(.cold-marker490) .home-route490 small{font-size:11px;line-height:13px}
 body:has(.story-goal-bonus140) .threat-clock490{top:66px;grid-template-columns:1fr 1fr 1fr}
 body:has(.story-goal-bonus140) .threat-clock490>strong{grid-area:1/1}
 body:has(.story-goal-bonus140) .threat-clock490>span{grid-area:1/2}
 body:has(.story-goal-bonus140) .threat-clock490>b{grid-area:1/3}
 body:has(.story-goal-bonus140) .threat-clock490>.cold-risk490{grid-area:2/2/3/4;border-top:0;padding-top:0}
}
