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

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #fff;
    line-height: 1.6;
    padding-bottom: 40px;
}

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

/* Header Styles */
header {
    padding: 20px 0; /* Reduced padding */
    background: rgba(26, 26, 46, 0.8);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px; /* Reduced gap */
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px; /* Reduced gap */
    font-size: 22px; /* Slightly smaller */
    font-weight: 700;
    color: #fff;
}

.logo-icon {
    color: #6C63FF;
    font-size: 24px; /* Slightly smaller */
}

.search-sort-container {
    display: flex;
    gap: 12px; /* Reduced gap */
    flex-wrap: wrap;
}

.search-bar {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 30px; /* Slightly smaller */
    padding: 0 12px; /* Reduced padding */
    height: 38px; /* Reduced height */
    transition: all 0.3s ease;
}

.search-bar:focus-within {
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 0 2px rgba(108, 99, 255, 0.3);
}

.search-bar input {
    background: transparent;
    border: none;
    color: #fff;
    padding: 0 8px; /* Reduced padding */
    width: 180px; /* Reduced width */
    font-size: 14px; /* Smaller font */
    outline: none;
}

.search-bar i {
    color: #6C63FF;
    font-size: 14px; /* Smaller icon */
}

.sort-dropdown select {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 30px; /* Slightly smaller */
    color: #fff;
    padding: 0 12px; /* Reduced padding */
    height: 38px; /* Reduced height */
    width: 160px; /* Reduced width */
    font-size: 14px; /* Smaller font */
    outline: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.sort-dropdown select:focus {
    box-shadow: 0 0 0 2px rgba(108, 99, 255, 0.3);
}

.sort-dropdown option {
    background: #1a1a2e;
}

/* Games Grid */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin-top: 35px; /* Reduced margin */
}

.game-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.game-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
    background: rgba(255, 255, 255, 0.08);
}

.game-thumbnail {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-bottom: 2px solid #6C63FF;
}

.game-card-content {
    padding: 20px;
}

.game-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.game-rating {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 15px;
    color: #FFD700;
}

.game-actions {
    display: flex;
    gap: 10px;
}

.details-btn {
    background: #6C63FF;
    color: white;
    border: none;
    padding: 12px 15px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.details-btn:hover {
    background: #5a52e0;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(108, 99, 255, 0.4);
}

.download-btn-card {
    background: #4CAF50;
    color: white;
    border: none;
    padding: 12px 15px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.download-btn-card:hover {
    background: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(76, 175, 80, 0.4);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: #1e1e38;
    width: 90%;
    max-width: 800px;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    transition: transform 0.3s ease;
    max-height: 90vh;
    overflow-y: auto;
}

.modal.active .modal-content {
    transform: scale(1);
}

.game-banner {
    width: 100%;
    height: 250px;
    object-fit: cover;
}

.modal-game-content {
    padding: 25px;
}

.modal-rating {
    display: flex;
    align-items: center;
    gap: 5px;
    margin: 15px 0;
    color: #FFD700;
    font-size: 18px;
}

.modal-description {
    margin-bottom: 25px;
    line-height: 1.6;
    color: #ccc;
}

.download-btn {
    background: #4CAF50;
    color: white;
    border: none;
    padding: 16px 30px;
    width: 100%;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 20px 0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.download-btn:hover {
    background: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(76, 175, 80, 0.4);
}

/* Screenshot Carousel */
.screenshot-carousel {
    position: relative;
    margin: 30px 0;
}

.carousel-container {
    display: flex;
    overflow: hidden;
    border-radius: 12px;
}

.carousel-slide {
    min-width: 100%;
    transition: transform 0.5s ease;
}

.carousel-slide img {
    width: 100%;
    height: 350px;
    object-fit: cover;
    display: block;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(108, 99, 255, 0.8);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
}

.carousel-btn:hover {
    background: #6C63FF;
}

.carousel-prev {
    left: 15px;
}

.carousel-next {
    right: 15px;
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 1010;
}

.close-modal:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .search-bar input {
        width: 160px; /* Reduced width */
    }
    
    .games-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }
    
    .carousel-slide img {
        height: 250px;
    }
}

@media (max-width: 480px) {
    .search-sort-container {
        flex-direction: column;
        width: 100%;
    }
    
    .search-bar, .sort-dropdown select {
        width: 100%;
    }
    
    .games-grid {
        grid-template-columns: 1fr;
    }
    
    .carousel-slide img {
        height: 200px;
    }
    
    .modal-game-content {
        padding: 15px;
    }
    
    .game-actions {
        flex-direction: column;
    }
}