/* Estilos Gerais */
:root {
    --primary: #2A9D8F;
    --secondary: #264653;
    --accent: #E9C46A;
    --danger: #E76F51;
    --light: #FFFFFF;
    --fire: #FF5733;       /* Laranja vivo */
    --skull: #FF0000;      /* Vermelho vivo */
    --lightning: #FFD700;  /* Amarelo ouro */
    --dark: #000000;
    --buttonmobile: #4a666398;
}

* {
    margin: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', system-ui, sans-serif;
    background: var(--secondary);
    color: var(--light);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0; /* Remover padding original de 20px */
    overflow: hidden; /* Prevenir scroll em qualquer direção */
}

/* Header */
.main-header {
    padding: 1rem;
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo {
    width: 40px;
    height: 40px;
}

.main-nav {
    display: flex;
    gap: 1.5rem;
}

.main-nav a {
    color: var(--light);
    text-decoration: none;
    transition: color 0.3s;
    font-weight: bold;
}

.main-nav a:hover {
    color: #ffc636;;
}

/* Container do Jogo */
.game-container {
    flex: 1;
    width: 100%;
    height: calc(100vh - 80px); /* Considerar header e margens */
    max-width: 1200px;
    margin: 80px auto 20px;
    position: relative;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    background-image: url('img/jungle.jpg'); /* Caminho da imagem */
    background-repeat: no-repeat;
    background-size: cover; /* Ajusta a imagem para cobrir todo o container */
    background-position: center; /* Centraliza a imagem */
    display: flex;
    flex-direction: column;
}

.game-area {
    flex: 1;
    width: 100%;
    position: relative;
    overflow: hidden;
    margin: 0 10px; /* Pequena margem nas laterais */
}

/* Elementos do Jogo */
.panda, .food, .obstacle {
    position: absolute;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.2s ease;
    pointer-events: none;
    z-index: 2;
}

.panda i {
    color: var(--dark);
    font-size: 2rem;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.food i {
    color: #0b5812;
    font-size: 1.8rem;
    animation: pulse 1s infinite;
    text-shadow: 0 0 15px rgba(3, 204, 13, 0.712); 
}

/* Novas cores dos obstáculos */
.fa-fire {
    color: var(--fire);
    filter: drop-shadow( 0 0 15px rgb(243, 97, 0)); /* Sombra externa do ícone */
}

.fa-skull {
    color: var(--skull);
    filter: drop-shadow( 0 0 15px rgb(134, 3, 3));
    border-radius: 70%;
}

.fa-bolt {
    color: var(--lightning);
    filter: drop-shadow ( 0 0 15px rgb(255, 230, 0)); 
    border-radius: 50%;
}

.obstacle i {
    font-size: 1.5rem;
    animation: float 2s ease-in-out infinite;
}

/* Animações */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Controles */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.438);
    border-radius: 10px;
    margin: 1rem 0;
    margin-top: auto;
}

.score-board {
    display: flex;
    gap: 1.5rem;
    font-size: 1.2rem;
}

.controls {
    display: flex;
    gap: 1rem;
}

.control-btn {
    background: #06740f;
    color: var(--light);
    border: none;
    padding: 0.8rem 1.2rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.control-btn:hover {
    background: #ffc636;
    transform: translateY(-2px);
}

/* Menu Hamburguer Responsivo */
.menu-toggle {
    display: none;
    cursor: pointer;
    font-size: 1.5rem;
}
/* Controles Mobile */
.mobile-controls {
    display: none; /* Escondido por padrão */
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    gap: 8px;
    flex-direction: column;
    align-items: center;
    z-index: 1000;
    touch-action: manipulation;
}

.mobile-controls .row {
    display: flex;
    gap: 50px;
    margin: 3px 0;
}

.mobile-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var( --buttonmobile);
    border: 1px solid var(--light);
    color: var(--light);
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    transition: all 0.1s ease;
}

.mobile-btn:active {
    background: var(--accent);
    transform: scale(0.95);
}

/* Dispositivos muito pequenos */
@media (max-width: 480px) { 
    .mobile-controls .row {
        gap: 40px;
    }
    
    .mobile-btn {
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
    }
}


@media (max-width: 768px) {
    body {
        touch-action: manipulation;
    }

    .main-nav {
        position: fixed;
        top: 60px;
        right: -100%;
        flex-direction: column;
        background: rgba(42, 157, 143, 0.95);
        width: 100%;
        padding: 1rem;
        transition: right 0.3s ease;
    }

    .main-nav.show {
        right: 0;
    }

    .menu-toggle {
        display: block;
    }

    .mobile-controls {
        display: flex;
        flex-direction: column;
        bottom: 15px;
        width: 100%;
        max-width: 280px;
    }

    .mobile-btn {
        width: 55px;
        height: 55px;
        font-size: 1.3rem;
    }

    .game-area {
        touch-action: none;
    }

    .game-header {
        margin: 0.5rem;
        padding: 0.8rem;
    }

    .score-board {
        gap: 1rem;
        font-size: 1rem;
    }

    .game-container {
        height: calc(100vh - 60px); /* Considerar altura do header */
        margin-top: 60px; /* Altura do header */
        padding-bottom: 100px; /* Espaço para controles */
        width: calc(100% - 20px); /* Margens laterais */
        margin-left: 10px;
        margin-right: 10px;
    }

    .panda i { font-size: 1.5rem; }
    .food i { font-size: 1.2rem; }
    .obstacle i { font-size: 1rem; }
}

/* Cenários */
.game-area.jungle { background-image: url('img/jungle-bg.jpg'); }
.game-area.desert { background-image: url('img/desert-bg.jpg'); }
.game-area.night { background-image: url('img/night-bg.jpg'); }
.game-area.beach { background-image: url('img/beach-bg.jpg'); }

/* Game Over */
#gameOver {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.9);
    padding: 2rem;
    border-radius: 15px;
    text-align: center;
    z-index: 1000;
    display: none;
}

.play-btn {
    background: #06740f;
    color: var(--light);
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    margin-top: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.play-btn:hover {
    background: #ffc636;
}