/* FUENTES */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@700&family=Marcellus&display=swap');

.modulo-descargas-rpg {
    background-color: #050505; /* Forzamos fondo oscuro si el body es blanco */
    padding: 100px 20px;
    min-height: 80vh;
    font-family: 'Marcellus', serif;
}

.wrapper-rpg {
    max-width: 1000px;
    margin: 0 auto;
}

.main-title-rpg {
    font-family: 'Cinzel', serif;
    font-size: 3.5rem;
    color: #fff;
    text-align: center;
    margin-bottom: 10px;
    text-shadow: 0 0 20px rgba(126, 34, 206, 0.8);
}

.gold-text { color: #e5c07b; }

.sub-title-rpg {
    color: #d1cae8;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 4px;
    margin-bottom: 50px;
}

/* GRID */
.grid-rpg {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
}

/* TARJETAS */
.card-rpg {
    background: #0a0a0a;
    border: 1px solid #7e22ce;
    width: 400px;
    padding: 40px;
    text-align: center;
    position: relative;
    clip-path: polygon(0% 20px, 20px 0%, calc(100% - 20px) 0%, 100% 20px, 100% calc(100% - 20px), calc(100% - 20px) 100%, 20px 100%, 0% calc(100% - 20px));
}

.item-name-rpg {
    font-family: 'Cinzel', serif;
    color: #e5c07b;
    font-size: 1.8rem;
    margin: 15px 0;
}

.item-desc-rpg { color: #d1cae8; margin-bottom: 30px; }

/* BOTÓN */
.btn-rpg {
    display: block;
    background: #000;
    color: #e5c07b !important;
    border: 1px solid #c5a059;
    padding: 15px;
    text-decoration: none;
    font-family: 'Cinzel', serif;
    transition: 0.3s;
}

.btn-rpg:hover {
    background: #c5a059;
    color: #000 !important;
}

.icon-rpg { color: #e5c07b; font-size: 3rem; }

/* ============================================================
   ESTILOS UNIFICADOS: HORARIOS Y DESCARGAS
   ============================================================ */

/* Forzar Fondo Oscuro en todo el cuerpo */
body, html {
    background-color: #050505 !important;
    margin: 0;
    padding: 0;
}

/* Contenedor Principal */
.modulo-seccion-rpg {
    padding: 120px 20px;
    background: transparent;
}

.wrapper-rpg {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

/* Tipografía y Colores de Títulos */
.titulo-rpg {
    font-family: 'Cinzel', serif !important;
    font-size: 3.5rem;
    color: #ffffff;
    text-transform: uppercase;
    text-shadow: 0 0 20px rgba(126, 34, 206, 0.7);
    margin-bottom: 10px;
}

.titulo-rpg .oro {
    color: #e5c07b !important;
}

.subtitulo-rpg {
    font-family: 'Marcellus', serif;
    color: #a855f7; /* Morado */
    text-transform: uppercase;
    letter-spacing: 4px;
    font-size: 0.8rem;
    margin-bottom: 60px;
}

/* Botones de Filtro Estilo RPG */
.filtros-rpg-container { display: flex; justify-content: center; margin-bottom: 50px; }
.filtros-rpg-box {
    background: rgba(126, 34, 206, 0.1);
    padding: 6px;
    border-radius: 12px;
    border: 1px solid rgba(126, 34, 206, 0.3);
}

.rpg-filter-btn {
    background: transparent;
    border: none;
    color: #888;
    padding: 10px 25px;
    font-family: 'Cinzel', serif;
    font-size: 0.75rem;
    cursor: pointer;
    text-transform: uppercase;
    transition: 0.3s;
}

.rpg-filter-btn.active {
    background: #7e22ce; /* Púrpura */
    color: #e5c07b; /* Oro */
    border-radius: 8px;
    box-shadow: 0 0 15px rgba(126, 34, 206, 0.5);
}

/* Rejilla de Tarjetas */
.grid-rpg-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 40px;
}

/* EL RECUADRO CON CORTE (Igual al de Descargas) */
.card-rpg-cut {
    background: rgba(10, 10, 12, 0.95);
    border: 1px solid rgba(126, 34, 206, 0.3);
    position: relative;
    transition: all 0.4s ease;
    clip-path: polygon(0% 20px, 20px 0%, calc(100% - 20px) 0%, 100% 20px, 100% calc(100% - 20px), calc(100% - 20px) 100%, 20px 100%, 0% calc(100% - 20px));
}

.card-rpg-item:hover .card-rpg-cut {
    border-color: #e5c07b;
    transform: translateY(-8px);
    box-shadow: 0 0 30px rgba(126, 34, 206, 0.3);
}

/* Header de la Tarjeta */
.card-rpg-header { height: 160px; position: relative; overflow: hidden; border-bottom: 1px solid rgba(126, 34, 206, 0.2); }
.img-header { width: 100%; height: 100%; object-fit: cover; opacity: 0.5; transition: 0.7s; }
.card-rpg-item:hover .img-header { transform: scale(1.1); opacity: 0.8; }
.img-overlay { position: absolute; inset: 0; background: linear-gradient(to top, #0a0a0c, transparent); }

.tipo-badge {
    position: absolute; top: 15px; right: 15px;
    background: #7e22ce; color: #fff; font-size: 9px; padding: 5px 12px;
    border-radius: 4px; border: 1px solid #e5c07b; font-weight: bold;
}

/* Contenido */
.card-rpg-content { padding: 30px; text-align: left; }
.item-name { font-family: 'Cinzel', serif; color: #fff; font-size: 1.6rem; margin-bottom: 20px; text-transform: uppercase; }

/* Recompensas / Drops */
.recompensas-box { margin-bottom: 25px; }
.label-recompensas { font-size: 8px; color: #666; text-transform: uppercase; letter-spacing: 2px; margin-bottom: 10px; }
.drops-flex { display: flex; gap: 10px; }
.drop-slot { width: 48px; height: 48px; background: rgba(255,255,255,0.05); border-radius: 8px; padding: 6px; }
.drop-slot img { width: 100%; height: 100%; object-fit: contain; }

/* Resplandores de Recompensas */
.glow-excellent { border: 1px solid #00ffcc; box-shadow: 0 0 10px #00ffcc44; }
.glow-ancient { border: 1px solid #ffcc00; box-shadow: 0 0 10px #ffcc0044; }
.glow-boss { border: 1px solid #990000; box-shadow: 0 0 10px #99000066; }

/* Timer Púrpura y Oro */
.timer-rpg-display { display: flex; gap: 12px; margin-bottom: 25px; }
.t-unit {
    flex: 1; background: rgba(126, 34, 206, 0.05);
    border: 1px solid rgba(126, 34, 206, 0.2);
    padding: 10px; border-radius: 10px; text-align: center;
}
.t-unit .value { display: block; font-size: 1.4rem; font-weight: bold; color: #fff; }
.t-unit .label { font-size: 7px; color: #a855f7; text-transform: uppercase; }
.oro-border { border-color: #e5c07b; }
.oro-border .value { color: #e5c07b; }

/* Tags de Horarios */
.horarios-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: 9px; background: rgba(255,255,255,0.03); color: #555; padding: 4px 10px; border-radius: 4px; border: 1px solid rgba(255,255,255,0.05); }

/* --- ADICIONALES PARA MÓDULO DE GUÍAS --- */

/* Buscador RPG */
.rpg-search-container {
    max-width: 600px;
    margin: 0 auto 30px auto;
}

.rpg-search-box {
    position: relative;
    background: rgba(126, 34, 206, 0.05);
    border: 1px solid rgba(126, 34, 206, 0.3);
    border-radius: 15px;
    padding: 5px;
}

.rpg-search-box input {
    width: 100%;
    background: transparent;
    border: none;
    padding: 15px 20px;
    color: white;
    font-family: 'Marcellus', serif;
    outline: none;
}

.rpg-search-box input::placeholder { color: rgba(168, 85, 247, 0.4); }

/* Texto de la Guía en Card */
.guide-excerpt {
    font-size: 0.85rem;
    color: #888;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 20px;
}

.btn-leer-mas {
    color: #e5c07b;
    font-family: 'Cinzel', serif;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    border-bottom: 1px solid #e5c07b;
    display: inline-block;
}

/* MODAL RPG */
.rpg-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.rpg-modal-overlay.hidden { display: none; }

.rpg-modal-container {
    background: #0a0a0c;
    width: 100%;
    max-width: 1100px;
    height: 85vh;
    border: 1px solid #7e22ce;
    position: relative;
    clip-path: polygon(0% 40px, 40px 0%, calc(100% - 40px) 0%, 100% 40px, 100% calc(100% - 40px), calc(100% - 40px) 100%, 40px 100%, 0% calc(100% - 40px));
}

.rpg-modal-close {
    position: absolute;
    top: 20px;
    right: 40px;
    background: #7e22ce;
    color: white;
    border: 1px solid #e5c07b;
    width: 40px;
    height: 40px;
    cursor: pointer;
    z-index: 10;
    font-size: 1.5rem;
}

.rpg-modal-body {
    display: flex;
    height: 100%;
    flex-direction: row;
}

.rpg-modal-aside {
    width: 40%;
    position: relative;
    border-right: 1px solid rgba(126, 34, 206, 0.3);
}

.rpg-modal-aside img { width: 100%; height: 100%; object-fit: cover; opacity: 0.4; }
.aside-overlay { position: absolute; inset: 0; background: linear-gradient(to right, transparent, #0a0a0c); }

.rpg-modal-main {
    width: 60%;
    padding: 60px;
    overflow-y: auto;
}

.titulo-modal {
    font-family: 'Cinzel', serif;
    color: #e5c07b;
    font-size: 3rem;
    margin: 20px 0;
    text-transform: uppercase;
}

.modal-meta {
    font-size: 0.7rem;
    color: #a855f7;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 30px;
    border-bottom: 1px solid rgba(126, 34, 206, 0.2);
    padding-bottom: 15px;
}

.rpg-content-text {
    color: #ccc;
    line-height: 1.8;
    font-family: 'Marcellus', serif;
}

/* Scrollbar Personalizada para el Modal */
.scroll-rpg::-webkit-scrollbar { width: 6px; }
.scroll-rpg::-webkit-scrollbar-track { background: #050505; }
.scroll-rpg::-webkit-scrollbar-thumb { background: #7e22ce; border-radius: 10px; }

/* Responsive */
@media (max-width: 768px) {
    .rpg-modal-body { flex-direction: column; }
    .rpg-modal-aside { width: 100%; height: 200px; }
    .rpg-modal-main { width: 100%; padding: 30px; }
    .aside-overlay { background: linear-gradient(to top, #0a0a0c, transparent); }
}

/* --- ADICIONALES PARA MÓDULO DE RANKINGS --- */

/* Tabs de Navegación */
.rpg-tabs-container {
    margin-bottom: 40px;
    display: flex;
    justify-content: center;
}

.rpg-tabs-scroll {
    display: flex;
    gap: 10px;
    background: rgba(126, 34, 206, 0.05);
    padding: 8px;
    border-radius: 12px;
    border: 1px solid rgba(126, 34, 206, 0.2);
    flex-wrap: wrap;
    justify-content: center;
}

.rpg-tab-btn {
    background: transparent;
    border: 1px solid transparent;
    color: #666;
    padding: 10px 18px;
    cursor: pointer;
    font-family: 'Cinzel', serif;
    font-size: 0.7rem;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: 0.3s;
    border-radius: 6px;
}

.rpg-tab-btn i { width: 14px; height: 14px; }

.rpg-tab-btn.active {
    background: #7e22ce;
    color: #e5c07b;
    border-color: #e5c07b;
    box-shadow: 0 0 15px rgba(126, 34, 206, 0.4);
}

.rpg-tab-btn:hover:not(.active) {
    color: #fff;
    background: rgba(126, 34, 206, 0.2);
}

/* Tabla de Ranking */
.rpg-ranking-container {
    max-width: 900px;
    margin: 0 auto 50px auto;
}

.rpg-table-body {
    padding: 20px;
    min-height: 500px;
    transition: opacity 0.3s ease;
}

/* Estilos para las filas (Asegúrate de que api_ranking.php use estas clases) */
.rank-row {
    display: flex;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid rgba(126, 34, 206, 0.1);
    transition: 0.3s;
}

.rank-row:hover {
    background: rgba(126, 34, 206, 0.05);
}

/* Paginación RPG */
.rpg-pagination {
    display: flex;
    justify-content: center;
    margin-top: 40px;
}

.pagination-box {
    display: flex;
    align-items: center;
    gap: 25px;
    padding: 10px 30px;
    background: rgba(10, 10, 12, 0.9) !important;
}

.nav-btn {
    background: transparent;
    border: 1px solid rgba(229, 192, 123, 0.3);
    color: #e5c07b;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.3s;
}

.nav-btn:hover:not(:disabled) {
    background: #7e22ce;
    border-color: #e5c07b;
    box-shadow: 0 0 10px #7e22ce;
}

.nav-btn:disabled {
    opacity: 0.2;
    cursor: not-allowed;
}

.page-info { text-align: center; }
.current-page { display: block; font-family: 'Cinzel', serif; color: #fff; font-size: 0.9rem; }
.total-pages { display: block; font-size: 0.6rem; color: #a855f7; text-transform: uppercase; letter-spacing: 1px; }

/* Animación de entrada de filas */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.rank-row { animation: fadeInUp 0.4s ease forwards; }

/* --- APLICACIÓN DE PALETA RPG (PÚRPURA Y DORADO) --- */

/* 1. Fondo del Panel Principal (Simulando Body/Contenedor) */
#user-panel-wrapper, .Modulo_Seccion {
    background-color: #0d0d0d !important; /* Negro muy oscuro o morado casi negro */
}

/* 2. Recuadros de Información (Avatar, Personajes, Mercado, etc.) */
/* Cambiamos el blanco (.glass) por Morado Oscuro */
.glass, .panel-usuario, .card-rpg, .Modulo_Contenido {
    background-color: #1a0b2e !important; /* Púrpura Morado Oscuro */
    border: 2px solid #e5c07b !important; /* Borde Dorado sutil */
    box-shadow: 0 0 15px rgba(126, 34, 206, 0.3) !important; /* Brillo Púrpura suave */
    border-radius: 2rem !important; /* Mantener bordes redondeados */
}

/* 3. Textos Generales (Dentro de los recuadros) */
.glass h2, .glass h3, .glass p, .glass span, .Modulo_Contenido * {
    color: #f3e8ff !important; /* Lavanda muy claro para legibilidad */
}

/* 4. Acentos Dorados (Títulos, Nombres, Resets) */
.glass h2, .glass h3, .text-orange-500, .Modulo_Titulo {
    color: #e5c07b !important; /* Dorado RPG */
    font-family: 'Cinzel', serif !important; /* Opcional: fuente tipo fantasía si la tienes cargada */
}

/* 5. Botones Principales (Añadir Puntos, Vender, Pagar) */
/* Reemplazamos el Naranja por Púrpura Vibrante con Borde Dorado */
.bg-orange-600, .btn-add, .menu-btn.active, .btn-primary-rpg {
    background-color: #7e22ce !important; /* Púrpura Vibrante */
    color: white !important;
    border: 1px solid #e5c07b !important; /* Borde Dorado */
    box-shadow: 0 0 10px rgba(126, 34, 206, 0.5) !important;
    transition: all 0.3s ease;
}

.bg-orange-600:hover, .btn-add:hover {
    background-color: #9333ea !important; /* Púrpura más claro al pasar el mouse */
    box-shadow: 0 0 15px rgba(229, 192, 123, 0.5) !important; /* Brillo Dorado al hover */
}

/* 6. Botones de Menú Lateral (No activos) */
.menu-btn {
    background-color: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid rgba(259, 192, 123, 0.1) !important;
    color: #a855f7 !important; /* Texto Morado */
}

/* 7. Botón "Canjear Código Maestro" (Mantener Dorado Especial) */
.bg-yellow-600 {
    background-color: #e5c07b !important; /* Fondo Dorado */
    color: #1a0b2e !important; /* Texto Morado Oscuro */
    font-weight: 900 !important;
}

/* 8. Botones Secundarios (Reset/MReset - Mantener sutiles) */
button[onclick*="reset"], button[onclick*="mreset"] {
    background-color: #312e81 !important; /* Índigo Oscuro */
    color: #e9d5ff !important;
    border: 1px solid #a855f7 !important;
}

/* 9. Glow de Monedas (Acento Dorado) */
.coin-glow {
    background: linear-gradient(135deg, rgba(229, 192, 123, 0.2) 0%, rgba(26, 11, 46, 0.4) 100%) !important;
    border: 1px solid #e5c07b !important;
    box-shadow: 0 0 20px rgba(229, 192, 123, 0.3) !important;
}

/* Contenedor Principal de Registro */
.glass-mmo {
    background-color: #1a0b2e !important; /* Morado muy oscuro */
    border: 1px solid #e5c07b !important; /* Dorado */
    backdrop-filter: blur(15px);
}

/* Títulos y Etiquetas */
.text-gold, label.text-gold {
    color: #e5c07b !important; /* Dorado Mu */
}

.bg-purple-glow {
    background-color: #7e22ce !important; /* Detalle Morado */
    box-shadow: 0 0 10px #7e22ce;
}

/* Campos de entrada (Inputs) */
.input-mmo {
    background: rgba(0, 0, 0, 0.4) !important;
    border: 1px solid rgba(229, 192, 123, 0.2) !important;
    color: #f3e8ff !important;
}

.input-mmo:focus {
    border-color: #e5c07b !important;
    box-shadow: 0 0 12px rgba(126, 34, 206, 0.5) !important;
    outline: none;
}

/* Botón de Acción */
.btn-register {
    background: linear-gradient(135deg, #7e22ce 0%, #4c1d95 100%) !important;
    border: 1px solid #e5c07b !important;
    color: #e5c07b !important;
    text-shadow: 1px 1px 2px black;
    transition: all 0.3s ease;
}

.btn-register:hover {
    background: #9333ea !important;
    color: white !important;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(126, 34, 206, 0.4) !important;
}