/* Main container — force centering */
.friv-favorites-container {
    max-width: 1200px !important;
    margin: 0 auto !important;
    padding: 20px 0 !important;
    text-align: center !important;
}

/* Grid — center all items */
.friv-favorites-list {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)) !important;
    gap: 25px !important;
    padding: 30px 0 !important;
    justify-content: center !important; /* centers cards in each row */
    justify-items: center !important;   /* centers each individual card */
    width: 100% !important;
}

/* Each card — centered */
.favorite-item {
    position: relative;
    background: #222;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    max-width: 240px !important; /* fixed width for consistency */
    justify-self: center !important;
}

.favorite-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.6);
}

.game-thumb img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.favorite-item:hover .game-thumb img {
    transform: scale(1.08);
}

.game-title {
    margin: 12px 10px;
    font-size: 16px;
    text-align: center;
    color: #fff;
}

.game-title a {
    color: #fff;
    text-decoration: none;
    transition: color 0.3s;
}

.game-title a:hover {
    color: #f1c40f;
}

.remove-favorite {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 22px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.4);
    transition: all 0.3s ease;
}

.remove-favorite:hover {
    background: #c0392b;
    transform: scale(1.2) rotate(90deg);
    box-shadow: 0 6px 16px rgba(231,76,60,0.6);
}

.remove-favorite:active {
    transform: scale(0.9);
}

.no-favorites {
    text-align: center;
    font-size: 1.4em;
    color: #888;
    padding: 60px 0;
    font-style: italic;
}

/* Responsiveness */
@media (max-width: 768px) {
    .friv-favorites-list {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)) !important;
        gap: 15px !important;
    }
}

@media (max-width: 480px) {
    .friv-favorites-list {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)) !important;
    }
}