/* ==================================================
   BLOQUE 1 - ESTILOS GENERALES DEL SITIO
================================================== */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background-color: #1e293b;
    color: #f8fafc;
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    transition: 0.2s ease;
}

h1, h2, h3, h4, h5, h6 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #22c55e;
    text-align: center;
}

p {
    margin-top: 0;
}

ul {
    padding-left: 20px;
}

/* ==================================================
   BLOQUE 2 - CONTENEDOR PRINCIPAL
================================================== */
.contenedor-principal {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 30px 20px 50px;
}

/* ==================================================
   BLOQUE 3 - MENÚ SUPERIOR / NAVEGACIÓN
================================================== */
.menu {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-bottom: 35px;
}

.menu a,
.menu-dropdown-boton {
    display: inline-block;
    padding: 10px 20px;
    background-color: #22c55e;
    color: #0f172a;
    text-decoration: none;
    border-radius: 8px;
    font-weight: bold;
    border: none;
    cursor: pointer;
    font-size: 16px;
    line-height: 1.2;
    min-height: 44px;
}

.menu a:hover,
.menu-dropdown-boton:hover {
    background-color: #16a34a;
    transform: translateY(-1px);
}

/* ==================================================
   BLOQUE 3A - DROPDOWN DE MÁS CONTENIDO
================================================== */
.menu-dropdown {
    position: relative;
}

.menu-dropdown-listado {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    min-width: 230px;
    background-color: #334155;
    padding: 10px;
    border-radius: 12px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
    z-index: 50;
}

.menu-dropdown-listado.activo {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.menu-dropdown-listado a {
    display: block;
    padding: 9px 12px;
    background-color: #1e293b;
    color: #f8fafc;
    text-decoration: none;
    border-radius: 8px;
    font-weight: bold;
    text-align: center;
}

.menu-dropdown-listado a:hover {
    background-color: #475569;
    transform: translateY(-1px);
}

/* ==================================================
   BLOQUE 4 - TARJETAS / CAJAS REUTILIZABLES
================================================== */
.caja {
    background-color: #334155;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 25px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}

/* ==================================================
   BLOQUE 5 - BOTONES REUTILIZABLES
================================================== */
.boton-verde {
    display: block;
    width: fit-content;
    margin: 0 auto;
    padding: 10px 24px;
    background-color: #22c55e;
    color: #0f172a;
    text-decoration: none;
    border-radius: 8px;
    font-weight: bold;
    border: none;
    cursor: pointer;
}

.boton-verde:hover {
    background-color: #16a34a;
    transform: translateY(-1px);
}

/* ==================================================
   BLOQUE 6 - FORMULARIOS REUTILIZABLES
================================================== */
input,
select,
textarea {
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid #94a3b8;
    background-color: #f8fafc;
    color: #0f172a;
    font-size: 14px;
    margin-bottom: 15px;
}

input[type="radio"],
input[type="checkbox"] {
    width: auto;
    padding: 0;
    margin-bottom: 0;
    border: none;
    background: none;
}

label {
    display: block;
    margin-bottom: 6px;
    font-weight: bold;
    text-align: left;
}

/* ==================================================
   BLOQUE 7 - UTILIDADES DE TEXTO Y ALINEACIÓN
================================================== */
.texto-centro {
    text-align: center;
}

.titulo-centro {
    text-align: center;
}

.texto-izquierda {
    text-align: left;
}

.separacion-superior {
    margin-top: 30px;
}

.separacion-inferior {
    margin-bottom: 30px;
}

/* ==================================================
   BLOQUE 8 - REDES SOCIALES EN PIE DE PÁGINA
================================================== */
.redes-sociales {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid rgba(148, 163, 184, 0.25);
    text-align: center;
}

.redes-sociales h3 {
    margin-bottom: 15px;
    font-size: 18px;
    color: #22c55e;
}

.redes-iconos {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}

.red-social {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background-color: #334155;
    color: #f8fafc;
    text-decoration: none;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}

.red-social:hover {
    background-color: #22c55e;
    color: #0f172a;
    transform: translateY(-2px) scale(1.05);
}

.red-social svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

/* ==================================================
   BLOQUE 9 - DISEÑO RESPONSIVE
================================================== */
@media (max-width: 768px) {
    .contenedor-principal {
        padding: 20px 15px 40px;
    }

    .menu {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;align-items:stretch;margin-bottom:24px}

    .menu a,
    .menu-dropdown-boton {
        width: 100%;
        text-align: center;
        padding:11px 8px;
        font-size:14px;
    }

    .menu-dropdown {width:100%;grid-column:1/-1}

    .menu-dropdown-listado {
        position: static;
        transform: none;
        min-width: 0;
        width: 100%;
        margin-top: 10px;
    }

    .menu-dropdown-listado a {
        text-align: center;
    }

    .caja {
        padding: 18px;
    }

    h1{font-size:clamp(1.9rem,9vw,2.7rem)}

    .red-social{width:46px;height:46px}
}

body.modo-juego-activo {
    overflow: hidden;
}

.modo-juego-alternativo {
    position: fixed !important;
    inset: 0 !important;
    z-index: 10000 !important;
    width: 100vw !important;
    max-width: none !important;
    height: 100vh !important;
    height: 100dvh !important;
    margin: 0 !important;
    padding: max(14px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left)) !important;
    overflow: auto !important;
    overscroll-behavior: contain;
    background: #1e293b !important;
}

.aviso-modo-juego {
    position: fixed;
    z-index: 11000;
    left: max(14px, env(safe-area-inset-left));
    right: max(14px, env(safe-area-inset-right));
    bottom: max(14px, env(safe-area-inset-bottom));
    max-width: 560px;
    margin: auto;
    padding: 18px;
    border: 1px solid #86efac;
    border-radius: 14px;
    background: #0f172a;
    color: #f8fafc;
    box-shadow: 0 15px 45px rgba(0, 0, 0, .45);
}

.aviso-modo-juego strong { color: #86efac; }
.aviso-modo-juego p { margin: 7px 0 14px; }
.aviso-modo-juego button { padding: 9px 15px; border: 0; border-radius: 8px; background: #22c55e; color: #0f172a; font-weight: 800; }

@media (max-width: 390px) {
    .contenedor-principal{padding-left:11px;padding-right:11px}
    .menu{grid-template-columns:1fr}
    .menu-dropdown{grid-column:auto}
}
