/* Modern CSS Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #2d3748;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    overflow-x: hidden;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Styles */
header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 0;
}

h1 {
    font-size: 2.8rem;
    font-weight: 800;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-align: center;
}

.subtitle {
    color: #718096;
    font-size: 1.2rem;
    margin-top: 8px;
    text-align: center;
}

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

/* Category Filter Styles */
.category-filter {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 40px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.filter-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: #2d3748;
    text-align: center;
    margin-bottom: 25px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.filter-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    max-width: 1000px;
    margin: 0 auto;
}

.filter-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.8);
    border: 2px solid transparent;
    border-radius: 15px;
    padding: 15px 20px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 600;
    color: #4a5568;
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

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

.filter-btn:hover::before {
    left: 100%;
}

.filter-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: rgba(102, 126, 234, 0.3);
}

.filter-btn.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

.filter-icon {
    font-size: 1.4rem;
    margin-right: 12px;
}

.filter-text {
    flex: 1;
    font-size: 1.1rem;
}

.game-count {
    background: rgba(255, 255, 255, 0.3);
    color: inherit;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 700;
    min-width: 30px;
    text-align: center;
}

.filter-btn.active .game-count {
    background: rgba(255, 255, 255, 0.25);
}

/* Games Container */
.games-container {
    margin-top: 40px;
}

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

/* Game Card Styles */
.game-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
}

.game-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.game-card:hover::before {
    opacity: 1;
}

.game-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.game-card.hidden {
    display: none;
}

.game-thumbnail {
    position: relative;
    height: 180px;
    background: linear-gradient(135deg, #f7fafc, #edf2f7);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.game-icon {
    font-size: 4rem;
    transition: all 0.3s ease;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
}

.game-card:hover .game-icon {
    transform: scale(1.1) rotate(5deg);
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.2));
}

.game-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s ease;
}

.game-card:hover .game-overlay {
    opacity: 1;
}

.play-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    transform: translateY(10px);
}

.game-card:hover .play-btn {
    transform: translateY(0);
}

.play-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.game-info {
    padding: 20px;
    text-align: center;
}

.game-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 8px;
}

.game-desc {
    color: #718096;
    font-size: 0.95rem;
    line-height: 1.4;
}

/* Game Modal Styles */
.game-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(10px);
}

.game-modal.active {
    display: flex;
}

.modal-content {
    background: rgba(255, 255, 255, 0.98);
    border-radius: 20px;
    width: 90%;
    max-width: 1200px;
    height: 85%;
    overflow: hidden;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    animation: modalSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 30px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    background: linear-gradient(135deg, #f7fafc, #edf2f7);
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2d3748;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.close-btn {
    background: rgba(255, 255, 255, 0.8);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    color: #718096;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: #e53e3e;
    color: white;
    transform: scale(1.1);
}

.modal-body {
    padding: 20px;
    height: calc(100% - 80px);
}

.game-iframe-container {
    width: 100%;
    height: 100%;
    border-radius: 15px;
    overflow: hidden;
    background: #f7fafc;
    position: relative;
}

.game-iframe {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 15px;
}

/* Loading Animation */
.loading {
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Hidden Game Data */
.hidden-game-data {
    display: none !important;
}

/* Footer Styles */
footer {
    margin-top: 80px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding: 40px 0;
}

.footer-content {
    text-align: center;
    color: #718096;
}

.related-sites {
    margin: 20px 0;
}

.related-sites a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

.related-sites a:hover {
    text-decoration: underline;
}

.keywords-section {
    margin-top: 30px;
}

.keywords-section h4 {
    color: #2d3748;
    margin-bottom: 15px;
}

.keywords-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.keyword-category {
    background: rgba(247, 250, 252, 0.8);
    padding: 15px;
    border-radius: 10px;
    text-align: left;
}

.keyword-category strong {
    color: #2d3748;
}

.keyword-category span {
    color: #718096;
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .container {
        padding: 0 15px;
    }
    
    .filter-buttons {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        gap: 12px;
    }
    
    .games-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 20px;
    }
    
    .modal-content {
        width: 95%;
        height: 90%;
    }
}

@media (max-width: 768px) {
    h1 {
        font-size: 2.2rem;
    }
    
    .filter-title {
        font-size: 1.5rem;
    }
    
    .filter-buttons {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .filter-btn {
        padding: 12px 16px;
    }
    
    .filter-text {
        font-size: 1rem;
    }
    
    .games-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 15px;
    }
    
    .game-thumbnail {
        height: 150px;
    }
    
    .game-icon {
        font-size: 3rem;
    }
    
    .modal-content {
        width: 95%;
        height: 85%;
        border-radius: 15px;
    }
    
    .modal-header {
        padding: 15px 20px;
    }
    
    .modal-title {
        font-size: 1.3rem;
    }
    
    .keywords-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }
    
    h1 {
        font-size: 1.8rem;
    }
    
    .category-filter {
        padding: 20px;
        margin-bottom: 30px;
    }
    
    .filter-title {
        font-size: 1.3rem;
        margin-bottom: 20px;
    }
    
    .games-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .game-card {
        border-radius: 15px;
    }
    
    .game-thumbnail {
        height: 140px;
    }
    
    .game-icon {
        font-size: 2.5rem;
    }
    
    .game-info {
        padding: 15px;
    }
    
    .game-title {
        font-size: 1.1rem;
    }
    
    .modal-content {
        width: 100%;
        height: 100%;
        border-radius: 0;
    }
    
    .modal-body {
        padding: 15px;
    }
}