/* Bedtime Sensory Design System */
:root {
  --bg-deep: #070913;
  --indigo-soft: #1E1B4B;
  --amber-warmth: #F59E0B;
  --lavender: #C4B5FD;
}

body {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
  background-color: var(--bg-deep);
}

/* Gentle floating ambient elements */
@keyframes gentleBob {
  0%, 100% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(-6px) rotate(-1.5deg);
  }
}

.animate-gentle-bob {
  animation: gentleBob 7s ease-in-out infinite;
}

/* Slow Yawn Expansion */
@keyframes animalYawn {
  0% {
    transform: scale(1);
  }
  40% {
    transform: scale(1.1) translateY(-4px);
  }
  75% {
    transform: scale(1.06) translateY(-2px);
  }
  100% {
    transform: scale(1) translateY(0);
  }
}

.yawn-active {
  animation: animalYawn 3.2s cubic-bezier(0.25, 1, 0.5, 1);
}

/* Snore / Zzz gentle float */
@keyframes floatZzz {
  0% {
    opacity: 0;
    transform: translate(0, 0) scale(0.6);
  }
  50% {
    opacity: 0.8;
    transform: translate(8px, -14px) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(16px, -28px) scale(1.2);
  }
}

.snoring-zzz {
  animation: floatZzz 3.5s ease-in-out infinite;
}

/* Tucked in State for Animal Cards */
.animal-card.tucked {
  background-color: rgba(10, 11, 24, 0.7);
  border-color: rgba(245, 158, 11, 0.12);
}

.animal-card.tucked .blanket {
  transform: translateY(-16px);
}

.animal-card.tucked .lantern {
  opacity: 0.25;
  background-color: rgba(255, 255, 255, 0.05);
}

.animal-card.tucked .lantern-flame {
  display: none;
}

/* Touch responsiveness */
.animal-card:active {
  transform: scale(0.97);
}

/* Smooth color transitions for melatonin filter */
#melatonin-tint, #sleep-dimmer {
  will-change: opacity, background-color;
}

/* Active Timer Button Highlight */
.timer-btn.active-timer {
  background-color: rgba(245, 158, 11, 0.25);
  border-color: rgba(245, 158, 11, 0.6);
  color: #FDE68A;
  font-weight: 700;
}

/* -------------------------------------------------------------
   Toddler Interactive Tap Elements & Animations
------------------------------------------------------------- */

/* Floating Dream Bubbles */
@keyframes floatDreamBubble {
  0% {
    transform: translateY(0px) translateX(0px) scale(0.8);
    opacity: 0;
  }
  15% {
    opacity: 0.9;
  }
  50% {
    transform: translateY(-50vh) translateX(18px) scale(1.05);
  }
  85% {
    opacity: 0.85;
  }
  100% {
    transform: translateY(-110vh) translateX(-14px) scale(1);
    opacity: 0;
  }
}

.dream-bubble {
  pointer-events: auto !important;
  animation: floatDreamBubble linear forwards;
  will-change: transform, opacity;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2), inset 0 2px 6px rgba(255, 255, 255, 0.3);
}

/* Snuggle Wiggle Animation for Petted Animals */
@keyframes snuggleWiggle {
  0% { transform: scale(1) rotate(0deg); }
  25% { transform: scale(1.04) rotate(-3deg); }
  50% { transform: scale(1.04) rotate(3deg); }
  75% { transform: scale(1.02) rotate(-1deg); }
  100% { transform: scale(1) rotate(0deg); }
}

.snuggle-wiggle {
  animation: snuggleWiggle 0.6s ease-in-out;
}

/* Wind Chimes Sway */
@keyframes chimeSway {
  0% { transform: rotate(0deg); }
  25% { transform: rotate(18deg); }
  50% { transform: rotate(-14deg); }
  75% { transform: rotate(6deg); }
  100% { transform: rotate(0deg); }
}

.chime-swing {
  animation: chimeSway 0.75s ease-out;
}

/* Cloud Puff */
@keyframes cloudPuff {
  0% { transform: scale(1); }
  40% { transform: scale(1.3) translateY(-4px); }
  100% { transform: scale(1); }
}

.cloud-puff {
  animation: cloudPuff 0.5s ease-out;
}

/* Jar Shake */
@keyframes jarShake {
  0% { transform: rotate(0deg) scale(1); }
  20% { transform: rotate(-8deg) scale(1.1); }
  40% { transform: rotate(8deg) scale(1.1); }
  60% { transform: rotate(-4deg) scale(1.05); }
  100% { transform: rotate(0deg) scale(1); }
}

.jar-shake {
  animation: jarShake 0.5s ease-out;
}

/* Star Twinkle Burst */
@keyframes starTwinkleBurst {
  0% { transform: scale(1) rotate(0deg); filter: drop-shadow(0 0 0px #F59E0B); }
  50% { transform: scale(1.4) rotate(180deg); filter: drop-shadow(0 0 15px #F59E0B); }
  100% { transform: scale(1) rotate(360deg); filter: drop-shadow(0 0 0px #F59E0B); }
}

.star-twinkle-burst {
  animation: starTwinkleBurst 0.75s cubic-bezier(0.25, 1, 0.5, 1);
}

/* Lantern Glow Boost */
.lantern-glow-boost {
  background-color: rgba(245, 158, 11, 0.45) !important;
  box-shadow: 0 0 16px #F59E0B !important;
}

/* -------------------------------------------------------------
   Sleepy Tap Playground Modes & Fluid Entrainment
------------------------------------------------------------- */
#playground-screen.hidden {
  display: none !important;
}

#playground-screen:not(.hidden) {
  display: flex !important;
}

#playground-screen {
  background: radial-gradient(circle at 50% 40%, #10122e 0%, #080916 65%, #04050d 100%);
}

#playground-canvas {
  touch-action: none;
  -webkit-touch-callout: none;
}

/* Calm Pulse Animations */
@keyframes soothingGlow {
  0%, 100% {
    filter: drop-shadow(0 0 8px rgba(245, 158, 11, 0.4));
    transform: scale(1);
  }
  50% {
    filter: drop-shadow(0 0 20px rgba(167, 139, 250, 0.6));
    transform: scale(1.08);
  }
}

.entrain-glow {
  animation: soothingGlow 4s ease-in-out infinite;
}