/* ================================================== */
/* 🔹 PANTALLA INICIAL */
#pantalla-inicial {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 40px;
  z-index: 1000;
  overflow: hidden;
  background: url("Imagen/Oeste3.png") center/cover no-repeat;
  filter: grayscale(50%) brightness(85%) contrast(110%);
  animation: fondoZoom 15s ease-in-out infinite alternate;
}

@keyframes fondoZoom {
  0% {
    transform: scale(1) translateY(0);
  }

  100% {
    transform: scale(1.09) translateY(-2%);
  }
}

/* ================================================== */
/* 🔹 CARTEL PRINCIPAL */
#cartel-inicial {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: clamp(20px, 4vw, 40px) clamp(30px, 6vw, 60px);
  border: 6px solid #3e1f0f;
  border-radius: 12px;
  background: linear-gradient(145deg, #5a3b1a, #3e1f0f);
  box-shadow:
    inset 0 0 15px rgba(255, 140, 0, 0.3),
    0 0 25px rgba(255, 150, 50, 0.6);
  text-align: center;
  opacity: 0;
  transform: scale(0.9);
  animation: cartelEntrada 1s ease-out forwards;
  animation-delay: 0.5s;
  max-width: 90%;
  width: auto;
  box-sizing: border-box;
}

@keyframes cartelEntrada {
  0% {
    opacity: 0;
    transform: scale(0.8) rotate(-3deg);
  }

  60% {
    opacity: 1;
    transform: scale(1.05) rotate(2deg);
  }

  100% {
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }
}

/* 🔹 TÍTULO DEL CARTEL */
#cartel-inicial h1 {
  font-family: "Bangers", cursive;
  font-size: clamp(2.5em, 6vw, 5em);
  color: #fce5b3;
  text-shadow: 2px 2px 0 #000, 0 0 10px rgba(255, 165, 0, 0.8);
  margin: 0;
  position: relative;
}



/* ================================================== */
/* 🔹 SUBTÍTULO */
#subtitulo-gallina {
  font-family: "Fjalla One", sans-serif;
  font-size: clamp(1em, 2.5vw, 2em);
  color: #ff9100;
  margin-top: 10px;
  opacity: 0;
  transform: translateY(-20px) rotate(-15deg);
  text-shadow: 0 0 8px #ff4000, 0 0 16px #ff9100, 0 0 32px #ff2200;
  animation: aparecerGallina 1s ease forwards, reboteGallina 0.5s ease 1s 1;
}

@keyframes aparecerGallina {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.5) rotate(-15deg);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1) rotate(0deg);
  }
}

@keyframes reboteGallina {
  0% {
    transform: scale(0.8) rotate(-5deg);
  }

  50% {
    transform: scale(1.15) rotate(10deg);
  }

  70% {
    transform: scale(0.95) rotate(-3deg);
  }

  100% {
    transform: scale(1) rotate(0deg);
  }
}

/* ================================================== */
/* 🔹 BOTONES INICIO */

.botones-inicio {
  display: flex;
  gap: clamp(20px, 5vw, 50px);
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
}

#pantalla-inicial button {
  font-family: "Fjalla One", sans-serif;
  font-size: clamp(1.1em, 2.5vw, 1.7em);
  width: clamp(170px, 18vw, 230px);
  height: clamp(60px, 12vh, 80px);
  border: 3px solid #3e1f0f;
  border-radius: 12px;
  background: linear-gradient(145deg, #5a3b1a, #3e1f0f);
  color: #fce5b3;
  text-shadow: 1px 1px 0 #000;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.6);
}

#pantalla-inicial button:hover {
  background: linear-gradient(145deg, #7b5022, #5a3b1a);
  transform: scale(1.1) rotate(-1deg);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.8);
}

#pantalla-inicial button:active {
  transform: scale(0.95);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.7);
}


/* ================================================== */
/* 🔹 RESET Y CONFIGURACIÓN BÁSICA */
/* ================================================== */

body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  font-family: "Rockwell", sans-serif;
  text-align: center;
  padding: 5px;
  color: #3e2f1c;

  background: linear-gradient(to bottom,
      rgba(216, 153, 101, 0.8),
      rgba(222, 184, 135, 0.8)),
    url("Imagen/Oeste2.png");
  background-size: cover;
  background-position: center center;
}

/* ================================================== */
/* 🔹 MENSAJES Y NIVELES */
/* ================================================== */

#mensaje {
  font-family: "Bangers", cursive;
  font-size: 30px;
  color: #5a3b1a;
  text-shadow: 1px 1px 0 #d2b48c;
  margin-top: 10px;
}

