/* PetVitals — lightweight CSS overlay for pet vitality indicators */

.pet-vitals {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

/* ── Flush (face-red) overlay ── */
.pet-vitals__flush {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 60%, rgba(255, 80, 60, 0.8), transparent 70%);
  mix-blend-mode: multiply;
  opacity: var(--flush-intensity, 0);
  transition: opacity 0.8s ease;
}

/* ── Context pressure bar (vertical, right side) ── */
.pet-vitals__pressure-bar {
  position: absolute;
  top: 10%;
  right: 2px;
  width: 4px;
  height: 80%;
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.15);
  overflow: hidden;
}

.pet-vitals__pressure-fill {
  width: 100%;
  height: 100%;
  border-radius: 2px;
  transform: scaleY(calc(var(--pressure-pct, 0) / 100));
  transform-origin: bottom;
  will-change: transform;
  transition: transform 1.2s ease, background-color 0.6s ease;
}

.pet-vitals__pressure-bar[data-tier="low"] .pet-vitals__pressure-fill {
  background: #4ade80;
}

.pet-vitals__pressure-bar[data-tier="medium"] .pet-vitals__pressure-fill {
  background: #fb923c;
}

.pet-vitals__pressure-bar[data-tier="high"] .pet-vitals__pressure-fill {
  background: #f87171;
}

.pet-vitals__pressure-bar[data-tier="critical"] .pet-vitals__pressure-fill {
  background: #ef4444;
  animation: pet-vitals-pulse 1s ease-in-out infinite;
}

@keyframes pet-vitals-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ── Sweat drops ── */
.pet-vitals__sweat {
  position: absolute;
  top: 15%;
  right: 10%;
  width: 20px;
  height: 30px;
}

.pet-vitals__drop {
  position: absolute;
  width: 6px;
  height: 8px;
  background: rgba(100, 180, 255, 0.7);
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  will-change: transform, opacity;
}

.pet-vitals__drop--1 {
  top: 0;
  left: 0;
  animation: pet-vitals-drip 2s ease-in-out infinite;
}

.pet-vitals__drop--2 {
  top: 4px;
  left: 10px;
  animation: pet-vitals-drip 2s ease-in-out 0.7s infinite;
}

.pet-vitals__drop--3 {
  top: -2px;
  left: 5px;
  animation: pet-vitals-drip 1.6s ease-in-out 1.2s infinite;
}

@keyframes pet-vitals-drip {
  0% {
    transform: translateY(0);
    opacity: 0.8;
  }
  60% {
    transform: translateY(10px);
    opacity: 0.6;
  }
  100% {
    transform: translateY(16px);
    opacity: 0;
  }
}

/* ── Energy bar (bottom) ── */
.pet-vitals__energy {
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 50%;
  height: 3px;
  border-radius: 1.5px;
  background: rgba(0, 0, 0, 0.12);
  overflow: hidden;
}

.pet-vitals__energy-fill {
  height: 100%;
  width: 100%;
  border-radius: 1.5px;
  transform: scaleX(calc(var(--energy-pct, 100) / 100));
  transform-origin: left;
  will-change: transform;
  transition: transform 2s ease, background-color 1s ease;
}

.pet-vitals__energy[data-tier="full"] .pet-vitals__energy-fill {
  background: #4ade80;
}

.pet-vitals__energy[data-tier="good"] .pet-vitals__energy-fill {
  background: #a3e635;
}

.pet-vitals__energy[data-tier="tired"] .pet-vitals__energy-fill {
  background: #fbbf24;
}

.pet-vitals__energy[data-tier="exhausted"] .pet-vitals__energy-fill {
  background: #fb923c;
}

.pet-vitals__energy[data-tier="depleted"] .pet-vitals__energy-fill {
  background: #ef4444;
  animation: pet-vitals-pulse 1.5s ease-in-out infinite;
}
