/* ═══════════════════════════════════════════════════════════════
   AlvFlix · Sistema de Estilos Responsivo
   Breakpoints: mobile-first
     sm: 640px  (teléfonos grandes)
     md: 768px  (tablets)
     lg: 1024px (laptops)
     xl: 1280px (escritorio)
   ═══════════════════════════════════════════════════════════════ */

/* --- BASE --- */
body {
    background-color: #141414;
    font-family: 'Inter', sans-serif;
    color: white;
    overflow-x: hidden;
    -webkit-tap-highlight-color: transparent;
    /* Quita el flash azul al tocar en móvil */
    -webkit-font-smoothing: antialiased;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

/* --- SCROLLBAR OCULTO (carruseles) --- */
.hide-scroll::-webkit-scrollbar {
    display: none;
}

.hide-scroll {
    -ms-overflow-style: none;
    scrollbar-width: none;
    scroll-behavior: smooth;
}

/* --- SNAP SCROLL --- */
.snap-x {
    scroll-snap-type: x mandatory;
}

.snap-start {
    scroll-snap-align: start;
}

/* --- GRADIENTES HERO --- */
.netflix-gradient {
    background: linear-gradient(to top, #141414 0%, #14141499 20%, transparent 70%);
}

/* Viñeta lateral: fuerte en desktop, sutil en móvil */
.hero-vignette {
    background: linear-gradient(to right, #141414 0%, transparent 60%);
}

@media (max-width: 767px) {
    .hero-vignette {
        background: linear-gradient(to top, #141414 5%, rgba(20, 20, 20, 0.6) 40%, transparent 100%);
    }
}

/* --- NAVEGACIÓN --- */
.nav-active {
    color: white;
    font-weight: 700;
}

.nav-inactive {
    color: #e5e5e5;
    font-weight: 500;
}

@media (max-width: 767px) {
    #nav {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding-left: 1rem;
        padding-right: 1rem;
        padding-bottom: 0.7rem;
        background: linear-gradient(to bottom, rgba(0, 0, 0, 0.88) 0%, rgba(0, 0, 0, 0.68) 70%, transparent 100%);
    }

    #navPrimary {
        display: flex;
        align-items: center;
        justify-content: space-between;
        min-width: 0;
        width: 100%;
    }

    #navPrimary h1 {
        font-size: 1.95rem;
        line-height: 1;
        letter-spacing: -0.04em;
    }

    #navSearchWrap {
        display: none;
    }

    #mobileSearchToggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 2.75rem;
        height: 2.75rem;
        margin-left: auto;
        border-radius: 999px;
        background: rgba(22, 22, 22, 0.72);
        border: 1px solid rgba(255, 255, 255, 0.12);
        backdrop-filter: blur(14px);
        -webkit-backdrop-filter: blur(14px);
        box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2);
    }

    #mobileSearchToggle.is-active {
        background: rgba(229, 9, 20, 0.18);
        border-color: rgba(229, 9, 20, 0.4);
        color: #fff;
    }

    #mobileBottomNav {
        min-height: calc(4.5rem + env(safe-area-inset-bottom, 0px));
        padding-top: 0.45rem;
        border-top-color: rgba(255, 255, 255, 0.08);
        background: rgba(15, 15, 15, 0.96);
        box-shadow: 0 -12px 30px rgba(0, 0, 0, 0.28);
    }

    #mobileBottomNav button {
        min-width: 0;
        flex: 1 1 0;
        gap: 0.3rem;
        padding: 0.4rem 0.2rem;
    }

    #mobileBottomNav span {
        font-size: 0.62rem;
        letter-spacing: -0.01em;
    }

    #heroSection {
        min-height: 100svh;
        padding-top: 5.6rem;
        padding-bottom: 7.4rem;
    }

    #heroBg {
        background-position: center center !important;
        background-size: cover;
    }

    #heroSection .max-w-2xl {
        max-width: 100%;
    }

    .hero-logo-shell {
        min-height: 92px;
        gap: 0.55rem;
        margin-bottom: 0.35rem;
    }

    .hero-logo-skeleton {
        width: min(100%, 300px);
        border-radius: 15px;
    }

    .hero-logo-caption {
        font-size: clamp(1.8rem, 8.8vw, 2.85rem);
        max-width: min(100%, 320px);
    }

    .hero-logo-image {
        max-width: 320px;
        max-height: 92px;
    }
}

.mobile-search-panel {
    position: fixed;
    top: calc(1rem + env(safe-area-inset-top, 0px));
    right: 1rem;
    z-index: 140;
    width: min(78vw, 290px);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-10px) scale(0.97);
    transition: opacity 0.22s ease, transform 0.22s ease;
}

