/* MODO CLARO (Por defecto) */
:root {
    --fondo: #FFFC9E;
    --panel: #FFF67A;
    --texto: #1F1F19;
    --verde: #1F1F19;
    --verde-oscuro: #3a3a32;
}

/* MODO OSCURO (Fondo oscuro con líneas/bordes/acentos del modo claro #FFFC9E) */
[data-theme="dark"] {
    --fondo: #1a1a1f;
    --panel: #26262e;
    --texto: #FFFC9E;
    --verde: #FFFC9E;
    --verde-oscuro: #d8d584;
}

* { 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;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.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: var(--fondo); }

.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: var(--fondo); }
.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: var(--fondo);
    padding: 0.7rem 1.5rem;
    border-radius: 6px;
    font-weight: bold;
    text-decoration: none;
}
.boton:hover { background: var(--verde-oscuro); color: var(--texto); }

.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: var(--fondo);
    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); color: var(--texto); }

.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: var(--fondo);
    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;
