/* ==============================================================================
   ESTILOS PREMIUM MASTER KINBUX - UTF-8 CON ANIMACIONES Y OPTIMIZACIÓN MÓVIL
   ============================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;600;700;800;900&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Space+Mono:wght@400;700&display=swap');

:root {
    --bg-space: #04060a;
    --bg-card: rgba(10, 14, 23, 0.84);
    --gold-kinbux: #f59e0b;
    --gold-bright: #fbbf24;
    --nano-purple: #a855f7;
    --buxi-red: #ef4444;
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;
    --font-mono: 'Space Mono', monospace;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth;
    -webkit-tap-highlight-color: transparent;
}

html {
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-space);
    color: #f1f5f9;
    overflow-x: hidden;
    max-width: 100vw;
    width: 100%;
    position: relative;
    line-height: 1.6;
}

/* Contenedor seguro de fondo que previene cualquier desborde horizontal en celulares */
.ambient-background-wrapper {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

h1, h2, h3, h4, h5, h6, .font-heading {
    font-family: var(--font-heading);
    letter-spacing: -0.02em;
}

.font-mono {
    font-family: var(--font-mono);
}

.glass-nav {
    background: rgba(4, 6, 10, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    width: 100%;
    max-width: 100vw;
}

#mobile-menu-drawer {
    max-height: calc(85vh);
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

/* ==========================================
   ANIMACIONES DE SCROLL REVEAL (INTERSECTION OBSERVER)
   ========================================== */
.reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}

.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.reveal-left {
    opacity: 0;
    transform: translateX(-30px);
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}

.reveal-left.is-visible {
    opacity: 1;
    transform: translateX(0);
}

.reveal-scale {
    opacity: 0;
    transform: scale(0.94);
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}

.reveal-scale.is-visible {
    opacity: 1;
    transform: scale(1);
}

@media (prefers-reduced-motion: reduce) {
    .reveal, .reveal-left, .reveal-scale {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
}

/* CANVAS DE FONDO DE CONSTELACIONES */
#particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* ISOTIPO X FLOTANTE */
.floating-x-bg {
    position: absolute;
    opacity: 0.035;
    pointer-events: none;
    user-select: none;
    z-index: 0;
    animation: rotateX 45s linear infinite;
}

@keyframes rotateX {
    0% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(180deg) scale(1.08); }
    100% { transform: rotate(360deg) scale(1); }
}

/* ANIMACIONES FLOTANTES */
.float-character {
    animation: floatHeroAnim 6s ease-in-out infinite;
    filter: drop-shadow(0 15px 35px rgba(245, 158, 11, 0.25));
}

.float-helmet {
    animation: floatHelmetAnim 5s ease-in-out infinite;
    filter: drop-shadow(0 0 35px rgba(245, 158, 11, 0.5));
}

@keyframes floatHeroAnim {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-12px) scale(1.02); }
}

@keyframes floatHelmetAnim {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-10px) rotate(2deg); }
}

