* {
    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%);
    padding: 20px;
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background-color: #ffffff;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

h1 {
    text-align: center;
    color: #333;
    margin-bottom: 30px;
    font-size: 28px;
    font-weight: 600;
}

/* Filters Section */
.filters-container {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-group label {
    font-weight: 600;
    color: #555;
    font-size: 14px;
    white-space: nowrap;
}

.filter-group label i {
    color: #667eea;
}

.filter-select {
    padding: 8px 15px;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}

.filter-select:hover {
    border-color: #667eea;
}

.filter-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.reset-btn {
    padding: 8px 20px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.reset-btn:hover {
    background: #c82333;
}

.reset-btn i {
    margin-right: 5px;
}

/* Results Count */
.results-count {
    text-align: center;
    font-size: 16px;
    color: #666;
    margin-bottom: 20px;
    font-weight: 500;
}

.results-count span {
    font-weight: 700;
    color: #667eea;
    font-size: 18px;
}

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

.game-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
}

.game-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.game-images {
    position: relative;
    width: 100%;
    padding-top: 100%; /* Square aspect ratio */
    background-color: #f0f0f0;
    overflow: hidden;
}

.game-images img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.3s;
}

.game-images img:hover {
    transform: scale(1.05);
}

.image-count {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 600;
    z-index: 1;
}

.game-info {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.game-title {
    font-size: 18px;
    font-weight: 700;
    color: #333;
    margin-bottom: 10px;
    line-height: 1.3;
}

.game-title-link {
    color: #667eea;
    text-decoration: none;
    transition: color 0.2s;
}

.game-title-link:hover {
    color: #764ba2;
    text-decoration: underline;
}

.game-title-link i {
    font-size: 14px;
    margin-left: 5px;
}

.game-meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.meta-item {
    display: flex;
    font-size: 14px;
    align-items: center;
    flex-wrap: wrap;
}

.meta-label {
    font-weight: 600;
    color: #667eea;
    min-width: 100px;
    flex-shrink: 0;
}

.meta-value {
    color: #555;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    gap: 5px;
}

.badge-platform {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

/* Icon badges */
.icon-row {
    gap: 8px;
    margin-top: 5px;
}

.icon-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 11px;
    font-weight: 600;
    gap: 5px;
}

.icon-digital {
    background: #17a2b8;
    color: white;
}

.icon-physical {
    background: #28a745;
    color: white;
}

.game-notes {
    font-size: 13px;
    color: #666;
    line-height: 1.5;
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid #eee;
}

.game-notes a {
    color: #667eea;
    text-decoration: none;
    word-break: break-all;
}

.game-notes a:hover {
    text-decoration: underline;
}

/* Magnific Popup Customization */
.mfp-bg {
    background: #000;
    opacity: 0.9;
}

.mfp-figure figure {
    background: #000;
}

.mfp-bottom-bar {
    margin-top: -50px;
}

.mfp-title {
    color: #fff;
    padding: 10px 0;
}

.mfp-counter {
    color: #fff;
}

.mfp-arrow {
    opacity: 0.8;
}

.mfp-arrow:hover {
    opacity: 1;
}

/* Mobile Responsive */
@media screen and (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .container {
        padding: 15px;
        border-radius: 10px;
    }
    
    h1 {
        font-size: 20px;
        margin-bottom: 20px;
    }
    
    .filters-container {
        padding: 15px;
        gap: 10px;
    }
    
    .filter-group {
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
    }
    
    .filter-select {
        width: 100%;
    }
    
    .reset-btn {
        width: 100%;
    }
    
    .results-count {
        font-size: 14px;
        margin-bottom: 15px;
    }
    
    .games-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 15px;
    }
    
    .game-card {
        border-radius: 8px;
    }
    
    .game-info {
        padding: 12px;
    }
    
    .game-title {
        font-size: 14px;
        margin-bottom: 8px;
    }
    
    .meta-item {
        font-size: 12px;
    }
    
    .meta-label {
        min-width: 70px;
        font-size: 11px;
    }
    
    .meta-value {
        font-size: 12px;
    }
    
    .badge {
        font-size: 10px;
        padding: 4px 8px;
    }
    
    .icon-badge {
        font-size: 10px;
        padding: 3px 8px;
    }
    
    .game-notes {
        font-size: 11px;
        padding-top: 8px;
    }
    
    .image-count {
        font-size: 10px;
        padding: 3px 8px;
        bottom: 5px;
        right: 5px;
    }
}

@media screen and (max-width: 480px) {
    .games-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .game-title {
        font-size: 13px;
    }
    
    .meta-label,
    .meta-value {
        font-size: 11px;
    }
}

/* Landscape orientation on mobile */
@media screen and (max-height: 600px) and (orientation: landscape) {
    .container {
        padding: 15px;
    }
    
    h1 {
        font-size: 20px;
        margin-bottom: 15px;
    }
    
    .filters-container {
        padding: 10px;
    }
}
