/* VARIABLES CSS */
:root {
    --primary-color: #FFD700;
    --secondary-color: #8A2BE2;
    --text-color: #f0f0f0;
    --background-dark: #2c2f33;
    --background-light-dark: #36393f;
    --blue-holyland: #00BFFF;
    /* Azul Cielo para HOLY y brillo */
    --white-holyland: #ffffff;
    --hover-dark: #474b53;
}

/* RESET Y ESTILOS GLOBALES */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--background-dark);
    color: var(--text-color);
    line-height: 1.6;
    scroll-behavior: smooth;
    cursor: default;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Cursor pointer para elementos interactivos */
a,
.btn,
.accordion,
.mode-item,
.rules-tab-btn,
.menu-toggle {
    /* Añadido .menu-toggle */
    cursor: pointer;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #ffd94f;
}

ul {
    list-style: none;
}

/* BOTONES */
.btn {
    display: inline-block;
    padding: 10px 25px;
    border-radius: 5px;
    font-weight: bold;
    text-align: center;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
    border: none;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--background-dark);
}

.btn-primary:hover {
    background-color: #ffd94f;
    color: var(--background-dark);
}

.btn-secondary {
    background-color: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
    background-color: var(--primary-color);
    color: var(--background-dark);
}

/* HEADER Y NAVEGACIÓN */
.header {
    background-color: rgba(0, 0, 0, 0.5);
    padding: 15px 0;
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    z-index: 1000;
    transition: background-color 0.3s ease;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header .logo img {
    height: 40px;
    vertical-align: middle;
}

.navbar ul {
    display: flex;
}

.navbar ul li {
    margin-left: 30px;
}

.navbar ul li a {
    color: var(--text-color);
    font-weight: 500;
    padding: 5px 0;
    display: block;
    position: relative;
}

.navbar ul li a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    bottom: -5px;
    left: 0;
    transition: width 0.3s ease;
}

.navbar ul li a:hover::after {
    width: 100%;
}

/* Dropdown */
.navbar .dropdown {
    position: relative;
    display: inline-block;
}

.navbar .dropbtn {
    display: flex;
    align-items: center;
}

.navbar .dropbtn .arrow-down {
    margin-left: 5px;
    font-size: 0.7em;
    transition: transform 0.3s ease;
}

.navbar .dropdown:hover .dropbtn .arrow-down {
    transform: rotate(180deg);
}

.navbar .dropdown-content {
    display: none;
    position: absolute;
    background-color: var(--background-light-dark);
    min-width: 160px;
    box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
    z-index: 1;
    border-radius: 5px;
    margin-top: 10px;
    border-top: 2px solid var(--primary-color);
}

.navbar .dropdown-content a {
    color: var(--text-color);
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    text-align: left;
    white-space: nowrap;
}

.navbar .dropdown-content a:hover {
    background-color: var(--hover-dark);
}

.navbar .dropdown:hover .dropdown-content {
    display: block;
}

.header-buttons .btn {
    margin-left: 10px;
}

/* HERO SECTION */
.hero {
    background: url('fondo.png') no-repeat center center/cover;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: var(--white-holyland);
    position: relative;
    padding: 0 20px;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 900px;
}

/* Título principal con efecto Typewriter y Brillo Azul */
.hero-subtitle {
    font-size: 5.5em;
    margin-bottom: 20px;
    font-weight: 800;
    line-height: 1.1;
    display: flex;
    justify-content: center;
    /* Efecto de Brillo (Glow) Azul */
    text-shadow: 0 0 5px var(--blue-holyland), 0 0 15px var(--blue-holyland);
}

.hero p {
    font-size: 1.2em;
    margin-bottom: 30px;
}

.hero-actions .btn {
    margin: 0 10px;
}

.server-address {
    margin-top: 30px;
}

.server-address .btn-address {
    background-color: var(--background-dark);
    color: var(--primary-color);
    padding: 12px 30px;
    border-radius: 50px;
    font-size: 1.1em;
    font-weight: bold;
    border: 2px solid var(--primary-color);
    transition: background-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
    /* Brillo Suave Azul por defecto */
    box-shadow: 0 0 15px rgba(0, 191, 255, 0.3);
}

