/* 
Diseño Premium para MensajeGO 
Enfoque: Estética Moderna, Animaciones Fluidas y Tipografía Inter
*/

:root {
    --bg-color: #020617;
    --text-color: #f8fafc;
    --accent-color: #c5a059; /* Gold */
    --accent-glow: rgba(197, 160, 89, 0.3);
    --secondary-color: #94a3b8; /* Silver */
    --secondary-glow: rgba(148, 163, 184, 0.3);
    --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    --font-inter: 'Inter', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-inter);
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Background Canvas (Gradient Animado) */
#background-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: radial-gradient(circle at 20% 30%, #0f172a 0%, transparent 50%),
                radial-gradient(circle at 80% 70%, #1e293b 0%, transparent 50%),
                radial-gradient(circle at 50% 50%, #020617 0%, #000 100%);
    animation: bgPulse 20s ease-in-out infinite alternate;
}

#background-canvas::after {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-image: radial-gradient(rgba(255, 255, 255, 0.1) 1px, transparent 1px);
    background-size: 60px 60px;
    opacity: 0.1;
    animation: starsDrift 150s linear infinite;
}

@keyframes starsDrift {
    from { background-position: 0 0; }
    to { background-position: 1000px 1000px; }
}

@keyframes bgPulse {
    0% { transform: scale(1); }
    100% { transform: scale(1.05); }
}

/* UI Layer (Contador) */
.ui-layer {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 50;
}

/* Efecto de Onda de Clic */
.click-ripple {
    position: fixed;
    width: 2px;
    height: 2px;
    background: rgba(197, 160, 89, 0.2);
    border-radius: 50%;
    pointer-events: none;
    transform: translate(-50%, -50%);
    animation: rippleAnim 0.8s ease-out;
    z-index: 99;
}

@keyframes rippleAnim {
    0% { width: 0; height: 0; opacity: 1; border: 1px solid var(--accent-color); }
    100% { width: 300px; height: 300px; opacity: 0; border: 4px solid transparent; }
}

#counter-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: clamp(10px, 2vw, 15px) clamp(15px, 3vw, 25px);
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

#counter-container .label {
    font-size: clamp(0.5rem, 1.5vw, 0.7rem);
    font-weight: 700;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.3);
    margin-bottom: 5px;
    white-space: nowrap;
    text-transform: uppercase;
}

#countdown {
    font-size: clamp(1.5rem, 5vw, 2.5rem);
    font-weight: 900;
    color: var(--accent-color);
    text-shadow: 0 0 15px var(--accent-glow);
    transition: var(--transition-smooth);
}

#countdown.pulse {
    transform: scale(1.2);
    color: var(--secondary-color);
    text-shadow: 0 0 20px var(--secondary-glow);
}

/* App Manager */
#app-container {
    text-align: center;
    user-select: none;
}

.clickable-text {
    font-size: clamp(3.2rem, 18vw, 15rem);
    font-weight: 900;
    cursor: pointer;
    display: flex;
    justify-content: center;
    flex-wrap: nowrap;
    gap: clamp(2px, 1vw, 8px);
    background: linear-gradient(135deg, #94a3b8 0%, #f1f5f9 25%, #c5a059 50%, #94a3b8 75%, #f1f5f9 100%);
    background-size: 200% auto;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 30px rgba(197, 160, 89, 0.1));
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    z-index: 20;
    animation: textShimmer 8s linear infinite;
}

@keyframes textShimmer {
    to { background-position: 200% center; }
}

.clickable-text:active {
    transform: scale(0.92);
}

.clickable-text span {
    display: inline-block;
    transition: transform 0.2s ease;
    text-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.clickable-text span:hover {
    transform: translateY(-25px) rotate(8deg);
    filter: brightness(1.5) drop-shadow(0 0 20px var(--accent-color));
}

#hint-text {
    margin-top: 20px;
    font-size: clamp(0.75rem, 2.8vw, 1.2rem);
    font-weight: 400;
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    animation: fadeInOut 3s infinite;
    position: relative;
    z-index: 20;
}

