:root {
    --cream: #FAF8F5;
    --sky-start: #87CEEB;
    --sky-end: #B0E0E6;
    --teal: #20B2AA;
    --coral: #FF7F50;
    --gold: #FFD700;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Nunito', sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--cream);
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
}

.bg-cream {
    background-color: var(--cream);
}

.text-teal {
    color: var(--teal);
}

.from-coral {
    --tw-gradient-from: var(--coral);
}

.to-coral {
    --tw-gradient-to: var(--coral);
}

.pb-safe {
    padding-bottom: max(env(safe-area-inset-bottom), 12px);
}

.featured-creature {
    background: linear-gradient(180deg, var(--sky-start) 0%, var(--sky-end) 100%);
    position: relative;
    min-height: 220px;
}

.clouds {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.cloud {
    position: absolute;
    background: white;
    border-radius: 50px;
    opacity: 0.9;
    filter: blur(0.5px);
}

.cloud::before,
.cloud::after {
    content: '';
    position: absolute;
    background: white;
    border-radius: 50%;
}

.cloud-1 {
    width: 100px;
    height: 40px;
    top: 15%;
    left: -100px;
    animation: cloud-drift 25s linear infinite;
}

.cloud-1::before {
    width: 50px;
    height: 50px;
    top: -25px;
    left: 15px;
}

.cloud-1::after {
    width: 35px;
    height: 35px;
    top: -18px;
    left: 55px;
}

.cloud-2 {
    width: 80px;
    height: 32px;
    top: 45%;
    left: -80px;
    animation: cloud-drift 30s linear infinite;
    animation-delay: -10s;
}

.cloud-2::before {
    width: 40px;
    height: 40px;
    top: -20px;
    left: 12px;
}

.cloud-2::after {
    width: 28px;
    height: 28px;
    top: -14px;
    left: 42px;
}

.cloud-3 {
    width: 60px;
    height: 24px;
    bottom: 25%;
    left: -60px;
    animation: cloud-drift 20s linear infinite;
    animation-delay: -5s;
}

.cloud-3::before {
    width: 30px;
    height: 30px;
    top: -15px;
    left: 10px;
}

.cloud-3::after {
    width: 22px;
    height: 22px;
    top: -11px;
    left: 32px;
}

@keyframes cloud-drift {
    0% { transform: translateX(0); }
    100% { transform: translateX(calc(100vw + 200px)); }
}

.creature-bounce {
    animation: bounce 2s ease-in-out infinite;
    image-rendering: pixelated;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.habit-card {
    transition: all 0.2s ease;
    position: relative;
}

.habit-card:active {
    transform: scale(0.98);
}

.habit-glow {
    animation: gentle-glow 2s ease-in-out infinite;
}

@keyframes gentle-glow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(32, 178, 170, 0); }
    50% { box-shadow: 0 0 0 4px rgba(32, 178, 170, 0.15); }
}

.creature-card {
    transition: all 0.2s ease;
    position: relative;
}

.creature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

.creature-card:active {
    transform: scale(0.98);
}

/* Confetti animation */
.confetti-container {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 100;
    overflow: hidden;
}

.confetti {
    position: absolute;
    width: 12px;
    height: 12px;
    top: -12px;
    animation: confetti-fall 3.5s ease-out forwards;
    border-radius: 2px;
}

@keyframes confetti-fall {
    0% {
        transform: translateY(0) rotate(0deg) scale(1);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(1080deg) scale(0.5);
        opacity: 0;
    }
}

.animate-bounce-in {
    animation: bounce-in 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes bounce-in {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.animate-slide-up {
    animation: slide-up 0.3s ease-out;
}

@keyframes slide-up {
    0% {
        transform: translateY(100%);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

.animate-wiggle {
    animation: wiggle 1s ease-in-out infinite;
}

@keyframes wiggle {
    0%, 100% { transform: rotate(-3deg); }
    50% { transform: rotate(3deg); }
}

.medal-shine {
    background: linear-gradient(90deg, transparent, rgba(255,215,0,0.3), transparent);
    animation: shine 2s ease-in-out infinite;
}

@keyframes shine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #d4d4d8;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a1a1aa;
}

/* Mobile optimizations */
@media (max-width: 640px) {
    .featured-creature {
        min-height: 200px;
    }
    
    .cloud-1 { width: 80px; height: 32px; }
    .cloud-2 { width: 64px; height: 26px; }
    .cloud-3 { width: 48px; height: 20px; }
}

/* Safe area for iOS */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    nav {
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* Button press effect */
button:active {
    transform: scale(0.97);
}

/* Input focus styles */
input:focus {
    box-shadow: 0 0 0 3px rgba(32, 178, 170, 0.2);
}