.server-address .btn-address:hover {
    background-color: var(--primary-color);
    color: var(--background-dark);
    /* Brillo más fuerte Azul al pasar el ratón */
    box-shadow: 0 0 20px var(--blue-holyland);
}

/* CORRECCIÓN APLICADA PARA CENTRAR .scroll-down */
.scroll-down {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    /* Centrado inicial (corregido) */

    font-size: 2.5em;
    color: var(--white-holyland);
    animation: bounce 2s infinite;
    z-index: 2;
}

.scroll-down a {
    color: var(--white-holyland);
    display: block;
}

/* CORRECCIÓN APLICADA: Incluimos translateX(-50%) en la animación para mantener el centrado */
@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateX(-50%) translateY(0);
    }

    40% {
        transform: translateX(-50%) translateY(-15px);
    }

    60% {
        transform: translateX(-50%) translateY(-8px);
    }
}

/* EFECTO MÁQUINA DE ESCRIBIR (TYPEWRITER) */
.typewriter-text {
    display: inline-block;
    overflow: hidden;
    white-space: nowrap;
    /* Border-right es el cursor */
    border-right: 0.25em solid var(--primary-color);
    max-width: 0;
}

/* Animación de escritura - CLAVE: Aquí se controla el ancho del texto */
@keyframes typing {
    from {
        max-width: 0
    }

    to {
        max-width: 100%
    }
}

/* Animación del cursor parpadeante - CORREGIDO: ahora el cursor desaparece al final */
@keyframes blink-caret {

    /* 0% - 75%: visible (parpadea) */
    0%,
    75% {
        border-color: var(--primary-color);
    }

    /* 50% y 100%: invisible (para el parpadeo y para desaparecer al final) */
    50%,
    100% {
        border-color: transparent;
    }
}

/* CLAVE: Esta clase se añade en JS al finalizar la animación de 'typing' */
.typewriter-text.finished {
    /* Mantiene el texto visible */
    max-width: 100% !important;
    /* Detiene la animación del cursor */
    border-right: none;
    /* Elimina el borde de texto (el cursor) */
    animation: none !important;
}


/* Colores HOLYLAND */
.typewriter-text.holyland-styled span:nth-child(-n + 4) {
    color: var(--blue-holyland);
}

.typewriter-text.holyland-styled span:nth-child(n + 5) {
    color: var(--white-holyland);
}

/* SECCIONES GENERALES */
section {
    padding: 80px 0;
    background-color: var(--background-light-dark);
}

section:nth-child(even) {
    background-color: var(--background-dark);
}

.section-title {
    font-size: 3em;
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 10px;
    font-weight: 700;
}

.section-subtitle {
    font-size: 1.2em;
    color: var(--text-color);
    text-align: center;
    margin-bottom: 50px;
    font-style: italic;
}

/* SOBRE NOSOTROS (ABOUT US) */
.about-us .about-content {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 40px;
    flex-wrap: wrap;
}

.about-us .text-content {
    flex: 1;
    min-width: 300px;
    max-width: 600px;
}

.about-us .text-content h3 {
    font-size: 2.5em;
    color: var(--white-holyland);
    margin-bottom: 20px;
    font-weight: 600;
    border-left: 5px solid var(--primary-color);
    padding-left: 15px;
}

.about-us .text-content p {
    margin-bottom: 15px;
    font-size: 1.1em;
}

.about-us .image-content img {
    max-width: 300px;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s ease;
}

.about-us .image-content img:hover {
    transform: scale(1.05);
}

