/* ━━━━━━━━━━━ FONTS (Local) ━━━━━━━━━━━ */
@font-face {
    font-family: 'Anton';
    src: url('../fonts/Anton.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Outfit';
    src: url('../fonts/Outfit-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Outfit';
    src: url('../fonts/Outfit-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

:root {
    --bg-dark: #06030f;
    --bg-mid: #0d0b1a;
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;

    /* Neons */
    --neon-red: #ef4444;
    --neon-red-bright: #ff6b6b;
    --neon-red-glow: rgba(239, 68, 68, 0.6);
    --neon-purple: #8b5cf6;
    --neon-purple-bright: #a78bfa;
    --neon-purple-glow: rgba(139, 92, 246, 0.6);
    --neon-cyan: #06b6d4;
    --neon-cyan-glow: #22d3ee;
    --neon-pink: #ec4899;

    /* Cards */
    --card-bg: rgba(255, 255, 255, 0.03);
    --card-border: rgba(255, 255, 255, 0.08);
    --card-hover-red: rgba(239, 68, 68, 0.15);
    --card-hover-purple: rgba(139, 92, 246, 0.15);
}

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: 'Outfit', sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    -webkit-tap-highlight-color: transparent;
    scroll-behavior: smooth;
}

/* ━━━━━━━━━━━ BACKGROUND ━━━━━━━━━━━ */
.bg-layer {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
}

.bg-image {
    background: url('../img/animeopti.png') center/cover no-repeat;
    opacity: 0.35;
    filter: saturate(1.1) brightness(0.7);
}

/* Orbes desactivados por petición */
.radial-glows, .corner-glow {
    display: none !important;
}

@keyframes glowShift {
    0%   { opacity: 1; transform: scale(1); }
    100% { opacity: 0.7; transform: scale(1.08); }
}

.cyber-mesh {
    opacity: 0.18;
    background-image:
        linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
    background-size: 50px 50px;
    mask-image: radial-gradient(ellipse 90% 90% at center, white 30%, transparent 80%);
    -webkit-mask-image: radial-gradient(ellipse 90% 90% at center, white 30%, transparent 80%);
}

/* Corner neon borders */
.corner-glow {
    position: fixed;
    pointer-events: none;
    z-index: -1;
}
.corner-glow.tl {
    top: -120px; left: -120px;
    width: 350px; height: 350px;
    background: radial-gradient(circle, rgba(239,68,68,0.22), transparent 70%);
    animation: cornerPulse 6s ease-in-out infinite alternate;
}
.corner-glow.br {
    bottom: -120px; right: -120px;
    width: 350px; height: 350px;
    background: radial-gradient(circle, rgba(139,92,246,0.22), transparent 70%);
    animation: cornerPulse 6s ease-in-out infinite alternate-reverse;
}
.corner-glow.tr {
    top: -80px; right: -80px;
    width: 250px; height: 250px;
    background: radial-gradient(circle, rgba(236,72,153,0.12), transparent 70%);
    animation: cornerPulse 8s ease-in-out infinite alternate;
}

@keyframes cornerPulse {
    0%   { opacity: 0.7; transform: scale(1); }
    100% { opacity: 1; transform: scale(1.3); }
}

/* Floating particles canvas */
#particles-canvas {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
}

/* ━━━━━━━━━━━ LAYOUT ━━━━━━━━━━━ */
.app-wrapper {
    max-width: 1100px;
    width: 100%;
    padding: 2.5rem 2rem;
    display: flex;
    flex-direction: column;
    gap: 3.5rem;
    align-items: center;
}

/* ━━━━━━━━━━━ HEADER ━━━━━━━━━━━ */
.main-header {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    animation: fadeInDown 0.9s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
    filter: drop-shadow(0 0 12px rgba(255, 255, 255, 0.2));
    animation: logoFloat 4s ease-in-out infinite;
}

@keyframes logoFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-4px); }
}

.title {
    font-family: 'Anton', sans-serif;
    text-transform: uppercase;
    font-weight: 400;
    font-size: clamp(2.8rem, 9vw, 4.8rem);
    letter-spacing: 0.03em;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    color: #ffffff;
    text-shadow: 
        0 4px 0 rgba(0,0,0,0.8),
        0 8px 15px rgba(0,0,0,0.4),
        0 0 20px rgba(255,255,255,0.1);
}

.title-lol {
    /* Eliminado sombreado interno para máxima claridad */
    color: #ffffff;
}

