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

html, body {
  width: 100%;
  min-height: 100vh;
  background: radial-gradient(ellipse at center, #0a0a0a 0%, #000000 100%);
  overflow-x: hidden;
}

/* BIENVENIDA */
.welcome {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 3rem;
    font-weight: bold;
    font-family: 'Arial', sans-serif;
    text-align: center;
    white-space: nowrap;
    animation: fadeUp 1.6s ease-out forwards;
    pointer-events: none;
    z-index: 2000;
}

@keyframes fadeUp {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -300px);
    }
}

/* CONTENIDO PRINCIPAL (oculto hasta que termine la bienvenida) */
.contenido-principal {
    display: none;
}

.contenido-principal.visible {
    display: block;
}

/* MENÚ SUPERIOR */
.menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    padding: 1rem 2rem;
    background: rgba(0, 0, 0, 0);
    backdrop-filter: blur(12px);
    z-index: 1000;
    transition: all 0.3s ease;
    gap: 0;
}

.menu.scrolled {
    background: rgba(5, 5, 10, 0.95);
    backdrop-filter: blur(16px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.menu-logo {
    color: white;
    font-size: 0.98rem;
    font-weight: 700;
    letter-spacing: 2px;
    background: linear-gradient(135deg, #fff, #888);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.menu-links {
    display: flex;
    gap: 2rem;
    list-style: none;
    justify-content: center;
    align-items: center;
}

.menu-link {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 1px;
    padding: 0.5rem 0;
    position: relative;
    transition: color 0.3s ease;
}

.menu-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 0px;
    background: transparent;
    transition: width 0.3s ease;
}

.menu-link:hover::after,
.menu-link.active::after {
    width: 0;
}

.menu-link:hover,
.menu-link.active {
    color: white;
}

.menu-hamburguesa {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
}

.menu-hamburguesa span {
    width: 25px;
    height: 2px;
    background: white;
    transition: all 0.3s ease;
}

/* CONTENIDO PRINCIPAL (texto y círculos) */
.contenido {
    max-width: 1200px;
    margin: 0 auto;
    padding: 100px 2rem 2rem 2rem;
}

.frase {
    text-align: center;
    margin: 4rem 0 6rem 0;
}

.frase-texto {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.5rem;
    line-height: 1.6;
    letter-spacing: 1px;
}

/* CÍRCULOS */
.circulos {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2.5rem;
    margin: 3rem 0 6rem 0;
}

.circulo {
    width: 240px;
    height: 240px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.2, 0.9, 0.4, 1.1);
    position: relative;
    overflow: hidden;
}

.circulo::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: rgba(10, 10, 20, 0.6);
    backdrop-filter: blur(16px);
    z-index: 0;
}

.circulo-titulo,
.circulo-descripcion {
    position: relative;
    z-index: 1;
}

.circulo-titulo {
    color: white;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.8rem;
    letter-spacing: 3px;
}

.circulo-descripcion {
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.85rem;
    max-width: 160px;
    line-height: 1.5;
    font-weight: 300;
}

.circulo::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 50%;
    background: linear-gradient(135deg, transparent 0%, transparent 70%, currentColor 100%);
    opacity: 0.6;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 1;
}

.circulo:hover::after {
    opacity: 1;
}

.circulo .glare {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    border-radius: 50%;
    background: radial-gradient(circle at var(--x, 50%) var(--y, 50%), rgba(255, 255, 255, 0.25) 0%, rgba(255, 255, 255, 0) 60%);
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
    z-index: 2;
}

.circulo:hover .glare {
    opacity: 1;
}

