/* Aurora drift background animation */
@keyframes aurora-drift {
  0% { filter: hue-rotate(0deg); opacity: 0.6; }
  50% { opacity: 0.9; }
  100% { filter: hue-rotate(45deg); opacity: 0.6; transform: scale(1.05); }
}

/* Subtle screen flicker for terminal */
@keyframes screen-flicker {
  0% { opacity: 0.98; }
  50% { opacity: 1; }
  100% { opacity: 0.99; }
}

/* Floating damage numbers */
@keyframes damage-float {
  0% { opacity: 1; transform: translateY(0) scale(1); }
  50% { transform: translateY(-20px) scale(1.2); }
  100% { opacity: 0; transform: translateY(-40px) scale(1); }
}

.damage-float {
  position: absolute;
  color: var(--accentCrimson);
  font-family: var(--fontHeading);
  font-size: 1.5rem;
  font-weight: bold;
  text-shadow: 0 0 5px #000, 0 0 10px rgba(220, 20, 60, 0.8);
  pointer-events: none;
  animation: damage-float 1.5s ease-out forwards;
  z-index: 100;
}
.damage-float.heal {
  color: var(--accentSuccess);
  text-shadow: 0 0 5px #000, 0 0 10px rgba(40, 255, 120, 0.8);
}

/* Level up pulsing */
@keyframes level-up-pulse {
  0% { text-shadow: 0 0 5px var(--accentGold); transform: scale(1); }
  100% { text-shadow: 0 0 20px var(--accentGold), 0 0 40px #fff; transform: scale(1.05); }
}

/* Rarity shimmer for legendary items */
@keyframes rarity-shimmer {
  0% { filter: brightness(1) drop-shadow(0 0 2px var(--accentGold)); }
  50% { filter: brightness(1.5) drop-shadow(0 0 8px #fff); }
  100% { filter: brightness(1) drop-shadow(0 0 2px var(--accentGold)); }
}

/* Ghost bar drain effect */
@keyframes bar-drain {
  from { width: var(--prev-width, 100%); }
  to { width: var(--new-width, 100%); }
}

.bar-ghost {
  position: absolute;
  height: 100%;
  background: rgba(255, 255, 255, 0.4);
  z-index: 0;
  transition: width 1s ease-out 0.2s;
}

.bar-fill {
  position: relative;
  z-index: 1;
}

/* Mob spawn flash */
@keyframes mob-spawn {
  0% { background-color: rgba(220, 20, 60, 0.3); }
  100% { background-color: transparent; }
}
.flash-combat {
  animation: mob-spawn 0.5s ease-out;
}

/* Panel slide-in on load */
@keyframes panel-slide-in-left {
  from { transform: translateX(-100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
@keyframes panel-slide-in-right {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.view.active #panel-stats {
  animation: panel-slide-in-left 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.view.active #panel-right {
  animation: panel-slide-in-right 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Input Cursor */
@keyframes input-cursor-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* Aurora text effect */
@keyframes aurora-text {
  0% { color: hsl(150, 70%, 50%); text-shadow: 0 0 10px hsl(150, 70%, 50%); }
  33% { color: hsl(200, 70%, 60%); text-shadow: 0 0 10px hsl(200, 70%, 60%); }
  66% { color: hsl(270, 70%, 65%); text-shadow: 0 0 10px hsl(270, 70%, 65%); }
  100% { color: hsl(150, 70%, 50%); text-shadow: 0 0 10px hsl(150, 70%, 50%); }
}
.aurora-event {
  font-family: var(--fontHeading);
  font-size: 1.2rem;
  animation: aurora-text 4s infinite linear;
}

/* Magic sparkle effect for lore panel */
@keyframes lore-sparkle {
  0% { text-shadow: 0 0 4px rgba(212, 175, 55, 0.4), 0 0 1px rgba(255,255,255,0.6); }
  50% { text-shadow: 0 0 12px rgba(212, 175, 55, 0.8), 0 0 3px rgba(255, 255, 255, 1), 0 0 20px rgba(0, 255, 170, 0.4); }
  100% { text-shadow: 0 0 4px rgba(212, 175, 55, 0.4), 0 0 1px rgba(255,255,255,0.6); }
}

.lore-sparkle-text {
  animation: lore-sparkle 3s infinite ease-in-out;
  color: #fff;
  font-family: 'Cinzel', serif;
}

@keyframes magical-glow {
  0% { box-shadow: 0 0 5px rgba(212, 175, 55, 0.2), inset 0 0 10px rgba(212, 175, 55, 0.1); }
  50% { box-shadow: 0 0 20px rgba(0, 220, 255, 0.4), inset 0 0 20px rgba(0, 220, 255, 0.2); }
  100% { box-shadow: 0 0 5px rgba(212, 175, 55, 0.2), inset 0 0 10px rgba(212, 175, 55, 0.1); }
}

.magical-glow-panel {
  border: 1px solid rgba(0, 220, 255, 0.3) !important;
  animation: magical-glow 6s infinite ease-in-out;
}

/* Background Sparkles Styles */
.sparkle-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 1; /* just above backgrounds, below interactive components */
  overflow: hidden;
}

@keyframes sparkle-fade {
  0% { transform: scale(0.5); opacity: 0; }
  50% { transform: scale(1.2); opacity: 0.8; }
  100% { transform: scale(0.8); opacity: 0; }
}

.bg-sparkle {
  transition: transform 0.25s cubic-bezier(0.1, 0.8, 0.3, 1);
  will-change: transform;
}
