/* Fonte */
@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

/* Base */
html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
  background-color: black;
  font-family: "Press Start 2P", cursive;
  color: white;
  text-align: center;
}

/* Container Principal do Canvas */
.canvas-container {
  display: inline-block;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  width: 100%;
}

/* Canvas */
#game-canvas {
  display: block;
  max-width: 100%;
  max-height: 100%;
}

/* Overlapping Div (transição de batalha) */
#overlappingDiv {
  background-color: black;
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  opacity: 0;
  pointer-events: none;
}

/* Tela Inicial */
#introScreen {
  background-image: url(/img/MapaFundo.png);
  background-size: cover;
  position: fixed;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
}

/* Logo do Jogo */
.logo-image {
  max-width: 80%;
  height: auto;
  max-height: 60vh;
}

/* Botão "INICIAR" */
#initButton {
  display: flex;
  align-items: center;
  font-size: 1.5rem;
  gap: 0.8rem;
  margin-top: 1rem;
  cursor: pointer;
  background: none;
  font-family: "Press Start 2P", cursive;
  border: none;
  color: white;
  outline: none;
  padding: 0;
}

/* Ícone do Botão */
.button-icon {
  height: 1.5em;
  width: auto;
  transition: all 0.3s ease;
}

/* Tela da História */
#storyScreen {
  display: none;
  position: fixed;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
}

/* Container da História */
.story-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 100%;
  padding: 2rem;
  max-width: 800px;
  margin: 0 auto;
}

/* Texto da História */
#storyText {
  white-space: pre-line;
  font-size: 1.2rem;
  margin-bottom: 3rem;
  line-height: 1.6;
  text-align: justify;
}

/* Botão "START" */
#startButton {
  cursor: pointer;
  width: 120px;
  height: auto;
  padding: 0;
  margin: 20px auto 0;
  display: block;
  transition: none;
}

/* Container dos Botões */
.button-container {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-top: 1rem;
}


#controlsOverlay {
  background-color: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
}


.controls-container {
  background: linear-gradient(145deg, #171717, #242424); 
  border: 2px solid #a14a27;
  border-radius: 8px;
  padding: 2.5rem 3rem;
  box-shadow: 0 0 20px rgba(235, 179, 21, 0.3), 
  inset 0 0 15px rgba(0, 0, 0, 0.5); 
  max-width: 650px;
  text-align: center;
}


.controls-container h2 {
  color: #ffffff;
  text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.7);
  margin-bottom: 2rem;
  font-size: 2rem;
}


.instructions-text {
  text-align: left;
  line-height: 1.8;
  font-size: 1rem;
  color: #e0e0e0;
}


.instructions-text strong {
  color: #ffa12b;
  font-weight: normal;
}

.pixel-button-fire {
  font-family: 'Press Start 2P', cursive;
  font-weight: bold;
  font-size: 20px; /* diminui de 36px para 20px */
  color: white;
  background-color: #FFA12B;
  border: none;
  padding: 12px 28px; /* menor que antes */
  cursor: pointer;
  margin: 20px;
  text-align: center;
  text-shadow: 0px 1px 0px #000;
  position: relative;
  border-radius: 5px;

  /* sombra e relevo */
  box-shadow: inset 0 1px 0 #FFE5C4, 0 6px 0 #915100;

  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);

  transition: all 0.15s ease;
  overflow: visible;
}

.pixel-button-fire:hover {
  background-color: #F78900;
}

.pixel-button-fire::after {
  content: "";
  position: absolute;
  bottom: -15px;
  left: -4px;
  width: 100%;
  height: 100%;
  background-color: #2B1800;
  border-radius: 5px;
  z-index: -1;
  padding: 4px;
  pointer-events: none;
}

#user-interface {
  display: none;
}

/* Barra de Batalha */
.battle-bar {
  height: 100px;
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.8);
  border-top: 4px solid #444;
  display: flex;
  z-index: 10;
  font-family: "Press Start 2P", cursive;
  pointer-events: auto;
}

/* Área dos Botões de Ataque */
.attack-buttons {
  width: 66.66%;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.8rem;
  padding: 1rem;
  justify-items: center;
  align-items: center;
}

