:root {
    --primary: #d4b192;
    --secondary: #2c3e50;
    --glow-color: #7a6048;
    --border-radius: 8px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Times New Roman', serif;
    padding: 20px;
    margin-top: 60px; /* Espaço para o header fixo */
    background: linear-gradient(135deg, #f5f7fa, #c3cfe2);
    min-height: 100vh;
}

/* ========== NOVO HEADER ========== */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 20px;
    z-index: 1000;
    backdrop-filter: blur(5px);
    border-bottom: 1px solid var(--primary);
}

.menu-icon {
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 22px;
    transition: transform 0.3s;
}

.menu-icon:hover {
    transform: scale(1.1);
}

.menu-icon span {
    display: block;
    width: 100%;
    height: 3px;
    background: var(--primary);
    border-radius: 3px;
    transition: 0.3s;
}

.menu-icon.active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.menu-icon.active span:nth-child(2) {
    opacity: 0;
}

.menu-icon.active span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

.menu {
    position: absolute;
    top: -1500px;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    max-width: 350px;
    background: rgba(44, 62, 80, 0.98);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: var(--border-radius);
    box-shadow: 0 4px 12px rgba(44, 62, 80, 0.98);
    padding: 15px 0;
    opacity: 0;
}

.menu.active {
    top: 65px;
    opacity: 1;
}

.menu ul {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 0 15px;
    list-style: none;
    max-height: 600px; /* Altura máxima */
    overflow-y: auto; /* Scroll apenas quando necessário */
    padding-right: 10px; /* Espaço para a barra de rolagem */
}

.menu-item {
    background: rgba(212, 177, 146, 0.1);
    border-radius: var(--border-radius);
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--primary);
    font-size: 0.95em;
    padding: 0 20px;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.menu-item:hover {
    background: var(--primary);
    color: var(--secondary);
    transform: translateY(-2px);
    border-color: var(--secondary);
    box-shadow: 0 3px 8px rgba(122, 96, 72, 0.4);
}

.menu-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: var(--border-radius);
    background: radial-gradient(circle at center, 
               rgba(212, 177, 146, 0.2) 0%, 
               transparent 70%);
    opacity: 0;
    transition: opacity 0.3s;
}

.menu-item:hover::before {
    opacity: 1;
}

.container {
    flex: 1;
    max-width: 600px;
    margin: 0 auto;
    padding: 15px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    box-sizing: border-box;
}

h1 {
    text-align: center;
    margin: 15px 0;
    font-size: 2rem;
}

.tradition-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
    gap: 6px;
    margin: 15px 0;
}

.tradition-btn {
    background: var(--secondary);
    border: 1px solid var(--primary);
    color: var(--primary);
    padding: 8px;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

.tradition-btn.active {
    background: var(--primary);
    color: var(--secondary);
}

.question-box {
    margin: 15px 0;
}

textarea {
    width: 100%;
    box-sizing: border-box;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--primary);
    color: #2c3e50;
    border-radius: 8px;
    padding: 12px;
    font-size: 1rem;
    min-height: 80px;
    resize: vertical;
    margin: 0;
}

.consult-btn {
    width: 100%;
    margin-top: 10px;
    background: var(--primary);
    color: var(--secondary);
    padding: 12px;
    border-radius: 8px;
    font-weight: bold;
}

#pendulum-screen {
    position: relative;
    height: 60vh;
    max-height: 400px;
}

#pendulum-container {
    position: relative;
    height: 50%;
    margin: 10px 0;
}

#pendulum {
    position: absolute;
    left: 50%;
    top: 10%;
    transform-origin: 50% 0;
    animation: pendulum-swing 2s ease-in-out infinite;
}

@keyframes pendulum-swing {
    0%, 100% { transform: rotate(-30deg); }
    50% { transform: rotate(30deg); }
}

.cord {
    width: 2px;
    height: 150px;
    background: var(--primary);
    margin: 0 auto;
}

.weight {
    width: 25px;
    height: 25px;
    background: var(--secondary);
    border: 2px solid var(--primary);
    border-radius: 50%;
    margin-top: -12px;
}

.divination-ring {
    position: absolute;
    width: 160px;
    height: 160px;
    left: calc(50% - 80px);
    top: calc(50% - 80px);
    border: 1px solid var(--primary);
    border-radius: 50%;
    opacity: 0.5;
}

.rune {
    position: absolute;
    font-size: 1.2rem;
}

.rune:nth-child(1) { top: 5%; left: 46%; }
.rune:nth-child(2) { top: 46%; right: 5%; }
.rune:nth-child(3) { bottom: 5%; left: 46%; }
.rune:nth-child(4) { top: 46%; left: 5%; }

.status-bar {
    text-align: center;
    margin: 15px 0;
}

.loading-dots {
    display: inline-block;
    margin: 10px;
}
.loading-dots::after {
    content: '...';
    animation: dots 1.5s infinite;
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

.result-grid {
    display: grid;
    gap: 12px;
    margin: 20px 0;
}

.result-card {
    background: rgba(0,0,0,0.2);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid var(--primary);
}

.element-tag {
    background: var(--primary);
    color: var(--secondary);
    padding: 4px 12px;
    border-radius: 15px;
    display: inline-block;
    font-size: 0.9rem;
}

.reset-btn {
    width: 100%;
    background: var(--primary);
    color: var(--secondary);
    padding: 12px;
    border-radius: 8px;
    margin-top: 15px;
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }
    
    h1 {
        font-size: 1.6rem;
    }
    
    .tradition-btn {
        font-size: 0.8rem;
        padding: 6px;
    }
    
    textarea {
        font-size: 0.9rem;
        min-height: 70px;
    }
    
    #pendulum-screen {
        height: 50vh;
    }
}
