/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Comic Sans MS', cursive, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Animated Background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(255, 255, 255, 0.05) 0%, transparent 50%);
    animation: backgroundFloat 20s ease-in-out infinite;
    pointer-events: none;
    z-index: -1;
}

@keyframes backgroundFloat {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(1deg); }
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    padding: 30px 0;
    text-align: center;
    position: relative;
}

.logo {
    display: inline-block;
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4, #45b7d1, #96ceb4, #ffeaa7);
    background-size: 300% 300%;
    animation: gradientShift 4s ease infinite;
    padding: 20px 40px;
    border-radius: 50px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transform: perspective(1000px) rotateX(5deg);
    transition: all 0.3s ease;
}

.logo:hover {
    transform: perspective(1000px) rotateX(0deg) scale(1.05);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
}

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

.logo-icon {
    font-size: 3rem;
    margin-bottom: 10px;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

.logo-text {
    color: white;
    font-size: 2.5rem;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    margin-bottom: 5px;
}

.logo-subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.2rem;
    font-weight: normal;
}

.header-decoration {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.floating-star {
    position: absolute;
    font-size: 2rem;
    animation: float 3s ease-in-out infinite;
}

.floating-star:nth-child(1) {
    top: 20%;
    left: 10%;
    animation-delay: 0s;
}

.floating-star:nth-child(2) {
    top: 30%;
    right: 15%;
    animation-delay: 1s;
}

.floating-star:nth-child(3) {
    bottom: 20%;
    left: 20%;
    animation-delay: 2s;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(180deg); }
}

/* Main Content */
.main {
    padding: 40px 0;
}

/* Welcome Section */
.welcome {
    text-align: center;
    margin-bottom: 50px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 30px;
    padding: 40px;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.welcome-title {
    font-size: 2.5rem;
    color: white;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    animation: titleGlow 3s ease-in-out infinite alternate;
}

@keyframes titleGlow {
    from { text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3); }
    to { text-shadow: 2px 2px 20px rgba(255, 255, 255, 0.5); }
}

.welcome-text {
    font-size: 1.3rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 20px;
}

.welcome-decoration {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.emoji {
    font-size: 2rem;
    animation: spin 4s linear infinite;
}

.emoji:nth-child(2) {
    animation-delay: 1.3s;
}

.emoji:nth-child(3) {
    animation-delay: 2.6s;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Games Grid */
.games {
    margin-bottom: 50px;
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 30px;
    padding: 20px 0;
}

/* Game Cards */
.game-card {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.05));
    backdrop-filter: blur(15px);
    border-radius: 25px;
    padding: 30px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.game-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transform: rotate(45deg);
    transition: all 0.6s ease;
    opacity: 0;
}

.game-card:hover::before {
    animation: shimmer 1.5s ease-in-out;
}

@keyframes shimmer {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); opacity: 0; }
    50% { opacity: 1; }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); opacity: 0; }
}

.game-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
}

.game-icon {
    text-align: center;
    margin-bottom: 25px;
}

.icon-svg {
    width: 120px;
    height: 120px;
    filter: drop-shadow(0 5px 15px rgba(0, 0, 0, 0.2));
    transition: all 0.3s ease;
}

.game-card:hover .icon-svg {
    transform: scale(1.1) rotate(5deg);
}

.game-info {
    text-align: center;
    margin-bottom: 25px;
}

.game-title {
    font-size: 1.8rem;
    color: white;
    margin-bottom: 15px;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
    font-weight: bold;
}

.game-description {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.6;
    margin-bottom: 20px;
}

.game-features {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.feature {
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.feature:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

/* Play Button */
.play-button {
    width: 100%;
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4);
    border: none;
    border-radius: 50px;
    padding: 15px 30px;
    font-size: 1.2rem;
    font-weight: bold;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
    font-family: inherit;
}

.play-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.play-button:hover::before {
    left: 100%;
}

.play-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    background: linear-gradient(45deg, #ff5252, #26c6da);
}

.play-button:active {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.play-icon {
    margin-right: 10px;
    font-size: 1.1rem;
}

.play-text {
    font-weight: bold;
}

/* Footer */
.footer {
    padding: 30px 0;
    text-align: center;
    background: rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.footer-text {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: bold;
}

.footer-decoration {
    display: flex;
    gap: 20px;
}

.footer-decoration .emoji {
    font-size: 1.5rem;
    animation: wiggle 2s ease-in-out infinite;
}

.footer-decoration .emoji:nth-child(2) {
    animation-delay: 0.7s;
}

.footer-decoration .emoji:nth-child(3) {
    animation-delay: 1.4s;
}

@keyframes wiggle {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(5deg); }
    75% { transform: rotate(-5deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .logo-text {
        font-size: 2rem;
    }
    
    .logo-subtitle {
        font-size: 1rem;
    }
    
    .welcome-title {
        font-size: 2rem;
    }
    
    .welcome-text {
        font-size: 1.1rem;
    }
    
    .games-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .game-card {
        padding: 25px;
    }
    
    .game-title {
        font-size: 1.5rem;
    }
    
    .game-description {
        font-size: 1rem;
    }
    
    .icon-svg {
        width: 100px;
        height: 100px;
    }
    
    .floating-star {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .logo {
        padding: 15px 25px;
    }
    
    .logo-text {
        font-size: 1.5rem;
    }
    
    .welcome {
        padding: 25px;
        margin-bottom: 30px;
    }
    
    .welcome-title {
        font-size: 1.5rem;
    }
    
    .game-card {
        padding: 20px;
    }
    
    .icon-svg {
        width: 80px;
        height: 80px;
    }
    
    .game-features {
        gap: 10px;
    }
    
    .feature {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .game-card {
        border: 3px solid white;
    }
    
    .play-button {
        border: 2px solid white;
    }
    
    .feature {
        border: 2px solid white;
    }
}