* { margin: 0; padding: 0; box-sizing: border-box; }
html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: sans-serif;
  background: #87ceeb;
}

#container {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
}

#background-layers {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(to bottom, 
    #beebff 0%, 
    #0aaadb 50%, 
    #235d81 100%
  );
}

#game {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: calc(100% - 90px);
  background: none;
}

@keyframes moveMountains {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* <<< ALTERADO: reposicionamento dos controles */
#controls-area {
  position: fixed;
  bottom: 0;
  width: 100%;
  height: 90px;
  background: rgba(0, 0, 0, 0.7);
  z-index: 100;
  pointer-events: none;
}

/* <<< NOVOS GRUPOS LATERAIS FIXOS */
#jump-group {
  position: absolute;
  left: 20px;
  bottom: 15px;
  display: flex;
  gap: 15px;
  pointer-events: auto;
}

#move-group {
  position: absolute;
  right: 20px;
  bottom: 15px;
  display: flex;
  gap: 15px;
  pointer-events: auto;
}

#menu-btn {
  position: absolute;
  left: 50%;
  bottom: 15px;
  transform: translateX(-50%);
  width: 150px;
  height: 50px;
  border-radius: 25px;
  background: linear-gradient(to bottom, #4a90e2, #003366);
  color: white;
  font-weight: bold;
  font-size: 24px;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.3),
    0 2px 5px rgba(0, 0, 0, 0.5);
  border: 2px solid transparent;
  background-clip: padding-box;
  pointer-events: auto;
  z-index: 101;
}

/* 📱 Altera apenas no mobile */
@media (max-width: 600px) {
  #menu-btn {
    left: 26%;
    bottom: 20px;
    transform: translateX(0); /* remove o centralizador */
    font-size: 18px;
    width: 110px;
  height: 40px;
  }
}



/* <<< ESTILO BASE DOS BOTÕES */
.btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 28px;
  color: white;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.1s, background 0.2s;
}

.btn:active {
  transform: scale(0.95);
  background: rgba(255, 255, 255, 0.9);
}

#jump {
  background: #f44336;
}

#left, #right {
  background: #4CAF50;
}

#score-display {
  position: absolute;
  top: 10px;
  right: 10px;
  color: white;
  padding: 5px 15px;
  border-radius: 6px;
  font-size: 32px;
  font-family: 'Bungee', cursive;
  text-shadow:
    -1px -1px 0 black,
     1px -1px 0 black,
    -1px  1px 0 black,
     1px  1px 0 black;
  -webkit-text-stroke: 1px black;
  z-index: 1000;
  user-select: none;
  pointer-events: none;
  
  /* Novas propriedades para alinhar número e imagem */
  display: flex;
  align-items: center; /* Centraliza verticalmente */
  gap: 10px; /* Espaço entre número e moeda */
}

.coin-icon {
  width: 40px; /* Ajuste conforme necessário */
  height: 40px; /* Mantém a proporção */
}

#timer-display {
  position: absolute;
  top: 60px;
  left: 2.5%;
  transform: translateX(-50%);
  color: white;
  padding: 13px 20px;
  font-family: 'Press Start 2P', monospace;
  font-size: 13px;
  border-radius: 4px;
  z-index: 10;
  text-shadow: 
    -1px -1px 0 #000,
     1px -1px 0 #000,
    -1px 1px 0 #000,
     1px 1px 0 #000;

     @media (max-width: 768px) {
     top: 60px;
     left: 15%;
      }
}

#hud {
  position: absolute;
  top: 10px;
  left: 10px;
  /*background: rgba(0,0,0,0.5);*/
  color: white;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 32px;
  font-family: 'Bungee', cursive;
  text-shadow:
    -1px -1px 0 black,
     1px -1px 0 black,
    -1px  1px 0 black,
     1px  1px 0 black;
  -webkit-text-stroke: 1px black;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  user-select: none;
  pointer-events: none;
  
}

#lives.hidden {
  display: none;
}

.hidden {
  display: none !important;
}



/* ===== BLOQUEIO DE SELEÇÃO E TOQUES ===== */
* {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* Botões - remove qualquer feedback visual indesejado */
.btn {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.btn:focus {
  outline: none;
}

/* HUD e elementos de vida - bloqueio total */
#hud, #lives {
  pointer-events: none;
  user-select: none;
}

/* Garante que imagens dentro do HUD também não sejam selecionáveis */
#hud img {
  pointer-events: none;
  -webkit-user-drag: none;
  -khtml-user-drag: none;
  -moz-user-drag: none;
  -o-user-drag: none;
  user-drag: none;
  user-select: none;
}

/* ===== MELHORIAS PARA DISPOSITIVOS MÓVEIS ===== */
html {
  touch-action: manipulation;
}

body {
  overscroll-behavior: none;
}

.btn:active {
  transform: scale(0.95);
  background: rgba(255, 255, 255, 0.9) !important;
  transition: transform 0.05s, background 0.05s;
}

button {
  border: none;
  background: none;
  padding: 0;
  margin: 0;
}

/* Telas de menu */
.screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  color: white;
  font-family: 'Bungee', cursive;
  text-align: center;
}

