#startScreen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5); /* Escurece o fundo para destacar o botão */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

#startScreen h1 {
    color: #FF9800;
    font-size: 24px;
    margin-bottom: 15px;
}

#startBtn {
    background: #FF9800;
    color: white;
    border: none;
    padding: 12px 25px;
    font-size: 18px;
    border-radius: 50px;
    cursor: pointer;
    margin-top: 15px;
    transition: 0.3s;
}

#startBtn:hover {
    background: #e68a00;
    transform: scale(1.1);
}



* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    overflow: hidden;
    font-family: 'Arial', sans-serif;
    background-color: #333; /* Cor de fundo fora do canvas */
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

#gameCanvas {
    pointer-events: auto; /* Garante que o canvas aceite toques */
    touch-action: none;   /* Impede o navegador de tentar dar zoom ou rolar */
    display: block;
    /* Ajustes para preencher a tela do celular corretamente */
    width: 100vw; 
    height: 100vh;
    max-width: 100%;
    max-height: 100%;
    
    object-fit: contain; /* Mantém a proporção do jogo sem cortar */
    background: #87CEEB;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    margin: 0 auto;
}

body {
    margin: 0;
    padding: 0;
    overflow: hidden; /* Remove as barras de rolagem */
    background-color: #333;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

#gameOver {
    position: absolute;
    background: rgba(0,0,0,0.85);
    padding: 40px;
    border-radius: 15px;
    text-align: center;
    display: none;
    z-index: 20;
    color: white;
}

#gameOver h1 {
    color: #ff4444;
    font-size: 48px;
    margin-bottom: 20px;
}

#restartBtn {
    background: #4CAF50;
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 20px;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s;
}

#restartBtn:hover {
    background: #45a049;
}

#startScreen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(135, 206, 235, 0.8); /* Cor do céu suave */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

#startBtn {
    background: #FFEB3B; /* Amarelo do pintinho */
    color: #8B4513; /* Marrom suave para o texto */
    padding: 20px 50px;
    font-size: 28px;
    font-weight: bold;
    border-radius: 15px;
    cursor: pointer;
    border: 4px solid white;
    box-shadow: 0 8px 0 #FBC02D; /* Sombra sólida estilo jogo */
    transition: all 0.1s;
    letter-spacing: 2px;
    animation: pulsar 1.5s infinite; /* Efeito de atenção */
}

#startBtn:active {
    transform: translateY(4px); /* Efeito de apertar o botão */
    box-shadow: 0 4px 0 #FBC02D;
}

/* Animação para o botão ficar pulsando devagar */
@keyframes pulsar {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Caixa principal que segura os scores */
#ui-container {
    position: fixed; /* Mudei de absolute para fixed */
    top: 20px;
    left: 20px;
    z-index: 999; /* Valor bem alto para garantir a frente */
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none; /* Importante para não travar o clique do jogo */
}

#score, #highScore {
    display: block !important; /* Força a exibição */
    visibility: visible !important;
    background: rgba(0, 0, 0, 0.7) !important; /* Fundo mais escuro para destacar */
    color: #ffffff !important;
    padding: 8px 15px;
    border-radius: 10px;
    font-size: 20px;
    font-family: 'Arial', sans-serif;
    min-width: 120px;
}

#highScore {
    color: #FFD700; /* Cor dourada para o Recorde */
}

/* Configurações exclusivas para Celular (telas menores que 600px) */
@media (max-width: 600px) {
    body {
        background-color: #87CEEB; /* Cor igual ao céu para não ver bordas pretas */
    }
    #ui-container {
        top: 10px;
        left: 10px;
    }
}
    

    #score, #highScore {
        font-size: 16px; /* Texto menor para não tampar o jogo */
        padding: 4px 10px;
        background: rgba(0, 0, 0, 0.5); /* Um pouco mais escuro para ler no sol */
    }

    /* Garante que o botão INICIAR seja fácil de clicar com o dedão */
    #startBtn {
        width: 80%;
        max-width: 250px;
        padding: 15px;
        font-size: 22px;
    }


#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #87CEEB; /* Mesmo azul do seu jogo */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999; /* Fica na frente de tudo */
}

.loader-content {
    text-align: center;
    color: white;
    font-family: Arial, sans-serif;
}

.pintinho-spinner {
    width: 60px;
    height: 60px;
    background-color: #FFEB3B; /* Amarelo do Pintinho */
    border-radius: 50%;
    position: relative;
    margin: 0 auto 20px;
    animation: spin-pintinho 1.5s linear infinite;
    border: 3px solid #FBC02D;
}

/* Olhos e Bico */
.olho-esq, .olho-dir {
    width: 8px; height: 8px;
    background: black;
    border-radius: 50%;
    position: absolute;
    top: 20px;
}
.olho-esq { left: 15px; }
.olho-dir { right: 15px; }

.bico {
    width: 0; height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 8px solid #FF9800;
    position: absolute;
    top: 32px; left: 24px;
}

/* Animação de rotação e pulinho */
@keyframes spin-pintinho {
    0% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(180deg) scale(1.1); }
    100% { transform: rotate(360deg) scale(1); }
}


@keyframes spin {
    to { transform: rotate(360deg); }
}

canvas {
    max-width: 100%; /* Garante que não ultrapasse a largura da tela */
    height: auto;    /* Mantém a proporção */
    display: block;
    margin: 0 auto;
}

@keyframes pulsar {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.7); }
    70% { transform: scale(1.05); box-shadow: 0 0 0 10px rgba(76, 175, 80, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(76, 175, 80, 0); }
}

#reviveBtn {
    /* Deixa o botão maior e mais fácil de clicar */
    padding: 15px 30px; 
    font-size: 18px;
    width: 80%; /* Faz o botão ocupar quase toda a largura da tela de Game Over */
    max-width: 300px;
    
    /* Melhora o posicionamento */
    display: block;
    margin: 10px auto 20px auto; /* Centraliza e dá espaço para o botão de baixo */
    
    /* Estilo Profissional */
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 50px; /* Deixa as bordas bem arredondadas, estilo app moderno */
    font-weight: bold;
    cursor: pointer;
    
    /* Garante que ele fique por cima de qualquer outro texto */
    position: relative;
    z-index: 999; 
    
    /* A animação que já criamos */
    animation: pulsar 1.5s infinite;
}

#reviveBtn:hover {
    background-color: #45a049; /* Escurece um pouco ao passar o mouse/dedo */
}