/*
 * RPG Master — Homepage CSS
 * Estética: GRIMOIRE OBSIDIANA (inspirado em Baldur's Gate 3)
 * Fundo obsidiana escuro, acentos dourados, tipografia medieval
 * ─────────────────────────────────────────────────────────────
 */

@import url('https://fonts.googleapis.com/css2?family=Cinzel+Decorative:wght@400;700;900&family=Cinzel:wght@400;600;700&family=Crimson+Text:ital,wght@0,400;0,600;1,400;1,600&display=swap');

/* ══════════════════════════════════════════════
   DESIGN TOKENS
══════════════════════════════════════════════ */
:root {
    --hp-ouro:    var(--lp-ouro, #c9a84c);
    --hp-ouro-dim:var(--lp-ouro-dim, #8b6914);
    --hp-fundo:   var(--lp-fundo, #0a0704);
    --hp-texto:   var(--lp-texto, #907060);
    --hp-borda:   var(--lp-borda, #1e1608);
    --hp-ft:      var(--lp-ft, 'Cinzel Decorative', serif);
    --hp-fb:      var(--lp-fb, 'Crimson Text', Georgia, serif);
    --hp-fu:      var(--lp-fu, 'Cinzel', serif);

    --g0: #fce89a; --g1: #e8c56a; --g2: #c9a84c; --g3: #9a7832; --g4: #6b4f10; --g5: #3d2c08;
    --b0: #0a0806; --b1: #0f0c08; --b2: #14100a; --b3: #1a1408; --b4: #221c0e; --b5: #2e2510;
    --t0: #f5f5f5; --t1: #e8dcc8; --t2: #c4a87c; --t3: #8a6a48; --t4: #4a3828;

    --glass: rgba(12, 9, 5, 0.92);
    --glass-border: rgba(201, 168, 76, 0.22);
}

/* ══════════════════════════════════════════════
   RESET & BASE
══════════════════════════════════════════════ */
.hp-root {
    position: relative;
    width: 100%;
    overflow-x: hidden;
    background: var(--hp-fundo);
    font-family: var(--hp-fb);
    color: var(--t1);
    font-size: 15px;
    line-height: 1.65;
}
.hp-root *, .hp-root *::before, .hp-root *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* Scrollbar */
.hp-root { scrollbar-width: thin; scrollbar-color: var(--g5) var(--b0); }
.hp-root::-webkit-scrollbar { width: 4px; }
.hp-root::-webkit-scrollbar-track { background: transparent; }
.hp-root::-webkit-scrollbar-thumb { background: var(--g5); border-radius: 2px; }

/* ══════════════════════════════════════════════
   ANIMATIONS
══════════════════════════════════════════════ */
@keyframes fade-in  { from { opacity:0 } to { opacity:1 } }
@keyframes fade-up  { from { opacity:0; transform:translateY(22px) } to { opacity:1; transform:translateY(0) } }
@keyframes float-p  { 0% { opacity:0; transform:translateY(100vh) scale(0) } 6% { opacity:.8 } 94% { opacity:.1 } 100% { opacity:0; transform:translateY(-12vh) scale(1.5) } }
@keyframes runa-pulsar { 0%,100% { opacity:var(--op,0.08); transform:translateY(0) scale(1) } 40% { opacity:calc(var(--op,0.08)*2.5); transform:translateY(-8px) scale(1.1) } 70% { opacity:var(--op,0.08); transform:translateY(3px) scale(0.95) } }
@keyframes nevoa-drift { 0% { transform:scaleX(1) translateY(0) } 50% { transform:scaleX(1.04) translateY(-6px) } 100% { transform:scaleX(0.97) translateY(3px) } }
@keyframes ouro-pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(201,168,76,0) } 50% { box-shadow: 0 0 0 4px rgba(201,168,76,.15) } }

/* ══════════════════════════════════════════════
   PARTICLES & EFFECTS
══════════════════════════════════════════════ */
.hp-particles {
    position: fixed; inset: 0;
    pointer-events: none; z-index: 10; overflow: hidden;
}
.hp-particle {
    position: absolute; opacity: 0;
    border-radius: 50%;
    animation: float-p linear infinite;
}
.hp-runas {
    position: absolute; inset: 0; z-index: 5;
    pointer-events: none; overflow: hidden;
}
.hp-runa {
    position: absolute;
    user-select: none;
    animation: runa-pulsar ease-in-out infinite;
}
.hp-nevoa {
    position: absolute; bottom: 0; left: 0; right: 0; height: 35%;
    z-index: 4; pointer-events: none;
    animation: nevoa-drift 12s ease-in-out infinite alternate;
}

/* ══════════════════════════════════════════════
   HERO SECTION
══════════════════════════════════════════════ */
.hp-hero {
    position: relative;
    min-height: 100vh;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    text-align: center;
    padding: 100px 24px 80px;
    overflow: hidden;
}
.hp-hero::before {
    content: ''; position: absolute; inset: 0; z-index: 0;
    background:
        radial-gradient(ellipse 110% 80% at 50% -10%, rgba(201,168,76,0.05) 0%, transparent 55%),
        radial-gradient(ellipse 70% 90% at 5% 110%, rgba(10,12,26,0.1) 0%, transparent 50%);
}
.hp-hero::after {
    content: ''; position: absolute; inset: 0; z-index: 0;
    background-image:
        repeating-linear-gradient(0deg, transparent, transparent 82px, rgba(201,168,76,0.02) 82px, rgba(201,168,76,0.02) 83px),
        repeating-linear-gradient(90deg, transparent, transparent 82px, rgba(201,168,76,0.02) 82px, rgba(201,168,76,0.02) 83px);
    pointer-events: none;
}
.hp-hero > * { position: relative; z-index: 6; }
.hp-hero-overlay {
    position: absolute; inset: 0; z-index: 1;
    pointer-events: none;
}
.hp-hero-vinheta {
    position: absolute; inset: 0; z-index: 1; pointer-events: none;
    background: radial-gradient(ellipse 120% 120% at 50% 50%, transparent 35%, var(--hp-fundo) 100%);
}

.hp-eyebrow {
    font-family: var(--hp-fu);
    font-size: 11px; letter-spacing: 8px; color: #4a3a2a;
    margin-bottom: 24px;
    animation: fade-in 1s ease both;
}
.hp-title {
    font-family: var(--hp-ft);
    font-weight: 900;
    font-size: clamp(40px, 10vw, 100px);
    color: var(--hp-ouro);
    line-height: 1.05;
    text-shadow: 0 0 80px rgba(201,168,76,0.2), 0 4px 24px rgba(0,0,0,0.6);
    animation: fade-up 1s ease 0.2s both;
    margin-bottom: 10px;
}
.hp-subtitle {
    font-family: var(--hp-fu);
    font-size: clamp(12px, 2vw, 16px);
    color: #6a5a3a; letter-spacing: 5px;
    animation: fade-up 1s ease 0.4s both;
    margin-bottom: 24px;
}
.hp-divider {
    width: 100px; height: 1px;
    margin: 0 auto 32px;
    background: linear-gradient(90deg, transparent, var(--hp-ouro-dim), transparent);
    animation: fade-in 1s ease 0.5s both;
}
.hp-desc {
    max-width: 520; margin: 0 auto 48px;
    font-size: clamp(16px, 2.5vw, 20px);
    color: var(--hp-texto); line-height: 1.8;
    animation: fade-up 1s ease 0.6s both;
}
.hp-cta-btn {
    display: inline-block;
    padding: 18px 52px;
    background: linear-gradient(135deg, #6b4f10, var(--hp-ouro), #8b6914);
    border: 1px solid rgba(201,168,76,0.27);
    border-radius: 12px;
    color: #0a0704;
    font-family: var(--hp-fu);
    font-size: 14px; font-weight: 700; letter-spacing: 4px;
    cursor: pointer; text-decoration: none;
    box-shadow: 0 8px 40px rgba(201,168,76,0.13), 0 2px 8px rgba(0,0,0,0.4);
    animation: fade-up 1s ease 0.8s both;
    transition: transform 0.2s, box-shadow 0.2s;
}
.hp-cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 48px rgba(201,168,76,0.2), 0 4px 12px rgba(0,0,0,0.5);
    color: #0a0704;
}

/* ══════════════════════════════════════════════
   SECTIONS COMMON
══════════════════════════════════════════════ */
.hp-section {
    padding: 80px 24px;
    position: relative;
}
.hp-section-label {
    font-family: var(--hp-fu);
    font-size: 10px; letter-spacing: 6px; color: #4a3a2a;
    text-align: center; margin-bottom: 14px;
    text-transform: uppercase;
}
.hp-section-title {
    font-family: var(--hp-ft);
    color: var(--hp-ouro);
    font-size: clamp(22px, 4vw, 40px);
    text-align: center; margin-bottom: 48px;
}

/* ══════════════════════════════════════════════
   FEATURES
══════════════════════════════════════════════ */
.hp-features-grid {
    max-width: 1000px; margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}
.hp-feature-card {
    background: #120e04;
    border: 1px solid var(--hp-borda);
    border-radius: 14px;
    padding: 28px 24px;
    transition: border-color 0.3s, transform 0.3s;
    cursor: default;
}
.hp-feature-card:hover {
    border-color: var(--hp-ouro-dim);
    transform: translateY(-4px);
}
.hp-feature-icon { font-size: 36px; margin-bottom: 14px; }
.hp-feature-name {
    font-family: var(--hp-fu);
    color: var(--hp-ouro);
    font-size: 14px; letter-spacing: 1px; margin-bottom: 10px;
}
.hp-feature-desc { color: #7a6a4a; font-size: 15px; line-height: 1.7; }

/* ══════════════════════════════════════════════
   CHARACTER SHOWCASE (BG3 Style - Full Hero)
══════════════════════════════════════════════ */
.hp-vitrine {
    padding: 0;
    background: var(--hp-fundo, #0a0806);
    position: relative; overflow: hidden;
    min-height: 80vh;
}
.hp-vitrine-container {
    position: relative;
    min-height: 80vh;
}
/* Avatar as full background */
.hp-char-image-area {
    position: absolute; inset: 0;
    z-index: 1;
}
.hp-char-avatar {
    width: 100%; height: 100%;
    object-fit: cover; object-position: center top;
}
/* Gradient overlays for text readability */
.hp-char-image-area::before {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(90deg, var(--hp-fundo, #0a0806) 0%, rgba(10,7,4,0.85) 30%, rgba(10,7,4,0.15) 60%, transparent 100%);
    z-index: 2; pointer-events: none;
}
.hp-char-image-area::after {
    content: '';
    position: absolute; left: 0; right: 0; bottom: 0; height: 40%;
    background: linear-gradient(180deg, transparent, var(--hp-fundo, #0a0806));
    z-index: 2; pointer-events: none;
}
/* Text info overlay on left */
.hp-char-info {
    position: relative; z-index: 3;
    max-width: 480px;
    padding: 100px 60px 120px;
    display: flex; flex-direction: column; justify-content: center;
    min-height: 70vh;
}
.hp-char-race {
    font-family: var(--hp-fu);
    font-size: 11px; letter-spacing: 5px; color: #8a7a5a;
    margin-bottom: 8px; text-transform: uppercase;
}
.hp-char-name {
    font-family: var(--hp-ft);
    font-size: clamp(32px, 5vw, 56px);
    color: #fff; font-weight: 900;
    line-height: 1.1; margin-bottom: 16px;
    text-shadow: 0 2px 20px rgba(0,0,0,0.8);
}
.hp-char-divider-small {
    width: 60px; height: 2px;
    background: linear-gradient(90deg, var(--hp-ouro), transparent);
    margin-bottom: 20px;
}
.hp-char-backstory {
    color: #c0b090; font-size: 14px; line-height: 1.8;
    display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical;
    overflow: hidden; text-overflow: ellipsis;
    max-height: calc(14px * 1.8 * 4);
    text-shadow: 0 1px 6px rgba(0,0,0,0.6);
}
/* Thumbnails - absolute right side */
.hp-char-thumbs {
    position: absolute; right: 40px; top: 50%; transform: translateY(-50%);
    z-index: 4;
    display: flex; flex-direction: column;
    gap: 12px; align-items: center;
}
.hp-char-thumb {
    width: 80px; height: 80px;
    border: 2px solid rgba(201,168,76,0.25);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s;
}
.hp-char-thumb:hover,
.hp-char-thumb.active {
    border-color: var(--hp-ouro);
    box-shadow: 0 0 20px rgba(201,168,76,0.4);
    transform: scale(1.05);
}
.hp-char-thumb img {
    width: 100%; height: 100%;
    object-fit: cover;
}

/* Stats panel - absolute bottom */
.hp-char-stats {
    position: absolute; bottom: 0; left: 0; right: 0;
    z-index: 5;
    background: rgba(10,8,4,0.7);
    backdrop-filter: blur(8px);
    border-top: 1px solid rgba(201,168,76,0.15);
    padding: 20px 60px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    z-index: 2;
}
.hp-stat-group {
    display: flex; flex-direction: column;
    gap: 4px;
}
.hp-stat-row {
    padding: 12px 0;
    border-bottom: 1px solid rgba(201,168,76,0.1);
}
.hp-stat-row:last-child { border-bottom: none; }
.hp-stat-primary {
    display: flex; align-items: center; gap: 12px;
}
.hp-stat-icon {
    width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    font-size: 24px;
    border: 1px solid var(--g4);
    border-radius: 50%;
    color: var(--hp-ouro);
}
.hp-stat-label {
    font-family: var(--hp-fu);
    font-size: 10px; letter-spacing: 3px; color: var(--t3);
    text-transform: uppercase;
}
.hp-stat-value {
    font-family: var(--hp-fu);
    font-size: 16px; color: var(--t0);
    letter-spacing: 1px; font-weight: 700;
    text-transform: uppercase;
}
.hp-stat-secondary-label {
    font-family: var(--hp-fu);
    font-size: 9px; letter-spacing: 2px; color: var(--t3);
    text-transform: uppercase; margin-bottom: 4px;
}
.hp-stat-secondary-value {
    font-size: 14px; color: var(--t2); line-height: 1.6;
}

/* No characters fallback */
.hp-vitrine-empty {
    text-align: center; padding: 80px 24px;
    color: var(--t4);
}
.hp-vitrine-empty-icon { font-size: 64px; opacity: 0.2; margin-bottom: 16px; }

/* ══════════════════════════════════════════════
   FAQ
══════════════════════════════════════════════ */
.hp-faq { max-width: 700px; margin: 0 auto; }
.hp-faq-item { border-bottom: 1px solid #1a1208; }
.hp-faq-btn {
    width: 100%; text-align: left; padding: 18px 0;
    background: none; border: none; cursor: pointer;
    color: #d4b896; font-family: var(--hp-fb);
    font-size: 16px;
    display: flex; justify-content: space-between; align-items: center; gap: 16px;
    transition: color 0.2s;
}
.hp-faq-btn:hover,
.hp-faq-btn.open { color: var(--hp-ouro); }
.hp-faq-toggle {
    color: var(--hp-ouro); font-size: 20px; flex-shrink: 0;
}
.hp-faq-answer {
    color: #8a7a5a; font-size: 15px; line-height: 1.8;
    padding-bottom: 18px;
    display: none;
}
.hp-faq-answer.open { display: block; }

/* ══════════════════════════════════════════════
   CTA FOOTER
══════════════════════════════════════════════ */
.hp-footer-cta {
    padding: 80px 24px;
    text-align: center;
    background: linear-gradient(180deg, #080503, var(--hp-fundo));
}
.hp-footer-title {
    font-family: var(--hp-ft);
    color: var(--hp-ouro);
    font-size: clamp(20px, 4vw, 36px);
    margin-bottom: 16px;
}
.hp-footer-desc {
    color: #6a5a3a; margin-bottom: 32px; font-size: 16px;
}

/* ══════════════════════════════════════════════
   BG3 CORNER BORDERS (injected via JS)
══════════════════════════════════════════════ */
.hp-bg3-card { position: relative; overflow: visible !important; }
.hp-bg3-card::before,
.hp-bg3-card::after {
    content: ''; position: absolute; pointer-events: none;
    width: 18px; height: 18px;
    border-color: var(--hp-ouro);
    border-style: solid;
    z-index: 10;
    transition: all 0.3s;
}
.hp-bg3-card::before {
    top: -1px; left: -1px;
    border-width: 2px 0 0 2px;
    border-radius: 2px 0 0 0;
    box-shadow: -3px -3px 8px rgba(201,168,76,0.15);
}
.hp-bg3-card::after {
    bottom: -1px; right: -1px;
    border-width: 0 2px 2px 0;
    border-radius: 0 0 2px 0;
    box-shadow: 3px 3px 8px rgba(201,168,76,0.15);
}
.hp-bg3-card:hover::before,
.hp-bg3-card:hover::after {
    width: 26px; height: 26px;
    border-color: var(--g1);
    box-shadow: 0 0 16px rgba(201,168,76,0.6), 0 0 32px rgba(201,168,76,0.3);
}

/* ══════════════════════════════════════════════
   ADVENTURES
══════════════════════════════════════════════ */
.hp-adventures-grid {
    max-width: 1000px; margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}
.hp-adventure-card {
    position: relative; overflow: hidden;
    border-radius: 14px;
    min-height: 240px;
    cursor: pointer;
    border: 1px solid var(--hp-borda);
    transition: border-color 0.3s, transform 0.3s;
}
.hp-adventure-card:hover {
    border-color: var(--hp-ouro-dim);
    transform: translateY(-4px);
}
.hp-adventure-bg {
    position: absolute; inset: 0;
    background: linear-gradient(135deg, #1a0c04, #2a1008, #180808);
}
.hp-adventure-img {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    object-fit: cover; opacity: 0.35;
}
.hp-adventure-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(180deg, transparent 30%, rgba(10,7,4,0.95) 90%);
}
.hp-adventure-content {
    position: relative; z-index: 1;
    padding: 24px;
    display: flex; flex-direction: column;
    justify-content: flex-end;
    height: 100%;
}
.hp-adventure-system {
    font-family: var(--hp-fu);
    font-size: 9px; letter-spacing: 3px; color: var(--t3);
    text-transform: uppercase; margin-bottom: 8px;
}
.hp-adventure-name {
    font-family: var(--hp-ft);
    font-size: 22px; color: var(--t0);
    margin-bottom: 8px;
}
.hp-adventure-tagline {
    font-size: 14px; color: var(--t2); line-height: 1.6;
    margin-bottom: 16px;
}
.hp-adventure-btn {
    display: inline-block;
    padding: 10px 24px;
    background: linear-gradient(135deg, var(--g4), var(--g3));
    border: 1px solid var(--g4);
    border-radius: 8px;
    color: var(--g0);
    font-family: var(--hp-fu);
    font-size: 11px; letter-spacing: 2px;
    text-decoration: none;
    transition: all 0.2s;
    align-self: flex-start;
}
.hp-adventure-btn:hover {
    background: linear-gradient(135deg, var(--g3), var(--g2));
    color: #0a0704;
}

/* ══════════════════════════════════════════════
   NAV HEADER (logged in)
══════════════════════════════════════════════ */
.hp-nav {
    position: fixed; top: 0; left: 0; right: 0;
    z-index: 100;
    padding: 16px 32px;
    display: flex; align-items: center; justify-content: space-between;
    background: linear-gradient(180deg, rgba(10,7,4,0.9), transparent);
    pointer-events: none;
}
.hp-nav > * { pointer-events: all; }
.hp-nav-logo {
    font-family: var(--hp-fu);
    font-size: 14px; letter-spacing: 4px; color: var(--hp-ouro);
    text-decoration: none;
}
.hp-nav-links { display: flex; gap: 16px; align-items: center; }
.hp-nav-link {
    font-family: var(--hp-fu);
    font-size: 11px; letter-spacing: 2px; color: var(--t2);
    text-decoration: none; padding: 8px 16px;
    border: 1px solid transparent;
    border-radius: 6px;
    transition: all 0.2s;
}
.hp-nav-link:hover {
    border-color: var(--glass-border);
    color: var(--hp-ouro);
    background: var(--glass);
}
.hp-nav-link.gold {
    border-color: var(--g4);
    color: var(--g1);
    background: rgba(201,168,76,0.08);
}

/* ══════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════ */
@media (max-width: 768px) {
    /* Vitrine — layout mobile em coluna */
    .hp-vitrine { min-height: auto; }
    .hp-vitrine-container { min-height: auto; display: flex; flex-direction: column; }

    /* Avatar ocupa parte superior — não tela toda */
    .hp-char-image-area {
        position: relative; inset: auto;
        height: 60vw; max-height: 320px;
        overflow: hidden;
    }
    .hp-char-image-area::before {
        background: linear-gradient(180deg, transparent 30%, var(--hp-fundo, #0a0806) 100%);
    }

    /* Info abaixo da imagem, sem position absolute */
    .hp-char-info {
        position: relative; z-index: 3;
        max-width: 100%;
        padding: 20px 20px 16px;
        min-height: auto;
        background: var(--hp-fundo, #0a0806);
    }

    /* Thumbnails em linha horizontal abaixo do texto */
    .hp-char-thumbs {
        position: relative; right: auto; top: auto;
        transform: none;
        flex-direction: row;
        gap: 8px;
        justify-content: flex-start;
        overflow-x: auto;
        padding: 0 20px 12px;
        background: var(--hp-fundo, #0a0806);
        z-index: 3;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .hp-char-thumbs::-webkit-scrollbar { display: none; }
    .hp-char-thumb { width: 52px; height: 52px; flex-shrink: 0; }
    .hp-char-thumb:hover, .hp-char-thumb.active { transform: none; }

    /* Stats abaixo das thumbs */
    .hp-char-stats {
        position: relative; bottom: auto;
        grid-template-columns: 1fr 1fr;
        gap: 0;
        padding: 12px 20px 20px;
        background: var(--hp-fundo, #0a0806);
        border-top: 1px solid rgba(201,168,76,0.1);
    }

    .hp-char-name { font-size: 26px; }
    .hp-char-backstory { -webkit-line-clamp: 3; }

    /* Nav */
    .hp-nav { padding: 10px 16px; }
    .hp-nav-links { gap: 6px; }
    .hp-nav-link { font-size: 11px; padding: 6px 10px; }

    /* Seções */
    .hp-section { padding: 40px 20px; }
    .hp-features-grid { grid-template-columns: 1fr 1fr; gap: 16px; }
    .hp-quests-grid { grid-template-columns: 1fr; }
}

@media (max-width: 420px) {
    .hp-char-stats { grid-template-columns: 1fr; }
    .hp-char-name { font-size: 22px; }
    .hp-features-grid { grid-template-columns: 1fr; }
}
