* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #000000;
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

.header {
    text-align: center;
    margin-bottom: 30px;
    color: rgb(239, 239, 239);
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

.filters-section {
    background: rgba(8, 8, 8, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}

.filters-section h2 {
    margin-bottom: 20px;
    color: #E54687;
    font-size: 1.5rem;
}

/* Filter grid - 3x3 on all screens except small */
.filters-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

.filter-group {
    display: flex;
    flex-direction: column;
}

.filter-group label {
    font-weight: 600;
    margin-bottom: 8px;
    color: #1ebad9;
    font-size: 0.9rem;
    white-space: nowrap;
}

.filter-group input,
.filter-group select {
    padding: 10px;
    border: 2px solid #e0e6ed;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    background: white;
    width: 100%;
}

.filter-group input:focus,
.filter-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.filter-group input[type="range"] {
    margin-bottom: 5px;
}

.filter-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e0e6ed;
}

.reset-btn {
    background: #E54687;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

.reset-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
}

.results-count {
    font-weight: 600;
    color: #667eea;
    font-size: 1.1rem;
}

.loading {
    text-align: center;
    padding: 60px 20px;
    color: white;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Games Grid - Responsive layout */
.games-grid {
    display: grid;
    margin-bottom: 40px;
    gap: 10px; /* No gap as requested */
}

/* Large screens: 4 games per row */
@media (min-width: 1200px) {
    .games-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Medium screens: 3 games per row */
@media (min-width: 768px) and (max-width: 1199px) {
    .games-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Small screens: 2 games per row */
@media (max-width: 767px) {
    .games-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.game-card {
    background: linear-gradient(135deg, rgba(23, 0, 68, 0.9) 0%, rgba(229, 70, 135, 0.2) 50%, rgba(30, 186, 217, 0.2) 100%);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
    border: 1px solid rgba(229, 70, 135, 0.3);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.game-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(229, 70, 135, 0.4), 0 8px 25px rgba(30, 186, 217, 0.2);
    border-color: rgba(229, 70, 135, 0.5);
}

.game-image-container {
    width: 100%;
    height: 200px;
    position: relative;
    overflow: hidden;
    border-radius: 8px 8px 0 0;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.game-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    background: black;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.game-card:hover .game-image {
    transform: scale(1.05);
}

.game-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #000000;
    color: white;
    text-align: center;
    padding: 20px;
    box-sizing: border-box;
}

.placeholder-logo {
    max-width: 60%;
    max-height: 60%;
    object-fit: contain;
    opacity: 0.8;
    filter: brightness(1.2);
}

.game-card:hover .placeholder-logo {
    opacity: 1;
}

.game-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.game-header {
    margin-bottom: 15px;
}

.game-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 8px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.game-category {
    display: inline-block;
    background: #E54687;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* Game details grid - 2x2 on all screens */
.game-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 10px;
    margin-top: auto;
}

.detail-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 8px;
    background: rgba(229, 70, 135, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(229, 70, 135, 0.2);
}

.detail-label {
    font-size: 0.75rem;
    color: #1ebad9;
    margin-bottom: 3px;
    text-transform: uppercase;
    font-weight: 600;
}

.detail-value {
    font-size: 0.9rem;
    font-weight: 700;
    color: #ffffff;
}

.rating-badge {
    background: linear-gradient(135deg, #1ebad9, #E54687);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 1rem;
    text-align: center;
    box-shadow: 0 4px 15px rgba(30, 186, 217, 0.3);
}

.complexity-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 5px;
}

.complexity-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s ease, background-color 0.3s ease;
    background: var(--complexity-color, #1ebad9);
}

.complexity-fill.low-complexity {
    background: linear-gradient(90deg, #4ade80, #22c55e);
}

.complexity-fill.medium-complexity {
    background: linear-gradient(90deg, #fbbf24, #f59e0b);
}

.complexity-fill.high-complexity {
    background: linear-gradient(90deg, #ef4444, #dc2626);
}

.no-results {
    text-align: center;
    padding: 60px 20px;
    color: white;
}

.no-results h3 {
    font-size: 1.8rem;
    margin-bottom: 15px;
}

.no-results p {
    font-size: 1.1rem;
    opacity: 0.8;
}

.game-image.loading {
    opacity: 0.7;
}

.game-image.loaded {
    opacity: 1;
}

.game-image.error {
    display: none;
}

/* Pagination Styles */
.pagination-container {
    margin: 40px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.pagination {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.pagination-btn {
    background: rgba(8, 8, 8, 0.9);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(229, 70, 135, 0.3);
    color: #ffffff;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 44px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.pagination-btn:hover:not(.disabled) {
    background: rgba(229, 70, 135, 0.2);
    border-color: rgba(229, 70, 135, 0.6);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(229, 70, 135, 0.3);
}

.pagination-btn.active {
    background: linear-gradient(135deg, #E54687, #1ebad9);
    border-color: #E54687;
    color: white;
    box-shadow: 0 4px 15px rgba(229, 70, 135, 0.4);
}

.pagination-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: rgba(8, 8, 8, 0.5);
    border-color: rgba(255, 255, 255, 0.1);
}

.pagination-btn.disabled:hover {
    transform: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.pagination-ellipsis {
    color: #1ebad9;
    font-weight: 600;
    padding: 12px 8px;
    font-size: 0.9rem;
}

.pagination-info {
    background: rgba(8, 8, 8, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(30, 186, 217, 0.3);
    color: #1ebad9;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.pagination-btn.page-number {
    min-width: 40px;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-radius: 50%;
    font-weight: 700;
}

.pagination-btn.page-number:hover:not(.disabled):not(.active) {
    background: rgba(30, 186, 217, 0.2);
    border-color: rgba(30, 186, 217, 0.6);
}

.pagination-btn.page-number.active {
    background: linear-gradient(135deg, #1ebad9, #E54687);
    border-color: #1ebad9;
    box-shadow: 0 4px 15px rgba(30, 186, 217, 0.4);
}

.games-grid {
    transition: opacity 0.2s ease-in-out;
}

.games-grid.loading {
    opacity: 0.7;
}

html {
    scroll-behavior: smooth;
}

.game-image.fill-mode {
    object-fit: cover;
}

.game-image.stretch-mode {
    object-fit: fill;
}

/* Responsive Design - Tablet and below */
@media (max-width: 1199px) {
    .header h1 {
        font-size: 2.2rem;
    }
    
    .filters-section {
        padding: 20px;
    }
    
    .filters-grid {
        gap: 15px;
    }
    
    .filter-group input,
    .filter-group select {
        font-size: 0.85rem;
        padding: 8px;
    }
    
    .filter-group label {
        font-size: 0.85rem;
    }
}

/* Medium screens (768px - 1199px) */
@media (min-width: 768px) and (max-width: 1199px) {
    .game-image-container {
        height: 180px;
    }
    
    .game-title {
        font-size: 1.2rem;
    }
    
    .game-content {
        padding: 18px;
    }
    
    .detail-item {
        padding: 7px;
    }
    
    .detail-label {
        font-size: 0.7rem;
    }
    
    .detail-value {
        font-size: 0.85rem;
    }
}

/* Small screens (max-width: 767px) */
@media (max-width: 767px) {
    .header h1 {
        font-size: 1.8rem;
    }
    
    .header p {
        font-size: 1rem;
    }
    
    .filters-section {
        padding: 15px;
    }
    
    /* Make filter grid 2x2 on small screens */
    .filters-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .filter-group input,
    .filter-group select {
        font-size: 0.8rem;
        padding: 6px;
    }
    
    .filter-group label {
        font-size: 0.8rem;
        margin-bottom: 5px;
    }
    
    .filter-actions {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .reset-btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
    
    .results-count {
        font-size: 1rem;
    }
    
    .game-image-container {
        height: 150px;
    }
    
    .game-title {
        font-size: 1rem;
        margin-bottom: 6px;
    }
    
    .game-category {
        font-size: 0.7rem;
        padding: 3px 10px;
    }
    
    .game-content {
        padding: 15px;
    }
    
    .detail-item {
        padding: 6px;
    }
    
    .detail-label {
        font-size: 0.65rem;
        margin-bottom: 2px;
    }
    
    .detail-value {
        font-size: 0.8rem;
    }
    
    .rating-badge {
        font-size: 0.9rem;
        padding: 6px 12px;
    }
    
    .pagination-btn {
        padding: 10px 12px;
        font-size: 0.8rem;
        min-width: 40px;
    }
    
    .pagination-info {
        padding: 10px 16px;
        font-size: 0.8rem;
    }
    
    /* Hide page numbers and ellipsis on small screens, show only prev/next */
    .pagination-btn.page-number,
    .pagination-ellipsis {
        display: none;
    }
    
    .pagination-btn:not(.page-number) {
        display: flex;
    }
}

/* Extra small screens (max-width: 480px) */
@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }
    
    .header h1 {
        font-size: 1.6rem;
    }
    
    .filters-section {
        padding: 12px;
        margin-bottom: 20px;
    }
    
    .filters-grid {
        gap: 10px;
    }
    
    .filter-group input,
    .filter-group select {
        font-size: 0.75rem;
        padding: 5px;
    }
    
    .filter-group label {
        font-size: 0.75rem;
    }
    
    .game-image-container {
        height: 130px;
    }
    
    .game-title {
        font-size: 0.9rem;
        line-height: 1.2;
    }
    
    .game-content {
        padding: 12px;
    }
    
    .game-details {
        gap: 8px;
    }
    
    .detail-item {
        padding: 5px;
    }
    
    .detail-label {
        font-size: 0.6rem;
    }
    
    .detail-value {
        font-size: 0.75rem;
    }
    
    .rating-badge {
        font-size: 0.8rem;
        padding: 5px 10px;
    }
    
    .pagination-btn {
        padding: 8px 10px;
        font-size: 0.75rem;
        min-width: 36px;
    }
    
    .pagination-info {
        padding: 8px 12px;
        font-size: 0.75rem;
    }
}

/* Very small screens (max-width: 360px) */
@media (max-width: 360px) {
    body {
        padding: 10px;
    }
    
    .header h1 {
        font-size: 1.4rem;
    }
    
    .filters-section {
        padding: 10px;
    }
    
    .game-image-container {
        height: 120px;
    }
    
    .game-title {
        font-size: 0.85rem;
    }
    
    .game-content {
        padding: 10px;
    }
    
    .detail-item {
        padding: 4px;
    }
    
    .detail-label {
        font-size: 0.55rem;
    }
    
    .detail-value {
        font-size: 0.7rem;
    }
    
    .game-category {
        font-size: 0.65rem;
        padding: 2px 8px;
    }
    
    .rating-badge {
        font-size: 0.75rem;
        padding: 4px 8px;
    }
}

@media (min-width: 1600px) and (max-width: 2056px) {
    .games-grid {
        grid-template-columns: repeat(5, 1fr);
    }
    .games-grid
    {
        gap: 10px;
    }
    }

.game-image.lazy-loading {
    filter: blur(8px);
    opacity: 0.8;
    transition: filter 0.6s ease-out, opacity 0.4s ease-out;
}

.game-image.lazy-loaded {
    filter: blur(0px);
    opacity: 1;
}

/* Ensure smooth transition */
.game-image {
    transition: filter 0.6s ease-out, opacity 0.4s ease-out;
    will-change: filter, opacity;
}