/* =========================================================================
   IdleTrigger · Hoja de estilos principal
   -------------------------------------------------------------------------
   Sin build (ni Node, ni Vite): se sube tal cual al hosting.
   Estructura:
     1. Tokens (colores, tipografías)     6. Tarjetas y listados
     2. Base                              7. Artículo
     3. Utilidades                        8. Comentarios y formularios
     4. Cabecera y pie                    9. Tags (nube, chips)
     5. Insignias, chips y botones       10. Panel de administración
   ========================================================================= */

/* 1. Tokens ---------------------------------------------------------------- */
:root {
    --bg: #0b0d12;
    --bg-elev: #11141b;
    --surface: #161a23;
    --surface-2: #1c212d;
    --line: #262c3a;
    --line-soft: #1f2430;

    --text: #eef1f7;
    --muted: #9aa3b7;
    --faint: #687088;

    /* Pastel: azul + naranja (+ dorado de trofeo y menta de apoyo) */
    --blue: #9fcdff;
    --blue-strong: #74b4ff;
    --blue-soft: rgba(159, 205, 255, .12);
    --orange: #ffbf96;
    --orange-strong: #ff9c66;
    --orange-soft: rgba(255, 191, 150, .12);
    --gold: #ffe19c;
    --gold-soft: rgba(255, 225, 156, .12);
    --mint: #a8ebd2;
    --mint-soft: rgba(168, 235, 210, .12);

    --grad-xp: linear-gradient(90deg, var(--blue) 0%, var(--orange) 100%);

    --font-display: 'Chakra Petch', 'Segoe UI', system-ui, sans-serif;
    --font-body: 'Inter', 'Segoe UI', system-ui, sans-serif;
    --font-pixel: 'Press Start 2P', ui-monospace, monospace;

    --radius: 14px;
    --radius-sm: 8px;
    --shadow: 0 18px 40px -20px rgba(0, 0, 0, .75);
    --container: 1180px;
}

/* 2. Base ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text);
    background:
        radial-gradient(900px 500px at 0% -10%, rgba(116, 180, 255, .10), transparent 60%),
        radial-gradient(800px 500px at 100% 0%, rgba(255, 156, 102, .07), transparent 60%),
        var(--bg);
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: .01em;
    margin: 0 0 .5em;
}

a { color: var(--blue); text-decoration: none; transition: color .15s; }
a:hover { color: var(--orange); }

img { max-width: 100%; height: auto; display: block; }

::selection { background: var(--orange); color: #1a0e06; }

:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; border-radius: 4px; }

/* 3. Utilidades ------------------------------------------------------------ */
.container { width: min(100% - 2rem, var(--container)); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.stack > * + * { margin-top: 1.25rem; }
.mt-0 { margin-top: 0; }
.section { margin-block: 2.75rem; }

.section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.1rem;
}
.section-title h2 {
    font-size: 1.35rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: .6rem;
}
.section-title h2::before {
    content: '';
    width: 10px;
    height: 10px;
    background: var(--orange);
    box-shadow: 10px 0 0 var(--blue); /* dos "píxeles" */
    margin-right: 10px;
}
.section-title a { font-family: var(--font-display); font-size: .9rem; font-weight: 600; }

.alert {
    border: 1px solid var(--line);
    border-left: 4px solid var(--blue);
    background: var(--surface);
    padding: .85rem 1rem;
    border-radius: var(--radius-sm);
    margin-block: 1rem;
}
.alert--success { border-left-color: var(--mint); }
.alert--error { border-left-color: var(--orange-strong); }
.alert ul { margin: 0; padding-left: 1.2rem; }

