/* =====================================================
   SECCIÓN MAQUINITAS
===================================================== */

.machine-games {
    width: 100%;
    padding: clamp(28px, 4vw, 55px);
    border: 2px solid #526fd6;
    border-radius: 34px;
    background:
        linear-gradient(
            145deg,
            rgba(1, 1, 16, 0.96),
            rgba(0, 0, 9, 0.99)
        );
    color: #fff;
}


/* =====================================================
   TOOLBAR
===================================================== */

.machine-games__toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 40px;
}


/* =====================================================
   BUSCADOR
===================================================== */

.machine-games__search {
    position: relative;
    flex: 1 1 360px;
    max-width: 420px;
}

.machine-games__search svg {
    position: absolute;
    top: 50%;
    left: 18px;
    width: 20px;
    height: 20px;
    fill: none;
    stroke: rgba(255, 255, 255, 0.76);
    stroke-width: 2;
    stroke-linecap: round;
    transform: translateY(-50%);
    pointer-events: none;
}

.machine-games__search input {
    width: 100%;
    min-height: 52px;
    padding: 10px 20px 10px 48px;
    border: 2px solid #526fd6;
    border-radius: 14px;
    outline: none;
    background: #233f99;
    color: #fff;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    box-shadow:
        inset 0 0 12px rgba(255, 255, 255, 0.04),
        0 5px 15px rgba(0, 0, 0, 0.18);
    transition:
        border-color 0.25s ease,
        box-shadow 0.25s ease,
        background-color 0.25s ease;
}

.machine-games__search input::placeholder {
    color: rgba(255, 255, 255, 0.78);
}

.machine-games__search input:focus {
    border-color: #8398fa;
    background: #2949ae;
    box-shadow:
        0 0 0 4px rgba(82, 111, 214, 0.18);
}


/* =====================================================
   FILTROS
===================================================== */

.machine-games__filters {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.machine-filter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 52px;
    padding: 10px 21px;
    border: 2px solid transparent;
    border-radius: 13px;
    background: #f4f4f8;
    color: #151927;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 800;
    cursor: pointer;
    transition:
        transform 0.24s ease,
        background-color 0.24s ease,
        color 0.24s ease,
        border-color 0.24s ease,
        box-shadow 0.24s ease;
}

.machine-filter:hover {
    transform: translateY(-2px);
    background: #fff;
}

.machine-filter.is-active {
    border-color: #7188f2;
    background: #2845ad;
    color: #fff;
    box-shadow:
        inset 0 0 0 2px rgba(255, 255, 255, 0.12),
        0 7px 18px rgba(31, 48, 151, 0.35);
}


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

.machine-games__grid {
    display: grid;
    grid-template-columns: repeat(
        6,
        minmax(130px, 1fr)
    );
    gap: 30px 18px;
}


/* =====================================================
   TARJETA
===================================================== */

.machine-game-card {
    min-width: 0;
    text-align: center;
    transition:
        opacity 0.3s ease,
        transform 0.3s ease;
}

.machine-game-card.is-hidden {
    display: none;
}

.machine-game-card__image {
    position: relative;
    display: block;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    border: 1px solid rgba(100, 54, 208, 0.65);
    border-radius: 12px;
    background: #090713;
    box-shadow:
        0 8px 18px rgba(0, 0, 0, 0.24);
    transition:
        transform 0.35s ease,
        border-color 0.35s ease,
        box-shadow 0.35s ease;
}

.machine-game-card__image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition:
        transform 0.5s cubic-bezier(0.22, 1, 0.36, 1),
        filter 0.35s ease;
}


/* =====================================================
   PROVEEDOR
===================================================== */

.machine-game-card__provider {
    position: absolute;
    top: 7px;
    left: 7px;
    z-index: 3;
    padding: 4px 9px;
    border-radius: 999px;
    background: rgba(24, 25, 38, 0.78);
    color: #fff;
    font-size: 0.57rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    backdrop-filter: blur(6px);
}


