/* =========================================
   LIBRO RANK - SISTEMA DE DISEÑO GLOBAL
   ========================================= */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Playfair+Display:wght@700&display=swap');

:root {
    /* --- PALETA COZY-DARK --- */
    --bg-body: #1a1614;       
    --bg-card: #25211e;       
    --bg-input: #2c2724;      
    --bg-input-focus: #36302c;

    /* ACENTOS */
    --primary: #4cd137;       /* Verde */
    --accent-gold: #d4af37;   /* Oro */
    --accent-gold-glow: rgba(212, 175, 55, 0.2);
    --error: #ff5e57;

    /* TEXTOS */
    --text-main: #ffffff;     /* Blanco puro */
    --text-muted: #e0d9d5;    /* Gris muy claro para lectura fluida */
    --text-gold: #ffd700;

    /* EFECTOS */
    --border: 1px solid rgba(212, 175, 55, 0.25);
    --border-gold: 1px solid var(--accent-gold);
    --radius: 14px;
    --shadow: 0 12px 30px rgba(0,0,0,0.5);
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- RESET & BASE --- */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    background-color: var(--bg-body);
    color: var(--text-main);
    font-family: 'Plus Jakarta Sans', sans-serif;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: clip;
}

html {
    overflow-x: clip;
}

main {
    flex: 1 0 auto;
}

footer.site-footer {
    flex-shrink: 0;
}

h1, h2, h3, .font-title { 
    font-family: 'Playfair Display', serif; 
    color: var(--accent-gold); 
    letter-spacing: -0.01em;
}