#nivel-info {
  font-family: "Bangers", cursive;
  font-size: 25px;
  color: #5a3b1a;
  text-shadow: 1px 1px 0 #d2b48c;
  text-align: center;
  margin-top: 0px;
  line-height: 1.2;
}

#nivel-info p:last-child {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 0px;
}

/* ================================================== */
/* 🔹 CAMPO DE CONTRASEÑA */
/* ================================================== */

.campo-password {
  display: inline-block;
  position: relative;
  margin-top: 10px;
}

#password {
  font-family: "Bangers", cursive;
  font-size: 20px;
  color: #5a3b1a;
  text-shadow: 1px 1px 0 #d2b48c;
  text-align: center;
  margin-top: 5px;
  visibility: hidden;
  opacity: 0;
  transition: visibility 0.3s ease, opacity 0.3s ease;
}

.campo-password:hover #password {
  visibility: visible;
  opacity: 1;
}

/* ================================================== */
/* 🔹 ZONA DE BOTONES */
/* ================================================== */

#zona-control {
  margin-top: 20px;
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

button {
  margin-top: 10px;
  font-family: "Fjalla One", sans-serif;
  font-size: 1.3em;
  font-weight: bold;
  width: 160px;
  height: 160px;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  padding: 0 5px;
  white-space: nowrap;
  touch-action: manipulation;

  display: flex;
  align-items: center;
  justify-content: center;

  color: #fff;
  background-color: #ff7f32;
  text-shadow: -1px -1px 0 #643713, 1px -1px 0 #643713,
    -1px 1px 0 #643713, 1px 1px 0 #643713;

  box-shadow: 0 6px 15px rgba(255, 127, 50, 0.6);
  transition: all 0.3s ease;
}

button:disabled {
  background-color: #c08b5680;
  cursor: not-allowed;
}

button:hover:enabled {
  background-color: #f8a62b;
  transform: scale(1.1);
  box-shadow: 0 10px 30px rgba(255, 127, 50, 0.8);
}

button:active {
  transform: scale(1.05);
  box-shadow: 0 4px 10px rgba(224, 177, 25, 0.699);
}

/* ================================================== */
/* 🔹 BALAS */
/* ================================================== */

#balas {
  display: flex;
  gap: 8px;
  vertical-align: middle;
  margin-left: 12px;
}

.bala {
  width: 18px;
  height: 25px;
  border-radius: 40% 40% 30% 30%;
  border: 2px solid #111;
  transition: 0.25s ease;

  background: linear-gradient(145deg, #555, #222);
  box-shadow: inset 0 2px 3px rgba(255, 255, 255, 0.2),
    inset 0 -2px 3px rgba(0, 0, 0, 0.6),
    0 1px 2px rgba(0, 0, 0, 0.4);
}

.bala.activa {
  border: 2px solid #666;
  transform: translateY(-2px) scale(1.05);

  background: linear-gradient(160deg, #d9d9d9, #7e7e7e, #b5b5b5);
  box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.6),
    inset 0 -2px 4px rgba(0, 0, 0, 0.5),
    0 0 8px rgba(200, 200, 200, 0.6);
}

/* ================================================== */
/* 🔹 VIDAS */
/* ================================================== */
#vidas {
  display: flex;
  gap: 2px;
  align-items: center;
}

.vida {
  width: 25px;
  height: 25px;
  display: inline-block;
  position: relative;
  transition: 0.25s ease;
}

.vida.activa::before {
  content: "❤︎";
  color: #da4e3e;
  display: inline-block;
  vertical-align: middle;
  transform-origin: center;
  animation: latido 3s infinite;
}

.vida.perdida::before {
  content: "✖︎";
  color: #5a3b1a;
  display: inline-block;
}

@keyframes latido {

  0%,
  100% {
    transform: scale(1);
  }

  25%,
  75% {
    transform: scale(1.2);
  }

  50% {
    transform: scale(1);
  }
}

/* ================================================== */
/* 🔹 ICONOS */
/* ================================================== */
.icon {
  opacity: 0.7;
  font-size: 2rem;
  margin-right: 8px;
  vertical-align: middle;
}

/* Solo mostrar en móviles */
.solo-movil {
  display: none;
}

/* ================================================== */
/* 🔹 RESPONSIVE */
/* ================================================== */

