/* Main styles for Kids Fun Games */
body {
    font-family: 'Comic Neue', cursive;
    background: linear-gradient(135deg, #6ee7b7 0%, #3b82f6 100%);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    overflow-x: hidden; /* Allow vertical scrolling but hide horizontal */
    
    /* Add smooth scrolling */
    scroll-behavior: smooth;
}

/* Style when scrolling for smoother experience */
body.is-scrolling .game-card {
    transition: none; /* Disable transitions during scroll for performance */
}

.main-title {
    font-family: 'Bubblegum Sans', cursive;
    text-shadow: 3px 3px 0px rgba(0, 0, 0, 0.2);
}

.game-card {
    transition: all 0.3s ease;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    border: 4px solid white;
}

.game-card:hover {
    transform: translateY(-10px) scale(1.05);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2);
}

/* Featured card styling */
.featured-card {
    border-width: 6px;
    border-color: rgba(255, 215, 0, 0.7);
    box-shadow: 0 15px 25px -5px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.featured-card::before {
    content: '';
    position: absolute;
    top: -20px;
    right: -20px;
    width: 80px;
    height: 80px;
    background-color: rgba(255, 215, 0, 0.3);
    transform: rotate(45deg);
    z-index: 1;
}

.featured-badge {
    display: inline-block;
    margin-bottom: 1rem;
}

/* Game tags and badges */
.game-tag,
.game-difficulty,
.game-age-range {
    display: inline-block;
    margin: 0.25rem;
    transition: all 0.2s ease;
}

.game-tag:hover,
.game-difficulty:hover,
.game-age-range:hover {
    background-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
}

/* Stars animation */
.stars {
    position: fixed; /* Changed to fixed to stay in place when scrolling */
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    top: 0;
    left: 0;
}

.star {
    position: absolute;
    background-color: white;
    border-radius: 50%;
    animation: twinkle 3s infinite ease-in-out;
}

@keyframes twinkle {
    0%,
    100% {
        opacity: 0.3;
        transform: scale(0.8);
    }

    50% {
        opacity: 1;
        transform: scale(1.1);
    }
}

/* Balloon animation */
.balloon {
    position: fixed; /* Changed to fixed to stay in place when scrolling */
    animation: float 15s infinite ease-in-out;
    opacity: 0.8;
    z-index: -1; /* Ensure balloons don't interfere with content */
}

@keyframes float {
    0% {
        transform: translateY(0) translateX(0);
    }

    50% {
        transform: translateY(-100px) translateX(50px);
    }

    100% {
        transform: translateY(0) translateX(0);
    }
}

/* Loading animation */
#loading-message {
    position: relative;
    padding: 20px;
    opacity: 0.8;
    animation: pulse 1.5s infinite ease-in-out;
}

@keyframes pulse {
    0%,
    100% {
        opacity: 0.6;
    }

    50% {
        opacity: 1;
    }
}

/* Error message styling */
.error-message {
    background-color: rgba(239, 68, 68, 0.2);
    border: 2px solid rgba(239, 68, 68, 0.5);
    border-radius: 0.5rem;
    padding: 0.75rem;
    margin: 1rem 0;
}

/* Mobile-specific adjustments */
@media (max-width: 640px) {
    .container {
        padding: 1rem;
    }

    .balloon {
        font-size: 2rem !important;
    }

    .game-card {
        padding: 1rem !important;
    }

    .game-card-icon {
        font-size: 4rem !important;
        margin-bottom: 0.5rem !important;
    }

    .game-card h2 {
        font-size: 1.5rem !important;
        margin-bottom: 0.5rem !important;
    }

    .game-card p {
        font-size: 1rem !important;
    }

    header {
        margin-bottom: 1.5rem !important;
        margin-top: 1rem !important;
    }

    footer {
        margin-top: 1.5rem !important;
    }

    footer p {
        font-size: 1rem !important;
    }
    
    /* Mobile adjustments for tags and badges */
    .game-tag,
    .game-difficulty,
    .game-age-range {
        font-size: 0.9rem !important;
        padding: 0.15rem 0.5rem !important;
    }
    
    .featured-badge {
        font-size: 1rem !important;
        padding: 0.2rem 0.6rem !important;
    }
}
