/* WE 王國｜GM 紙娃娃第一階段：GM Exclusive 分層素材 */
.kingdom-gm-character-stage {
  isolation: isolate;
}

.kingdom-gm-paper-layer {
  position: absolute;
  left: 50%;
  pointer-events: none;
  user-select: none;
  object-fit: contain;
  object-position: center;
  transform: translateX(-50%);
  transition: opacity .24s ease, filter .24s ease, transform .24s ease;
}

.kingdom-gm-layer-effect {
  z-index: 1;
  bottom: 0;
  width: min(92%, 620px);
  height: 48%;
  opacity: .72;
  mix-blend-mode: screen;
  filter: drop-shadow(0 0 30px rgba(185, 92, 255, .48));
}

.kingdom-gm-layer-back {
  z-index: 2;
  top: 21%;
  width: min(78%, 500px);
  height: 56%;
  opacity: .82;
  filter: drop-shadow(0 0 22px rgba(157, 70, 232, .38));
}

.kingdom-gm-body-art {
  z-index: 3 !important;
}

.kingdom-gm-layer-body {
  z-index: 4;
  top: 23%;
  width: min(49%, 315px);
  height: 46%;
  opacity: .86;
  filter: drop-shadow(0 8px 16px rgba(0,0,0,.38));
}

.kingdom-gm-layer-head {
  z-index: 5;
  top: 13%;
  width: min(22%, 142px);
  height: 16%;
  opacity: .96;
  filter: drop-shadow(0 0 13px rgba(235, 194, 84, .44));
}

.kingdom-gm-layer-weapon {
  z-index: 6;
  bottom: 6%;
  width: min(56%, 360px);
  height: 58%;
  opacity: .9;
  filter: drop-shadow(0 0 22px rgba(175, 82, 248, .48));
}

.kingdom-gm-stage-crest,
.kingdom-gm-stage-caption,
.kingdom-gm-avatar-column {
  z-index: 9 !important;
}

.kingdom-gm-title-art {
  display: block;
  max-width: min(300px, 72%);
  max-height: 52px;
  margin-top: 7px;
  object-fit: contain;
  object-position: left center;
  filter: drop-shadow(0 0 12px rgba(136, 52, 196, .28));
}

.kingdom-gm-portrait-ring {
  isolation: isolate;
}

.kingdom-gm-portrait-ring > img[data-gm-portrait] {
  position: relative;
  z-index: 2;
}

.kingdom-gm-portrait-frame {
  position: absolute;
  inset: -8px;
  z-index: 4;
  width: calc(100% + 16px) !important;
  height: calc(100% + 16px) !important;
  object-fit: contain !important;
  border-radius: 0 !important;
  pointer-events: none;
  filter: drop-shadow(0 0 10px rgba(213, 170, 72, .28));
}

.kingdom-gm-portrait-ring > button {
  z-index: 6 !important;
}

.kingdom-gm-slot-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.kingdom-gm-slot-copy small {
  color: #9f69ca;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.kingdom-gm-slot-thumb {
  overflow: hidden;
}

.kingdom-gm-slot-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0 7px rgba(156, 67, 225, .28));
}

.kingdom-gm-exclusive-notice {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 10px;
  padding: 9px 12px;
  border: 1px solid rgba(224, 184, 76, .34);
  background: linear-gradient(90deg, rgba(58, 16, 87, .72), rgba(10, 9, 15, .72));
}

.kingdom-gm-exclusive-notice img {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.kingdom-gm-exclusive-notice div {
  min-width: 0;
}

.kingdom-gm-exclusive-notice strong,
.kingdom-gm-exclusive-notice span {
  display: block;
}

.kingdom-gm-exclusive-notice strong {
  color: #f3d67c;
  font-size: 12px;
  letter-spacing: .16em;
}

.kingdom-gm-exclusive-notice span {
  margin-top: 2px;
  color: rgba(231, 219, 191, .7);
  font-size: 10px;
}

.kingdom-gm-main-action {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.kingdom-gm-main-action::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: var(--gm-btn-art);
  background-repeat: no-repeat;
  background-position: center;
  background-size: 100% 100%;
  opacity: .44;
}

.kingdom-gm-main-action span {
  position: relative;
  z-index: 2;
}

.kingdom-gm-main-action[data-saved='true'] {
  box-shadow: 0 0 20px rgba(192, 102, 255, .38), inset 0 0 16px rgba(202, 125, 255, .18);
}

.kingdom-gm-stage.is-gm-previewing .kingdom-gm-body-art {
  animation: kingdom-gm-body-pulse 1.55s ease-in-out;
}

.kingdom-gm-stage.is-gm-previewing .kingdom-gm-layer-back {
  animation: kingdom-gm-back-flare 1.55s ease-in-out;
}

.kingdom-gm-stage.is-gm-previewing .kingdom-gm-layer-weapon {
  animation: kingdom-gm-weapon-flare 1.55s ease-in-out;
}

.kingdom-gm-stage.is-gm-previewing .kingdom-gm-layer-effect {
  animation: kingdom-gm-aura-flare 1.55s ease-in-out;
}

.kingdom-gm-stage.is-gm-previewing .kingdom-gm-stage-crest {
  animation: kingdom-gm-crest-flare 1.55s ease-in-out;
}

@keyframes kingdom-gm-body-pulse {
  0%, 100% { transform: translateX(-50%) scale(1); filter: drop-shadow(0 18px 24px rgba(0,0,0,.64)) drop-shadow(0 0 12px rgba(123,44,183,.15)); }
  38% { transform: translateX(-50%) scale(1.025); filter: drop-shadow(0 18px 24px rgba(0,0,0,.6)) drop-shadow(0 0 32px rgba(192,94,255,.76)) brightness(1.08); }
  68% { transform: translateX(-50%) scale(1.008); filter: drop-shadow(0 18px 24px rgba(0,0,0,.62)) drop-shadow(0 0 20px rgba(164,72,239,.48)); }
}

@keyframes kingdom-gm-back-flare {
  0%, 100% { opacity: .82; transform: translateX(-50%) scale(1); }
  45% { opacity: 1; transform: translateX(-50%) scale(1.055); filter: drop-shadow(0 0 34px rgba(197, 101, 255, .78)) brightness(1.08); }
}

@keyframes kingdom-gm-weapon-flare {
  0%, 100% { opacity: .9; transform: translateX(-50%) scale(1); }
  45% { opacity: 1; transform: translateX(-50%) scale(1.06); filter: drop-shadow(0 0 38px rgba(213, 122, 255, .92)) brightness(1.18); }
}

@keyframes kingdom-gm-aura-flare {
  0%, 100% { opacity: .72; transform: translateX(-50%) scale(1); }
  45% { opacity: 1; transform: translateX(-50%) scale(1.08); filter: drop-shadow(0 0 46px rgba(202, 113, 255, .9)) brightness(1.2); }
}

@keyframes kingdom-gm-crest-flare {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 12px rgba(151,67,225,.38)); }
  45% { transform: scale(1.08); filter: drop-shadow(0 0 27px rgba(211,130,255,.9)) brightness(1.12); }
}

@media (max-width: 760px) {
  .kingdom-gm-layer-head {
    top: 14%;
    width: 26%;
  }

  .kingdom-gm-layer-body {
    top: 24%;
    width: 56%;
  }

  .kingdom-gm-layer-back {
    top: 24%;
    width: 86%;
  }

  .kingdom-gm-layer-weapon {
    width: 66%;
  }

  .kingdom-gm-title-art {
    max-width: 230px;
  }
}
