/* Imyeon Signal v14 — Commercial RPG Visual & UX Overhaul
   Unit 1: Overworld 18-frame walk cycle, Canvas FX layer, virtual joystick, clean HUD & quest bar, Nano Banana key visuals. */

/* 1. Opening Title Key Visual & Restored Lit Village (Nano Banana originals) */
.modal-box:has(.intro-screen):before {
  height: 100%;
  background:
    linear-gradient(180deg, #0f0720eb 0%, #1a0c3088 24%, #1a0b2d40 48%, #160a28eb 76%, #110820 100%),
    url('assets/intro-rift-bg.webp') center center / cover no-repeat;
}
.modal-box:has(.npc-hub.village-restored) {
  background:
    linear-gradient(180deg, #170d26bf 0%, #1c102b66 38%, #160c24f2 84%),
    url('assets/village-lit.webp') center 42% / cover no-repeat;
}

/* 2. Map World Ground Extension & Canvas FX Layer */
.immersive-map > .map-wrap {
  background: radial-gradient(ellipse at 50% 80%, #2a1c3f, #120b21 75%);
}
.immersive-map > .map-wrap:after {
  background: linear-gradient(
    180deg,
    #11081ff2 0%,
    #150b26cc 16%,
    #180d2b44 25%,
    transparent 33%,
    transparent 66%,
    #150b26cf 79%,
    #120920fa 93%
  );
}
.map-world > .world-fx-canvas {
  position: absolute;
  inset: 0;
  width: 1000px;
  height: 1500px;
  pointer-events: none;
  z-index: 2;
}
.map-world > .district-route {
  z-index: 3;
}
.map-world > .district-destination {
  z-index: 3;
}

/* 3. 18-Frame Painted Explorer Walk Sprite (6 cols × 3 rows) */
.map-wrap .map-world .district-avatar {
  filter: drop-shadow(0 5px 5px #0f061acc) drop-shadow(0 0 8px #92f5e466);
  transition: none;
}
.map-world .district-avatar.walking {
  animation: none !important;
}
.explorer-sprite {
  background-image: url('assets/explorer-walk-v15.webp');
  background-size: 600% 300%;
  background-position: 0% 0%;
  background-repeat: no-repeat;

}
.facing-down .explorer-sprite {
  background-position-y: 0%;
}
.facing-up .explorer-sprite {
  background-position-y: 50%;
}
.facing-right .explorer-sprite,
.facing-left .explorer-sprite {
  background-position-y: 100%;
}
.facing-left .explorer-sprite {
  transform: scaleX(-1);
}
.district-avatar.walking .explorer-sprite {
  background-position-x: var(--walk-column, 0%);
}
.district-avatar:not(.walking) .explorer-sprite {
  scale: 1;
  transform-origin: center 94%;
  animation: explorer-breathe 2.8s ease-in-out infinite;
}
@keyframes explorer-breathe { 50% { scale: 1 1.018; } }
html.reduce-motion .district-avatar .explorer-sprite { animation: none; background-position-x: 0%; }
@media (prefers-reduced-motion: reduce) {
  .district-avatar .explorer-sprite, .district-avatar.walking .explorer-sprite { animation: none; background-position-x: 0%; }
}

/* Keep the illustrated map and explorer on separate transform layers. */
.map-wrap > .map-world { will-change: transform; }
.map-wrap .map-world .district-avatar {
  left: 0;
  top: 0;
  width: 76px;
  height: 76px;
  will-change: transform;
  filter: none;
}
.district-avatar::before {
  content: "";
  position: absolute;
  inset: auto 25% 1%;
  height: 13%;
  background: radial-gradient(ellipse, #11091fe6, #11091f65 48%, transparent 74%);
}
.district-avatar .explorer-sprite { filter: drop-shadow(0 2px 3px #130d24b0); }
.district-route path {
  stroke: #ffe4a1a6;
  stroke-width: 1.6;
  stroke-dasharray: 2 6;
  vector-effect: non-scaling-stroke;
  animation: none;
}
.map-world .district-destination {
  width: 24px;
  height: 16px;
  transform: translate(-50%,-50%);
  border-radius: 50%;
  border: 1px solid #ffdf9c;
  background: #f3c97e24;
  box-shadow: 0 0 8px #ffdf9c73;
}
.map-world .district-tap-ring {
  position: absolute;
  z-index: 7;
  width: 36px;
  height: 25px;
  border-radius: 50%;
  border: 1px solid #ffe8ab;
  box-shadow: 0 0 8px #f8ce87;
  opacity: 0;
  pointer-events: none;
}

/* 4. NPC Quest Indicators & Compact Map Pins (no HUD gap bleed) */
.map-world .district-memory {
  min-width: 62px;
  min-height: 36px;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid #ecc989cc;
  background: linear-gradient(155deg, #3a2356eb, #1f1233f2);
  box-shadow: 0 3px 10px #0b0518aa, 0 0 12px #b682ee44;
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 5px;
  z-index: 4;
}
.map-wrap .district-memory .ui-icon {
  width: 14px;
  height: 14px;
  margin: 0;
}
.map-world .district-memory small {
  font-size: 10px;
  white-space: nowrap;
}
.map-world .district-memory.zone-village,
.map-world .district-memory.zone-square {
  opacity: 0;
  pointer-events: none;
}
.map-world .district-npc {
  z-index: 5;
}
.map-world .district-npc.quest-target:before {
  content: '!';
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  width: 22px;
  height: 22px;
  line-height: 20px;
  border-radius: 50%;
  background: linear-gradient(180deg, #fff1b8, #e09f3e);
  border: 1.5px solid #2b143d;
  color: #240f36;
  font-weight: 900;
  font-size: 13px;
  text-align: center;
  box-shadow: 0 0 14px #ffd875cc, 0 3px 6px #0c0418aa;
  animation: npc-quest-bob 1.2s ease-in-out infinite alternate;
  z-index: 3;
}
@keyframes npc-quest-bob {
  from { transform: translate(-50%, 0); }
  to { transform: translate(-50%, -5px); }
}

/* 5. Map Top HUD + 1-Tap Direct Quest Ribbon & Journal Button */
.map-hud {
  z-index: 9;
  padding: 0 14px 8px;
  background: linear-gradient(180deg, #120921f2 0%, #150b26d8 74%, transparent 100%);
}
.map-hud .topbar {
  min-height: 60px;
  padding-top: calc(8px + var(--safe-top));
  padding-bottom: 8px;
}
.map-hud .brand h1 {
  font-size: 21px;
}
.top-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.bgm-pill {
  min-width: 36px;
  height: 34px;
  padding: 0 9px;
  border-radius: 8px;
  border: 1px solid #b78e56aa;
  background: linear-gradient(150deg, #3f2249e6, #1e0f2ce6);
  color: #ffe4ad;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.bgm-pill.on {
  border-color: #f3d28e;
  box-shadow: 0 0 10px #dca45e44;
}
.region-tabs {
  margin: 4px 0 7px;
  gap: 7px;
}
.region-tab {
  min-height: 38px;
  padding: 4px 8px;
  font-size: 11px;
}
.quest-bar-row {
  display: flex;
  align-items: stretch;
  gap: 7px;
  pointer-events: auto;
}
.quest-bar-row .quest-ribbon {
  flex: 1;
  min-width: 0;
  padding: 8px 11px;
  gap: 9px;
  border-color: #e5be78;
  background: linear-gradient(100deg, #432459f0, #241335eb);
}
.quest-bar-row .quest-ribbon small {
  color: #f2cf8d;
  font-weight: 700;
  margin-bottom: 1px;
}
.quest-bar-row .quest-ribbon strong {
  font-size: 11.5px;
  line-height: 1.35;
}
.quest-bar-row .quest-ribbon > .quest-go-chip,
.quest-go-chip {
  flex: 0 0 auto;
  padding: 4px 9px;
  border-radius: 999px;
  background: linear-gradient(180deg, #9850b0, #5b2877);
  border: 1px solid #ffe0a1;
  color: #fff3ca;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: 0 2px 8px #0f051caa;
}
.quest-notes-btn {
  flex: none;
  width: 44px;
  min-height: 44px;
  border-radius: 11px;
  border: 1px solid #c79f63;
  background: linear-gradient(145deg, #3b204eed, #211130eb);
  color: #ffe5af;
  display: grid;
  place-items: center;
}

/* 6. Sleek Translucent Compass Pad & Touch Virtual Joystick */
.touch-joystick {
  position: absolute;
  width: 84px;
  height: 84px;
  margin: -42px 0 0 -42px;
  border-radius: 50%;
  border: 1.5px solid #90f5e099;
  background: radial-gradient(circle, #3d215880, #140b24b8);
  box-shadow: 0 0 18px #8cf2de40;
  pointer-events: none;
  z-index: 6;
  opacity: 0;
  transition: opacity 0.14s ease;
  display: grid;
  place-items: center;
}
.touch-joystick.active {
  opacity: 1;
}
.touch-joystick i {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff4c8, #d29eff 75%);
  border: 1px solid #ffe7a8;
  box-shadow: 0 0 12px #90f5e0bb;
  display: block;
}
.map-wrap .field-pad {
  left: 14px;
  bottom: calc(184px + var(--safe));
  width: 96px;
  height: 96px;
  gap: 2px;
  padding: 4px;
  border-radius: 50%;
  background: radial-gradient(circle, #2a173eb8, #140b22cc);
  border: 1px solid #cfa86e66;
  box-shadow: 0 4px 14px #09031399;
  backdrop-filter: blur(4px);
  z-index: 6;
}
.map-wrap .field-pad button {
  min-width: 28px;
  min-height: 28px;
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 8px;
  font-size: 10px;
  background: #3a2252cc;
  border: 1px solid #d9b47a55;
  color: #ffe7b5;
}

/* 7. Compact Bottom Map Dock & Non-Occluding Top Toast */
.map-dock {
  left: 14px;
  right: 14px;
  bottom: calc(82px + var(--safe));
  z-index: 8;
}
.map-companion {
  bottom: calc(100% + 8px);
  width: 84px;
  min-height: 92px;
  padding: 3px 4px 6px;
}
.map-companion-art,
.map-companion .creature-art {
  width: 68px;
  height: 64px;
}
.map-dock .location-caption {
  margin-bottom: 5px;
}
.location-caption > span {
  font-size: 16px;
}
.field-travel-hint {
  margin: 4px 0 6px;
  padding: 7px 10px;
  font-size: 10.5px;
}
.map-utilities button {
  min-height: 38px;
  font-size: 10.5px;
}
.toast {
  top: calc(12px + var(--safe-top));
  bottom: auto;
  z-index: 60;
  padding: 7px 14px;
  border-radius: 999px;
  background: linear-gradient(120deg, #3b2152f5, #211232f5);
  border: 1px solid #efd093;
  box-shadow: 0 8px 24px #070212cc, 0 0 16px #c586f044;
  font-size: 11.5px;
  font-weight: 700;
  pointer-events: none;
}

/* ==========================================================================
   Unit 2: Rear Over-The-Shoulder Battle Camera, Combat Juice, Dual HP/MP,
           CONNECT Focus Mode & Single-Screen Capture Result
   ========================================================================== */

/* 8. Biome Battle Arena Backgrounds (Nano Banana 9:16 Painted Stages) */
.battle-view {
  background:
    linear-gradient(180deg, #110820b8 0%, #150a2426 22%, #150b2438 56%, #160c28eb 79%, #110920 100%),
    url('assets/battle-forest-v3.webp') center 34% / cover no-repeat;
}
.battle-view.zone-cave,
.battle-view.zone-crystal_cave {
  background-image:
    linear-gradient(180deg, #0f081eb8 0%, #130b2424 22%, #140b2538 56%, #150c28eb 79%, #10081f 100%),
    url('assets/battle-crystal-cave.webp');
}
.battle-view.zone-lava_cave {
  background-image:
    linear-gradient(180deg, #190914bf 0%, #1c0b1628 22%, #1b0b1938 56%, #190b1feb 79%, #13081a 100%),
    url('assets/battle-lava-cave.webp');
}
.battle-view.zone-outskirts {
  background-image:
    linear-gradient(180deg, #120922b8 0%, #160c2824 22%, #170d2a38 56%, #160c29eb 79%, #110820 100%),
    url('assets/battle-outskirts-rift.webp');
}

/* 9. Rear Over-The-Shoulder Stage & 60fps Battle VFX Canvas */
.battle-view .battle-stage {
  position: relative;
  min-height: 228px;
  overflow: visible;
  will-change: transform;
}
.battle-stage > .battle-fx-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 6;
}
.battle-view .battle-world {
  position: relative;
  z-index: 7;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  color: #f2dfb9;
  text-shadow: 0 1px 4px #090313;
}

/* Keep the enemy across the field from the rear-facing active companion. */
.battle-view .actor.enemy,
.battle-view .battle-stage.core-battle .actor.enemy {
  left: auto;
  right: 0;
  top: 13%;
  width: 58%;
  height: 64%;
  z-index: 3;
  filter: drop-shadow(0 14px 12px #0b0419dd);
}
.battle-view .battle-stage.has-support .actor.enemy {
  right: 0;
  top: 13%;
  width: 53%;
  height: 58%;
}
.battle-view .battle-stage .actor.support {
  left: 13%;
  right: auto;
  top: 22%;
  width: 31%;
  height: 36%;
  z-index: 4;
}
.battle-view .actor.ally {
  left: 1%;
  bottom: 2%;
  width: 51%;
  height: 58%;
  display: flex;
  align-items: end;
  justify-content: center;
  container-type: size;
  z-index: 5;
}
.battle-view .actor.ally > .creature-art {
  position: relative;
  display: flex;
  align-items: end;
  justify-content: center;
}
.actor.ally .rear-pose {
  position: relative;
  display: block;
  width: min(100cqw, 100cqh);
  aspect-ratio: 1;
}
.actor.ally .rear-frame {
  position: absolute;
  inset: 0;
  display: block;
  overflow: hidden;
  background: var(--rear-sheet) var(--rear-position) / var(--rear-size) no-repeat;
  clip-path: var(--rear-cut, none);
}
.actor.ally .rear-frame::before,
.actor.ally:has(.mirror-art):not(:has(.rear-pose))::before {
  content: "";
  position: absolute;
  left: 10%;
  right: 10%;
  height: 18%;
  border: 1px solid #ffe4a4d1;
  border-radius: 50%;
  background: radial-gradient(ellipse, #f9ca6c34, transparent 70%);
  box-shadow: 0 0 11px #f5c87365, inset 0 0 8px #f5c87350;
}
.actor.ally .rear-frame::before {
  top: var(--ally-feet);
  transform: translateY(-50%);
}
.actor.ally:has(.mirror-art):not(:has(.rear-pose))::before { bottom: 7%; }
.battle-view .actor.ally.fainted { opacity: .32; }
.battle-view .actor.ally.strike,
.battle-view .actor.ally.skill-flare {
  animation: ally-rear-lunge .42s cubic-bezier(.2,.9,.3,1) both;
}
.battle-view .actor.ally.hit { animation: ally-rear-recoil .36s ease-out both; }
.battle-view .actor.ally.swap-out { animation: ally-exit .15s ease-in both; }
.battle-view .actor.ally.swap-in { animation: ally-enter .18s ease-out both; }
@keyframes ally-rear-lunge {
  0%, 100% { transform: none; }
  45% { transform: translate(46px, -48px) scale(1.1); }
}
@keyframes ally-rear-recoil {
  0%, 100% { transform: none; }
  35% { transform: translate(-22px, 14px) scale(.92); }
}
@keyframes ally-exit { to { opacity: 0; transform: translate(-32px, 20px); } }
@keyframes ally-enter { from { opacity: 0; transform: translate(-32px, 20px); } }

/* 10. Enemy WEAKENED Badge & Lower-Right Ally Dual HP + MP Status Card */
.battle-view .status-box.enemy-status {
  top: 22px;
  left: 0;
  right: auto;
  width: min(61%, 248px);
  padding: 7px 10px;
  border-radius: 11px;
  background: linear-gradient(160deg, #2b173feb, #170d26f2);
  border: 1px solid #deb87a88;
  box-shadow: 0 6px 18px #090314aa;
  z-index: 7;
}
.enemy-status-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 3px;
}
.enemy-title-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.weakened-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  border-radius: 999px;
  background: linear-gradient(135deg, #1b4b4c, #2f2354);
  border: 1px solid #82f4d2;
  color: #baffec;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.03em;
  box-shadow: 0 0 10px #7ef7d455;
  animation: weakened-pulse 1.3s ease-in-out infinite alternate;
}
@keyframes weakened-pulse {
  from { box-shadow: 0 0 6px #7ef7d444; }
  to { box-shadow: 0 0 14px #7ef7d4aa; }
}
.battle-view .battle-effects {
  top: 76px;
  left: 8px;
  right: auto;
  bottom: auto;
  justify-content: flex-start;
  z-index: 8;
}
.battle-view .status-box.ally-status {
  left: auto;
  right: 0;
  bottom: 9px;
  width: 43%;
  min-width: 0;
  max-width: 172px;
  padding: 6px 9px;
  border-radius: 11px;
  background: linear-gradient(160deg, #2a173eeb, #160c25f2);
  border: 1px solid #d7b27788;
  box-shadow: 0 6px 16px #090314aa;
  z-index: 7;
}
.ally-status-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 5px;
  margin-bottom: 2px;
}
.mp-track {
  display: block;
  height: 5px;
  margin-top: 4px;
  border-radius: 999px;
  background: #170e29;
  border: 1px solid #8a73b555;
  overflow: hidden;
}
.mp-track > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #6ad7f0, #b87dff);
  box-shadow: 0 0 8px #8be8ff88;
  transition: width 0.22s ease;
}
.mp-sub-row {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  color: #d6c8f2;
  margin-top: 2px;
}

/* Floating Damage & Critical Numbers Centered Clearly Over Target */
.battle-view .battle-number.enemy {
  left: 50%;
  top: 28%;
  transform: translateX(-50%);
  z-index: 8;
  font-size: 22px;
  font-weight: 900;
  text-shadow: 0 3px 10px #090214, 0 0 14px #ffd875aa;
}
.battle-view .battle-number.ally {
  left: 30%;
  bottom: 34%;
  z-index: 8;
}

/* 11. Dedicated CONNECT Focus Ring & Toggle CTA */
.combat-dial.is-connect-dial {
  border-color: #9dfbe3;
  box-shadow: 0 0 0 4px #7ef7d43d, 0 0 28px #7ef7d488, 0 0 52px #9f7aea44;
}
.combat-dial.is-connect-dial .dial-sigil .ui-icon {
  color: #a6ffea;
  filter: drop-shadow(0 0 8px #7ef7d4);
}
.connect-call-caption {
  font-size: 9.5px;
  line-height: 16px;
  margin: 1px 0 4px;
  color: #b7ffec;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-align: center;
  text-shadow: 0 0 10px #7ef7d455;
}
.dial-primary-row {
  display: flex;
  align-items: stretch;
  gap: 7px;
  width: 100%;
}
.dial-primary-row .connect-mode-btn {
  flex: 0 0 104px;
  min-height: 48px;
  padding: 0 8px;
  border-radius: 11px;
  border: 1.5px solid #7ef7d4cc;
  background: linear-gradient(155deg, #1d3c4aeb, #181a34f5);
  color: #b9ffed;
  font-size: 11.5px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  box-shadow: 0 0 14px #7ef7d433;
}
.dial-primary-row .connect-mode-btn .ui-icon {
  width: 15px;
  height: 15px;
}
.dial-primary-row .connect-mode-btn.active {
  border-color: #ffe29a;
  background: linear-gradient(155deg, #47285ceb, #231333f5);
  color: #ffe9b5;
}
.dial-primary-row .dial-tap-button {
  flex: 1;
  min-width: 0;
  font-size: 17px;
  letter-spacing: 0.08em;
}
.dial-primary-row .dial-tap-button.connect-btn {
  background: linear-gradient(180deg, #7c3cb8, #451c75);
  border: 1.5px solid #9dfbe3;
  color: #ffffff;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.06em;
  box-shadow: 0 0 22px #7ef7d466, inset 0 0 14px #ffe6a340;
}
.rank-skills {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 0;
}
.rank-skills button {
  flex: 1 1 46%;
  min-height: 34px;
  padding: 4px 7px;
  font-size: 10px;
}
.rank-skills > p {
  display: none;
}

/* 12. Single-Screen Royal Amethyst & Gold CAPTURE RESULT / BATTLE CLEAR Modal */
.modal-box:has(.capture-result-sheet) {
  padding: 14px 15px 15px;
}
.capture-result-sheet {
  display: flex;
  flex-direction: column;
  gap: 7px;
  text-align: center;
}
.capture-result-sheet .result-banner {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  align-self: center;
  padding: 4px 14px;
  border-radius: 999px;
  border: 1px solid #e7c27d;
  background: linear-gradient(145deg, #3c2154, #211132);
  color: #ffe4a8;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
}
.capture-result-sheet .result-banner .ui-icon {
  width: 14px;
  height: 14px;
}
.capture-result-sheet h2 {
  margin: 0;
  font-size: 21px;
  color: #fff2cf;
}
.capture-result-sheet .capture-portrait {
  width: 128px;
  height: 128px;
  margin: 2px auto;
  padding: 8px;
  border-radius: 50%;
  background: radial-gradient(circle, #5b318299 0%, #2a1542cc 64%, transparent 74%);
  box-shadow: 0 0 26px #b779f055;
}
.capture-result-sheet .capture-portrait .creature-art {
  width: 100%;
  height: 100%;
}
.capture-result-sheet .capture-card-frame {
  padding: 9px 12px;
  border-radius: 13px;
  border: 1px solid #e6c17c;
  background: linear-gradient(160deg, #321b49f2, #1c0f2cf5);
  box-shadow: inset 0 0 18px #c78ef522;
}
.capture-result-sheet .capture-card-frame h3 {
  margin: 2px 0 3px;
  font-size: 17px;
  color: #fff3d4;
}
.capture-result-sheet .capture-meta {
  font-size: 10.5px;
  color: #e9c98f;
  font-weight: 700;
}
.capture-result-sheet .capture-lore {
  margin: 4px 0 0;
  font-size: 11px;
  line-height: 1.35;
  color: #dfd1eb;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.capture-result-sheet .discovery-stamp,
.capture-result-sheet .milestone-stamp {
  margin: 0;
  padding: 6px 10px;
  font-size: 11px;
}
.capture-result-sheet .reward-line {
  margin: 0;
  padding: 7px 10px;
  border-radius: 10px;
  background: #1b0f2bd9;
  border: 1px solid #b8956644;
  font-size: 11px;
  line-height: 1.4;
}
.capture-result-sheet .case-reveal {
  margin: 0;
  padding: 6px 10px;
  font-size: 11px;
  border-radius: 9px;
  background: #28163ee6;
  border: 1px solid #ffd98a77;
  color: #fff2ce;
  font-weight: 600;
}
.capture-result-sheet .modal-actions {
  margin-top: 3px;
}

/* 13. Turn-Based One-Thumb Command Deck & Bonus Timing Ring (Lower 40%, >= 44pt) */
.battle-view .topbar .icon-button {
  min-width: 44px;
  min-height: 44px;
}
.battle-view .enemy-intent.danger {
  border-color: #ff9a76;
  background: linear-gradient(155deg, #4b1d2ef2, #250f24f5);
  box-shadow: 0 0 14px #ff7b5444;
}
.battle-view .enemy-intent.danger strong {
  color: #ffd59e;
}
.battle-view .battle-thumb-dock {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.battle-view .battle-thumb-dock > button.primary {
  min-height: 46px;
}
.battle-view .rank-skills button {
  min-height: 44px;
}
.battle-view .turn-command-deck {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.battle-view .cmd-row-main {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}
.battle-view .cmd-row-sub {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}
.battle-view .cmd-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 54px;
  padding: 6px 10px;
  border-radius: 13px;
  border: 1.5px solid #d9b67a99;
  background: linear-gradient(160deg, #351f4ef2, #1d1130f8);
  color: #fff2cf;
  text-align: left;
  box-shadow: inset 0 1px 0 #ffffff22, 0 5px 14px #080314aa;
  touch-action: manipulation;
}
.battle-view .cmd-row .cmd-btn {
  min-height: 50px;
  padding: 5px 7px;
  gap: 5px;
}
.battle-view .cmd-btn:disabled {
  opacity: 0.42;
  filter: saturate(0.5);
}
.battle-view .cmd-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  color: #ffd98e;
}
.battle-view .cmd-icon .ui-icon {
  width: 18px;
  height: 18px;
}
.battle-view .cmd-row-sub .cmd-icon .ui-icon {
  width: 15px;
  height: 15px;
}
.battle-view .cmd-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.15;
}
.battle-view .cmd-copy strong {
  font-size: 14px;
  font-weight: 900;
  color: #fff5da;
  white-space: nowrap;
}
.battle-view .cmd-row .cmd-copy strong {
  font-size: 12.5px;
}
.battle-view .cmd-copy small {
  font-size: 9.5px;
  color: #d7c4ec;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.battle-view .cmd-attack {
  border-color: #f0c272cc;
  background: linear-gradient(155deg, #4b2a54f2, #251334f8);
}
.battle-view .cmd-skill.is-charged {
  border-color: #e6a8ff;
  background: linear-gradient(155deg, #58287af5, #2b1345fa);
  box-shadow: 0 0 16px #c87dff66, inset 0 1px 0 #fff4;
}
.battle-view .cmd-guard.is-recommended {
  border-color: #ffe28c;
  background: linear-gradient(155deg, #523822f5, #291a1bf8);
  box-shadow: 0 0 16px #ffd46a66;
}
.battle-view .cmd-guard.is-recommended .cmd-copy small {
  color: #ffe59b;
  font-weight: 800;
}
.battle-view .cmd-connect.is-ready {
  border-color: #82f4d2;
  background: linear-gradient(155deg, #1b4b4cf5, #1f1b42fa);
  box-shadow: 0 0 18px #7ef7d466;
}
.battle-view .cmd-connect.is-ready .cmd-icon,
.battle-view .cmd-connect.is-ready .cmd-copy small {
  color: #b7ffec;
  font-weight: 800;
}
.battle-view .timing-tiers {
  justify-content: center;
  gap: 12px;
  font-size: 10px;
  font-weight: 700;
}
.battle-view .timing-tiers .yellow-tier { color: #fff091; }
.battle-view .timing-tiers .orange-tier { color: #ffad64; }
.battle-view .timing-tiers .outer-tier { color: #d5b8ff; }
.timing-result {
  position: absolute; top: 42%; left: 50%; z-index: 15; transform: translate(-50%,-50%);
  pointer-events: none; font: 900 clamp(32px,11vw,54px)/1 Georgia,serif;
  color: #ead2ff; padding: 7px 13px; border: 1px solid currentColor; border-radius: 13px;
  background: #1a102af0; box-shadow: 0 3px 20px #130b1c99;
}
.timing-result.timing-yellow { color: #fff091; box-shadow: 0 0 26px #ffda68ae; }
.timing-result.timing-orange { color: #ffad64; }
.battle-view .battle-utility-row button {
  min-height: 44px;
  font-size: 12px;
}
.battle-view .battle-utility-row button.active-mercy {
  border-color: #82f4d2;
  background: linear-gradient(155deg, #1c4448, #1a213d);
  color: #baffec;
}
.battle-view .battle-hint {
  margin: 0;
  font-size: 10px;
  line-height: 1.25;
  text-align: center;
  color: #d7c5ea;
}
.battle-view .china-art {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

/* 5-Stat Status & Gauge Expansion Panel (Party & Battle Modal) */
.hunter-stats-panel {
  padding: 11px 12px;
  border-radius: 14px;
  border: 1px solid #dfb97b88;
  background: linear-gradient(160deg, #2d1844f0, #190d28f5);
  box-shadow: 0 6px 18px #0a041699;
  margin-bottom: 8px;
}
.hunter-stats-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 7px;
}
.hunter-stats-head h3 {
  margin: 0;
  font-size: 14px;
  color: #fff0c7;
}
.stat-pt-badge {
  padding: 3px 9px;
  border-radius: 999px;
  background: linear-gradient(135deg, #6f389e, #3f1d63);
  border: 1px solid #ffe09c;
  color: #fff3cb;
  font-size: 10.5px;
  font-weight: 800;
}
.gauge-preview-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  margin-bottom: 8px;
}
.gauge-preview-pill {
  padding: 4px 6px;
  border-radius: 8px;
  background: #170d26cc;
  border: 1px solid #a887c744;
  text-align: center;
  font-size: 9.5px;
  color: #dfd0ee;
}
.gauge-preview-pill strong {
  display: block;
  font-size: 11px;
  color: #ffe6a8;
}
.stat-grid-rows {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.stat-alloc-row {
  display: grid;
  grid-template-columns: 78px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border-radius: 9px;
  background: #1b0f2cd9;
  border: 1px solid #9f82be38;
}
.stat-alloc-row .stat-name {
  font-size: 11.5px;
  font-weight: 800;
  color: #ffebc0;
}
.stat-alloc-row .stat-desc {
  font-size: 10px;
  color: #cfc0e2;
  line-height: 1.25;
  word-break: keep-all;
}
.stat-alloc-btn {
  min-width: 52px;
  min-height: 30px;
  padding: 3px 8px;
  border-radius: 8px;
  font-size: 10.5px;
  font-weight: 800;
}

/* 14. Unit 3 — 8-Biome Battle Arenas, 8 Chinese Mythical Bosses, Evolved Arcane Crest & World Atlas Radar */
.battle-stage.biome-crystal-cave {
  background-image: linear-gradient(180deg, #12092266 0%, #10081e22 45%, #0d0618aa 100%), url("assets/battle-crystal-cave.webp") !important;
  background-size: cover !important;
  background-position: center 42% !important;
}
.battle-stage.biome-lava-cave {
  background-image: linear-gradient(180deg, #24090d66 0%, #1d080c1c 45%, #120408bb 100%), url("assets/battle-lava-cave.webp") !important;
  background-size: cover !important;
  background-position: center 46% !important;
}
.battle-stage.biome-ice-cave {
  background-image: linear-gradient(180deg, #07193066 0%, #0a1f381c 45%, #061022bb 100%), url("assets/battle-ice-cave.webp") !important;
  background-size: cover !important;
  background-position: center 45% !important;
}
.battle-stage.biome-riverside {
  background-image: linear-gradient(180deg, #0b132e66 0%, #0d16331c 45%, #090e22bb 100%), url("assets/battle-riverside.webp") !important;
  background-size: cover !important;
  background-position: center 48% !important;
}
.battle-stage.biome-sea {
  background-image: linear-gradient(180deg, #090e2866 0%, #0a132e1c 45%, #06091bbb 100%), url("assets/battle-sea-coast.webp") !important;
  background-size: cover !important;
  background-position: center 44% !important;
}
.battle-stage.biome-wind-cliff {
  background-image: linear-gradient(180deg, #16183055 0%, #1b182c1a 45%, #100c1fbb 100%), url("assets/battle-wind-cliff.webp") !important;
  background-size: cover !important;
  background-position: center 46% !important;
}
.battle-stage.biome-village {
  background-image: linear-gradient(180deg, #1b0e2d66 0%, #1a0f2c22 45%, #0f071cbb 100%), url("assets/battle-outskirts-rift.webp") !important;
  background-size: cover !important;
  background-position: center 45% !important;
}

/* Mythic Boss Sprite & Combat Motion */
.creature-art.mythic-boss-art {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}
.creature-art.mythic-boss-art .mythic-boss-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 12px 22px #070312dd) drop-shadow(0 0 18px #c87eff44);
  transition: transform 0.18s cubic-bezier(0.22, 1, 0.36, 1), filter 0.18s ease;
}
.battle-stage .actor.enemy.mythic-enemy {
  width: 204px;
  height: 204px;
  top: 40px;
}
.creature-art.mythic-boss-art.frame-attack .mythic-boss-img {
  transform: scale(1.13) translateY(12px);
  filter: drop-shadow(0 14px 24px #000) drop-shadow(0 0 24px #ff627e99);
}
.creature-art.mythic-boss-art.frame-ultimate .mythic-boss-img {
  transform: scale(1.18) translateY(8px);
  filter: drop-shadow(0 14px 28px #000) drop-shadow(0 0 32px #ffcf6e);
}
.creature-art.mythic-boss-art.frame-hit .mythic-boss-img {
  transform: scale(0.93) translate(8px, -6px);
  filter: brightness(1.55) drop-shadow(0 0 22px #fff2b2);
}
.creature-art.mythic-boss-art.frame-evade .mythic-boss-img {
  transform: translateX(-18px) scale(0.97);
  opacity: 0.82;
}
.creature-art.mythic-boss-art.frame-guard .mythic-boss-img {
  transform: scale(1.04);
  filter: drop-shadow(0 0 24px #7ef7d4aa);
}

/* Evolved Creature Rotating Arcane Magic Circle Crest */
.creature-art.evolved-crest-art {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.creature-art.evolved-crest-art .evolved-crest-bg {
  position: absolute;
  inset: -8%;
  width: 116%;
  height: 116%;
  object-fit: contain;
  mix-blend-mode: screen;
  opacity: 0.78;
  pointer-events: none;
  z-index: 0;
  animation: evolved-crest-spin 18s linear infinite;
}
.reduce-motion .creature-art.evolved-crest-art .evolved-crest-bg {
  animation: none;
}
@keyframes evolved-crest-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.creature-art.evolved-crest-art .evolved-portrait-img,
.creature-art.evolved-crest-art .atlas-frame {
  position: relative;
  z-index: 1;
}
.creature-art.evolved-crest-art .evolved-portrait-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 8px 16px #090314cc) drop-shadow(0 0 12px #ffd97855);
}

/* Map HUD World Radar Pill */
.region-tabs .region-tab.world-radar-tab {
  background: linear-gradient(135deg, #4b2373eb, #24123df2);
  border: 1px solid #ffd98ecc;
  color: #fff2c6;
  font-weight: 800;
  padding: 5px 10px;
  box-shadow: 0 4px 14px #0b0419aa, 0 0 12px #ffc96633;
}
.region-tabs .region-tab.world-radar-tab.has-live-boss {
  border-color: #ff9c7a;
  box-shadow: 0 4px 14px #0b0419aa, 0 0 14px #ff6e5455;
}

/* World Atlas & 8-Boss Respawn Radar Modal */
.world-atlas-sheet {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.world-atlas-sheet h2 {
  margin: 0;
  font-size: 18px;
  color: #fff2cc;
}
.world-modal-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.world-tab-btn {
  min-height: 36px;
  padding: 5px 8px;
  border-radius: 10px;
  background: #1c102ee6;
  border: 1px solid #9d7ec244;
  color: #d7c7ea;
  font-size: 11.5px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.world-tab-btn.active {
  background: linear-gradient(145deg, #5d2e8c, #331854);
  border-color: #ffe09a;
  color: #fff5d4;
  box-shadow: 0 0 14px #d48cff44;
}
.radar-count {
  padding: 1px 6px;
  border-radius: 999px;
  background: #ff5c6c;
  color: #fff;
  font-size: 10px;
}
.world-atlas-board {
  position: relative;
  width: 100%;
  height: 332px;
  border-radius: 14px;
  overflow: hidden;
  border: 1.5px solid #e0bc7f99;
  box-shadow: 0 8px 24px #070312cc;
  background: #140b22;
}
.world-atlas-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}
.atlas-pin {
  position: absolute;
  transform: translate(-50%, -50%);
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 7px;
  border-radius: 999px;
  background: #1b0e2ee8;
  border: 1px solid #dec08a99;
  color: #f9ecd0;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: 0 3px 10px #06020fcc;
  z-index: 2;
}
.atlas-pin.has-boss {
  border-color: #ff9d78;
  background: linear-gradient(135deg, #4b172ce8, #240e2ee8);
}
.atlas-pin.selected {
  transform: translate(-50%, -50%) scale(1.1);
  border: 1.5px solid #82f4d2;
  background: linear-gradient(135deg, #214d52f5, #2b1847f5);
  color: #ffffff;
  box-shadow: 0 0 16px #7ef7d4aa;
  z-index: 4;
}
.atlas-pin-dot {
  font-size: 11px;
  line-height: 1;
}
.world-region-card {
  padding: 9px 11px;
  border-radius: 12px;
  background: linear-gradient(160deg, #27153ce8, #160b24f2);
  border: 1px solid #d8b47766;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.world-region-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}
.world-region-head strong {
  display: block;
  font-size: 13.5px;
  color: #fff0c4;
}
.world-region-head small {
  font-size: 10.5px;
  color: #cbbbe0;
}
.world-region-bgm {
  padding: 2px 7px;
  border-radius: 999px;
  background: #362052;
  border: 1px solid #b694dc55;
  color: #e8d8ff;
  font-size: 9.5px;
  font-weight: 700;
  white-space: nowrap;
}
.world-region-bosses {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.region-boss-chip {
  width: 100%;
  text-align: left;
  padding: 6px 9px;
  border-radius: 9px;
  font-size: 11px;
  font-weight: 800;
}
.region-boss-chip.live {
  background: linear-gradient(135deg, #69213e, #3a1438);
  border: 1px solid #ffb088;
  color: #fff2dc;
}
.region-boss-chip.wait,
.region-boss-chip.safe {
  background: #1a0f2bd9;
  border: 1px solid #9378b544;
  color: #d5c6e8;
}

/* 8 Mythical Boss Radar List */
.world-radar-caption {
  margin: 0;
  font-size: 10.5px;
  line-height: 1.35;
  color: #d6c7ea;
  word-break: keep-all;
}
.mythic-radar-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 430px;
  overflow-y: auto;
  padding-right: 2px;
}
.mythic-radar-row {
  display: grid;
  grid-template-columns: 52px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 11px;
  background: linear-gradient(155deg, #25143ae8, #150b24f2);
  border: 1px solid #b894d844;
}
.mythic-radar-row.is-live {
  border-color: #ffad84aa;
  box-shadow: inset 0 0 14px #ff6a4d1f;
}
.mythic-thumb {
  position: relative;
  width: 50px;
  height: 50px;
  border-radius: 10px;
  background: radial-gradient(circle, #3d215c, #170b26);
  border: 1px solid #e0be8466;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.mythic-thumb img {
  width: 46px;
  height: 46px;
  object-fit: contain;
}
.mythic-owned-dot {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #236e5c;
  border: 1px solid #82f4d2;
  color: #dcfff4;
  font-size: 8.5px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mythic-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.mythic-title-line {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}
.mythic-title-line strong {
  font-size: 12.5px;
  color: #fff2cd;
}
.mythic-title-line small {
  font-size: 10px;
  color: #cbb8e2;
  font-weight: 600;
}
.mythic-tier-chip {
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 9.5px;
  font-weight: 800;
  background: #352052;
  color: #ffe3a2;
  border: 1px solid #dfb97566;
}
.mythic-tier-chip.boss {
  background: #571d3b;
  color: #ffd5c2;
  border-color: #ff9a7b88;
}
.mythic-sub-line {
  font-size: 10px;
  color: #c7b6dc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mythic-timer-line {
  font-size: 10px;
  font-weight: 800;
}
.mythic-timer-line.live {
  color: #9dfbe3;
}
.mythic-timer-line.wait {
  color: #ffd29c;
}
.mythic-raid-btn {
  min-width: 58px;
  min-height: 34px;
  padding: 4px 10px;
  border-radius: 9px;
  font-size: 11px;
  font-weight: 800;
}
.mythic-summon-btn {
  min-width: 58px;
  min-height: 34px;
  padding: 3px 7px;
  border-radius: 9px;
  font-size: 9.5px;
  line-height: 1.15;
  font-weight: 800;
}
.dex-card.mythic-dex-card {
  border-color: #e4ba7888;
  background: linear-gradient(165deg, #321949e8, #190c28f5);
}

/* One-Thumb Map Dock: All required map controls stay inside the lower 40% (ANTIGRAVITY-001 §3.4, D-6). */
.map-view .map-hud {
  padding: 0 14px;
  pointer-events: none;
}
.map-view .map-hud .topbar {
  min-height: calc(56px + var(--safe-top));
  height: auto;
  padding-top: calc(6px + var(--safe-top));
  padding-bottom: 6px;
}
.map-view .map-dock {
  left: 12px;
  right: 12px;
  bottom: calc(76px + var(--safe));
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.map-view .map-dock-head {
  display: flex;
  align-items: stretch;
  gap: 6px;
}
.map-view .map-dock-head .quest-ribbon {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 48px;
  padding: 6px 10px;
  margin: 0;
}
.map-view .map-dock-head .quest-ribbon small {
  font-size: 9.5px;
  margin-bottom: 1px;
}
.map-view .map-dock-head .quest-ribbon strong {
  font-size: 11.5px;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.map-view .map-dock-head .quest-ribbon > .quest-go-chip {
  flex: 0 0 auto;
  width: auto;
  padding: 4px 9px;
  white-space: nowrap;
}
.map-companion {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.map-companion .creature-art,
.map-companion .creature-art.atlas-art {
  container-type: normal;
}
.map-companion .creature-art .atlas-frame {
  width: 100%;
  height: 100%;
  filter: none;
}
.map-view .map-dock-head .map-companion {
  position: static;
  flex: 0 0 auto;
  width: auto;
  min-width: 96px;
  max-width: 128px;
  min-height: 48px;
  padding: 4px 8px;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  border-radius: 11px;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.map-view .map-dock-head .map-companion-art {
  display: block;
  position: relative;
  width: 38px;
  height: 38px;
  min-width: 38px;
  min-height: 38px;
  flex: 0 0 38px;
  filter: none;
}
.map-view .map-dock-head .map-companion .creature-art,
.map-view .map-dock-head .map-companion .creature-art.atlas-art {
  container-type: normal;
  display: block;
  position: relative;
  width: 38px;
  height: 38px;
  min-width: 38px;
  min-height: 38px;
  flex: 0 0 38px;
  margin: 0;
  filter: none;
}
.map-view .map-dock-head .map-companion .creature-art .atlas-frame {
  position: relative;
  display: block;
  width: 38px;
  height: 38px;
  overflow: hidden;
  filter: none;
}
.map-view .map-dock-head .map-companion .creature-art.evolved:after {
  font-size: 11px;
  top: -2px;
  right: -2px;
}
.map-view .map-dock-head .map-companion-name {
  font-size: 10.5px;
  font-weight: 700;
  max-width: 68px;
  text-align: left;
}
.map-view .map-dock .region-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin: 0;
}
.map-view .map-dock .region-tab {
  min-height: 44px;
  padding: 4px 5px;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 700;
}
.map-view .map-dock .region-tab .ui-icon {
  width: 16px;
  height: 16px;
}
.map-view .map-dock .map-utilities {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin: 0;
}
.map-view .map-dock .map-utilities button {
  min-height: 44px;
  padding: 4px 6px;
  font-size: 10.5px;
  font-weight: 700;
  gap: 4px;
}
.map-view .map-dock .map-utilities button.has-live-boss {
  border-color: #ff9c7a;
  box-shadow: 0 0 12px #ff6e5444;
}

/* Thumb controls and companion panels */
.region-arriving { animation: region-arrival .26s ease-out both; }
@keyframes region-arrival { from { opacity: .26; } to { opacity: 1; } }
.map-view .region-tab.is-locked { opacity: .62; }
.ally-side-label { color: #f6d88f; font-size: 10px; font-weight: 800; }
.battle-view .battle-stage.has-support .status-box.enemy-status { right: auto; width: min(61%, 248px); }
.battle-view .battle-stage.has-support .status-box.support-status { top: 82px; left: 0; right: auto; }
.battle-view .battle-stage .actor.enemy.mythic-enemy { right: 0; left: auto; top: 12%; width: 63%; height: 67%; }
.battle-view .battle-stage .weakened-badge { font-size: 8px; padding-inline: 4px; }
.battle-view .battle-stage .enemy-title-group { flex-wrap: wrap; min-width: 0; }
.battle-view .battle-stage .enemy-title-group strong,
.battle-view .ally-status-head strong { overflow-wrap: anywhere; }
.lineup { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
.field-lineup { grid-template-columns: repeat(3, minmax(0, 1fr)) 50px; }
.lineup-slot, .lineup-edit {
  position: relative; display: flex; align-items: center; justify-content: center;
  min-width: 0; min-height: 44px; padding: 3px 4px; gap: 3px; border-radius: 9px;
  border: 1px solid #8f6aaa; background: #221631f5; color: #fff2d4;
}
.lineup-edit { font-size: 11px; font-weight: 750; }
.lineup-slot.is-lead { border-color: #edc47a; background: #4a2c52; }
.lineup-slot.is-fainted { opacity: .6; }
.lineup-slot.empty { border-style: dashed; color: #ddc9e6; font-size: 10px; }
.battle-lineup .lineup-slot.empty { opacity: .68; }
.lineup-slot .creature-art, .swap-card .creature-art { width: 30px; height: 30px; flex: none; }
.lineup-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; font-weight: 700; }
.lineup-slot.is-lead .lineup-name { padding-top: 9px; }
.lead-mark { position: absolute; top: 2px; right: 4px; color: #ffe3a2; font-size: 8px; font-weight: 800; }
.lineup-hp { position: absolute; inset: auto 6px 3px; height: 3px; border-radius: 5px; background: #090612; overflow: hidden; }
.lineup-hp i { display: block; height: 100%; background: #8ae8bd; }
.battle-lineup .lineup-slot { padding-bottom: 6px; }
.modal-root:has(.battle-sheet) { align-items: end; padding: 0; }
.modal-root .battle-sheet {
  width: min(100%, 530px); max-height: min(40dvh, 360px); overflow: auto;
  padding: 12px 14px calc(10px + var(--safe)); border-radius: 20px 20px 0 0;
  animation: battle-sheet-in .2s ease-out both;
}
@keyframes battle-sheet-in { from { transform: translateY(32px); opacity: .5; } }
.battle-sheet h2 { font-size: 20px; margin: 0 0 4px; }
.battle-sheet p { margin: 0 0 8px; font-size: 12px; }
.battle-sheet-list { display: grid; gap: 6px; }
.battle-sheet .sheet-cancel { width: 100%; min-height: 44px; margin-top: 6px; }
.battle-sheet .skill-choice { min-height: 49px; display: grid; text-align: left; }
.skill-choice small { color: #e0c9eb; }
.swap-card {
  display: grid; grid-template-columns: 50px minmax(0,1fr); gap: 10px; align-items: center;
  padding: 6px 10px; text-align: left; color: #fff0d1; background: #352144;
  border: 1px solid #c495cb; border-radius: 10px;
}
.swap-card:disabled { opacity: .62; }
.swap-card .creature-art { width: 50px; height: 50px; }
.swap-card strong { font-size: 12px; }
.swap-card .hp-track, .swap-card .mp-track { display: block; height: 4px; margin: 3px 0 0; }
.swap-card .status-sub, .swap-card .mp-sub-row { font-size: 9px; line-height: 1; }
html.reduce-motion :is(.region-arriving, .battle-sheet, .actor.ally.swap-out, .actor.ally.swap-in, .actor.ally.hit) { animation: none; }
html.reduce-motion .battle-view .actor.ally:is(.hit,.strike) { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  :is(.region-arriving, .battle-sheet, .battle-view .actor.ally.swap-out, .battle-view .actor.ally.swap-in, .battle-view .actor.ally.hit) { animation: none; }
  .battle-view .actor.ally.strike, .battle-view .actor.ally.skill-flare { animation: none; }
}

.map-world .map-point[data-field-boss] {
  min-width: 106px; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto;
  gap: 2px 5px; padding: 5px 8px; border-radius: 12px; z-index: 9; text-align: left;
}
.map-world .map-point[data-field-boss] > span:first-child { grid-row: 1 / 3; }
.map-world .map-point[data-field-boss] > small { grid-column: 2; }
.map-world .map-point[data-field-boss] .boss-pin-state {
  grid-column: 2; display: block; white-space: nowrap; font-size: 10px;
  line-height: 1.15; color: #ffdfa5; font-variant-numeric: tabular-nums;
}
.map-world .map-point[data-boss-status="locked"] .boss-pin-state,
.map-world .map-point[data-boss-status="waiting"] .boss-pin-state { color: #dec5e9; }
.map-world .map-point[data-boss-status="returned"] { animation: boss-pin-ready 1.7s ease-in-out infinite; }
@keyframes boss-pin-ready {
  0%,100% { box-shadow: 0 0 0 3px #ffd08b4d; }
  50% { box-shadow: 0 0 0 7px #ffae5538, 0 0 16px #ffd283ad; }
}
html.reduce-motion .map-world .map-point[data-boss-status="returned"] { animation: none; border-color: #ffe39a; }
@media(prefers-reduced-motion:reduce) {
  .map-world .map-point[data-boss-status="returned"] { animation: none; border-color: #ffe39a; }
}

/* Standalone evolved art does not need the circular atlas backdrop. */
.creature-art.new-evolution-art > .evolved-portrait-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
