:root {
    --fondo: #1a1a1f;
    --panel: #26262e;
    --texto: #e8e8ee;
    --verde: #55c957;
    --verde-oscuro: #3a9a3c;
}

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

body {
    background: var(--fondo);
    color: var(--texto);
    font-family: system-ui, sans-serif;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.cabecera {
    background: var(--panel);
    border-bottom: 3px solid var(--verde);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.logo { color: var(--verde); font-size: 1.4rem; font-weight: bold; text-decoration: none; }

nav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

nav a {
    color: var(--texto);
    text-decoration: none;
    margin-left: 1.2rem;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
}
nav a:hover, nav a.activo { background: var(--verde); color: #000; }

.menu-check { display: none; }
.hamburguesa { display: none; }
.menu-fondo { display: none; }

.idioma { position: relative; margin-left: 1.2rem; }
.idioma summary {
    list-style: none;
    cursor: pointer;
    user-select: none;
    color: var(--texto);
    padding: 0.3rem 0.7rem;
    border-radius: 4px;
    border: 1px solid var(--verde);
}
.idioma summary::-webkit-details-marker { display: none; }
.idioma summary:hover, .idioma[open] summary { background: var(--verde); color: #000; }
.idioma ul {
    list-style: none;
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    min-width: 150px;
    background: var(--panel);
    border: 2px solid var(--verde);
    border-radius: 8px;
    padding: 0.3rem;
    z-index: 200;
}
.idioma ul a {
    display: block;
    margin: 0;
    padding: 0.4rem 0.7rem;
}

.contenedor { flex: 1; max-width: 900px; width: 100%; margin: 2rem auto; padding: 0 1rem; }

h1 { margin-bottom: 1rem; color: var(--verde); }

.hero { text-align: center; padding: 3rem 1rem; }
.hero p { margin: 1rem 0 1.5rem; font-size: 1.2rem; }

.boton {
    display: inline-block;
    background: var(--verde);
    color: #000;
    padding: 0.7rem 1.5rem;
    border-radius: 6px;
    font-weight: bold;
    text-decoration: none;
}
.boton:hover { background: var(--verde-oscuro); }

.tarjetas { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }
.tarjeta { background: var(--panel); padding: 1.5rem; border-radius: 8px; border-left: 4px solid var(--verde); }
.tarjeta h2 { margin-bottom: 0.5rem; }

.markdown, .normas-contenido { background: var(--panel); padding: 1.5rem; border-radius: 8px; }
.markdown p, .normas-contenido p { margin-bottom: 0.8rem; }
.markdown h2, .markdown h3,
.normas-contenido h2, .normas-contenido h3 { margin: 1rem 0 0.5rem; color: var(--verde); }
.markdown ul, .markdown ol,
.normas-contenido ul, .normas-contenido ol { margin: 0 0 0.8rem 1.5rem; }
.markdown li, .normas-contenido li { font-size: 1.15rem; margin-bottom: 0.5rem; }
.markdown a, .normas-contenido a { color: var(--verde); }
.markdown img, .normas-contenido img { max-width: 100%; border-radius: 8px; }
.markdown pre, .normas-contenido pre {
    background: #111;
    padding: 1rem;
    border-radius: 6px;
    overflow-x: auto;
    margin: 0.5rem 0;
}
.markdown code, .normas-contenido code { color: var(--verde); font-family: monospace; }

.btn-copiar {
    background: var(--verde);
    color: #000;
    border: none;
    border-radius: 6px;
    padding: 0.15rem 0.8rem;
    margin-left: 0.5rem;
    font-size: 0.95rem;
    font-weight: bold;
    cursor: pointer;
}
.btn-copiar:hover { background: var(--verde-oscuro); }

.normas-contenido { border-left: 4px solid var(--verde); }

.anuncio {
    display: flow-root;
    margin-bottom: 1.5rem;
    border-left: 4px solid var(--verde);
    font-size: 1.15rem;
    line-height: 1.65;
}
.anuncio h2, .anuncio h3 {
    margin-top: 0;
    font-size: 1.6rem;
}
.anuncio img,
.anuncio video,
.anuncio iframe {
    float: left;
    width: 140px;
    max-width: 100%;
    border-radius: 8px;
    margin: 0 1.5rem 0.9rem 0;
}
.anuncio iframe { aspect-ratio: 16 / 9; height: auto; border: 0; }

.anuncio:nth-child(even) img,
.anuncio:nth-child(even) video,
.anuncio:nth-child(even) iframe {
    float: right;
    margin: 0 0 1rem 1.2rem;
}

.redes {
    background: var(--panel);
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid var(--verde);
}
.redes h1, .redes h2, .redes h3 { color: var(--verde); margin: 0 0 1rem; }
.redes p { margin-bottom: 1rem; }
.redes ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.8rem;
}
.redes li { margin: 0; }
.redes li a {
    display: block;
    text-align: center;
    background: var(--fondo);
    color: var(--texto);
    text-decoration: none;
    font-weight: bold;
    font-size: 1.1rem;
    padding: 0.9rem 1rem;
    border-radius: 8px;
    border: 2px solid var(--verde);
    transition: background 0.15s, color 0.15s, transform 0.15s;
}
.redes li a:hover {
    background: var(--verde);
    color: #000;
    transform: translateY(-3px);
}

.galeria {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}
.galeria a {
    display: block;
    overflow: hidden;
    border-radius: 8px;
    border: 2px solid var(--verde);
    background: var(--panel);
}
.galeria img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    transition: transform 0.2s;
}
.galeria a:hover img { transform: scale(1.05); }

.error-pagina {
    text-align: center;
    padding: 3rem 1rem;
}
.error-codigo {
    font-size: 6rem;
    font-weight: bold;
    line-height: 1;
    color: var(--verde);
    margin-bottom: 0.5rem;
}
.error-pagina p {
    margin: 0.5rem 0 1.5rem;
    font-size: 1.15rem;
}

.pie {
    text-align: center;
    padding: 1.5rem;
    background: var(--panel);
    border-top: 3px solid var(--verde);
    font-size: 0.85rem;
    opacity: 0.8;
}
.pie-enlaces { margin-top: 0.4rem; }
.pie-enlaces a { color: var(--verde); text-decoration: none; }
.pie-enlaces a:hover { text-decoration: underline; }

@media (max-width: 900px) {
    .cabecera { padding: 0.8rem 1rem; flex-wrap: nowrap; }

    .hamburguesa {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        border: 2px solid var(--verde);
        border-radius: 8px;
        color: var(--verde);
        font-size: 1.6rem;
        line-height: 1;
        cursor: pointer;
        user-select: none;
    }
    .hamburguesa:hover { background: var(--verde); color: #000; }

    .menu-fondo {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.6);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.25s, visibility 0.25s;
        z-index: 900;
    }

    nav {
        position: fixed;
        top: 0;
        right: 0;
        width: 260px;
        max-width: 80%;
        height: 100%;
        flex-direction: column;
        align-items: stretch;
        flex-wrap: nowrap;
        gap: 0.4rem;
        padding: 4.5rem 1rem 1rem;
        background: var(--panel);
        border-left: 3px solid var(--verde);
        overflow-y: auto;
        transform: translateX(100%);
        visibility: hidden;
        transition: transform 0.25s, visibility 0.25s;
        z-index: 1000;
    }

    nav a {
        display: block;
        margin: 0;
        padding: 0.8rem 1rem;
        font-size: 1.1rem;
    }

    .menu-check:checked ~ .menu-fondo { opacity: 1; visibility: visible; }
    .menu-check:checked ~ nav { transform: translateX(0); visibility: visible; }

    .idioma { margin: 0.6rem 0 0; }
    .idioma summary { display: block; padding: 0.7rem 1rem; }
    .idioma ul {
        position: static;
        min-width: 0;
        margin-top: 0.4rem;
    }
}

@media (max-width: 700px) {
    .anuncio { font-size: 1.05rem; line-height: 1.6; }
    .anuncio h2, .anuncio h3 { font-size: 1.4rem; }
    .anuncio img, .anuncio video, .anuncio iframe,
    .anuncio:nth-child(even) img,
    .anuncio:nth-child(even) video,
    .anuncio:nth-child(even) iframe {
        float: none;
        width: 100%;
        margin: 0 0 1rem 0;
    }
    .redes ul { grid-template-columns: 1fr; }
    .galeria { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}
