:root {
    --bg-dark: #070a10;
    --cyan-neon: #00f2fe;
    --cyan-glow: rgba(0, 242, 254, 0.4);
    --glass-bg: rgba(25, 25, 25, 0.4);
    --glass-border: rgba(0, 242, 254, 0.15);
    --text-main: #ffffff;
    --text-muted: rgba(255, 255, 255, 0.6);
    --font-main: 'Montserrat', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-main);
    min-height: 100vh;
    overflow-x: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    -webkit-font-smoothing: antialiased;
}

/* =======================================================
   EFECTOS DE FONDO (FUTURISTA)
   ======================================================= */
.background-effects {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
}

.glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.5;
    animation: floatOrb 15s ease-in-out infinite alternate;
}

.orb-1 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, var(--cyan-glow) 0%, transparent 70%);
    top: -100px;
    left: -100px;
}

.orb-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(0, 100, 255, 0.2) 0%, transparent 70%);
    bottom: -150px;
    right: -100px;
    animation-delay: -5s;
}

.grid-overlay {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    opacity: 0.3;
    perspective: 1000px;
    transform: rotateX(60deg) scale(2.5) translateY(-50px);
    transform-origin: top center;
    mask-image: linear-gradient(to bottom, transparent 0%, black 100%);
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 100%);
    animation: perspectiveMove 30s linear infinite;
}

@keyframes floatOrb {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(50px, 50px) scale(1.2);
    }
}

@keyframes perspectiveMove {
    0% {
        background-position: 0 0;
    }

    100% {
        background-position: 0 500px;
    }
}

/* =======================================================
   CONTENEDOR PRINCIPAL
   ======================================================= */
.main-container {
    width: 100%;
    max-width: 1200px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    z-index: 10;
}

/* =======================================================
   RELOJ EN TIEMPO REAL
   ======================================================= */
.real-time-wrapper {
    margin-bottom: 2rem;
    display: flex;
    justify-content: flex-end;
    width: 100%;
    max-width: 800px;
}

.real-time-clock {
    background: rgba(10, 10, 10, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 0.6rem 1.2rem;
    border-radius: 30px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    color: var(--text-muted);
}

.real-time-clock #current-time {
    color: var(--cyan-neon);
    font-variant-numeric: tabular-nums;
}

/* =======================================================
   HEADER
   ======================================================= */
.header {
    margin-bottom: 4rem;
}

.brand-title {
    font-size: clamp(2.5rem, 6vw, 5rem);
    font-weight: 900;
    letter-spacing: 2px;
    margin-bottom: 0.5rem;
    text-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
}

.highlight {
    background: linear-gradient(90deg, #007bff, #00f2fe);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: none;
    font-style: italic;
}

.subtitle {
    font-size: clamp(1rem, 2vw, 1.2rem);
    color: var(--text-muted);
    font-weight: 300;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

/* =======================================================
   CSS GRID (CONTADOR REGRESIVO)
   ======================================================= */
.countdown-section {
    width: 100%;
    max-width: 900px;
    margin-bottom: 4rem;
}

.countdown-grid {
    display: grid;
    /* Grid automático que se adapta. Min 120px, que ocupe todo el espacio equitativamente */
    grid-template-columns: repeat(var(--grid-columns, 4), 1fr);
    gap: 1.5rem;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.time-box {
    position: relative;
    border-radius: 16px;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.05) 0%, rgba(0, 0, 0, 0.4) 100%);
    padding: 2px;
    /* Espacio para el borde gradiente */
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
    transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform-origin: center;
}

.time-box.hidden {
    opacity: 0;
    transform: scale(0.5) translateY(30px);
    pointer-events: none;
    height: 0;
    padding: 0;
    margin: 0;
    border: none;
    overflow: hidden;
    /* La clase parent js ajustará el grid-template-columns */
}

/* Borde brillante animado opcional */
.time-box::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 16px;
    padding: 1px;
    background: linear-gradient(135deg, var(--cyan-neon), transparent 60%);
    -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;
    opacity: 0.5;
}

.glass-inner {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 14px;
    padding: 2rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.time-value {
    font-size: clamp(3rem, 6vw, 4.5rem);
    font-weight: 700;
    color: var(--cyan-neon);
    font-variant-numeric: tabular-nums;
    text-shadow: 0 0 15px rgba(0, 251, 255, 0.4), 0 0 30px rgba(0, 251, 255, 0.2);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.time-label {
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-muted);
}

/* =======================================================
   CTA CONDICIONAL
   ======================================================= */
.footer {
    width: 100%;
    display: flex;
    justify-content: center;
}

.cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    text-decoration: none;
    padding: 1rem 2.5rem;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: 1px;
    transition: all 0.4s ease;
    min-width: 300px;
}

/* ESTADO BLOQUEADO */
.cta.locked {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: not-allowed;
    pointer-events: none;
}

/* ESTADO ACTIVO / LIVE */
.cta.live {
    background: linear-gradient(90deg, #007bff, #00f2fe);
    color: #ffffff;
    border: none;
    box-shadow: 0 10px 30px rgba(0, 123, 255, 0.4);
    cursor: pointer;
    pointer-events: auto;
    animation: pulseGlow 2s infinite;
}

.cta.live:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 15px 40px rgba(0, 251, 255, 0.6);
}

@keyframes pulseGlow {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 251, 255, 0.4);
    }

    70% {
        box-shadow: 0 0 0 20px rgba(0, 251, 255, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(0, 251, 255, 0);
    }
}

/* =======================================================
   ANIMACIONES DE ENTRADA
   ======================================================= */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInAnim 1s ease forwards;
}

.delay-1 {
    animation-delay: 0.3s;
}

.delay-2 {
    animation-delay: 0.6s;
}

@keyframes fadeInAnim {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =======================================================
   MEDIA QUERIES (MOBILE)
   ======================================================= */
@media (max-width: 768px) {
    .real-time-wrapper {
        justify-content: center;
    }

    /* En móvil mostrar 2x2 */
    .countdown-grid {
        grid-template-columns: repeat(var(--grid-columns-mobile, 2), 1fr) !important;
        gap: 1rem;
    }

    .glass-inner {
        padding: 1.5rem 0.5rem;
    }

    .cta {
        width: 100%;
        padding: 1rem;
        font-size: 1rem;
    }
}