/* 4. Cabecera y pie -------------------------------------------------------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(11, 13, 18, .82);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line-soft);
}
.site-header__inner {
    display: flex;
    align-items: center;
    gap: 2rem;
    height: 64px;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.45rem;
    letter-spacing: .01em;
    color: var(--blue);
    white-space: nowrap;
}
.logo:hover { color: var(--blue); }
.logo__icon { width: 30px; height: 30px; filter: drop-shadow(0 0 10px rgba(255, 191, 150, .35)); }
.logo__accent { color: var(--orange); }

.main-nav { flex: 1; }
.main-nav ul { display: flex; gap: .25rem; list-style: none; margin: 0; padding: 0; }
.main-nav a {
    display: block;
    padding: .45rem .8rem;
    border-radius: 8px;
    color: var(--muted);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: .98rem;
}
.main-nav a:hover, .main-nav a.is-active { color: var(--text); background: var(--surface); }
.main-nav a.is-active { box-shadow: inset 0 -2px 0 var(--orange); }

/* Desplegable del menú (Géneros) */
.nav-dropdown { position: relative; }
.nav-dropdown__toggle {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .45rem .8rem;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: .98rem;
    cursor: pointer;
}
.nav-dropdown__toggle:hover, .nav-dropdown.is-open .nav-dropdown__toggle { color: var(--text); background: var(--surface); }
.nav-dropdown__toggle.is-active { color: var(--text); box-shadow: inset 0 -2px 0 var(--orange); }
.nav-dropdown__chevron { width: 15px; height: 15px; transition: transform .2s; }
.nav-dropdown.is-open .nav-dropdown__chevron { transform: rotate(180deg); }
.main-nav .nav-dropdown__menu {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 60;
    min-width: 340px;
    grid-template-columns: 1fr 1fr;
    gap: .15rem;
    padding: .5rem;
    list-style: none;
    background: var(--bg-elev);
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: var(--shadow);
}
.main-nav .nav-dropdown__menu::before { /* puente invisible para no perder el hover */
    content: '';
    position: absolute;
    inset: -10px 0 auto;
    height: 10px;
}
.main-nav .nav-dropdown__menu a { font-size: .92rem; padding: .45rem .7rem; }
.main-nav .nav-dropdown__menu a:hover, .main-nav .nav-dropdown__menu a.is-active { color: var(--orange); background: var(--surface); box-shadow: none; }
.nav-dropdown.is-open .nav-dropdown__menu { display: grid; }
@media (hover: hover) and (min-width: 861px) {
    .nav-dropdown:hover .nav-dropdown__menu { display: grid; }
}

.header-actions { display: flex; align-items: center; gap: .5rem; }

.icon-btn {
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
}
.icon-btn:hover { color: var(--text); background: var(--surface); border-color: var(--line); }
.icon-btn svg { width: 20px; height: 20px; }

.nav-toggle { display: none; }

/* Selector de idioma ES / EN */
.lang-switch {
    display: inline-flex;
    padding: 3px;
    gap: 2px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--bg-elev);
}
.lang-switch a {
    padding: .2rem .5rem;
    border-radius: 7px;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: .78rem;
    letter-spacing: .05em;
    color: var(--muted);
}
.lang-switch a:hover { color: var(--text); }
.lang-switch a.is-active { background: var(--grad-xp); color: #1d1006; }

.search-bar { display: none; border-top: 1px solid var(--line-soft); padding-block: .8rem; }
.search-bar.is-open { display: block; }
.search-bar form { display: flex; gap: .5rem; }

.site-footer {
    margin-top: 4rem;
    border-top: 1px solid var(--line-soft);
    background: var(--bg-elev);
    padding-block: 3rem 2rem;
    font-size: .95rem;
}
.site-footer__grid { display: grid; grid-template-columns: 2fr 1fr; gap: 2.5rem; }
.site-footer h3 { font-size: 1rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--orange); }
.site-footer__bottom {
    margin-top: 2.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--line-soft);
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    color: var(--faint);
    font-size: .85rem;
}

