.dmajin-companion-root {
  position: fixed;
  z-index: 750;
  pointer-events: none;
  bottom: 1.25rem;
  right: 1.1rem;
  width: 56px;
  height: 56px;
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.dmajin-companion-root.hidden {
  opacity: 0;
  transform: translateY(12px) scale(0.85);
  visibility: hidden;
}

.dmajin-companion-root--game {
  bottom: 5.5rem;
  right: 1rem;
}

.dmajin-companion-float {
  position: relative;
  width: 100%;
  height: 100%;
  animation: companion-float 3.6s ease-in-out infinite;
  will-change: transform;
}

.dmajin-companion-float--reduced {
  animation: companion-float-reduced 5s ease-in-out infinite;
}

.dmajin-companion-glow {
  position: absolute;
  left: 50%;
  top: 58%;
  width: 70%;
  height: 28%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(0, 245, 212, 0.35) 0%, rgba(0, 245, 212, 0) 72%);
  animation: companion-glow 3.6s ease-in-out infinite;
  pointer-events: none;
}

.dmajin-companion-sprite {
  position: relative;
  z-index: 1;
  width: 56px;
  height: 56px;
  image-rendering: pixelated;
  background-repeat: no-repeat;
  background-size: 400% 400%;
  filter: drop-shadow(0 3px 10px rgba(0, 245, 212, 0.28));
  animation: companion-sway 4.8s ease-in-out infinite;
  will-change: transform, background-position;
}

@keyframes companion-float {
  0%, 100% {
    transform: translateY(0) translateX(0);
  }
  35% {
    transform: translateY(-7px) translateX(2px);
  }
  70% {
    transform: translateY(-3px) translateX(-2px);
  }
}

@keyframes companion-float-reduced {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

@keyframes companion-sway {
  0%, 100% {
    transform: rotate(-1.5deg) scale(1);
  }
  50% {
    transform: rotate(1.5deg) scale(1.03);
  }
}

@keyframes companion-glow {
  0%, 100% {
    opacity: 0.45;
    transform: translate(-50%, -50%) scale(0.92);
  }
  50% {
    opacity: 0.75;
    transform: translate(-50%, -50%) scale(1.08);
  }
}

.companion-contract-wrap {
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(0, 245, 212, 0.18);
}

.companion-contract-hint {
  margin: 0.5rem 0 0;
  font-size: 0.82rem;
  color: #9ca3af;
  line-height: 1.45;
}

.companion-contract-btn {
  width: 100%;
  margin-top: 0.35rem;
}

.quest-access-wrap {
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(126, 200, 227, 0.2);
}

.quest-access-hint {
  color: rgba(238, 242, 240, 0.65);
  font-size: 0.82rem;
  line-height: 1.45;
  margin: 0;
}

.quest-access-btn {
  display: block;
  margin-top: 0.35rem;
  text-align: center;
  width: 100%;
}

.companion-profile-card .companion-profile-preview {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 0.5rem 0 0.75rem;
}

.companion-profile-preview .dmajin-companion-float {
  flex-shrink: 0;
  width: 64px;
  height: 64px;
}

.companion-profile-preview .dmajin-companion-sprite {
  width: 64px;
  height: 64px;
}

.companion-profile-status {
  margin: 0;
  font-size: 0.9rem;
  color: #d1d5db;
}

.companion-profile-name {
  margin: 0.15rem 0 0;
  font-weight: 600;
  color: var(--turquoise, #00f5d4);
}

@media (max-width: 600px) {
  .dmajin-companion-root {
    width: 48px;
    height: 48px;
    bottom: 1rem;
    right: 0.75rem;
  }
  .dmajin-companion-sprite {
    width: 48px;
    height: 48px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .dmajin-companion-float,
  .dmajin-companion-sprite,
  .dmajin-companion-glow {
    animation-duration: 6s;
  }
}
