/* Approved chunky sprite direction. Last-loaded presentation layer only. */
:root{--tavern-lime:#e3b76b;--tavern-gold:#e3b76b;--tavern-purple:#b3a2d2;--pixel-ink:#141320;--pixel-panel:#211e2c;--pixel-edge:#796043;--pixel-teal:#235d63;color:#eee1c5;background:#141320}
html{color-scheme:dark}body{background:linear-gradient(#14132088,#141320dd),url('assets/pixel/tavern.png') center/cover fixed;font-size:12px;line-height:1.9}
body::before,body::after{display:none}
button,input,select,textarea,.shell,dialog,.title-content,.deck-card,.card,.item-tile,.shop-item,.role-option,.game-settings,.bonus-result,.fantasy-rules,.encounter-heading,.encounter-heading h2,.boss-health{border-radius:2px!important}
button{transition:background-color .12s,transform .12s;border:2px solid #8b7150;box-shadow:inset 0 2px #ffffff12,0 3px #100e17;min-height:42px}
button:enabled:hover{filter:brightness(1.13);transform:translateY(-1px)}button:enabled:active{transform:translateY(2px);box-shadow:inset 0 2px #0003}
button:focus-visible,a:focus-visible,summary:focus-visible,input:focus-visible,select:focus-visible{outline:3px solid #8bd1ca;outline-offset:4px}
.primary,.draw,.bonus-main,#campaign-actions .road-attack{background:#235d63!important;color:#fff0cd!important;border:2px solid #dfb775!important;box-shadow:inset 0 2px #46878b,0 4px #100e17!important}
.small,.stop,.deck-actions button:not(.draw),.role-arrow{background:#2a2635!important;color:#e7d4b0!important;border-color:#756044!important}
.shell,dialog.bonus,.session-dialog,.title-content{background:#1b1926f5!important;border:2px solid #9b7b50!important;box-shadow:0 0 0 3px #15121c,0 0 0 5px #4a3a30,0 16px 40px #0007!important}
.shell{max-width:1280px}.title-content{background:#181722d9!important;max-width:820px;padding:48px 32px}.title-screen{background:transparent}.title-screen h1{color:#e9bd76;line-height:1.6;text-shadow:3px 3px #1d1420}.title-tagline{color:#ebdaba}.title-eyebrow{color:#b1c9c5}
.title-actions .primary{min-width:230px}.setup-header,.top{border-color:#65513e}.brand{color:#f1d9a6}.setup-mode{border-color:#65513e}
.game-settings,.category-option,.player-entry,.setting-selects select,.timer-range input{background:#242131!important;border-color:#554839!important;color:#eee0c5!important}
.role-carousel .role-option{background:#171822!important;border:2px solid #5d4d3e!important;min-height:310px;padding:20px!important}.role-carousel .role-option[aria-pressed=true]{background:#1a292d!important;border-color:#d4ae6c!important;color:#f6dfb2!important}
.role-carousel .role-option .role-portrait{width:128px!important;height:128px!important;margin:0 auto 14px}.role-option small{color:#bdc6c6!important}.role-option span{color:#deb878!important}
.role-portrait{object-fit:contain;image-rendering:pixelated;border:0!important;background-color:transparent!important;border-radius:0!important;flex-shrink:0}
.encounter-heading,#bonus .encounter-heading,.boss-compact .encounter-heading{min-height:210px!important;position:relative;display:flex;align-items:center;padding:20px 28px!important;border:2px solid #796043!important;border-radius:0!important;background-image:linear-gradient(90deg,#141320cc,#14132033),var(--encounter-scene,url('assets/pixel/crypt.png'))!important;background-position:center!important;background-size:cover!important;margin-bottom:20px!important;overflow:hidden}
.encounter-heading h2,#bonus .encounter-heading h2,.boss-compact .encounter-heading h2{background:transparent!important;border:0!important;box-shadow:none!important;padding:0!important;color:#f5dfad;font-size:clamp(16px,2vw,25px)!important;max-width:100%;text-shadow:3px 3px #15111c}
.encounter-heading .pixel-creature,#bonus .encounter-heading .pixel-creature,.boss-compact .encounter-heading .pixel-creature{width:180px!important;height:180px!important;flex:0 0 180px;border:0!important;border-radius:0!important;background-color:transparent!important;box-shadow:none!important;image-rendering:pixelated}
.road-boss-heading,.boss-compact .road-boss-heading{max-width:calc(100% - 200px)!important;flex:1}.road-boss-health{background:#17131ee8!important;border:1px solid #69523f!important;border-radius:0!important;padding:10px 12px!important;max-width:340px!important}.road-hp-track{height:12px!important;border:2px solid #100f18;border-radius:0!important;background:#302231!important}.road-hp-fill{background:#b75255!important}
.encounter-person .role-portrait,#campaign-person .role-portrait,.boss-compact #campaign-person .role-portrait{width:72px!important;height:72px!important}.encounter-person,#campaign-person{gap:14px!important;padding-bottom:10px;border-bottom:1px solid #534433;color:#e5bf7a}
#bonus .encounter-scene,.boss-compact #campaign-story,#campaign-story{background:#1c1c28!important;border:0!important;border-left:3px solid #80654a!important;border-radius:0!important;padding:14px 18px!important;color:#d8d2cf;line-height:1.9!important}
#fantasy-rules,#campaign-rules,.fantasy-rules{border:1px solid #715a42!important;border-radius:0!important;background:#282436!important;color:#f4dfb4!important;padding:16px!important;font-size:12px!important;line-height:2!important}
.campaign-health{gap:8px!important}.boss-health{background:#242c30!important;border:1px solid #5a7772!important;color:#d5e5d9!important}.health-note{color:#b3b6b8!important}
.d20-tray{border:2px solid #65503e!important;border-radius:0!important;background:#14131d!important}.d20-toolbar{background:#24212d!important;border-color:#65503e!important}.d20-caption{color:#e3bb77!important}
.item-tile,.shop-item{background:#242230!important;border-color:#61503e!important}.item-action,.gold-balance,.skill-allocation h3{color:#e3b76b!important}.item-tile.ward{background:#1e3030!important;border-color:#5a8277!important}.pixel-item{image-rendering:pixelated}
.deck-card{background:#eddfbd!important;color:#251e28!important;border:3px solid #a78350!important;box-shadow:inset 0 0 0 4px #d5bf93,0 6px #110f18!important}.deck-card p{color:inherit}.deck-prompt,#deck-prompt{font-size:clamp(18px,2.4vw,27px);line-height:1.9}
#boss-summary,#encounter-summary,#timer-notice,.session-dialog{border-radius:2px!important}.boss-summary-footer,.encounter-summary-footer,.guide-header{background:#1d1b28!important;border-color:#5d4a38!important}#bonus-result-title,#boss-summary-title,#campaign-dialog #boss-summary-title,#bonus #encounter-summary #bonus-result-title{color:#e3b76b!important}.skill-upgrade{background:#29565b!important;border:1px solid #9d8159!important;color:#f2e0ba!important;border-radius:0!important}.bonus-reveal{background:#2b2838!important;color:#e2bd7f!important;border-radius:0!important}
.fantasy-extra{border-color:#534636!important}.fantasy-extra summary{color:#bacdc9!important}.notice-cheers{width:84px!important;height:84px!important}
img.pixel-atlas{object-fit:none!important;object-position:-99999px -99999px!important;background-repeat:no-repeat!important;image-rendering:pixelated}
.mage-peek img{height:100%!important}.class-info .role-portrait{width:112px!important;height:112px!important}
@media(max-width:760px){.shell{margin:14px 8px;padding:20px 14px}.encounter-heading,#bonus .encounter-heading,.boss-compact .encounter-heading{min-height:152px!important;padding:12px!important;gap:10px!important}.encounter-heading .pixel-creature,#bonus .encounter-heading .pixel-creature,.boss-compact .encounter-heading .pixel-creature{width:112px!important;height:112px!important;flex-basis:112px}.road-boss-heading,.boss-compact .road-boss-heading{max-width:calc(100% - 122px)!important}.encounter-heading h2,#bonus .encounter-heading h2,.boss-compact .encounter-heading h2{font-size:14px!important;line-height:1.8!important}.role-carousel .role-option .role-portrait{width:112px!important;height:112px!important}.title-content{padding:32px 18px}.title-screen h1{font-size:25px}.encounter-person .role-portrait,#campaign-person .role-portrait{width:60px!important;height:60px!important}}
@media(prefers-reduced-motion:reduce){button{transition:none}button:enabled:hover{transform:none}}

img[src="assets/pixel/blank.svg#warrior"]{object-fit:none!important;object-position:-99999px -99999px!important;background-image:url("assets/pixel/heroes.png")!important;background-size:300% 300%!important;background-position:0.0% 0.0%!important;background-repeat:no-repeat!important;image-rendering:pixelated;}
img[src="assets/pixel/blank.svg#rogue"]{object-fit:none!important;object-position:-99999px -99999px!important;background-image:url("assets/pixel/heroes.png")!important;background-size:300% 300%!important;background-position:50.0% 0.0%!important;background-repeat:no-repeat!important;image-rendering:pixelated;}
img[src="assets/pixel/blank.svg#mage"]{object-fit:none!important;object-position:-99999px -99999px!important;background-image:url("assets/pixel/heroes.png")!important;background-size:300% 300%!important;background-position:100.0% 0.0%!important;background-repeat:no-repeat!important;image-rendering:pixelated;}
img[src="assets/pixel/blank.svg#ranger"]{object-fit:none!important;object-position:-99999px -99999px!important;background-image:url("assets/pixel/heroes.png")!important;background-size:300% 300%!important;background-position:0.0% 50.0%!important;background-repeat:no-repeat!important;image-rendering:pixelated;}
img[src="assets/pixel/blank.svg#paladin"]{object-fit:none!important;object-position:-99999px -99999px!important;background-image:url("assets/pixel/heroes.png")!important;background-size:300% 300%!important;background-position:50.0% 50.0%!important;background-repeat:no-repeat!important;image-rendering:pixelated;}
img[src="assets/pixel/blank.svg#bard"]{object-fit:none!important;object-position:-99999px -99999px!important;background-image:url("assets/pixel/heroes.png")!important;background-size:300% 300%!important;background-position:100.0% 50.0%!important;background-repeat:no-repeat!important;image-rendering:pixelated;}
img[src="assets/pixel/blank.svg#necromancer"]{object-fit:none!important;object-position:-99999px -99999px!important;background-image:url("assets/pixel/heroes.png")!important;background-size:300% 300%!important;background-position:0.0% 100.0%!important;background-repeat:no-repeat!important;image-rendering:pixelated;}
img[src="assets/pixel/blank.svg#berserker"]{object-fit:none!important;object-position:-99999px -99999px!important;background-image:url("assets/pixel/heroes.png")!important;background-size:300% 300%!important;background-position:50.0% 100.0%!important;background-repeat:no-repeat!important;image-rendering:pixelated;}
img[src="assets/fantasy/ash-dragon.svg"]{object-fit:none!important;object-position:-99999px -99999px!important;background-image:url("assets/pixel/encounters-a.png")!important;background-size:400% 400%!important;background-position:0.0% 0.0%!important;background-repeat:no-repeat!important;image-rendering:pixelated;}
img[src="assets/fantasy/moonwell-nymph.svg"]{object-fit:none!important;object-position:-99999px -99999px!important;background-image:url("assets/pixel/encounters-a.png")!important;background-size:400% 400%!important;background-position:33.33333333333333% 0.0%!important;background-repeat:no-repeat!important;image-rendering:pixelated;}
img[src="assets/fantasy/exiled-mage.svg"]{object-fit:none!important;object-position:-99999px -99999px!important;background-image:url("assets/pixel/encounters-a.png")!important;background-size:400% 400%!important;background-position:66.66666666666666% 0.0%!important;background-repeat:no-repeat!important;image-rendering:pixelated;}
img[src="assets/fantasy/hollow-knight.svg"]{object-fit:none!important;object-position:-99999px -99999px!important;background-image:url("assets/pixel/encounters-a.png")!important;background-size:400% 400%!important;background-position:100.0% 0.0%!important;background-repeat:no-repeat!important;image-rendering:pixelated;}
img[src="assets/fantasy/bridge-troll.svg"]{object-fit:none!important;object-position:-99999px -99999px!important;background-image:url("assets/pixel/encounters-a.png")!important;background-size:400% 400%!important;background-position:0.0% 33.33333333333333%!important;background-repeat:no-repeat!important;image-rendering:pixelated;}
img[src="assets/fantasy/banshee-choir.svg"]{object-fit:none!important;object-position:-99999px -99999px!important;background-image:url("assets/pixel/encounters-a.png")!important;background-size:400% 400%!important;background-position:33.33333333333333% 33.33333333333333%!important;background-repeat:no-repeat!important;image-rendering:pixelated;}
img[src="assets/fantasy/grave-wraith.svg"]{object-fit:none!important;object-position:-99999px -99999px!important;background-image:url("assets/pixel/encounters-a.png")!important;background-size:400% 400%!important;background-position:66.66666666666666% 33.33333333333333%!important;background-repeat:no-repeat!important;image-rendering:pixelated;}
img[src="assets/fantasy/mimic-chest.svg"]{object-fit:none!important;object-position:-99999px -99999px!important;background-image:url("assets/pixel/encounters-a.png")!important;background-size:400% 400%!important;background-position:100.0% 33.33333333333333%!important;background-repeat:no-repeat!important;image-rendering:pixelated;}
img[src="assets/fantasy/bog-witch.svg"]{object-fit:none!important;object-position:-99999px -99999px!important;background-image:url("assets/pixel/encounters-a.png")!important;background-size:400% 400%!important;background-position:0.0% 66.66666666666666%!important;background-repeat:no-repeat!important;image-rendering:pixelated;}
img[src="assets/fantasy/gargoyle-sentinel.svg"]{object-fit:none!important;object-position:-99999px -99999px!important;background-image:url("assets/pixel/encounters-a.png")!important;background-size:400% 400%!important;background-position:33.33333333333333% 66.66666666666666%!important;background-repeat:no-repeat!important;image-rendering:pixelated;}
img[src="assets/fantasy/werewolf-innkeeper.svg"]{object-fit:none!important;object-position:-99999px -99999px!important;background-image:url("assets/pixel/encounters-a.png")!important;background-size:400% 400%!important;background-position:66.66666666666666% 66.66666666666666%!important;background-repeat:no-repeat!important;image-rendering:pixelated;}
img[src="assets/fantasy/goblin-merchant.svg"]{object-fit:none!important;object-position:-99999px -99999px!important;background-image:url("assets/pixel/encounters-a.png")!important;background-size:400% 400%!important;background-position:100.0% 66.66666666666666%!important;background-repeat:no-repeat!important;image-rendering:pixelated;}
img[src="assets/fantasy/bone-hydra.svg"]{object-fit:none!important;object-position:-99999px -99999px!important;background-image:url("assets/pixel/encounters-a.png")!important;background-size:400% 400%!important;background-position:0.0% 100.0%!important;background-repeat:no-repeat!important;image-rendering:pixelated;}
img[src="assets/fantasy/fallen-paladin.svg"]{object-fit:none!important;object-position:-99999px -99999px!important;background-image:url("assets/pixel/encounters-a.png")!important;background-size:400% 400%!important;background-position:33.33333333333333% 100.0%!important;background-repeat:no-repeat!important;image-rendering:pixelated;}
img[src="assets/fantasy/shadow-spider.svg"]{object-fit:none!important;object-position:-99999px -99999px!important;background-image:url("assets/pixel/encounters-a.png")!important;background-size:400% 400%!important;background-position:66.66666666666666% 100.0%!important;background-repeat:no-repeat!important;image-rendering:pixelated;}
img[src="assets/fantasy/vampire-count.svg"]{object-fit:none!important;object-position:-99999px -99999px!important;background-image:url("assets/pixel/encounters-a.png")!important;background-size:400% 400%!important;background-position:100.0% 100.0%!important;background-repeat:no-repeat!important;image-rendering:pixelated;}
img[src="assets/fantasy/cursed-dryad.svg"]{object-fit:none!important;object-position:-99999px -99999px!important;background-image:url("assets/pixel/encounters-b.png")!important;background-size:400% 400%!important;background-position:0.0% 0.0%!important;background-repeat:no-repeat!important;image-rendering:pixelated;}
img[src="assets/fantasy/lich-librarian.svg"]{object-fit:none!important;object-position:-99999px -99999px!important;background-image:url("assets/pixel/encounters-b.png")!important;background-size:400% 400%!important;background-position:33.33333333333333% 0.0%!important;background-repeat:no-repeat!important;image-rendering:pixelated;}
img[src="assets/fantasy/black-unicorn.svg"]{object-fit:none!important;object-position:-99999px -99999px!important;background-image:url("assets/pixel/encounters-b.png")!important;background-size:400% 400%!important;background-position:66.66666666666666% 0.0%!important;background-repeat:no-repeat!important;image-rendering:pixelated;}
img[src="assets/fantasy/frost-giant.svg"]{object-fit:none!important;object-position:-99999px -99999px!important;background-image:url("assets/pixel/encounters-b.png")!important;background-size:400% 400%!important;background-position:100.0% 0.0%!important;background-repeat:no-repeat!important;image-rendering:pixelated;}
img[src="assets/fantasy/spectral-ferryman.svg"]{object-fit:none!important;object-position:-99999px -99999px!important;background-image:url("assets/pixel/encounters-b.png")!important;background-size:400% 400%!important;background-position:0.0% 33.33333333333333%!important;background-repeat:no-repeat!important;image-rendering:pixelated;}
img[src="assets/fantasy/imp-accountant.svg"]{object-fit:none!important;object-position:-99999px -99999px!important;background-image:url("assets/pixel/encounters-b.png")!important;background-size:400% 400%!important;background-position:33.33333333333333% 33.33333333333333%!important;background-repeat:no-repeat!important;image-rendering:pixelated;}
img[src="assets/fantasy/basilisk.svg"]{object-fit:none!important;object-position:-99999px -99999px!important;background-image:url("assets/pixel/encounters-b.png")!important;background-size:400% 400%!important;background-position:66.66666666666666% 33.33333333333333%!important;background-repeat:no-repeat!important;image-rendering:pixelated;}
img[src="assets/fantasy/storm-sorceress.svg"]{object-fit:none!important;object-position:-99999px -99999px!important;background-image:url("assets/pixel/encounters-b.png")!important;background-size:400% 400%!important;background-position:100.0% 33.33333333333333%!important;background-repeat:no-repeat!important;image-rendering:pixelated;}
img[src="assets/fantasy/ember-golem.svg"]{object-fit:none!important;object-position:-99999px -99999px!important;background-image:url("assets/pixel/encounters-b.png")!important;background-size:400% 400%!important;background-position:0.0% 66.66666666666666%!important;background-repeat:no-repeat!important;image-rendering:pixelated;}
img[src="assets/fantasy/rat-king.svg"]{object-fit:none!important;object-position:-99999px -99999px!important;background-image:url("assets/pixel/encounters-b.png")!important;background-size:400% 400%!important;background-position:33.33333333333333% 66.66666666666666%!important;background-repeat:no-repeat!important;image-rendering:pixelated;}
img[src="assets/fantasy/hollow-monarch.svg"]{object-fit:none!important;object-position:-99999px -99999px!important;background-image:url("assets/pixel/encounters-b.png")!important;background-size:400% 400%!important;background-position:66.66666666666666% 66.66666666666666%!important;background-repeat:no-repeat!important;image-rendering:pixelated;}
img[src="assets/fantasy/cinder-regent.svg"]{object-fit:none!important;object-position:-99999px -99999px!important;background-image:url("assets/pixel/encounters-b.png")!important;background-size:400% 400%!important;background-position:100.0% 66.66666666666666%!important;background-repeat:no-repeat!important;image-rendering:pixelated;}
img[src="assets/fantasy/road-warden.svg"]{object-fit:none!important;object-position:-99999px -99999px!important;background-image:url("assets/pixel/encounters-b.png")!important;background-size:400% 400%!important;background-position:0.0% 100.0%!important;background-repeat:no-repeat!important;image-rendering:pixelated;}
img[src="assets/fantasy/toll-reaper.svg"]{object-fit:none!important;object-position:-99999px -99999px!important;background-image:url("assets/pixel/encounters-b.png")!important;background-size:400% 400%!important;background-position:33.33333333333333% 100.0%!important;background-repeat:no-repeat!important;image-rendering:pixelated;}
img[src="assets/fantasy/the-last-conductor.svg"]{object-fit:none!important;object-position:-99999px -99999px!important;background-image:url("assets/pixel/encounters-b.png")!important;background-size:400% 400%!important;background-position:66.66666666666666% 100.0%!important;background-repeat:no-repeat!important;image-rendering:pixelated;}
img[src="assets/fantasy/protection-spell.svg"]{object-fit:none!important;object-position:-99999px -99999px!important;background-image:url("assets/pixel/items.png")!important;background-size:300% 300%!important;background-position:0.0% 0.0%!important;background-repeat:no-repeat!important;image-rendering:pixelated;}
img[src="assets/fantasy/rune-charm.svg"]{object-fit:none!important;object-position:-99999px -99999px!important;background-image:url("assets/pixel/items.png")!important;background-size:300% 300%!important;background-position:50.0% 0.0%!important;background-repeat:no-repeat!important;image-rendering:pixelated;}
img[src="assets/fantasy/mischief-token.svg"]{object-fit:none!important;object-position:-99999px -99999px!important;background-image:url("assets/pixel/items.png")!important;background-size:300% 300%!important;background-position:100.0% 0.0%!important;background-repeat:no-repeat!important;image-rendering:pixelated;}
img[src="assets/fantasy/iron-sword.svg"]{object-fit:none!important;object-position:-99999px -99999px!important;background-image:url("assets/pixel/items.png")!important;background-size:300% 300%!important;background-position:0.0% 50.0%!important;background-repeat:no-repeat!important;image-rendering:pixelated;}
img[src="assets/fantasy/moon-bow.svg"]{object-fit:none!important;object-position:-99999px -99999px!important;background-image:url("assets/pixel/items.png")!important;background-size:300% 300%!important;background-position:50.0% 50.0%!important;background-repeat:no-repeat!important;image-rendering:pixelated;}
img[src="assets/fantasy/ember-staff.svg"]{object-fit:none!important;object-position:-99999px -99999px!important;background-image:url("assets/pixel/items.png")!important;background-size:300% 300%!important;background-position:100.0% 50.0%!important;background-repeat:no-repeat!important;image-rendering:pixelated;}
img[src="assets/fantasy/gold-pouch.svg"]{object-fit:none!important;object-position:-99999px -99999px!important;background-image:url("assets/pixel/items.png")!important;background-size:300% 300%!important;background-position:0.0% 100.0%!important;background-repeat:no-repeat!important;image-rendering:pixelated;}
img[src="assets/fantasy/insight-spell.svg"]{object-fit:none!important;object-position:-99999px -99999px!important;background-image:url("assets/pixel/items.png")!important;background-size:300% 300%!important;background-position:50.0% 100.0%!important;background-repeat:no-repeat!important;image-rendering:pixelated;}
img[src="assets/fantasy/cheers.svg"]{object-fit:none!important;object-position:-99999px -99999px!important;background-image:url("assets/pixel/items.png")!important;background-size:300% 300%!important;background-position:100.0% 100.0%!important;background-repeat:no-repeat!important;image-rendering:pixelated;}
.sprite-host{display:inline-block;position:relative;vertical-align:middle;flex-shrink:0;line-height:0}
.sprite-source{display:block!important;opacity:0!important}
.sprite-window{position:absolute;inset:0;overflow:hidden;pointer-events:none}
.sprite-window .sprite-sheet{position:absolute!important;max-width:none!important;max-height:none!important;object-fit:fill!important;object-position:center!important;border:0!important;border-radius:0!important;padding:0!important;margin:0!important;background:none!important;image-rendering:pixelated;display:block!important}

/* Separate player identity fields from the character selector. */
.setup .player-fields{gap:24px}
.setup .player-entry{padding:20px;box-sizing:border-box;border:1px solid #514635}
.setup .player-entry>label{margin-bottom:12px}
.setup .player-entry .role-picker{margin-top:28px;padding-top:20px;border-top:1px solid #514635}
@media(max-width:520px){.setup .player-fields{gap:18px}.setup .player-entry{padding:16px}.setup .player-entry .role-picker{margin-top:24px;padding-top:18px}}

/* A visible wizard above the title, not hidden behind the letter. */
.mage-peek{width:1.8em!important;height:1.8em!important;bottom:.7em!important;overflow:visible!important;z-index:3!important}
.mage-peek>.sprite-host{width:100%;height:100%}.mage-peek #title-mage{width:100%!important;height:100%!important}
.title-screen h1 .title-subtitle{display:inline-block;margin-top:1em}
/* Keep title/health above a shared stage; both sides face inward. */
.encounter-heading.faceoff-scene,#bonus .encounter-heading.faceoff-scene,.boss-compact .encounter-heading.faceoff-scene{display:grid!important;grid-template-columns:minmax(0,1fr) 180px;grid-template-areas:"title title" "party foe";align-items:end;gap:14px 24px!important;min-height:300px!important;padding:20px 28px!important}
.faceoff-scene>h2,.faceoff-scene>.road-boss-heading{grid-area:title;max-width:100%!important;width:100%;margin:0!important}
.faceoff-scene>.sprite-host{grid-area:foe;justify-self:end;transform:scaleX(-1)}
.scene-party{grid-area:party;display:flex;align-items:end;flex-wrap:wrap;gap:12px;min-width:0}
.scene-player{margin:0;max-width:96px;text-align:center;align-self:end}.scene-player .role-portrait{width:96px!important;height:96px!important}.scene-player figcaption{font-size:8px;line-height:1.8;color:#c5cecf;max-width:96px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding:6px 2px;border-bottom:2px solid transparent}
.scene-player.is-active figcaption{color:#f3d49a;border-bottom-color:#e3b76b}.scene-player.is-active>.sprite-host{filter:drop-shadow(0 2px 0 #cba366)}
@media(max-width:760px){.encounter-heading.faceoff-scene,#bonus .encounter-heading.faceoff-scene,.boss-compact .encounter-heading.faceoff-scene{grid-template-columns:minmax(0,1fr) 100px;min-height:235px!important;padding:12px!important;gap:10px!important}.scene-party{gap:6px}.scene-player{max-width:58px}.scene-player .role-portrait{width:58px!important;height:68px!important}.scene-player figcaption{font-size:7px;max-width:58px}.faceoff-scene .pixel-creature{width:100px!important;height:112px!important}}

/* Small, foot-anchored breathing; animate the inner viewport so facing is preserved. */
:is(.title-screen,.setup,.encounter-heading,.encounter-person,.class-info) .sprite-host[data-idle="true"]>.sprite-window{transform-origin:50% 100%;animation:sprite-breathe var(--idle-time,3.6s) ease-in-out var(--idle-delay,0s) infinite}
@keyframes sprite-breathe{0%,100%{transform:scale(1,1)}45%,55%{transform:scale(.995,1.025)}}
@media(prefers-reduced-motion:reduce){:root:not([data-sprite-motion="on"]) .sprite-host>.sprite-window{animation:none!important;transform:none!important}}

:root[data-sprite-motion="off"] .sprite-host>.sprite-window{animation:none!important;transform:none!important}
.character-motion{font-size:9px!important;padding:8px 12px!important;min-height:36px}

:root[data-sprite-motion="on"] :is(.title-screen,.setup,.encounter-heading,.encounter-person,.class-info) .sprite-host[data-idle="true"]>.sprite-window{animation:sprite-breathe var(--idle-time,3.6s) ease-in-out var(--idle-delay,0s) infinite!important}

/* Character-attached HUD: live health stays with the figures in the scene. */
.encounter-heading.faceoff-scene,#bonus .encounter-heading.faceoff-scene,.boss-compact .encounter-heading.faceoff-scene{grid-template-columns:minmax(0,1fr) minmax(180px,28%);grid-template-areas:"party title" "party foe";column-gap:24px!important;row-gap:10px!important;min-height:300px!important}
.faceoff-scene>h2,.faceoff-scene>.road-boss-heading{justify-self:center;align-self:end;text-align:center;min-width:0;max-width:100%!important}
.faceoff-scene>h2,.faceoff-scene .road-boss-heading h2,#bonus .faceoff-scene>h2,.boss-compact .faceoff-scene .road-boss-heading h2{font-size:clamp(12px,1.5vw,20px)!important;line-height:1.6!important;padding:0!important;background:none!important;overflow-wrap:anywhere}
.faceoff-scene>.sprite-host{justify-self:center;margin-bottom:28px}
.faceoff-scene .road-boss-health{width:100%;box-sizing:border-box;margin:8px 0 0!important;padding:8px!important;text-align:center}
.faceoff-scene .road-hp-label{font-size:9px;line-height:1.6}
.faceoff-scene .road-hp-track{margin-top:7px;height:7px}
.scene-party{padding-top:24px;gap:16px}
.scene-player{width:110px;max-width:110px;min-width:0}
.scene-player figcaption{max-width:110px;white-space:normal;overflow-wrap:anywhere}
.scene-hp{font-size:8px;line-height:1.8;padding-top:4px;color:#eee0be}
.scene-hp-track{height:5px;margin:5px 5px 0;background:#211923;border:1px solid #74604a;overflow:hidden}
.scene-hp-track>span{display:block;height:100%;background:#8bb9a3}
.scene-player.is-fallen>.sprite-host{filter:grayscale(1);opacity:.5}
.scene-hud-ready #campaign-person,.scene-hud-ready #fantasy-area .encounter-person{display:none!important}
.scene-health-ready #campaign-health>.boss-health,.scene-health-ready #campaign-health>.health-note:first-child{display:none}
.scene-health-ready #campaign-health:not(:has(.health-note:nth-of-type(2))){display:none}
.scene-health-ready #campaign-health{margin:0;padding:0;border:0}
.boss-compact .boss-layout-grid{grid-template-columns:minmax(0,1.35fr) minmax(0,1fr)}
.boss-compact .d20-stage{height:320px}
.boss-compact .d20-expanded .d20-stage{height:min(520px,60vh)}
@media(max-width:760px){
 .encounter-heading.faceoff-scene,#bonus .encounter-heading.faceoff-scene,.boss-compact .encounter-heading.faceoff-scene{grid-template-columns:minmax(0,1fr) minmax(105px,35%);gap:10px!important;min-height:250px!important}
 .faceoff-scene>.sprite-host{margin-bottom:32px}
 .scene-party{gap:10px;padding-top:12px}.scene-player{width:72px;max-width:72px}.scene-player figcaption{max-width:72px;font-size:7px}.scene-hp{font-size:7px}
 .faceoff-scene .road-hp-label{font-size:7px}.boss-compact .d20-stage{height:280px}
}

/* Show only the wizard's head, shoulders and staff above the foreground letter. */
.mage-letter{isolation:isolate}
.mage-letter-front{position:relative;z-index:2}
.mage-peek{width:1.8em!important;height:1em!important;bottom:1.15em!important;overflow:hidden!important;z-index:1!important}
.mage-peek>.sprite-host{width:1.8em!important;height:1.8em!important}
.mage-peek .sprite-source{width:100%!important;height:100%!important}
.mage-peek .sprite-window{animation:none!important;transform:none!important}

.mage-peek *{font-size:inherit!important}
.mage-peek>.sprite-host{position:absolute;left:0;top:0}

/* The mountain backdrop has a chasm: supply a real foreground floor. */
.bonus[data-scenery="storm"] .faceoff-scene{position:relative;isolation:isolate;overflow:hidden}
.bonus[data-scenery="storm"] .faceoff-scene::after{content:"";position:absolute;inset:auto 0 0;height:76px;background:url('assets/pixel/frozen-ledge.svg') center bottom/100% 100% no-repeat;image-rendering:pixelated;z-index:-1;pointer-events:none}
.bonus[data-scenery="storm"] .faceoff-scene>.sprite-host{margin-bottom:18px}
.bonus[data-scenery="storm"] .scene-player.is-active>.sprite-host{filter:none}
.bonus[data-scenery="storm"] .faceoff-scene>.sprite-host::before,.bonus[data-scenery="storm"] .scene-player>.sprite-host::before{content:"";position:absolute;left:16%;right:16%;bottom:10%;height:8%;background:#09121da8;clip-path:polygon(15% 0,85% 0,85% 20%,100% 20%,100% 80%,85% 80%,85% 100%,15% 100%,15% 80%,0 80%,0 20%,15% 20%);pointer-events:none}
.bonus[data-scenery="storm"] .scene-player figcaption{background:#182331c9}
@media(max-width:760px){.bonus[data-scenery="storm"] .faceoff-scene::after{height:64px}.bonus[data-scenery="storm"] .faceoff-scene>.sprite-host{margin-bottom:22px}}

/* Merchant: a compact storefront, with the seller on the street beside the stall. */
#campaign-dialog[data-scenery="market"]{width:min(960px,calc(100vw - 24px));box-sizing:border-box}
#campaign-dialog[data-scenery="market"] .bonus-controls{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:12px}
#campaign-dialog[data-scenery="market"] .bonus-controls button{margin:0;font-size:9px;padding:9px 12px}
#campaign-dialog[data-scenery="market"] #campaign-kicker{margin:0 0 12px;padding:8px;font-size:10px}
#campaign-dialog[data-scenery="market"] .faceoff-scene{grid-template-columns:minmax(0,1fr) minmax(180px,44%);min-height:260px!important}
#campaign-dialog[data-scenery="market"] .faceoff-scene>.sprite-host{margin-bottom:0;transform:translateX(-18%) scaleX(-1)}
#campaign-dialog[data-scenery="market"] .faceoff-scene>.road-boss-heading{transform:translateX(-8%)}
#campaign-dialog[data-scenery="market"] .faceoff-scene>.sprite-host::before{content:"";position:absolute;left:15%;right:15%;bottom:9%;height:7%;background:#080b12a8;border-radius:50%;pointer-events:none}
#campaign-dialog[data-scenery="market"] #campaign-story{font-size:10px!important;line-height:1.9!important;margin:12px 0!important;padding:10px 14px!important}
#campaign-dialog[data-scenery="market"] #campaign-rules{display:grid;grid-template-columns:1fr auto;gap:4px 14px;align-items:center;padding:12px 16px!important;white-space:normal;margin:0;font-size:11px!important}
.shop-customer{grid-column:1;overflow-wrap:anywhere}.shop-turn{grid-column:1;font-size:8px;color:#b5b9bd}.shop-wallet{grid-column:2;grid-row:1/3;color:#f1c878;border-left:1px solid #796043;padding-left:16px;white-space:nowrap}
#campaign-dialog[data-scenery="market"] #campaign-board{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;margin:14px 0}
#campaign-dialog[data-scenery="market"] .shop-item{min-width:0;display:flex;flex-direction:column;gap:12px;padding:16px;box-sizing:border-box}
.shop-item-heading{display:flex;align-items:center;gap:12px;min-height:64px}.shop-item-heading strong{font-size:11px;line-height:1.8;overflow-wrap:anywhere}.shop-item-heading .pixel-item{width:58px!important;height:58px!important;float:none!important;margin:0!important}
#campaign-dialog[data-scenery="market"] .shop-description{font-size:10px;line-height:1.9;margin:0;flex:1}
#campaign-dialog[data-scenery="market"] .shop-item>button{width:100%;min-height:44px;font-size:10px;margin:0;order:3}
#campaign-dialog[data-scenery="market"] .shop-owned{font-size:9px;margin:0;color:#bac8ba;order:2}
#campaign-dialog[data-scenery="market"] #campaign-actions{display:flex;justify-content:flex-end;margin:16px 0 0;padding-top:12px;border-top:1px solid #61503e}
#campaign-dialog[data-scenery="market"] #campaign-actions>button{font-size:11px;padding:12px 20px}
@media(max-width:540px){
 #campaign-dialog[data-scenery="market"]{padding:12px}
 #campaign-dialog[data-scenery="market"] .faceoff-scene{grid-template-columns:minmax(0,1fr) minmax(110px,44%);min-height:220px!important}
 #campaign-dialog[data-scenery="market"] #campaign-board{grid-template-columns:1fr;gap:10px}
 #campaign-dialog[data-scenery="market"] .shop-item{gap:8px;padding:12px}.shop-item-heading{min-height:48px}.shop-item-heading .pixel-item{width:48px!important;height:48px!important}
 #campaign-dialog[data-scenery="market"] #campaign-actions>button{width:100%}
}

/* Final challenge: passengers in the aisle, conductor at the wheel, cards centre stage. */
#campaign-dialog[data-scenery="bus"][open]{display:flex;flex-direction:column;width:min(1080px,calc(100vw - 24px));box-sizing:border-box;gap:12px}
#campaign-dialog[data-scenery="bus"] .bonus-controls{order:0;display:flex;flex-wrap:wrap;gap:8px;margin:0}
#campaign-dialog[data-scenery="bus"] .bonus-controls button{font-size:9px;margin:0;padding:9px 12px}
#campaign-dialog[data-scenery="bus"] #campaign-kicker{order:1;font-size:10px;margin:0;padding:8px}
#campaign-dialog[data-scenery="bus"] .faceoff-scene{order:2;position:relative;display:block!important;min-height:260px!important;margin:0;padding:12px!important;background-position:center center}
#campaign-dialog[data-scenery="bus"] .faceoff-scene>.road-boss-heading{position:absolute;top:10px;left:50%;transform:translateX(-50%);width:70%;max-width:320px!important;text-align:center}
#campaign-dialog[data-scenery="bus"] .faceoff-scene h2{font-size:14px!important}
#campaign-dialog[data-scenery="bus"] .faceoff-scene>.sprite-host{position:absolute;left:54%;top:45px;transform:translateX(-50%);margin:0}
#campaign-dialog[data-scenery="bus"] .faceoff-scene>.sprite-host .pixel-creature{width:92px!important;height:104px!important}
#campaign-dialog[data-scenery="bus"] .scene-party{position:relative;margin:120px auto 0;padding:0;width:42%;justify-content:space-between;gap:10px 18px}
#campaign-dialog[data-scenery="bus"] .scene-player{width:90px;max-width:90px}
#campaign-dialog[data-scenery="bus"] .scene-player .role-portrait{width:72px!important;height:80px!important}
#campaign-dialog[data-scenery="bus"] .scene-player figcaption{max-width:90px;background:#141825c9}
#campaign-dialog[data-scenery="bus"] #campaign-board{order:3;display:grid;grid-template-columns:repeat(4,minmax(0,130px));justify-content:center;gap:16px;margin:0;padding:18px;border:2px solid #796043;background:#20232e;box-sizing:border-box}
#campaign-dialog[data-scenery="bus"] #campaign-board[data-variant="row"]{grid-template-columns:repeat(5,minmax(0,120px))}
#campaign-dialog[data-scenery="bus"] #campaign-board:empty{display:none}
.bus-progress{grid-column:1/-1;text-align:center;color:#e3b76b;margin:0 0 6px;font-size:11px;line-height:1.8}
#campaign-dialog[data-scenery="bus"] .bus-card{width:100%;height:auto;aspect-ratio:5/7;box-sizing:border-box;font-size:clamp(18px,3vw,30px);box-shadow:0 5px #08091080}
#campaign-dialog[data-scenery="bus"] #campaign-result{order:4;margin:0;text-align:center;font-size:13px;padding:14px}
#campaign-dialog[data-scenery="bus"] #campaign-actions{order:5;display:flex;flex-wrap:wrap;justify-content:center;gap:10px;margin:0}
#campaign-dialog[data-scenery="bus"] #campaign-actions>p{text-align:center;font-size:11px;margin:0}
#campaign-dialog[data-scenery="bus"] #campaign-actions>button{min-width:130px;font-size:12px;min-height:48px}
#campaign-dialog[data-scenery="bus"] #campaign-health{order:6}
#campaign-dialog[data-scenery="bus"]>.fantasy-extra{order:7;margin:0}
#campaign-dialog[data-scenery="bus"] #campaign-rules{order:8;font-size:10px!important;margin:0;padding:12px!important}
#campaign-dialog[data-scenery="bus"] #campaign-story{order:9;font-size:10px!important;margin:0;padding:12px!important}
@media(max-width:540px){
 #campaign-dialog[data-scenery="bus"][open]{padding:12px;gap:10px}
 #campaign-dialog[data-scenery="bus"] .faceoff-scene{min-height:240px!important}
 #campaign-dialog[data-scenery="bus"] .faceoff-scene h2{font-size:11px!important}
 #campaign-dialog[data-scenery="bus"] .faceoff-scene>.sprite-host{top:46px}
 #campaign-dialog[data-scenery="bus"] .faceoff-scene>.sprite-host .pixel-creature{width:72px!important;height:82px!important}
 #campaign-dialog[data-scenery="bus"] .scene-party{margin-top:105px;width:72%;gap:8px}
 #campaign-dialog[data-scenery="bus"] .scene-player{width:72px;max-width:72px}
 #campaign-dialog[data-scenery="bus"] .scene-player .role-portrait{width:58px!important;height:64px!important}
 #campaign-dialog[data-scenery="bus"] #campaign-board{gap:8px;padding:12px 8px}
 #campaign-dialog[data-scenery="bus"] .bus-card{font-size:16px}
 #campaign-dialog[data-scenery="bus"] #campaign-actions>button{min-width:110px;font-size:10px}
}