.mobile-search-panel.open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.mobile-search-panel__inner {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    height: 3rem;
    padding: 0 0.85rem;
    border-radius: 999px;
    background: rgba(20, 20, 20, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.11);
    box-shadow: 0 16px 38px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.mobile-search-panel__icon {
    width: 1rem;
    height: 1rem;
    color: rgba(255, 255, 255, 0.55);
    flex-shrink: 0;
}

.mobile-search-panel__input {
    flex: 1 1 auto;
    min-width: 0;
    background: transparent;
    border: 0;
    outline: 0;
    color: #fff;
    font-size: 0.95rem;
}

.mobile-search-panel__input::placeholder {
    color: rgba(255, 255, 255, 0.45);
}

.mobile-search-panel__clear {
    border: 0;
    background: transparent;
    color: rgba(255, 255, 255, 0.58);
    font-size: 1rem;
    line-height: 1;
}

.app-loader {
    position: fixed;
    inset: 0;
    z-index: 400;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.app-loader.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.app-loader__backdrop {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at top, rgba(229, 9, 20, 0.18), transparent 38%),
        linear-gradient(180deg, #0d0d0d 0%, #141414 100%);
}

.app-loader__content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    text-align: center;
}

.app-loader__wordmark {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(3rem, 10vw, 4.8rem);
    letter-spacing: 0.02em;
    color: #e50914;
    text-shadow: 0 8px 30px rgba(229, 9, 20, 0.18);
}

.app-loader__spinner {
    display: flex;
    gap: 0.45rem;
}

.app-loader__spinner span {
    width: 0.6rem;
    height: 0.6rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.82);
    animation: appLoaderPulse 0.9s ease-in-out infinite;
}

.app-loader__spinner span:nth-child(2) {
    animation-delay: 0.12s;
}

.app-loader__spinner span:nth-child(3) {
    animation-delay: 0.24s;
}

.app-loader__text {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.7);
    letter-spacing: 0.02em;
}

@keyframes appLoaderPulse {
    0%,
    100% {
        opacity: 0.35;
        transform: translateY(0);
    }

    50% {
        opacity: 1;
        transform: translateY(-5px);
    }
}

/* --- CARRUSEL BOTONES (solo hover en no-touch) --- */
.group-carousel:hover .carousel-btn:not(.carousel-btn-hidden) {
    opacity: 1;
}

@media (hover: none) {

    /* En dispositivos táctiles, mostrar siempre las flechas pero semitransparentes */
    .carousel-btn {
        opacity: 0.5 !important;
    }
}

/* --- MODAL SCROLL --- */
.modal-scroll::-webkit-scrollbar {
    width: 6px;
}

.modal-scroll::-webkit-scrollbar-track {
    background: #141414;
    border-radius: 8px;
}

.modal-scroll::-webkit-scrollbar-thumb {
    background: #404040;
    border-radius: 8px;
}

/* --- ANIMACIONES --- */
.fade-in {
    animation: fadeIn 0.6s ease-out forwards;
}

.hero-logo-shell {
    width: min(100%, 500px);
    min-height: clamp(84px, 16vw, 132px);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 0.7rem;
    margin-bottom: 0.5rem;
}

.hero-logo-shell--loaded {
    justify-content: center;
}

.hero-logo-skeleton {
    width: min(100%, 420px);
    height: clamp(52px, 10vw, 86px);
    border-radius: 18px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.05)),
        linear-gradient(90deg, rgba(229, 9, 20, 0.2), rgba(255, 255, 255, 0.08), rgba(229, 9, 20, 0.2));
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        0 14px 40px rgba(0, 0, 0, 0.26);
}

.hero-logo-caption {
    font-size: clamp(1.9rem, 5.4vw, 4.5rem);
    font-weight: 900;
    letter-spacing: -0.05em;
    line-height: 0.94;
    color: rgba(255, 255, 255, 0.92);
    text-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    max-width: min(100%, 540px);
}

.hero-logo-image {
    width: 100%;
    max-width: 500px;
    max-height: 132px;
    object-fit: contain;
    object-position: left center;
    display: block;
    filter: drop-shadow(0 20px 35px rgba(0, 0, 0, 0.38));
}

.hero-shimmer {
    position: relative;
    overflow: hidden;
}

