/* =====================================================
   ASIDE
===================================================== */

.dashboard-aside {
    width: 100%;
    max-width: 340px;
    margin-left: auto;
    color: #fff;
}


/* =====================================================
   BANNER PROMOCIONAL
===================================================== */

.aside-promo {
    display: block;
    width: 100%;
    overflow: hidden;
    border: 2px solid #526ddd;
    border-radius: 34px;
    background: #090622;
    box-shadow:
        0 14px 30px rgba(0, 0, 0, 0.35),
        0 0 20px rgba(56, 46, 224, 0.08);
    transition:
        transform 0.3s ease,
        box-shadow 0.3s ease,
        filter 0.3s ease;
}

.aside-promo:hover {
    transform: translateY(-4px);
    filter: brightness(1.06);
    box-shadow:
        0 18px 35px rgba(0, 0, 0, 0.45),
        0 0 24px rgba(93, 48, 255, 0.18);
}

.aside-promo img {
    display: block;
    width: 100%;
    height: auto;
}


/* =====================================================
   JUEGOS FAVORITOS
===================================================== */

.favorite-games {
    margin-top: 54px;
}

.favorite-games__title {
    margin: 0 0 26px;
    color: #fff;
    font-size: clamp(1.05rem, 1vw, 2rem);
    font-weight: 400;
    line-height: 1.2;
    text-align: center;
}


/* =====================================================
   GRID
===================================================== */

.favorite-games__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 25px 18px;
}


/* =====================================================
   CARD
===================================================== */

.favorite-game-card {
    min-width: 0;
}

.favorite-game-card__image {
    position: relative;
    display: block;
    overflow: hidden;
    aspect-ratio: 1.25 / 1;
    border: 1px solid #6824c8;
    border-radius: 10px;
    background: #09051c;
    width: 150px;
    height: 150px;
}

.favorite-game-card__image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition:
        transform 0.45s ease,
        filter 0.35s ease;
}

.favorite-game-card h3 {
    margin: 7px 3px 0;
    overflow: hidden;
    color: rgba(255, 255, 255, 0.92);
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.25;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
}


/* =====================================================
   FAVORITO
===================================================== */

.favorite-game-card__favorite {
    position: absolute;
    top: 7px;
    right: 7px;
    display: grid;
    place-items: center;
    width: 25px;
    height: 25px;
    border: 2px solid #ffcc00;
    border-radius: 6px;
    background: #ffd500;
    color: #1b1700;
    font-size: 0.9rem;
    font-weight: 900;
    z-index: 3;
    box-shadow: 0 3px 7px rgba(0, 0, 0, 0.35);
}

.favorite-game-card__favorite:not(.is-active) {
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
}


/* =====================================================
   OVERLAY HOVER
===================================================== */

.favorite-game-card__overlay {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    background: rgba(3, 0, 22, 0.68);
    color: #fff;
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    opacity: 0;
    transform: scale(0.98);
    transition:
        opacity 0.3s ease,
        transform 0.3s ease;
    z-index: 2;
}

.favorite-game-card__image:hover img {
    transform: scale(1.08);
    filter: brightness(0.72);
}

.favorite-game-card__image:hover
.favorite-game-card__overlay {
    opacity: 1;
    transform: scale(1);
}


/* =====================================================
   VER MÁS
===================================================== */

.favorite-games__footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 24px;
}

.favorite-games__more {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #fff;
    font-size: 1rem;
    font-weight: 400;
    text-decoration: none;
    text-underline-offset: 4px;
    transition:
        color 0.2s ease,
        transform 0.2s ease;
}

.favorite-games__more span {
    font-size: 1.35rem;
    line-height: 1;
}

.favorite-games__more:hover {
    color: #ffd000;
    transform: translateX(3px);
}


/* =====================================================
   TABLET
===================================================== */

@media (max-width: 1199px) {

    .dashboard-aside {
        max-width: none;
    }

    .aside-promo {
        max-width: 420px;
        margin-inline: auto;
    }

    .favorite-games__grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

}


/* =====================================================
   MOBILE
===================================================== */

@media (max-width: 768px) {

    .dashboard-aside {
        max-width: none;
    }

    .aside-promo {
        max-width: 390px;
        margin-inline: auto;
        border-radius: 28px;
    }

    .favorite-games {
        margin-top: 42px;
    }

    .favorite-games__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 22px 14px;
    }

    .favorite-games__footer {
        justify-content: center;
    }

}


/* =====================================================
   MÓVIL PEQUEÑO
===================================================== */

@media (max-width: 430px) {

    .favorite-games__title {
        margin-bottom: 20px;
        font-size: 1.45rem;
    }

    .favorite-games__grid {
        gap: 18px 10px;
    }

    .favorite-game-card h3 {
        font-size: 0.66rem;
    }

}


/* =====================================================
   ACCESIBILIDAD
===================================================== */

.aside-promo:focus-visible,
.favorite-game-card__image:focus-visible,
.favorite-games__more:focus-visible {
    outline: 3px solid #ffd000;
    outline-offset: 4px;
}

@media (prefers-reduced-motion: reduce) {

    .aside-promo,
    .favorite-game-card__image img,
    .favorite-game-card__overlay,
    .favorite-games__more {
        transition: none;
    }

}

/* =====================================================
   FAVORITOS MÓVIL / CARRUSEL
===================================================== */

.favorite-games--mobile-slider {
    display: none;
}


/* =====================================================
   SOLO MÓVIL
===================================================== */

