/* Cookie Clicker Styles */
#cookie-clicker {
    position: fixed;
    bottom: 20px;
    right: 20px;
    /* Change z-index to be LOWER than intro-container (9998) and lower than film-grain (9000) */
    z-index: 50;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#cookie {
    width: 80px;
    height: 80px;
    cursor: pointer;
    transition: transform 0.1s ease;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.5));
    user-select: none;
}

#cookie:hover {
    transform: scale(1.05);
}

#cookie:active {
    transform: scale(0.95);
}

#cps-counter {
    background-color: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 5px 10px;
    border-radius: 15px;
    font-family: 'Rajdhani', sans-serif;
    font-weight: bold;
    margin-top: 5px;
    font-size: 16px;
    text-align: center;
    min-width: 80px;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
    text-shadow: 0 0 5px #00ffff;
    border: 1px solid #00ffff;
    animation: glow 1.5s infinite alternate;
}

/* Feedback text for click performance - Comic style */
.feedback-text {
    position: absolute;
    font-weight: bold;
    font-family: 'Comic Sans MS', 'Chalkboard SE', cursive;
    pointer-events: none;
    animation: comic-pop 1s forwards;
    opacity: 0;
    text-align: center;
    white-space: nowrap;
    transform-origin: center;
    padding: 5px 10px;
    border-radius: 10px;
    letter-spacing: 1px;
    border: 2px solid black;
    box-shadow: 3px 3px 0 rgba(0,0,0,0.8);
    /* Keep this z-index higher than cookie-clicker but lower than intro-container */
    z-index: 51;
    /* Position will be set by JavaScript */
}

/* Different color classes for different performance levels */
.feedback-text.poor {
    color: #ff0000;
    background-color: rgba(255, 200, 200, 0.8);
    font-size: 20px;
    transform: rotate(-5deg);
}

.feedback-text.average {
    color: #ff6600;
    background-color: rgba(255, 230, 200, 0.8);
    font-size: 22px;
    transform: rotate(3deg);
}

.feedback-text.good {
    color: #0066ff;
    background-color: rgba(200, 220, 255, 0.8);
    font-size: 24px;
    transform: rotate(-3deg);
}

.feedback-text.excellent {
    color: #9900ff;
    background-color: rgba(230, 200, 255, 0.8);
    font-size: 26px;
    transform: rotate(5deg);
}

.feedback-text.legendary {
    color: #00cc00;
    background-color: rgba(200, 255, 200, 0.8);
    font-size: 30px;
    font-weight: 800;
    transform: rotate(-2deg);
}

@keyframes comic-pop {
    0% {
        transform: scale(0) rotate(0deg);
        opacity: 0;
    }
    20% {
        transform: scale(1.2) rotate(var(--rotation, 5deg));
        opacity: 1;
    }
    60% {
        transform: scale(1) rotate(var(--rotation, 5deg)) translate(-10px, -10px);
        opacity: 1;
    }
    100% {
        transform: scale(0.8) rotate(var(--rotation, 5deg)) translate(-20px, -30px);
        opacity: 0;
    }
}

@keyframes glow {
    from {
        box-shadow: 0 0 5px rgba(0, 255, 255, 0.5);
    }
    to {
        box-shadow: 0 0 15px rgba(0, 255, 255, 0.8);
    }
}

/* Animation for the cookie when clicked */
@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

.pulse {
    animation: pulse 0.3s ease-out;
}