.text-muted { color: var(--text-muted) !important; }
strong { color: #fff !important; }

a { text-decoration: none; color: inherit; transition: var(--transition); }

/* =========================================
   1. COMPONENTES DE NAVEGACIÓN
   ========================================= */
header.site-header {
    background-color: rgba(26, 22, 20, 0.95);
    border-bottom: var(--border);
    padding: 0.65rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
}

.library-header {
    background: linear-gradient(to bottom, rgba(0,0,0,0.4), transparent), 
                rgba(212, 175, 55, 0.03);
    padding: 60px 0;
    border-bottom: 1px solid rgba(212, 175, 55, 0.1);
    margin-bottom: 2rem;
}

.active-nav {
    color: var(--accent-gold) !important;
}

.nav-link-custom {
    color: rgba(255, 255, 255, 0.85) !important;
    font-weight: 700;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.nav-link-custom:hover {
    color: var(--accent-gold) !important;
    transform: translateY(-1px);
}

.logo {
    font-weight: 800;
    font-size: 1.25rem;
    color: #fff;
}
.logo span { color: var(--accent-gold); }

/* Logo versión landing (sin login) — más grande, todo uppercase */
.logo-landing {
    font-weight: 900;
    font-size: 1.6rem;
    color: #fff;
    letter-spacing: 1px;
    font-family: 'Plus Jakarta Sans', sans-serif;
}
.logo-landing span { color: var(--accent-gold); }

/* Botón CTA del header landing */
.btn-landing-cta {
    background: var(--accent-gold);
    color: #000 !important;
    font-weight: 800;
    font-size: 0.9rem;
    padding: 0.55rem 1.4rem;
    border-radius: 8px;
    border: 2px solid var(--accent-gold);
    transition: var(--transition);
    cursor: pointer;
}
.btn-landing-cta:hover {
    background: #f1c40f;
    border-color: #f1c40f;
    transform: translateY(-2px);
}

.header-badge {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 50px;
    white-space: nowrap;
}

/* =========================================
   2. SISTEMA DE TARJETAS (CARDS)
   ========================================= */
.card {
    background-color: var(--bg-card);
    border: var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.card:hover {
    border-color: rgba(212, 175, 55, 0.5);
    transform: translateY(-2px);
}

.card h2 {
    color: var(--accent-gold) !important;
    font-size: 1.25rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid rgba(212, 175, 55, 0.1);
    padding-bottom: 0.5rem;
}

/* Tarjeta de Libro Específica */
.book-card {
    position: relative;
    padding: 14px !important;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.book-card h3 {
    color: #fff !important;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.95rem;
    line-height: 1.3;
    margin-top: 5px;
}

.book-card p {
    color: var(--text-muted) !important;
    font-weight: 500;
    font-size: 0.8rem;
}

.book-cover {
    background: #36302c;
    aspect-ratio: 2/3;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.5);
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.05);
}

/* =========================================
   3. BOTONES & ACCIONES
   ========================================= */
.btn-gold {
    background-color: var(--accent-gold);
    color: #000;
    font-weight: 600;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    transition: var(--transition);
}

.btn-gold:hover {
    background-color: #f1c40f;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px var(--accent-gold-glow);
}

.btn-delete-icon, .btn-edit-icon {
    position: absolute;
    top: 10px;
    background: rgba(37, 33, 30, 0.8);
    border: 1px solid rgba(212, 175, 55, 0.2);
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.btn-delete-icon { right: 10px; color: rgba(212, 175, 55, 0.5); }
.btn-edit-icon { right: 45px; color: var(--accent-gold); }
.btn-journal-icon { 
    position: absolute;
    top: 10px;
    right: 80px;
    background: rgba(37, 33, 30, 0.8);
    border: 1px solid rgba(212, 175, 55, 0.2);
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    color: #3498db;
}

.btn-delete-icon:hover { background: var(--error); color: white; }
.btn-edit-icon:hover { background: var(--accent-gold); color: #000; }
.btn-journal-icon:hover { background: #3498db; color: white; }

/* =========================================
   4. FORMULARIOS DARK
   ========================================= */
.form-control, .form-select {
    background-color: var(--bg-input) !important;
    border: 1px solid #3d3632 !important;
    color: var(--text-main) !important;
    padding: 0.75rem 1rem;
}

.form-control:focus, .form-select:focus {
    background-color: var(--bg-input-focus) !important;
    border-color: var(--accent-gold) !important;
    box-shadow: 0 0 0 0.2rem var(--accent-gold-glow) !important;
    outline: none;
    color: var(--text-main) !important;
}

/* Labels visibles en tema oscuro */
.form-label {
    color: var(--text-muted) !important;
    font-size: 0.85rem;
    margin-bottom: 0.4rem;
}

/* Placeholder visible sobre fondo oscuro */
.form-control::placeholder,
.form-select::placeholder {
    color: rgba(224, 217, 213, 0.45) !important;
    opacity: 1 !important;
}

/* Opciones del select en dark */
.form-select option {
    background-color: var(--bg-input) !important;
    color: var(--text-main) !important;
}

/* Textarea */
textarea.form-control {
    resize: vertical;
    min-height: 90px;
}

/* Inputs con autofill (Chrome los pinta de azul) */
.form-control:-webkit-autofill,
.form-control:-webkit-autofill:hover,
.form-control:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px var(--bg-input-focus) inset !important;
    -webkit-text-fill-color: var(--text-main) !important;
    caret-color: var(--text-main);
}

/* =========================================
   5. DASHBOARD & STATS
   ========================================= */
.stat-card {
    background: rgba(37, 33, 30, 0.6);
    border: var(--border);
    border-radius: var(--radius);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.stat-value {
    font-size: 1.6rem;
    font-weight: 800;
    color: #fff;
    line-height: 1;
    font-family: 'Playfair Display', serif;
}

.stat-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    margin-top: 3px;
}

.stat-icon {
    background: rgba(212, 175, 55, 0.1);
    color: var(--accent-gold);
    width: 45px;
    height: 45px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

/* =========================================
   6. PERFIL & AMIGOS
   ========================================= */
.perfil-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

.perfil-side {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.perfil-side .card {
    margin-bottom: 0;
}

.user-avatar {
    width: 140px;
    height: 140px;
    margin: 0 auto 1.5rem;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #333, #000);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid var(--accent-gold);
    box-shadow: 0 0 20px var(--accent-gold-glow);
    overflow: hidden;
}

.user-meta { text-align: center; }
.user-name { font-size: 1.8rem; margin-bottom: 0.2rem; }
.user-handle { font-size: 1rem; margin-bottom: 1rem; }

.badge--level {
    background: rgba(212, 175, 55, 0.1);
    color: var(--accent-gold);
    border: 1px solid rgba(212, 175, 55, 0.3);
    padding: 6px 15px;
    border-radius: 50px;
    font-weight: 800;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 1px;
}

/* Mi Resumen - Últimas Conquistas */
.card-lectura-mini {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    transition: var(--transition);
}

.card-lectura-mini:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: translateX(5px);
}

.card-lectura-mini h4 {
    color: #fff !important;
    font-size: 1rem;
    margin: 0;
}

.card-lectura-mini p {
    color: var(--text-muted) !important;
    margin: 0;
}

.grid-lecturas {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

/* Trofeos */
.trophies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 20px;
    margin-top: 1.5rem;
}

.trophy-item {
    background: rgba(0,0,0,0.2);
    border: 1px solid rgba(255,255,255,0.05);
    padding: 1.5rem 1rem;
    border-radius: 16px;
    text-align: center;
    transition: var(--transition);
    filter: grayscale(1) opacity(0.4);
}

.trophy-item.desbloqueado {
    filter: none;
    background: rgba(212, 175, 55, 0.05);
    border-color: rgba(212, 175, 55, 0.2);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

.trophy-icon {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 0.5rem;
}

.trophy-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    margin: 0;
}

.desbloqueado .trophy-title { color: var(--accent-gold); }

/* Editar Cuenta - Formularios Premium */
.perfil-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.field--full { grid-column: span 2; }

.field label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--accent-gold);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.perfil-form input,
.perfil-form textarea,
.perfil-form select {
    background: var(--bg-input) !important;
    border: 1px solid rgba(255,255,255,0.1) !important;
    border-radius: 10px !important;
    padding: 0.8rem 1rem !important;
    color: #fff !important;
    font-family: inherit;
    transition: var(--transition);
}

.perfil-form input::placeholder,
.perfil-form textarea::placeholder {
    color: rgba(224, 217, 213, 0.45) !important;
    opacity: 1 !important;
}

.perfil-form input:focus, 
.perfil-form textarea:focus {
    border-color: var(--accent-gold) !important;
    background: var(--bg-input-focus) !important;
    outline: none;
    box-shadow: 0 0 0 4px var(--accent-gold-glow);
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 5px;
}

.chip {
    padding: 8px 18px;
    border-radius: 50px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.05);
    color: var(--text-muted);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.chip:hover {
    border-color: var(--accent-gold);
    color: #fff;
}

.btn--brand {
    background: var(--accent-gold);
    color: #000;
    border: none;
    padding: 1rem 2rem;
    border-radius: 10px;
    font-weight: 800;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
}

.btn--brand:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--accent-gold-glow);
    background: #f1c40f;
}

@media (max-width: 768px) {
    .perfil-layout { grid-template-columns: 1fr; }
    .form-grid { grid-template-columns: 1fr; }
    .field--full { grid-column: span 1; }
}

/* Pestañas */
.inventory-tabs {
    display: flex;
    gap: 4px;
    background: rgba(0,0,0,0.35);
    padding: 5px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.06);
    overflow-x: auto;
    scrollbar-width: none;
}
.inventory-tabs::-webkit-scrollbar { display: none; }

.tab-btn {
    flex: 1;
    min-width: max-content;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid transparent;
    background: transparent;
    color: rgba(255,255,255,0.38);
    font-weight: 700;
    font-size: 0.82rem;
    cursor: pointer;
    transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease;
    white-space: nowrap;
}

.tab-btn:hover:not(.active) {
    color: rgba(255,255,255,0.65);
    background: rgba(255,255,255,0.04);
}

.tab-btn.active {
    background: linear-gradient(135deg, rgba(212,175,55,0.14), rgba(212,175,55,0.06));
    color: var(--accent-gold);
    border-color: rgba(212,175,55,0.28);
    box-shadow: 0 2px 10px rgba(212,175,55,0.08);
}

/* =========================================
   7. LANDING PAGE (INDEX)
   ========================================= */

.hero-section {
    position: relative;
    padding: 120px 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    background: linear-gradient(to right, rgba(26, 22, 20, 0.92) 35%, rgba(26, 22, 20, 0.35) 100%),
                url('https://images.unsplash.com/photo-1481627834876-b7833e8f5570?q=80&w=2000&auto=format&fit=crop');
    background-size: cover;
    background-position: center;
    border-bottom: var(--border);
}

.hero-content {
    max-width: 800px;
    z-index: 10;
}

.hero-content h1 {
    font-size: 5rem;
    line-height: 1.05;
    margin-bottom: 2rem;
    color: #fff;
    font-weight: 800;
}

.hero-content h1 span {
    display: block;
    color: var(--accent-gold);
    font-style: italic;
}

.hero-content p {
    font-size: 1.5rem;
    color: var(--text-muted);
    margin-bottom: 3.5rem;
    line-height: 1.6;
}

.hero-btns {
    display: flex;
    gap: 20px;
}

.btn-main {
    background: var(--accent-gold);
    color: #000;
    padding: 1.2rem 3rem;
    border-radius: 12px;
    font-weight: 800;
    font-size: 1.2rem;
    transition: var(--transition);
    border: none;
}

.btn-main:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px var(--accent-gold-glow);
    background: #f1c40f;
}

