/* Favorite Games section (homepage, above Recently Played).
   Deliberately a different look from recently-played.css: that one is a
   grey panel with big orange cards, this one is a violet glass panel with
   pink neon and flatter, wider cards, so the two blocks never read as the
   same list twice. */

#favorites-section {
    position: relative;
    background: linear-gradient(145deg, #1b1233 0%, #241436 55%, #140f26 100%);
    border: 2px solid rgba(255, 71, 133, .38);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .05);
    padding: 16px 16px 20px;
    margin-bottom: 24px;
    overflow: hidden;
}


/* Soft pink light bleeding in from the top corners */

#favorites-section::before {
    content: "";
    position: absolute;
    top: -70px;
    left: 50%;
    transform: translateX(-50%);
    width: 420px;
    height: 160px;
    background: radial-gradient(ellipse at center, rgba(255, 71, 133, .30), transparent 70%);
    pointer-events: none;
}


/* 🔹 Heading */

.fav-head {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin: 4px 0 18px;
}

.fav-head h4 {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 11px 26px;
    font-size: 21px;
    font-weight: 700;
    letter-spacing: .5px;
    text-transform: uppercase;
    color: #fff;
    border-radius: 999px;
    background: linear-gradient(45deg, #ff4785, #b14bff);
    box-shadow: 0 0 18px rgba(255, 71, 133, .55), 0 0 36px rgba(177, 75, 255, .35);
    animation: favPulse 2.4s infinite alternate;
}

.fav-head h4 i {
    font-size: 18px;
    animation: favHeadBeat 1.8s ease-in-out infinite;
}

@keyframes favPulse {
    0% {
        box-shadow: 0 0 12px rgba(255, 71, 133, .45), 0 0 24px rgba(177, 75, 255, .25);
    }
    100% {
        box-shadow: 0 0 26px rgba(255, 71, 133, .85), 0 0 52px rgba(177, 75, 255, .6);
    }
}

@keyframes favHeadBeat {
    0%,
    70%,
    100% {
        transform: scale(1);
    }
    15% {
        transform: scale(1.25);
    }
    30% {
        transform: scale(1);
    }
    45% {
        transform: scale(1.15);
    }
}

.fav-count {
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #ffb3cd;
    background: rgba(255, 71, 133, .12);
    border: 1px solid rgba(255, 71, 133, .35);
    border-radius: 999px;
    padding: 5px 12px;
}


/* 🔹 Grid: 6 per row, deliberately short cards */

.fav-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 12px;
}

.fav-card {
    position: relative;
    border-radius: 14px;
    background: rgba(255, 255, 255, .045);
    border: 1px solid rgba(255, 71, 133, .22);
    padding: 8px 8px 6px;
    transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease, background .25s ease;
}

.fav-card:hover {
    transform: translateY(-6px);
    background: rgba(255, 71, 133, .10);
    border-color: #ff4785;
    box-shadow: 0 12px 26px rgba(0, 0, 0, .40), 0 0 16px rgba(255, 71, 133, .35);
}

.fav-card.removing {
    transform: scale(.86);
    opacity: 0;
    transition: transform .18s ease, opacity .18s ease;
}

.fav-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.fav-link:focus-visible {
    outline: 2px solid #ff4785;
    outline-offset: 3px;
    border-radius: 10px;
}

.fav-thumb {
    display: block;
    border-radius: 10px;
    overflow: hidden;
    line-height: 0;
    background: #0f0b1c;
}

.fav-thumb img {
    width: 100%;
    height: 84px;
    object-fit: cover;
    transition: transform .3s ease, filter .3s ease;
}

.fav-card:hover .fav-thumb img {
    transform: scale(1.08);
    filter: saturate(1.15) brightness(1.06);
}

.fav-name {
    display: block;
    margin-top: 8px;
    font-family: 'Poppins', sans-serif;
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1.25;
    color: #ffd9e6;
    text-align: center;
    /* two lines max, so one long title can't make the row taller */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 32px;
}

.fav-card:hover .fav-name {
    color: #fff;
}


/* 🔹 Remove button */

.fav-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, .25);
    background: rgba(12, 9, 24, .82);
    color: #ffb3cd;
    font-size: 13px;
    line-height: 1;
    cursor: url("https://unblockedgames88.gitlab.io/assets/images/cursor.png"), pointer;
    opacity: 0;
    transform: scale(.8);
    transition: opacity .2s ease, transform .2s ease, background .2s ease, color .2s ease;
    z-index: 3;
}

.fav-card:hover .fav-remove,
.fav-remove:focus-visible {
    opacity: 1;
    transform: scale(1);
}

.fav-remove:hover {
    background: #ff4785;
    border-color: #ff4785;
    color: #fff;
    transform: scale(1.12);
}


/* Touch devices have no hover, so the remove button must always show */

@media (hover: none) {
    .fav-remove {
        opacity: 1;
        transform: scale(1);
    }
}


/* 🔹 Responsive */

@media (max-width: 1200px) {
    .fav-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 991px) {
    .fav-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .fav-thumb img {
        height: 92px;
    }
}

@media (max-width: 575px) {
    #favorites-section {
        padding: 12px 10px 14px;
        border-radius: 16px;
    }
    .fav-head h4 {
        font-size: 17px;
        padding: 9px 18px;
    }
    .fav-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }
    .fav-thumb img {
        height: 88px;
    }
}


/* Users who asked the OS for less motion get the section, not the show */

@media (prefers-reduced-motion: reduce) {
    .fav-head h4,
    .fav-head h4 i,
    .fav-card,
    .fav-thumb img {
        animation: none;
        transition: none;
    }
}
