/* GAME module — list, detail, leaderboard */

.game-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 260px));
    justify-content: center;
    gap: 20px;
    padding: 24px 40px 40px;
    max-width: 1100px;
    margin: 0 auto;
}

.game-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1rem;
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    color: inherit;
    text-decoration: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    max-width: 260px;
}

.game-tile:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.game-tile img.game-tile-icon {
    width: 128px;
    height: 128px;
    object-fit: contain;
    border-radius: 6px;
    margin-bottom: 0.75rem;
}

.game-tile h3 {
    margin: 0.25rem 0;
}

.game-tile p {
    font-size: 0.9rem;
    opacity: 0.85;
    margin: 0;
}

.game-detail {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    max-width: 680px;
    margin: 0 auto;
}

.game-detail img.game-detail-icon {
    width: 200px;
    height: 200px;
    object-fit: contain;
    border-radius: 10px;
}

.game-detail h2 {
    margin: 0;
}

.game-detail p.game-description {
    text-align: center;
    line-height: 1.5;
}

.game-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 0.5rem;
}

.game-actions .btn {
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    border: 1px solid #555;
    background-color: #2b2b2b;
    color: #f0f0f0;
    cursor: pointer;
    text-decoration: none;
    font-size: 1rem;
}

.game-actions .btn-primary {
    background-color: #c0392b;
    border-color: #c0392b;
}

.game-actions .btn:hover {
    filter: brightness(1.1);
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.leaderboard-table th,
.leaderboard-table td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid #333;
    text-align: left;
}

.leaderboard-table th {
    background-color: var(--color-primary);
    color: white;
}

.leaderboard-table td.num {
    text-align: left;
    font-variant-numeric: tabular-nums;
}

.leaderboard-empty {
    margin-top: 1.5rem;
    opacity: 0.75;
    text-align: center;
}

@media (max-width: 720px) {
    .game-list {
        padding: 16px;
        gap: 12px;
    }

    .game-tile img.game-tile-icon {
        width: 96px;
        height: 96px;
    }

    .game-detail {
        padding: 1rem;
    }

    .game-detail img.game-detail-icon {
        width: 140px;
        height: 140px;
    }

    /* Leaderboard: shrink font + pad, prevent timestamp wrap, drop the
     * "Played" column entirely so the four essential columns
     * (Rank/Player/Score/Duration) fit cleanly on a 360-720px viewport. */
    .leaderboard-table {
        font-size: 0.85rem;
    }

    .leaderboard-table th,
    .leaderboard-table td {
        padding: 0.5rem 0.5rem;
        white-space: nowrap;
    }

    .leaderboard-table th:nth-child(5),
    .leaderboard-table td:nth-child(5) {
        display: none;
    }
}
