/* ═══════════════════════════════════════════ */
/* FONT OVERRIDE — Nunito */
/* ═══════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;500;600;700;800&display=swap');

html, body, button, input, textarea, select, option,
.btn, .card, .badge, .pill, .option, .joker-btn,
.title-bounce, .subtitle, .question-text, .sb-name, .sb-meta,
.pm-name, .pm-score, .site-logo, .site-nav a,
.admin-table, .lb-table, .cat-bar-item, .footer-cat,
.toast-app, .streak-popup, .cat-hero-name, .modal-input,
.result-title, .result-emoji, .lb-stat-value, .lb-stat-label,
.sm-value, .sm-label, .stat-value, .stat-label,
.q-difficulty, .hint-box, .correct-answer-info,
.profile-trigger, .user-name, .user-score, .pm-item,
.result-stats, .rs-value, .rs-label, .input-wrap input,
.feature-item, .fi-title, .fi-desc, .suggestion-pill,
.cat-bar-name, .cat-bar-count, .sb-rank, .sb-score,
.podium-name, .podium-score, .podium-medal,
.summary-pill, .page-btn, .btn-mini {
    font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
}
/* ═══════════════════════════════════════════ */
/* ═══════════════════════════════════════════ */

/* ═══════════════════════════════════════════ */
/* ═══════════════════════════════════════════ */

/* ═══════════════════════════════════════════ */
/* ═══════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════
   IMPORTACIÓN DE FUENTES Y RESET GLOBAL
   ═══════════════════════════════════════════════════════ */


* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --dark: #2c2c54;
    --accent: #ffd93d;
    --accent-2: #ff6b6b;
    --success: #6bcf7f;
}

body {
    font-family: 'Nunito', sans-serif;
    color: var(--dark);
    background: linear-gradient(135deg, #e8f4ff 0%, #f5e8ff 50%, #fff0e8 100%);
    min-height: 100vh;
}

/* ═══════════════════════════════════════════════════════
   CABECERA PRINCIPAL (diseño moderno, móvil con botones de texto)
   ═══════════════════════════════════════════════════════ */

.site-header {
    position: sticky;
    top: 0;
    z-index: 900;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid rgba(44, 44, 84, 0.08);
    box-shadow: 0 4px 20px rgba(44, 44, 84, 0.04);
}

.header-inner {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 20px;
    min-height: 68px;
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: nowrap;
}

/* ─── Logotipo ─── */
.site-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    flex-shrink: 0;
    color: var(--dark);
}
.site-logo .logo-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 44px;
    padding: 0 16px;
    font-size: 1.6rem;
    background: linear-gradient(135deg, #ff9d31, #ff5555);
    border-radius: 40px;
    box-shadow: 3px 6px 14px rgba(0, 0, 0, 0.22);
    color: #fff;
    border: none;
    font-weight: 900;
}
.site-logo .logo-text {
    font-size: 1.22rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    white-space: nowrap;
}

/* ─── Navegación ─── */
.site-nav {
    display: flex;
    align-items: center;
    gap: 2px;
    flex: 1 1 auto;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
    margin: 0;
    justify-content: center;
}
.site-nav::-webkit-scrollbar { display: none; }
.site-nav a {
    position: relative;
    padding: 9px 14px;
    font-size: 1.33rem;
    font-weight: 600;
    color: #4a4a6a;
    text-decoration: none;
    border-radius: 10px;
    transition: color 0.15s, background 0.15s;
    white-space: nowrap;
    background: transparent;
    box-shadow: none;
    flex-shrink: 0;
}
.site-nav a:hover {
    color: var(--dark);
    background: rgb(78 92 225 / 18%);
}
.site-nav a.active {
    color: var(--dark);
    font-weight: 800;
    background: transparent;
}
.site-nav a.active::after {
    content: '';
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: -2px;
    height: 5px;
    background: #7b84ff;
    border-radius: 3px;
}

/* ─── Bloque derecho ─── */
.header-right,
.header-inner > .header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    flex-shrink: 0;
}

/* ─── Botones de autenticación ─── */
.auth-buttons,
#authButtons {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 0;
}
.auth-btn-header {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 14px;
    border-radius: 40px;
    font-family: inherit;
    font-size: 1.1rem;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
    line-height: 1;
    border: 1.5px solid rgba(44, 44, 84, 0.12);
    box-shadow: none;
}
.auth-btn-login {
    background: transparent;
    color: #4a4a6a;
}
.auth-btn-login:hover {
    background: rgba(44, 44, 84, 0.05);
    color: var(--dark);
}
.auth-btn-signup {
    background: linear-gradient(135deg, #ffd93d, #ffb700);
    color: var(--dark);
    border-color: transparent;
    box-shadow: 0 3px 10px rgba(255, 183, 0, 0.35);
}
.auth-btn-signup:hover {
    box-shadow: 0 5px 14px rgba(255, 183, 0, 0.5);
}

/* ─── Menú desplegable de perfil ─── */
.profile-dropdown {
    position: relative;
    display: inline-block;
}
.profile-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px 8px 12px;
    background: #f7f7fb;
    border: 1.5px solid rgba(44, 44, 84, 0.08);
    border-radius: 999px;
    font-family: inherit;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--dark);
    cursor: pointer;
    transition: all 0.15s;
    box-shadow: none;
    max-width: 260px;
}
.profile-trigger:hover {
    background: #fff;
    border-color: rgba(255, 183, 0, 0.45);
}

/* ─── Avatar / Bandera ─── */
.user-flag-img,
.pm-avatar-flag,
.guest-avatar {
    width: 32px;
    height: 24px;
    min-width: 32px;
    object-fit: cover;
    background: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    overflow: hidden;
    flex-shrink: 0;
    padding: 0;
    line-height: 1;
}
.pm-avatar-flag {
    width: 34px;
    height: 24px;
    font-size: 1.3rem;
}
.guest-avatar img,
.user-flag-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