/* 5. Insignias, chips y botones -------------------------------------------- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .2rem .6rem;
    border-radius: 999px;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: .72rem;
    letter-spacing: .06em;
    text-transform: uppercase;
    line-height: 1.5;
    border: 1px solid currentColor;
    white-space: nowrap;
}
.badge--blue { color: var(--blue); background: var(--blue-soft); }
.badge--orange { color: var(--orange); background: var(--orange-soft); }
.badge--gold { color: var(--gold); background: var(--gold-soft); }
.badge--mint { color: var(--mint); background: var(--mint-soft); }
a.badge:hover { filter: brightness(1.15); }

/* Chip de "logro": tipografía pixel */
.chip-xp {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    font-family: var(--font-pixel);
    font-size: .55rem;
    letter-spacing: .02em;
    padding: .45rem .55rem;
    border-radius: 6px;
    background: rgba(11, 13, 18, .82);
    color: var(--gold);
    border: 1px solid rgba(255, 225, 156, .35);
    backdrop-filter: blur(4px);
}
.chip-xp svg { width: 12px; height: 12px; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: .65rem 1.15rem;
    border-radius: 10px;
    border: 1px solid transparent;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: .95rem;
    letter-spacing: .02em;
    cursor: pointer;
    transition: transform .12s, filter .15s, background .15s;
    color: #1d1006;
    background: var(--grad-xp);
}
.btn:hover { color: #1d1006; filter: brightness(1.08); transform: translateY(-1px); }
.btn--ghost { background: var(--surface); color: var(--text); border-color: var(--line); }
.btn--ghost:hover { color: var(--text); background: var(--surface-2); }
.btn--danger { background: transparent; color: var(--orange-strong); border-color: rgba(255, 156, 102, .4); }
.btn--danger:hover { color: #1d1006; background: var(--orange-strong); }
.btn--sm { padding: .35rem .7rem; font-size: .82rem; border-radius: 8px; }

/* 6. Tarjetas y listados --------------------------------------------------- */
.media {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--surface-2);
}
.media > img {
    /* La imagen se ve SIEMPRE entera: se ajusta al recuadro sin recortarse ni deformarse */
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    transition: transform .5s ease;
}
/* Relleno de los huecos con la propia imagen desenfocada (si la proporción no es 16:9) */
.media__blur {
    position: absolute;
    inset: -24px;
    background-size: cover;
    background-position: center;
    filter: blur(22px) brightness(.55) saturate(1.2);
}
.media .chip-xp { z-index: 2; }
.media .chip-xp { position: absolute; top: .6rem; right: .6rem; z-index: 2; }

.cover-placeholder {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 1.25rem;
    text-align: center;
    font-family: var(--font-pixel);
    font-size: clamp(.6rem, 1.4vw, .95rem);
    line-height: 1.7;
    color: var(--gold);
    background:
        linear-gradient(135deg, rgba(116, 180, 255, .30), rgba(255, 156, 102, .28)),
        repeating-linear-gradient(0deg, transparent 0 3px, rgba(0, 0, 0, .18) 3px 4px),
        var(--surface-2);
    text-shadow: 0 2px 0 rgba(0, 0, 0, .6);
}

.card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    overflow: hidden;
    transition: border-color .2s, transform .2s, box-shadow .2s;
}
.card:hover { border-color: rgba(159, 205, 255, .35); transform: translateY(-3px); box-shadow: var(--shadow); }
.card:hover .media img { transform: scale(1.04); }
.card__body { display: flex; flex-direction: column; gap: .6rem; padding: 1rem 1.1rem 1.15rem; flex: 1; }
.card__badges { display: flex; flex-wrap: wrap; gap: .4rem; }
.card__title { font-size: 1.12rem; margin: 0; }
.card__title a { color: var(--text); }
.card__title a:hover { color: var(--orange); }
.card__title a::after { content: ''; position: absolute; inset: 0; } /* toda la tarjeta clicable */
.card__excerpt { margin: 0; color: var(--muted); font-size: .94rem; }
.card .badge, .card .tag, .card .meta a { position: relative; z-index: 1; } /* enlaces internos por encima */

