:root {
    --color-bg: #E0F7FA; /* Sky Blue Light */
    --color-monster: #88D498; /* Grass Green */
    --color-cookie: #D4A373;
    --color-bubble: #FFF9C4; /* Bright Yellow Light */
    --color-text: #FF6F91; /* Pink */
    --color-accent: #4DD0E1;
}

body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden; /* Prevent scrolling */
    background-color: var(--color-bg);
    font-family: 'M PLUS Rounded 1c', 'Arial Rounded MT Bold', sans-serif;
    user-select: none; /* Prevent text selection */
    -webkit-user-select: none;
    touch-action: none; /* Prevent default touch actions like scroll */
}

#game-container {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    height: 100%;
    position: relative;
}

.back-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 100;
    text-decoration: none;
    color: #555;
    font-size: 1.2rem;
    background: rgba(255,255,255,0.8);
    padding: 10px 20px;
    border-radius: 20px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    transition: transform 0.2s;
    font-weight: bold;
}

.back-btn:active {
    transform: scale(0.95);
}

#confetti-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; /* Let clicks pass through */
    z-index: 99;
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 800px;
}

/* Monster Area */
#monster-area {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
}

/* Breathing Animation */
@keyframes breathe {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.breathing {
    animation: breathe 3s infinite ease-in-out;
}

#monster svg {
    filter: drop-shadow(0 10px 10px rgba(0,0,0,0.1));
    transition: transform 0.2s;
}

/* Eating Animation Class (Triggered by JS) */
.eating {
    transform: scale(1.1) !important;
}

/* Target Number Bubble */
#target-bubble {
    position: absolute;
    top: -40px;
    right: 20px;
    width: 80px;
    height: 80px;
    background-color: var(--color-bubble);
    border: 4px solid var(--color-text);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 3rem;
    color: var(--color-text);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    z-index: 10;
}

@keyframes bounceIn {
    0% { transform: scale(0); opacity: 0; }
    60% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(1); }
}

.bounce-in {
    animation: bounceIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Cookie Jar (Bottom Area) */
#cookie-jar {
    height: 150px;
    width: 100%;
    background-color: rgba(255, 255, 255, 0.5);
    border-top-left-radius: 50% 20px;
    border-top-right-radius: 50% 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 -5px 20px rgba(0,0,0,0.05);
}

.cookie-placeholder {
    width: 100px;
    height: 100px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(255,255,255,0.8);
    border-radius: 50%;
    box-shadow: inset 0 5px 10px rgba(0,0,0,0.1);
}

/* Draggable Cookie */
.cookie {
    width: 80px;
    height: 80px;
    cursor: grab;
    transition: transform 0.1s;
    touch-action: none;
    z-index: 50; /* Above everything else while dragging */
}

.cookie:active {
    cursor: grabbing;
    transform: scale(1.1);
}

/* Clone styling for dragging */
.dragging-clone {
    position: fixed;
    pointer-events: none;
    z-index: 100;
    opacity: 0.9;
    filter: drop-shadow(0 15px 15px rgba(0,0,0,0.2));
}

/* Success Message */
#feedback-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: rgba(255,255,255,0.8);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s;
    z-index: 90;
}

#success-message {
    font-size: 4rem;
    color: var(--color-text);
    text-shadow: 2px 2px 0px white;
    transform: scale(0.5);
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#feedback-overlay.show {
    opacity: 1;
}

#feedback-overlay.show #success-message {
    transform: scale(1);
}

.hidden-mobile {
    display: none; /* Hide title on small screens to save space */
}

@media (min-width: 768px) {
    .hidden-mobile {
        display: block;
        color: var(--color-text);
        margin-top: 20px;
    }
}