@keyframes fadeInOut {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.8; }
}

/* Fragmentación Dynamica (se inyectan vía JS) */
.fragment {
    position: absolute;
    font-weight: 900;
    pointer-events: none;
    white-space: nowrap;
    text-rendering: optimizeSpeed;
    filter: drop-shadow(0 0 10px rgba(197, 160, 89, 0.2));
    z-index: 5;
    background: linear-gradient(45deg, #fff, #c5a059);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    /* La animación se asigna dinámicamente en JS para aleatorizar */
}

/* Animación de Flotación (Gravedad Cero) */
@keyframes floatingSpace {
    0% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(15px, -20px) rotate(2deg); }
    66% { transform: translate(-10px, 15px) rotate(-2deg); }
    100% { transform: translate(0, 0) rotate(0deg); }
}

/* Cinematic Overlay */
#cinematic-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(2, 6, 23, 0.98);
    backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 100;
    opacity: 1;
    transition: opacity 1s ease;
}

#cinematic-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

#paper-plane-container, #character-container {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.paper-plane {
    position: absolute;
    width: clamp(50px, 15vw, 100px);
    height: clamp(50px, 15vw, 100px);
    fill: #f1f5f9;
    filter: drop-shadow(0 0 15px rgba(197, 160, 89, 0.4));
    z-index: 105;
    transition: opacity 0.5s ease;
}

/* Partículas del Avión (Papelitos) */
.paper-plane-particle {
    position: absolute;
    background: white;
    box-shadow: 0 0 10px white;
    pointer-events: none;
    z-index: 104;
}

/* Animación de Entrada del Niño */
.character-svg {
    position: absolute;
    bottom: -100%;
    left: 50%;
    transform: translate(-50%, 0);
    width: clamp(250px, 60vw, 450px);
    height: clamp(300px, 70vw, 550px);
    transition: bottom 1.5s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 110;
}

.character-svg.active {
    bottom: clamp(-40px, -10vw, -80px);
}

/* Mensaje Final */
#final-message {
    z-index: 110;
}

.paper-content {
    background: #ffffff;
    color: #1e293b;
    padding: clamp(20px, 8vw, 60px) clamp(30px, 12vw, 100px);
    border-radius: 4px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    transform: scale(0);
    transition: transform 1s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
    max-width: 90vw;
}

.paper-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, transparent 45%, rgba(0,0,0,0.05) 50%, transparent 55%);
    background-size: 200% 200%;
    animation: shine 3s infinite;
}

@keyframes shine {
    0% { background-position: -200% -200%; }
    100% { background-position: 200% center; }
}

#final-message.active .paper-content {
    transform: scale(1);
}

#final-message h2 {
    font-size: clamp(1.5rem, 8vw, 4rem);
    font-weight: 900;
    letter-spacing: -1px;
    text-transform: uppercase;
    white-space: nowrap;
    background: linear-gradient(135deg, #1e293b, #c5a059);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Footer SEO y Enlaces */
#main-footer {
    position: absolute;
    bottom: 20px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    padding: 0 20px;
    z-index: 30;
    pointer-events: auto;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    padding: 8px 15px;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 50px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    max-width: 100%;
}

.footer-btn {
    font-size: clamp(0.65rem, 2vw, 0.85rem);
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: var(--transition-smooth);
    padding: 4px 8px;
    border-radius: 20px;
}

@media (max-width: 480px) {
    .footer-links {
        border-radius: 20px;
        flex-direction: column;
        align-items: center;
        gap: 5px;
    }
}

.footer-btn:hover {
    color: white;
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-2px);
}

.footer-btn.highlight {
    color: var(--accent-color);
    text-shadow: 0 0 8px rgba(197, 160, 89, 0.2);
}

.footer-btn.highlight:hover {
    transform: translateY(-2px) scale(1.05);
}

.footer-credit {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.3);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* Utilities */
.hidden { display: none !important; }
