/* Configurações Globais e Responsividade */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Consolas', 'Courier New', monospace;
}

body {
    background-color: #333;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    color: #fff;
    overflow: hidden;
}

/* Estrutura de Borda e Limites (Aspecto Visual de Tela) */
#game-wrapper {
    width: 90vw;
    max-width: 1000px;
    height: 90vh;
    max-height: 600px;
    position: relative;
    border: 2px solid #fff; /* borda fininha branca */
    box-shadow: none;        /* remove o brilho amarelo */
    overflow: hidden;
    background-color: #000;
    outline: none;
}


/* Canvas e Cenário */
#game-canvas {
    width: 100%;
    height: 100%;
    display: block;
    background-color: #68c0ff;
}

/* Heads-Up Display (Placar) */
#hud {
    position: absolute;
    top: 10px;
    left: 10px;
    font-size: 1.2em;
    font-weight: bold;
    background: rgba(0, 0, 0, 0.7);
    padding: 6px 10px;
    border-radius: 5px;
    z-index: 30;
    color: #ffd700;
}

/* Telas de Overlay (Menu/Game Over) */
#menu-screen, #game-over-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    z-index: 40;
    padding: 20px;
}

#menu-screen h1, #game-over-screen h2 {
    font-size: 3em;
    color: #ffd700;
    margin-bottom: 20px;
    text-shadow: 2px 2px #000;
}

/* Botões e Inputs */
button {
    padding: 12px 24px;
    margin: 8px;
    font-size: 1.05em;
    font-weight: bold;
    color: #333;
    background-color: #ffd700;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
}

button:hover {
    background-color: #ffc400;
    transform: translateY(-2px);
}

#player-name-input {
    padding: 10px;
    margin-bottom: 16px;
    font-size: 1.05em;
    border: 2px solid #ffd700;
    background-color: #333;
    color: #fff;
    border-radius: 5px;
    text-align: center;
}

/* Personagem (Sprite e Fallback) */
#player-sprite {
    position: absolute;
    width: 60px;
    height: 60px;
    z-index: 35; /* acima do canvas e HUD */
    background-size: 80% auto;
    background-position: bottom center;
    background-repeat: no-repeat;
    pointer-events: none; /* não atrapalha toques */
}

/* Classe de Fallback/Padrão (ativada pelo JS se a imagem não carregar) */
.player-css-mode {
    background-color: var(--player-color);
    border: 3px solid #fff;
    border-radius: 5px;
    box-shadow: 0 0 5px #fff;
}

/* Pequena animação visual quando pula */
#player-sprite.jumping {
    transform: translateY(-6px);
    transition: transform 0.08s linear;
}

/* Texto flutuante de pontos */
.floating-score {
    position: absolute;
    font-weight: bold;
    color: #fff;
    text-shadow: 1px 1px 0 #000;
    z-index: 50;
    pointer-events: none;
    transform: translateY(0);
    opacity: 1;
    transition: transform 0.8s ease-out, opacity 0.8s ease-out;
}

/* Ajuste responsivo para telas pequenas */
@media (max-width: 480px) {
    #menu-screen h1, #game-over-screen h2 {
        font-size: 2em;
    }
    #hud { font-size: 1em; }
}

/* Pássaros voando */
.bird {
    position: absolute;
    width: 70px;
    height: 60px;
    background: url('assets/bird.png') no-repeat;
    background-size: contain;
    z-index: 6; /* acima do sol e nuvens, mas atrás do player */
    animation-name: flyBirds;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
}

@keyframes flyBirds {
    0% { left: 100%; transform: scaleX(-1); }
    100% { left: -50px; transform: scaleX(-1); }
}


/* --- Céu Animado com Nuvens --- */
.cloud {
    position: absolute;
    background: #fff;
    border-radius: 50%;
    opacity: 0.8;
    z-index: 5; /* atrás do player e HUD */
}

.cloud::before,
.cloud::after {
    content: '';
    position: absolute;
    background: #fff;
    border-radius: 50%;
}

/* Animação de flutuação */
@keyframes floatCloud {
    from { transform: translateX(100vw); }
    to { transform: translateX(-200px); }
}

.cloud {
    width: 80px;
    height: 50px;
    top: 50px;
    left: 100%;
    animation: floatCloud 60s linear infinite;
}

.cloud::before {
    width: 40px;
    height: 40px;
    top: -10px;
    left: 10px;
}

.cloud::after {
    width: 50px;
    height: 50px;
    top: -20px;
    left: 30px;
}

/* Sol */
.sun {
    position: absolute;
    top: 20px;
    right: 50px;
    width: 80px;
    height: 80px;
    background: radial-gradient(circle at center, #FFD700 0%, #FFA500 70%);
    border-radius: 50%;
    z-index: 5;
}

/* Nuvens */
.cloud {
    position: absolute;
    left: -200px; /* começam fora da tela */
    width: 200px;
    height: 80px;
    background: url('assets/cloud.png') no-repeat;
    background-size: contain;
    z-index: 4;
    animation-name: moveClouds;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
}

@keyframes moveClouds {
    0% { left: 100%; }
    100% { left: -200px; }
}



