/* ---------------------------------- */
/* 0. IMPORTACIÓN DE FUENTE LOCAL     */
/* ---------------------------------- */
@font-face {
    font-family: 'caprasimo';
    src: url('../assets/fonts/Caprasimo-Regular.ttf') format('truetype');
}

@font-face {
    font-family: 'incosolata';
    src: url('../assets/fonts/Inconsolata-VariableFont_wdth,wght.ttf') format('truetype');
}

/* ---------------------------------- */
/* 1. Variables y Configuración Base  */
/* ---------------------------------- */
:root {
    --color-primary: #0A1F12;
    --color-primary-green: #08160D;
    --color-primary-red: #CB0129;
    --color-secondary: #A10116;
    --color-text: #FFFFFF;
}

/* CORRECCIÓN 1: Evitar desbordamiento y centrar todo */
html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    /* Impedir overflow horizontal causado por márgenes externos */
    overflow-x: hidden; 
}

body {
    background-color: var(--color-primary);
    color: var(--color-text);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start; 
    gap: 20px;
    /* Usar padding para margen interno */
    padding: 20px 10px 0 10px; 
    min-height: 100vh;
    box-sizing: border-box;
}

header {
    display: flex;
    justify-content: center;
}

/* CORRECCIÓN 2: Usar 100% del ancho y box-sizing estándar */
main {
    width: 100%; /* Ahora usa el 100% del body con padding */
    max-width: 1200px; /* Limita el ancho en pantallas grandes */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding-bottom: 40px; 
    box-sizing: border-box;
}

/* Fuentes base reajustadas para Móvil (VW para escalar) */
h1 {
    font-family: 'caprasimo', sans-serif;
    font-size: 40px; 
    margin: 0;
    text-align: center;
    line-height: 1;
}

h2 {
    font-family: 'caprasimo', sans-serif;
    font-size: 30px; 
    margin: 0;
    text-align: center;
    line-height: 1;
}

h3 {
    font-family: 'incosolata', sans-serif;
    font-size: 6vw; 
    margin: 0;
    text-align: center;
}

p, li, a {
    font-family: 'incosolata', monospace;
    font-weight: 400;
    color: white;
    font-size: 12px;
    text-align: center;
    text-decoration: none;
    margin: 0;
    text-shadow: #08160D;
}

/* ---------------------------------- */
/* 2. Navegación (Ajuste para Móvil)  */
/* ---------------------------------- */
.main-nav {
    position: fixed;
    top: 5%;
    right: 50%;
    transform: translateX(50%); 
    z-index: 1000;
    display: flex;
    justify-content: center; 
    align-content: center;
}

.nav-links {
    display: flex;
    gap: 10px; 
    list-style-type: none;
    align-items: center;
    margin: 0;
    padding: 0;
}
.btn-menu {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
}
.btn-menu img {
    height: 20px;
    width: auto;
}
.nav-links a {
    font-size: 14px;
}

/* CORRECCIÓN: Usar 100% y centrar en móvil */
.grid {
    display: flex;
    flex-direction: column;
    /* Quitamos el margin, ya que el padding del body lo maneja */
    gap: 10px;
    width: 100%; 
    box-sizing: border-box;
    align-items: flex-start;
}

/* ---------------------------------- */
/* 3. Contenedores y Cajas (width/gap)*/
/* ---------------------------------- */
/* CORRECCIÓN: Unificamos el width a 100% y dejamos que el padding del main/body actúe */
.bg-content, .bg-content-red, .bg-content-green {
    width: 100%; 
    padding: 10px; 
    gap: 10px;
    border-radius: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-sizing: border-box; /* Fundamental */
    text-align: center;
}

.bg-content { background-color: var(--color-primary-red); }
.bg-content-red { background-color: var(--color-secondary); }
.bg-content-green { background-color: var(--color-primary-green); }


.bg-content img {
    width: 100%;
    height: auto;
    max-height: 150px;
    object-fit: scale-down;
}

.main-picture {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%; /* Usar 100% para evitar desbordamiento */
    border-radius: 40px;
    object-fit: cover;
}
/* ---------------------------------- */
/* 4. Títulos y Elementos de Lista    */
/* ---------------------------------- */
.title {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 10px;
}
.title img{
    height: 20px;
}
ol, li {
    padding-left: 0; /* Centrar listas */
    text-align: center;
    width: 100%;
    box-sizing: border-box;
    list-style: none;
}

b {
    font-weight: 700;
    color: var(--color-text);
    display: block; 
    margin-top: 10px;
}
/* ---------------------------------- */
/* 5. Cuenta Regresiva (Countdown)    */
/* ---------------------------------- */
#countdown-wrapper {
    /* CORRECCIÓN: Agregar position: relative y centrar */
    display: flex;
    width: 100%;

    gap: 10px;
}

#countdown {
    display: flex;
    gap: 5px;
    text-align: center;
    opacity: 1; 
    transition: opacity 0.5s ease;
}