.about-us .stats {
    display: flex;
    justify-content: space-around;
    margin-top: 30px;
    background-color: var(--background-dark);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.about-us .stats div {
    text-align: center;
}

.about-us .stats span {
    display: block;
    font-size: 2.5em;
    font-weight: bold;
    color: var(--primary-color);
}

.about-us .stats p {
    font-size: 0.9em;
    color: var(--text-color);
    margin-top: 5px;
    margin-bottom: 0;
}

/* PREGUNTAS FRECUENTES (FAQ) */
.faq {
    background-color: var(--background-dark) !important;
}

.faq .faq-content {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 40px;
    flex-wrap: wrap;
}

.faq .image-content img {
    max-width: 300px;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s ease;
}

.faq .image-content img:hover {
    transform: scale(1.05);
}

.faq-items {
    flex: 1;
    min-width: 300px;
    max-width: 600px;
}

.accordion {
    background-color: var(--background-light-dark);
    color: var(--text-color);
    padding: 18px;
    width: 100%;
    text-align: left;
    border: none;
    outline: none;
    transition: background-color 0.3s ease;
    font-size: 1.1em;
    margin-bottom: 5px;
    border-radius: 5px;
    position: relative;
    padding-right: 40px;
    font-weight: 600;
}

.accordion:hover {
    background-color: var(--hover-dark);
}

.accordion:focus {
    outline: 2px solid var(--primary-color);
}

.accordion::after {
    content: '+';
    font-weight: bold;
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    transition: transform 0.3s ease;
    color: var(--primary-color);
}

.accordion.active::after {
    content: '-';
}

.panel {
    padding: 0 18px;
    background-color: var(--background-light-dark);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    border-bottom-left-radius: 5px;
    border-bottom-right-radius: 5px;
    margin-bottom: 10px;
}

.panel p {
    padding-bottom: 15px;
    padding-top: 5px;
    color: #ccc;
    font-size: 0.95em;
}

/* MODALIDADES DE JUEGO */
.game-modes .modes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    justify-content: center;
}

.game-modes .mode-item {
    background-color: var(--background-dark);
    border-radius: 10px;
    overflow: hidden;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 3px solid transparent;
}

.game-modes .mode-item:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 10px 30px rgba(255, 215, 0, 0.4);
    border: 3px solid var(--primary-color);
}

.game-modes .mode-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.game-modes .mode-item p {
    padding: 20px 10px;
    font-size: 1.2em;
    font-weight: bold;
    color: var(--primary-color);
    text-transform: uppercase;
}

/* NUEVA SECCIÓN: MOMENTOS (CARRUSEL) */
.moments {
    background-color: var(--background-dark) !important;
}

.carousel-container {
    overflow: hidden;
    position: relative;
    width: 100%;
    margin: 40px auto;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.carousel-track {
    display: flex;
    transition: transform 0.5s ease-in-out;
    animation: scroll-carousel 30s linear infinite;
    /* Tiempo ajustado si es necesario */
    width: 200%;
    /* Suficiente para duplicar las imágenes */
}

.carousel-slide {
    min-width: 20%;
    /* Muestra 5 imágenes a la vez (100% / 5) */
    height: 350px;
    overflow: hidden;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.carousel-slide img:hover {
    transform: scale(1.05);
}

/* Animación del carrusel para 5 imágenes (se desplaza la mitad de la pista duplicada) */
@keyframes scroll-carousel {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

/* CALL TO ACTION (TIENDA Y DISCORD) - NUEVOS ESTILOS PARA LOS BOTONES */
.call-to-action {
    padding: 60px 0;
    text-align: center;
    background-color: var(--background-dark) !important;
}

.call-to-action .cta-box {
    background-color: var(--primary-color);
    color: var(--background-dark);
    padding: 40px;
    border-radius: 10px;
    max-width: 800px;
    margin: 0 auto;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
}

.call-to-action .cta-box h3 {
    font-size: 2.5em;
    margin-bottom: 15px;
    font-weight: 700;
}

.call-to-action .cta-box p {
    font-size: 1.1em;
    margin-bottom: 30px;
}

.call-to-action .cta-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    /* Para responsive */
}

.call-to-action .cta-actions .btn {
    flex-basis: 200px;
    /* Ancho fijo para botones */
}

.call-to-action .cta-actions .btn-store {
    background-color: var(--background-dark);
    color: var(--primary-color);
    border: 2px solid var(--background-dark);
}

.call-to-action .cta-actions .btn-store:hover {
    background-color: var(--hover-dark);
    color: var(--primary-color);
    border-color: var(--hover-dark);
}

.call-to-action .cta-actions .btn-discord {
    background-color: var(--secondary-color);
    /* Morado Discord */
    color: var(--text-color);
    border: 2px solid var(--secondary-color);
}

.call-to-action .cta-actions .btn-discord:hover {
    background-color: #9356E8;
    border-color: #9356E8;
}

/* FOOTER */
.footer {
    background-color: #1a1a1a;
    color: #aaa;
    padding: 40px 0 20px;
    text-align: center;
}

.footer .container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.footer-logo {
    display: flex;
    align-items: center;
    font-size: 1.5em;
    font-weight: bold;
    color: var(--text-color);
}

.footer-logo img {
    height: 30px;
    margin-right: 10px;
}

.footer-nav ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
}

.footer-nav ul li a {
    color: #aaa;
    font-weight: normal;
}

.footer-nav ul li a:hover {
    color: var(--primary-color);
}

.copyright {
    margin-top: 30px;
    border-top: 1px solid #333;
    padding-top: 20px;
    font-size: 0.9em;
}

/* ------------------------------------------- */
/* ESTILOS DE LA PÁGINA DE REGLAS (reglas.html) */
/* ------------------------------------------- */
.rules-content {
    background-color: var(--background-light-dark);
    padding: 120px 0 80px;
    /* Ajuste para el header fijo */
    min-height: 80vh;
}

.rules-tabs {
    text-align: center;
    margin-bottom: 40px;
}

.rules-tab-btn {
    background: none;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    padding: 10px 20px;
    margin: 0 5px;
    cursor: pointer;
    border-radius: 5px;
    font-weight: bold;
    transition: background-color 0.3s, color 0.3s;
}

.rules-tab-btn.active {
    background-color: var(--primary-color);
    color: var(--background-dark);
}

.rules-list {
    max-width: 850px;
    margin: 0 auto;
}

.rule-item {
    background-color: var(--background-dark);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 15px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    border-left: 5px solid var(--primary-color);
}

.rule-item h3 {
    font-size: 1.5em;
    color: var(--white-holyland);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
}

.rule-item h3 span {
    display: inline-block;
    background-color: var(--primary-color);
    color: var(--background-dark);
    width: 30px;
    height: 30px;
    line-height: 30px;
    text-align: center;
    border-radius: 50%;
    margin-right: 15px;
    font-size: 0.8em;
    font-weight: 900;
}

.rule-item ul {
    list-style: none;
    padding-left: 0;
    margin-top: 10px;
}

.rule-item ul li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 8px;
    font-size: 0.95em;
    color: #ccc;
}

