/* ==================== RESET E BASE ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Courier New', monospace;
    background: #000;
    overflow: hidden;
    color: #fff;
}

/* ==================== CONTAINER PRINCIPAL ==================== */
#game-container {
    width: 100vw;
    height: 100vh;
    position: relative;
    background: #1a1a1a;
}

/* ==================== CANVAS 3D ==================== */
#game-canvas {
    display: block;
    width: 100%;
    height: 100%;
    image-rendering: pixelated;
    cursor: none;
}

/* ==================== HUD ==================== */
#hud {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 20px;
    background: linear-gradient(180deg, rgba(0,0,0,0.8) 0%, transparent 100%);
    pointer-events: none;
    z-index: 100;
}

#stats {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.stat-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(0,0,0,0.7);
    padding: 8px 15px;
    border-radius: 5px;
    border: 2px solid #444;
}

.stat-label {
    font-weight: bold;
    font-size: 14px;
    min-width: 80px;
}

.bar {
    width: 150px;
    height: 20px;
    background: #222;
    border: 2px solid #555;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.bar-fill {
    height: 100%;
    transition: width 0.3s;
    border-radius: 8px;
}

.stat-bar span:last-child {
    font-size: 12px;
    color: #aaa;
    min-width: 70px;
}

#info {
    position: absolute;
    top: 20px;
    right: 20px;
    text-align: right;
}

#day-time, #location {
    background: rgba(0,0,0,0.7);
    padding: 8px 15px;
    border-radius: 5px;
    border: 2px solid #444;
    margin-bottom: 10px;
    font-size: 14px;
    font-weight: bold;
}

/* ==================== MIRA ==================== */
#crosshair {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 30px;
    color: #fff;
    text-shadow: 0 0 5px #000, 0 0 10px #000;
    pointer-events: none;
    z-index: 50;
    font-weight: bold;
}

/* ==================== INVENTÁRIO ==================== */
#inventory {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    max-width: 90vw;
    background: rgba(0,0,0,0.95);
    border: 3px solid #e67e22;
    border-radius: 10px;
    padding: 20px;
    z-index: 200;
}

#inventory h2 {
    color: #e67e22;
    margin-bottom: 20px;
    text-align: center;
}

#inventory-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.inventory-slot {
    aspect-ratio: 1;
    background: #222;
    border: 2px solid #555;
    border-radius: 5px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    padding: 5px;
}

.inventory-slot:hover {
    background: #333;
    border-color: #e67e22;
}

.inventory-slot.empty {
    opacity: 0.5;
}

.inventory-slot .item-icon {
    font-size: 30px;
    margin-bottom: 5px;
}

.inventory-slot .item-name {
    font-size: 10px;
    text-align: center;
    color: #aaa;
}

.inventory-slot .item-quantity {
    font-size: 12px;
    color: #f39c12;
    font-weight: bold;
}

#item-info {
    background: #1a1a1a;
    padding: 15px;
    border-radius: 5px;
    border: 2px solid #555;
    min-height: 80px;
    margin-bottom: 15px;
    font-size: 14px;
    line-height: 1.6;
}

/* ==================== MENSAGENS ==================== */
#messages {
    position: absolute;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    width: 500px;
    max-width: 90vw;
    pointer-events: none;
    z-index: 150;
}

.message {
    background: rgba(0,0,0,0.8);
    padding: 10px 20px;
    border-radius: 5px;
    margin-bottom: 10px;
    border-left: 4px solid #3498db;
    animation: slideIn 0.3s;
}

.message.warning {
    border-left-color: #f39c12;
}

.message.danger {
    border-left-color: #e74c3c;
}

.message.success {
    border-left-color: #2ecc71;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==================== BOTÕES ==================== */
.btn {
    padding: 12px 30px;
    font-size: 16px;
    font-weight: bold;
    font-family: inherit;
    border: 3px solid #fff;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    background: #555;
    color: #fff;
    box-shadow: 0 4px 0 #333;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 0 #333;
}

.btn:active {
    transform: translateY(4px);
    box-shadow: 0 0 0 #333;
}

.btn-primary {
    background: linear-gradient(135deg, #e67e22, #d35400);
    box-shadow: 0 4px 0 #c0392b;
}

.btn-primary:hover {
    box-shadow: 0 6px 0 #c0392b;
}

.btn-primary:active {
    box-shadow: 0 0 0 #c0392b;
}

#close-inventory {
    display: block;
    margin: 0 auto;
}

/* ==================== MENU INICIAL ==================== */
#start-menu {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0,0,0,0.95), rgba(26,26,26,0.95));
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 300;
    padding: 20px;
}

#start-menu h1 {
    font-size: clamp(2rem, 6vw, 4rem);
    color: #e67e22;
    text-shadow: 3px 3px 0 #000;
    margin-bottom: 10px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

#start-menu h2 {
    font-size: clamp(1.2rem, 3vw, 2rem);
    color: #f39c12;
    margin-bottom: 30px;
}

.menu-description {
    max-width: 600px;
    text-align: center;
    line-height: 1.8;
    font-size: clamp(0.9rem, 2vw, 1.1rem);
    color: #ccc;
    margin-bottom: 40px;
}

/* ==================== GAME OVER ==================== */
#game-over {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(139, 0, 0, 0.95);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 300;
    padding: 20px;
}

#game-over h1 {
    font-size: clamp(2rem, 6vw, 4rem);
    color: #fff;
    text-shadow: 3px 3px 0 #000;
    margin-bottom: 30px;
    animation: shake 0.5s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

#survival-stats {
    background: rgba(0,0,0,0.7);
    padding: 30px;
    border-radius: 10px;
    border: 3px solid #fff;
    margin-bottom: 30px;
    max-width: 500px;
    text-align: center;
    font-size: 18px;
    line-height: 2;
}

/* ==================== UTILITÁRIO ==================== */
.hidden {
    display: none !important;
}

/* ==================== RESPONSIVO ==================== */
@media (max-width: 768px) {
    #stats {
        flex-direction: column;
        gap: 5px;
    }
    
    .stat-bar {
        padding: 5px 10px;
    }
    
    .bar {
        width: 100px;
    }
    
    #inventory {
        width: 95vw;
    }
    
    #inventory-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