/* Mostrar botones VS en móviles y tablets */
@media (max-width: 1024px) {
  .solo-movil {
    display: inline-flex;
  }

  #pantalla-inicial button {
    font-size: clamp(1em, 3.5vw, 1.5em);
    width: clamp(140px, 50%, 220px);
    height: clamp(50px, 10vh, 70px);
  }

  /* Ajustes del cartel principal */
  #cartel-inicial {
    padding: clamp(15px, 4vw, 30px);
    max-width: 90%;
    width: auto;
  }

  #cartel-inicial h1 {
    font-size: clamp(2em, 8vw, 4em);
  }

  #subtitulo-gallina {
    font-size: clamp(0.9em, 5vw, 1.5em);
    margin-top: 10px;
  }

  /* Ajustes generales de layout */
  body {
    padding: 5px;
    margin: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
  }

  #zona-control {
    gap: 10px;
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
  }

  /* Iconos dentro de botones */
  .icon {
    font-size: 1.5rem;
    margin-right: 5px;
  }
}

@media (max-width: 768px) {

  .solo-movil {
    display: inline-flex;
  }

  #pantalla-inicial button {
    font-size: clamp(1em, 4vw, 1.5em);
    width: clamp(140px, 60%, 220px);
  }

  #cartel-inicial {
    padding: clamp(15px, 4vw, 30px);
  }

  #cartel-inicial h1 {
    font-size: clamp(2em, 8vw, 4em);
  }

  #subtitulo-gallina {
    font-size: clamp(0.9em, 5vw, 1.5em);
  }

  #pantalla-inicial button {
    font-size: clamp(1em, 4vw, 1.5em);
    width: clamp(140px, 30vw, 200px);
    height: clamp(50px, 10vh, 70px);
  }

  body {
    padding: 5px;
    margin: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
  }

  #mensaje {
    font-size: 24px;
    margin: 20px 0 10px 0;
  }

  #nivel-info {
    font-size: 20px;
    line-height: 1.2;
    margin: 10px 0 5px 0;
  }

  #password {
    margin-top: 5px;
    font-size: 16px;
  }

  #zona-control {
    gap: 10px;
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
  }

  #boton-disparo-container {
    order: -1;
    display: none;
    margin-bottom: 10px;
    text-align: center;
  }

  button {
    width: 120px;
    height: 120px;
    font-size: 1em;
    padding: 6px;
    position: relative;
    text-align: center;
    white-space: nowrap;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }

  .icon {
    font-size: 1.7rem;
    margin-right: 5px;
  }

  #nivel-info p:last-child {
    gap: 6px;
    margin-top: 4px;
  }

  #balas {
    gap: 5px;
  }

  .bala {
    width: 14px;
    height: 22px;
  }

  #vidas {
    gap: 2px;
  }
}

/* ================================================== */
/* 🔹 RESPONSIVE - MÓVILES PEQUEÑOS */
/* ================================================== */
@media (max-width: 480px) {

  .solo-movil {
    display: inline-flex;
  }

  #pantalla-inicial button {
    font-size: clamp(1em, 4vw, 1.5em);
    width: clamp(140px, 60%, 220px);
  }

  #cartel-inicial {
    padding: clamp(10px, 4vw, 20px);
  }

  #cartel-inicial h1 {
    font-size: clamp(1.8em, 10vw, 3em);
  }

  #subtitulo-gallina {
    font-size: clamp(0.8em, 6vw, 1.3em);
  }

  #pantalla-inicial button {
    font-size: clamp(0.9em, 5vw, 0.9em);
    width: clamp(120px, 35vw, 190px);
    height: clamp(45px, 9vh, 60px);
  }

  body {
    padding: 5px;
    margin: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
  }

  #mensaje {
    font-size: 20px;
    margin: 15px 0 10px 0;
  }

  #nivel-info {
    font-size: 18px;
    margin: 5px 0 3px 0;
  }

  #password {
    margin-top: 3px;
    font-size: 16px;
  }

  #zona-control {
    gap: 10px;
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
  }

  #boton-disparo-container {
    order: -1;
    display: none;
    margin-bottom: 10px;
    text-align: center;
  }

  button {
    width: 90px;
    height: 90px;
    font-size: 0.85em;
    padding: 4px;
    white-space: nowrap;
  }

  .icon {
    font-size: 1.3rem;
    margin-right: 4px;
  }

  #nivel-info p:last-child {
    gap: 4px;
    margin-top: 3px;
  }

  #balas {
    gap: 4px;
  }

  .bala {
    width: 12px;
    height: 18px;
  }

  #vidas {
    gap: 2px;
  }
}