:root {
    --bg-main: #0a0f18;
    --bg-card: rgba(15, 23, 42, 0.8);
    --border-color: rgba(255, 255, 255, 0.1);
    --text-main: #ffffff;
    --text-muted: #94a3b8;
    --primary: #0ea5e9;
    --accent: #f59e0b;
    --danger: #ef4444;
    --success: #10b981;
}

body {
    background-color: var(--bg-main);
    background-image: radial-gradient(circle at top right, #1e293b, transparent),
                      radial-gradient(circle at bottom left, #0f172a, transparent);
    color: var(--text-main);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    min-height: 100vh;
}

.glassmorphism {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.6);
}

.text-white { color: #ffffff !important; text-shadow: 0 0 10px rgba(255,255,255,0.2); }
.text-muted { color: #cbd5e1 !important; } /* Aumentado o brilho do muted */

.card {
    border-radius: 1rem;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    box-shadow: 0 0 20px rgba(14, 165, 233, 0.2);
}

.btn-primary {
    background: linear-gradient(135deg, #0ea5e9, #0284c7);
    border: none;
    font-weight: 700;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(14, 165, 233, 0.4);
}

.btn-primary:active { transform: scale(0.95); }

.table {
    border-collapse: separate;
    border-spacing: 0 8px;
}

.table tr {
    background: rgba(255, 255, 255, 0.03);
}

.table td, .table th {
    border: none;
    padding: 1rem;
}

/* Badge de Recurso Melhorado */
.res-badge {
    padding: 10px 20px;
    border-radius: 12px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border-color);
}

.res-value {
    font-size: 1.5rem;
    font-weight: 800;
    line-height:1;
}

/* Timers */
.countdown {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    letter-spacing: 1px;
}

.village-view {
    height: 500px; /* Aumentado para dar profundidade de base */
    background-size: cover;
    background-position: center bottom; /* Focar na base do deserto */
    border-radius: 2rem;
    position: relative;
    border: 3px solid rgba(14, 165, 233, 0.4);
    overflow: hidden;
    margin-bottom: 2rem;
    box-shadow: 0 20px 50px rgba(0,0,0,0.8);
}

.village-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(10, 15, 24, 0.95));
    padding: 3rem 2.5rem;
}

.table tr {
    background: rgba(15, 23, 42, 0.6); /* Mais escuro para contraste */
}

.animate-glow {
    animation: glow 4s infinite alternate;
}

@keyframes glow {
    from { box-shadow: 0 0 10px rgba(14, 165, 233, 0.1); }
    to { box-shadow: 0 0 25px rgba(14, 165, 233, 0.3); }
}

/* SCANNER EFFECT FOR VILLAGE VIEW */
.scanner-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(to right, transparent, var(--primary), transparent);
    box-shadow: 0 0 15px var(--primary);
    animation: scan 6s linear infinite;
    z-index: 5;
    opacity: 0.5;
}

@keyframes scan {
    0% { top: 0; }
    100% { top: 100%; }
}

/* GLINT EFFECT */
.glint {
    position: relative;
    overflow: hidden;
}

.glint::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.1), transparent);
    transform: rotate(45deg);
    animation: glint 10s infinite;
}

@keyframes glint {
    0% { left: -150%; }
    20% { left: 150%; }
    100% { left: 150%; }
}

/* NAVBAR GLASS */
.navbar {
    background: rgba(10, 15, 24, 0.8) !important;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255,255,255,0.05);
    padding: 1rem 0;
}

.nav-link {
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.85rem;
    padding: 0.5rem 1.2rem !important;
    transition: all 0.3s;
}

.nav-link:hover {
    color: var(--primary) !important;
    text-shadow: 0 0 10px rgba(14, 165, 233, 0.5);
}

.nav-link.active {
    background: rgba(14, 165, 233, 0.1);
    border-radius: 50px;
}

/* CUSTOM BUTTONS */
.btn-xs {
    padding: 0.25rem 0.6rem;
    font-size: 0.65rem;
}

.fw-black { font-weight: 900; }
.ls-1 { letter-spacing: 1px; }

/* HOVER EFFECTS */
.bg-hover-white\/5:hover {
    background: rgba(255,255,255,0.05) !important;
}

.transition-all {
    transition: all 0.2s ease-in-out;
}

/* RESPONSIVE DEFENSE: MOBILE OPTIMIZATIONS */
@media (max-width: 768px) {
    .village-view {
        height: 300px;
    }
    
    .village-overlay {
        padding: 1.5rem 1rem;
    }

    .display-5 {
        font-size: 2rem;
    }

    /* Transformar tabelas em Cards Mobile */
    .table thead {
        display: none;
    }

    .table, .table tbody, .table tr, .table td {
        display: block;
        width: 100%;
    }

    .table tr {
        margin-bottom: 1rem;
        border: 1px solid var(--border-color);
        border-radius: 1rem;
        padding: 1rem;
    }

    .table td {
        padding: 0.5rem 0;
        text-align: left !important;
    }

    .table td:last-child {
        border-top: 1px solid rgba(255,255,255,0.05);
        padding-top: 1rem;
        margin-top: 0.5rem;
        text-align: center !important;
    }

    .table td:last-child button, 
    .table td:last-child .btn {
        width: 100%;
    }

    .res-value {
        font-size: 1.2rem;
    }
}
