/* Partners share the same battlefield composition on desktop and mobile. */
#battle-root #battle-party {
  flex-basis: 40%;
  max-width: 40%;
  pointer-events: auto;
}
#battle-root #hud-ally {
  flex-basis: 24%;
}
.party-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5cqw;
  min-height: 6cqh;
}
.party-readout {
  min-width: 0;
  font-size: clamp(10px, 1.1cqw, 18px);
}
.partner-slots {
  display: flex;
  gap: 0.35cqw;
  flex-shrink: 0;
}
.partner-button {
  position: relative;
  width: 4.7cqw;
  height: 6.4cqh;
  min-width: 32px;
  min-height: 28px;
  padding: 0;
  border: 1px solid #91aebf;
  border-radius: 5px;
  background: #162c3d;
  overflow: hidden;
  cursor: pointer;
  touch-action: manipulation;
}
.partner-button img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
#battle-party .partner-button span {
  position: absolute;
  inset: auto 0 0;
  background: #071420d9;
  color: white;
  font: bold clamp(8px, 0.85cqw, 14px)/1.15 system-ui;
  text-align: center;
}
.partner-button:disabled {
  filter: grayscale(0.65);
  opacity: 0.55;
  cursor: default;
}
.partner-button:focus-visible {
  outline: 3px solid #ffd575;
}
.partner-auto,
#partner-cancel {
  position: absolute;
  z-index: 30;
  background: #142938e8;
  color: #eef7ff;
  border: 1px solid #84acbb;
  border-radius: 6px;
  padding: 8px 12px;
  font: 600 clamp(11px, 1.2cqw, 19px) system-ui;
  min-height: 34px;
  touch-action: manipulation;
}
.partner-auto {
  right: 12%;
  top: 2%;
}
#partner-cancel {
  left: 40%;
  bottom: 25%;
}
.partner-auto[hidden],
#partner-cancel[hidden],
.partner-slots[hidden] {
  display: none !important;
}
.partner-cut {
  position: absolute;
  inset: 12% 0 20%;
  z-index: 45;
  overflow: hidden;
  pointer-events: none;
  background: linear-gradient(110deg, #081627ef, #28516cdf, #071520bb);
  border-block: 2px solid #abd5e4;
  animation: partner-cut-in 0.16s ease-out both;
}
.partner-cut img {
  position: absolute;
  height: 150%;
  bottom: -50%;
  left: 12%;
  object-fit: contain;
}
.partner-cut strong {
  position: absolute;
  right: 8%;
  top: 44%;
  font: bold clamp(18px, 3cqw, 48px) system-ui;
  color: #fff;
  text-shadow: 0 3px 8px #000;
}
.partner-field {
  position: absolute;
  height: auto;
  max-height: 85%;
  object-fit: contain;
  z-index: 19;
  pointer-events: none;
  filter: drop-shadow(0 0 7px #b8e0ff77);
}
.partner-fx {
  position: absolute;
  z-index: 24;
  pointer-events: none;
  width: 15%;
  aspect-ratio: 1;
  translate: -50% -50%;
  opacity: 0;
}
.partner-hit-burst {
  background: conic-gradient(
    transparent,
    #fff3b5,
    transparent,
    #fff,
    transparent,
    #e49640,
    transparent
  );
  border-radius: 50%;
  animation: partner-impact 0.32s ease-out both;
}
.partner-shield-burst {
  border: 5px solid #acecff;
  border-radius: 50%;
  box-shadow:
    0 0 22px #81d9ff,
    inset 0 0 20px #81d9ff;
  animation: partner-impact 0.4s ease-out both;
}
.partner-rail {
  position: absolute;
  height: 6px;
  background: #faffff;
  box-shadow: 0 0 12px 4px #f6b460;
  transform-origin: left center;
  z-index: 22;
  pointer-events: none;
  animation: partner-rail-fade 0.25s both;
}
.partner-survival {
  filter: drop-shadow(0 0 14px #99f2ff);
}
.partner-roster label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 6px 16px 6px 0;
  max-width: 100%;
}
.partner-roster select {
  max-width: 65vw;
  background: #253e50;
  color: white;
  border: 1px solid #8aa5b4;
  padding: 9px;
  border-radius: 5px;
  font: inherit;
}
.partner-card {
  display: flow-root;
}
.partner-card img {
  float: left;
  width: 68px;
  height: 68px;
  object-fit: cover;
  margin: 6px 14px 6px 0;
  border-radius: 8px;
  background: #1c3446;
}
@keyframes partner-cut-in {
  from {
    translate: -100% 0;
  }
  to {
    translate: 0 0;
  }
}
@keyframes partner-impact {
  0% {
    opacity: 1;
    scale: 0.3;
  }
  30% {
    opacity: 1;
    scale: 1;
  }
  100% {
    opacity: 0;
    scale: 1.6;
  }
}
@keyframes partner-rail-fade {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

#world-root.world-story-scene
  #world-portrait:is(
    [data-portrait^="akihiro_"],
    [data-portrait^="shino_"],
    [data-portrait^="ryuga_"]
  ) {
  --dialogue-portrait-height: 105dvh;
  --dialogue-portrait-top: 4dvh;
}

#battle-root #battle-party[hidden] { display: none; }