@keyframes titleShimmer {
    0% { filter: drop-shadow(0 0 15px rgba(34, 211, 238, 0.4)); }
    100% { filter: drop-shadow(0 0 30px rgba(167, 139, 250, 0.6)); }
}

.subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
    font-weight: 400;
    max-width: 560px;
    letter-spacing: 0.02em;
    opacity: 0.85;
}

/* ━━━━━━━━━━━ CARDS ━━━━━━━━━━━ */
.cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(400px, 100%), 1fr));
    gap: 1.8rem;
    width: 100%;
    max-width: 920px;
    animation: fadeInUp 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.15s both;
}

.portal-card {
    text-decoration: none;
    color: inherit;
    background: linear-gradient(145deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.02) 100%);
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 24px;
    position: relative;
    overflow: hidden;
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.5s ease, border-color 0.4s ease, opacity 0.8s ease, filter 0.8s ease;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    cursor: pointer;
}

/* Shine sweep on hover */
.portal-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,0.04) 50%, transparent 60%);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
    z-index: 3;
    border-radius: inherit;
}

.portal-card:hover::after {
    transform: translateX(100%);
}

.card-inner {
    padding: 2.5rem 2.5rem 2.2rem;
    position: relative;
    z-index: 2;
    height: 100%;
    display: flex;
    flex-direction: column;
    min-height: 220px;
}

/* Ambient glow overlay */
.portal-card::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    opacity: 0;
    transition: opacity 0.5s ease;
    border-radius: inherit;
}

.vivo-card::before {
    background:
        radial-gradient(ellipse 80% 60% at 30% 100%, rgba(239, 68, 68, 0.2), transparent),
        radial-gradient(ellipse 50% 50% at 80% 20%, rgba(239, 68, 68, 0.08), transparent);
}

.archivo-card::before {
    background:
        radial-gradient(ellipse 80% 60% at 70% 100%, rgba(139, 92, 246, 0.2), transparent),
        radial-gradient(ellipse 50% 50% at 20% 20%, rgba(139, 92, 246, 0.08), transparent);
}

/* Top edge glow line */
.portal-card .top-glow-line {
    position: absolute;
    top: 0; left: 15%; right: 15%;
    height: 1px;
    opacity: 0;
    transition: opacity 0.5s ease;
    z-index: 4;
    border-radius: 50%;
}

.vivo-card .top-glow-line {
    background: linear-gradient(90deg, transparent, var(--neon-red), transparent);
    box-shadow: 0 0 12px 2px var(--neon-red-glow);
}

.archivo-card .top-glow-line {
    background: linear-gradient(90deg, transparent, var(--neon-purple), transparent);
    box-shadow: 0 0 12px 2px var(--neon-purple-glow);
}

.portal-card:hover .top-glow-line { opacity: 1; }
.portal-card:hover::before { opacity: 1; }

.portal-card:hover {
    transform: translateY(-8px) scale(1.01);
}

.vivo-card:hover {
    border-color: rgba(239, 68, 68, 0.45);
    box-shadow:
        0 20px 60px -15px rgba(239, 68, 68, 0.4),
        0 0 0 1px rgba(239, 68, 68, 0.15),
        inset 0 1px 0 rgba(255,255,255,0.08);
}

.archivo-card:hover {
    border-color: rgba(139, 92, 246, 0.45);
    box-shadow:
        0 20px 60px -15px rgba(139, 92, 246, 0.4),
        0 0 0 1px rgba(139, 92, 246, 0.15),
        inset 0 1px 0 rgba(255,255,255,0.08);
}

/* ━━━ BADGE ━━━ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.9rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    margin-bottom: 1.8rem;
    align-self: flex-start;
}

.badge-vivo {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.badge-archivo {
    background: rgba(139, 92, 246, 0.12);
    border: 1px solid rgba(139, 92, 246, 0.3);
    color: #c4b5fd;
}

.dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}

.red-dot {
    background: var(--neon-red);
    box-shadow: 0 0 8px var(--neon-red), 0 0 16px rgba(239,68,68,0.4);
    animation: pulseRed 1.8s ease-in-out infinite;
}

.purple-dot {
    background: var(--neon-purple);
    box-shadow: 0 0 8px var(--neon-purple), 0 0 16px rgba(139,92,246,0.4);
}

/* ━━━ CARD CONTENT ━━━ */
.card-content-wrap {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1rem;
    margin-top: auto;
}

.text-group h2 {
    font-family: 'Anton', sans-serif;
    text-transform: uppercase;
    font-size: clamp(2.4rem, 4vw, 3.2rem);
    line-height: 1;
    font-weight: 400;
    margin-bottom: 0.6rem;
    letter-spacing: 0.01em;
}