.btn-secondary {
    background: rgba(255,255,255,0.08);
    border: 2px solid rgba(255,255,255,0.5);
    color: #fff;
    padding: 1.2rem 3rem;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1.2rem;
    backdrop-filter: blur(10px);
    transition: var(--transition);
}

.btn-secondary:hover {
    background: rgba(255,255,255,0.15);
    border-color: #fff;
    transform: translateY(-2px);
}

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-top: 60px;
}

.feature-card {
    background: var(--bg-card);
    border: var(--border);
    padding: 3.5rem 2rem;
    border-radius: var(--radius);
    transition: var(--transition);
    text-align: center;
}

.feature-card:hover {
    border-color: var(--accent-gold);
    transform: translateY(-8px);
    box-shadow: var(--shadow);
}

.feature-icon {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    display: block;
}

.feature-card h3 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: #fff !important;
}

.feature-card p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* Game Preview Section */
.game-preview {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6rem;
    align-items: center;
    padding: 120px 0;
}

.game-text h2 {
    font-size: 3.8rem;
    margin-bottom: 2.5rem;
    line-height: 1.1;
}

.coin-stat {
    display: inline-flex;
    align-items: center;
    background: rgba(212, 175, 55, 0.1);
    color: var(--accent-gold);
    padding: 18px 36px;
    border-radius: 18px;
    font-weight: 800;
    font-size: 1.5rem;
    border: 1px solid rgba(212, 175, 55, 0.4);
}

.room-preview-box {
    height: 550px;
    background: url('https://images.unsplash.com/photo-1516979187457-637abb4f9353?q=80&w=1000&auto=format&fit=crop');
    background-size: cover;
    background-position: center;
    border: var(--border);
    border-radius: 40px;
    position: relative;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.room-preview-box::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(26,22,20,0.8), transparent);
}

/* Ranking Landing */
.table-landing {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 10px;
}

.table-landing th {
    padding: 1rem 1.5rem;
    color: var(--accent-gold);
    font-weight: 800;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 2px;
    opacity: 0.8;
}

.table-landing td {
    background: rgba(255,255,255,0.02);
    padding: 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.03);
    border-bottom: 1px solid rgba(255,255,255,0.03);
    vertical-align: middle;
}

.table-landing tr td:first-child { 
    border-left: 1px solid rgba(255,255,255,0.03); 
    border-radius: 12px 0 0 12px; 
    width: 80px;
    text-align: center;
}

