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

html, body {
  height: 100%;
  height: 100dvh;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background-color: var(--bg-deep);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

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

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

/* Slow Yawn Expansion */
@keyframes animalYawn {
  0% {
    transform: scale(1);
  }
  40% {
    transform: scale(1.08) translateY(-3px);
  }
  75% {
    transform: scale(1.04) translateY(-1.5px);
  }
  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(6px, -10px) scale(0.9);
  }
  100% {
    opacity: 0;
    transform: translate(12px, -20px) scale(1.1);
  }
}

.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.75);
  border-color: rgba(245, 158, 11, 0.15);
}

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

.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);
}

/* Melatonin filter layers */
#melatonin-tint, #sleep-dimmer {
  will-change: opacity, background-color;
}

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

/* 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(14px) scale(1.03);
  }
  85% {
    opacity: 0.85;
  }
  100% {
    transform: translateY(-110vh) translateX(-10px) 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 */
@keyframes snuggleWiggle {
  0% { transform: scale(1) rotate(0deg); }
  25% { transform: scale(1.03) rotate(-2deg); }
  50% { transform: scale(1.03) rotate(2deg); }
  75% { transform: scale(1.01) rotate(-1deg); }
  100% { transform: scale(1) rotate(0deg); }
}

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

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

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

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

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

/* Jar Shake */
@keyframes jarShake {
  0% { transform: rotate(0deg) scale(1); }
  20% { transform: rotate(-7deg) scale(1.08); }
  40% { transform: rotate(7deg) scale(1.08); }
  60% { transform: rotate(-3deg) scale(1.04); }
  100% { transform: rotate(0deg) scale(1); }
}

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

/* Star Twinkle Burst */
@keyframes starTwinkleBurst {
  0% { transform: scale(1) rotate(0deg); }
  50% { transform: scale(1.35) rotate(180deg); }
  100% { transform: scale(1) rotate(360deg); }
}

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

/* Playground Mode Transition */
#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;
}