/* ============================================================================
   TUXUNIVERSE - EFECTOS DE INTERACCION
   Comportamiento visual compartido para tarjetas y superficies accionables.

   Uso:
   Añadir la clase .efecto-interactivo-led al elemento clicable que envuelve
   la tarjeta. El componente conserva su propio diseño y dimensiones.

   Efectos incluidos:
   - Elevación ligera.
   - Sombra naranja.
   - Recorrido LED alrededor del perímetro.
   - Halo luminoso difuminado.
   - Estado equivalente para navegación mediante teclado.
   ============================================================================ */

@property --tu-led-angle {
    syntax: "<angle>";
    inherits: false;
    initial-value: 0deg;
}

.efecto-interactivo-led {
    position: relative;
    isolation: isolate;
    /* El enlace envolvente comparte el radio de la tarjeta que contiene. */
    border-radius: var(--tu-card-radius);
    transition:
        transform 300ms ease,
        box-shadow 300ms ease;
}

/* Contorno LED: solo se anima el degradado, no gira el elemento. */
.efecto-interactivo-led::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    box-sizing: border-box;
    padding: 1.2px;
    border-radius: inherit;
    pointer-events: none;
    opacity: 0;
    --tu-led-angle: 0deg;
    background: conic-gradient(
        from var(--tu-led-angle),
        transparent 0deg 235deg,
        rgba(255, 80, 0, 0.06) 250deg,
        rgba(255, 80, 0, 0.18) 270deg,
        rgba(255, 80, 0, 0.42) 292deg,
        rgba(255, 80, 0, 0.78) 312deg,
        hsl(19, 100%, 50%) 330deg,
        hsl(19, 100%, 50%) 340deg,
        rgba(255, 80, 0, 0.72) 350deg,
        rgba(255, 80, 0, 0.28) 358deg,
        transparent 360deg
    );
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    filter:
        drop-shadow(0 0 3px rgba(255, 240, 232, 0.95))
        drop-shadow(0 0 6px rgba(255, 87, 34, 0.78))
        drop-shadow(0 0 13px rgba(255, 87, 34, 0.38));
    transition: opacity 180ms ease;
}

/* Halo exterior que acompaña al tramo luminoso. */
.efecto-interactivo-led::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    box-sizing: border-box;
    padding: 3px;
    border-radius: inherit;
    pointer-events: none;
    opacity: 0;
    --tu-led-angle: 0deg;
    background: conic-gradient(
        from var(--tu-led-angle),
        transparent 0deg 235deg,
        rgba(255, 80, 0, 0.04) 252deg,
        rgba(255, 80, 0, 0.12) 275deg,
        rgba(255, 80, 0, 0.26) 300deg,
        rgba(255, 80, 0, 0.48) 325deg,
        rgba(255, 80, 0, 0.30) 345deg,
        rgba(255, 80, 0, 0.10) 358deg,
        transparent 360deg
    );
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    filter: blur(5px);
    transition: opacity 180ms ease;
}

@keyframes tu-led-giratorio {
    to { --tu-led-angle: 360deg; }
}

/* Ratón/trackpad: elevación, sombra y recorrido LED. */
@media (hover: hover) and (pointer: fine) {
    .efecto-interactivo-led:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 24px rgba(255, 102, 0, 0.16);
    }

    .efecto-interactivo-led:hover::before,
    .efecto-interactivo-led:hover::after {
        opacity: 1;
        animation: tu-led-giratorio 1200ms linear infinite;
    }
}

/* Teclado: el mismo tratamiento cuando el elemento recibe el foco. */
.efecto-interactivo-led:focus-visible {
    outline: none;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(255, 102, 0, 0.16);
}

.efecto-interactivo-led:focus-visible::before,
.efecto-interactivo-led:focus-visible::after {
    opacity: 1;
    animation: tu-led-giratorio 2s linear infinite;
}

/* En pantallas táctiles no se simula un hover persistente. */
@media (hover: none), (pointer: coarse) {
    .efecto-interactivo-led:hover {
        transform: none;
        box-shadow: none;
    }
}

/* Respeta la preferencia del usuario de reducir movimiento. */
@media (prefers-reduced-motion: reduce) {
    .efecto-interactivo-led,
    .efecto-interactivo-led::before,
    .efecto-interactivo-led::after {
        transition: none !important;
        animation: none !important;
    }
}

/* ============================================================================
   BUILDS - REVELADO HORIZONTAL ENTRE CATEGORÍAS
   La capa anterior se vuelve transparente de izquierda a derecha y deja ver
   el contenido nuevo situado debajo. La cabecera y las cuatro tarjetas
   comparten la misma máscara; las tarjetas se escalonan desde JavaScript.
   ============================================================================ */

.tu-builds-wipe-cabecera {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 18px;
    isolation: isolate;
}

.tu-builds-wipe-cabecera > .builds-intro {
    position: absolute !important;
    inset: 0;
    width: 100%;
    height: 100%;
    min-height: 0;
    max-height: none;
    aspect-ratio: auto;
    border-radius: inherit;
}

.tu-builds-wipe-tarjeta {
    position: relative;
    display: block;
    width: 100%;
    min-width: 0;
    overflow: hidden;
    border-radius: var(--tu-card-radius);
    background: transparent;
}

.tu-builds-wipe-tarjeta > .builds-categoria {
    position: absolute !important;
    inset: 0;
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
}

.tu-builds-wipe-capa {
    backface-visibility: hidden;
}

.tu-builds-wipe-nueva {
    z-index: 1;
}

.tu-builds-wipe-antigua {
    z-index: 2;
    pointer-events: none;
}

.tu-builds-wipe-antigua.tu-builds-wipe-activa {
    animation-name: tu-builds-revelado-izquierda-derecha;
    animation-duration: var(--tu-builds-wipe-duracion, 1200ms);
    animation-timing-function: linear;
    animation-fill-mode: both;
    animation-delay: var(--tu-builds-wipe-retardo, 0ms);
    will-change: clip-path;
}

@keyframes tu-builds-revelado-izquierda-derecha {
    from { clip-path: inset(0 0 0 0 round var(--tu-builds-wipe-radio, 22px)); }
    to   { clip-path: inset(0 0 0 100% round var(--tu-builds-wipe-radio, 22px)); }
}

@media (max-width: 650px) {
    .tu-builds-wipe-cabecera {
        border-radius: 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .tu-builds-wipe-antigua.tu-builds-wipe-activa {
        animation: none !important;
        clip-path: none !important;
    }
}