.table-landing tr td:last-child { 
    border-right: 1px solid rgba(255,255,255,0.03); 
    border-radius: 0 12px 12px 0; 
}

.rank-number {
    font-family: 'Playfair Display', serif;
    font-size: 1.4rem;
    font-weight: 900;
    color: var(--text-muted);
}

.rank-number.top-1 {
    color: var(--accent-gold);
    text-shadow: 0 0 15px var(--accent-gold-glow);
}

.table-landing tr.highlight td {
    background: rgba(212, 175, 55, 0.05);
    border-color: rgba(212, 175, 55, 0.2);
}

@media (max-width: 1100px) {
    .hero-content h1 { font-size: 3.5rem; }
    .features-grid { grid-template-columns: 1fr; }
    .game-preview { grid-template-columns: 1fr; text-align: center; }
    .hero-btns { justify-content: center; }
}

/* =========================================
   8. PÁGINAS DE ACCESO (SPLIT LAYOUT)
   ========================================= */
.auth-page {
    background: linear-gradient(rgba(0,0,0,0.3), rgba(0,0,0,0.5)), 
                url('https://images.unsplash.com/photo-1507842217343-583bb7270b66?q=80&w=2000&auto=format&fit=crop');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    display: flex !important;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
}

.auth-visual {
    display: none; /* Ocultamos el bloque separado ya que ahora es el fondo */
}

.auth-content {
    width: 100%;
    max-width: 380px;
    height: auto;
    background: rgba(26, 22, 20, 0.88);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: 0 25px 50px rgba(0,0,0,0.5);
}

@media (max-width: 800px) {
    .auth-page { justify-content: center; padding: 1rem; }
    .auth-content { width: 100%; margin-right: 0; padding: 2rem; }
}

.auth-header {
    margin-bottom: 3rem;
}

.auth-header .logo {
    font-size: 2rem;
    margin-bottom: 2rem;
    display: block;
}

.auth-form-container h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    color: #fff;
}

.auth-form-container p.muted {
    margin-bottom: 2rem;
}

.field label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent-gold);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.auth-input {
    width: 100%;
    background: var(--bg-input) !important;
    border: 1px solid rgba(255,255,255,0.1) !important;
    border-radius: 8px !important;
    padding: 1rem !important;
    color: #fff !important;
    margin-bottom: 1.5rem;
    transition: var(--transition);
}

.auth-input:focus {
    border-color: var(--accent-gold) !important;
    background: var(--bg-input-focus) !important;
    box-shadow: 0 0 0 4px var(--accent-gold-glow) !important;
}

.auth-input::placeholder {
    color: rgba(224, 217, 213, 0.45) !important;
    opacity: 1 !important;
}

.btn-auth {
    width: 100%;
    padding: 1.2rem;
    background: var(--accent-gold);
    color: #000;
    border: none;
    border-radius: 8px;
    font-weight: 800;
    font-size: 1.1rem;
    cursor: pointer;
    transition: var(--transition);
}

.btn-auth:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--accent-gold-glow);
    background: #f1c40f;
}

@media (max-width: 1000px) {
    .auth-visual { display: none; }
    .auth-content { width: 100%; padding: 2rem; }
}

/* =========================================
   9. UTILS & ADAPTATIVIDAD
   ========================================= */
.text-gold { color: var(--accent-gold) !important; }
.badge-cozy { font-size: 0.65rem; padding: 4px 8px; border-radius: 4px; text-transform: uppercase; font-weight: bold; }
.badge--leido { background: #2d4030; color: #a3cfbb; }

/* =========================================
   10. SOCIAL FEED
   ========================================= */
.shop-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 2rem;
    background: linear-gradient(135deg, var(--bg-card), #111);
    border: 1px solid rgba(212, 175, 55, 0.2);
    box-shadow: 0 0 30px rgba(0,0,0,0.5);
}

.user-balance {
    font-size: 1.8rem;
    font-weight: 900;
    color: #ffd700;
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
    background: rgba(0,0,0,0.3);
    padding: 8px 25px;
    border-radius: 50px;
    border: 1px solid rgba(255, 215, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 15px;
}

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

.product-card {
    position: relative;
    background: #1a1a1a;
    border-radius: 24px;
    padding: 2rem 1.5rem;
    text-align: center;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 2px solid rgba(255,255,255,0.05);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0,0,0,0.6);
}

/* Rarezas */
.rarity-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 0.65rem;
    font-weight: 900;
    padding: 4px 12px;
    border-radius: 50px;
    letter-spacing: 1px;
    z-index: 10;
}

