/* Character Animation Container */

.character-welcome {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: var(--space-4);
}

.character-container {
  position: relative;
  width: 280px;
  height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Removed white backgrounds and borders */
  background: transparent;
  border: none;
}

.character-glow {
  position: absolute;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(108, 99, 255, 0.12) 0%, transparent 70%);
  animation: float 4s ease-in-out infinite;
}

.character-img {
  width: 240px;
  height: 240px;
  object-fit: contain;
  border-radius: 50%;
  position: relative;
  z-index: 2;
  transition: opacity 0.4s ease, transform 0.4s ease;
  filter: drop-shadow(0 8px 24px rgba(108, 99, 255, 0.15));
}

.character-img.switching {
  opacity: 0;
  transform: scale(0.9);
}

.character-status {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-3);
  padding: var(--space-1) var(--space-3);
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border-light);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-accent-green);
  animation: pulse 2s ease-in-out infinite;
}

/* Floating Character (Chat Mode) */
.character-floating {
  position: fixed;
  top: 50%;
  right: 24px;
  transform: translateY(-50%);
  z-index: 30;
  display: none;
  flex-direction: column;
  align-items: center;
  animation: slideInRight 0.5s ease;
}

.character-floating.active {
  display: flex;
}

.character-floating .character-container {
  width: 240px;
  height: 240px;
}

.character-floating .character-glow {
  width: 220px;
  height: 220px;
}

.character-floating .character-img {
  width: 200px;
  height: 200px;
}

.character-floating .character-frame {
  padding: var(--space-3);
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: none;
  border-radius: var(--radius-2xl);
  /* Enhanced shadow for transparent floating look */
  filter: drop-shadow(0 15px 35px rgba(108, 99, 255, 0.2));
  cursor: grab;
  touch-action: none;
  user-select: none;
  transition: transform var(--transition-normal), filter var(--transition-normal);
}

.character-floating.dragging .character-frame {
  cursor: grabbing;
  transform: scale(1.05);
  filter: drop-shadow(0 20px 45px rgba(108, 99, 255, 0.4));
}

.character-floating .character-frame:hover {
  transform: scale(1.05);
  filter: drop-shadow(0 20px 45px rgba(108, 99, 255, 0.3));
}

.character-expression {
  margin-top: var(--space-2);
  padding: var(--space-1) var(--space-3);
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  white-space: nowrap;
  animation: fadeIn 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Click Reaction Speech Bubble (Side) */
.reaction-bubble {
  position: absolute;
  top: 10px;
  right: -60px;
  background: var(--color-surface-solid);
  color: var(--color-text);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-lg) var(--radius-lg) var(--radius-lg) 0;
  box-shadow: var(--shadow-md);
  font-size: var(--text-sm);
  font-weight: 500;
  z-index: 20;
  opacity: 0;
  transform: translateY(10px) scale(0.9);
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  white-space: nowrap;
  max-width: 200px;
  border: 1px solid var(--glass-border-light);
}

.reaction-bubble::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 10px;
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 6px solid var(--color-surface-solid);
}

.reaction-bubble.show {
  opacity: 1;
  transform: translateY(0) scale(1);
  animation: floatSmall 3s ease-in-out infinite alternate;
}

@keyframes floatSmall {
  0% { transform: translateY(0) scale(1); }
  100% { transform: translateY(-4px) scale(1); }
}

@media (max-width: 768px) {
  .reaction-bubble {
    right: -20px;
    top: 0px;
    font-size: var(--text-xs);
  }
}

/* Special Effect States */
.character-container.boss-mode .character-img {
  filter: drop-shadow(0 0 20px rgba(108, 99, 255, 0.5));
}

.character-container.hacker-mode .character-img {
  filter: drop-shadow(0 0 15px rgba(0, 255, 0, 0.4));
}

.character-container.love-mode .character-img {
  filter: drop-shadow(0 0 15px rgba(255, 107, 157, 0.5));
}

.character-container.dance-mode {
  animation: danceBounce 0.5s ease infinite;
}

@keyframes danceBounce {

  0%,
  100% {
    transform: translateY(0) rotate(0);
  }

  25% {
    transform: translateY(-8px) rotate(-3deg);
  }

  75% {
    transform: translateY(-8px) rotate(3deg);
  }
}

.character-container.supersaiyan-mode .character-img {
  filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.6)) brightness(1.1);
}

.character-container.supersaiyan-mode {
  animation: energyShake 0.1s ease infinite;
}

@keyframes energyShake {

  0%,
  100% {
    transform: translate(0);
  }

  25% {
    transform: translate(1px, -1px);
  }

  75% {
    transform: translate(1px, 1px);
  }
}

.character-container.magic-mode .character-img {
  animation: magicGlow 1.5s ease-in-out infinite alternate;
}

@keyframes magicGlow {
  from {
    filter: drop-shadow(0 0 15px rgba(148, 103, 255, 0.4));
  }

  to {
    filter: drop-shadow(0 0 30px rgba(148, 103, 255, 0.7)) brightness(1.1);
  }
}

.character-container.sleeping-mode {
  opacity: 0.8;
}

.zzz-container {
  position: absolute;
  top: -10px;
  right: -10px;
  z-index: 5;
  font-size: var(--text-lg);
  color: var(--color-primary);
}

.zzz {
  animation: zzzFloat 2s ease-in-out infinite;
  display: inline-block;
}

.zzz:nth-child(2) {
  animation-delay: 0.5s;
  font-size: var(--text-base);
  opacity: 0.7;
}

.zzz:nth-child(3) {
  animation-delay: 1s;
  font-size: var(--text-sm);
  opacity: 0.4;
}

@keyframes zzzFloat {

  0%,
  100% {
    transform: translateY(0) translateX(0);
    opacity: 0.3;
  }

  50% {
    transform: translateY(-15px) translateX(5px);
    opacity: 1;
  }
}