/* --- ESTILOS GERAIS --- */
body {
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background-color: #1a1a1a;
    font-family: 'Press Start 2P', cursive;
    overflow: hidden;
}

/* --- TELA DO JOGO E CENÁRIO --- */
#game-container {
    width: 95vw;
    max-width: 1100px;
    height: 90vh;
    max-height: 620px;
    border: 5px solid #444;
    border-radius: 5px;
    background-color: #87ceeb;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
#game-container:focus { outline: none; }
#sky, #far-clouds, #near-clouds, #ground {
    position: absolute;
    left: 0;
    width: 100%;
    height: 100%;
    background-repeat: repeat-x;
}
#far-clouds {
    background-image: url('imagens/clouds.png');
    animation: scroll 60s linear infinite;
    opacity: 0.6;
    width: 101%;
}
#near-clouds {
    background-image: url('imagens/clouds.png');
    animation: scroll 30s linear infinite reverse;
    width: 101%;
}
#ground {
    height: 24px;
    bottom: 0;
    z-index: 5;
    background-image: url('imagens/ground.png');
    animation: scroll 8s linear infinite;
}
@keyframes scroll {
    from { background-position-x: 0; }
    to { background-position-x: -1024px; }
}

/* --- PERSONAGEM E ITENS --- */
#hedgehog {
    position: absolute;
    bottom: 24px;
    left: 60px;
    width: 55px;
    height: 59px;
    z-index: 10;
    background-image: url('imagens/hedgehog-sprite.png');
    background-size: auto 100%;
    mask-image: url('imagens/hedgehog-sprite.png');
    mask-size: auto 100%;
    transition: background-image 0.1s;
}
.run-frame-1 { background-position: 0 0; }
.run-frame-2 { background-position: -55px 0; }
.jump-frame  { background-position: -110px 0; }
.crashed { animation: blink 0.5s 3; }

#hedgehog.attack-pose {
    background-image: url('imagens/hedgehog-attack.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    mask-image: url('imagens/hedgehog-attack.png');
}

.item {
    position: absolute;
    z-index: 9;
    bottom: 29px;
    background-size: contain;
    background-repeat: no-repeat;
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
}
.tool { 
    width: 44px;
    height: 44px;
    background-image: url('imagens/item-ferramenta.png'); 
    mask-image: url('imagens/item-ferramenta.png');
}
.code { 
    width: 50px;
    height: 38px;
    bottom: 60px; 
    background-image: url('imagens/item-codigo.png');
    mask-image: url('imagens/item-codigo.png');
}
.bug { 
    width: 56px;
    height: 38px;
    background-image: url('imagens/obstaculo-bug.png');
    mask-image: url('imagens/obstaculo-bug.png');
}

.explosion {
    position: absolute;
    width: 64px;
    height: 64px;
    background-image: url('imagens/explosion-sprite.png');
    z-index: 50;
    animation: play-explosion 0.5s steps(5) forwards;
}
@keyframes play-explosion {
    from { background-position: 0 0; }
    to { background-position: -320px 0; }
}

/* --- INTERFACE E BOTÕES --- */
#ui-container {
    position: absolute;
    width: 100%;
    padding: 15px;
    box-sizing: border-box;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    color: white;
    text-shadow: 2px 2px #333;
    font-size: 0.8em;
    z-index: 20;
}
#score-display, #highscore-display {
    background: rgba(0,0,0,0.3);
    padding: 5px 10px;
    border-radius: 5px;
}

#boost-container {
    font-size: 0.8em;
    color: white;
    text-shadow: 2px 2px #333;
    text-align: right;
    width: 154px;
}
#boost-bar {
    height: 15px;
    background-color: rgba(0,0,0,0.3);
    border: 2px solid #333;
    margin-top: 5px;
    background-image: linear-gradient(to right, #00ffff, #00b8b8);
    background-size: 0% 100%;
    background-repeat: no-repeat;
    transition: background-size 0.2s linear;
}
#boost-container.ready {
    animation: glow 1s infinite alternate;
}
@keyframes glow {
    from { box-shadow: 0 0 5px #00ffff; }
    to { box-shadow: 0 0 15px #00ffff, 0 0 25px #fff; }
}

#message-display {
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    color: white; text-shadow: 2px 2px #333;
    text-align: center; font-size: 1.5em; z-index: 100;
}
#message-display span {
    font-size: 0.6em; display: block; margin-top: 15px;
}

#mute-button {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 2em;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 101;
}

#attack-button {
    position: absolute;
    bottom: 20px;
    left: 20px;
    width: 60px;
    height: 60px;
    background-color: rgba(255, 0, 0, 0.5);
    border: 3px solid rgba(255, 255, 255, 0.7);
    border-radius: 50%;
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: 'Press Start 2P', cursive;
    font-size: 28px;
    color: white;
    text-shadow: 2px 2px #000;
    opacity: 0;
    transform: scale(0.5);
    transition: opacity 0.3s, transform 0.3s;
    pointer-events: none;
}
#attack-button.ready {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
    animation: glow-attack 1s infinite alternate;
}
@keyframes glow-attack {
    from { box-shadow: 0 0 10px #ff0000; }
    to { box-shadow: 0 0 25px #ff0000, 0 0 35px #ffffff; }
}

/* --- ESTILOS PARA FORMULÁRIO E LEADERBOARD --- */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 200;
    animation: fadeIn 0.3s;
}

.modal {
    background-color: #fff;
    padding: 25px;
    border-radius: 10px;
    border: 5px solid #444;
    text-align: center;
    color: #333;
    width: 80%;
    max-width: 400px;
}

.modal h2 {
    margin-top: 0;
}

#register-form input {
    display: block;
    width: calc(100% - 20px);
    padding: 10px;
    margin: 10px auto;
    font-family: sans-serif;
    border: 2px solid #ccc;
    border-radius: 5px;
}

.modal button {
    background-color: #f39c12;
    color: white;
    border: none;
    padding: 12px 20px;
    font-family: 'Press Start 2P', cursive;
    cursor: pointer;
    border-radius: 5px;
    margin-top: 10px;
}

.modal button:hover {
    background-color: #e67e22;
}

#leaderboard-list {
    list-style-type: decimal;
    padding-left: 40px;
    text-align: left;
}

#leaderboard-list li {
    padding: 5px 0;
    font-size: 0.9em;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* --- ESTILOS PARA CONSENTIMENTO LGPD --- */
.modal .small-text {
    font-size: 0.8em;
    color: #666;
    margin-bottom: 15px;
}

.consent-checkbox {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 20px 0;
    font-family: Arial, sans-serif;
}

.consent-checkbox input[type="checkbox"] {
    margin-right: 10px;
    width: 18px;
    height: 18px;
}

.consent-checkbox label {
    font-size: 0.9em;
    text-align: left;
}

.modal button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}


/* Animações genéricas */
@keyframes blink {
    50% { opacity: 0.2; }
}
.particle {
    position: absolute;
    width: 5px;
    height: 5px;
    background-color: #f39c12;
    border-radius: 50%;
    animation: fade-out-up 0.5s ease-out forwards;
}
@keyframes fade-out-up {
    to { transform: translateY(-50px); opacity: 0; }
}