.rarity-common { border-color: #7f8c8d; }
.rarity-common .rarity-badge { background: #7f8c8d; color: white; }
.rarity-common .product-glow { background: radial-gradient(circle, rgba(127, 140, 141, 0.1) 0%, transparent 70%); }

.rarity-rare { border-color: #3498db; }
.rarity-rare .rarity-badge { background: #3498db; color: white; }
.rarity-rare .product-glow { background: radial-gradient(circle, rgba(52, 152, 219, 0.2) 0%, transparent 70%); }
.rarity-rare:hover { box-shadow: 0 0 30px rgba(52, 152, 219, 0.3); }

.rarity-legendary { border-color: #f1c40f; }
.rarity-legendary .rarity-badge { background: #f1c40f; color: black; }
.rarity-legendary .product-glow { background: radial-gradient(circle, rgba(241, 196, 15, 0.3) 0%, transparent 70%); }
.rarity-legendary:hover { box-shadow: 0 0 40px rgba(241, 196, 15, 0.4); }

.product-image-container {
    position: relative;
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.product-glow {
    position: absolute;
    width: 150%;
    height: 150%;
    top: -25%;
    left: -25%;
    z-index: 1;
}

.product-img {
    position: relative;
    z-index: 2;
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
    filter: drop-shadow(0 10px 20px rgba(0,0,0,0.8));
    transition: transform 0.3s ease;
}

.product-card:hover .product-img {
    transform: scale(1.15) rotate(5deg);
}

.product-type-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 800;
    color: rgba(255,255,255,0.4);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 0.5rem;
}

.product-title {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1.25rem;
    font-weight: 800;
    color: white !important;
    margin-bottom: 1rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.price-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 1.5rem;
}

.price-value {
    font-size: 1.5rem;
    font-weight: 900;
    color: #ffd700;
}

.btn-buy-game {
    width: 100%;
    background: linear-gradient(to bottom, #f1c40f, #d4af37);
    color: black;
    border: none;
    padding: 1rem;
    border-radius: 14px;
    font-weight: 900;
    font-size: 1rem;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 0 #9a7d23;
}

.btn-buy-game:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 0 #9a7d23;
    filter: brightness(1.1);
}

.btn-buy-game:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #9a7d23;
}

.btn-buy-game.btn-disabled {
    background: #333;
    color: #666;
    box-shadow: 0 4px 0 #111;
    cursor: not-allowed;
    filter: none;
}

/* =========================================
   11. MI HABITACIÓN (ROOM) - UI MEJORADA
   ========================================= */
.room-container-flex {
    display: flex;
    gap: 30px;
    padding: 30px;
    background: rgba(0,0,0,0.2);
    border-radius: 30px;
    margin-top: 2rem;
}

.inventory-panel {
    width: 350px;
    background: #1a1a1a;
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 24px;
    padding: 2rem;
    box-shadow: 0 20px 50px rgba(0,0,0,0.8);
}

.inventory-panel .inventory-tabs {
    background: #000;
    padding: 5px;
    border-radius: 16px;
    margin-bottom: 2rem;
}

.inventory-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    padding: 5px;
}

.inventario-item {
    background: #252525;
    border-radius: 16px;
    padding: 15px;
    border: 2px solid transparent;
    transition: all 0.2s ease;
    cursor: grab;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.inventario-item:hover {
    background: #333;
    border-color: var(--accent-gold);
    transform: scale(1.05);
}

.inventario-item:active { cursor: grabbing; }

.coin-badge {
    background: rgba(0,0,0,0.7) !important;
    border: 1px solid var(--accent-gold) !important;
    color: var(--accent-gold) !important;
    backdrop-filter: blur(10px);
    font-family: 'Plus Jakarta Sans', sans-serif;
}

/* Fix para label buscador perfil y textos */
.perfil-main h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--accent-gold);
}

.user-meta h1 { color: #fff !important; }
.user-meta .muted { color: var(--text-muted) !important; }

@media (max-width: 1024px) {
    .room-container-flex { flex-direction: column; }
    .inventory-panel { width: 100%; min-height: auto; }
}

@media (max-width: 768px) {
    .perfil-layout { grid-template-columns: 1fr; }
}

/* --- ESTILOS TRÍPTICO: PANEL 1 (AMPLIADO) --- */
.modern-panel {
    max-width: 850px;
    margin: 40px auto;
    background: #fff;
    border-radius: 30px;
    overflow: hidden;
    box-shadow: 0 25px 60px rgba(0,0,0,0.2);
    border: 1px solid #eee;
    display: flex;
    flex-direction: column;
}

.modern-canvas-container {
    height: 550px;
    background: #fff9c4; 
    position: relative;
    border-bottom: 2px solid #eee;
    cursor: crosshair;
}

/* Men� inferior de Hex�gonos */
.action-menu-modern {
    background: #f5f5f5;
    padding: 20px 10px;
    display: flex;
    justify-content: space-evenly;
    align-items: center;
}

.hex-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.hexagon-btn {
    width: 65px;
    height: 65px;
    background-color: #1a1a1a;
    clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
    display: flex;
    justify-content: center;
    align-items: center;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.hexagon-btn:hover {
    background-color: #333;
    transform: scale(1.1) translateY(-5px);
}

.hex-label {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    color: #666;
    letter-spacing: 1px;
}

/* Paredes y Suelo (Simulados en Canvas o CSS) */
.room-overlay {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background: linear-gradient(to bottom, transparent 60%, rgba(139, 69, 19, 0.1) 60%);
}

/* --- ESTILOS TR�PTICO: PANEL 2 (CABA�A R�STICA) --- */
.rustic-panel {
    max-width: 850px;
    margin: 40px auto;
    background: #fff;
    border-radius: 30px;
    overflow: hidden;
    box-shadow: 0 25px 60px rgba(0,0,0,0.2);
    border: 1px solid #eee;
    display: none; /* Oculto por defecto */
    flex-direction: column;
}

.rustic-canvas-container {
    height: 550px;
    background-color: #ffffff;
    /* Patr�n de hojas de eucalipto (Simulado con gradientes y formas) */
    background-image: radial-gradient(circle at 20% 20%, rgba(100, 150, 100, 0.05) 0%, transparent 20%),
                      radial-gradient(circle at 80% 40%, rgba(100, 150, 100, 0.05) 0%, transparent 25%),
                      radial-gradient(circle at 40% 70%, rgba(100, 150, 100, 0.05) 0%, transparent 15%);
    position: relative;
}

/* =========================================
   12. SOCIAL FEED
   ========================================= */
.feed-item {
    border-left: 4px solid var(--accent-gold);
    transition: var(--transition);
}

.feed-item:hover {
    background: rgba(255, 255, 255, 0.02);
}

.feed-user-img img {
    border: 2px solid var(--accent-gold);
    padding: 2px;
}

.feed-actions a {
    transition: var(--transition);
}

.feed-actions a:hover {
    color: var(--accent-gold) !important;
    opacity: 1;
}

.feed-book-preview {
    transition: var(--transition);
}

.feed-book-preview:hover {
    background: rgba(212, 175, 55, 0.1) !important;
}

.badge-cozy {
    background: rgba(212, 175, 55, 0.1);
    color: var(--accent-gold);
    border: 1px solid rgba(212, 175, 55, 0.3);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: bold;
}


/* =========================================
   10. SOCIAL FEED
   ========================================= */
.feed-item {
    border-left: 4px solid var(--accent-gold);
    transition: var(--transition);
}

.feed-item:hover {
    background: rgba(255, 255, 255, 0.02);
}

.feed-user-img img {
    border: 2px solid var(--accent-gold);
    padding: 2px;
}

.feed-actions a {
    transition: var(--transition);
}

.feed-actions a:hover {
    color: var(--accent-gold) !important;
    opacity: 1;
}

.feed-book-preview {
    transition: var(--transition);
}

.feed-book-preview:hover {
    background: rgba(212, 175, 55, 0.1) !important;
}

.badge-cozy {
    background: rgba(212, 175, 55, 0.1);
    color: var(--accent-gold);
    border: 1px solid rgba(212, 175, 55, 0.3);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: bold;
}

/* =========================================
   13. MODALES
   ========================================= */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1050;
    padding: 1rem;
}

.modal-content-custom {
    background: var(--bg-card);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 20px;
    padding: 2rem;
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 30px 60px rgba(0,0,0,0.7);
}

/* =========================================
   14. BINGO LITERARIO
   ========================================= */
.bingo-square {
    background: var(--bg-card);
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 80px;
    padding: 0.5rem;
}

.bingo-square:hover:not(:disabled) {
    border-color: var(--accent-gold);
    background: rgba(212, 175, 55, 0.05);
    transform: scale(1.03);
}

.bingo-square.completed {
    background: rgba(212, 175, 55, 0.15);
    border-color: var(--accent-gold);
    box-shadow: 0 0 12px rgba(212, 175, 55, 0.3);
}

.bingo-square .bingo-text {
    font-size: 0.65rem;
    color: var(--text-muted);
    line-height: 1.2;
}

.bingo-square.completed .bingo-text {
    color: var(--accent-gold);
}

/* =========================================
   15. CUENTO COMUNITARIO
   ========================================= */
.book-container {
    background: #fff9f0;
    border-radius: 16px;
    padding: 2rem;
    color: #2c1810;
    font-family: 'Georgia', serif;
}

.fragmento {
    border-left: 4px solid var(--accent-gold);
    padding: 1.5rem 1.5rem 1.5rem 2rem;
    margin-bottom: 1.5rem;
}

.fragmento-meta {
    font-size: 0.8rem;
    color: #7a5c4a;
    margin-bottom: 0.75rem;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

.fragmento-texto {
    line-height: 1.9;
    font-size: 1rem;
    color: #2c1810;
    white-space: pre-wrap;
}

/* Bingo hover (no clase CSS bingo-square) */
.bingo-hover:hover {
    border-color: var(--accent-gold) !important;
    background: rgba(212, 175, 55, 0.06) !important;
    transform: scale(1.04);
}

/* =========================================
   16. SKELETON LOADERS
   ========================================= */
@keyframes skel-pulse {
    0%, 100% { opacity: 0.35; }
    50%       { opacity: 0.7;  }
}

.skel {
    background: rgba(212, 175, 55, 0.1);
    border-radius: 8px;
    animation: skel-pulse 1.6s ease-in-out infinite;
}

.skel-dark {
    background: rgba(255, 255, 255, 0.07);
    border-radius: 8px;
    animation: skel-pulse 1.6s ease-in-out infinite;
}

.skel-circle {
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.07);
    animation: skel-pulse 1.6s ease-in-out infinite;
    flex-shrink: 0;
}

/* =========================================
   17. RESPONSIVE MOBILE
   ========================================= */

/* --- Header: estado base (desktop) --- */
.header-nav-desktop  { display: block; }
.header-hamburger    { display: none !important; }
.header-badge-hide-sm { display: inline-flex; }
.header-perfil-desktop { display: inline-flex !important; }
.header-salir-desktop  { display: inline-block !important; }

/* Tablet / mobile: ≤ 768px */
@media (max-width: 768px) {
    /* Menú hamburguesa */
    .header-nav-desktop    { display: none !important; }
    .header-hamburger      { display: block !important; }
    .header-badge-hide-sm  { display: none !important; }
    .header-perfil-desktop { display: none !important; }
    .header-salir-desktop  { display: none !important; }

    /* Hero landing */
    .hero-section {
        padding: 80px 0 60px;
        min-height: auto;
        background-attachment: scroll !important;
    }
    .hero-content h1 { font-size: 2.8rem; }
    .hero-content p  { font-size: 1.1rem; margin-bottom: 2rem; }
    .hero-btns {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }
    .btn-main,
    .btn-secondary {
        width: 100%;
        text-align: center;
        padding: 1rem 1.5rem;
        font-size: 1rem;
    }

    /* Auth pages — fix iOS fixed background */
    .auth-page {
        background-attachment: scroll !important;
        padding: 1.5rem 1rem;
    }
    .auth-content {
        padding: 2rem 1.5rem;
    }
    .auth-form-container h1 { font-size: 1.9rem; }
    .auth-header { margin-bottom: 1.5rem; }

    /* Perfil */
    .perfil-layout { grid-template-columns: 1fr; }
    .user-name     { font-size: 1.4rem; }

    /* Library header */
    .library-header { padding: 36px 0; }

    /* Cards y modales */
    .card { padding: 1.2rem; }
    .modal-content-custom { padding: 1.5rem; }

    /* Contenedor global */
    .container {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
}

/* Pantallas muy pequeñas: ≤ 480px */
@media (max-width: 480px) {
    /* Hero */
    .hero-section { padding: 60px 0 40px; }
    .hero-content h1 { font-size: 1.9rem; line-height: 1.1; }
    .hero-content p  { font-size: 0.95rem; }

    /* Auth */
    .auth-content { padding: 1.5rem 1.2rem; }
    .auth-form-container h1 { font-size: 1.5rem; }
    .btn-auth { padding: 1rem; font-size: 1rem; }

    /* Bingo: casillas más compactas */
    .bingo-grid { gap: 0.4rem !important; }
    .bingo-square {
        min-height: 56px;
        padding: 0.25rem;
        border-radius: 8px;
    }
    .bingo-square .bingo-text { font-size: 0.52rem; }

    /* Stat cards (home) */
    .stat-card  { padding: 12px; gap: 10px; }
    .stat-value { font-size: 1.3rem; }
    .stat-icon  { width: 36px; height: 36px; font-size: 1rem; }

    /* Contenedor */
    .container {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }

    /* Tabs de perfil/bingo */
    .tab-btn { padding: 10px 6px; font-size: 0.78rem; }

    /* Modal */
    .modal-content-custom { padding: 1.25rem; border-radius: 16px; }
}


.lector-row:hover { background: rgba(255,255,255,0.07) !important; }

/* ── Misiones glow badge ── */
@keyframes mision-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(212,175,55,0.85), 0 0 8px rgba(212,175,55,0.5); }
  60%  { box-shadow: 0 0 0 7px rgba(212,175,55,0), 0 0 14px rgba(212,175,55,0.2); }
  100% { box-shadow: 0 0 0 0 rgba(212,175,55,0), 0 0 8px rgba(212,175,55,0.5); }
}
.mision-glow-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: linear-gradient(135deg, #d4af37, #f1c40f);
  font-size: 0.55rem;
  font-weight: 900;
  color: #000;
  margin-left: 4px;
  animation: mision-pulse 1.4s ease-in-out infinite;
  vertical-align: middle;
  flex-shrink: 0;
}
.nav-mision-glow {
  color: #d4af37 !important;
  text-shadow: 0 0 10px rgba(212,175,55,0.6);
}

@keyframes hoy-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(124,58,237,0.7); }
  50%       { box-shadow: 0 0 0 5px rgba(124,58,237,0); }
}

/* ══════════════════════════════════════════
   CORRECCIONES RESPONSIVE — MOBILE FIRST
   ══════════════════════════════════════════ */

/* ── Tabs con scroll horizontal (ranking, misiones, biblioteca) ── */
.tabs-scroll-x {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 2px;
}
.tabs-scroll-x::-webkit-scrollbar { display: none; }
.tabs-scroll-x > * { flex-shrink: 0; }

/* ── Touch targets mínimos (44px WCAG) en móvil ── */
@media (max-width: 768px) {
  .btn, button:not([style*="font-size: 0.5"]):not([style*="font-size: 0.6"]) {
    min-height: 40px;
  }
  .btn-sm { min-height: 38px; }
}

/* ── Ranking ── */
@media (max-width: 768px) {
  /* Hero: padding reducido en mobile */
  .ranking-hero { padding: 2rem 0 1.5rem !important; }

  /* Stats grid: quitamos el marginLeft auto para que ocupe todo el ancho en mobile */
  .ranking-stats-grid { max-width: 100% !important; margin-left: 0 !important; }
}

@media (max-width: 576px) {
  /* Stats grid hero: 2 col → 1 col */
  .ranking-stats-grid {
    grid-template-columns: 1fr 1fr !important;
    max-width: 100% !important;
    margin-left: 0 !important;
  }

  /* Ocultar columna secundaria "pts" en pantallas muy chicas */
  .ranking-pts-col { display: none; }

  /* Ocultar badge "amigo" en texto para no desborder username */
  .ranking-amigo-badge { display: none; }

  /* Badge liga oculto en texto secundario */
  .ranking-liga-badge { display: none; }

  /* Stats section: un solo item visible */
  .ranking-row-stats { gap: 0.4rem !important; }

  /* Padding reducido en hero del ranking */
  .ranking-hero-progress { max-width: 100% !important; }
}

/* ── Misiones ── */
@media (max-width: 576px) {
  /* Grid de misiones: min 240px para caber en 390px */
  .misiones-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)) !important;
  }

  /* Hero stats: wrap en columna */
  .misiones-hero-stats {
    flex-direction: column !important;
    align-items: stretch !important;
  }
  .misiones-hero-stats > div {
    padding: 0.75rem !important;
  }
}

