/* Variables Medievales */
:root {
    --bg-parchment: #f4e4bc;
    --bg-dark-wood: #2d241e;
    --text-ink: #3e2723;
    --accent-gold: #c5a059;
    --accent-red: #8a1c1c;
    --border-color: #8d6e63;
    --font-heading: 'Cinzel', serif; /* Asegúrate de cargar esta fuente en tu Elementor o Theme si no se ve */
    --font-body: 'Lora', serif;
}

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;700&family=Lora:ital,wght@0,400;1,400&display=swap');

.rpg-wrapper { display: flex; flex-wrap: wrap; background-color: var(--bg-dark-wood); border: 4px solid var(--border-color); box-shadow: 0 10px 30px rgba(0,0,0,0.5); min-height: 600px; font-family: var(--font-body); color: var(--text-ink); }
.rpg-sidebar { width: 250px; background: #1a120b; color: var(--accent-gold); border-right: 2px solid var(--border-color); flex-shrink: 0; }
.rpg-sidebar-header { padding: 20px; background: rgba(0,0,0,0.3); text-align: center; border-bottom: 1px solid var(--border-color); }
.rpg-sidebar-header h3 { margin: 0; font-family: var(--font-heading); color: #fff !important; text-transform: uppercase; letter-spacing: 2px; }
.rpg-mission-list { list-style: none; padding: 0; margin: 0; }
.rpg-mission-list li { padding: 15px 20px; border-bottom: 1px solid rgba(141, 110, 99, 0.2); cursor: pointer; transition: all 0.3s; font-family: var(--font-heading); }
.rpg-mission-list li:hover { background: rgba(197, 160, 89, 0.1); padding-left: 25px; color: #fff; }
.rpg-main { flex-grow: 1; background-color: var(--bg-parchment); background-image: url('https://www.transparenttextures.com/patterns/paper-fibers.png'); padding: 30px; position: relative; width: calc(100% - 250px); }
.rpg-empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; color: rgba(62, 39, 35, 0.5); font-size: 1.5rem; }
.rpg-empty-state i { font-size: 4rem; margin-bottom: 20px; }
.rpg-title { font-family: var(--font-heading); font-size: 2.5rem; color: var(--bg-dark-wood); border-bottom: 3px double var(--border-color); padding-bottom: 10px; margin-top: 0; }
.rpg-tabs { margin-bottom: 20px; border-bottom: 2px solid var(--border-color); }
.rpg-tab { background: none; border: none; padding: 10px 20px; font-family: var(--font-heading); font-weight: bold; cursor: pointer; font-size: 1.1rem; color: rgba(62, 39, 35, 0.6); }
.rpg-tab.active { color: var(--text-ink); border-bottom: 3px solid var(--accent-red); }
.tab-content { display: none; animation: fadeIn 0.5s; }
.tab-content.active { display: block; }
.elementor-kit-5 h3 { color: #b42732 !important }

/* Sections */
.rpg-section { margin-bottom: 20px; }
.rpg-section h3 { font-family: var(--font-heading); color: var(--accent-red) !important; font-size: 1.2rem; border-bottom: 1px solid rgba(0,0,0,0.1); }
.rpg-poster-container { background: url('https://www.transparenttextures.com/patterns/wood-pattern.png'), #3e2723; padding: 15px; margin-top: 30px; border-radius: 4px; box-shadow: inset 0 0 20px #000; }
.rpg-poster { background: #e2c792; padding: 30px; text-align: center; border: 2px dashed #5a3a22; position: relative; }
.rpg-poster h4 { font-family: var(--font-heading); font-size: 2rem; margin: 0 0 20px 0; text-transform: uppercase; }
.rpg-poster p { font-style: italic; font-size: 1.2rem; }
.poster-seal { position: absolute; bottom: 10px; right: 20px; font-size: 3rem; color: var(--accent-red); opacity: 0.8; transform: rotate(-15deg); }


/* Accordion */
.accordion-header { background-color: rgba(62, 39, 35, 0.05); color: var(--text-ink); cursor: pointer; padding: 18px; width: 100%; border: none; text-align: left; outline: none; font-size: 1.2rem; transition: 0.4s; border: 1px solid var(--border-color); margin-top: 10px; display: flex; align-items: center; font-family: var(--font-heading); }
.accordion-header:hover { background-color: rgba(62, 39, 35, 0.1); }
.accordion-header.active { background-color: var(--bg-dark-wood); color: #fff; }
.chap-num { background: var(--accent-red); color: #fff; padding: 2px 8px; font-size: 0.8rem; margin-right: 10px; border-radius: 2px; }
.chap-title { flex-grow: 1; font-weight: bold; }
.arrow { transition: transform 0.3s; }
.accordion-header.active .arrow { transform: rotate(180deg); }
.accordion-panel { padding: 0 18px; background-color: rgba(255,255,255,0.3); max-height: 0; overflow: hidden; transition: max-height 0.2s ease-out; border-left: 1px solid var(--border-color); border-right: 1px solid var(--border-color); }
.panel-inner { padding: 20px 0; }
.scene-block { background: rgba(0,0,0,0.05); padding: 15px; border-radius: 4px; display: flex; gap: 15px; margin: 15px 0; }
.scene-text { flex: 1; }
.scene-img img { width: 150px; height: 100px; object-fit: cover; border: 2px solid var(--bg-dark-wood); cursor: zoom-in; }

.entities-grid { display: flex; gap: 20px; margin-top: 20px; }
.ent-col { flex: 1; }

.entity-card {
    background: #fff;
    border: 1px solid rgba(0,0,0,0.1);
    padding: 10px;
    margin-bottom: 15px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.ent-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
}

.ent-img {
    width: 40px; height: 40px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    border: 1px solid #333;
    cursor: pointer;
    flex-shrink: 0;
}

.ent-header strong {
    font-family: var(--font-heading);
    font-size: 1rem;
    color: var(--accent-red);
}

.ent-desc {
    font-size: 0.9rem;
    line-height: 1.5;
    white-space: pre-wrap; /* Esto permite que se vean los párrafos y saltos de línea */
    color: #444;
    background: #fafafa;
    padding: 8px;
    border-radius: 3px;
    border: 1px solid #eee;
}

.rewards-block { margin-top: 20px; border-top: 1px dashed var(--border-color); padding-top: 10px; color: var(--accent-gold); font-weight: bold; background: var(--bg-dark-wood); padding: 10px; border-radius: 4px; }


/* Responsive */
@media (max-width: 768px) {
    .rpg-wrapper { flex-direction: column; }
    .rpg-sidebar { width: 100%; height: auto; border-right: none; border-bottom: 2px solid var(--border-color); }
    .rpg-main { width: 100%; }
    .rpg-mission-list { display: flex; overflow-x: auto; }
    .rpg-mission-list li { white-space: nowrap; }
    .scene-block { flex-direction: column; }
    .scene-img img { width: 100%; height: auto; }
    .entities-grid { flex-direction: column; }
}

.compendium-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 25px;
    padding: 10px;
}

.comp-card {
    background: #fff;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}

.comp-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
}

.comp-img {
    width: 100%;
    height: 200px; /* Imagen grande */
    background-size: cover;
    background-position: top center;
    border-bottom: 2px solid var(--accent-gold);
}

.comp-img-placeholder {
    width: 100%;
    height: 150px;
    background: #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: #aaa;
    border-bottom: 2px solid var(--accent-gold);
}

.comp-info {
    padding: 15px;
    text-align: center;
    background: var(--bg-parchment);
}

.comp-name {
    margin: 0 0 10px 0;
    font-family: var(--font-heading);
    font-size: 1.4rem;
    color: var(--text-ink);
    text-transform: uppercase;
}

.comp-toggle-btn {
    background: var(--bg-dark-wood);
    color: var(--accent-gold);
    border: none;
    padding: 8px 15px;
    cursor: pointer;
    font-family: var(--font-heading);
    font-weight: bold;
    border-radius: 4px;
    width: 100%;
    transition: background 0.3s;
}

.comp-toggle-btn:hover {
    background: var(--accent-red);
    color: white;
}

.comp-details {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out, padding 0.4s;
    background: rgba(255,255,255,0.5);
    margin-top: 10px;
    border-radius: 4px;
    text-align: left;
    border: 1px solid rgba(0,0,0,0.05);
}

.comp-details p {
    margin: 0;
    white-space: pre-wrap;
    font-size: 0.95rem;
    line-height: 1.5;
}

.hidden { display: none; }
@keyframes fadeIn { from { opacity:0; } to { opacity:1; } }