 /* =====================================================
       PAGE SETUP
    ===================================================== */

    body {
      margin: 0;
      min-height: 100vh;
      font-family: Arial, sans-serif;
      background: #ffffff;
    }


/* =====================================================
   HIDDEN UTILITY
===================================================== */

.hidden {
   display: none !important;
}


/* =====================================================
   GAME SCREEN
===================================================== */

.game-container {
  width: 100%;
}

.game-screen {
  width: 100%;
  max-width: 900px;
  margin: 0px auto;
  padding: 10px;
  text-align: center;
}


/* =====================================================
   GAME TOPBAR
===================================================== */

.game-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 600px;
  margin: 0 auto 20px;
}

.help-button {
  border: none;
  background: #f4a8ff;
  padding: 10px 18px;
  border-radius: 18px;
  font-weight: 700;
  cursor: pointer;
}

.level-label {
  font-size: 22px;
  font-weight: 700;
}

.home-button {
  background: #FFD93D;
  color: #333;
  padding: 8px 14px;
  border-radius: 25px;
  font-weight: 600;
  text-decoration: none;
  font-family: 'Fredoka', sans-serif;
  box-shadow: 0 4px 0 #e6c12f;
  transition: all 0.15s ease;
}

.home-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 0 #e6c12f;
}

.rule-button {
  border: none;
  background: #7FB3D5;
  padding: 10px 18px;
  border-radius: 18px;
  font-weight: 700;
  cursor: pointer;
}

.rule-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 0 burlywood;
}

/* =====================================================
   AUDIO ZONE
===================================================== */

.audio-zone {
  margin: 20px auto;
}

.play-audio-button {
  border: none;
  background: #31c950;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  font-size: 34px;
  cursor: pointer;
  box-shadow: 0 5px 0 #f4a8ff;
}

/* =====================================================
   AUDIO BUTTON ACTIVE
===================================================== */

.play-audio-button.active-audio {
  background: #FFD93D;
  transform: scale(1.08);
}

/* =====================================================
   BATTLE BOARD
===================================================== */

.battle-board {
  display: grid;
  gap: 15px;
  max-width: 520px;
  margin: 15px auto 10px;
}

/* =====================================================
   BOARD CELLS
===================================================== */

.battle-cell {
  aspect-ratio: 1 / 1;
  background: white;
  border-radius: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 48px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.12);
  cursor: pointer;
  transition: transform 0.2s ease;
}

.battle-cell:hover {
  transform: scale(1.04);
}

/* =====================================================
   IMÁGENES DEL TABLERO
===================================================== */

.battle-cell img {
  width: 85%;
  height: 85%;
  object-fit: contain;
}

/* =====================================================
   BOTONES DE RESPUESTA
===================================================== */

.answer-buttons {
  display: flex;
  justify-content: center;
  gap: 5px;

  width: fit-content;
  margin: 25px auto 0;

  border: 4px solid #8EDBFF;
  border-radius: 20px;
  padding: 12px 18px;
  background: white;
}

.answer-button {
  width: 80px;
  height: 80px;
  border: none;
  border-radius: 50%;
  font-size: 36px;
  cursor: pointer;
  transition: transform 0.2s ease;
  box-shadow: 0 5px 0 rgba(0,0,0,0.15);
}

.answer-button:hover {
  transform: translateY(-4px);
}

.yes-button {
  background: #7CFF8A;
}

.no-button {
  background: #FF8A8A;
}

/* =====================================================
   BATTLE HUD
===================================================== */

.battle-hud {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 15px;

  width: fit-content;
  margin: -12px auto 0;
}

/* =====================================================
   ZONAS DE BARCOS
===================================================== */

.player-ship-zone,
.enemy-ship-zone {
  width: 120px;
  height: 110px;
  object-fit: contain;

  display: flex;
  justify-content: center;
  align-items: center;

  border-radius: 18px;
  background: white;
}

.player-ship-zone {
  border: 4px solid #31C950;
}

.enemy-ship-zone {
  border: 4px solid #F4A8FF;
}

.ship-image {
  width: 110px;
  height: 110px;
  object-fit: contain;
}

/* =====================================================
   FEEDBACK RESPUESTA CORRECTA
===================================================== */

.correct-feedback {
  outline: 5px solid #31C950;
  transform: scale(1.05);
}

/* =====================================================
   FEEDBACK RESPUESTA INCORRECTA
===================================================== */

.wrong-feedback {
  outline: 5px solid #FB2C36;
  transform: scale(0.95);
}

/* =====================================================
   VELO VERDE PERMANENTE
===================================================== */

.battle-cell {
  position: relative;
  overflow: hidden;
}

.correct-permanent-mark::after {
  content: "";
  position: absolute;
  inset: 0;

  background: rgba(49, 201, 80, 0.28);

  border-radius: 20px;
  pointer-events: none;
}