/* ── Biblioteca ── */
@media (max-width: 576px) {
  /* Grid de libros: mínimo menor para que quepan 2 en 390px */
  .biblioteca-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)) !important;
  }
}

/* ── Perfil — grids multicol → 1 col en móvil ── */
@media (max-width: 640px) {
  .perfil-datos-grid,
  .perfil-logros-grid,
  .perfil-wrapped-grid {
    grid-template-columns: 1fr !important;
  }

  /* Libros favoritos — scroll horizontal ya correcto */
  .perfil-favoritos-scroll {
    padding-bottom: 0.5rem;
    scrollbar-width: none;
  }
  .perfil-favoritos-scroll::-webkit-scrollbar { display: none; }
}

/* ── Ranking tabs — wrap en desktop, scroll en móvil ── */
.ranking-tabs { flex-wrap: wrap; }
@media (max-width: 768px) {
  .ranking-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
  }
  .ranking-tabs::-webkit-scrollbar { display: none; }
  .ranking-tabs > * { flex-shrink: 0; }
}

/* ── Dropdown "Hoy" — no desborda el viewport en pantallas pequeñas ── */
@media (max-width: 480px) {
  .hoy-dropdown {
    position: fixed !important;
    top: 60px !important;
    left: 0.75rem !important;
    right: 0.75rem !important;
    width: auto !important;
    max-height: calc(100vh - 70px);
    overflow-y: auto;
  }
}