.hero-shimmer::after {
    content: "";
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(100deg,
            transparent 15%,
            rgba(255, 255, 255, 0.22) 50%,
            transparent 85%);
    animation: heroShimmer 1.8s ease-in-out infinite;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes heroShimmer {
    100% {
        transform: translateX(100%);
    }
}

/* Animación reducida para usuarios que lo prefieran */
@media (prefers-reduced-motion: reduce) {

    .fade-in,
    * {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* --- GLASS PILL (panel de servidores) --- */
.glass-pill {
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* --- MENÚ HAMBURGUESA MÓVIL --- */
.mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 200;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.mobile-menu.open {
    opacity: 1;
    pointer-events: auto;
}

.mobile-menu li {
    font-size: 1.5rem;
    font-weight: 700;
    cursor: pointer;
    transition: color 0.2s;
    list-style: none;
}

.mobile-menu li:hover {
    color: #e50914;
}

/* --- SAFE AREA (notch en iPhone, barras en Android) --- */
@supports (padding-top: env(safe-area-inset-top)) {
    #nav {
        padding-top: max(1.25rem, env(safe-area-inset-top));
    }

    #playerModal {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* --- RESPONSIVE PLAYER --- */
@media (max-width: 640px) {
    #serverContainer {
        max-width: 100vw !important;
        overflow-x: auto;
        flex-wrap: nowrap !important;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding: 4px;
        gap: 4px;
    }

    #serverContainer::-webkit-scrollbar {
        display: none;
    }
}

/* --- LANDSCAPE PHONE (video player optimizado) --- */
@media (max-height: 500px) and (orientation: landscape) {
    #playerTopBar {
        padding: 6px 10px !important;
    }

    #serverContainer {
        max-height: 32px;
        overflow-y: hidden;
    }
}

/* --- PLAYER TOP BAR: Auto-hide en inactividad de mouse --- */
#playerModal:not(:hover) #playerTopBar {
    opacity: 0;
    transition: opacity 2.5s ease 1.5s;
}

#playerModal:hover #playerTopBar,
#playerModal #playerTopBar:focus-within {
    opacity: 1;
    transition: opacity 0.2s ease;
}

/* Siempre visible en touch */
@media (hover: none) and (pointer: coarse) {
    #playerModal #playerTopBar {
        opacity: 1 !important;
        transition: none !important;
    }
}

/* --- PLAYER SERVER BUTTONS --- */
.player-server-btn.active {
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.15);
}

/* --- TOUCH/TAP OPTIMIZATIONS --- */
@media (hover: none) and (pointer: coarse) {
    button {
        min-height: 44px;
        min-width: 44px;
    }

    input[type="text"] {
        font-size: 16px !important;
    }

    select {
        font-size: 16px !important;
    }
}

/* ═══════════════════════════════════════════════════
   CONTINUAR VIENDO — Tarjetas con barra de progreso
   ═══════════════════════════════════════════════════ */
.continue-card {
    transition: transform 0.28s cubic-bezier(.22, 1, .36, 1),
        box-shadow 0.28s ease,
        border-color 0.28s ease;
    will-change: transform;
}

.continue-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 22px 40px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.08);
    z-index: 10;
}

.continue-shelf {
    position: relative;
}

.continue-shelf__header {
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 0 0.25rem;
}

.continue-shelf__header-copy {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.continue-shelf__title-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.continue-shelf__eyebrow {
    margin: 0 0 0.25rem;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.48);
}

.continue-shelf__heading {
    margin: 0;
    font-size: clamp(1.15rem, 2.2vw, 1.7rem);
    font-weight: 900;
    letter-spacing: -0.03em;
    color: #fff;
}

.continue-shelf__count {
    flex-shrink: 0;
    font-size: 0.78rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.58);
}

.continue-shelf__row {
    display: flex;
    gap: 0.9rem;
    overflow-x: auto;
    padding: 0.25rem 0.25rem 0.65rem;
    align-items: stretch;
}

.continue-shelf__card {
    position: relative;
    overflow: hidden;
    flex: 0 0 min(420px, 82vw);
    width: min(420px, 82vw);
    min-height: 188px;
    border-radius: 18px;
    background: #1a1a1a;
    border: 1px solid rgba(255, 255, 255, 0.06);
    cursor: pointer;
}

.continue-shelf__image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.01);
}

.continue-shelf__scrim {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(0, 0, 0, 0.12) 0%, rgba(0, 0, 0, 0.38) 52%, rgba(7, 7, 7, 0.96) 100%),
        linear-gradient(90deg, rgba(0, 0, 0, 0.42) 0%, transparent 44%);
}

.continue-shelf__body {
    position: relative;
    z-index: 1;
    display: flex;
    height: 100%;
    flex-direction: column;
    justify-content: flex-end;
    padding: 1rem;
}

.continue-shelf__topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.7rem;
}

.continue-shelf__badge {
    align-self: flex-start;
    padding: 0.3rem 0.55rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.12);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.92);
}