.rule-item ul li::before {
    content: '•';
    color: var(--blue-holyland);
    font-weight: bold;
    display: inline-block;
    width: 1em;
    margin-left: -1em;
}

/* ------------------------------------------- */
/* EFECTO DE APARICIÓN (REVEAL ON SCROLL) */
/* ------------------------------------------- */

.reveal-item {
    opacity: 0.01;
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
    min-height: 10px;
}

.reveal-item.left {
    transform: translateX(-50px);
}

.reveal-item.right {
    transform: translateX(50px);
}

.reveal-item.bottom,
.game-modes .mode-item.reveal-item {
    transform: translateY(50px);
}

.reveal-item.active {
    opacity: 1;
    transform: none;
}

/* ------------------------------------------- */
/* ESTILO PARA EL TEXTO (PRÓXIMAMENTE) EN EL FOOTER */
/* ------------------------------------------- */
/* Deshabilita el after general del nav para el footer para evitar conflictos */
.footer-nav ul li a::after {
    content: none !important;
}

/* Aplica el estilo (Próximamente) al enlace de Guías en el footer (usa href="#") */
.footer-nav ul li a[href="#"] {
    position: relative;
}

.footer-nav ul li a[href="#"]::after {
    content: " (Próximamente)";
    font-size: 0.8em;
    color: #888;
    /* Color gris suave */
    font-style: italic;
    margin-left: 5px;
    position: static;
    /* Asegura que no tenga animaciones o posiciones raras */
}

/* ESTILOS DEL BOTÓN DE MENÚ HAMBURGUESA (OCULTO POR DEFECTO) */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 1.8em;
    cursor: pointer;
    z-index: 1001;
    padding: 10px;
}