@media (max-width: 768px) {

    .favorite-games--mobile-slider {
        display: block;
        width: 100%;
        margin: 34px 0 28px;
        padding: 0;
        color: #fff;
        overflow: hidden;

        transition:
            opacity 0.3s ease,
            transform 0.3s ease;
    }

    .favorite-games--mobile-slider.is-hidden {
        display: none;
    }

    .favorite-games--mobile-slider
    .favorite-games__title {
        margin: 0 0 24px;
        padding-inline: 15px;

        font-size: clamp(1.6rem, 6.5vw, 2.15rem);
        font-weight: 300;
        line-height: 1.15;
        text-align: center;
    }


    /* =================================================
       ESTRUCTURA DEL SLIDER
    ================================================= */

    .mobile-favorites-slider {
        position: relative;

        display: grid;
        grid-template-columns: 42px minmax(0, 1fr) 42px;
        align-items: center;

        width: 100%;
        gap: 8px;
    }


    /* =================================================
       VIEWPORT
    ================================================= */

    .mobile-favorites-slider__viewport {
        width: 100%;
        min-width: 0;

        overflow-x: auto;
        overflow-y: hidden;

        scroll-behavior: smooth;
        scroll-snap-type: x mandatory;

        scrollbar-width: none;

        overscroll-behavior-inline: contain;
        -webkit-overflow-scrolling: touch;
    }

    .mobile-favorites-slider__viewport::-webkit-scrollbar {
        display: none;
    }


    /* =================================================
       TRACK
    ================================================= */

    .favorite-games--mobile-slider
    .mobile-favorites-slider__track {
        display: flex;
        align-items: flex-start;

        width: max-content;
        gap: 12px;

        padding: 3px 1px 8px;
    }


    /* Sobrescribe el grid original de favorite-games */

    .favorite-games--mobile-slider
    .favorite-game-card {
        flex: 0 0 clamp(145px, 43vw, 225px);
        width: clamp(145px, 43vw, 225px);

        scroll-snap-align: start;
        scroll-snap-stop: always;
    }

    .favorite-games--mobile-slider
    .favorite-game-card__image {
        aspect-ratio: 1.22 / 1;
        border-radius: 9px;
    }

    .favorite-games--mobile-slider
    .favorite-game-card h3 {
        margin-top: 7px;

        font-size: clamp(0.62rem, 2.4vw, 0.78rem);
    }


    /* =================================================
       FLECHAS
    ================================================= */

    .mobile-favorites-slider__arrow {
        position: relative;
        z-index: 4;

        display: grid;
        place-items: center;

        width: 42px;
        height: 78px;
        padding: 0;

        border: 0;
        background: transparent;
        color: #18a9ff;

        cursor: pointer;

        filter:
            drop-shadow(0 0 3px rgba(0, 139, 255, 0.85));

        transition:
            color 0.22s ease,
            opacity 0.22s ease,
            transform 0.22s ease;
    }

    .mobile-favorites-slider__arrow svg {
        display: block;

        width: 38px;
        height: 70px;

        fill: none;
        stroke: currentColor;
        stroke-width: 1.7;
        stroke-linecap: round;
        stroke-linejoin: round;

        margin-top: -20px;
    }

    .mobile-favorites-slider__arrow:hover {
        color: #fff;
        transform: scale(1.06);
    }

    .mobile-favorites-slider__arrow:active {
        transform: scale(0.94);
    }

    .mobile-favorites-slider__arrow:disabled {
        opacity: 0.25;
        cursor: default;
        transform: none;
    }


    /* =================================================
       BARRA DE POSICIÓN
    ================================================= */

    .mobile-favorites-progress {
        position: relative;

        width: calc(100% - 100px);
        height: 10px;

        margin: 26px auto 0;

        overflow: hidden;

        border-radius: 999px;

        background: #3f4951;
    }

    .mobile-favorites-progress__thumb {
        position: absolute;
        top: 0;
        left: 0;

        width: 25%;
        height: 100%;

        border-radius: inherit;

        background:
            linear-gradient(
                90deg,
                #278dca,
                #4bbcff
            );

        transform: translateX(0);

        transition:
            width 0.22s ease,
            transform 0.12s linear;
    }


    /* =================================================
       OCULTAR EL VER MÁS EN ESTE CARRUSEL
    ================================================= */

    .favorite-games--mobile-slider
    .favorite-games__footer {
        display: none;
    }

}


/* =====================================================
   MÓVILES PEQUEÑOS
===================================================== */

@media (max-width: 430px) {

    .mobile-favorites-slider {
        grid-template-columns: 33px minmax(0, 1fr) 33px;
        gap: 5px;
    }

    .mobile-favorites-slider__arrow {
        width: 33px;
        height: 65px;
    }

    .mobile-favorites-slider__arrow svg {
        width: 31px;
        height: 58px;
    }

    .favorite-games--mobile-slider
    .favorite-game-card {
        flex-basis: 68vw;
        width: 68vw;
        max-width: 160px;
    }

    .mobile-favorites-progress {
        width: calc(100% - 74px);
        height: 8px;
        margin-top: 21px;
    }

}


/* =====================================================
   ACCESIBILIDAD
===================================================== */

.mobile-favorites-slider__arrow:focus-visible {
    outline: 3px solid #ffd000;
    outline-offset: 3px;
    border-radius: 8px;
}

@media (prefers-reduced-motion: reduce) {

    .mobile-favorites-slider__viewport {
        scroll-behavior: auto;
    }

    .mobile-favorites-slider__arrow,
    .mobile-favorites-progress__thumb,
    .favorite-games--mobile-slider {
        transition: none;
    }

}