/* --- ESTILOS GERAIS E LAYOUT (COM CORREÇÃO DE SCROLL) --- */
html {
  height: 100%;
  width: 100%;
  overflow: hidden; /* Impede a rolagem na página inteira */
}

body {
  font-family: Arial, sans-serif;
  margin: 0;
  height: 100%; /* Ocupa 100% da altura do HTML */
  width: 100%;
  overflow: hidden; /* Garante que o corpo também não tenha rolagem */
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: #333;
  position: relative; /* Define um contexto de posicionamento */
}

.game-wrapper {
  height: 98vh;
  max-height: 900px;
  width: calc(var(--wrapper-height, 98vh) * (9 / 16));
  max-width: 95vw;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  border-radius: 20px;
  overflow: hidden;
  position: relative;
  background-color: white;
  --wrapper-height: 98vh;
}

.container {
  padding: 40px;
  text-align: center;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.logo {
  max-width: 150px;
  margin-bottom: 20px;
  align-self: center;
}
h1 {
  margin-bottom: 10px;
  color: #333;
}
p {
  color: #666;
  margin-bottom: 30px;
}

/* --- TELA DO JOGO --- */
#gameScreen {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
}
#game-container {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* Placar de pontos com posicionamento corrigido */
/* Placar de pontos com posicionamento corrigido */
#score {
  position: absolute;
  top: 10%; /* Ajustado para dar espaço */
  left: 15.5%;
  transform: translateX(-50%);
  font-size: clamp(20px, 6vw, 30px); /* Fonte um pouco menor */
  font-weight: bold;
  color: #f0f0f0; /* Cor um pouco diferente para distinguir */
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.6);
  z-index: 100;
}

/* CÓDIGO ADICIONADO ABAIXO */
#highScore {
  position: absolute;
  top: 15%; /* Ajustado para dar espaço */
  left: 13%;
  transform: translateX(-50%);
  font-size: clamp(16px, 3vw, 20px); /* Fonte um pouco menor */
  font-weight: bold;
  color: #f0f0f0; /* Cor um pouco diferente para distinguir */
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.6);
  z-index: 100;
}
/* --- ELEMENTOS DO JOGO --- */
#character {
  position: absolute;
  width: 50px;
  height: 50px;
  background-size: contain;
  background-repeat: no-repeat;
  left: 50%;
  transform: translateX(-50%);
  bottom: 50%;
  z-index: 5;
}
.collectible {
  position: absolute;
  width: 80px;
  height: 80px;
  background-image: url("imgs/sprites/coin.png");
  background-size: contain;
  background-repeat: no-repeat;
  z-index: 4;
}
.obstacle-orbiter {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 300px;
  height: 300px;
  transform: translate(-50%, -50%); /* <-- ADICIONE ESTA LINHA */
}
.pizza-obstacle {
  position: absolute;
  width: 50px;
  height: 50px;
  background-image: url("imgs/sprites/bat-placeholder.png");
  background-size: contain;
  background-repeat: no-repeat;
}

/* --- EFEITO DE RAIOS DE SOL GIRATÓRIOS --- */
#game-container::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 250%;
  height: 250%;
  transform-origin: center center;
  background: repeating-conic-gradient(
    from 0deg,
    rgba(255, 187, 0, 0.5) 0% 2%,
    transparent 2% 10%
  );
  animation: rotate-background 60s linear infinite;
  z-index: 1;
}

/* --- ESTILOS DOS MENUS E BOTÕES --- */
#loginForm {
  display: flex;
  flex-direction: column;
}
#nicknameInput,
#phoneInput {
  padding: 15px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 16px;
  margin-bottom: 10px;
}
.error-message {
  color: #f44336;
  font-size: 14px;
  min-height: 20px;
  margin-bottom: 0;
  margin-top: -5px;
}
#playButton,
.menu-button {
  display: block;
  width: 100%;
  padding: 15px;
  margin-top: 15px;
  border: none;
  border-radius: 8px;
  background-color: #4caf50;
  color: white;
  font-size: 18px;
  cursor: pointer;
  transition: background-color 0.2s;
}
#playButton:disabled {
  background-color: #cccccc;
  cursor: not-allowed;
  opacity: 0.7;
}
.menu-button:hover {
  background-color: #45a049;
}
#playAgainButton,
#backToLoginButton {
  background-color: #888;
}
#playAgainButton:hover,
#backToLoginButton:hover {
  background-color: #777;
}
#showRankingButton {
  background-color: #2196f3;
}
#showRankingButton:hover {
  background-color: #1e88e5;
}

/* --- MENSAGEM DE INÍCIO E RANKING --- */
#startMessage {
  position: absolute;
  top: 60%; /* Correção para centralizar */
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  z-index: 20;
}

#startMessage p {
  font-size: 22px;
  font-weight: bold;
  color: white;
  text-shadow: 1px 1px 3px #000;
  margin: 0;
  line-height: 1.4;
}
.hand-icon {
  font-size: 40px;
  margin-top: 10px;
  animation: pulse 1.5s ease-in-out infinite;
}
#rankingList {
  list-style: none;
  padding: 0;
  margin: 20px 0;
  width: 100%;
  text-align: left;
}
#rankingList li {
  display: flex;
  justify-content: space-between;
  padding: 12px 5px;
  border-bottom: 1px solid #eee;
  font-size: 16px;
}
#rankingList li:last-child {
  border-bottom: none;
}
#rankingList li span:first-child {
  font-weight: bold;
}
#playerRankDisplay {
  margin-top: 25px;
  padding-top: 15px;
  border-top: 2px solid #eee;
  font-size: 18px;
  font-weight: bold;
  color: #333;
}

.smoke-particle {
  position: absolute; /* Permite o posicionamento exato via JS */
  background-color: rgba(255, 255, 255, 0.7); /* Cor de fumaÃ§a/bolha */
  border-radius: 50%; /* Deixa a partÃ­cula redonda */
  z-index: 4; /* Garante que fique atrÃ¡s do personagem */

  /* Aplica a animaÃ§Ã£o 'smoke-puff' que dura 1 segundo */
  animation: smoke-puff 1s ease-out forwards;
}

/* --- ANIMAÇÕES --- */
@keyframes rotate-background {
  from {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}
@keyframes continuous-rotation {
  from {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}
@keyframes smoke-puff {
  0% {
    transform: scale(1);
    opacity: 0.7;
  }
  100% {
    transform: scale(2.5) translateY(40px);
    opacity: 0;
  }
}
@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
  }
}

/* --- CLASSE UTILITÁRIA --- */
.hidden {
  display: none !important;
}
/* --- ESTILOS PARA O CHECKBOX DE PROMOÇÕES --- */
.promo-checkbox-container {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 20px;
  margin-bottom: 10px;
}

#promoCheckbox {
  margin-right: 8px; /* Espaço entre a caixa e o texto */
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.promo-checkbox-container label {
  font-size: 14px;
  color: #666;
  cursor: pointer;
}