/* ── Arena sala cards — badges no tapan el botón en mobile ── */
@media (max-width: 576px) {
  .arena-sala-card {
    padding-top: 2.75rem !important;
  }
}

/* ── Modal responsive (biblioteca agregar libro) ── */
@media (max-width: 576px) {
  .modal-dialog { margin: 0.5rem !important; }
  .modal-dialog.modal-lg { max-width: calc(100vw - 1rem) !important; }
}

/* ── Toasts — no desbordar el viewport en mobile ── */
@media (max-width: 576px) {
  .lr-toast {
    right: 0.75rem !important;
    left: auto !important;
    max-width: calc(100vw - 1.5rem) !important;
  }
}

/* ── Hero sections — padding reducido en móvil ── */
@media (max-width: 576px) {
  .container { padding-left: 0.75rem !important; padding-right: 0.75rem !important; }
}

/* ── Features grid 3 col → 1 col ── */
@media (max-width: 768px) {
  .features-grid { grid-template-columns: 1fr !important; }
  .game-preview  { grid-template-columns: 1fr !important; gap: 2rem !important; }
}

/* ── Bingo — casillas más compactas en 390px ── */
@media (max-width: 420px) {
  .bingo-square { min-height: 52px !important; }
  .bingo-square .bingo-text { font-size: 0.48rem !important; }
}