.vivo-card h2 {
    text-shadow: 0 0 40px rgba(239, 68, 68, 0.3);
}

.archivo-card h2 {
    text-shadow: 0 0 40px rgba(139, 92, 246, 0.3);
}

.text-group p {
    color: #cbd5e1; /* Color más claro para mejor contraste */
    font-size: 0.92rem;
    line-height: 1.6;
    max-width: 230px;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5); /* Sombra para resaltar sobre el fondo de anime */
}

.icon-group {
    opacity: 0.75;
    transition: opacity 0.4s ease, transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    flex-shrink: 0;
}

.portal-card:hover .icon-group {
    opacity: 1;
    transform: scale(1.08) translateY(-3px);
}

/* Animated soundwave bars */
.soundwave-bars {
    display: flex;
    align-items: center;
    gap: 4px;
    height: 70px;
}

.bar {
    width: 6px;
    border-radius: 3px;
    background: linear-gradient(180deg, #fda4af, #ef4444);
    animation: barBounce 1.2s ease-in-out infinite;
    transform-origin: bottom;
}

.bar:nth-child(1) { height: 28px; animation-delay: 0s; }
.bar:nth-child(2) { height: 50px; animation-delay: 0.15s; }
.bar:nth-child(3) { height: 35px; animation-delay: 0.3s; }
.bar:nth-child(4) { height: 65px; animation-delay: 0.1s; }
.bar:nth-child(5) { height: 42px; animation-delay: 0.25s; }
.bar:nth-child(6) { height: 20px; animation-delay: 0.4s; }
.bar:nth-child(7) { height: 38px; animation-delay: 0.05s; }

@keyframes barBounce {
    0%, 100% { transform: scaleY(1); opacity: 0.8; }
    50% { transform: scaleY(0.3); opacity: 0.5; }
}

/* ━━━━━━━━━━━ SOCIAL LINKS ━━━━━━━━━━━ */
.social-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
    animation: fadeInUp 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.3s both;
}

.btn-social {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.7rem 1.4rem;
    border-radius: 50px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--text-main);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 500;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.btn-social::before {
    content: '';
    position: absolute;
    inset: 0;
    background: currentColor;
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: inherit;
}

.btn-social:hover::before { opacity: 0.07; }

.btn-social:hover {
    transform: translateY(-4px);
    border-color: currentColor;
}

/* YouTube red */
.btn-social.yt {
    color: #ff4444;
}
.btn-social.yt:hover {
    box-shadow: 0 8px 25px -8px rgba(255,68,68,0.5);
    background: rgba(255,68,68,0.08);
}

/* Twitch purple */
.btn-social.twitch {
    color: #9146ff;
}
.btn-social.twitch:hover {
    box-shadow: 0 8px 25px -8px rgba(145,70,255,0.5);
    background: rgba(145,70,255,0.08);
}

/* Twitter/X white */
.btn-social.twitter {
    color: #e7e9ea;
}
.btn-social.twitter:hover {
    box-shadow: 0 8px 25px -8px rgba(231,233,234,0.3);
    background: rgba(231,233,234,0.06);
}

/* Instagram gradient */
.btn-social.instagram {
    color: #e1306c;
}
.btn-social.instagram:hover {
    box-shadow: 0 8px 25px -8px rgba(225,48,108,0.5);
    background: rgba(225,48,108,0.08);
}

/* Patreon orange */
.btn-social.patreon {
    color: #ff424d;
}
.btn-social.patreon:hover {
    box-shadow: 0 8px 25px -8px rgba(255,66,77,0.5);
    background: rgba(255,66,77,0.08);
}

/* Manga amber */
.btn-social.manga {
    color: #f59e0b;
}
.btn-social.manga:hover {
    box-shadow: 0 8px 25px -8px rgba(245,158,11,0.5);
    background: rgba(245,158,11,0.08);
}