/* COLORES POR SECCIÓN */
.circulo[data-seccion="comunidad"] { color: #3b82f6; }
.circulo[data-seccion="comunidad"]:hover { transform: scale(1.06); box-shadow: 0 0 40px rgba(59, 130, 246, 0.4); }

.circulo[data-seccion="creacion"] { color: #10b981; }
.circulo[data-seccion="creacion"]:hover { transform: scale(1.06); box-shadow: 0 0 40px rgba(16, 185, 129, 0.4); }

.circulo[data-seccion="Mi espacio"] { color: #a855f7; }
.circulo[data-seccion="Mi espacio"]:hover { transform: scale(1.06); box-shadow: 0 0 40px rgba(168, 85, 247, 0.4); }

.circulo[data-seccion="viaje"] { color: #f59e0b; }
.circulo[data-seccion="viaje"]:hover { transform: scale(1.06); box-shadow: 0 0 40px rgba(245, 158, 11, 0.4); }

/* ESTRELLAS */
.estrella {
    position: fixed;
    background-color: white;
    border-radius: 50%;
    opacity: 0;
    pointer-events: none;
    z-index: 0;
    animation: brilloEstrella 4s ease-in-out infinite;
}

@keyframes brilloEstrella {
    0% { opacity: 0; transform: scale(0.5); }
    50% { opacity: 0.6; transform: scale(1); }
    100% { opacity: 0; transform: scale(0.5); }
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .menu {
        grid-template-columns: auto 1fr auto;
        padding: 0.7rem 1rem;
    }
    .menu-derecha {
        grid-column: 3;
        justify-self: end;
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }
    .menu-hamburguesa {
        display: flex;
    }
    .menu-links {
        position: fixed;
        top: 60px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 60px);
        background: rgba(5, 5, 10, 0.98);
        backdrop-filter: blur(20px);
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2rem;
        transition: left 0.3s ease;
    }
    .menu-links.active {
        left: 0;
    }
    .menu-hamburguesa.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    .menu-hamburguesa.active span:nth-child(2) {
        opacity: 0;
    }
    .menu-hamburguesa.active span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px);
    }
    .frase-texto {
        font-size: 1.1rem;
    }
    .circulo {
        width: 160px;
        height: 160px;
    }
    .circulo-titulo {
        font-size: 1rem;
    }
    .circulo-descripcion {
        font-size: 0.7rem;
        max-width: 120px;
    }
    
    .menu-login {
        padding: 0.4rem 0.6rem;
    }
    .welcome {
        font-size: clamp(1.2rem, 6vw, 2rem);
        white-space: normal;
        word-break: break-word;
        text-align: center;
        padding: 0 1rem;
        width: 90vw;
    }
}

/* ===== MODO DÍA/NOCHE ===== */
.menu-theme {
    cursor: pointer;
    margin-left: 1rem;
    padding: 0.5rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.menu-theme:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.theme-icon {
    font-size: 1.2rem;
}

/* Tema claro (body tiene clase .light) */
body.light {
    background: radial-gradient(ellipse at center, #f0f0f0 0%, #d0d0d0 100%);
}

body.light .frase-texto {
    color: #1a1a1a;
}

body.light .circulo::before {
    background: rgba(200, 200, 210, 0.6);
}

body.light .circulo-titulo {
    color: #1a1a1a;
}

body.light .circulo-descripcion {
    color: #333;
}

body.light .menu {
    background: rgba(230, 230, 240, 0.8);
    backdrop-filter: blur(12px);
}

body.light .menu.scrolled {
    background: rgba(220, 220, 230, 0.95);
}

body.light .menu-link {
    color: #333;
}

body.light .menu-link:hover,
body.light .menu-link.active {
    color: #000;
}

body.light .menu-logo {
    background: linear-gradient(135deg, #333, #666);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

body.light .estrella {
    background-color: #666;
    opacity: 0.3;
}

body.light .menu-hamburguesa span {
    background: #333;
}

body.light .menu-theme {
    background: rgba(0, 0, 0, 0.1);
}

body.light .menu-theme:hover {
    background: rgba(0, 0, 0, 0.2);
}

/* ===== PIE DE PÁGINA ===== */
.footer {
    margin-top: 4rem;
    padding: 2rem;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-content p {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.8rem;
    letter-spacing: 1px;
    margin: 0.3rem 0;
}

.footer-small {
    font-size: 0.7rem;
    opacity: 0.4;
}

/* Tema claro */
body.light .footer {
    border-top-color: rgba(0, 0, 0, 0.1);
}

body.light .footer-content p {
    color: rgba(0, 0, 0, 0.5);
}

/* ===== ELEMENTOS EXCLUSIVOS DEL MODO CLARO ===== */
.claro-oculto {
    position: fixed;
    bottom: 100px;
    right: 20px;
    pointer-events: none;
    z-index: 999;
    display: none;
}

body.light .claro-oculto {
    display: block;
}

.carita {
    position: absolute;
    font-size: 2.5rem;
    transition: left 0.5s ease, top 0.3s ease;
    filter: drop-shadow(0 0 5px rgba(0,0,0,0.2));
    cursor: default;
}

.destello {
    position: absolute;
    font-size: 1.2rem;
    transition: all 0.2s ease;
    filter: blur(0.5px);
}

/* Lienzo para modo claro */
.lienzo-claro {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
    display: none;
}

body.light .lienzo-claro {
    display: block;
}

body.light .lienzo-claro {
    display: block;
}

/* Asegurar que el contenido esté por encima */
.menu {
    z-index: 1000;  /* Ya lo tienes */
}

.contenido {
    position: relative;
    z-index: 200;  /* Mayor que el canvas */
}

.circulos {
    position: relative;
    z-index: 200;
}

/* Botón de login en el menú */
.menu-login {
    cursor: pointer;
    user-select: none;
    margin-left: 0;
    padding: 0.5rem 1.2rem;
    border-radius: 30px;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    border: 1px solid;
    background: rgba(0, 132, 255, 0.15);
    border-color: rgba(0, 132, 255, 0.4);
}

.menu-login:hover {
    background: rgba(0, 132, 255, 0.25);
    transform: scale(1.02);
    border-color: rgba(0, 132, 255, 0.7);
}

.login-text {
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: white;
}

/* Modo claro */
body.light .menu-login {
    background: rgba(0, 132, 255, 0.1);
    border-color: rgba(0, 132, 255, 0.3);
}

body.light .menu-login:hover {
    background: rgba(0, 132, 255, 0.2);
    border-color: rgba(0, 132, 255, 0.6);
}

body.light .login-text {
    color: #1a1a1a;
}

/* Cuando el usuario está logueado */
.menu-login.logged {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.4);
}

.menu-login.logged:hover {
    background: rgba(16, 185, 129, 0.25);
    border-color: rgba(16, 185, 129, 0.7);
}

.menu-login.logged .login-text {
    content: "Mi cuenta";
}

/* Modal de login */
.modal-login {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal-contenido {
    background: #1a1a2e;
    border-radius: 16px;
    width: 90%;
    max-width: 500px;  
    max-height: 90vh;
    overflow-y: auto;  
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-header h3 {
    color: white;
    font-size: 1.3rem;
}

.modal-close {
    color: #888;
    font-size: 1.8rem;
    cursor: pointer;
}

.modal-close:hover {
    color: white;
}

.modal-input {
    width: 100%;
    padding: 0.8rem;
    margin-bottom: 1rem;
    background: #0a0a0f;
    border: 1px solid #333;
    border-radius: 8px;
    color: white;
    font-size: 0.9rem;
}

.modal-btn {
    width: 100%;
    padding: 0.8rem;
    background: #0084ff;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
}

.modal-btn:hover {
    background: #0070e0;
}

.login-error {
    color: #ff4444;
    font-size: 0.8rem;
    margin-bottom: 1rem;
    display: none;
}

.modal-registro {
    text-align: center;
    margin-top: 1rem;
    color: #888;
    font-size: 0.8rem;
}

.modal-registro a {
    color: #0084ff;
    text-decoration: none;
}

/* Tema claro */
body.light .modal-contenido {
    background: #f0f0f0;
    border-color: #ccc;
}

body.light .modal-header h3 {
    color: #1a1a1a;
}

body.light .modal-input {
    background: white;
    border-color: #ccc;
    color: #1a1a1a;
}

body.light .login-error {
    color: #ff0000;
}

/* Menú lateral de usuario */
.user-menu {
    position: fixed;
    top: 0;
    right: -300px;
    width: 280px;
    height: 100%;
    background: #000000;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: -5px 0 20px rgba(16, 184, 211, 0.12);
    z-index: 10001;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
}

.user-menu.open {
    right: 0;
}

.user-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-weight: bold;
    font-size: 1.2rem;
    color: white;
}

.user-menu-close {
    background: none;
    border: none;
    color: #888;
    font-size: 1.5rem;
    cursor: pointer;
}

.user-menu-close:hover {
    color: white;
}

.user-menu-options {
    flex: 1;
    padding: 1rem 0;
}

.user-menu-option {
    padding: 0.8rem 1.5rem;
    cursor: pointer;
    transition: background 0.2s;
    color: #ccc;
    font-size: 1rem;
}

.user-menu-option:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

/* Tema claro */
body.light .user-menu {
    background: #f0f0f0;
    border-left-color: #ccc;
}

body.light .user-menu-header {
    border-bottom-color: #ccc;
    color: #1a1a1a;
}

body.light .user-menu-option {
    color: #333;
}

body.light .user-menu-option:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #000;
}