.continue-shelf__progress-pill {
    flex-shrink: 0;
    padding: 0.26rem 0.5rem;
    border-radius: 999px;
    background: rgba(229, 9, 20, 0.18);
    border: 1px solid rgba(229, 9, 20, 0.3);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.continue-shelf__copy {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.continue-shelf__title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 900;
    line-height: 1.04;
    letter-spacing: -0.03em;
    color: #fff;
    text-shadow: 0 8px 18px rgba(0, 0, 0, 0.28);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.continue-shelf__subtitle {
    margin: 0.4rem 0 0;
    font-size: 0.78rem;
    line-height: 1.35;
    color: rgba(255, 255, 255, 0.72);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.continue-shelf__actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 0.85rem;
}

.continue-shelf__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.48rem;
    border: 0;
    border-radius: 999px;
    padding: 0.72rem 1rem;
    background: linear-gradient(135deg, #f5f5f5, #d9d9d9);
    color: #0d0d0d;
    font: inherit;
    font-size: 0.8rem;
    font-weight: 900;
    letter-spacing: -0.01em;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
}

.continue-shelf__button-icon {
    font-size: 0.72rem;
    line-height: 1;
}

.continue-shelf__progress {
    flex-shrink: 0;
    max-width: 42%;
    font-size: 0.74rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.78);
    text-align: right;
}

.continue-shelf__bar {
    width: 100%;
    height: 5px;
    margin-top: 0.75rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    overflow: hidden;
}

.continue-shelf__bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #e50914, #ff4036);
    box-shadow: 0 0 18px rgba(229, 9, 20, 0.45);
}

@media (min-width: 768px) {
    .continue-shelf__card {
        flex-basis: min(430px, 32vw);
        width: min(430px, 32vw);
        min-height: 208px;
    }

    .continue-shelf__body {
        padding: 1.1rem 1.1rem 1rem;
    }

    .continue-shelf__title {
        font-size: 1.15rem;
    }

    .continue-shelf__subtitle {
        font-size: 0.82rem;
    }
}

@media (min-width: 1280px) {
    .continue-shelf__card {
        flex-basis: min(430px, 26vw);
        width: min(430px, 26vw);
    }
}

@media (hover: none) {
    .continue-card:hover {
        transform: none;
        box-shadow: none;
    }
}

/* ═══════════════════════════════════════════════════
   FOOTER — AlvFlix (logo Bebas Neue)
   ═══════════════════════════════════════════════════ */
.site-footer {
    position: relative;
    margin-top: 0;
    padding: 0 1rem;
    padding-bottom: max(6rem, calc(1.75rem + env(safe-area-inset-bottom, 0px)));
    background: linear-gradient(180deg, #0c0c0c 0%, #141414 35%, #0a0a0a 100%);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    overflow: hidden;
}

@media (min-width: 768px) {
    .site-footer {
        padding: 0 clamp(1.5rem, 5vw, 3rem);
        padding-bottom: 2.5rem;
    }
}

.site-footer__accent {
    height: 3px;
    width: 100%;
    max-width: 56rem;
    margin: 0 auto;
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(229, 9, 20, 0.15) 20%,
            #e50914 50%,
            rgba(229, 9, 20, 0.15) 80%,
            transparent 100%);
    box-shadow: 0 0 24px rgba(229, 9, 20, 0.45);
}

.site-footer__grid {
    display: grid;
    gap: 2rem;
    max-width: 72rem;
    margin: 0 auto;
    padding: 2.25rem 0 1.75rem;
    text-align: center;
}

@media (min-width: 768px) {
    .site-footer__grid {
        grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.9fr) minmax(0, 1fr);
        gap: 2.5rem;
        text-align: left;
        align-items: start;
        padding: 3rem 0 2rem;
    }
}

.site-footer__brand {
    position: relative;
}

.site-footer__logo {
    font-family: 'Bebas Neue', Impact, sans-serif;
    font-size: clamp(3.25rem, 14vw, 5.5rem);
    line-height: 0.85;
    letter-spacing: 0.08em;
    margin: 0;
    text-shadow: 0 0 40px rgba(229, 9, 20, 0.35);
}

.site-footer__logo-alv {
    color: #fafafa;
}

.site-footer__logo-flix {
    color: #e50914;
    margin-left: 0.02em;
    text-shadow: 0 0 28px rgba(229, 9, 20, 0.6);
}

.site-footer__tagline {
    margin: 0.75rem 0 0;
    font-size: 0.875rem;
    color: #a1a1aa;
    max-width: 22rem;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.5;
}

@media (min-width: 768px) {
    .site-footer__tagline {
        margin-left: 0;
        margin-right: 0;
    }
}

.site-footer__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 1.25rem;
}

@media (min-width: 768px) {
    .site-footer__badges {
        justify-content: flex-start;
    }
}

.site-footer__pill {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 0.35rem 0.65rem;
    border-radius: 9999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    color: #d4d4d8;
}

.site-footer__nav,
.site-footer__aside {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
}

@media (min-width: 768px) {

    .site-footer__nav,
    .site-footer__aside {
        align-items: flex-start;
    }
}