.card--hero .card__title { font-size: clamp(1.4rem, 2.6vw, 2rem); }
.card--hero .card__body { flex: 0 0 auto; }
.card--side .card__body { padding: .8rem 1rem 1rem; }
.card--side .card__title { font-size: 1rem; }

.meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .35rem 1rem;
    color: var(--faint);
    font-size: .82rem;
    margin-top: auto;
}
.meta span, .meta a, .meta time { display: inline-flex; align-items: center; gap: .3rem; }
.meta a { color: var(--muted); }
.meta svg { width: 14px; height: 14px; opacity: .8; }
.meta .avatar { display: inline-grid; gap: 0; }

.hero-grid { display: grid; grid-template-columns: 1.85fr 1fr; gap: 1.25rem; margin-top: 1.75rem; align-items: start; }
.hero-side { display: grid; gap: 1.25rem; align-content: start; }

.home-split { display: grid; grid-template-columns: 1.85fr 1fr; gap: 1.25rem; }

.grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }

/* Fila de guías (miniaturas con tiempo y 100%) */
.thumb-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.thumb { display: block; color: var(--text); }
.thumb .media { border-radius: 10px; border: 1px solid var(--line-soft); aspect-ratio: 16 / 9; }
.thumb:hover .media { border-color: var(--orange); }
.thumb:hover img { transform: scale(1.05); }
.thumb__title { font-size: .95rem; margin: .55rem 0 0; color: var(--text); }
.thumb:hover .thumb__title { color: var(--orange); }

/* Indie Radar */
.radar { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.radar-item {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: .45rem;
    padding: .8rem;
    border-radius: 12px;
    background: var(--surface);
    border: 1px solid var(--line-soft);
}
.radar-item:hover { border-color: rgba(255, 191, 150, .4); }
.radar-item h3 { font-size: .9rem; margin: 0; }
.radar-item h3 a { color: var(--text); }
.radar-item h3 a::after { content: ''; position: absolute; inset: 0; }
.radar-item h3 a:hover { color: var(--orange); }
.radar-item .meta { margin-top: 0; }

.avatar {
    display: inline-grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--grad-xp);
    color: #1d1006;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: .7rem;
    flex: none;
    overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar--lg { width: 44px; height: 44px; font-size: .95rem; }

/* Layout contenido + barra lateral */
.with-sidebar { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 2rem; align-items: start; }
.sidebar { display: grid; gap: 1.25rem; position: sticky; top: 84px; }
.widget {
    background: var(--surface);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    padding: 1.1rem;
}
.widget h2 { font-size: 1rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: .9rem; }
.ranked { list-style: none; margin: 0; padding: 0; counter-reset: rank; display: grid; gap: .7rem; }
.ranked li { counter-increment: rank; display: flex; gap: .7rem; align-items: baseline; }
.ranked li::before {
    content: counter(rank, decimal-leading-zero);
    font-family: var(--font-pixel);
    font-size: .6rem;
    color: var(--orange);
}
.ranked a { color: var(--text); font-size: .92rem; font-weight: 500; }
.ranked a:hover { color: var(--orange); }

/* Cabecera de listados (categoría / género / tag / autor) */
.page-head {
    margin-top: 2rem;
    padding: 1.75rem;
    border-radius: var(--radius);
    background:
        linear-gradient(120deg, rgba(116, 180, 255, .14), rgba(255, 156, 102, .10)),
        var(--surface);
    border: 1px solid var(--line-soft);
}
.page-head__kicker { font-family: var(--font-pixel); font-size: .6rem; color: var(--orange); letter-spacing: .05em; }
.page-head h1 { font-size: clamp(1.6rem, 3.5vw, 2.4rem); margin: .6rem 0 .35rem; }
.page-head p { color: var(--muted); margin: 0; max-width: 70ch; }

.breadcrumbs { font-size: .85rem; color: var(--faint); margin: 1.5rem 0 .75rem; }
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: .4rem; margin: 0; padding: 0; }
.breadcrumbs li + li::before { content: '›'; margin-right: .4rem; color: var(--faint); }
.breadcrumbs a { color: var(--muted); }

