/* Approved arena-first composition. Artwork and combat simulation remain separate. */
@font-face{font-family:AtlasDisplay;src:url('./assets/cinzel-beta.ttf') format('truetype');font-display:swap}
body.world-game.edge-to-edge-map .app.immersive:has(.battle-atlas) .event-sheet:has(.battle-atlas),
body.world-game.edge-to-edge-map .autobattle-result-sheet:has(.battle-atlas){
  inset:max(18px,env(safe-area-inset-top)) auto auto 50%;transform:translateX(-50%);
  width:min(1640px,calc(100vw - 40px));max-width:none;max-height:calc(100dvh - 36px - env(safe-area-inset-top));
  padding:0;border:0;border-radius:0;background:transparent;box-shadow:none;overflow:auto;
  scrollbar-color:#92703c #f6e7c7;scrollbar-width:thin;overscroll-behavior:contain;touch-action:pan-y;
}
body.autobattle-open:has(.battle-atlas) .app.immersive::before{background:#08130b3d}
.battle-atlas{--auto-ink:#183b30;--auto-muted:#60563e;--auto-bronze:#92703c;--auto-blood:#ca483d;--auto-ground:#f6e7c7;overflow:visible;color:var(--auto-ink)}
.battle-atlas .auto-arena-shell{position:relative;isolation:isolate;padding:12px;background:transparent}
.battle-atlas .auto-arena-shell::after{content:"";position:absolute;inset:0;z-index:12;border:24px solid transparent;border-image:url('./assets/light-atlas-v1/resource-plaque.webp') 95 115 / 28px / 0 stretch;pointer-events:none}
.battle-atlas .auto-stage{height:clamp(480px,calc(100dvh - 115px),830px);overflow:hidden;border-radius:22px;background:#423725}
.battle-atlas .auto-backdrop{object-position:center 65%}
.battle-atlas .auto-stage-shade{background:linear-gradient(180deg,#1118090d 40%,#11180940 100%)}
.battle-atlas .auto-header{position:absolute;left:24px;top:4px;z-index:14;background:none;padding:0;pointer-events:none}
.battle-atlas .auto-title{display:flex;align-items:center;flex-direction:column;max-width:min(380px,calc(100vw - 90px));pointer-events:auto}
.world-game .app.immersive .event-sheet .battle-atlas h2,.battle-atlas h2{
  color:#183b30;font-family:AtlasLoot,Georgia,serif;font-weight:700;font-size:clamp(28px,3vw,44px);letter-spacing:0;line-height:1.1;
  padding:13px 28px 15px;margin:0;text-align:center;border:12px solid transparent;border-image:url('./assets/light-atlas-v1/resource-plaque.webp') 100 120 fill / 18px / 0 stretch;
}
.battle-atlas .enemy-info-button{min-height:44px;padding:5px 20px;margin-top:-7px;border:8px solid transparent;border-image:url('./assets/light-atlas-v1/resource-plaque.webp') 100 120 fill / 10px / 0 stretch;background:none;color:#183b30;font:600 14px/1.25 Georgia,serif;position:relative}
.battle-atlas .enemy-info-button::after{content:"";display:inline-block;width:7px;height:7px;border-right:1.5px solid currentColor;border-bottom:1.5px solid currentColor;rotate:45deg;margin:0 0 3px 12px}
.battle-atlas .enemy-info-button[aria-expanded=true]::after{rotate:225deg;margin-bottom:-1px}
.battle-atlas .auto-figure{top:34%;bottom:17%;width:20%;isolation:auto}
.battle-atlas .auto-figure[data-slot="0"]{left:3%;width:20%}
.battle-atlas .auto-figure[data-slot="1"]{left:23%;width:20%}
.battle-atlas .auto-figure[data-slot="2"]{left:43%;width:20%}
.battle-atlas .auto-figure.auto-foe{left:74%;top:34%;width:23%}
.battle-atlas[data-party-count="2"] .auto-figure[data-slot="0"]{left:7%;width:22%}
.battle-atlas[data-party-count="2"] .auto-figure[data-slot="1"]{left:31%;width:22%}
.battle-atlas[data-party-count="1"] .auto-figure[data-slot="0"]{left:22%;width:25%}
.battle-atlas .auto-figure-visual{top:0}
.battle-atlas .auto-unit-hud{position:absolute;left:2%;right:2%;top:-18%;bottom:auto;z-index:9;display:flex;flex-direction:column;align-items:center;gap:5px;pointer-events:none}
.battle-atlas .auto-foe .auto-unit-hud{top:-35%}
.battle-atlas .auto-vitals{display:flex;align-items:center;gap:8px;width:100%;padding:3px 5px;border-radius:8px;background:#152019d9}
.battle-atlas .auto-health-track{flex:1;height:13px;min-width:24px;border:2px solid #d7b572;border-radius:10px;margin:0;background:#241c16;box-shadow:inset 0 1px 2px #08090766}
.battle-atlas .auto-health-track>span{background:#cf4f40;border-top:2px solid #ef8770;border-radius:6px}
.battle-atlas .auto-hp-number{font:600 clamp(13px,1.35vw,20px)/1.15 Georgia,serif;color:#fff5db;font-variant-numeric:tabular-nums;white-space:nowrap}
.battle-atlas .auto-hp-number small{font:inherit;font-size:.85em;color:#f2e4c8}
.battle-atlas .auto-class-label,.battle-atlas .auto-enemy-name{color:#183b30;font:600 clamp(12px,1.15vw,16px)/1.25 Georgia,serif;text-align:center;max-width:100%;padding:4px 13px;border:6px solid transparent;border-image:url('./assets/light-atlas-v1/resource-plaque.webp') 100 120 fill / 8px / 0 stretch;overflow-wrap:anywhere}
.battle-atlas .auto-enemy-name{font-size:clamp(14px,1.45vw,21px);padding:6px 16px}
.battle-atlas .auto-unit-effects{overflow:auto;max-height:56px;width:100%;gap:5px;justify-content:safe center;flex-wrap:nowrap;padding:1px 2px;pointer-events:auto;scrollbar-width:thin;scrollbar-color:#92703c transparent;touch-action:pan-x}
.battle-atlas .auto-effect-badge{position:relative;min-width:44px;min-height:44px;padding:5px;border:2px solid #d2ad67;border-radius:50%;background:#203a29;color:#ffe3a3;gap:2px;font-size:12px;box-shadow:0 3px 5px #0c110d55}
.battle-atlas .auto-effect-badge svg{width:19px;height:19px}
.battle-atlas .auto-effect-badge{flex-shrink:0}
.battle-atlas .auto-effect-badge small{border:0;padding:0;font-size:9px;color:inherit}
.battle-atlas .auto-effect-badge.is-debuff{color:#ffe0d2;background:#493024}
.battle-atlas .auto-effect-badge[data-effect-type*="poison"]{color:#d1ee94;background:#203d29}
.battle-atlas .auto-effect-badge[data-effect-type*="bleed"]{color:#ffcab6;background:#552b25}
.battle-atlas .auto-effect-badge:hover{background:#395a39}
.battle-atlas .auto-inspect-hitbox{inset:24% 0 0;z-index:7}
.battle-atlas .auto-inspect-hitbox>span{display:none}
.battle-atlas .auto-inspect-hitbox[aria-expanded=true]{outline:0}
.battle-atlas .auto-impact{top:38%;z-index:10;font-size:clamp(28px,3.4vw,48px);font-family:Georgia,serif}
.battle-atlas .auto-impact:is(.critical,.miss){background:none;padding:0;text-shadow:0 3px 7px #140902}
.battle-atlas .auto-poison-status{top:16%;max-width:24%;background:#203a29}
.battle-atlas .auto-action-readout{position:absolute;z-index:14;left:50%;bottom:19px;translate:-50% 0;width:max-content;max-width:calc(100% - 70px);min-width:260px;min-height:66px;
  display:flex;justify-content:center;gap:13px;align-items:center;padding:9px 34px;border:12px solid transparent;border-image:url('./assets/light-atlas-v1/resource-plaque.webp') 100 120 fill / 17px / 0 stretch;background:none;text-align:center}
.battle-atlas .auto-action-readout>strong{color:#183b30;font:600 clamp(16px,1.5vw,23px)/1.3 Georgia,serif;text-wrap:balance}
.battle-atlas .auto-action-amount{color:#813e27;font:600 clamp(16px,1.5vw,23px)/1.3 Georgia,serif;white-space:nowrap}
.battle-atlas .auto-action-readout.is-heal .auto-action-amount{color:#28633d}
.battle-atlas .auto-detail-control{padding:0 18px;background:none}
.battle-atlas .auto-details-toggle{padding:8px 16px;min-height:44px;color:#183b30;background:#f6e7c7;border:1px solid #92703c;border-radius:6px;font:600 14px/1.3 Georgia,serif}
.battle-atlas :is(button,a):focus-visible{outline:3px solid #fff2ae;outline-offset:3px}
.battle-atlas :is(.auto-fighter-inspector,#auto-battle-details),.battle-atlas .auto-result{color:#183b30;background:#f6e7c7 url('./assets/light-atlas-v1/vellum.webp');border:1px solid #92703c;border-radius:10px;margin:10px 16px}
.battle-atlas .auto-fighter-inspector{max-height:min(450px,60dvh);overflow:auto;overscroll-behavior:contain;touch-action:pan-y}
.edge-to-edge-map .battle-atlas .auto-fighter-inspector>header{background:#f6e7c7;z-index:1;top:-20px;border-bottom-color:#b9a16d}
.battle-atlas .auto-fighter-inspector :is(h3,strong,p,span,li),.battle-atlas #auto-battle-details :is(h3,strong,p,span,li){color:#183b30;text-shadow:none}
.battle-atlas .auto-fighter-inspector>header p:not(.auto-identity){color:#60563e}
.battle-atlas :is(.auto-healing-budget,.auto-abilities span,.auto-enemy-note,.auto-journal li,.auto-member-name,.auto-effect-details li){color:#60563e}
.battle-atlas .auto-fighter-inspector>header button,.battle-atlas .auto-continue{color:#fff2d2;background:#234b3a;border:1px solid #92703c;border-radius:7px;min-height:44px}
.battle-atlas .auto-fighter-inspector>header button:hover,.battle-atlas .auto-continue:hover{background:#326449}
.battle-atlas .auto-result p{color:#183b30}
.battle-atlas .auto-artifact-effects{padding:12px 28px;color:#60563e}
.battle-atlas .auto-effect-details,.battle-atlas .auto-fighter-inspector .auto-signature,.battle-atlas .auto-journal{border-color:#b9a16d}
.battle-atlas .auto-fighter-inspector :is(button,a):focus-visible,.battle-atlas #auto-battle-details :is(button,a):focus-visible{outline-color:#21634d}
.battle-atlas .auto-detail-control .auto-details-toggle:focus-visible{outline-color:#fff2ae}
/* The completed arena has one next step; rewards are not a second report page. */
.battle-atlas .auto-result--atlas{display:flex;flex-direction:column;align-items:center;gap:10px;padding:14px 20px 16px;background:#14271f;border:1px solid #bfa063;border-radius:12px;text-align:center;color:#fff2d2}
.battle-atlas .auto-result-rewards{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:10px 28px;list-style:none;margin:0;padding:0}
.battle-atlas .auto-result-rewards .auto-reward{display:flex;align-items:baseline;justify-content:center;gap:8px;padding:0;margin:0;min-width:0}
.battle-atlas .auto-result-rewards .icon{align-self:center;width:22px;height:22px;flex:none;color:#e4c68d;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
.battle-atlas .auto-result--atlas p{color:#dce4cc;max-width:54ch;text-wrap:balance}
.battle-atlas .auto-result--atlas .auto-continue{box-sizing:border-box;flex:none;width:min(100%,280px);min-height:56px;padding:10px 26px;border:3px double #94713d;border-radius:12px;background:linear-gradient(#f5dfa9,#e4c68d);color:#183b30;text-align:center;white-space:normal;box-shadow:none;cursor:pointer;transition:background-color 150ms ease-out}
.battle-atlas .auto-result--atlas .auto-continue:hover{background:#f5dfa9}
.battle-atlas .auto-result--atlas .auto-continue:active{background:#d9b574}
.battle-atlas .auto-result--atlas .auto-continue:disabled{background:#b9ad8d;color:#394332;border-color:#8a7958;cursor:default;opacity:1}
.battle-atlas .auto-result--atlas ::selection{background:#e4c68d;color:#14271f}
@media(max-width:900px) and (min-width:601px){.battle-atlas .auto-stage{height:clamp(460px,76dvh,680px)}.battle-atlas .auto-figure-visual{top:12%}.battle-atlas .auto-unit-effects{gap:2px}.battle-atlas .auto-effect-badge{min-width:44px;min-height:44px}}
@media(max-width:600px){
  body.world-game.edge-to-edge-map .app.immersive:has(.battle-atlas) .event-sheet:has(.battle-atlas),body.world-game.edge-to-edge-map .autobattle-result-sheet:has(.battle-atlas){top:max(8px,env(safe-area-inset-top));width:calc(100vw - 12px);max-height:calc(100dvh - 16px - env(safe-area-inset-top))}
  .battle-atlas .auto-arena-shell{padding:8px}.battle-atlas .auto-arena-shell::after{border-image-width:18px}
  .battle-atlas .auto-stage{height:clamp(490px,calc(100svh - 90px),690px);border-radius:14px}
  .battle-atlas .auto-header{top:1px;left:12px;right:12px;justify-content:center}
  .battle-atlas .auto-title{max-width:100%}
  .world-game .app.immersive .event-sheet .battle-atlas h2,.battle-atlas h2{font-size:23px;padding:8px 15px;border-width:8px;border-image-width:12px}
  .battle-atlas .enemy-info-button{font-size:12px;min-height:44px;margin-top:-3px}
  .battle-atlas .auto-figure,.battle-atlas .auto-figure[data-slot],.battle-atlas[data-party-count] .auto-figure[data-slot]{top:58%;bottom:13%;width:30%}
  .battle-atlas .auto-figure[data-slot="0"],.battle-atlas[data-party-count] .auto-figure[data-slot="0"]{left:2%}
  .battle-atlas .auto-figure[data-slot="1"],.battle-atlas[data-party-count] .auto-figure[data-slot="1"]{left:35%}
  .battle-atlas .auto-figure[data-slot="2"]{left:68%}
  .battle-atlas[data-party-count="2"] .auto-figure[data-slot="0"]{left:13%;width:33%}
  .battle-atlas[data-party-count="2"] .auto-figure[data-slot="1"]{left:55%;width:33%}
  .battle-atlas[data-party-count="1"] .auto-figure[data-slot="0"]{left:33%;width:34%}
  .battle-atlas .auto-figure.auto-foe{left:32%;top:20%;bottom:52%;width:36%}
  .battle-atlas .auto-figure-visual{top:8%}
  .battle-atlas .auto-unit-hud{left:0;right:0;top:auto;bottom:65%;gap:2px}
  .battle-atlas .auto-foe .auto-unit-hud{top:auto;bottom:63%}
  .battle-atlas .auto-enemy-name{display:none}
  .battle-atlas .auto-vitals{display:grid;gap:3px;justify-items:center;padding:4px}
  .battle-atlas .auto-health-track{width:100%;height:10px;min-width:0}
  .battle-atlas .auto-hp-number{font-size:13px}
  .battle-atlas .auto-class-label{font-size:11px;line-height:1.2;border-width:3px;border-image-width:5px;padding:3px 6px;min-height:25px;max-width:100%}
  .battle-atlas .auto-unit-effects{flex-wrap:nowrap;justify-content:flex-start;max-height:50px;padding:1px 0;gap:2px;overflow:auto}
  .battle-atlas .auto-effect-badge{flex-shrink:0;min-width:44px;min-height:44px;padding:3px}
  .battle-atlas .auto-effect-badge svg{width:16px;height:16px}
  .battle-atlas .auto-action-readout{min-width:0;width:max-content;min-height:51px;max-width:calc(100% - 32px);bottom:10px;padding:6px 17px;border-width:9px;border-image-width:12px;gap:8px}
  .battle-atlas .auto-action-readout>strong,.battle-atlas .auto-action-amount{font-size:15px}
  .battle-atlas .auto-detail-control{padding:0 12px}
  .battle-atlas .auto-poison-status{top:21%;right:5%;max-width:30%;font-size:10px}
  .battle-atlas :is(.auto-fighter-inspector,#auto-battle-details,.auto-result){margin:8px}
  .battle-atlas .auto-fighter-inspector .auto-abilities{grid-template-columns:1fr}
}
@media(max-height:500px) and (min-width:601px){
  .battle-atlas .auto-stage{height:calc(100dvh - 86px);min-height:280px}
  .battle-atlas .auto-figure{top:46%;bottom:15%}.battle-atlas .auto-figure.auto-foe{top:46%}.battle-atlas .auto-figure-visual{top:0}.battle-atlas .auto-unit-hud{top:-25%;bottom:auto}.battle-atlas .auto-foe .auto-unit-hud{top:-52%}
  .world-game .app.immersive .event-sheet .battle-atlas h2,.battle-atlas h2{font-size:23px;padding:8px 18px;border-width:8px}
  .battle-atlas .auto-action-readout{min-height:45px;padding:3px 24px;bottom:10px}
}
.battle-atlas.is-complete .auto-stage{height:clamp(320px,calc(100dvh - 258px),700px)}
.battle-atlas.is-complete .auto-impact{display:none}
.battle-atlas.is-complete .auto-title{max-width:min(480px,calc(100vw - 56px))}
.world-game .app.immersive .event-sheet .battle-atlas.is-complete h2,.battle-atlas.is-complete h2{font-size:clamp(26px,2.6vw,38px)}
@media(max-width:600px){
  .battle-atlas .auto-result--atlas{padding:12px;gap:8px}
  .battle-atlas .auto-result-rewards{gap:6px 18px}
  .battle-atlas .auto-result-rewards .auto-reward{gap:5px}
}
@media(prefers-reduced-motion:reduce){.battle-atlas .auto-result--atlas .auto-continue{transition:none}}