/* RESPONSIVE DESIGN (Menú Hamburguesa) */
@media (max-width: 768px) {

    .header .container {
        /* Volvemos a fila para tener el logo y la hamburguesa en la misma línea */
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 0;
    }

    .header .logo {
        flex-grow: 1;
        /* Asegura que el logo esté a la izquierda */
        text-align: left;
    }

    /* 🟢 HACER VISIBLE EL BOTÓN Y OCULTAR BOTONES DE ESCRITORIO */
    .menu-toggle {
        display: block;
    }

    .header-buttons {
        display: none;
        /* Ocultamos los botones de Tienda/Discord para ahorrar espacio en el header móvil */
    }

    /* 🛑 NAVEGACIÓN COMPLETA (Menú Overlay) */
    .navbar {
        position: fixed;
        top: 70px;
        /* Debajo del header fijo */
        left: 0;
        width: 100%;
        height: 100%;
        background-color: var(--background-dark);
        display: none;
        /* OCULTO POR DEFECTO */
        padding-top: 20px;
        z-index: 999;
        overflow-y: auto;
    }

    .navbar.active {
        display: block;
        /* MOSTRAR cuando JS añade la clase 'active' */
    }

    .navbar ul {
        flex-direction: column;
        /* Lista vertical */
        text-align: center;
        width: 100%;
        margin-top: 0;
    }

    .navbar ul li {
        margin: 0;
        border-bottom: 1px solid var(--hover-dark);
    }

    .navbar ul li a {
        padding: 15px 0;
        font-size: 1.2em;
    }

    .navbar ul li a::after {
        content: none;
        /* Eliminar el subrayado animado en móvil */
    }

    /* Ajuste para el Dropdown en vista vertical */
    .navbar .dropdown-content {
        position: static;
        /* Ya no es absoluto respecto al li, sino que fluye */
        margin-top: 0;
        min-width: 100%;
        box-shadow: none;
        border-top: none;
        border-radius: 0;
    }

    .navbar .dropdown-content a {
        padding-left: 40px;
        /* Sangría para subenlaces */
        background-color: var(--background-dark);
    }

    /* Restaurar el layout de otras secciones que modificaste */
    .hero-actions .btn {
        display: block;
        margin: 10px auto;
        width: 80%;
    }

    .about-us .about-content,
    .faq .faq-content {
        flex-direction: column;
        text-align: center;
    }

    .faq .image-content {
        order: -1;
    }

    .about-us .text-content h3 {
        padding-left: 0;
        border-left: none;
        border-bottom: 3px solid var(--primary-color);
        padding-bottom: 10px;
    }

    .about-us .stats {
        flex-direction: column;
        gap: 20px;
    }

    .game-modes .modes-grid {
        grid-template-columns: 1fr;
    }

    .call-to-action .cta-box {
        padding: 30px 20px;
    }

    .call-to-action .cta-box h3 {
        font-size: 2em;
    }

    .carousel-slide {
        min-width: 50%;
        /* Muestra 2 imágenes */
    }

    /* Ajuste de animación para 2 elementos */
    @keyframes scroll-carousel {
        0% {
            transform: translateX(0);
        }

        100% {
            transform: translateX(-50%);
        }
    }
}

@media (max-width: 480px) {
    .hero-subtitle {
        font-size: 2.5em;
    }

    .section-title {
        font-size: 2.2em;
    }

    .carousel-slide {
        min-width: 100%;
        /* Muestra 1 imagen */
    }

    /* Ajuste de animación para 1 elemento */
    @keyframes scroll-carousel {
        0% {
            transform: translateX(0);
        }

        100% {
            transform: translateX(-50%);
        }
    }

    .call-to-action .cta-actions {
        gap: 10px;
    }

    .call-to-action .cta-actions .btn {
        flex-basis: 100%;
    }
}

/* RESPONSIVE MEDIA QUERIES ANTERIORES */
@media (max-width: 1200px) {
    .carousel-slide {
        min-width: 25%;
        /* Muestra 4 imágenes */
    }

    /* Ajuste de animación para 4 elementos */
    @keyframes scroll-carousel {
        0% {
            transform: translateX(0);
        }

        100% {
            transform: translateX(-50%);
        }
    }
}

@media (max-width: 992px) {
    .hero-subtitle {
        font-size: 4em;
    }

    .carousel-slide {
        min-width: 33.33%;
        /* Muestra 3 imágenes */
    }

    /* Ajuste de animación para 3 elementos */
    @keyframes scroll-carousel {
        0% {
            transform: translateX(0);
        }

        100% {
            transform: translateX(-66.66%);
        }
    }
}