.site-footer__nav-title {
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #e50914;
    margin-bottom: 0.35rem;
}

.site-footer__link {
    background: none;
    border: none;
    padding: 0.35rem 0;
    font: inherit;
    font-size: 0.875rem;
    color: #a1a1aa;
    cursor: pointer;
    transition: color 0.2s ease, transform 0.2s ease;
}

.site-footer__link:hover {
    color: #fff;
    transform: translateX(2px);
}

.site-footer__blurb {
    margin: 0;
    font-size: 0.8125rem;
    line-height: 1.55;
    color: #71717a;
    max-width: 20rem;
    text-align: center;
}

@media (min-width: 768px) {
    .site-footer__blurb {
        text-align: left;
    }
}

.site-footer__cta {
    margin-top: 0.5rem;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.8125rem;
    font-weight: 700;
    color: #e50914;
    text-decoration: none;
    transition: color 0.2s ease, letter-spacing 0.2s ease;
}

.site-footer__cta:hover {
    color: #ff2a32;
    letter-spacing: 0.02em;
}

.site-footer__bottom {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.35rem 0.65rem;
    max-width: 72rem;
    margin: 0 auto;
    padding: 1.25rem 0 0;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 0.75rem;
    color: #52525b;
}

.site-footer__dot {
    opacity: 0.5;
}

@media (prefers-reduced-motion: reduce) {
    .site-footer__link:hover {
        transform: none;
    }
}

/* ═══════════════════════════════════════════════════
   NETFLIX CARD HOVER & HERO VIDEO
   ═══════════════════════════════════════════════════ */

/* Hero Video */
.hero-video-wrapper {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
    opacity: 0;
    transition: opacity 1.5s ease;
}

.hero-video-wrapper iframe {
    width: 100vw;
    height: 56.25vw;
    /* 16:9 aspect ratio */
    min-height: 100vh;
    min-width: 177.77vh;
    /* 16:9 aspect ratio */
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1.15);
    pointer-events: none;
    /* Prevent clicking/pausing the trailer */
}

.hero-video-wrapper.show {
    opacity: 1;
}

.hero-bg-fadeout {
    opacity: 0 !important;
    transition: opacity 1s ease 1s !important;
}

/* Hover Cards */
.netflix-card {
    transition: transform 0.28s cubic-bezier(.22, 1, .36, 1), box-shadow 0.28s ease, border-color 0.28s ease;
    will-change: transform, z-index;
    cursor: pointer;
    transform-origin: center center;
    position: relative;
    overflow: hidden !important;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: #161616;
}

.netflix-card-img {
    height: 100%;
    width: 100%;
    object-fit: cover;
    transition: transform 0.45s ease, filter 0.35s ease;
}

.netflix-card:hover {
    transform: translateY(-4px) scale(1.03);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.12);
    z-index: 50 !important;
    border-color: rgba(255, 255, 255, 0.14);
}

.netflix-card:hover .netflix-card-img {
    transform: scale(1.04);
    filter: saturate(1.05);
}

.card-title-plate {
    position: absolute;
    inset: auto 0 0 0;
    z-index: 12;
    pointer-events: none;
}

.card-title-plate__gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(10, 10, 10, 0.95), rgba(10, 10, 10, 0.72) 48%, transparent);
}

.card-title-plate__content {
    position: relative;
    padding: 0.8rem 0.8rem 0.7rem;
}

.card-title-plate__title {
    margin: 0;
    color: #fff;
    font-weight: 800;
    font-size: 0.88rem;
    line-height: 1.15;
    letter-spacing: -0.02em;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-title-plate__logo {
    display: block;
    max-width: min(76%, 210px);
    max-height: 74px;
    object-fit: contain;
    filter: drop-shadow(0 8px 22px rgba(0, 0, 0, 0.38));
}

.hover-logo-image {
    display: block;
    max-width: min(74%, 205px);
    max-height: 76px;
    object-fit: contain;
    filter: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.42));
}

.hover-logo-fallback {
    margin: 0;
    color: #fff;
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.08;
    letter-spacing: -0.03em;
    text-align: left;
    text-shadow: 0 4px 18px rgba(0, 0, 0, 0.46);
}

/* Expand the details below the image on hover */
.netflix-card-details {
    opacity: 0;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.5) 60%, transparent 100%);
    padding: 10px 8px 6px 8px;
    transition: opacity 0.2s ease 0.3s;
    pointer-events: none;
    z-index: 51;
}

.netflix-card:hover .netflix-card-details {
    opacity: 1;
    pointer-events: auto;
}

/* Allow parent rows to not clip the scaled card */
.group-carousel div[id^="row-"] {
    overflow-y: visible !important;
    padding-top: 1rem;
    padding-bottom: 2rem;
    padding-left: 0.65rem;
    padding-right: 0.65rem;
    margin-bottom: -1rem;
    /* counteract padding */
}

