@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@700&family=Metal+Mania&display=swap');

body { margin: 0; overflow: hidden; background: #000; font-family: 'Cinzel', serif; user-select: none; }

/* --- HUD & GAMEPLAY --- */
#hud-layer {
    position: absolute; bottom: 0px; left: 50%; transform: translateX(-50%); 
    display: flex; flex-direction: column; align-items: center;
    pointer-events: none; z-index: 10; width: 800px; height: 300px;
}

.hud-structure {
    position: relative; width: 600px; height: 250px; 
    display: flex; justify-content: center; align-items: flex-end;
    transform: scale(0.80); transform-origin: bottom center; 
}

.hud-frame-img {
    position: absolute; bottom: 0; left: 0; width: 100%; height: 100%;
    z-index: 20; object-fit: contain; filter: drop-shadow(0 0 10px rgba(0,0,0,0.8));
}

.bar-container-vertical {
    position: absolute; bottom: 45px; width: 70px; height: 121px; 
    background: #1a0505; z-index: 15; border-radius: 4px; overflow: hidden;
    box-shadow: inset 0 0 20px #000;
}
#hp-container-box { left: 155px; }
#mana-container-box { right: 155px; }

.vertical-fill {
    position: absolute; bottom: 0; left: 0; width: 100%; height: 100%; 
    transition: height 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
#hp-fill { background: linear-gradient(0deg, #400000, #bd0000, #ff4444); box-shadow: 0 0 15px #ff0000; }
#mana-fill { background: linear-gradient(0deg, #000040, #0000bd, #4444ff); box-shadow: 0 0 15px #0000ff; }

#face-container {
    position: absolute; bottom: 35px; left: 50%; transform: translateX(-50%);
    width: 130px; height: 160px; z-index: 14; background: #000;
    border-radius: 10px; overflow: hidden;
}
#face-img { width: 100%; height: 100%; object-fit: cover; }

#timer-container-top {
    position: absolute; top: -20px; width: 100px; height: 5px;
    background: rgba(0,0,0,0.6); border: 2px solid #554433;
    border-radius: 20px; overflow: hidden; z-index: 25; box-shadow: 0 0 15px rgba(0,0,0,0.8);
}
#timer-fill {
    width: 100%; height: 100%; background: white;
    box-shadow: 0 0 10px 2px gold, inset 0 0 5px #ffaa00; 
    border-radius: 20px; transition: width 0.1s linear;
}

.xp-box-floating {
    position: absolute; left: -120px; bottom: 50px; text-align: right; z-index: 25;
}
.xp-label { font-size: 12px; color: #aaa; letter-spacing: 2px; font-family: 'Cinzel'; display: block;}
.xp-val { font-size: 32px; color: #88ff88; text-shadow: 0 0 10px #00ff00; font-family: 'Cinzel'; font-weight: bold; }

.orb-hud {
    position: absolute; bottom: 250px; right: 20%; width: 120px; height: 120px; 
    background-image: url('imagens/orbe.png'); background-size: contain; background-repeat: no-repeat; background-position: center;
    z-index: 5; pointer-events: none; display: none;
    filter: drop-shadow(0 0 15px rgba(200, 255, 255, 0.8)); animation: floatOrb 3s infinite ease-in-out;
}
@keyframes floatOrb { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-15px); } }

.axe-hud {
    position: absolute; bottom: 180px; right: 12%; width: 100px; height: 100px;
    background-image: url('imagens/machado_orbe.png'); background-size: contain; background-repeat: no-repeat; background-position: center;
    z-index: 6; pointer-events: none; display: none;
    filter: drop-shadow(0 0 10px rgba(100, 0, 0, 0.8)); animation: floatAxe 4s infinite ease-in-out;
}
@keyframes floatAxe { 0%, 100% { transform: translateY(0) rotate(0deg); } 50% { transform: translateY(-10px) rotate(5deg); } }

#hud-bussola-container {
    display: none; position: absolute; top: 20px; left: 50%; transform: translateX(-50%);
    width: 200px; height: 30px; background: rgba(0,0,0,0.5); border: 2px solid #555;
    border-radius: 15px; pointer-events: none; z-index: 20;
}
#seta-bussola {
    position: absolute; top: 50%; left: 50%; width: 40px; height: 40px;
    background-image: url('imagens/seta_bussola.png'); background-size: contain; background-repeat: no-repeat;
    transform: translate(-50%, -50%); border: none;
}

