* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

header {
    text-align: center;
    color: white;
    margin-bottom: 40px;
    animation: slideDown 0.6s ease-out;
}

header h1 {
    font-size: 3em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

header p {
    font-size: 1.2em;
    opacity: 0.9;
}

.category-nav {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.category-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 25px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.category-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.category-btn.active {
    background: white;
    color: #667eea;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.game-card {
    background: white;
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    animation: scaleIn 0.4s ease-out;
}

.game-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.game-thumbnail {
    font-size: 4em;
    margin-bottom: 15px;
}

.game-card h3 {
    color: #333;
    margin-bottom: 8px;
    font-size: 1.4em;
}

.game-card p {
    color: #666;
    margin-bottom: 15px;
    font-size: 0.95em;
}

.play-btn {
    padding: 10px 25px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
    box-shadow: 0 4px 10px rgba(102, 126, 234, 0.4);
}

.play-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 15px rgba(102, 126, 234, 0.6);
}

.play-btn:active {
    transform: scale(0.98);
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 20px;
    border-radius: 15px;
    width: 90%;
    max-width: 900px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.close {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close:hover,
.close:focus {
    color: #000;
}

.game-iframe {
    width: 100%;
    height: 70vh;
    border: none;
    border-radius: 10px;
    background: #f0f0f0;
    flex-grow: 1;
}

.modal-content.fullscreen {
    width: 100vw;
    height: 100vh;
    max-width: 100vw;
    max-height: 100vh;
    margin: 0;
    border-radius: 0;
    padding: 0;
}

.modal-content.fullscreen .game-iframe {
    height: calc(100vh - 50px);
    border-radius: 0;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #f9f9f9;
    border-bottom: 1px solid #ddd;
}

.modal-header h2 {
    margin: 0;
    flex-grow: 1;
    font-size: 1.5em;
    color: #333;
}

.fullscreen-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9em;
    margin-right: 10px;
    transition: all 0.3s ease;
}

.fullscreen-btn:hover {
    background: #764ba2;
    transform: scale(1.05);
}

/* Animations */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Responsive design */
@media (max-width: 768px) {
    header h1 {
        font-size: 2em;
    }

    .games-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 15px;
    }

    .game-card {
        padding: 15px;
    }

    .game-thumbnail {
        font-size: 3em;
    }

    .modal-content {
        width: 95%;
        margin: 10% auto;
        padding: 15px;
    }

    .game-iframe {
        height: 50vh;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.5em;
    }

    header p {
        font-size: 1em;
    }

    .games-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .category-nav {
        gap: 5px;
    }

    .category-btn {
        padding: 8px 15px;
        font-size: 0.9em;
    }
}
