.adventure-page {
  display: grid;
  grid-template-rows: auto minmax(360px, 1fr);
  min-block-size: 100%;
  padding: 9px max(12px, var(--safe-right)) 12px max(12px, var(--safe-left));
  gap: 9px;
  background: radial-gradient(ellipse at top, #494987, #101d43 72%);
  --training-ink: #252c63;
  --training-accent: #5445a5;
}
.world-board, .journey, .novel, .battle-arena {
  min-inline-size: 0;
  border: 1px solid #f3d79d;
  border-radius: 14px;
  box-shadow: 0 0 0 1px #c6c3f263, 0 4px 15px #151d46a1;
  background: #18254d;
  overflow: hidden;
}
.world-board {
  --shared-border-color: #ffdf97;
  --outlaw-border-color: #d9b7ff;
  display: grid;
  grid-template-rows: auto minmax(300px, 1fr) auto;
}
.world-page {
  background: radial-gradient(ellipse at 45% 0, #c8d2f0, #737fb2 30%, #212a51 77%);
}
.map-legend {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px 7px;
  padding: 5px;
  font-size: .61rem;
  font-weight: 800;
}
.map-legend :is(span, button) { display: inline-flex; align-items: center; gap: 2px; }
.map-legend button { min-block-size:44px; padding:0 3px; background:transparent; border:0; color:inherit; font:inherit; }
.map-legend button:focus-visible { outline-color:#ffe6a9; }
.map-legend img { width: 17px; height: 17px; object-fit: contain; background: #eae6ff; padding: 2px; border-radius: 50%; }
.legend-outlaw { color: #f3c1a9; }
.map-border-key {
  display: flex;
  flex: 1 0 100%;
  flex-wrap: wrap;
  justify-content: center;
  gap: 3px 14px;
  padding-block: 2px 4px;
  font-size: .66rem;
}
.map-border-key :is(.border-key-shared, .border-key-outlaw) { gap: 5px; }
.map-border-key span::before {
  content: '';
  inline-size: 15px;
  border-top: 2px solid var(--shared-border-color);
}
.map-border-key .border-key-outlaw::before { border-top: 2px dashed var(--outlaw-border-color); }
.map-viewport { position: relative; min-block-size: 0; }
.map-svg { display: block; position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; user-select: none; cursor: grab; }
.map-svg:active { cursor: grabbing; }
.map-road-border, .map-road, .map-road-line, .map-water-bank, .map-water, .map-water-ripple {
  fill: none;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.map-road-border { stroke: #5d564f; stroke-width: 16px; opacity: .64; }
.map-road { stroke: #d9c8a5; stroke-width: 12px; }
.map-road-line { stroke: #fff1d0; stroke-width: 1.6px; stroke-dasharray: 3 5; }
.map-water-bank { stroke: #386e75; stroke-width: 28px; }
.map-water { stroke: url(#world-water); stroke-width: 22px; }
.map-water-ripple { stroke: #c4f5ff; stroke-width: 1.9px; stroke-dasharray: 6 7 15 7; }
.tile-art, .map-border, .map-border-glow, .map-pin, .map-ribbon, .map-compass, .map-danger, .map-guide { pointer-events: none; }
.world-tile.map-foreign .tile-art { filter: brightness(.78); }
.map-ribbon.map-foreign { filter: brightness(.82) drop-shadow(0 3px 3px #12162c); }
.map-legend .map-foreign { opacity:.78; }
.tile-art text { text-anchor: middle; font-size: 11px; font-weight: 850; fill: #fff7dc; stroke: #333256; stroke-width: 3px; paint-order: stroke; }
.world-tile { cursor: pointer; outline: none; }
.tile-hit { fill: transparent; stroke: #f3e8cd70; stroke-width: 1.15px; }
[data-faction="outlaw"] .tile-hit { stroke: #9383ab77; }
.world-tile.edge-special .tile-hit { stroke: #ffdf69; stroke-width: 2.5px; }
.world-tile.edge-story .tile-hit { stroke: #fc7d76; stroke-width: 3.5px; }
.world-tile:is([aria-pressed="true"], :focus-visible) .tile-hit {
  fill: #fff1e737;
  stroke: #fff7e0;
  stroke-width: 3.5px;
  filter: drop-shadow(0 0 4px #ecb7e5);
}
.map-border, .map-border-glow { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.map-border-glow { stroke: #65c9ff; stroke-width: 8px; opacity: .85; filter: drop-shadow(0 0 6px #54b6ff); }
.map-border { stroke: #ebf8ff; stroke-width: 3.2px; }
.map-territory-borders { fill: none; stroke-linejoin: round; stroke-linecap: round; pointer-events: none; }
.territory-coast { stroke: #c8d8ef; stroke-width: 1.15px; opacity: .8; }
.territory-underlay { stroke: #201b35; stroke-width: 4.2px; }
.territory-shared { stroke: var(--shared-border-color); stroke-width: 2.1px; }
.territory-outlaw { stroke: var(--outlaw-border-color); stroke-width: 1.7px; stroke-dasharray: 3 2; stroke-linecap: butt; }
.map-ribbon text { text-anchor: middle; fill: #fff6df; font-size: 23px; font-weight: 850; }
.map-ribbon { filter: drop-shadow(0 3px 3px #12162c); }
.map-compass { position: absolute; inset: 9px auto auto 7px; width: 41px; height: 47px; }
.map-compass text { text-anchor: middle; fill: #fff0c4; font: 700 9px Georgia, serif; }
.map-danger text { text-anchor: middle; font-size: 20px; font-weight: 850; fill: #e9c3f0; stroke: #252143; stroke-width: 3px; paint-order: stroke; }
.map-danger text:last-child { font-size: 15px; }
.map-guide {
  position: absolute;
  inset: 13px auto auto 53px;
  margin: 0;
  padding: 4px 8px;
  border: 1px solid #b4bce15e;
  border-radius: 9px;
  background: #222b55d9;
  color: #e5ebff;
  font-size: .67rem;
  font-weight: 750;
}
.map-guide span { color: #e9c993; }
.map-viewport:has(.map-detail:not([hidden])) .map-guide { visibility: hidden; }
.map-pin ellipse { fill: #252a5b; opacity: .65; }
.map-pin path { fill: #d35059; stroke: #fff1d7; stroke-width: 2px; }
.map-pin path:last-child { fill: #fff7ca; stroke: none; }
.map-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  padding: 4px 6px;
  border-block-start: 1px solid #a7afd8;
}
.map-controls > span { min-inline-size: 0; overflow-wrap: anywhere; }
.map-controls small { display: block; color: #c9d8fd; font-size: .65rem; }
.map-controls strong { display: block; font-size: .82rem; }
.map-controls > div { display: flex; gap: 3px; }
.map-controls button, .battle-speed button {
  inline-size: 44px;
  min-block-size: 44px;
  padding: 0;
  border: 1px solid #aeb9e3;
  border-radius: 8px;
  background: #2e4177;
  color: #fff6dc;
  font-size: 1.1rem;
  font-weight: 800;
}
.map-controls button {
  border-color: #dcc696;
  border-radius: 50%;
  background: radial-gradient(ellipse at 40% 20%, #6e80c2, #2d3c76 68%);
  box-shadow: inset 0 0 0 1px #eef1ff3f;
}
.map-detail {
  position: absolute;
  inset: 7px 6px auto auto;
  inline-size: clamp(163px, 58%, 215px);
  max-block-size: calc(100% - 14px);
  overflow: auto;
  padding: 6px;
  border: 2px solid #e7c88f;
  border-radius: 12px;
  background: linear-gradient(#fcf6ec, #e7e7fa);
  box-shadow: inset 0 0 0 1px #fff, 0 3px 16px #0c1837bd;
  color: #212b58;
}
.map-preview-art { display: block; width: 100%; border: 1px solid #bda772; border-radius: 7px; }
.map-detail h2 {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 4px 0;
  padding: 4px;
  border: 1px solid #dfc48a;
  border-radius: 6px;
  background: linear-gradient(100deg, #273870, #515796);
  color: #fff9eb;
  font-size: .86rem;
  overflow-wrap: anywhere;
}
.map-detail h2 img { flex: none; width: 21px; height: 21px; padding: 2px; border-radius: 50%; background: #f4f3ff; }
.map-detail p, .map-detail small { margin: 3px 1px; font-size: .71rem; line-height: 1.45; }
.map-detail small { color: #4b4c7d; }
.map-detail-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; margin-block-start: 5px; }
.map-detail-actions button { min-block-size: 44px; padding: 3px; border: 1px solid #9eacd4; border-radius: 9px; background: #faf9ff; color: #25346a; font-size: .73rem; font-weight: 800; }
.map-detail-actions .primary { border-color: #b18b56; background: linear-gradient(#576db1, #314680); color: #fff; }

.adventure-landscape, .scene-outdoors {
  background:
    linear-gradient(180deg, #30345b22 38%, #182247bb),
    radial-gradient(ellipse at 61% 82%, #89b68b 26%, transparent 27%),
    radial-gradient(ellipse at 16% 95%, #7ea999 41%, transparent 42%),
    radial-gradient(ellipse at 85% 98%, #558689 43%, transparent 44%),
    linear-gradient(#526bb1, #c8d0ed 63%, #516e81);
}
.journey, .battle-arena { display: grid; grid-template-rows: auto minmax(170px, 1fr) auto; gap: 8px; padding: 10px; }
.journey-copy, .journey-footer, .battle-top, .attack-box {
  border: 1px solid #e4d5ae;
  border-radius: 10px;
  background: #192852e8;
  padding: 9px;
}
.journey-copy h2 { margin: 0; font-size: 1.28rem; }
.journey-copy small { color: #e2ddf1; }
.journey-track { position: relative; min-inline-size: 0; }
.journey-track::before {
  content: '';
  position: absolute;
  inset: auto 4% 20%;
  block-size: 9px;
  border-radius: 12px;
  background: #fae5b5a1;
  box-shadow: 0 4px 0 #648173;
}
.journey-partner { position: absolute; inset-block-end: 18%; inline-size: 31%; transform: translateX(-50%); }
.adventure-portrait { display: block; max-inline-size: 100%; object-fit: contain; filter: drop-shadow(0 5px 8px #17234682); }
.wild-portrait-retry { min-block-size: 44px; }
.novel > .wild-portrait-retry { grid-row: 1; place-self: center; }
.fighter .wild-portrait-retry { position: absolute; inset: 0; margin: auto; block-size: fit-content; z-index: 1; }
.portrait-rival { filter: sepia(.24) hue-rotate(61deg) saturate(1.4) drop-shadow(0 5px 8px #17234682); }
.portrait-guest { filter: brightness(.32) saturate(.4) drop-shadow(0 5px 8px #17234682); }
.journey-finish, .journey-alert {
  position: absolute;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 2px solid #fff0bf;
  box-shadow: 0 3px 9px #43336585;
}
.journey-finish { inset: auto 9% 22% auto; width: 35px; height: 35px; background: #4b4990; color: #ffedbf; }
.journey-alert { inset: -9px -9px auto auto; width: 42px; height: 42px; font-size: 1.5rem; font-weight: 900; background: #fff4d4; color: #912d47; }
.journey-progress { display: block; margin-block-start: 5px; width: 100%; accent-color: #ecbd76; }
.novel {
  display: grid;
  grid-template-rows: minmax(170px, 1fr) auto;
  align-items: end;
  padding: 10px;
  gap: 6px;
  background-color: #33446f;
}
.scene-room { background: linear-gradient(#575c9270, #172447a8), url('assets/room.png') center / cover; }
.scene-city { background: linear-gradient(#505f8c60, #212d58bb), repeating-linear-gradient(90deg, #778cae 0 30px, #aab8d1 31px 53px, #536c96 54px 70px); }
.scene-west { background: linear-gradient(150deg, #57507933, #282146ca), repeating-linear-gradient(-13deg, #ab858e 0 12px, #826b86 13px 17px); }
.scene-east { background: linear-gradient(150deg, #8ca98d, #304c68), repeating-linear-gradient(36deg, #aecb95 0 20px, #618e75 21px 29px); }
.novel > .adventure-portrait { place-self: end center; height: min(42dvh, 370px); }
.novel-text { padding: 10px; border: 2px solid #e9c992; border-radius: 10px; background: #192852f5; }
.novel-text h2 { margin: 0; color: #f9dc9e; font-size: 1.15rem; }
.novel-text p { margin: 8px 0; line-height: 1.5; }
.novel-text small { display: block; color: #d5cce8; margin-block-end: 5px; }
.adventure-shop { align-self: start; }
.country-gacha { --shop-accent:#78bcff; --shop-ink:#204b83; border-color:var(--shop-accent); }
.country-gacha[data-shop-country="noircrest"] { --shop-accent:#bc9ce6; --shop-ink:#563983; }
.country-gacha[data-shop-country="futahikari"] { --shop-accent:#9ed6a3; --shop-ink:#205a3e; }
.country-gacha header img { inline-size:26px; block-size:26px; padding:2px; background:#f9edff; border-radius:50%; vertical-align:middle; margin-inline-end:7px; }
.country-gacha h3 { color:var(--shop-ink); margin-block:14px 6px; }
.gacha-shop-name, .gacha-balance, .gacha-shortage { font-size:.78rem; }
.gacha-shop-name { color:#435477; }
.gacha-rates { margin:0; border:1px solid var(--line-soft); border-radius:7px; }
.gacha-rates > div { display:flex; align-items:baseline; justify-content:space-between; gap:8px; padding:7px 10px; font-size:.83rem; }
.gacha-rates > div + div { border-block-start:1px solid #ffffff26; }
.gacha-rates dd { margin:0; color:var(--shop-ink); font-weight:800; white-space:nowrap; }
.gacha-result { text-align:center; padding:10px 0; }
.gacha-result a { display:inline-flex; align-items:center; min-block-size:44px; text-decoration:underline; }
.gacha-prize-icon { display:grid; place-items:center; margin:4px auto; inline-size:clamp(62px, 21cqi, 98px); aspect-ratio:1; border:1px solid var(--shop-accent); border-radius:18px; background:radial-gradient(#364c74,#151f46); font-size:2rem; }
.gacha-prize-icon :is(img, .ui-icon) { inline-size:60%; block-size:auto; }
.adventure-shop p { margin-inline: 5px; }
.adventure-shop .controls { margin-block-start: 12px; color: white; }
.shop-stock { display: grid; gap: 7px; padding: 0; list-style: none; }
.shop-stock li {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  padding: 6px;
  border: 1px solid #b4b3e3;
  border-radius: 9px;
  background: #e6e3ff;
  overflow-wrap: anywhere;
}
.shop-stock small { display: block; }
.shop-stock .primary { color: white; }

.battle-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px; }
.battle-speed { display: flex; gap: 4px; }
.battle-speed button[aria-pressed="true"] { background: #6052a4; border-color: #ffe1a1; }
.battle-arena { background: linear-gradient(160deg, #6677a3, #263759 65%, #152742); }
.battle-stage { position: relative; display: grid; min-block-size: 0; }
.battle-lanes { display: grid; grid-template-rows: repeat(2, minmax(110px, 1fr)); gap: 5px; min-block-size: 0; }
@media (max-height: 650px) {
  .adventure-page:has(.battle-arena) { block-size: 100%; grid-template-rows: auto minmax(300px, 1fr); }
  .battle-arena { padding: 5px; gap: 4px; }
  .battle-lanes { grid-template-rows: repeat(2, minmax(90px, 1fr)); }
  .battle-top { padding: 4px; }
  .attack-box { min-block-size: 45px; }
  .adventure-page:has(.battle-arena[data-phase="done"]) { grid-template-rows: auto minmax(325px, 1fr); }
}
.battle-lane {
  position: relative;
  min-inline-size: 0;
  min-block-size: 0;
  overflow: hidden;
  border-radius: 9px;
  background: #315d58;
  isolation: isolate;
}
.battle-lane::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px #eddfb389, inset 0 0 26px 4px #13182a88;
}
.lane-landscape { position: absolute; inset: 0 auto 0 0; width: 144%; height: 100%; object-fit: cover; object-position: center 60%; }
.lane-0 .lane-landscape { left: auto; right: 0; transform: scaleX(-1); }
.lane-1 .lane-landscape { filter: brightness(.93) saturate(.93); }
.battle-site-scenery .battle-lane .lane-landscape {
  inset: 0;
  width: 100%;
  transform: none;
  object-position: center 31%;
}
.battle-site-scenery .lane-1 .lane-landscape { object-position: center 38%; }
.battle-site-scenery .fighter { top: 29%; height: 60%; }
.novel.novel-site-scenery {
  background: linear-gradient(#26335620, #18264499), var(--novel-backdrop) center 35% / cover;
}
.adventure-portrait[data-uncensored][data-wild-render] {
  filter: brightness(.84) saturate(.88) drop-shadow(-2px 0 #8b5becb0) drop-shadow(2px 1px #4ed3e7a6);
}
.battle-arena[data-outcome="win"] .adventure-portrait[data-uncensored][data-wild-render] {
  filter: brightness(.77) saturate(.74) drop-shadow(-2px 0 #8b5beca0);
}
.resident-crest {
  place-self: end center;
  padding: 12px;
  border: 1px solid #e2cdbd;
  border-radius: 50%;
  background: #f5eff6eb;
  box-shadow: 0 4px 24px #121b4373;
}
.resident-crest img { display: block; width: clamp(48px, 16vw, 76px); height: auto; }
.tile-preparing .tile-art { opacity: .48; }
.fighter { position: absolute; left: 5%; top: 22%; width: 32%; height: 56%; perspective: 600px; }
.lane-1 .fighter { left: auto; right: 5%; }
.fighter::before {
  content: '';
  position: absolute;
  inset: auto 22% -1%;
  height: 12%;
  background: radial-gradient(ellipse, #102827bc 3%, transparent 72%);
}
.fighter-label { position: absolute; z-index: 1; left: 5px; top: 4px; display: grid; justify-items: center; padding: 3px 6px; max-inline-size: 45%; border-radius: 7px; background: #142448eb; text-align: center; overflow-wrap: anywhere; }
.lane-1 .fighter-label { left: auto; right: 5px; }
.fighter-label strong { font-size: .83rem; }
.battle-hp { color: #ff8ea8; font-size: .96rem; letter-spacing: .05em; }
.fighter .adventure-portrait { inline-size: 100%; block-size: 100%; object-fit: contain; transform-origin: 50% 60%; backface-visibility: visible; }
.battle-shot, .battle-impact {
  --energy: #81bdff;
  --hot-core: #f5fbff;
  position: absolute;
  z-index: 2;
  opacity: 0;
  pointer-events: none;
}
[data-slot="A"]:is(.battle-shot, .battle-impact) { --energy: #ff5076; --hot-core: #fff3d1; }
[data-slot="B"]:is(.battle-shot, .battle-impact) { --energy: #48ebac; --hot-core: #f2ffe0; }
.battle-shot {
  width: 30px;
  height: 20px;
  background: radial-gradient(ellipse at 56% 50%, white 12%, var(--hot-core) 28%, var(--energy) 51%, transparent 72%);
  filter: drop-shadow(0 0 5px var(--energy));
}
.battle-shot::before, .battle-shot::after, .battle-shot i {
  content: '';
  position: absolute;
  right: 37%;
  top: 50%;
  transform: translateY(-50%);
  background: linear-gradient(90deg, transparent, var(--energy) 65%, var(--hot-core));
}
.battle-shot::before { width: 78px; height: 21px; clip-path: polygon(0 50%, 99% 8%, 100% 92%); }
.battle-shot::after { width: 57px; height: 3px; opacity: .95; }
.battle-shot i {
  width: 63px;
  height: 27px;
  clip-path: polygon(0 9%, 95% 32%, 96% 41%, 24% 25%, 32% 86%, 96% 57%, 100% 65%, 32% 94%, 24% 25%);
  opacity: .7;
}
.battle-shot[data-technique="cleaning-robot"] { border-radius: 50%; outline: 1px dashed var(--hot-core); outline-offset: -2px; }
.battle-shot[data-technique="meal-prep"] i { height: 36px; transform: translateY(-50%) rotate(-6deg); }
.battle-shot[data-technique="linen-care"]::after { height: 7px; clip-path: polygon(0 0, 100% 35%, 100% 70%, 0 100%, 66% 50%); }
.battle-impact {
  left: 23%;
  top: 55%;
  width: 48px;
  height: 48px;
  transform: translate(-50%, -50%) scale(var(--burst-scale, 1));
  filter: drop-shadow(0 0 8px var(--energy));
}
.lane-1 .battle-impact { left: 77%; }
.battle-impact::before, .battle-impact::after, .battle-impact i { content: ''; position: absolute; }
.battle-impact::before { inset: 8%; border: 1px solid var(--hot-core); border-radius: 50%; }
[data-reaction="hit"] .battle-impact::after {
  inset: -5%;
  background: radial-gradient(circle, white 0 17%, var(--hot-core) 25%, var(--energy) 65%);
  clip-path: polygon(50% 0, 57% 38%, 87% 12%, 66% 42%, 100% 52%, 64% 57%, 84% 91%, 54% 67%, 47% 100%, 42% 64%, 13% 85%, 34% 55%, 0 45%, 37% 42%, 17% 11%, 45% 34%);
}
[data-reaction="hit"] .battle-impact i {
  inset: -14%;
  background: radial-gradient(circle at 14% 70%, var(--hot-core) 0 2px, transparent 3px),
    radial-gradient(circle at 78% 85%, var(--hot-core) 0 2px, transparent 3px),
    radial-gradient(circle at 72% 14%, var(--hot-core) 0 1px, transparent 2px);
}
[data-reaction="dodge"] .battle-impact {
  --energy: #a9eaff;
  --hot-core: #e5f7ff;
  transform: translate(-50%, -50%) rotate(-30deg) scale(var(--burst-scale, 1)) scaleY(.56);
}
[data-reaction="dodge"] .battle-impact::before { border-style: dashed; }
[data-reaction="dodge"] .battle-impact::after {
  inset: 31% -38%;
  border-top: 2px solid var(--energy);
  border-radius: 50%;
}
.attack-box { position: absolute; z-index: 1; top: 5px; right: 5px; display: flex; align-items: center; gap: 4px; inline-size: 49%; min-block-size: 53px; padding: 3px 5px; }
.lane-1 .attack-box { right: auto; left: 5px; }
.attack-box[data-slot="A"] { border-color: #ff879b; }
.attack-box[data-slot="B"] { border-color: #7cefaa; }
.attack-box[data-slot="C"] { border-color: #8fcaff; }
.attack-box small, .attack-box strong { display: block; }
.attack-box strong { font-size: .76rem; }
.attack-box small { color: #d8ddf4; font-size: .64rem; }
.attack-box .attack-phase:empty { display: none; }
.attack-medal { flex: none; inline-size: 35px; }
.attack-box[data-phase="lock"] {
  background: #514580;
  box-shadow: inset 0 0 12px #ffedb391;
  animation: battle-lock-glow 200ms ease-out;
}
@keyframes battle-lock-glow {
  from { box-shadow: inset 0 0 18px #fff4ce, 0 0 11px #ffedb3; }
  to { box-shadow: inset 0 0 12px #ffedb391; }
}
.battle-lane[data-reaction="hit"]::after { box-shadow: inset 0 0 0 1px #ffe3bb, inset 0 0 20px #ff906a7a; }
.battle-auto-label { margin: 0; text-align: center; font-size: .66rem; letter-spacing: .1em; color: #eee4d0; }
.battle-arena[data-phase="done"] .attack-box { display: none; }
.battle-arena[data-outcome] {
  --result-accent: #dae0ff;
  --result-glow: #939ccf52;
  --result-panel: #252b57;
  grid-template-rows: auto minmax(260px, 1fr) auto;
}
.battle-arena[data-outcome="win"] { --result-accent: #ffdfa0; --result-glow: #ffd57b85; --result-panel: #3b346c; }
.battle-arena[data-outcome="loss"] { --result-accent: #ffc2cc; --result-glow: #ef92b133; --result-panel: #42283e; }
.battle-result-layer {
  position: absolute;
  z-index: 3;
  inset: 0;
  display: grid;
  align-items: safe center;
  justify-items: center;
  overflow: auto;
  padding: 6px 12px;
  border-radius: 9px;
  background: radial-gradient(ellipse at 50% 40%, var(--result-glow), transparent 65%), #14182c5e;
}
[data-outcome="win"] .battle-result-layer { animation: battle-victory .65s ease-out; }
[data-outcome="loss"] .battle-result-layer { background-color: #161325ad; animation: battle-defeat .65s ease-out; }
[data-outcome="win"] .battle-result-layer::before {
  content: '';
  position: absolute;
  inset: 5% 0;
  background: repeating-conic-gradient(from 12deg, transparent 0deg 24deg, #ffdf9e80 30deg, transparent 39deg);
  mask-image: radial-gradient(ellipse, transparent 24%, black 45%, transparent 69%);
  pointer-events: none;
  animation: battle-rays .85s ease-out both;
}
[data-outcome="win"] .fighter-1 .adventure-portrait,
[data-outcome="loss"] .fighter-0 .adventure-portrait {
  opacity: .6;
  filter: grayscale(.8) drop-shadow(0 4px 5px #111b2b);
  animation: battle-fall .5s ease-out both;
}
[data-outcome="win"] .fighter-0 .adventure-portrait { filter: drop-shadow(0 0 8px #ffe6a588); }
.battle-summary {
  position: relative;
  display: grid;
  gap: 7px;
  width: min(100%, 330px);
  padding: 11px 13px;
  border: 1px solid var(--result-accent);
  border-radius: 14px;
  color: #fff5f2;
  background: linear-gradient(var(--result-panel), #151e3a 80%);
  box-shadow: 0 0 0 3px #161b45bd, 0 8px 28px #101531c9, 0 0 26px var(--result-glow);
  text-align: center;
  animation: battle-result-enter .42s ease-out;
}
.battle-result-banner {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 13px;
  border-block-end: 1px solid #ffebc151;
  color: var(--result-accent);
  padding-block-end: 5px;
}
.battle-result-emblem {
  display: grid;
  place-items: center;
  width: 41px;
  height: 41px;
  border-radius: 50%;
  border: 1px solid currentColor;
  background: radial-gradient(circle, var(--result-glow), transparent);
  font-size: 1.55rem;
}
.battle-result-banner h2 { margin: 0; font-size: 2.15rem; letter-spacing: .1em; text-shadow: 0 0 16px var(--result-glow); }
[data-outcome="win"] .battle-result-emblem { box-shadow: 0 0 16px #ffd77882, inset 0 0 6px #fff1ac76; }
.battle-summary p { margin: 0; color: #f1e9f4; font-size: .76rem; }
.battle-earned-coins, .battle-earned-items {
  padding: 6px 8px;
  border-radius: 6px;
  background: #0b163e9a;
  text-align: start;
}
.battle-earned-coins {
  display: grid;
  grid-template-columns: 23px minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
  font-size: .76rem;
}
.battle-earned-coins :is(.ui-icon, strong) { color: #ffe2a1; }
.battle-earned-coins strong { font-size: 1.15rem; }
.battle-earned-items h3 { margin: 0 0 2px; font-size: .77rem; }
.battle-earned-items ul { margin-block: 4px 0; }
.battle-summary .primary { width: 100%; min-height: 44px; }
[data-outcome="loss"] .battle-summary .primary { background: linear-gradient(#634c6a, #352a4c); }
.battle-unlock {
  width: min(350px, calc(100% - max(14px, var(--safe-left)) - max(14px, var(--safe-right))));
  border: 2px solid #f0d9a4;
  border-radius: 14px;
  background: radial-gradient(ellipse at 50% 0, #484b9c, #202e61 70%);
  box-shadow: 0 0 25px #b7bcfb72;
  text-align: center;
}
.battle-unlock h2 { color: #ffedbc; line-height: 1.45; word-break: keep-all; }
.battle-unlock p { font-size: .85rem; }
.battle-unlock p strong { display: block; font-size: 1rem; }
.battle-unlock-art {
  width: 94px;
  margin: 0 auto 9px;
  padding: 5px;
  border: 1px solid #e9d7af;
  border-radius: 12px;
  background: radial-gradient(ellipse, #fff1e1, #a7a6e7);
}
.battle-unlock-art .item-art { inline-size: min(100%, 68px); margin-inline: auto; }
@keyframes battle-victory { from { background-color: #ffdb885e; } }
@keyframes battle-defeat { from { background-color: #16132500; } }
@keyframes battle-result-enter { from { opacity: .25; transform: translateY(9px); } }
@keyframes battle-rays {
  from { opacity: 0; transform: scale(.78); }
  40% { opacity: .95; }
  to { opacity: .38; transform: scale(1); }
}
@keyframes battle-fall { to { transform: translateY(6px) rotate(-5deg); } }
@media (prefers-reduced-motion: reduce) {
  .attack-box[data-phase="lock"], .battle-arena .battle-result-layer, .battle-summary,
  [data-outcome="win"] .battle-result-layer::before, .battle-arena[data-outcome] .fighter .adventure-portrait { animation: none; }
  [data-outcome="win"] .battle-result-layer::before { opacity: .38; }
  .fighter .adventure-portrait { transform: none !important; opacity: 1 !important; }
  .battle-shot, .battle-impact { display: none; }
}