.btn-social svg {
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.btn-social:hover svg {
    transform: scale(1.15);
}

/* ━━━━━━━━━━━ ANIMATIONS ━━━━━━━━━━━ */
@keyframes fadeInDown {
    0% { opacity: 0; transform: translateY(-28px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInUp {
    0% { opacity: 0; transform: translateY(32px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes pulseRed {
    0%, 100% { opacity: 1; box-shadow: 0 0 8px var(--neon-red), 0 0 16px rgba(239,68,68,0.4); }
    50% { opacity: 0.5; box-shadow: 0 0 4px var(--neon-red); }
}

/* ━━━━━━━━━━━ RESPONSIVE ━━━━━━━━━━━ */

/* ── Tablet ── */
@media (max-width: 880px) {
    .app-wrapper {
        padding: 2rem 1.5rem;
        gap: 2.8rem;
        padding-top: max(2rem, env(safe-area-inset-top));
    }
    .cards-container {
        grid-template-columns: 1fr;
        max-width: 540px;
    }
    .card-content-wrap {
        flex-direction: row;
        align-items: flex-end;
    }
    .text-group h2 {
        font-size: 2.6rem;
    }
}

/* ── Mobile ── */
@media (max-width: 600px) {
    body {
        align-items: flex-start;
    }
    /* Optimización: desactivar orbes y partículas en móvil */
    .radial-glows, .corner-glow, #particles-canvas {
        display: none;
    }

    .app-wrapper {
        padding: 1.8rem 1.1rem;
        padding-bottom: calc(1.8rem + env(safe-area-inset-bottom));
        gap: 2.2rem;
        min-height: 100dvh;
        justify-content: center;
    }
    .main-header {
        gap: 0.75rem;
    }
    .logo-icon {
        width: 28px;
        height: 28px;
    }
    .title {
        font-size: clamp(1.7rem, 7vw, 2.2rem);
        gap: 0.35rem;
    }
    .subtitle {
        font-size: 0.95rem;
        padding: 0 0.5rem;
    }
    /* Cards */
    .cards-container {
        gap: 1.2rem;
        max-width: 100%;
    }
    .portal-card {
        border-radius: 18px;
    }
    .card-inner {
        padding: 1.6rem 1.4rem 1.4rem;
        min-height: 180px;
    }
    .badge {
        margin-bottom: 1.3rem;
        font-size: 0.7rem;
    }
    .card-content-wrap {
        flex-direction: row;
        align-items: flex-end;
        gap: 0.8rem;
    }
    .text-group h2 {
        font-size: clamp(1.8rem, 7vw, 2.4rem);
        margin-bottom: 0.5rem;
    }
    .text-group p {
        font-size: 0.85rem;
        max-width: 180px;
    }
    /* Shrink soundwave on small screens */
    .soundwave-bars {
        height: 52px;
        gap: 3px;
    }
    .bar {
        width: 5px;
    }
    .bar:nth-child(1) { height: 20px; }
    .bar:nth-child(2) { height: 38px; }
    .bar:nth-child(3) { height: 26px; }
    .bar:nth-child(4) { height: 50px; }
    .bar:nth-child(5) { height: 32px; }
    .bar:nth-child(6) { height: 16px; }
    .bar:nth-child(7) { height: 28px; }
    /* Social buttons — 3 per row on mobile */
    .social-links {
        gap: 0.55rem;
    }
    .btn-social {
        padding: 0.65rem 1rem;
        font-size: 0.82rem;
        gap: 0.45rem;
        /* min tap target */
        min-height: 44px;
    }
    /* Corner glows smaller */
    .corner-glow.tl,
    .corner-glow.br { width: 220px; height: 220px; }
    .corner-glow.tr { width: 150px; height: 150px; }
}

/* ── Very small phones (≤380px) ── */
@media (max-width: 380px) {
    .app-wrapper {
        padding: 1.4rem 0.9rem;
        gap: 1.8rem;
    }
    .title {
        font-size: 1.6rem;
        flex-wrap: wrap;
        justify-content: center;
    }
    .card-inner {
        padding: 1.3rem 1.1rem 1.2rem;
    }
    .text-group h2 {
        font-size: 1.7rem;
    }
    .text-group p {
        font-size: 0.8rem;
        max-width: 100%;
    }
    .btn-social {
        padding: 0.6rem 0.85rem;
        font-size: 0.78rem;
    }
    /* Hide icons on very small screens to give text more room */
    .icon-group {
        display: none;
    }
    .card-content-wrap {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ── Hover only on pointer devices (disables hover states on touch) ── */
@media (hover: none) {
    .portal-card {
        user-select: none;
        -webkit-user-select: none;
    }
    .portal-card:hover {
        transform: none;
    }
    .vivo-card:hover,
    .archivo-card:hover {
        box-shadow: none;
        border-color: var(--card-border);
    }
    .portal-card:hover::before { opacity: 0; }
    .portal-card:hover .top-glow-line { opacity: 0; }
    
    .btn-social:hover {
        transform: none;
        box-shadow: none;
    }
}

/* ── Respect reduced motion preference ── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    #particles-canvas { display: none; }
}
