:root {
    --bg-color: #f3f0ff;
    --text-color: #2d3748;
    --primary-color: #8b5cf6;
    --heart-color: #ef4444;
    --meter-bg: #e2e8f0;
    --meter-fill: #10b981;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden; /* Prevent scrolling when hearts float up */
}

.game-container {
    background: white;
    border-radius: 32px;
    padding: 2.5rem;
    box-shadow: 0 20px 40px rgba(139, 92, 246, 0.15);
    text-align: center;
    max-width: 450px;
    width: 90%;
    position: relative;
    border: 4px solid #ede9fe;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
    text-shadow: 0 2px 4px rgba(139, 92, 246, 0.2);
}

.happiness-meter {
    width: 100%;
    height: 24px;
    background-color: var(--meter-bg);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 0.75rem;
    box-shadow: inset 0 2px 6px rgba(0,0,0,0.1);
}

.happiness-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #34d399, #10b981);
    border-radius: 12px;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.happiness-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.4) 0%, rgba(255,255,255,0) 100%);
}

header p {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 2.5rem;
}

main {
    position: relative;
}

.cat-container {
    position: relative;
    cursor: pointer;
    display: inline-block;
    padding: 20px;
    border-radius: 40px;
    transition: background-color 0.3s ease;
    -webkit-tap-highlight-color: transparent;
}

.cat-container:hover {
    background-color: rgba(139, 92, 246, 0.08);
}

.cat-image {
    max-width: 100%;
    height: auto;
    border-radius: 20px;
    transition: transform 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: bottom center;
    user-select: none;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
}

/* Squish animation when petted */
.cat-container:active .cat-image {
    transform: scale(1.08, 0.92) translateY(8px);
}

.hearts-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: visible;
}

.heart {
    position: absolute;
    color: var(--heart-color);
    font-size: 32px;
    user-select: none;
    pointer-events: none;
    animation: floatUp 1.2s ease-out forwards;
    filter: drop-shadow(0 2px 4px rgba(239, 68, 68, 0.4));
    z-index: 10;
}

@keyframes floatUp {
    0% {
        transform: translate(-50%, -50%) scale(0.5);
        opacity: 0;
    }
    15% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, calc(-50% - 150px)) scale(1);
        opacity: 0;
    }
}

.reset-btn {
    margin-top: 2rem;
    padding: 0.75rem 2rem;
    font-family: 'Outfit', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-color);
    background-color: transparent;
    border: 2px solid var(--primary-color);
    border-radius: 9999px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.reset-btn:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.reset-btn:active {
    transform: translateY(0);
}