.empty {
    padding: 3rem 1rem;
    text-align: center;
    color: var(--muted);
    border: 1px dashed var(--line);
    border-radius: var(--radius);
}

.pagination { display: flex; flex-wrap: wrap; gap: .4rem; justify-content: center; margin-top: 2rem; }
.pagination__item {
    min-width: 40px;
    height: 40px;
    display: inline-grid;
    place-items: center;
    padding-inline: .7rem;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--muted);
    font-family: var(--font-display);
    font-weight: 600;
}
a.pagination__item:hover { color: var(--text); border-color: var(--blue); }
.pagination__item.is-active { background: var(--grad-xp); color: #1d1006; border-color: transparent; }
.pagination__item.is-disabled { opacity: .4; }

/* 7. Artículo -------------------------------------------------------------- */
.article__header { margin-bottom: 1.5rem; }
.article__header h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); margin: .8rem 0 .7rem; }
.lead { font-size: 1.15rem; color: var(--muted); margin: 0 0 1rem; }
.article__cover { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line-soft); margin-bottom: 1.75rem; }
.article__cover .media { aspect-ratio: 16 / 9; }

/* Panel "logro": datos del juego y barra 100% */
.achievement {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 1.25rem;
    align-items: center;
    padding: 1.1rem 1.25rem;
    margin-block: 1.25rem 1.75rem;
    border-radius: var(--radius);
    background: linear-gradient(120deg, rgba(255, 225, 156, .08), rgba(116, 180, 255, .08)), var(--surface);
    border: 1px solid rgba(255, 225, 156, .25);
}
.achievement__icon {
    width: 64px;
    height: 64px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: var(--grad-xp);
    box-shadow: 0 0 30px -6px rgba(255, 191, 150, .6);
}
.achievement__icon svg { width: 36px; height: 36px; color: #1d1006; }
.achievement__label { font-family: var(--font-pixel); font-size: .58rem; color: var(--gold); letter-spacing: .04em; }
.achievement__game { font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; margin: .35rem 0 .6rem; }
.achievement__stats { display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; color: var(--muted); font-size: .9rem; }
.achievement__stats strong { color: var(--text); font-family: var(--font-display); }

.xp-bar { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin-top: .75rem; }
.xp-bar span { display: block; height: 100%; background: var(--grad-xp); border-radius: inherit; }

.pips { display: inline-flex; gap: 3px; vertical-align: middle; }
.pips i { width: 8px; height: 12px; background: var(--surface-2); border-radius: 2px; }
.pips i.on { background: var(--orange); }

.video { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line-soft); margin-block: 1.5rem; background: #000; }
.video iframe, .video video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* Texto del artículo (Markdown) */
.prose { font-size: 1.06rem; line-height: 1.8; color: #dfe4ee; }
.prose h2 { font-size: 1.6rem; margin-top: 2.2rem; padding-bottom: .4rem; border-bottom: 1px solid var(--line-soft); }
.prose h3 { font-size: 1.25rem; margin-top: 1.8rem; color: var(--blue); }
.prose p, .prose ul, .prose ol { margin: 0 0 1.15rem; }
.prose li { margin-bottom: .35rem; }
.prose li::marker { color: var(--orange); }
.prose strong { color: var(--text); }
.prose a { text-decoration: underline; text-decoration-color: rgba(159, 205, 255, .4); text-underline-offset: 3px; }
.prose img { border-radius: 10px; border: 1px solid var(--line-soft); margin: 1.5rem auto; }
.prose blockquote {
    margin: 1.5rem 0;
    padding: 1rem 1.25rem;
    border-left: 4px solid var(--orange);
    background: var(--orange-soft);
    border-radius: 0 10px 10px 0;
    color: var(--text);
}
.prose blockquote p:last-child { margin-bottom: 0; }
.prose code { font-size: .9em; background: var(--surface-2); padding: .1em .4em; border-radius: 5px; color: var(--orange); }
.prose pre { background: var(--bg-elev); padding: 1rem; border-radius: 10px; overflow-x: auto; border: 1px solid var(--line-soft); }
.prose pre code { background: none; padding: 0; color: var(--text); }
.prose table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; font-size: .95rem; display: block; overflow-x: auto; }
.prose th, .prose td { padding: .65rem .85rem; border: 1px solid var(--line); text-align: left; }
.prose th { background: var(--surface-2); font-family: var(--font-display); color: var(--blue); }
.prose hr { border: 0; height: 1px; background: var(--line); margin: 2rem 0; }

.article__footer { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--line-soft); display: grid; gap: 1.25rem; }
.article__footer h2 { font-size: 1rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: .6rem; }