/* =====================================================
   VELO NARANJA PERMANENTE
===================================================== */

.wrong-permanent-mark::after {
  content: "";
  position: absolute;
  inset: 0;

  background: rgba(255, 179, 71, 0.38);

  border-radius: 20px;
  pointer-events: none;
}

/* =====================================================
   IMPACTOS VISIBLES EN LOS BARCOS
===================================================== */

.player-ship-zone,
.enemy-ship-zone {
  position: relative;
}

.ship-hits {
  position: absolute;
  top: 50px;
  left: 50%;
  transform: translateX(-50%);

  display: flex;
  gap: 4px;

  font-size: 22px;
  pointer-events: none;
}

.hit-mark {
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.3));
}

/* =====================================================
   MODAL DE REGLAS DEL JUEGO
===================================================== */

.rules-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 999;
  padding: 20px;
}

.rules-content {
  position: relative;
  background: linear-gradient(180deg, #8EDBFF, #FFFFFF);
  border: 5px solid #31C950;
  border-radius: 28px;
  padding: 30px;
  max-width: 620px;
  width: 100%;
  text-align: center;
  box-shadow: 0 10px 0 #F4A8FF;
}

.rules-content h2 {
  font-size: 2rem;
  margin-bottom: 24px;
}

.rules-close {
  position: absolute;
  top: 14px;
  right: 14px;
  border: none;
  background: #FB2C36;
  color: white;
  font-size: 1.2rem;
  border-radius: 50%;
  width: 38px;
  height: 38px;
  cursor: pointer;
}

.rules-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

.rules-card {
  background: white;
  border-radius: 22px;
  padding: 20px;
  box-shadow: 0 5px 0 #8EDBFF;
}

.rules-card span {
  display: block;
  font-size: 2.4rem;
  margin-bottom: 10px;
}

.rules-card p {
  font-weight: 700;
  font-size: 1.1rem;
  margin: 0;
}


/* =====================================================
   END GAME MODAL
===================================================== */

.endgame-modal {
  position: fixed;
  inset: 0;

  background: rgba(0, 0, 0, 0.55);

  display: flex;
  justify-content: center;
  align-items: center;

  z-index: 9999;

  padding: 20px;
}

/* =====================================================
   CONTENIDO MODAL FINAL
===================================================== */

.endgame-content {
  background: linear-gradient(180deg, #8EDBFF, #FFFFFF);

  border: 5px solid #31C950;

  border-radius: 28px;

  padding: 30px;

  width: 100%;
  max-width: 650px;

  text-align: center;

  box-shadow: 0 10px 0 #F4A8FF;
}

/* =====================================================
   TÍTULO FINAL
===================================================== */

.endgame-content h2 {
  font-size: 2.2rem;
  margin-bottom: 20px;
}

/* =====================================================
   ESTADÍSTICAS FINALES
===================================================== */

.endgame-stats {
  display: flex;
  justify-content: center;
  gap: 30px;

  margin-bottom: 28px;

  font-size: 1.2rem;
  font-weight: 700;
}

/* =====================================================
   ZONA DE BARCOS FINALES
===================================================== */

.endgame-ships {
  display: flex;
  justify-content: center;
  gap: 30px;

  flex-wrap: wrap;

  margin-bottom: 30px;
}

/* =====================================================
   BLOQUE INDIVIDUAL BARCO
===================================================== */

.final-ship-block {
  background: white;

  border-radius: 22px;

  padding: 18px;

  width: 220px;

  box-shadow: 0 5px 0 #8EDBFF;
}

.final-ship-block h3 {
  margin-top: 0;
  margin-bottom: 15px;
}

/* =====================================================
   IMÁGENES BARCOS FINALES
===================================================== */

.final-ship-image {
  width: 100%;
  max-width: 180px;
  object-fit: contain;
}

/* =====================================================
   BOTÓN PLAY AGAIN
===================================================== */

.play-again-button {
  border: none;

  background: #31C950;

  color: white;

  font-size: 1.1rem;
  font-weight: 700;

  padding: 14px 24px;

  border-radius: 20px;

  cursor: pointer;

  box-shadow: 0 5px 0 #F4A8FF;

  transition: transform 0.2s ease;
}

.play-again-button:hover {
  transform: translateY(-3px);
}

/* =====================================================
   RESPONSIVE ENDGAME MODAL
===================================================== */

@media (max-width: 600px) {

  .endgame-content {
    padding: 24px 18px;
  }

  .endgame-stats {
    flex-direction: column;
    gap: 10px;
  }

  .final-ship-block {
    width: 100%;
    max-width: 260px;
  }
}

/* =====================================================
   RESPONSIVE MODAL DE REGLAS
===================================================== */

@media (max-width: 600px) {
  .rules-cards {
    grid-template-columns: 1fr;
  }

  .rules-content {
    padding: 24px 18px;
  }
}