.group-carousel {
    z-index: 1;
}

.group-carousel:hover {
    z-index: 10;
}

.carousel-btn-hidden {
    opacity: 0 !important;
    pointer-events: none !important;
    visibility: hidden !important;
}

@media (min-width: 1024px) {
    .netflix-card--desktop {
        aspect-ratio: 16 / 9 !important;
        border-radius: 12px;
    }

    .netflix-card--desktop .card-title-plate__gradient {
        background: linear-gradient(to top, rgba(6, 6, 6, 0.9), rgba(6, 6, 6, 0.35) 45%, transparent 80%);
    }

    .netflix-card--desktop .card-title-plate__content {
        padding: 0.9rem 0.95rem 0.8rem;
    }

    .netflix-card--desktop .card-title-plate__title {
        font-size: 1rem;
        -webkit-line-clamp: 1;
    }

    .netflix-card--desktop .card-title-plate {
        display: none;
    }

    .netflix-card--desktop.is-hovered {
        transform: translateY(-8px) scale(1.07);
        box-shadow: 0 24px 48px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.16);
        z-index: 60 !important;
    }

    .netflix-card--desktop.is-hovered .card-title-plate {
        opacity: 0;
        transition: opacity 0.2s ease;
    }

    .netflix-card--desktop .netflix-hover-details {
        padding: 0.95rem 1rem 1rem;
        background: linear-gradient(to top, rgba(8, 8, 8, 0.92), rgba(8, 8, 8, 0.58) 42%, rgba(8, 8, 8, 0.08));
        display: flex;
        flex-direction: column;
        justify-content: flex-end;
    }

    .netflix-card--desktop .netflix-hover-details::after {
        content: "";
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
        height: 94px;
        background: linear-gradient(to bottom, rgba(18, 18, 18, 0.08), rgba(18, 18, 18, 0.98) 28%);
        z-index: 0;
        pointer-events: none;
    }

    .netflix-card--desktop .hover-logo-container {
        position: absolute;
        left: 1rem;
        right: 1rem;
        top: 0.8rem;
        min-height: 66px;
        display: flex;
        align-items: flex-start;
        justify-content: flex-start;
        margin: 0;
        z-index: 2;
    }

    .netflix-card--desktop .hover-logo-container img {
        margin-left: 0;
        max-width: min(68%, 190px);
        max-height: 64px;
    }

    .netflix-card--desktop .netflix-hover-details>div:nth-child(2) {
        order: 2;
        position: relative;
        z-index: 2;
        display: flex;
        align-items: center;
        flex-wrap: wrap;
        gap: 0.42rem;
        padding: 0 0.05rem;
        margin: 0.35rem 0 0;
    }

    .netflix-card--desktop .netflix-hover-details>div:nth-child(3) {
        display: none !important;
    }

    .netflix-card--desktop .netflix-hover-details>div:last-child {
        order: 1;
        position: relative;
        z-index: 2;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.65rem;
        margin-top: 0;
    }

    .netflix-card--desktop .netflix-hover-details .pointer-events-auto {
        pointer-events: auto;
    }

    .netflix-card--desktop .netflix-hover-details>div:last-child>button,
    .netflix-card--desktop .netflix-hover-details>div:last-child .shrink-0 button,
    .netflix-card--desktop .netflix-hover-details>div:last-child>div button {
        width: 38px !important;
        height: 38px !important;
        border-radius: 999px !important;
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
    }

    .netflix-card--desktop .netflix-hover-details>div:last-child button svg {
        width: 16px !important;
        height: 16px !important;
    }

    .netflix-card--desktop .netflix-hover-details>div:last-child>div {
        display: flex;
        align-items: center;
        gap: 0.5rem !important;
        order: 2;
        margin-left: auto;
    }

    .netflix-card--desktop .netflix-hover-details>div:last-child>button {
        order: 3;
    }

    .netflix-card--desktop .netflix-hover-details .age-rating-badge,
    .netflix-card--desktop .netflix-hover-details .hover-year-badge,
    .netflix-card--desktop .netflix-hover-details>div:nth-child(2)>span:nth-child(3) {
        font-size: 9px !important;
        font-weight: 700;
        color: rgba(255, 255, 255, 0.88);
        border: 1px solid rgba(255, 255, 255, 0.18);
        background: rgba(255, 255, 255, 0.04);
        padding: 0.18rem 0.42rem !important;
        border-radius: 0.32rem;
        line-height: 1;
    }

    .netflix-card--desktop .netflix-hover-details .hover-genres-badge {
        font-size: 0.76rem !important;
        font-weight: 600;
        color: rgba(255, 255, 255, 0.78);
        max-width: calc(100% - 120px);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .netflix-card--desktop.card-has-logo .card-title-plate__title {
        display: none;
    }
}