/* =========================================
   MOBILE — COLECCIÓN
   ========================================= */
@media (max-width: 640px) {
  /* Layout: sidebar arriba, contenido abajo */
  .coleccion-layout {
    flex-direction: column !important;
    gap: 0.75rem !important;
  }

  /* Sidebar horizontal scrolleable */
  .coleccion-sidebar {
    width: 100% !important;
    position: static !important;
    flex-direction: row !important;
    display: flex !important;
    overflow-x: auto !important;
    overflow-y: visible !important;
    padding: 0.5rem 0.75rem !important;
    gap: 0.4rem;
    scrollbar-width: none;
    -ms-overflow-style: none;
    border-radius: 12px !important;
  }
  .coleccion-sidebar::-webkit-scrollbar { display: none; }

  /* El párrafo "Álbumes" se oculta en mobile */
  .coleccion-sidebar > p { display: none !important; }

  /* Botones del sidebar: chips horizontales */
  .coleccion-sidebar > button {
    flex-shrink: 0 !important;
    width: auto !important;
    white-space: nowrap;
    padding: 0.35rem 0.75rem !important;
    border-radius: 20px !important;
    border: 1px solid rgba(255,255,255,0.1) !important;
    background: rgba(255,255,255,0.05) !important;
    color: rgba(255,255,255,0.65) !important;
    font-size: 0.72rem !important;
    gap: 5px !important;
    margin-bottom: 0 !important;
  }

  /* Ocultar el contador X/Y en los chips del sidebar mobile */
  .coleccion-sidebar > button > span:last-child { display: none; }

  /* Sección de colección mobile */
  .coleccion-seccion { overflow: hidden; }
}