.share { display: flex; flex-wrap: wrap; gap: .5rem; }

.author-box { display: flex; gap: 1rem; align-items: center; padding: 1rem; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line-soft); }
.author-box p { margin: .2rem 0 0; color: var(--muted); font-size: .92rem; }

/* 8. Comentarios y formularios -------------------------------------------- */
.comments { margin-top: 3rem; }
.comment { display: grid; grid-template-columns: auto 1fr; gap: .85rem; padding: 1rem 0; border-bottom: 1px solid var(--line-soft); }
.comment__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .6rem; }
.comment__head strong { font-family: var(--font-display); }
.comment__head time { color: var(--faint); font-size: .82rem; }
.comment__body { margin: .3rem 0 .4rem; color: #dfe4ee; white-space: pre-line; }
.comment__replies { grid-column: 2; padding-left: 1rem; border-left: 2px solid var(--line); }
.comment__reply-btn { background: none; border: 0; padding: 0; color: var(--blue); font-size: .85rem; cursor: pointer; font-family: var(--font-display); font-weight: 600; }
.comment__reply-btn:hover { color: var(--orange); }

.form { display: grid; gap: 1rem; }
.form-row { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.field { display: grid; gap: .35rem; }
.field label, .label { font-family: var(--font-display); font-weight: 600; font-size: .9rem; color: var(--muted); }
.field small { color: var(--faint); font-size: .8rem; }
.input, .select, .textarea {
    width: 100%;
    padding: .7rem .85rem;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--bg-elev);
    color: var(--text);
    font: inherit;
    font-size: .95rem;
}
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.textarea { min-height: 130px; resize: vertical; }
.checkbox { display: inline-flex; align-items: center; gap: .5rem; cursor: pointer; color: var(--text); }
.checkbox input { accent-color: var(--orange); width: 16px; height: 16px; }
.field-error { color: var(--orange-strong); font-size: .85rem; }
.hp { position: absolute; left: -9999px; } /* honeypot */

.auth-card { max-width: 440px; margin: 3rem auto; padding: 2rem; background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--radius); }
.auth-card h1 { font-size: 1.6rem; }

