.guide-entry-portal,
.free-chaos-portal,
.free-guide-crack,
.guide-impact.guide-impact-breach {
  --portal-art: url('/assets/guide/amethyst-rift.v2.webp');
  background: var(--portal-art) center / contain no-repeat;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  pointer-events: none;
}

.guide-entry-portal {
  left: 31%;
  top: 8%;
  width: 84%;
  height: 100%;
  aspect-ratio: auto;
  filter: drop-shadow(0 0 15px #9847ff87);
  transform-origin: 52% 56%;
  animation: amethyst-rift-breathe 2.3s ease-in-out infinite;
}

.guide-entry-portal::before,
.guide-entry-portal::after,
.guide-entry-portal i,
.guide-impact-breach svg {
  display: none;
}

.guide-entry-portal--anchored {
  inset: auto clamp(8px,3vw,52px) clamp(35px,7vh,100px) auto;
  width: clamp(105px,15vw,224px);
  height: clamp(176px,28vw,320px);
}

.guide-character-stage { z-index: 2; }

.guide-impact.guide-impact-breach {
  width: clamp(110px, 12vw, 190px);
  height: clamp(170px, 20vw, 270px);
  filter: drop-shadow(0 0 19px #9240ffb3);
  animation: amethyst-rift-breathe 1.9s ease-in-out infinite;
  translate: -50% -50%;
  transform: none;
}

.guide-impact-breach b {
  position: absolute;
  inset: auto 0 12%;
  text-align: center;
  text-shadow: 0 2px 8px #070315;
}

.free-chaos-portal {
  left: 20%;
  top: 3%;
  width: 85%;
  height: 102%;
  filter: drop-shadow(0 0 15px #9847ff87);
}

.free-chaos-guide.portal .free-chaos-portal {
  animation: amethyst-rift-breathe 2.3s ease-in-out infinite;
}

.free-guide-crack {
  width: 136px;
  height: 210px;
  filter: drop-shadow(0 0 19px #9240ffb3);
}

.free-chaos-stage {
  transition-duration: var(--free-guide-duration, 850ms);
}

.guide-character-button,
.free-chaos-person {
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.guide-character-button:focus-visible,
.free-chaos-person:focus-visible {
  outline: 2px solid #c69cff;
  outline-offset: 3px;
  border-radius: 12px;
}

.is-dragging .guide-character-button,
.is-dragging .free-chaos-person { cursor: grabbing; }

.is-dragging .guide-character-stage,
.is-dragging .free-chaos-stage { animation: none; transition: none; }

.guide-character-button img,
.free-chaos-person img { pointer-events: none; }

.guide-speech,
.free-chaos-speech { pointer-events: none; }

.speech-right .free-chaos-speech {
  left: calc(100% - 20px);
  right: auto;
}

.guide-resource-flight {
  position: absolute;
  width: 44px;
  height: 44px;
  object-fit: contain;
  top: 0;
  left: 0;
  z-index: 8;
  pointer-events: none;
  filter: drop-shadow(0 0 12px #c461ff);
}

.guide-staff-hit {
  position: absolute;
  width: 56px;
  height: 56px;
  z-index: 8;
  pointer-events: none;
  background:
    radial-gradient(circle, #fff 0 5%, #eac7ff 6% 10%, #9c38e479 15%, transparent 46%),
    conic-gradient(from 27deg, transparent 0 12%, #d394ff 13%, transparent 14% 39%, #e1b0ff 40%, transparent 41% 67%, #d394ff 68%, transparent 69% 88%, #b25aff 89%, transparent 90%);
  border-radius: 50%;
  mix-blend-mode: screen;
  animation: guide-staff-flash 700ms cubic-bezier(.12,.6,.2,1) both;
}

@keyframes amethyst-rift-breathe {
  0%,100% { scale: .94 .96; opacity: .87; }
  45% { scale: 1.04 1.025; opacity: 1; }
  62% { scale: 1.02 .99; opacity: .93; }
}

@keyframes guide-staff-flash {
  0% { transform: translate(-50%,-50%) rotate(-14deg) scale(.2); opacity: .8; }
  20% { opacity: 1; }
  100% { transform: translate(-50%,-50%) rotate(25deg) scale(1.35); opacity: 0; }
}

@media (max-width: 720px) {
  .guide-resource-flight { width: 33px; height: 33px; }
  .guide-speech,
  .free-chaos-speech { max-width: min(210px, 61vw); }
}

@media (prefers-reduced-motion: reduce) {
  .galaxy-guide *,
  .free-chaos-guide * { animation: none !important; transition: none !important; }
}