.screen-content {
  background: rgba(0, 0, 0, 0.7);
  padding: 30px;
  border-radius: 15px;
  max-width: 90%;
  border: 3px solid #4CAF50;
}

.screen h1 {
  margin-bottom: 30px;
  font-size: 2.5rem;
  color: #4CAF50;
  text-shadow: 0 0 10px rgba(76, 175, 80, 0.5);
}

.menu-btn {
  display: block;
  width: 200px;
  padding: 15px;
  margin: 15px auto;
  background: #4CAF50;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1.2rem;
  font-family: 'Bungee', cursive;
  cursor: pointer;
  transition: all 0.3s;
}

.menu-btn:hover {
  background: #45a049;
  transform: scale(1.05);
}

.menu-btn:active {
  transform: scale(0.95);
}

#game-container {
  width: 100%;
  height: 100%;
}

/* Tela de Game Over - Versão Corrigida */
#gameover-screen {
  background: rgba(0, 0, 0, 0.9);
}

#gameover-screen .screen-content {
  background: transparent;
  border: none;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

#gameover-screen h1 {
  color: #ff0000;
  font-size: 3rem;
  margin: 0;
  text-shadow: 0 0 10px rgba(255, 0, 0, 0.5);
  font-family: 'Bungee', cursive;
}

#dead-image {
  max-width: 60%;
  height: auto;
  margin: 30px 0;
}

.game-time-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.game-time-label {
  color: #ffff00;
  font-size: 17px;
  font-family: 'Press Start 2P', monospace;
  margin: 30px 0;
}

.game-time-value {
  color: #ffffff;
  font-size: 15px;
  font-family: 'Press Start 2P', monospace;
  margin: 15px 0;
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.8); }
  to { opacity: 1; transform: scale(1); }
}

/* === TELA DE INÍCIO DESKTOP === */
#start-screen.custom-start {
  background: url('../img/zinoworld.jpg') no-repeat center center;
  background-size: cover;
}

/* Remove fundo da caixa e bordas */
.screen-content.no-bg {
  background: transparent;
  border: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Botão centralizado */
#start-screen .menu-btn {
  position: relative;
  z-index: 2;
}



/* BLOQUEIA IMAGENS DENTRO DOS BOTÕES DE CONTROLE */
#controls-area img,
.btn img,
#menu-btn img {
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  -khtml-user-select: none;
  -webkit-user-drag: none;
  user-drag: none;
}


@media screen and (orientation: landscape) {
  #controls-area {
    background: rgba(0, 0, 0, 0.05) !important; /* Quase invisível */
    transition: background 0.3s ease-in-out;
  }
}


/* === TELA DE INÍCIO MOBILE COM IMAGEM DIFERENTE === */
@media (max-width: 768px) {
  #start-screen.custom-start {
    background: url('../img/zinoworld_mobile.jpg') no-repeat center center;
    background-size: auto 100%; /* Preenche verticalmente, corta lados */
  }
}
/* Botão "Novo Jogo" em vermelho */
#start-screen .menu-btn {
  background: #e53935; /* vermelho forte */
  color: white;
}

#start-screen .menu-btn:hover {
  background: #d32f2f;
  transform: scale(1.05);
}

#start-screen .menu-btn:active {
  background: #c62828;
  transform: scale(0.95);
}

/* Tela de Introdução */
#intro-screen {
  background: white;
  z-index: 3000;
}

#vinheta-screen{

    background-color: #ffffff;
}

.intro-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  animation: fadeInOut 3s ease-in-out forwards;
}

.intro-logo img {
  width: 200px;
  margin-bottom: 10px;
}

.intro-logo p {
  font-family: 'Bungee', cursive;
  font-size: 24px;
  color: black;
}

@keyframes fadeInOut {
  0% { opacity: 0; }
  20% { opacity: 1; }
  80% { opacity: 1; }
  100% { opacity: 0; }
}

/* Tela da vinheta */
#vinheta-screen .vinheta-img {
  max-width: 60%;
  margin-bottom: 20px;

}

#vinheta-ok-btn{
  color:#ffffff;
  background-color: #c62828;
}

.vinheta-text {
  color: rgb(0, 0, 0);
  font-family: 'Bungee', cursive;
  font-size: 1.2rem;
  margin-bottom: 20px;
  
}

/* Telas de Nível */
#level-intro-screen, #level-complete-screen {
    background: rgba(0, 0, 0, 0.9);
    z-index: 2500;
}

#level-intro-screen h1 {
    font-size: 3rem;
    color: #4CAF50;
    margin-bottom: 20px;
    text-shadow: 0 0 10px rgba(76, 175, 80, 0.7);
    animation: pulse 2s infinite;
}

.level-number {
    font-size: 1.5rem;
    color: #FFC107;
    margin-bottom: 30px;
    font-family: 'Press Start 2P', monospace;
}

.results {
    margin: 30px 0;
    font-size: 1.2rem;
}

.result-row {
    display: flex;
    justify-content: space-between;
    margin: 15px 0;
    padding: 10px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 5px;
}

.result-value {
    color: #FFC107;
    font-weight: bold;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}