/* GRADIENTES DE TEXTO */
.text-gradient-gold {
    background: linear-gradient(135deg, #ffffff 0%, #fde047 35%, #f59e0b 70%, #d97706 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.text-gradient-nano {
    background: linear-gradient(135deg, #ffffff 0%, #e879f9 45%, #a855f7 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.text-gradient-buxi {
    background: linear-gradient(135deg, #ffffff 0%, #f87171 45%, #ef4444 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* BOTONES CON GLOW */
.glow-btn-gold {
    background: linear-gradient(135deg, #fbbf24 0%, #d97706 100%);
    color: #04060a;
    font-weight: 900;
    box-shadow: 0 0 25px rgba(245, 158, 11, 0.45);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.glow-btn-gold:hover {
    box-shadow: 0 0 45px rgba(251, 191, 36, 0.8);
    transform: translateY(-2px);
}

.glow-btn-nano {
    background: linear-gradient(135deg, #c084fc 0%, #9333ea 100%);
    color: #ffffff;
    font-weight: 900;
    box-shadow: 0 0 25px rgba(168, 85, 247, 0.45);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.glow-btn-nano:hover {
    box-shadow: 0 0 45px rgba(192, 132, 252, 0.8);
    transform: translateY(-2px);
}

.glow-btn-buxi {
    background: linear-gradient(135deg, #f87171 0%, #dc2626 100%);
    color: #ffffff;
    font-weight: 900;
    box-shadow: 0 0 25px rgba(239, 68, 68, 0.45);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.glow-btn-buxi:hover {
    box-shadow: 0 0 45px rgba(248, 113, 113, 0.8);
    transform: translateY(-2px);
}

/* GLASSMORFISM */
.glass-card {
    background: rgba(10, 14, 23, 0.82);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 1.25rem;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card:hover {
    border-color: rgba(245, 158, 11, 0.4);
    box-shadow: 0 12px 40px -10px rgba(245, 158, 11, 0.25);
    transform: translateY(-4px);
}

.glass-nav {
    background: rgba(4, 6, 10, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(245, 158, 11, 0.2);
}

.glass-badge-gold {
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.4);
    color: #fbbf24;
    backdrop-filter: blur(10px);
}

.glass-input {
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #f8fafc;
    backdrop-filter: blur(10px);
    transition: all 0.25s ease;
}

.glass-input:focus {
    outline: none;
    border-color: #f59e0b;
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.35);
}

/* LUCES RADIALES */
.radial-glow-gold {
    position: absolute;
    width: 650px;
    height: 650px;
    background: radial-gradient(circle, rgba(245, 158, 11, 0.15) 0%, rgba(0, 0, 0, 0) 70%);
    pointer-events: none;
    z-index: 0;
}

.radial-glow-nano {
    position: absolute;
    width: 650px;
    height: 650px;
    background: radial-gradient(circle, rgba(168, 85, 247, 0.14) 0%, rgba(0, 0, 0, 0) 70%);
    pointer-events: none;
    z-index: 0;
}

.radial-glow-buxi {
    position: absolute;
    width: 650px;
    height: 650px;
    background: radial-gradient(circle, rgba(239, 68, 68, 0.14) 0%, rgba(0, 0, 0, 0) 70%);
    pointer-events: none;
    z-index: 0;
}

.pulse-gold {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #f59e0b;
    box-shadow: 0 0 12px #f59e0b;
    animation: pulseGoldAnim 2s infinite;
}

@keyframes pulseGoldAnim {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.8); }
    70% { transform: scale(1.1); box-shadow: 0 0 0 10px rgba(245, 158, 11, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}

/* CARRUSEL DE BANNERS HERO (16:9 EXACTO) */
.hero-banner-track {
    display: flex;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    touch-action: pan-y pinch-zoom;
}

.hero-banner-slide {
    flex: 0 0 100%;
    aspect-ratio: 16 / 9;
    position: relative;
    overflow: hidden;
    border-radius: 1.5rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}

.hero-banner-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* PARALLAX 3D CARD */
.parallax-card {
    transition: transform 0.2s cubic-bezier(0.2, 0, 0.4, 1), box-shadow 0.3s ease;
    transform-style: preserve-3d;
    will-change: transform;
}

.parallax-card:hover {
    box-shadow: 0 25px 60px -15px rgba(245, 158, 11, 0.3);
}

/* CARRUSEL DE FOTOS & PONENCIAS */
.photo-slider-track {
    display: flex;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    touch-action: pan-y pinch-zoom;
}

.photo-slide-item {
    flex: 0 0 100%;
    transition: all 0.3s ease;
}

@media (min-width: 640px) {
    .photo-slide-item {
        flex: 0 0 50%;
    }
}

@media (min-width: 1024px) {
    .photo-slide-item {
        flex: 0 0 33.333%;
    }
}

/* TARJETAS DE LOS 10 ECLIPSES */
.eclipse-card {
    background: rgba(8, 11, 18, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 1.25rem;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
    transition: all 0.35s ease;
}

.eclipse-card:hover {
    border-color: rgba(245, 158, 11, 0.45);
    box-shadow: 0 10px 30px rgba(245, 158, 11, 0.15);
    transform: translateY(-3px);
}

.eclipse-card.color-gold:hover { border-color: rgba(245, 158, 11, 0.6); }
.eclipse-card.color-nano:hover { border-color: rgba(168, 85, 247, 0.6); }
.eclipse-card.color-buxi:hover { border-color: rgba(239, 68, 68, 0.6); }

/* MARQUEE DE ALIADOS */
.marquee-container {
    overflow: hidden;
    user-select: none;
    display: flex;
    gap: 2rem;
    mask-image: linear-gradient(to right, transparent, black 15%, black 85%, transparent);
}

.marquee-content {
    flex-shrink: 0;
    display: flex;
    justify-content: space-around;
    min-width: 100%;
    gap: 2rem;
    animation: scrollMarquee 25s linear infinite;
}

@keyframes scrollMarquee {
    from { transform: translateX(0); }
    to { transform: translateX(calc(-100% - 2rem)); }
}

.marquee-container:hover .marquee-content {
    animation-play-state: paused;
}

/* SCROLLBAR */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #04060a;
}

::-webkit-scrollbar-thumb {
    background: #1e293b;
    border-radius: 4px;
    border: 2px solid #04060a;
}

::-webkit-scrollbar-thumb:hover {
    background: #f59e0b;
}

/* ==========================================
   MODAL INMERSIVO DE DETALLES (CERO SCROLL INFINITO)
   ========================================== */
.immersive-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(4, 6, 10, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, visibility 0.35s ease;
}

.immersive-modal-backdrop.active {
    opacity: 1;
    visibility: visible;
}

.immersive-modal-box {
    background: linear-gradient(145deg, rgba(13, 17, 26, 0.96), rgba(7, 9, 14, 0.98));
    border: 1px solid rgba(245, 158, 11, 0.4);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.8), 0 0 40px rgba(245, 158, 11, 0.18);
    border-radius: 2rem;
    max-width: 860px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    transform: scale(0.92) translateY(20px);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.immersive-modal-backdrop.active .immersive-modal-box {
    transform: scale(1) translateY(0);
}

/* ==========================================
   TEMPORIZADOR DE TORNEO MENSUAL NANO
   ========================================== */
.tournament-timer-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
}

.timer-unit-box {
    background: rgba(15, 10, 25, 0.85);
    border: 1px solid rgba(168, 85, 247, 0.4);
    border-radius: 1rem;
    padding: 0.75rem 0.5rem;
    text-align: center;
    box-shadow: inset 0 0 15px rgba(168, 85, 247, 0.1);
}

.timer-unit-val {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    font-weight: 900;
    color: #fde047;
    line-height: 1;
    text-shadow: 0 0 12px rgba(253, 224, 71, 0.5);
}

.timer-unit-label {
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #c084fc;
    margin-top: 0.25rem;
}

/* TARJETA INTERACTIVA DE ALTO IMPACTO */
.cinematic-feature-card {
    position: relative;
    border-radius: 1.75rem;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(10, 14, 23, 0.75);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
}

.cinematic-feature-card:hover {
    transform: translateY(-6px);
    border-color: rgba(245, 158, 11, 0.5);
    box-shadow: 0 20px 45px -10px rgba(245, 158, 11, 0.25);
}

.cinematic-feature-card .card-bg-img {
    transition: transform 0.6s ease, filter 0.6s ease;
}

.cinematic-feature-card:hover .card-bg-img {
    transform: scale(1.06);
    filter: brightness(1.1);
}

/* ==========================================
   BLOQUES DIVISORES DE SECCIÓN CON EFECTO PARALLAX ELEGANTE
   ========================================== */
.parallax-divider-section {
    position: relative;
    width: 100%;
    min-height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-attachment: fixed;
    background-position: center center;
    background-repeat: no-repeat;
    background-size: cover;
    overflow: hidden;
    margin: 3.5rem 0;
    box-shadow: inset 0 20px 40px rgba(4, 6, 10, 0.95), inset 0 -20px 40px rgba(4, 6, 10, 0.95);
    border-top: 1px solid rgba(245, 158, 11, 0.25);
    border-bottom: 1px solid rgba(245, 158, 11, 0.25);
}

@media (max-width: 768px) {
    .parallax-divider-section {
        background-attachment: scroll; /* Suave en navegadores móviles que no soportan fixed */
        min-height: 220px;
    }
}

.parallax-divider-overlay {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(4, 6, 10, 0.5) 0%, rgba(4, 6, 10, 0.88) 85%);
    backdrop-filter: blur(2px);
}

/* ==========================================
   ACORDEÓN Y TARJETAS DESPLEGABLES INTERACTIVAS (HOVER + CLIC PARA DESGLOSAR)
   ========================================== */
.expandable-block-card {
    position: relative;
    border-radius: 1.75rem;
    background: rgba(10, 14, 23, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}

.expandable-block-card:hover {
    border-color: rgba(245, 158, 11, 0.4);
    box-shadow: 0 15px 40px -10px rgba(245, 158, 11, 0.2);
    transform: translateY(-2px);
}

.expandable-header {
    cursor: pointer;
    user-select: none;
    transition: background-color 0.3s ease;
}

.expandable-header:hover {
    background: rgba(245, 158, 11, 0.04);
}

.expand-chevron {
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.expandable-block-card.is-expanded .expand-chevron {
    transform: rotate(180deg);
}

.expandable-block-card.is-expanded {
    border-color: rgba(245, 158, 11, 0.6);
    box-shadow: 0 25px 60px -15px rgba(245, 158, 11, 0.25);
}

.expandable-body {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.5s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease, padding 0.4s ease;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
    padding-top: 0;
    padding-bottom: 0;
}

.expandable-block-card.is-expanded .expandable-body {
    max-height: 1200px;
    opacity: 1;
    padding-top: 1rem;
    padding-bottom: 1.75rem;
}

/* ==============================================================================
   ESTILOS DE IMPRESIÓN OFICIAL (PDF & DOSSIER ESCOLAR)
   ============================================================================== */
@media print {
    body * {
        visibility: hidden !important;
    }
    #modal-programa-escolar,
    #modal-programa-escolar * {
        visibility: visible !important;
    }
    #modal-programa-escolar {
        position: absolute !important;
        inset: 0 !important;
        width: 100% !important;
        height: auto !important;
        background: #ffffff !important;
        color: #0f172a !important;
        padding: 10px !important;
        display: block !important;
        overflow: visible !important;
    }
    #modal-programa-escolar .bg-slate-950,
    #modal-programa-escolar .bg-slate-900,
    #modal-programa-escolar .bg-slate-900\/80,
    #modal-programa-escolar .bg-slate-900\/60 {
        background: #f8fafc !important;
        color: #0f172a !important;
        border: 1px solid #cbd5e1 !important;
        box-shadow: none !important;
    }
    #modal-programa-escolar h2,
    #modal-programa-escolar h3,
    #modal-programa-escolar strong {
        color: #0369a1 !important;
    }
    #modal-programa-escolar .text-white {
        color: #0f172a !important;
    }
    #modal-programa-escolar .text-slate-300,
    #modal-programa-escolar .text-slate-400 {
        color: #334155 !important;
    }
    .print\:hidden {
        display: none !important;
    }
}




/* ==============================================================================
 * MODO DE PANTALLA COMPLETA / AULA PROYECTOR: FORMATO VERTICAL TIKTOK CENTRADO
 * ============================================================================== */
#game-theater-container:fullscreen,
#game-theater-container:-webkit-full-screen,
#game-theater-container:-moz-full-screen {
    width: 100vw !important;
    height: 100vh !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    background: radial-gradient(circle at center, #1b0c33 0%, #06010a 100%) !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
    position: fixed !important;
    inset: 0 !important;
    z-index: 99999 !important;
}

#game-theater-container:fullscreen #btn-exit-fullscreen,
#game-theater-container:-webkit-full-screen #btn-exit-fullscreen,
#game-theater-container:-moz-full-screen #btn-exit-fullscreen {
    display: flex !important;
}

#game-theater-container:fullscreen #btn-fullscreen-wrapper,
#game-theater-container:-webkit-full-screen #btn-fullscreen-wrapper,
#game-theater-container:-moz-full-screen #btn-fullscreen-wrapper {
    display: none !important;
}

#game-theater-container:fullscreen #game-fullscreen-container,
#game-theater-container:-webkit-full-screen #game-fullscreen-container,
#game-theater-container:-moz-full-screen #game-fullscreen-container {
    height: 94vh !important;
    max-height: 94vh !important;
    width: calc(94vh * (540 / 860)) !important;
    max-width: 95vw !important;
    aspect-ratio: 540 / 860 !important;
    border-radius: 1.5rem !important;
    border: 3px solid rgba(168, 85, 247, 0.7) !important;
    box-shadow: 0 0 50px rgba(168, 85, 247, 0.4), 0 0 120px rgba(0, 0, 0, 0.9) !important;
    margin: auto !important;
    position: relative !important;
    overflow: hidden !important;
}

/* Fallback si el navegador hace fullscreen directo a game-fullscreen-container */
#game-fullscreen-container:fullscreen,
#game-fullscreen-container:-webkit-full-screen,
#game-fullscreen-container:-moz-full-screen {
    width: 100vw !important;
    height: 100vh !important;
    background: radial-gradient(circle at center, #1b0c33 0%, #06010a 100%) !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
}

#game-fullscreen-container:fullscreen canvas#nano-game-canvas,
#game-fullscreen-container:-webkit-full-screen canvas#nano-game-canvas,
#game-fullscreen-container:-moz-full-screen canvas#nano-game-canvas {
    height: 94vh !important;
    max-height: 94vh !important;
    width: calc(94vh * (540 / 860)) !important;
    max-width: 95vw !important;
    aspect-ratio: 540 / 860 !important;
    margin: auto !important;
    border: 3px solid rgba(168, 85, 247, 0.7) !important;
    border-radius: 1.5rem !important;
    box-shadow: 0 0 50px rgba(168, 85, 247, 0.4), 0 0 120px rgba(0, 0, 0, 0.9) !important;
    display: block !important;
}

#game-fullscreen-container:fullscreen > div[id$="-overlay"],
#game-fullscreen-container:-webkit-full-screen > div[id$="-overlay"],
#game-fullscreen-container:-moz-full-screen > div[id$="-overlay"] {
    position: absolute !important;
    left: 50% !important;
    top: 50% !important;
    transform: translate(-50%, -50%) !important;
    height: 94vh !important;
    max-height: 94vh !important;
    width: calc(94vh * (540 / 860)) !important;
    max-width: 95vw !important;
    aspect-ratio: 540 / 860 !important;
    border-radius: 1.5rem !important;
    overflow-y: auto !important;
}