/*
 * Game page styles
 * Gallery view with game covers (landscape 16:9)
 */

/* ============ Page Header ============ */

.page-header {
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.stats-line {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* ============ Stats Grid ============ */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 1.25rem;
    text-align: center;
    border: 1px solid var(--border);
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--accent);
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ============ Search Box ============ */

.search-box {
    margin-bottom: 1.5rem;
}

.search-box input {
    width: 100%;
    max-width: 400px;
}

/* ============ Gallery ============ */

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.5rem;
}

.loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
}

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
}

/* ============ Game Card ============ */

.game-card {
    background: var(--bg-secondary);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.game-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px var(--shadow);
}

.game-poster {
    aspect-ratio: 16 / 9;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.game-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.game-poster .placeholder {
    font-size: 3rem;
    color: var(--text-muted);
}

.game-info {
    padding: 0.75rem;
}

.game-title {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.game-year {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* ============ Modal ============ */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-secondary);
    border-radius: 12px;
    max-width: 650px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: transform 0.3s;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.modal-header h2 {
    font-size: 1.25rem;
    line-height: 1.3;
    padding-right: 1rem;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.5rem;
    line-height: 1;
    padding: 0;
    transition: color 0.2s;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 1.5rem;
}

.modal-poster {
    width: 100%;
    margin-bottom: 1rem;
    border-radius: 6px;
    overflow: hidden;
}

.modal-poster img {
    width: 100%;
    display: block;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.modal-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.meta-tag {
    display: inline-block;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    font-size: 0.8rem;
}

.modal-description {
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

.modal-link {
    display: inline-block;
    margin-top: 1rem;
    color: var(--accent);
    font-size: 0.9rem;
}

.modal-link:hover {
    text-decoration: underline;
}

/* ============ Responsive ============ */

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    .gallery {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .page-header h1 {
        font-size: 1.5rem;
    }

    .tabs {
        flex-wrap: wrap;
    }

    .tab-btn {
        padding: 0.75rem 1rem;
        font-size: 0.85rem;
    }

    .gallery {
        grid-template-columns: 1fr;
    }
}