@media (max-width: 1023px) {
    .netflix-card--mobile {
        aspect-ratio: 2 / 3 !important;
    }

    .netflix-card--mobile .netflix-hover-details {
        display: none;
    }

    .netflix-card--mobile .card-title-plate {
        display: none;
    }
}


/* ═══════════════════════════════════════════════════════════════
   iOS PWA / STANDALONE — Correcciones cuando se agrega a inicio
   Se activa cuando la app corre en modo installed (sin barra Safari)
   ═══════════════════════════════════════════════════════════════ */
@media (display-mode: standalone) {
    /* La status bar de iOS se superpone al nav — compensar */
    #nav {
        padding-top: max(env(safe-area-inset-top, 20px), 1.25rem) !important;
    }

    /* Bottom nav necesita más espacio para el home indicator de iPhone */
    #mobileBottomNav {
        padding-bottom: max(env(safe-area-inset-bottom, 20px), 1.1rem) !important;
        min-height: calc(3.6rem + env(safe-area-inset-bottom, 20px)) !important;
    }

    /* El hero debe empezar más abajo para no quedar bajo la status bar */
    #heroSection {
        padding-top: calc(env(safe-area-inset-top, 20px) + 5.4rem) !important;
    }

    /* El contenido principal debe tener margen inferior para el bottom nav */
    #mainContent {
        padding-bottom: calc(env(safe-area-inset-bottom, 20px) + 5.5rem) !important;
    }

    /* Footer también necesita espacio del home indicator */
    .site-footer {
        padding-bottom: calc(env(safe-area-inset-bottom, 20px) + 5.5rem) !important;
    }

    /* Modales deben respetar las áreas seguras */
    #detailsModal {
        padding-top: env(safe-area-inset-top, 20px) !important;
    }

    /* El player modal necesita compensar la status bar */
    #playerModal {
        padding-top: env(safe-area-inset-top, 0px) !important;
        padding-bottom: env(safe-area-inset-bottom, 0px) !important;
        padding-left: env(safe-area-inset-left, 0px) !important;
        padding-right: env(safe-area-inset-right, 0px) !important;
    }
}

/* ── iOS PWA extra: la barra de estado translúcida requiere
   compensación vertical incluso fuera de standalone si usa
   apple-mobile-web-app-capable  ── */
@supports (-webkit-touch-callout: none) {
    /* iPhone con notch/Dynamic Island en portrait */
    @media (max-width: 767px) {
        #nav {
            padding-top: max(env(safe-area-inset-top, 0px), 1rem);
        }

        /* Evita que las tarjetas queden cortadas por el bottom nav */
        .group-carousel div[id^="row-"] {
            padding-bottom: 1.5rem;
        }
    }
}


/* ═══════════════════════════════════════════════════════════════
   TARJETAS MÓVIL — Layout mejorado para pantallas pequeñas
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 639px) {
    /* Tarjetas portrait (2/3) más anchas y uniformes */
    .netflix-card--mobile {
        aspect-ratio: 2 / 3 !important;
        border-radius: 10px !important;
        min-width: 108px;
    }

    /* Grid de carrusel más compacto y aprovecha mejor el ancho */
    .group-carousel div[id^="row-"] {
        gap: 0.45rem !important;
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
        padding-top: 0.5rem;
        padding-bottom: 1.8rem;
        margin-bottom: -0.5rem;
    }

    /* Título de sección */
    .group-carousel > div:first-child h2,
    .group-carousel > div:first-child .text-lg,
    .group-carousel > div:first-child .text-xl {
        font-size: 1rem !important;
        font-weight: 800;
        letter-spacing: -0.02em;
    }

    /* Continue watching cards más compactas en móvil */
    .continue-shelf__card {
        flex-basis: min(340px, 78vw) !important;
        width: min(340px, 78vw) !important;
        min-height: 168px !important;
        border-radius: 14px !important;
    }

    .continue-shelf__title {
        font-size: 0.9rem !important;
    }

    .continue-shelf__subtitle {
        -webkit-line-clamp: 1 !important;
    }

    /* Hero en móvil: botones más grandes para toque cómodo */
    #heroSection button {
        min-height: 44px;
        font-size: 0.92rem !important;
        padding-left: 1.2rem !important;
        padding-right: 1.2rem !important;
    }

    /* Input de búsqueda: previene zoom automático en iOS */
    #searchInput,
    #mobileSearchInput {
        font-size: 16px !important;
    }

    /* Separación de secciones */
    .group-carousel {
        margin-bottom: 0.5rem !important;
    }
}

/* ── Pantallas medianas (iPhone Plus, Android grande) ── */
@media (min-width: 390px) and (max-width: 639px) {
    .netflix-card--mobile {
        min-width: 120px;
    }
}


