/* Map discoveries: one timed lifecycle for every POI, independent of camera pans. */
.world-poi{pointer-events:auto;cursor:pointer;clip-path:none;-webkit-tap-highlight-color:transparent}
.actor-body{position:absolute;inset:0;display:block;transform-origin:50% 95%}
.poi-tether{position:absolute;left:50%;bottom:0;height:1px;background:#7b714bb0;transform-origin:0 50%;pointer-events:none}
.world-poi .actor-label{bottom:-13px;font-size:9px;min-width:25px;white-space:nowrap}
.poi-timer{position:absolute;bottom:-31px;left:50%;transform:translateX(-50%);background:#142727e8;border:1px solid #c4ae7966;border-radius:5px;padding:1px 5px;color:#f0dfb7;white-space:nowrap;font:10px/14px system-ui;font-variant-numeric:tabular-nums;pointer-events:none}
.poi-timer.expiring,[data-poi-expires].expiring{color:#ffd29b;border-color:#d69a64}
.world-place{height:48px;width:64px}.world-place .actor-label{bottom:-12px}
.poi-emblem{display:grid;place-items:center;position:absolute;left:10px;bottom:0;width:44px;height:44px;border-radius:50%;border:2px solid #cdb778;background:radial-gradient(#3a4740,#14282a);box-shadow:0 3px 8px #0005;color:#e3c885;font:24px/1 Georgia}
[data-poi-type="dungeon"] .poi-emblem{border-color:#b095c5;color:#d7b6ea}
[data-poi-type="mini"] .poi-emblem{border-color:#94b8d8;color:#bad4ee}
.world-place:focus-visible,.world-enemy:focus-visible{outline:2px solid #ffe4a2;outline-offset:3px;border-radius:20px}
.poi-puff{position:absolute;left:50%;bottom:25px;width:0;height:0;pointer-events:none;display:none;z-index:3}
.poi-puff i{position:absolute;width:34px;height:28px;left:-17px;top:-14px;border-radius:50%;background:radial-gradient(ellipse at 35% 30%,#e5d8bbef 0,#b8beaac9 45%,#a9bbaa00 73%);--x:-36px;--y:-24px;opacity:0}
.poi-puff i:nth-child(2){--x:33px;--y:-25px;width:41px;height:32px}
.poi-puff i:nth-child(3){--x:-18px;--y:-55px;width:37px;height:37px}
.poi-puff i:nth-child(4){--x:17px;--y:-49px}
.poi-puff i:nth-child(5){--x:47px;--y:4px;width:29px;height:24px}
.poi-puff i:nth-child(6){--x:-46px;--y:4px}
.poi-puff i:nth-child(7){--x:0px;--y:10px;width:43px;height:25px}
.poi-puff b{position:absolute;left:-22px;top:4px;width:44px;height:13px;border:2px solid #efdb9866;border-radius:50%;opacity:0}
.is-arriving .poi-puff,.is-leaving .poi-puff{display:block}
.is-arriving .poi-puff i{animation:puff-arrive 700ms ease-out both}
.is-leaving .poi-puff i{animation:puff-depart 700ms ease-out both}
.is-arriving .poi-puff b,.is-leaving .poi-puff b{animation:puff-ring 650ms ease-out both}
.is-arriving .actor-body{animation:poi-arrive 580ms ease-out both}
.is-leaving .actor-body{animation:poi-depart 330ms ease-in both}
@keyframes puff-arrive{0%{opacity:0;transform:scale(.2)}18%{opacity:.95}100%{opacity:0;transform:translate(var(--x),var(--y)) scale(1.4)}}
@keyframes puff-depart{0%{opacity:0;transform:scale(.4)}22%{opacity:.85}100%{opacity:0;transform:translate(var(--x),var(--y)) scale(1.6)}}
@keyframes puff-ring{15%{opacity:.7;transform:scale(.5)}100%{opacity:0;transform:scale(2.5)}}
@keyframes poi-arrive{0%,12%{opacity:0;transform:scale(.45)}70%{opacity:1;transform:scale(1.06)}100%{opacity:1;transform:scale(1)}}
@keyframes poi-depart{to{opacity:0;transform:scale(.55)}}

.encounter-resume{position:absolute;z-index:3;left:50%;transform:translateX(-50%);bottom:105px;width:min(460px,calc(100% - 28px));display:flex;align-items:center;justify-content:space-between;gap:12px;background:#192b2bf5;border:1px solid #d8b77a;border-radius:14px;padding:11px 13px;box-shadow:0 5px 22px #0004}
.encounter-resume>div{min-width:0}.encounter-resume strong{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:400}
.encounter-resume small{font:9px system-ui;letter-spacing:1px;color:var(--gold)}.encounter-resume span{display:block;font:11px system-ui;color:#c0cabc}.encounter-resume button{flex-shrink:0;padding:10px;font:12px system-ui}
/* Gonelands: large shared stage, small action dock, menus over the stage. */
dialog.combat-view{width:min(940px,calc(100% - 24px));height:min(850px,calc(100dvh - 24px));max-height:calc(100dvh - 24px);padding:12px;overflow:hidden;background:linear-gradient(145deg,#25362f,#111f20)}
.combat-view>.sheet-top{height:26px;margin:0 0 6px}.combat-view #closeSheet{font:12px system-ui;padding:5px 10px}
.combat-view #sheetContent{height:calc(100% - 32px);min-height:0}
.battle-layout{height:100%;display:grid;grid-template-rows:auto minmax(0,1fr) auto auto;gap:6px;min-height:0}
.combat-heading{display:flex;align-items:center;gap:10px;min-height:48px;padding:0 4px}
.combat-heading>div{flex:1;min-width:0}.combat-heading small{font:11px system-ui;display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.combat-heading strong{font:600 17px/1.5 system-ui;display:block;color:#c7d1c3}.combat-heading.my-turn strong{color:#ffe0a2}
.turn-clock{display:grid;place-items:center;min-width:40px;height:40px;border-radius:50%;border:2px solid #d5b57a;background:#383322;font:bold 12px system-ui;color:#ffe7b6;font-variant-numeric:tabular-nums}.turn-clock.urgent{background:#6b3025;border-color:#e4a36b}
.history-button{height:42px;min-width:42px;padding:4px;font-size:23px;background:#172b27}
.battle-stage{position:relative;min-height:0;display:flex;flex-direction:column;background-image:linear-gradient(#10201935,#10201975),var(--battle-ground);background-size:cover;background-position:center;border:1px solid #89764f;border-radius:14px;overflow:hidden;padding:8px 12px;box-shadow:inset 0 0 40px #08171780}
.initiative{display:flex;justify-content:center;gap:4px;min-height:22px;flex:none;overflow:hidden;white-space:nowrap}
.initiative span{font:9px/16px system-ui;background:#142422c9;border:1px solid #c9b68933;border-radius:15px;padding:1px 8px;overflow:hidden;text-overflow:ellipsis}
.initiative .current{color:#ffe2a1;border-color:#d9b45b}
.opponent-line,.ally-line{display:flex;align-items:end;justify-content:center;flex:1;min-height:0;gap:8px;padding:6px 0}
.ally-line{flex:1.1;padding-top:12px}
.combatant{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:end;gap:2px;width:160px;max-width:100%;height:100%;max-height:245px;min-width:0;padding:0 4px;border:0;background:transparent!important;text-align:center;flex-shrink:1;isolation:isolate}
.combatant .battle-sprite{width:100%;height:auto;min-height:25px;max-height:185px;flex:1;filter:drop-shadow(0 3px 3px #03100ca0)}
.combatant.opponent .battle-sprite{max-height:205px}
.combatant strong{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font:600 11px/16px system-ui;color:#f3e5c9;padding:1px 6px;border-radius:4px;background:#14221cda;flex-shrink:0}
.combatant small{font:10px/13px system-ui;color:#ede9dc;text-shadow:0 1px 4px #000;white-space:nowrap;flex-shrink:0}
.combatant .figure-ground{position:absolute;bottom:63px;left:25%;right:25%;height:12px;background:#06130b90;border-radius:50%;z-index:-1}
.combatant.opponent .figure-ground{bottom:42px}
.combatant.active .figure-ground{outline:1px solid #f0cf70;box-shadow:0 0 14px #ffcf6377;background:#bea45255}
.combatant.active strong{color:#ffe39b;border:1px solid #d1b77866}
.combatant.fallen{opacity:.48}.battle-bar{width:72%;height:6px;background:#0e1c18b0;border:1px solid #b5a58080;border-radius:4px;overflow:hidden;flex-shrink:0}
.battle-bar i{display:block;height:100%;background:linear-gradient(#b3c496,#6f9a6b)}.opponent .battle-bar i{background:linear-gradient(#d69883,#ad6059)}.battle-bar.mana{height:4px;border-color:#6b8d9877}.battle-bar.mana i{background:#73b6cb}
.battle-caption{font:10px/17px system-ui;margin:5px 0 0;padding:3px 7px;background:#14251dc9;color:#e0d9c1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;border-radius:4px;min-height:23px;flex-shrink:0}
.combat-dock{position:relative;background:linear-gradient(150deg,#334132,#142923);border:1px solid #9d875b;border-radius:14px;padding:5px;z-index:3}
.combat-dock .action-tabs{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:5px;margin:0}
.action-orb{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1px;min-height:78px;padding:4px 0!important;border:1px solid transparent;border-radius:10px;background:radial-gradient(ellipse,#c5b37f24,#0b211b80);font:11px system-ui!important}
.action-orb:hover,.action-orb.chosen{border-color:#d7bd7d;background:#baaa6f25}
.action-orb small{font:9px/14px system-ui;color:#bac6b0}
.action-art{display:block;width:41px;height:41px;background:url('/assets/art/combat-actions.webp') no-repeat;background-size:400% 200%;background-position:var(--action-position);filter:drop-shadow(0 2px 3px #0007);flex-shrink:0}
.action-hint{display:block;text-align:center;font:10px/14px system-ui;margin-top:4px;color:#c5ccb6}
.combat-dock>p{font:12px system-ui;margin:5px 4px 8px;color:#d5dfc1}
.combat-sheet{position:absolute;bottom:calc(100% + 8px);left:0;right:0;max-height:min(330px,46dvh);overflow:auto;overscroll-behavior:contain;padding:10px;border:1px solid #bba06a;border-radius:14px;background:linear-gradient(140deg,#2e3d2efb,#132520fa);box-shadow:0 -10px 25px #0006;scrollbar-width:thin}
.combat-sheet>header{display:flex;align-items:center;justify-content:space-between;gap:8px;height:38px;margin-bottom:5px}.combat-sheet>header strong{font:16px Georgia;color:#e8d4a5}.combat-sheet>header button{min-width:38px;height:38px;padding:0;background:transparent;border:0;font-size:26px}
.combat-sheet>p{font:13px/1.6 system-ui}.ability-deck{display:flex;gap:8px;overflow:auto;scroll-snap-type:x proximity;padding-bottom:4px}
.ability-card{display:flex;flex:1 0 100px;min-width:0;flex-direction:column;align-items:center;gap:6px;scroll-snap-align:start;padding:8px 6px;background:#20382b}
.ability-card strong{font:12px/16px system-ui;color:#e6d2a9}.ability-card span:not(.action-art){font:11px/16px system-ui;color:#cbd1c0}.ability-card small{font:10px/15px system-ui;color:#f1d5a3}.ability-card:disabled{opacity:.6}
.battle-history p{padding:6px 0;margin:0;border-bottom:1px solid #ffffff14;font:12px/1.6 system-ui;color:#d6decf}
.battle-inspect{display:flex;justify-content:space-around;gap:10px;margin:10px 0 16px;font:12px system-ui}.battle-inspect b{display:block;font:25px Georgia;color:#ecd49b}
.battle-footer{display:flex;justify-content:space-between;gap:10px}.battle-footer button{padding:7px 8px;background:transparent;border:0;font:11px/18px system-ui;color:#c9b98e;min-height:34px}
.damage-number{position:absolute;left:50%;top:25%;transform:translateX(-50%);font:bold 25px system-ui;color:#ffe3b4;text-shadow:0 2px 4px #2c1309;pointer-events:none;animation:damage-rise 850ms ease-out both;z-index:8}
@keyframes damage-rise{0%{opacity:0;transform:translate(-50%,10px) scale(.7)}20%{opacity:1;transform:translate(-50%,-2px) scale(1.15)}100%{opacity:0;transform:translate(-50%,-38px) scale(1)}}
body[data-busy="true"] .combat-dock [data-move]{pointer-events:none;opacity:.5}
@media(max-width:700px){dialog.combat-view{width:100%;height:100dvh;max-height:100dvh;max-width:100%;margin:0;border-radius:0;border:0;padding:8px 10px max(6px,env(safe-area-inset-bottom))}.world-place{width:64px}.battle-stage{padding:6px}.combat-heading strong{font-size:15px}.encounter-resume{bottom:calc(94px + env(safe-area-inset-bottom))}.ally-line{gap:2px}.combatant{padding-inline:1px}.combatant strong{font-size:10px}.ally-line .combatant{max-width:calc(100% / var(--party-size))}}
@media(max-height:650px){.combat-heading{min-height:40px}.combat-heading strong{font-size:14px}.action-orb{min-height:61px}.action-art{width:30px;height:30px}.battle-layout{gap:4px}.combatant small{font-size:9px;line-height:11px}.combatant strong{font-size:9px;line-height:12px}.initiative{min-height:18px}.battle-caption{font-size:9px;min-height:18px;padding:1px 4px}.battle-footer button{min-height:28px;padding:4px}.combat-sheet{max-height:50dvh}}
@media(orientation:landscape) and (max-height:500px){.battle-layout{grid-template-columns:minmax(0,1fr) 230px;grid-template-rows:42px minmax(0,1fr) 32px}.combat-heading{grid-column:1/-1}.battle-stage{grid-row:2/4}.combat-dock{grid-column:2;align-self:end}.battle-footer{grid-column:2}.combat-dock .action-tabs{grid-template-columns:repeat(2,1fr)}.opponent-line,.ally-line{flex:1}.battle-stage{display:grid;grid-template-columns:1fr 1fr;grid-template-rows:20px minmax(0,1fr) 20px}.initiative,.battle-caption{grid-column:1/-1}.ally-line{grid-column:1;grid-row:2;padding-top:0}.opponent-line{grid-column:2;grid-row:2}.combat-sheet{max-height:65dvh}.ability-deck{flex-direction:column}.ability-card{flex-basis:auto}}
@media(prefers-reduced-motion:reduce){.poi-puff{display:none!important}.is-arriving .actor-body{opacity:1;transform:none}.is-leaving .actor-body{opacity:0}.damage-number{animation:none;opacity:1}.encounter-resume{scroll-behavior:auto}}
/* Continuous meter changes begin on the hit/cast, while the scene stays mounted. */
.battle-bar{height:9px}.battle-bar.mana{height:6px}.battle-bar i{transition:width 550ms cubic-bezier(.2,.6,.3,1);box-shadow:0 0 6px #dbe8a655}.battle-bar.instant i{transition:none}
.battle-banner{position:absolute;z-index:9;left:0;right:0;top:37%;display:flex;flex-direction:column;align-items:center;gap:5px;padding:16px 8px;background:linear-gradient(90deg,#13251c00,#14251ded 20%,#14251ded 80%,#13251c00);text-align:center;pointer-events:none;animation:battle-banner-in 600ms ease-out both}
.battle-banner>span{font:27px Georgia;color:#f0d18a}.battle-banner strong{font:28px Georgia;letter-spacing:1px;color:#f2dfb0}.battle-banner small{font:11px system-ui;color:#d7d9c5}.battle-banner[data-kind="lost"] strong{color:#e1a18c}
[data-sequence="intro"] .ally .battle-sprite{animation:hero-enter 1500ms ease-out both}[data-sequence="intro"] .opponent .battle-sprite{animation:enemy-enter 1500ms ease-out both}
[data-sequence="outro"] .battle-stage{box-shadow:inset 0 0 60px #e4c56b33;transition:box-shadow 1s}
body[data-busy="true"] .combat-dock [data-action="next"]{pointer-events:none;opacity:.5}
@keyframes hero-enter{from{opacity:0;transform:translateX(-38px)}70%,to{opacity:1;transform:translateX(0)}}
@keyframes enemy-enter{from{opacity:0;transform:translateX(38px)}70%,to{opacity:1;transform:translateX(0)}}
@keyframes battle-banner-in{from{opacity:0;transform:scale(.92)}to{opacity:1;transform:scale(1)}}
@media(prefers-reduced-motion:reduce){.battle-bar i{transition:none}.battle-banner,[data-sequence="intro"] .battle-sprite{animation:none!important}}
