/* style.css - COMPLETO COM VELOCÍMETRO CORRIGIDO */

/* CORREÇÃO GLOBAL: Garante que padding e border não causem scroll */
* {
    box-sizing: border-box; 
    margin: 0; 
}

body {
    font-family: 'Arial', sans-serif;
    background-color: #3498db; 
    
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    
    padding-top: 10px; 
    margin: 0;
    min-height: 100vh;
    overflow-x: hidden; 
    overflow-y: hidden; 
}

h2 {
    color: #2c3e50;
    margin-bottom: 10px;
    text-align: center;
}

#placar {
    margin-bottom: 15px;
    font-size: 1.5em; 
    font-weight: bold;
    color: #e74c3c;
    text-align: center;
}

/* --- ESTILO CORRIGIDO PARA O VELOCÍMETRO --- */
#velocimetro-display {
    /* Posição em relação ao .game-container */
    position: absolute;
    
    /* Reposicionamento para o canto SUPERIOR direito (dentro do jogo) */
    top: 15px; 
    right: 10px; 
    
    z-index: 5; /* Fica acima do Canvas, mas abaixo das telas de overlay */
    
    font-size: 1.1em;
    font-weight: bold;
    color: #f39c12; /* Cor Laranja */
    background-color: rgba(44, 62, 80, 0.7); /* Fundo escuro semi-transparente */
    padding: 5px 10px;
    border-radius: 5px;
    text-shadow: 1px 1px 1px #000;
}
/* FIM ESTILO CORRIGIDO */


/* --- ESTILO DA BARRA DE COMBUSTÍVEL --- */
#fuel-container {
    width: 385px; 
    height: 15px;
    background-color: #333; 
    border: 2px solid #2c3e50;
    border-radius: 5px;
    margin-bottom: 10px;
    overflow: hidden; 
}

#fuel-bar {
    height: 100%;
    width: 100%; 
    background-color: #e74c3c; 
    transition: width 0.3s, background-color 0.5s; /* Adicionei 'width' para transição suave */
}

/* --- O CONTAINER DO JOGO --- */
.game-container {
    text-align: center;
    background: #3498db; 
    padding: 0; 
    border-radius: 0; 
    box-shadow: none; 
    position: relative; 
    touch-action: manipulation; 
    margin: 0 auto; 
    max-width: 385px; 
    width: 100%; 
}

/* --- O CANVAS (Área de Jogo) --- */
#gameCanvas {
    background-color: #2c3e50; 
    border: 5px solid #bdc3c7;
    display: block;
    cursor: crosshair;
    
    width: 385px; 
    height: 600px;
}

/* --- ESTILOS PARA NOVOS CONTROLES MOBILE (4 BOTÕES) --- */

/* LINHA DE CIMA (Esquerda, Acelerar, Direita) */
#mobile-controls-top {
    display: flex; 
    justify-content: space-between; 
    width: 385px; 
    margin-top: 10px;
    padding: 10px 0;
}

/* LINHA DE BAIXO (Frear) */
#mobile-controls-bottom {
    display: flex; 
    justify-content: center; /* Centraliza o botão Frear */
    width: 385px;
    padding-bottom: 10px;
}

/* Estilo para TODOS os novos botões */
#mobile-controls-top button, #mobile-controls-bottom button {
    padding: 10px 10px;
    font-size: 1em; /* Levemente menor para caber 3 em linha */
    font-weight: bold;
    background-color: #2ecc71; 
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    touch-action: manipulation;
    user-select: none;
    transition: background-color 0.1s;
}

/* Tamanho dos botões laterais (Esquerda e Direita) */
#mobile-controls-top #btn-left, 
#mobile-controls-top #btn-right {
    width: 30%; 
}

/* Tamanho do botão Acelerar (Centro) */
#mobile-controls-top #btn-up {
    width: 35%; 
    background-color: #3498db; /* Cor diferente para destaque */
}
/* Tamanho do botão Frear (Baixo) */
#mobile-controls-bottom #btn-down {
    width: 35%; 
    background-color: #e74c3c; /* Cor Vermelha para freio */
}

#mobile-controls-top button:active, 
#mobile-controls-bottom button:active {
    filter: brightness(0.8);
}

/* FIM DOS NOVOS ESTILOS */


/* --- ESTILO DAS TELAS DE OVERLAY (INÍCIO E FIM) --- */
#game-over-screen, #start-screen {
    position: absolute;
    top: 0px; 
    left: 0px; 
    width: 385px; 
    height: 600px; 
    background: rgba(44, 62, 80, 0.95); 
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10; 
    cursor: pointer;
    text-align: center;
    border: 5px solid #bdc3c7; 
}
.hidden { display: none !important; }