/* ============================================================
   SCRIPTA - Estilos Globais Otimizados v1.1.0
   ============================================================ */

/* 1. Base e Layout */
body { 
    background: #0f172a; 
    color: #f8fafc; 
    font-family: 'Courier New', Courier, monospace; 
    padding: 10px; 
    margin: 0; 
    line-height: 1.5;
    user-select: none; /* Evita selecionar texto por acidente ao clicar nos itens */
}

.container { 
    display: flex; 
    flex-wrap: wrap; 
    gap: 15px; 
    max-width: 1200px; 
    margin: 0 auto; 
}



/* Layout do Mural */
.mural-container {
    display: flex;
    gap: 20px;
    background: rgba(0, 0, 0, 0.4);
    padding: 15px;
    border-radius: 8px;
    align-items: flex-start;
}

.mural-selecao {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mural-select {
    width: 100%;
    background: #000;
    color: #fff;
    border: 1px solid #334155;
    padding: 10px;
    border-radius: 4px;
    font-family: 'Courier New', Courier, monospace;
}

.mural-detalhes {
    flex: 1;
    border-left: 1px solid #334155;
    padding-left: 20px;
}

.detalhe-linha {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    border-bottom: 1px solid rgba(51, 65, 85, 0.5);
    font-size: 13px;
}

.detalhe-label {
    color: #94a3b8;
}

.detalhe-valor {
    color: #fff;
    font-weight: bold;
}

.btn-mural {
    width: 100%;
    background: #1e293b;
    border: 1px solid #475569;
    color: white;
    padding: 8px;
    cursor: pointer;
    font-weight: bold;
    margin-top: 10px;
}

.btn-mural:hover {
    background: #334155;
}



.box { 
    border: 2px solid #334155; 
    padding: 15px; 
    border-radius: 8px; 
    background: #1e293b; 
    flex: 1; 
    min-width: 280px; 
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

/* 2. Navegação */
nav { 
    display: flex; 
    gap: 10px; 
    margin-bottom: 20px; 
    background: #111827; 
    padding: 10px; 
    border-radius: 8px; 
    border: 2px solid #334155; 
    width: 100%;
    box-sizing: border-box;
}

.nav-btn { 
    background: #1e293b; 
    color: #94a3b8; 
    border: 1px solid #334155; 
    padding: 10px 15px; 
    cursor: pointer; 
    border-radius: 4px; 
    font-weight: bold; 
    transition: all 0.2s ease;
    flex: 1;
}

.nav-btn:hover { background: #334155; color: white; }
.nav-btn.active { 
    background: #3b82f6; 
    color: white; 
    border-color: #60a5fa;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
}

/* 3. Status e HP */
.hp-container { 
    background: #000; 
    height: 25px; 
    border-radius: 5px; 
    position: relative; 
    border: 2px solid #334155; 
    margin: 10px 0; 
    overflow: hidden; 
}

#hp-bar { 
    background: linear-gradient(90deg, #b91c1c, #ef4444); 
    width: 100%; 
    height: 100%; 
    transition: width 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); 
}

#hp-text { 
    position: absolute; 
    width: 100%; 
    text-align: center; 
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 12px; 
    font-weight: bold; 
    color: white; 
    text-shadow: 1px 1px 2px black; 
    z-index: 2;
}

/* 4. Inventário e Slots */
.grid-bolsa { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(50px, 1fr)); 
    gap: 8px; 
    margin-top: 10px; 
}

.item-slot-bolsa {
    width: 50px;
    height: 50px;
    background: #0f172a;
    border: 2px solid #475569;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative; /* Importante para as badges */
    transition: 0.2s;
    cursor: pointer;
}

.item-slot-bolsa img {
    max-width: 32px;
    max-height: 32px;
    object-fit: contain;
    image-rendering: pixelated; /* Mantém a arte em pixel art nítida */
}

.item-slot-bolsa:hover { 
    border-color: #fbbf24; 
    background: #1e293b;
    transform: scale(1.05);
}


/* Container do Equipamento para dar destaque */
.slot-equipado-destaque {
    width: 100px; /* Aumentado para destaque */
    height: 100px;
    border: 3px solid #fbbf24; /* Borda mais grossa */
    background: radial-gradient(circle, rgba(251, 191, 36, 0.2) 0%, rgba(30, 41, 59, 0.8) 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px rgba(251, 191, 36, 0.2);
    position: relative;
}

#eq-img {
    width: 80%;
    height: 80%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

/* Efeito de brilho para itens raros/épicos quando equipados */
.slot-equipado-destaque:hover #eq-img {
    transform: scale(1.1);
}



/* Badges e Barras de Durabilidade */
.badge-atk {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ef4444;
    color: white;
    font-size: 10px;
    padding: 1px 4px;
    border-radius: 4px;
    font-weight: bold;
    border: 1px solid #000;
}

.dur-bar-mini { 
    position: absolute; 
    bottom: 2px; 
    left: 4px; 
    right: 4px; 
    height: 4px; 
    background: #000; 
    border-radius: 2px;
    border: 1px solid #334155;
}

.dur-fill-mini { 
    height: 100%; 
    background: #22c55e; 
    transition: width 0.3s ease;
}

/* 5. Mural de Missões */
.mural-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.missao-card {
    background: #111827;
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 12px;
    transition: transform 0.2s;
}

.missao-card:hover {
    border-color: #4b5563;
    background: #1f2937;
}

/* 6. Taberna e Forja */
.taberna-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.item-taberna {
    background: #0f172a;
    border: 2px solid #334155;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: 0.2s;
}

.item-taberna:hover { border-color: #fbbf24; }
.item-taberna strong { color: #fbbf24; }

/* 7. Sistema de Log (O "Chat" do jogo) */
#log { 
    height: 120px; 
    overflow-y: auto; 
    background: #000; 
    padding: 12px; 
    margin-top: 15px; 
    border: 2px solid #334155; 
    color: #4ade80; 
    font-family: 'Consolas', monospace;
    font-size: 12px; 
    border-radius: 6px; 
    width: 100%; 
    box-sizing: border-box;
    box-shadow: inset 0 0 10px rgba(0,255,0,0.1);
}

/* 8. Auxiliares e Botões */
.page { display: none; width: 100%; flex-direction: column; animation: fadeIn 0.3s ease; }
.page.active { display: flex; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

.btn-explorar {
    background: #2563eb;
    color: white;
    border: none;
    padding: 12px;
    border-radius: 6px;
    width: 100%;
    font-weight: bold;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: 0.2s;
}

.btn-explorar:hover:not(:disabled) { 
    background: #3b82f6; 
    filter: brightness(1.1);
}

.btn-explorar:disabled {
    background: #475569;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Responsividade Mobile */
@media (max-width: 600px) {
    .container { flex-direction: column; }
    nav { flex-wrap: wrap; }
    .nav-btn { font-size: 12px; padding: 8px; }
}