/* =====================================================
   OVERLAY / ANIMACIÓN FAVORITOS
===================================================== */

.machine-game-card__overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: grid;
    place-items: center;
    background:
        linear-gradient(
            180deg,
            rgba(2, 0, 16, 0.2),
            rgba(2, 0, 20, 0.8)
        );
    opacity: 0;
    transition: opacity 0.35s ease;
}

.machine-game-card__overlay span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 105px;
    min-height: 42px;
    padding: 9px 20px;
    border: 2px solid #ffd72f;
    border-radius: 999px;
    background: #ffd000;
    color: #1b1600;
    font-size: 0.9rem;
    font-weight: 900;
    text-transform: uppercase;
    box-shadow:
        0 8px 20px rgba(0, 0, 0, 0.35);
    opacity: 0;
    transform: translateY(18px) scale(0.92);
    transition:
        opacity 0.35s ease,
        transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.machine-game-card__image:hover {
    transform: translateY(-6px);
    border-color: #8b68ff;
    box-shadow:
        0 15px 25px rgba(0, 0, 0, 0.42),
        0 0 20px rgba(89, 42, 216, 0.16);
}

.machine-game-card__image:hover img {
    transform: scale(1.09);
    filter: brightness(0.63);
}

.machine-game-card__image:hover
.machine-game-card__overlay {
    opacity: 1;
}

.machine-game-card__image:hover
.machine-game-card__overlay span {
    opacity: 1;
    transform: translateY(0) scale(1);
}


/* =====================================================
   TÍTULO
===================================================== */

.machine-game-card h3 {
    margin: 9px 5px 0;
    color: rgba(255, 255, 255, 0.94);
    font-size: 0.76rem;
    font-weight: 700;
    line-height: 1.25;
}


/* =====================================================
   VACÍO
===================================================== */

.machine-games__empty {
    margin: 45px 0 10px;
    color: rgba(255, 255, 255, 0.72);
    font-size: 1rem;
    text-align: center;
}


/* =====================================================
   RESPONSIVE
===================================================== */

@media (max-width: 1500px) {

    .machine-games__grid {
        grid-template-columns: repeat(
            5,
            minmax(130px, 1fr)
        );
    }

}

@media (max-width: 1250px) {

    .machine-games__grid {
        grid-template-columns: repeat(
            4,
            minmax(125px, 1fr)
        );
    }

}

@media (max-width: 900px) {

    .machine-games {
        padding: 28px 22px;
        border-radius: 27px;
    }

    .machine-games__toolbar {
        align-items: stretch;
    }

    .machine-games__search {
        flex-basis: 100%;
        max-width: none;
    }

    .machine-games__filters {
        width: 100%;
    }

    .machine-filter {
        flex: 1 1 140px;
    }

    .machine-games__grid {
        grid-template-columns: repeat(
            3,
            minmax(110px, 1fr)
        );
    }

}

@media (max-width: 600px) {

    .machine-games {
        padding: 24px 14px;
        border-radius: 22px;
    }

    .machine-games__toolbar {
        margin-bottom: 28px;
    }

    .machine-games__filters {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
    }

    .machine-filter {
        width: 100%;
        min-height: 47px;
        padding-inline: 12px;
        font-size: 0.83rem;
    }

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

    .machine-game-card h3 {
        font-size: 0.69rem;
    }

}

@media (max-width: 370px) {

    .machine-games__grid {
        grid-template-columns: 1fr;
    }

}


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

.machine-filter:focus-visible,
.machine-game-card__image:focus-visible,
.machine-games__search input:focus-visible {
    outline: 3px solid #ffd000;
    outline-offset: 4px;
}

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

    .machine-filter,
    .machine-game-card,
    .machine-game-card__image,
    .machine-game-card__image img,
    .machine-game-card__overlay,
    .machine-game-card__overlay span {
        transition: none;
    }

}