.user-name {
    font-weight: 900;
    font-size: 1.15rem;
    max-width: 110px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.user-score {
    background: linear-gradient(135deg, #22a06b, #1c8558);
    color: #fff;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 800;
    line-height: 1.4;
    white-space: nowrap;
}
.profile-chevron {
    font-size: 0.75rem;
    color: #8a8ab0;
}

/* ─── Menú desplegable interno ─── */
.profile-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 280px;
    background: #fff;
    border: none;
    border-radius: 18px;
    box-shadow: 0 12px 40px rgba(44, 44, 84, 0.15), 0 0 0 1px rgba(44, 44, 84, 0.05);
    padding: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.18s, transform 0.18s, visibility 0.18s;
    z-index: 300;
}
.profile-menu.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.pm-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: linear-gradient(135deg, hsl(109.66deg 65.48% 48.54% / 49%), #fff);
    border-radius: 14px;
}
.pm-name {
    font-weight: 800;
    font-size: 1.05rem;
    color: var(--dark);
}
.pm-score {
    font-size: 0.8rem;
    color: #8a8ab0;
    margin-top: 2px;
}
.pm-divider {
    height: 1px;
    background: rgba(44, 44, 84, 0.06);
    margin: 6px 4px;
}
.pm-item {
    display: flex;
    align-items: center;
    gap: 11px;
    width: 100%;
    padding: 10px 12px;
    background: transparent;
    border: none;
    text-align: left;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--dark);
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.12s;
    text-decoration: none;
}
.pm-item:hover { background: #f7f7fb; }
.pm-item.pm-danger { color: #c92a2a; }
.pm-item.pm-danger:hover { background: #ffe4e4; }

/* ═══════════════════════════════════════════════════════
   DISEÑO PRINCIPAL DE LA APLICACIÓN
   ═══════════════════════════════════════════════════════ */

.app-body { display: block !important; padding: 0 !important; }
.app-layout {
    max-width: 1440px;
    margin: 0 auto;
    padding: 20px;
    display: grid;
    grid-template-columns: 300px 1fr 320px;
    gap: 20px;
    align-items: start;
}
.main-col { min-width: 0; }

/* ─── Barra lateral ─── */
.sidebar { position: sticky; top: 80px; }
.ad-box {border: 0px dashed var(--dark);overflow: hidden;margin-bottom: 15px;}
.ad-tall {display: flex;flex-direction: column;text-align: center;}
.ad-label {
    background: var(--dark);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 4px 14px;
    letter-spacing: 2px;
    text-align: center;
    width: fit-content;
    margin: 0 auto;
    border-radius: 0 0 10px 10px;
}
.ad-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 20px;
    text-align: center;
    background: repeating-linear-gradient(45deg, #fafaff, #fafaff 10px, #f0f0ff 10px, #f0f0ff 20px);
}
.ad-icon { font-size: 4rem; margin-bottom: 15px; opacity: 0.5; }
.ad-title { font-size: 1.05rem; font-weight: 700; margin-bottom: 6px; }
.ad-desc { font-size: 0.85rem; color: #888; }

.promo-box {
    background: #fff;
    border: 8px solid #2c2c54;
    border-radius: 40px;
    padding: 18px;
    margin-bottom: 15px;
    box-shadow: 0 5px 0 rgba(44, 44, 84, 0.12);
    text-align: center;
}
.promo-box .promo-icon { font-size: 2rem; margin-bottom: 8px; display: block; }
.promo-box h4 { font-size: 0.98rem; margin-bottom: 6px; }
.promo-box p { font-size: 0.83rem; color: #6c6c8e; line-height: 1.5; }

/* ─── Marcador ─── */
.scoreboard {
    background: #fff;
    border: 8px solid #2c2c54;
    border-radius: 40px;
    overflow: hidden;
    box-shadow: 0 5px 0 rgba(44, 44, 84, 0.12);
    margin-bottom: 15px;
}
.scoreboard-header {
    padding: 10px 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
}
.scoreboard-header h3 {font-size: 1.5rem;margin: 0;flex: 1;color: #1f1e1e;font-weight: 900;}
.sb-icon { font-size: 1.3rem; }
.live-dot {
    width: 10px; height: 10px;
    background: var(--success);
    border-radius: 50%;
    animation: pulse-dot 1.5s infinite;
}
@keyframes pulse-dot {
    0% { box-shadow: 0 0 0 0 rgba(107, 207, 127, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(107, 207, 127, 0); }
    100% { box-shadow: 0 0 0 0 rgba(107, 207, 127, 0); }
}
.scoreboard-list {padding: 10px 10px 10px 10px;max-height: 500px;overflow-y: auto;}
.sb-loading, .sb-empty { padding: 30px 15px; text-align: center; color: #999; font-size: 0.9rem; }
.sb-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 6px;
    margin-bottom: 1px;
    border-radius: 30px;
    transition: all 0.15s;
    border-bottom: 1px solid #f5f5fa;
}
.sb-item:last-child { border-bottom: none; }
.sb-item:hover { background: #fafaff; }
.sb-item.top-1 { background: linear-gradient(90deg, #2ef94a, transparent); border-left: 4px solid #3dc850; }
.sb-item.top-2 { background: linear-gradient(90deg, #b888f8, transparent); border-left: 4px solid #9461d8; }
.sb-item.top-3 { background: linear-gradient(90deg, #ffe583, transparent); border-left: 4px solid #fdca26; }
.sb-rank { width: 28px; text-align: center; font-weight: 800; font-size: 0.95rem; }
.sb-flag-img {
    width: 30px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}
.sb-user { flex: 1; min-width: 0; }
.sb-name {font-weight: 900;font-size: 1rem;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;}
.sb-meta { font-size: 0.7rem; color: #999; }
.sb-score {
    background: var(--success);
    color: #fff;
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 800;
    font-size: 0.82rem;
}
.sb-footer-link {
    display: block;
    text-align: center;
    padding: 12px;
    background: #fff8e7;
    color: var(--dark);
    font-weight: 800;
    font-size: 0.88rem;
    text-decoration: none;
    border-top: 2px solid var(--dark);
    transition: background 0.15s;
}
.sb-footer-link:hover { background: var(--accent); }
.stats-box { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat-mini {
    background: #fff;
    border: 8px solid #2c2c54;
    border-radius: 40px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 0 rgba(44, 44, 84, 0.12);
}
.sm-icon { font-size: 1.5rem; }
.sm-value { font-size: 1.15rem; font-weight: 800; line-height: 1; }
.sm-label { font-size: 0.68rem; color: #888; text-transform: uppercase; letter-spacing: 0.5px; margin-top: 2px; }

/* ═══════════════════════════════════════════════════════
   TARJETAS Y FORMULARIOS
   ═══════════════════════════════════════════════════════ */

.card {
    background: #fff;
    border: 8px solid #2c2c54;
    border-radius: 40px;
    padding: 20px 20px;
    box-shadow: 0 8px 0 rgba(44, 44, 84, 0.12);
    animation: popIn 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}
@keyframes popIn {
    0% { transform: scale(0.95); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.welcome-card { text-align: center; }
.welcome-hero { margin-bottom: 30px; }
.title-bounce {
    font-size: 2.5rem;
    font-weight: 900;
    margin-bottom: 8px;
    color: #2c2c54;
}
.subtitle { color: #6c6c8e; font-size: 1.05rem; }
.welcome-form { display: flex; flex-direction: column; gap: 12px; max-width: 300px; margin: 0 auto 10px; }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-icon { position: absolute; left: 18px; z-index: 1; font-size: 1.3rem; pointer-events: none; }
.input-wrap input {
    width: 100%;
    padding: 16px 20px 16px 55px;
    border: 5px solid var(--dark);
    border-radius: 40px;
    font-family: inherit;
    font-size: 1.5rem;
    font-weight: 900;
    outline: none;
    background: #fff8e7;
    transition: all 0.2s;
}
.input-wrap input:focus {
    border-color: var(--accent-2);
    background: #fff;
    transform: scale(1.01);
    box-shadow: 0 0 0 4px rgba(255, 107, 107, 0.15);
}
.username-check { min-height: 24px; font-size: 0.88rem; text-align: left; padding: 0 5px; }
.check-loading { color: #888; }
.check-ok { color: var(--success); font-weight: 700; }
.check-error { color: var(--accent-2); font-weight: 700; }
.suggestions-title { font-size: 0.82rem; color: #888; margin: 8px 0 6px; }
.suggestions-list { display: flex; flex-wrap: wrap; gap: 6px; }
.suggestion-pill {
    padding: 6px 14px;
    background: #fff;
    border: 2px solid var(--dark);
    border-radius: 15px;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
}
.suggestion-pill:hover { background: var(--accent); transform: translateY(-1px); }
.welcome-actions { display: flex; gap: 10px; margin-top: 20px; }

.btn {
    display: inline-block;
    padding: 14px 28px;
    border: 5px solid var(--dark);
    border-radius: 40px;
    font-family: inherit;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: all 0.15s;
    box-shadow: 0 5px 0 var(--dark);
    color: var(--dark);
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 7px 0 var(--dark); }
.btn:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--dark); }
.btn-primary { background: linear-gradient(135deg, var(--accent), #ffb700); }
.btn-outline { background: #fff; }
.btn-lg { padding: 18px 35px; font-size: 1.15rem; width: 100%; max-width: 300px; margin: 0 auto; }

.welcome-back { display: flex; flex-direction: column; gap: 15px; }
.wb-title {
    font-size: 1.05rem;
    padding: 15px;
    background: linear-gradient(135deg, #f0fff0, #e0ffe0);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}
.wb-flag { width: 32px; height: 24px; object-fit: cover; }

.feature-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    padding-top: 20px;
    border-top: 2px dashed #f0f0f5;
}
.feature-item { text-align: center; padding: 12px 6px; border-radius: 14px; transition: all 0.15s; }
.feature-item:hover { background: #f8f8ff; transform: translateY(-2px); }
.fi-icon { font-size: 1.8rem; margin-bottom: 6px; }
.fi-title { font-weight: 800; font-size: 0.85rem; margin-bottom: 2px; }
.fi-desc { font-size: 0.72rem; color: #888; }

/* ═══════════════════════════════════════════════════════
   SECCIÓN DEL CONCURSO (QUIZ)
   ═══════════════════════════════════════════════════════ */

.badge {
    padding: 8px 14px;
    background: #fff;
    border: 3px solid var(--dark);
    border-radius: 14px;
    font-weight: 700;
    font-size: 0.9rem;
    box-shadow: 0 3px 0 var(--dark);
    transition: all 0.3s;
}
#streakBadge.streak-fire { background: linear-gradient(135deg, #ff8c42, var(--accent-2)); color: #fff; }
#streakBadge.streak-blaze { background: linear-gradient(135deg, var(--accent-2), #ff3860); color: #fff; box-shadow: 0 0 20px rgba(255, 56, 96, 0.5); }
#streakBadge.streak-legend {
    background: linear-gradient(135deg, #a020f0, #ff3860, var(--accent));
    background-size: 200% 200%;
    color: #fff;
    animation: streakLegend 1s infinite;
}
@keyframes streakLegend {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.diff-easy { background: #d4f5e2; color: #22a06b; }
.diff-medium { background: #fff8e7; color: #b8860b; }
.diff-hard { background: #ffe0e0; color: var(--accent-2); }

/* ─── Temporizador ─── */
.timer-wrap {
    display: flex;
    justify-content: center;
    margin: 5px 0 18px;
}
.timer-circle { position: relative; width: 130px; height: 130px; }
.timer-circle svg { transform: rotate(-90deg); width: 100%; height: 100%; }
.timer-bg { fill: none; stroke: #f0f0ff; stroke-width: 8; }
.timer-fg {
    fill: none;
    stroke: #6bcbff;
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 283;
    transition: stroke-dashoffset 1s linear, stroke 0.3s;
}
.timer-circle span {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2.4rem;
    font-weight: 800;
}
.timer-circle.warning .timer-fg { stroke: var(--accent); }
.timer-circle.danger .timer-fg { stroke: var(--accent-2); }
.timer-circle.danger span { color: var(--accent-2); animation: pulse 0.5s infinite; }
@keyframes pulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.15); }
}

/* ─── Barra superior del quiz ─── */
.quiz-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 0 0 15px 0;
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
    width: 100%;
}
.qtb-stats {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: #f8f8ff;
    border: 2px solid #e5e5f0;
    border-radius: 24px;
    font-size: 0.88rem;
    font-weight: 800;
    color: var(--dark);
    line-height: 1;
    white-space: nowrap;
}
.qtb-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: color 0.2s;
}
.qtb-icon { font-size: 0.95rem; line-height: 1; }
.qtb-val { font-weight: 800; color: var(--dark); font-size: 0.9rem; }
.qtb-sep { color: #c0c0d0; font-weight: 400; font-size: 0.9rem; margin: 0 2px; }

#streakBadge.streak-fire { color: #ff6b6b; }
#streakBadge.streak-fire .qtb-val { color: #ff6b6b; }
#streakBadge.streak-blaze { color: #ff3860; }
#streakBadge.streak-blaze .qtb-val { color: #ff3860; }
#streakBadge.streak-legend {
    background: linear-gradient(135deg, #a020f0, #ff3860, #ffd93d);
    background-size: 200% 200%;
    animation: legendShift 1.5s ease infinite;
    padding: 2px 8px;
    border-radius: 12px;
    margin: -2px 0;
}
#streakBadge.streak-legend .qtb-val { color: #fff; }
@keyframes legendShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.qtb-quit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    background: #ffe0e0;
    color: #ff3860;
    border: 2px solid #ff3860;
    border-radius: 50%;
    font-size: 1rem;
    font-weight: 900;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
    line-height: 1;
    flex-shrink: 0;
}
.qtb-quit:hover {
    background: #ff3860;
    color: #fff;
    transform: scale(1.08);
}
.qtb-quit:active { transform: scale(0.95); }

/* ─── Comodines ─── */
.joker-bar {
    display: flex;
    gap: 12px;
    margin: 20px auto 25px;
    justify-content: center;
    flex-wrap: wrap;
    align-items: center;
    padding: 0;
    background: transparent;
    border: none;
    max-width: 500px;
    position: relative;
    z-index: 5;
    min-height: 70px;
}
.joker-btn {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 12px 18px;
    background: linear-gradient(135deg, #fff8e7, #ffe8a3);
    border: 3px solid var(--dark);
    border-radius: 18px;
    font-family: inherit;
    font-weight: 800;
    font-size: 0.9rem;
    color: var(--dark);
    cursor: pointer;
    box-shadow: 0 5px 0 var(--dark), 0 8px 20px rgba(255, 217, 61, 0.3);
    transition: all 0.15s;
    position: relative;
    min-width: 90px;
    line-height: 1;
    appearance: none;
    -webkit-appearance: none;
}
.joker-btn:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 8px 0 var(--dark), 0 12px 25px rgba(255, 217, 61, 0.5);
    background: linear-gradient(135deg, #ffd93d, #ffb700);
}
.joker-btn:active:not(:disabled) {
    transform: translateY(3px);
    box-shadow: 0 2px 0 var(--dark);
}
.joker-btn:disabled {
    opacity: 0.4;
    filter: grayscale(0.7);
    cursor: not-allowed;
}
.joker-btn .joker-icon {
    display: inline-block;
    font-size: 1.6rem;
    line-height: 1;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.15));
}
.joker-btn .joker-label {
    display: inline-block;
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--dark);
    white-space: nowrap;
    letter-spacing: 0.3px;
}
.joker-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ff3860;
    color: #fff;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 900;
    border: 3px solid #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    line-height: 1;
    z-index: 10;
}
.joker-btn:disabled .joker-count { background: #999; }

/* ─── Pregunta y opciones ─── */
.question-text {
    font-size: 1.5rem;
    text-align: center;
    margin-bottom: 20px;
    line-height: 1.45;
    min-height: 50px;
    padding: 0 10px;
}
.options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.option {
    padding: 15px 13px;
    border: 3px solid var(--dark);
    border-radius: 18px;
    background: #fff;
    font-family: inherit;
    font-size: 1.25rem;
    font-weight: 700;
    cursor: pointer;
    text-align: left;
    transition: all 0.15s;
    box-shadow: 0 5px 0 var(--dark);
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--dark);
    min-height: 60px;
}
.option:hover:not(:disabled) { background: #fff8e7; transform: translateY(-2px); box-shadow: 0 7px 0 var(--dark); }
.option:disabled { cursor: not-allowed; opacity: 0.9; }
.option .letter {
    background: var(--dark);
    color: #fff;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.9rem;
    flex-shrink: 0;
}
.option.correct { background: var(--success) !important; color: #fff; }
.option.correct .letter { background: #fff; color: var(--success); }
.option.wrong { background: var(--accent-2) !important; color: #fff; }
.option.wrong .letter { background: #fff; color: var(--accent-2); }
.option.eliminated { opacity: 0.25; filter: grayscale(1); text-decoration: line-through; }

.hint-box {
    background: linear-gradient(135deg, #fff8e7, #ffecd2);
    border: 3px dashed #ffb700;
    border-radius: 15px;
    padding: 12px 18px;
    margin-bottom: 18px;
    text-align: center;
    font-size: 1rem;
    font-weight: 700;
}
.hint-box b { color: var(--accent-2); }

/* ═══════════════════════════════════════════════════════
   TARJETA DE RESULTADO
   ═══════════════════════════════════════════════════════ */

.result-card { text-align: center; }
.result-emoji { font-size: 5rem; margin-bottom: 10px; animation: bounce 1s infinite; }
@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}
.result-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 25px 0; }
.rs-item {background: linear-gradient(135deg, #f8f8ff, #f0f0ff);border: 5px solid var(--dark);border-radius: 18px;padding: 18px 10px;}
.rs-value { font-size: 1.9rem; font-weight: 800; }
.rs-label {font-size: 0.85rem;color: #333232;text-transform: uppercase;margin-top: 4px;font-weight: 700;letter-spacing: 0.5px;}
.result-buttons { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.correct-answer-info {
    background: #ffe0e0;
    border: 3px solid var(--accent-2);
    border-radius: 15px;
    padding: 15px;
    margin: 15px 0;
    text-align: center;
}
.correct-answer-info b {
    color: var(--success);
    background: #fff;
    padding: 4px 10px;
    border-radius: 10px;
    display: inline-block;
    margin-top: 5px;
}

/* ═══════════════════════════════════════════════════════
   VENTANAS MODALES
   ═══════════════════════════════════════════════════════ */

.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(44, 44, 84, 0.7);
    z-index: 500;
    align-items: center;
    justify-content: center;
    padding: 15px;
    overflow-y: auto;
    backdrop-filter: blur(4px);
}
.modal-overlay.active { display: flex; }
.modal-box {
    background: #fff;
    border: 4px solid var(--dark);
    border-radius: 24px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 0 rgba(44, 44, 84, 0.3);
    animation: popIn 0.3s ease;
    margin: auto;
}
.modal-lg { max-width: 700px; }
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 22px;
    border-bottom: 3px solid var(--dark);
    background: linear-gradient(135deg, #fff, #fff8e7);
    border-radius: 20px 20px 0 0;
}
.modal-header h2 { font-size: 1.2rem; }
.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--dark);
    width: 34px;
    height: 34px;
    border-radius: 50%;
    transition: all 0.15s;
}
.modal-close:hover { background: var(--accent-2); color: #fff; }
.modal-body { padding: 22px; overflow-y: auto; }
.modal-desc { color: #666; font-size: 0.92rem; margin-bottom: 15px; }
.modal-input {
    width: 100%;
    padding: 14px 18px;
    border: 3px solid var(--dark);
    border-radius: 14px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    outline: none;
}
.modal-input:focus { border-color: var(--accent-2); box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.15); }
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 15px 22px;
    border-top: 3px solid #f0f0f5;
    background: #fafaff;
    border-radius: 0 0 20px 20px;
}
.name-status { margin-top: 10px; min-height: 22px; font-size: 0.9rem; }
.name-suggestions {
    margin-top: 12px;
    padding: 12px;
    background: #fff8e7;
    border-radius: 12px;
    border: 2px dashed var(--accent);
}
.country-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.country-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 12px 8px;
    background: #fff;
    border: 3px solid #e5e5f0;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.15s;
    font-size: 0.82rem;
    font-weight: 600;
    text-align: center;
}
.country-item:hover { border-color: var(--accent); transform: translateY(-2px); }
.country-item.selected {
    border-color: var(--dark);
    background: linear-gradient(135deg, #fff8e7, #ffe8a3);
    box-shadow: 0 4px 0 var(--dark);
}
.country-item img {
    width: 32px;
    height: 24px;
    object-fit: cover;
    border-radius: 6px;
}

/* ═══════════════════════════════════════════════════════
   PIE DE PÁGINA
   ═══════════════════════════════════════════════════════ */

.site-footer {
    background: linear-gradient(135deg, var(--dark), #1e1e42);
    color: #fff;
    margin-top: 50px;
    border-top: 5px solid var(--accent);
}
.footer-inner {
    max-width: 1440px;
    margin: 0 auto;
    padding: 40px 25px 20px;
    display: grid;
    grid-template-columns: 2fr  2fr;
    gap: 30px;
}
.footer-col h5 { color: var(--accent); margin-bottom: 12px; font-size: 0.95rem; }
.footer-col a {
    display: block;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    padding: 4px 0;
    font-size: 0.88rem;
    transition: color 0.15s;
}
.footer-col a:hover { color: var(--accent); }
.footer-logo { font-size: 1.2rem; font-weight: 800; margin-bottom: 10px; }
.footer-desc { font-size: 0.87rem; line-height: 1.6; color: rgba(255, 255, 255, 0.6); }
.footer-cats { display: flex; flex-wrap: wrap; gap: 6px; }
.footer-cat {
    background: rgba(255, 255, 255, 0.08);
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.78rem;
    border: 1px solid rgba(255, 217, 61, 0.25);
}
.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    padding: 20px;
    font-size: 0.83rem;
    color: rgba(255, 255, 255, 0.5);
}

/* ═══════════════════════════════════════════════════════
   NOTIFICACIONES Y MENSAJES DE RACHA
   ═══════════════════════════════════════════════════════ */

.toast-app {
    position: fixed;
    top: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: var(--dark);
    color: #fff;
    padding: 14px 24px;
    border-radius: 15px;
    font-weight: 700;
    z-index: 9999;
    opacity: 0;
    transition: all 0.3s;
    border: 3px solid #fff;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    max-width: 90vw;
    font-family: inherit;
}
.toast-app.show { transform: translateX(-50%) translateY(0); opacity: 1; }
.toast-app.success { background: #22a06b; }
.toast-app.error { background: var(--accent-2); }

.streak-popup {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%) scale(0.3);
    background: linear-gradient(135deg, var(--accent-2), var(--accent));
    color: #fff;
    font-size: 2.5rem;
    font-weight: 800;
    padding: 25px 50px;
    border-radius: 25px;
    border: 5px solid #fff;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
    z-index: 9999;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    pointer-events: none;
    text-shadow: 3px 3px 0 rgba(44, 44, 84, 0.3);
    white-space: nowrap;
}
.streak-popup.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }

/* ═══════════════════════════════════════════════════════
   BARRA DE CATEGORÍAS Y HÉROES
   ═══════════════════════════════════════════════════════ */

.categories-bar {
    background: linear-gradient(135deg, #fff 0%, #fff8e7 100%);
    border-bottom: 3px solid var(--dark);
    position: sticky;
    top: 78px;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(44, 44, 84, 0.06);
    width: 100%;
}
.cat-bar-inner {
    max-width: 1440px;
    margin: 0 auto;
    padding: 12px 25px;
    display: flex;
    align-items: center;
    gap: 18px;
}
.cat-bar-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 800;
    font-size: 0.85rem;
    color: var(--dark);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
    padding-right: 15px;
    border-right: 2px dashed #ddd;
    white-space: nowrap;
}
.cat-bar-scroll {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 4px;
    flex: 1;
    min-width: 0;
    scrollbar-width: thin;
}
.cat-bar-scroll::-webkit-scrollbar { height: 6px; }
.cat-bar-scroll::-webkit-scrollbar-thumb { background: #ddd; border-radius: 3px; }

.cat-bar-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: #fff;
    border: 3px solid var(--dark);
    border-radius: 15px;
    font-family: inherit;
    font-weight: 700;
    font-size: 0.88rem;
    color: var(--dark);
    cursor: pointer;
    transition: all 0.15s;
    box-shadow: 0 4px 0 var(--dark);
    flex-shrink: 0;
    white-space: nowrap;
}
.cat-bar-item:hover { transform: translateY(-2px); box-shadow: 0 6px 0 var(--dark); }
.cat-bar-item.active {
    background: linear-gradient(135deg, #ffd93d, #ffb700);
    box-shadow: 0 4px 0 var(--dark), 0 0 20px rgba(255, 217, 61, 0.5);
}
.cat-bar-emoji { font-size: 1.2rem; }
.cat-bar-img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--dark);
    background: #fff;
    flex-shrink: 0;
}
.cat-bar-name { font-weight: 700; }
.cat-bar-count {
    background: var(--dark);
    color: #fff;
    padding: 1px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 700;
}

/* ═══════════════════════════════════════════════════════
   TABLAS DE CLASIFICACIÓN
   ═══════════════════════════════════════════════════════ */

.lb-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
    font-family: inherit;
}
.lb-table thead th {
    background: var(--dark);
    color: #fff;
    padding: 14px 12px;
    text-align: left;
    font-weight: 700;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
    white-space: nowrap;
}
.lb-table thead th:first-child { border-radius: 12px 0 0 0; }
.lb-table thead th:last-child { border-radius: 0 12px 0 0; }
.lb-table tbody td {
    padding: 14px 12px;
    border-bottom: 2px solid #f0f0f5;
    vertical-align: middle;
    color: var(--dark);
}
.lb-table tbody tr:hover { background: #fafaff; }
.lb-table tbody tr:last-child td { border-bottom: none; }
.lb-table .lb-rank { width: 60px; text-align: center; font-weight: 800; font-size: 1.1rem; }
.lb-table .lb-flag { width: 70px; text-align: center; }
.lb-table .lb-flag img {
    width: 40px;
    height: 28px;
    object-fit: cover;
    border-radius: 4px;
    border: 2px solid var(--dark);
    vertical-align: middle;
    background: #fff;
}
.lb-table .lb-name {font-weight: 700;font-size: 1.15rem;}
.lb-table .lb-score {
    background: #6bcf7f;
    color: #fff;
    padding: 5px 14px;
    border-radius: 15px;
    font-weight: 800;
    font-size: 0.88rem;
    display: inline-block;
}
.lb-table .lb-streak { color: #ff6b6b; font-weight: 800; }
.lb-table .lb-games { color: #888; font-weight: 600; }
.lb-table tbody tr.top-1 { background: linear-gradient(90deg, #fff8e7, transparent); }
.lb-table tbody tr.top-2 { background: linear-gradient(90deg, #f5f5f5, transparent); }
.lb-table tbody tr.top-3 { background: linear-gradient(90deg, #ffe8d6, transparent); }

.leaderboard-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}
.lb-stat {
    background: linear-gradient(135deg, #fff8e7, #ffecd2);
    border: 6px solid var(--dark);
    border-radius: 18px;
    padding: 16px 12px;
    text-align: center;
    box-shadow: 0 4px 0 rgba(44, 44, 84, 0.15);
}
.lb-stat-icon { font-size: 1.8rem; margin-bottom: 4px; }
.lb-stat-value {font-size: 2rem;font-weight: 800;color: var(--dark);line-height: 1;}
.lb-stat-label { font-size: 0.72rem; color: #888; text-transform: uppercase; margin-top: 6px; letter-spacing: 0.3px; font-weight: 700; }

/* ─── Podio ─── */
.podium {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 20px;
    padding: 30px 15px 10px;
    min-height: 320px;
}
.podium-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
    width: 130px;
}
.podium-flag {
    overflow: hidden;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s;
}
.podium-flag img {width: 32px;object-fit: cover;}
.podium-name {
    font-weight: 800;
    font-size: 1rem;
    color: var(--dark);
    text-align: center;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.podium-score {
    font-weight: 800;
    font-size: 0.85rem;
    color: #22a06b;
    background: #d4f5e2;
    padding: 4px 12px;
    border-radius: 15px;
    border: 2px solid #22a06b;
    white-space: nowrap;
}
.podium-score small { font-size: 0.7rem; color: #22a06b; opacity: 0.8; }
.podium-base {
    width: 100%;
    border: 3px solid var(--dark);
    border-bottom: none;
    border-radius: 14px 14px 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.3s;
}
.podium-base::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--dark);
}
.podium-medal {
    font-size: 2.5rem;
    filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.25));
    line-height: 1;
}
.h-1 { height: 140px; }
.h-2 { height: 100px; }
.h-3 { height: 70px; }
.podium-item.first .podium-flag { width: 32px; height: 24px; }
.podium-item.first .podium-name {font-size: 1.75rem;}
.podium-item.first .podium-score { font-size: 0.95rem; padding: 5px 15px; }
.podium-item.first .podium-base { background: linear-gradient(135deg, #ffd93d, #ffb700); }
.podium-item.second .podium-base { background: linear-gradient(135deg, #e8e8e8, #b8b8b8); }
.podium-item.third .podium-base { background: linear-gradient(135deg, #ffb366, #cd7f32); }

/* ═══════════════════════════════════════════════════════
   MENÚ LATERAL DE CATEGORÍAS (BARRA IZQUIERDA)
   ═══════════════════════════════════════════════════════ */

.cat-sidebar-list { list-style: none; padding: 0; margin: 0; }
.cat-sidebar-list li { margin-bottom: 2px; }
.cat-sidebar-list a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px;
    background: #fff;
    border-radius: 45px;
    text-decoration: none;
    color: var(--dark);
    font-weight: 700;
    font-size: 1.2rem;
}
.cat-sidebar-list a:hover { background: #2ab984; color: #fff; }
.cat-sidebar-list a.active {
    background: linear-gradient(135deg, #ffd93d, #ffb700);
    box-shadow: 0 3px 0 #2c2c54, 0 0 15px rgba(255, 217, 61, 0.5);
}
.cat-sidebar-list .cat-side-icon {
    width: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 3px solid var(--dark);
    overflow: hidden;
    font-size: 1.1rem;
    flex-shrink: 0;
}
.cat-sidebar-list .cat-side-icon img { width: 100%; height: 100%; object-fit: cover; }
.cat-sidebar-list .cat-side-count {
    background: var(--dark);
    color: #fff;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    display: none;
    margin-left: auto;
}

/* ═══════════════════════════════════════════════════════
   INTERRUPTOR (SWITCH)
   ═══════════════════════════════════════════════════════ */

.switch-label {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
    padding: 6px 0;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--dark);
    background: none;
    border: none;
    line-height: 1.2;
    white-space: nowrap;
}
.switch-label input[type="checkbox"] {
    display: none;
    visibility: hidden;
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}
.switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
    background: #ccc;
    border-radius: 28px;
    transition: background 0.25s ease;
    border: 3px solid var(--dark);
    box-sizing: border-box;
    flex-shrink: 0;
    vertical-align: middle;
}
.switch::after {
    content: '';
    position: absolute;
    top: 1px;
    left: 1px;
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    border: 2px solid var(--dark);
    transition: transform 0.25s ease;
    box-sizing: border-box;
}
.switch-label input[type="checkbox"]:checked + .switch { background: #6bcf7f; }
.switch-label input[type="checkbox"]:checked + .switch::after { transform: translateX(24px); }

/* ═══════════════════════════════════════════════════════
   ARTÍCULO DE CATEGORÍA
   ═══════════════════════════════════════════════════════ */

.cat-article-section { animation: popIn 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55); }
.cat-article-content h1,
.cat-article-content h2,
.cat-article-content h3 {
    margin: 20px 0 10px;
    color: var(--dark);
    line-height: 1.3;
}
.cat-article-content h2 { font-size: 1.4rem; }
.cat-article-content h3 { font-size: 1.15rem; }
.cat-article-content p { margin-bottom: 12px; line-height: 1.8; }
.cat-article-content ul,
.cat-article-content ol { margin: 12px 0 12px 25px; line-height: 1.8; }
.cat-article-content li { margin-bottom: 6px; }
.cat-article-content a { color: #ff3860; text-decoration: underline; font-weight: 600; }
.cat-article-content a:hover { color: #ff6b6b; }
.cat-article-content strong { color: var(--dark); font-weight: 800; }
.cat-article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 14px;
    margin: 15px 0;
    border: 3px solid var(--dark);
}
.cat-article-content blockquote {
    border-left: 5px solid #ffd93d;
    background: #fff8e7;
    padding: 12px 20px;
    margin: 15px 0;
    border-radius: 0 10px 10px 0;
    font-style: italic;
    color: #666;
}
.cat-article-content code {
    background: #f0f0ff;
    padding: 2px 8px;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    color: #a020f0;
}
.cat-article-content pre {
    background: var(--dark);
    color: #ffd93d;
    padding: 15px;
    border-radius: 12px;
    overflow-x: auto;
    margin: 15px 0;
    font-size: 0.85rem;
}
.cat-article-content table { width: 100%; border-collapse: collapse; margin: 15px 0; }
.cat-article-content table th,
.cat-article-content table td { padding: 10px 12px; border: 2px solid #e5e5f0; text-align: left; }
.cat-article-content table th { background: #fff8e7; font-weight: 700; color: var(--dark); }

/* Correcciones z-index de TinyMCE */
.tox-tinymce { z-index: 100 !important; }
.tox-tinymce-aux { z-index: 10000 !important; }

/* ═══════════════════════════════════════════════════════
   DISEÑO RESPONSIVO (MÓVIL Y TABLET)
   ═══════════════════════════════════════════════════════ */

@media (max-width: 1200px) {
    .app-layout { grid-template-columns: 260px 1fr 280px; gap: 20px; }
}

@media (max-width: 992px) {
    .app-layout { grid-template-columns: 1fr; gap: 20px; }
    .sidebar { position: static; }
    .sidebar-left { order: 3; }
    .sidebar-right { order: 2; }
    .main-col { order: 1; }
    .ad-tall { min-height: 250px; }
    .footer-inner { grid-template-columns: 1fr; gap: 20px; }
    .feature-grid { grid-template-columns: 1fr 1fr; }
}

/* ─── Tablet ─── */
@media (max-width: 900px) {
    .header-inner { padding: 0 16px; min-height: 64px; gap: 14px; }
    .site-logo .logo-text { font-size: 1.1rem; }
    .site-logo .logo-icon { height: 38px; padding: 0 12px; font-size: 1.3rem; border-radius: 10px; }
    .site-nav a { padding: 8px 12px; font-size: 0.9rem; }
    .auth-btn-header { padding: 8px 12px; font-size: 0.85rem; }
    .user-name { max-width: 90px; }
}

/* ─── Móvil (cabecera con botones de texto) ─── */
@media (max-width: 720px) {
    .header-inner {
        padding: 8px 12px;
        gap: 8px;
        min-height: 60px;
        flex-wrap: nowrap;
    }
    .site-logo .logo-icon {
        height: 38px;
        padding: 0 12px;
        font-size: 1.15rem;
        border-radius: 10px;
    }
    .site-logo .logo-text { display: none; }

    .site-nav {
        margin-left: 4px;
        gap: 2px;
        flex: 1 1 auto;
        overflow-x: auto;
        scrollbar-width: none;
    }
    .site-nav::-webkit-scrollbar { display: none; }
    .site-nav a {
        padding: 7px 10px;
        font-size: 0.82rem;
        border-radius: 8px;
    }
    .site-nav a.active::after { left: 10px; right: 10px; }

    .header-right { margin-left: 4px; gap: 5px; }

    /* Los botones de autenticación mantienen el texto en móvil */
    .auth-btn-header {
        padding: 7px 10px;
        font-size: 0.78rem;
        gap: 4px;
        border-radius: 9px;
    }
    .auth-btn-header span:first-child { display: inline; font-size: 0.85rem; }
    .auth-btn-header span:last-child { display: inline; font-size: 0.78rem; }

    /* Ocultar el marcador en el perfil, mostrar solo el nombre */
    .user-score { display: none; }
    .user-name { max-width: 60px; font-size: 0.8rem; }
    .user-flag-img,
    .guest-avatar {
        width: 26px;
        height: 26px;
        min-width: 26px;
        min-height: 26px;
    }
    .pm-avatar-flag { width: 40px; height: 40px; min-width: 40px; min-height: 40px; }

    /* Menú desplegable de ancho completo en móvil */
    .profile-menu { width: calc(100vw - 24px); right: -8px; }

    /* Otros ajustes móviles */
    .cat-bar-inner { padding: 10px 15px; gap: 10px; flex-wrap: wrap; }
    .cat-bar-label { border-right: none; padding-right: 0; width: 100%; }
    .cat-bar-item { padding: 8px 14px; font-size: 0.82rem; }
    .app-layout { padding: 15px 12px; }
    .card { padding: 22px 18px; border-radius: 20px; }
    .options { grid-template-columns: 1fr; }
    .option { padding: 12px 10px; font-size: 0.88rem; min-height: 55px; }
    .option .letter { width: 26px; height: 26px; font-size: 0.8rem; }
    .question-text { font-size: 1.05rem; }
    .timer-circle { width: 100px; height: 100px; }
    .timer-circle span { font-size: 1.8rem; }
    .qtb-stats { font-size: 0.8rem; padding: 5px 10px; gap: 4px; }
    .qtb-icon { font-size: 0.85rem; }
    .qtb-val { font-size: 0.82rem; }
    .qtb-sep { font-size: 0.8rem; }
    .qtb-quit { width: 32px; height: 32px; font-size: 0.9rem; }
    .joker-bar { gap: 8px; margin: 15px auto 20px; min-height: 60px; }
    .joker-btn { padding: 10px 14px; min-width: 80px; border-radius: 15px; }
    .joker-btn .joker-icon { font-size: 1.4rem; }
    .joker-btn .joker-label { font-size: 0.72rem; }
    .joker-count {
        width: 20px;
        height: 20px;
        font-size: 0.68rem;
        top: -6px;
        right: -6px;
        border-width: 2px;
    }
    .result-stats { grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
    .rs-value { font-size: 1.4rem; }
    .scoreboard-list { max-height: 350px; }
    .country-grid { grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); }
    .streak-popup { font-size: 1.5rem; padding: 18px 30px; }
    .leaderboard-stats { grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
    .lb-stat { padding: 12px 8px; }
    .lb-stat-icon { font-size: 1.5rem; }
    .lb-stat-value { font-size: 1.2rem; }
    .lb-stat-label { font-size: 0.65rem; }
    .podium { gap: 10px; min-height: 250px; padding: 20px 10px 10px; }
    .podium-item { width: 100px; }
    .podium-flag { width: 50px; height: 50px; }
    .podium-item.first .podium-flag { width: 60px; height: 60px; }
    .podium-name { font-size: 0.82rem; }
    .podium-item.first .podium-name { font-size: 0.92rem; }
    .podium-score { font-size: 0.72rem; padding: 3px 10px; }
    .podium-item.first .podium-score { font-size: 0.78rem; }
    .podium-medal { font-size: 2rem; }
    .h-1 { height: 100px; }
    .h-2 { height: 75px; }
    .h-3 { height: 55px; }
    .lb-table thead th { font-size: 0.72rem; padding: 10px 8px; }
    .lb-table tbody td { font-size: 0.82rem; padding: 10px 8px; }
    .lb-table .lb-flag img { width: 32px; height: 22px; }
    .lb-table .lb-rank { width: 40px; font-size: 0.95rem; }
    .lb-table .lb-score { font-size: 0.78rem; padding: 4px 10px; }
    .switch-label { font-size: 0.85rem; gap: 10px; }
    .switch { width: 46px; height: 26px; }
    .switch::after { width: 18px; height: 18px; }
    .switch-label input[type="checkbox"]:checked + .switch::after { transform: translateX(20px); }
    .lang-switcher { padding: 3px; }
    .lang-btn { width: 34px; height: 26px; }
}

/* ─── Móvil pequeño ─── */
@media (max-width: 500px) {
    .lb-table .lb-col-best,
    .lb-table .lb-col-games { display: none; }
}

@media (max-width: 480px) {
    .header-inner { padding: 6px 10px; }
    .site-nav a { padding: 6px 8px; font-size: 0.78rem; }
    .auth-btn-header { padding: 6px 8px; font-size: 0.72rem; gap: 3px; }
    .auth-btn-header span:first-child { font-size: 0.8rem; }
    .auth-btn-header span:last-child { font-size: 0.72rem; }
    .user-name { max-width: 55px; font-size: 0.75rem; }
    .qtb-stats { font-size: 0.75rem; padding: 4px 8px; }
    .qtb-val { font-size: 0.78rem; }
    .qtb-quit { width: 28px; height: 28px; font-size: 0.8rem; }
}

/* ─── Móvil muy pequeño: solo iconos en botones de autenticación ─── */
@media (max-width: 360px) {
    .auth-btn-header span:last-child { display: none; }
    .auth-btn-header { padding: 7px 9px; }
    .auth-btn-header span:first-child { font-size: 0.95rem; }
    .user-name { max-width: 50px; font-size: 0.72rem; }
}

/* ═══════════════════════════════════════════════════════
   CAMBIO DE IDIOMA
   ═══════════════════════════════════════════════════════ */

.lang-switcher {
    display: flex;
    gap: 4px;
    padding: 4px;
    background: #f8f8ff;
    border: 3px solid var(--dark);
    border-radius: 25px;
    box-shadow: 0 3px 0 var(--dark);
}
.lang-btn {
    display: block;
    width: 40px;
    height: 32px;
    border-radius: 20px;
    overflow: hidden;
    border: 2px solid transparent;
    transition: all 0.15s;
    opacity: 0.5;
}
.lang-btn img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lang-btn:hover { opacity: 0.85; transform: scale(1.05); }
.lang-btn.active {
    opacity: 1;
    border-color: var(--dark);
    box-shadow: 0 0 0 2px var(--accent);
}

/* ═══════════════════════════════════════════════════════
   HÉROES DE CATEGORÍA (GRID DE TARJETAS GRANDES)
   ═══════════════════════════════════════════════════════ */

.categories-hero {
    margin: 25px 0;
    padding: 22px 18px;
    background: linear-gradient(135deg, #fff8e7 0%, #ffecd2 100%);
    border: 3px dashed var(--dark);
    border-radius: 40px;
}
.cat-hero-header { text-align: center; margin-bottom: 20px; }
.cat-hero-header h2 {font-size: 1.5rem;margin-bottom: 4px;color: var(--dark);}
.cat-hero-header p { font-size: 0.9rem; color: #888; }
.cat-hero-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 15px;
}
.cat-hero-card {
    position: relative;
    background: #fff;
    border: 3px solid var(--dark);
    border-radius: 20px;
    padding: 16px 10px 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    box-shadow: 0 4px 0 var(--dark);
    overflow: hidden;
    user-select: none;
}
.cat-hero-card:hover { transform: translateY(-4px); box-shadow: 0 8px 0 var(--dark); }
.cat-hero-card:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--dark); }
.cat-hero-card.active {
    background: linear-gradient(135deg, #ffd93d, #ffb700);
    transform: translateY(-2px);
    box-shadow: 0 6px 0 var(--dark), 0 0 20px rgba(255, 217, 61, 0.5);
}
.cat-hero-img {
    width: 85px;
    height: 85px;
    margin: 0 auto 12px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid var(--dark);
    overflow: hidden;
    background: #fff;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}
.cat-hero-card.active .cat-hero-img { transform: scale(1.06); }
.cat-hero-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cat-hero-img-all { background: linear-gradient(135deg, #6bcbff, #a8edea) !important; }
.cat-hero-emoji { font-size: 2.6rem; line-height: 1; }
.cat-hero-name {
    font-weight: 800;
    font-size: 1.15rem;
    color: var(--dark);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cat-hero-count { font-size: 0.72rem; color: #888; font-weight: 600; }
.cat-hero-card.active .cat-hero-count { color: var(--dark); opacity: 0.75; }
.cat-hero-check {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 26px;
    height: 26px;
    background: #6bcf7f;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 800;
    opacity: 0;
    transform: scale(0.5) rotate(-45deg);
    transition: all 0.25s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    border: 2px solid var(--dark);
    box-shadow: 0 2px 0 var(--dark);
}
.cat-hero-card.active .cat-hero-check { opacity: 1; transform: scale(1) rotate(0); }

.btn-play-hero.pulse { animation: pulse-btn 0.6s ease 2; }
@keyframes pulse-btn {
    0%, 100% { transform: scale(1); box-shadow: 0 5px 0 var(--dark); }
    50% { transform: scale(1.05); box-shadow: 0 8px 0 var(--dark), 0 0 25px rgba(255, 217, 61, 0.7); }
}

@media (max-width: 700px) {
    .categories-hero { padding: 15px 12px; margin: 18px 0; }
    .cat-hero-grid { grid-template-columns: repeat(auto-fill, minmax(105px, 1fr)); gap: 10px; }
    .cat-hero-img { width: 62px; height: 62px; margin-bottom: 8px; }
    .cat-hero-emoji { font-size: 2rem; }
    .cat-hero-name { font-size: 0.78rem; }
    .cat-hero-count { font-size: 0.65rem; }
    .cat-hero-card { padding: 12px 8px 10px; border-radius: 16px; }
    .cat-hero-check { width: 20px; height: 20px; font-size: 0.8rem; top: 6px; right: 6px; }
}
@media (max-width: 400px) {
    .cat-hero-grid { grid-template-columns: repeat(2, 1fr); }
}


.sb_left{
background:#fff;border: 8px solid #2c2c54;border-radius: 40px;padding:15px;margin-bottom:15px;box-shadow:0 5px 0 rgba(44,44,84,0.12);
}


/* ═══════════════════════════════════════════════════════
   AJUSTE MÓVIL DE LA CABECERA (logo compacto + botones de texto)
   ═══════════════════════════════════════════════════════ */

@media (max-width: 720px) {
    /* Cabecera: altura y espaciado compactos */
    .site-header .header-inner {
        padding: 6px 10px !important;
        gap: 6px !important;
        min-height: 56px !important;
        flex-wrap: nowrap !important;
        overflow: hidden !important;
    }

    /* Logotipo: caja naranja más pequeña, texto reducido */
    .site-header .site-logo {
        flex-shrink: 0 !important;
        gap: 0 !important;
    }
    .site-header .site-logo .logo-icon {
        height: 36px !important;
        padding: 0 10px !important;
        font-size: 0.95rem !important;
        border-radius: 10px !important;
        box-shadow: 2px 4px 10px rgba(0, 0, 0, 0.18) !important;
        max-width: none !important;
        white-space: nowrap !important;
    }
    .site-header .site-logo .logo-text {
        display: none !important;
    }

    /* Menú central: enlaces más pequeños, scroll horizontal si hace falta */
    .site-header .site-nav {
        flex: 1 1 auto !important;
        min-width: 0 !important;
        margin-left: 2px !important;
        gap: 0 !important;
        overflow-x: auto !important;
        scrollbar-width: none !important;
    }
    .site-header .site-nav::-webkit-scrollbar { display: none !important; }
    .site-header .site-nav a {
        padding: 6px 8px !important;
        font-size: 0.78rem !important;
        border-radius: 8px !important;
        flex-shrink: 0 !important;
    }
    .site-header .site-nav a.active::after {
        left: 8px !important;
        right: 8px !important;
        bottom: -1px !important;
        height: 2px !important;
    }

    /* Bloque derecho */
    .site-header .header-right {
        margin-left: 2px !important;
        gap: 4px !important;
        flex-shrink: 0 !important;
    }

    /* Botones de autenticación: mantienen el texto pero compactos */
    .site-header .auth-buttons {
        gap: 4px !important;
    }
    .site-header .auth-btn-header {
        padding: 6px 8px !important;
        font-size: 0.72rem !important;
        gap: 3px !important;
        border-radius: 8px !important;
        border-width: 1.5px !important;
    }
    .site-header .auth-btn-header span:first-child {
        font-size: 0.8rem !important;
        display: inline !important;
    }
    .site-header .auth-btn-header span:last-child {
        display: inline !important;
        font-size: 0.72rem !important;
    }

    /* Perfil de usuario: compacto */
    .site-header .user-flag-img,
    .site-header .guest-avatar {
        width: 24px !important;
        height: 24px !important;
        min-width: 24px !important;
        min-height: 24px !important;
    }
    .site-header .user-name {
        max-width: 55px !important;
        font-size: 0.74rem !important;
    }
    .site-header .user-score { display: none !important; }
    .site-header .profile-trigger {
        padding: 3px 8px 3px 3px !important;
        gap: 5px !important;
    }
}

/* ═══ Móviles muy pequeños: solo iconos ═══ */
@media (max-width: 400px) {
    .site-header .site-logo .logo-icon {
        height: 32px !important;
        padding: 0 8px !important;
        font-size: 0.85rem !important;
    }
    .site-header .site-nav a {
        padding: 5px 7px !important;
        font-size: 0.72rem !important;
    }
    .site-header .auth-btn-header {
        padding: 5px 7px !important;
        font-size: 0.68rem !important;
    }
    .site-header .auth-btn-header span:last-child {
        display: none !important;
    }
    .site-header .auth-btn-header span:first-child {
        font-size: 0.85rem !important;
    }
}


/* ═══════════════════════════════════════════════════════
   TABLA DE CLASIFICACIÓN EN MÓVIL — sin desbordamiento
   ═══════════════════════════════════════════════════════ */

@media (max-width: 720px) {
    /* La tarjeta que contiene la tabla debe contener el scroll, no la página */
    .main-col .card {
        overflow: hidden !important;
    }

    .table-wrap {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: none !important;
        margin: 0 !important;
    }
    .table-wrap::-webkit-scrollbar { display: none !important; }

    /* Tabla: ancho mínimo para que quepa sin desbordar la tarjeta */
    .lb-table {
        min-width: 0 !important;
        width: 100% !important;
        font-size: 0.82rem !important;
        table-layout: auto !important;
    }

    /* Cabecera y celdas: menos padding, texto más pequeño */
    .lb-table thead th,
    .lb-table tbody td {
        padding: 8px 6px !important;
        font-size: 0.74rem !important;
    }
    .lb-table thead th {
        font-size: 0.68rem !important;
        letter-spacing: 0.2px !important;
        padding: 8px 5px !important;
    }

    /* Ocultar columnas menos importantes para dar aire a las demás */
    .lb-table thead th:nth-child(2),
    .lb-table tbody td:nth-child(2),    /* Bandera grande */
    .lb-table thead th:nth-child(5),
    .lb-table tbody td:nth-child(5),    /* En İyi */
    .lb-table thead th:nth-child(7),
    .lb-table tbody td:nth-child(7) {   /* Oyun */
        display: none !important;
    }

    /* Bandera: se queda pegada al nombre como un mini icono */
    .lb-table .lb-flag {
        width: 30px !important;
        padding-right: 0 !important;
    }
    .lb-table .lb-flag img {
        width: 26px !important;
        height: 18px !important;
        border-width: 1px !important;
    }

    /* Nombre más compacto */
    .lb-table .lb-name {
        font-size: 0.82rem !important;
        max-width: 90px !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    /* Rank más pequeño */
    .lb-table .lb-rank {
        width: 34px !important;
        font-size: 0.85rem !important;
        padding-left: 4px !important;
    }

    /* Puntuación en pastilla más pequeña */
    .lb-table .lb-score {
        font-size: 0.72rem !important;
        padding: 3px 8px !important;
    }

    /* Seri compacta */
    .lb-table .lb-streak {
        font-size: 0.78rem !important;
        white-space: nowrap !important;
    }

    /* Cabeceras: acortar texto para que quepan */
    .lb-table thead th:nth-child(3)::after { content: ''; }

    /* La tarjeta que envuelve: menos padding horizontal */
    .main-col > .card {
        padding: 18px 12px !important;
    }

    /* Estadísticas superiores  */
    .leaderboard-stats {
        gap: 6px !important;
    }
    .lb-stat {
        padding: 10px 6px !important;
        border-width: 2px !important;
    }
    .lb-stat-icon { font-size: 1.3rem !important; }
    .lb-stat-value { font-size: 1.1rem !important; }
    .lb-stat-label { font-size: 0.6rem !important; }
}

@media (max-width: 480px) {
    .lb-table thead th,
    .lb-table tbody td {
        padding: 7px 4px !important;
        font-size: 0.7rem !important;
    }
    .lb-table thead th { font-size: 0.62rem !important; }
    .lb-table .lb-name { max-width: 75px !important; font-size: 0.76rem !important; }
    .lb-table .lb-score { font-size: 0.68rem !important; padding: 2px 7px !important; }
    .lb-table .lb-rank { width: 28px !important; font-size: 0.78rem !important; }
    .lb-table .lb-flag { width: 26px !important; }
    .lb-table .lb-flag img { width: 22px !important; height: 16px !important; }
    .lb-table .lb-streak { font-size: 0.7rem !important; }

    /* Ocultar cabeceras menos críticas */
    .lb-table thead th:nth-child(3),
    .lb-table tbody td:nth-child(3) { display: table-cell !important; } /* Nombre siempre visible */
}

@media (max-width: 380px) {
    /* En móviles muy pequeños, esconder la bandera también */
    .lb-table thead th:nth-child(2),
    .lb-table tbody td:nth-child(2) { display: none !important; }
    .lb-table .lb-name { max-width: 90px !important; font-size: 0.72rem !important; }
    .lb-table thead th,
    .lb-table tbody td { padding: 6px 3px !important; }
    .lb-table thead th { font-size: 0.58rem !important; }
}