/* --- MENUS --- */
.screen-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(5, 0, 0, 0.95); z-index: 100;
    display: none; flex-direction: column; align-items: center; justify-content: center;
    color: #ddd;
}
#main-menu {
    display: flex;
    background: linear-gradient(rgba(40,10,10,0.7), rgba(0,0,0,1)), url('imagens/bg_menu.jpg');
    background-size: cover; background-position: center;
}
.title-main { 
    font-family: 'Metal Mania', cursive; font-size: 90px; color: #bd0000; margin: 0; 
    text-shadow: 0 0 10px #000, 4px 4px 0px #330000; text-align: center; line-height: 1; letter-spacing: 2px;
}
.subtitle { font-size: 20px; color: #666; margin-bottom: 40px; font-family: monospace; letter-spacing: 5px; }

.menu-btn {
    margin: 10px; padding: 15px 50px; font-size: 24px; font-family: 'Cinzel', serif;
    cursor: pointer; background: rgba(20, 0, 0, 0.8); color: #aaa; 
    border: 2px solid #550000; box-shadow: 0 0 15px rgba(100, 0, 0, 0.3);
    transition: all 0.2s; width: 300px; text-align: center; text-transform: uppercase;
}
.menu-btn:hover { background: #bd0000; color: #000; transform: scale(1.05); box-shadow: 0 0 25px rgba(255, 0, 0, 0.6); border-color: #ff0000; }

/* LOJA (COM GORDURINHA NO FINAL) */
#shop-menu { 
    background: rgba(8, 2, 2, 0.98); 
    justify-content: flex-start; overflow-y: auto;
    padding-top: 50px; padding-bottom: 150px;
}
.shop-grid {
    display: flex; flex-wrap: wrap; justify-content: center; gap: 15px;
    max-width: 1000px; margin-top: 20px;
}
.shop-item {
    background: #1a0a0a; border: 1px solid #441111; padding: 15px;
    display: flex; flex-direction: column; align-items: center; text-align: center;
    transition: background 0.2s; width: 160px;
}
.shop-item:hover { background: #330a0a; border-color: #ff3333; }
.shop-icon { font-size: 30px; margin-bottom: 10px; }
.upgrade-dots { color: #444; font-size: 16px; letter-spacing: 3px; margin: 5px 0; }
.active-dot { color: #bd0000; text-shadow: 0 0 5px #ff0000; }
.maxed-out { color: gold !important; }

@keyframes bloodWave {
    0% { background: radial-gradient(circle, rgba(255,0,0,0) 0%, rgba(50,0,0,0.8) 100%); transform: scale(1); }
    50% { background: radial-gradient(circle, rgba(255,0,0,0.2) 20%, rgba(100,0,0,0.9) 100%); transform: scale(1.02); }
    100% { background: radial-gradient(circle, rgba(255,0,0,0) 0%, rgba(50,0,0,0.8) 100%); transform: scale(1); }
}
.blood-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none; z-index: 150; animation: bloodWave 3s infinite ease-in-out; mix-blend-mode: multiply;
}

#center-msg {
    display:none; position:absolute; top:30%; width:100%; text-align:center; 
    color:#fff; font-size:24px; text-shadow:0 0 10px gold; pointer-events:none; z-index: 50;
}

/* NOVO: MENSAGENS DE EVENTO (NÃO SOMEM COM PAUSA) */
#event-msg {
    display:none; position:absolute; top:15%; width:100%; text-align:center; 
    color:#ffaa00; font-size:30px; text-shadow:0 0 15px red; pointer-events:none; z-index: 60;
    font-family: 'Metal Mania', cursive;
}

.fullscreen-msg {
    display: none; position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(20,0,0,0.95); z-index: 200;
    flex-direction: column; align-items: center; justify-content: center;
    color: #fff; text-align: center;
}
.credits { position: absolute; bottom: 10px; font-size: 12px; color: #555; }

/* --- MANUAL (GRIMÓRIO) --- */
#manual-menu {
    display: none; align-items: center; justify-content: flex-start;
    overflow-y: auto; padding-top: 50px; padding-bottom: 50px;
    background: rgba(10, 5, 5, 0.98);
}
.manual-content {
    width: 800px; max-width: 90%; margin: 0 auto; text-align: center;
    padding-bottom: 150px; 
}
.manual-section { margin-bottom: 40px; border-bottom: 1px solid #441111; padding-bottom: 20px; }
.manual-title {
    font-family: 'Metal Mania', cursive; color: #bd0000; font-size: 40px;
    margin-bottom: 15px; text-shadow: 0 0 10px #000;
}
.lore-text { font-size: 18px; color: #aaa; font-style: italic; margin-bottom: 20px; line-height: 1.6; }
.manual-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 20px; }
.manual-card {
    background: #150505; border: 1px solid #552222; padding: 10px; width: 180px;
    display: flex; flex-direction: column; align-items: center; border-radius: 8px; box-shadow: 0 0 10px rgba(0,0,0,0.5);
}
.manual-img { width: 64px; height: 64px; object-fit: contain; margin-bottom: 10px; filter: drop-shadow(0 0 5px rgba(255,255,255,0.2)); }
.key-badge {
    background: #333; color: #fff; padding: 2px 8px; border-radius: 4px;
    border: 1px solid #666; font-family: monospace; font-weight: bold; margin-right: 5px;
}
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: #1a0505; }
::-webkit-scrollbar-thumb { background: #551111; border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: #881111; }