/* 9. Tags ------------------------------------------------------------------ */
.tags { display: flex; flex-wrap: wrap; gap: .4rem; list-style: none; margin: 0; padding: 0; }
.tag {
    display: inline-flex;
    align-items: center;
    padding: .28rem .65rem;
    border-radius: 8px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    color: var(--blue);
    font-size: .82rem;
    font-weight: 500;
    transition: all .15s;
}
.tag::before { content: '#'; color: var(--orange); margin-right: .1rem; font-weight: 700; }
.tag:hover { color: #1d1006; background: var(--orange); border-color: var(--orange); }
.tag:hover::before { color: #1d1006; }
.tag__count { margin-left: .4rem; font-size: .72rem; color: var(--faint); }
.tag:hover .tag__count { color: #1d1006; }
.tags--sm .tag { font-size: .74rem; padding: .18rem .5rem; }
.tags--lg .tag { font-size: .95rem; padding: .45rem .85rem; }

/* Franja de tags en tendencia de la portada */
.trending {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: .9rem 1.1rem;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--line-soft);
    overflow-x: auto;
    scrollbar-width: thin;
}
.trending__label { font-family: var(--font-pixel); font-size: .55rem; color: var(--orange); white-space: nowrap; }
.trending .tags { flex-wrap: nowrap; }
.trending .tag { white-space: nowrap; }

/* Nube de tags: tamaño según uso */
.tag-cloud { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; justify-content: center; padding: 2rem 1rem; }
.tag-cloud .tag--w1 { font-size: .85rem; }
.tag-cloud .tag--w2 { font-size: 1rem; }
.tag-cloud .tag--w3 { font-size: 1.2rem; }
.tag-cloud .tag--w4 { font-size: 1.45rem; color: var(--orange); }
.tag-cloud .tag--w5 { font-size: 1.75rem; color: var(--gold); border-color: rgba(255, 225, 156, .4); }

/* Aviso de cookies ---------------------------------------------------------- */
.cookie-banner {
    position: fixed;
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    z-index: 100;
    max-width: 760px;
    margin-inline: auto;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 1rem 1.25rem;
    padding: 1.1rem 1.25rem;
    background: rgba(17, 20, 27, .97);
    border: 1px solid var(--line);
    border-top: 3px solid transparent;
    border-image: var(--grad-xp) 1;
    border-image-slice: 1 0 0 0;
    border-radius: var(--radius);
    box-shadow: 0 24px 60px -20px rgba(0, 0, 0, .85);
    backdrop-filter: blur(10px);
}
.cookie-banner[hidden] { display: none; }
.cookie-banner__body { flex: 1 1 380px; }
.cookie-banner__title { display: flex; align-items: center; gap: .5rem; font-size: 1.05rem; margin: 0 0 .4rem; }
.cookie-banner__title svg { width: 20px; height: 20px; color: var(--gold); }
.cookie-banner p { margin: 0; color: var(--muted); font-size: .9rem; }
.cookie-banner__prefs { display: grid; gap: .5rem; margin-top: .85rem; font-size: .88rem; }
.cookie-banner__prefs[hidden] { display: none; }
.cookie-banner__prefs .checkbox { align-items: flex-start; }
.cookie-banner__prefs input { margin-top: .2rem; }
.cookie-banner__actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.cookie-banner__actions [hidden] { display: none; }

.link-btn {
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
}
.link-btn:hover { color: var(--orange); }

/* 10. Panel de administración --------------------------------------------- */
.admin { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; }
.admin__nav { background: var(--bg-elev); border-right: 1px solid var(--line-soft); padding: 1.25rem 1rem; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.admin__nav ul { list-style: none; margin: 1.5rem 0 0; padding: 0; display: grid; gap: .2rem; }
.admin__nav a { display: block; padding: .55rem .75rem; border-radius: 8px; color: var(--muted); font-family: var(--font-display); font-weight: 600; }
.admin__nav a:hover, .admin__nav a.is-active { background: var(--surface); color: var(--text); }
.admin__nav a.is-active { box-shadow: inset 3px 0 0 var(--orange); }
.admin__nav .nav-sep { margin: 1rem .75rem .3rem; font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; color: var(--faint); }
.admin__main { padding: 1.75rem 2rem 4rem; }
.admin__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1.25rem; }
.admin__head h1 { margin: 0; font-size: 1.6rem; }

.panel { background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 1.25rem; }
.panel + .panel { margin-top: 1.25rem; }
.panel h2 { font-size: 1.05rem; }

.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.stat { background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 1rem 1.1rem; }
.stat__value { font-family: var(--font-display); font-size: 1.9rem; font-weight: 700; background: var(--grad-xp); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat__label { color: var(--muted); font-size: .85rem; }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th, .table td { padding: .7rem .75rem; border-bottom: 1px solid var(--line-soft); text-align: left; vertical-align: middle; }
.table th { font-family: var(--font-display); color: var(--muted); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; }
.table tr:hover td { background: rgba(255, 255, 255, .015); }
.table .actions { display: flex; gap: .4rem; justify-content: flex-end; white-space: nowrap; }
.table form { margin: 0; }

.filters { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.filters .input, .filters .select { width: auto; min-width: 180px; }

.editor-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 1.25rem; align-items: start; }
.editor-layout aside { display: grid; gap: 1.25rem; position: sticky; top: 1rem; }
.cover-preview { border-radius: 10px; overflow: hidden; border: 1px solid var(--line); margin-bottom: .5rem; }
.checks { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; max-height: 220px; overflow-y: auto; }

/* Pestañas de idioma en los formularios del panel */
.locale-tabs {
    display: flex;
    gap: .4rem;
    margin-bottom: 1rem;
    padding: .35rem;
    border-radius: 12px;
    background: var(--bg-elev);
    border: 1px solid var(--line);
    width: fit-content;
}
.locale-tabs button {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .45rem .9rem;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--muted);
    font-family: var(--font-display);
    font-weight: 700;
    cursor: pointer;
}
.locale-tabs button.is-active { background: var(--surface-2); color: var(--text); box-shadow: inset 0 -2px 0 var(--orange); }
.locale-tabs .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.locale-tabs .dot.is-done { background: var(--mint); }
[data-locale-panel][hidden] { display: none !important; }
.locale-badge { font-family: var(--font-pixel); font-size: .5rem; color: var(--orange); margin-left: .35rem; }

/* EasyMDE en modo oscuro */
.EasyMDEContainer .CodeMirror { background: var(--bg-elev); color: var(--text); border-color: var(--line); border-radius: 0 0 10px 10px; min-height: 420px; }
.EasyMDEContainer .CodeMirror-cursor { border-color: var(--orange); }
.editor-toolbar { background: var(--surface-2); border-color: var(--line); border-radius: 10px 10px 0 0; opacity: 1; }
.editor-toolbar button { color: var(--muted) !important; }
.editor-toolbar button:hover, .editor-toolbar button.active { background: var(--surface) !important; border-color: var(--line) !important; color: var(--text) !important; }
.editor-preview, .editor-preview-side { background: var(--surface); color: var(--text); }
.editor-statusbar { color: var(--faint); }

/* Responsive ---------------------------------------------------------------- */
@media (max-width: 1024px) {
    .with-sidebar, .editor-layout { grid-template-columns: 1fr; }
    .sidebar, .editor-layout aside { position: static; }
    .thumb-row { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 860px) {
    .hero-grid, .home-split { grid-template-columns: 1fr; }
    .hero-side { grid-template-columns: 1fr 1fr; }
    .site-footer__grid { grid-template-columns: 1fr; }

    .nav-toggle { display: inline-grid; }
    .lang-switch a { padding: .2rem .4rem; }
    .main-nav {
        display: none;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: var(--bg-elev);
        border-bottom: 1px solid var(--line);
        padding: .75rem 1rem 1rem;
    }
    .main-nav.is-open { display: block; }
    .main-nav ul { flex-direction: column; }
    .nav-dropdown__toggle { width: 100%; justify-content: space-between; }
    .main-nav .nav-dropdown__menu { position: static; min-width: 0; margin: .25rem 0 .5rem; box-shadow: none; }
    .main-nav .nav-dropdown__menu::before { display: none; }
    .cookie-banner { left: .5rem; right: .5rem; bottom: .5rem; }
    .cookie-banner__actions { width: 100%; }
    .cookie-banner__actions .btn { flex: 1 1 auto; }
    .site-header__inner { gap: 1rem; justify-content: space-between; }

    .admin { grid-template-columns: 1fr; }
    .admin__nav { position: static; height: auto; }
    .admin__nav ul { display: flex; flex-wrap: wrap; }
    .admin__main { padding: 1.25rem 1rem 3rem; }
}

@media (max-width: 560px) {
    .hero-side, .radar { grid-template-columns: 1fr; }
    .achievement { grid-template-columns: 1fr; }
    .site-footer__bottom { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
