@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@400;500;600&family=Comic+Neue:wght@400;700&display=swap');

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

body {
    font-family: 'Fredoka', sans-serif;
    background: linear-gradient(135deg, #87CEEB 0%, #F0E68C 50%, #DEB887 100%);
    min-height: 100vh;
    padding: 20px;
    color: #4A4A4A;
}

.game-container {
    max-width: 1000px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.game-title {
    font-family: 'Comic Neue', cursive;
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    padding: 20px;
    background: linear-gradient(45deg, #9370DB, #FFD700, #32CD32);
    background-size: 300% 300%;
    animation: gradientShift 3s ease infinite;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 20px;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.game-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 20px;
}

#canvas {
    border: 4px solid #8B4513;
    border-radius: 15px;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    max-width: 100%;
    height: auto;
}

.controls-panel {
    background: rgba(255, 248, 220, 0.8);
    border-radius: 15px;
    padding: 20px;
    width: 100%;
    max-width: 800px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.control-row {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.plant-button {
    background: linear-gradient(45deg, #32CD32, #90EE90);
    color: white;
    border: none;
    padding: 15px 25px;
    border-radius: 25px;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(50, 205, 50, 0.3);
    font-family: 'Fredoka', sans-serif;
}

.plant-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(50, 205, 50, 0.4);
}

.action-button {
    background: linear-gradient(45deg, #9370DB, #DA70D6);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 20px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(147, 112, 219, 0.3);
    font-family: 'Fredoka', sans-serif;
}

.action-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(147, 112, 219, 0.4);
}

.progress-section {
    margin-bottom: 20px;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 10px;
}

.stage-text {
    font-weight: 600;
    color: #2E8B57;
    font-size: 1.1rem;
    flex: 1;
}

.timer {
    color: #8B4513;
    font-weight: 500;
}

.progress-container {
    width: 100%;
    height: 20px;
    background: #E0E0E0;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.1);
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #32CD32, #FFD700, #9370DB);
    width: 0%;
    transition: width 0.5s ease;
    border-radius: 10px;
    position: relative;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.3) 50%, transparent 100%);
    animation: shimmer 2s infinite;
}

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

.care-hearts {
    color: #2E8B57;
    font-weight: 600;
    text-align: center;
    font-size: 1.1rem;
}

.action-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.reset-button, .screenshot-button {
    background: linear-gradient(45deg, #FF6B6B, #FF8E8E);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 15px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(255, 107, 107, 0.3);
    font-family: 'Fredoka', sans-serif;
}

.screenshot-button {
    background: linear-gradient(45deg, #4ECDC4, #6FDBDB);
    box-shadow: 0 3px 10px rgba(78, 205, 196, 0.3);
}

.reset-button:hover, .screenshot-button:hover {
    transform: translateY(-2px);
}

.reset-button:hover {
    box-shadow: 0 5px 15px rgba(255, 107, 107, 0.4);
}

.screenshot-button:hover {
    box-shadow: 0 5px 15px rgba(78, 205, 196, 0.4);
}

.instructions {
    text-align: center;
    padding: 20px;
    background: rgba(255, 248, 220, 0.6);
    font-size: 1.1rem;
    color: #2E8B57;
    font-weight: 500;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .game-title {
        font-size: 1.8rem;
        padding: 15px;
    }
    
    #canvas {
        width: 100%;
        height: auto;
        max-width: 400px;
    }
    
    .control-row {
        flex-direction: column;
        align-items: center;
    }
    
    .plant-button, .action-button {
        width: 100%;
        max-width: 250px;
    }
    
    .progress-info {
        flex-direction: column;
        text-align: center;
    }
    
    .action-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .reset-button, .screenshot-button {
        width: 100%;
        max-width: 200px;
    }
}

@media (max-width: 480px) {
    .game-title {
        font-size: 1.5rem;
    }
    
    .controls-panel {
        padding: 15px;
        margin: 0 10px;
    }
    
    .instructions {
        font-size: 1rem;
        padding: 15px;
    }
}

/* Button press animation */
.plant-button:active, .action-button:active, .reset-button:active, .screenshot-button:active {
    transform: translateY(0);
    transition: transform 0.1s ease;
}

/* Glow effect for active states */
.controls-panel button:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(147, 112, 219, 0.5);
}

/* Celebration animation class */
@keyframes celebrate {
    0% { transform: scale(1) rotate(0deg); }
    25% { transform: scale(1.1) rotate(5deg); }
    50% { transform: scale(1.05) rotate(-5deg); }
    75% { transform: scale(1.1) rotate(5deg); }
    100% { transform: scale(1) rotate(0deg); }
}

.celebrating {
    animation: celebrate 0.6s ease-in-out;
}