#days, #minutes, #hours, #seconds {
    font-family: 'caprasimo', sans-serif;
    font-size: 30px; 
    line-height: 1;
}
.countdown-item span {
    color: white;
    line-height: 1;
    display: block; /* Asegura que la unidad quede debajo */
}
.unit {
    font-family: 'inconsolata', sans-serif;
    font-size: 8px; 
    font-weight: 400;
    margin-top: 0.25rem;
    line-height: 1;
}

/* 2. Mensaje de Finalización (Inicialmente oculto) */
#finish-message {
    /* CORRECCIÓN: Establecer la superposición correcta */
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 31, 18, 0.95); /* Fondo oscuro semitransparente */
    border-radius: 40px; /* Igual que el wrapper */
    
    display: flex;
    justify-content: center;
    align-items: center;
    
    /* Estado inicial: Oculto */
    opacity: 0; 
    pointer-events: none; 
    transition: opacity 0.5s ease;
}

#finish-message p {
    font-size: 6vw; /* Usa h3 para la fuente grande, o p para la fuente pequeña */
    font-family: 'caprasimo', sans-serif;
    color: var(--color-primary-red);
    padding: 10px;
    text-align: center;
}

/* --- 4. Comportamiento cuando el evento finaliza (Clase JS) --- */
/* Cuando JS añade la clase 'countdown-finished' al wrapper: */
.countdown-finished #countdown {
    opacity: 0; /* Oculta los números */
    pointer-events: none;
}

.countdown-finished #finish-message {
    opacity: 1; /* Muestra el mensaje */
    pointer-events: auto;
}

/* ---------------------------------- */
/* 6. Clases .lg y .lg-1 (Estilo Glassmorph)*/
/* ---------------------------------- */
.lg, .lg-1 {
    /* ... (Los estilos de Glassmorph se mantienen) */
    background: rgba(255, 255, 255, 0.05);
    box-shadow: inset 1px 0px 1px 0 rgba(255, 255, 255, 0.3), inset 0px 0px 0px 1px rgba(255, 255, 255, 0.3), 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.2);
    color: rgba(255, 255, 255, 0.8);
    transition: all 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.5);
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
}

.lg {
    padding: 10px;
    border-radius: 9999px;
    cursor: pointer;
    font-size: 19px;
}
.lg.btn {
    flex-direction: row;
    align-items: center;
    font-size: 16px;
    gap: 10px;
    padding: 10px;

}
.lg-1 {
    width: -webkit-fill-available; /* CORRECCIÓN */
    padding: 10px;
    border-radius: 40px;
    font-size: 19px;
}
.gl{
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(3px);
}
.lg.btn:hover{
    transform: scale(1.05);
    border-radius: 9999px;
}

/* Quitamos la selección que interfiere con la interacción */
/* .lg.btn::selection{
    transform: scale(0.05);
    border-radius: 9999px;
} */

.lg-1 h2 {
    font-size: 8vw;
    line-height: 1;
}
/* ---------------------------------- */
/* 7. Footer y Redes Sociales         */
/* ---------------------------------- */
.footer-container {
    padding: 20px 0; /* Quitar margen lateral, usar padding */
    gap: 10px;
    border-top: 2px solid rgba(255, 255, 255, 0.2);
    display: flex;
    text-align: center;
    justify-content: center;
    width: 100%;
    box-sizing: border-box;
}
.social-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}
.social-icon {
    width: 2rem; 
    height: 2rem; 
    color: var(--color-text);
    transition: color 0.3s ease, transform 0.3s ease;
}
/* Colores hover específicos */
.social-links a:nth-child(1) .social-icon:hover { color: #60a5fa; transform: scale(1.1); }
.social-links a:nth-child(2) .social-icon:hover { color: #dc2626; transform: scale(1.1); }
.social-links a:nth-child(3) .social-icon:hover { color: #1d4ed8; transform: scale(1.1); }
/* ---------------------------------- */
/* 8. Media Queries para Tabletas y PC*/
/* ---------------------------------- */
@media (min-width: 768px) {
    h1 { font-size: 128px; }
    h2 { font-size: 50px; }
    h3 { font-size: 47px; }
    p, li, div{ font-size: 26px; }
    
    /* Restaurar el posicionamiento del menú */
    .main-nav {
        transform: translateX(50%);
        padding: 10px;
        font-size: 10px;
    }
    #days, #minutes, #hours, #seconds { 
        font-size: 128px;
        font-family: 'caprasimo', sans-serif; 
    }

    .unit { font-size: 26px; }
    
    /* CORRECCIÓN: Grid en PC */
    .grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 20px; /* Aumentamos el gap en PC */
        width: 100%;
        margin: 0;
    }

    .title img {
        height: 40px;
    }
    
    /* Ajuste de fuente del mensaje de finalización en PC */
    #finish-message p {
        font-size: 47px; 
    }
}