/* ═══════════════════════════════════════════════════════════════
   TV BROWSERS — Fire TV, Android TV, Samsung Tizen, LG WebOS
   Detección: pantalla grande + sin puntero fino + sin touch
   ═══════════════════════════════════════════════════════════════ */
@media (min-width: 1280px) and (hover: hover) and (pointer: coarse) {
    /* TVs con control remoto: puntero grueso, hover disponible,
       pantalla ≥ 1280px (Fire TV Stick 4K = 1080p) */

    /* ── Ocultar elementos de móvil que no aplican en TV ── */
    #mobileBottomNav { display: none !important; }
    #mobileSearchToggle { display: none !important; }
    #mobileSearchPanel { display: none !important; }

    /* ── Mostrar nav completo de desktop ── */
    #navLinks { display: flex !important; }
    #navSearchWrap { display: flex !important; }
    #nav {
        padding-left: 3rem !important;
        padding-right: 3rem !important;
    }

    /* ── Tarjetas más grandes para TV ── */
    .netflix-card {
        border-radius: 10px !important;
    }

    /* ── Botones más grandes (fácil selección con D-pad) ── */
    button, [role="button"] {
        min-height: 56px;
        min-width: 56px;
    }
}

/* ── Pantallas muy grandes sin touch (puede ser TV o monitor 4K) ── */
@media (min-width: 1920px) {
    .netflix-card--desktop {
        border-radius: 14px !important;
    }

    /* Tipografía escalada para verla desde el sofá */
    .card-title-plate__title {
        font-size: 1.1rem !important;
    }

    #nav {
        padding-left: 4rem !important;
        padding-right: 4rem !important;
    }
}


/* ═══════════════════════════════════════════════════════════════
   FOCUS VISIBLE — Navegación con teclado / control remoto D-pad
   Crítico para Fire TV, Android TV y accesibilidad
   ═══════════════════════════════════════════════════════════════ */

/* Quitar el outline por defecto feo */
*:focus { outline: none; }

/* Mostrar outline bonito solo cuando se navega con teclado/remoto */
*:focus-visible {
    outline: 3px solid #e50914 !important;
    outline-offset: 3px !important;
    border-radius: 6px;
}

/* Tarjetas con focus: escala como el hover */
.netflix-card:focus-visible {
    transform: translateY(-4px) scale(1.04) !important;
    box-shadow: 0 0 0 3px #e50914, 0 20px 40px rgba(0,0,0,0.6) !important;
    z-index: 60 !important;
    outline: none !important;
}

/* Botones del bottom nav con focus */
#mobileBottomNav button:focus-visible {
    outline: 2px solid #e50914 !important;
    outline-offset: 2px !important;
    border-radius: 8px;
}

/* Nav links con focus */
#navLinks li:focus-visible {
    outline: 2px solid #e50914 !important;
    outline-offset: 4px !important;
    border-radius: 4px;
    color: #fff;
}

/* Botones del hero */
#heroSection button:focus-visible {
    outline: 3px solid #fff !important;
    outline-offset: 3px !important;
}

/* Botones de server del player */
#serverContainer button:focus-visible {
    outline: 2px solid #e50914 !important;
    outline-offset: 2px !important;
}

/* Elementos del menú móvil */
.mobile-menu li:focus-visible {
    outline: 2px solid #e50914 !important;
    outline-offset: 6px !important;
    border-radius: 4px;
    color: #e50914;
}

/* Cards de deportes */
.sport-card-item:focus-visible {
    outline: 3px solid #e50914 !important;
    outline-offset: 2px !important;
    transform: scale(1.02) !important;
}


/* ═══════════════════════════════════════════════════════════════
   MISCELÁNEOS DE CALIDAD — Ajustes finos para ambas plataformas
   ═══════════════════════════════════════════════════════════════ */

/* Scroll táctil suave en iOS */
.group-carousel div[id^="row-"],
.continue-shelf__row,
#serverContainer,
.server-strip {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
}

/* Texto no seleccionable en elementos interactivos (evita selección accidental al tocar) */
button, [role="button"], .netflix-card, .sport-card-item,
#mobileBottomNav, #nav, .mobile-menu li {
    -webkit-user-select: none;
    user-select: none;
}

/* Tap highlight eliminado en todos lados */
a, button, [role="button"], .netflix-card, .sport-card-item {
    -webkit-tap-highlight-color: transparent;
}

/* Imágenes no arrastrables */
img {
    -webkit-user-drag: none;
    user-drag: none;
}

/* Asegurar que los SVGs de botones siempre sean visibles con o sin Tailwind */
button svg {
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
    pointer-events: none;
}

/* ── Accesibilidad: skip nav para lectores de pantalla ── */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border-width: 0;
}