/* Botões de Ataque */
.attack-buttons button {
  background-color: #1a1a1a;
  border: 2px solid rgb(0, 0, 0);
  color: white;
  font-family: "Press Start 2P", cursive;
  font-size: 0.7rem;
  text-transform: none;
  cursor: pointer;
  padding: 0.5rem 0.8rem;
  width: fit-content;
  transition: background-color 0.2s, color 0.2s;
}

/* Destaque no Botão*/
.attack-buttons button:hover {
  background-color: white;
  color: black;
}

/* Área do Tipo de Ataque */
.attack-type {
  width: 33.33%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

/* Tipo de Ataque */
.attack-type h1 {
  font-size: 0.7rem;
  color: white;
  background-color: #1a1a1a;
  padding: 0.5rem 1rem;
  border: 2px solid rgb(0, 0, 0);
  text-transform: none;
}

/* Div que controla toda a Batalha */
.battle-status-container {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 60px;
  z-index: 30;
  background: rgba(0, 0, 0, 0.7);
  padding: 10px 20px;
  border-radius: 10px;
}

/* Vida do Player e Enemy */
.health-bar-container {
  display: flex;
  align-items: center;
  padding: 10px 15px;
  gap: 12px;
  width: auto;
}

/* Ícone do Personagem */
.character-icon {
  width: 48px;
  height: 48px;
  border: 2px solid #fff;
  border-radius: 50%;
}

/* Área da Barra de Vida */
.health-bar {
  position: relative;
  height: 10px;
  width: 200px;
  background: #333;
  border-radius: 5px;
  overflow: hidden;
}

/* Fundo da Barra de Vida */
.health-bar-bg {
  background-color: #ccc;
  height: 100%;
  width: 100%;
}

/* Barra de Vida */
.health-bar-fill {
  background: linear-gradient(to right, #4CAF50, #8BC34A);
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
}

/* VS */
.vs-icon-container {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* VS - Icon */
.vs-icon {
  width: 50px;
  height: 50px;
  filter: drop-shadow(0 0 5px rgba(173, 164, 164, 0.7));
}

/* Barra de Diálogo */
#dialogue-box {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background-color: rgb(0, 0, 0);
  padding: 12px;
  display: none;
  cursor: pointer;
}

/* Diálogo NPCS */
#characterDialogueBox {
  background-color: white;
  height: 100px;
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  border-top: 4px black solid;
  display: none;
  padding: 12px;
  color: black;
  line-height: 2rem;
}


#controlsOverlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: rgba(0, 0, 0, 0.8);
  padding: 2rem;
  border-radius: 12px;
  color: white;
}

.controls-container {
  background-color: rgba(0, 0, 0, 0.7);
  padding: 2rem;
  border: 4px solid #4a4a4a;
  border-radius: 10px;
  max-width: 600px;
  width: 90%;
  text-align: center;
}

.control-row {
  display: flex;
  align-items: center;
  margin: 1.5rem 0;
  justify-content: flex-start;
  padding: 0 1rem;
}

.key {
  background-color: #333;
  color: white;
  border: 2px solid #666;
  border-radius: 5px;
  width: 50px;
  height: 50px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-right: 1.5rem;
  font-size: 1.4rem;
}

#startButton {
  background-color: #4CAF50;
  border: none;
  color: white;
  padding: 15px 30px;
  font-size: 1rem;
  cursor: pointer;
  font-family: 'Press Start 2P', cursive;
  border-radius: 5px;
  transition: all 0.3s;
}

#startButton:hover {
  background-color: #45a049;
  transform: scale(1.05);
}

@media (max-height: 700px),
(max-width: 1000px) {
  .battle-status-container {
    top: 5px;
    padding: 1px 5px;
    gap: 30px;
    background-color: transparent;
  }

  .battle-bar {
    height: 80px;
    font-size: 0.6rem;
  }

  .attack-buttons {
    width: 100%;
    padding: 1rem;
    gap: 0.8rem;
  }

  .vs-icon {
    width: 40px;
    height: 40px;
  }

  .character-icon {
    width: 36px;
    height: 36px;
  }

  .battle-dialogue {
    font-size: 1rem;
  }
}

