body {
  margin: 0;
  padding: 0;
  background-color: #111;
  color: #fff;
  font-family: sans-serif;
  overflow-y: scroll;
  overflow-x: hidden;
  width: 100%;
  box-sizing: border-box;
}

* {
  box-sizing: border-box;
}

[id^="info"][id$="-toggle"] {
  cursor: pointer;
  transition: transform 0.3s ease;
  justify-content: space-between;
  color: #f0e8d8;
}

[id^="info"][id$="-toggle"]::after {
  content: '>';
  font-size: 0.9em;
  font-weight: bold;
  color: #888;
  margin-left: auto;
  transition: transform 0.3s ease;
  display: inline-block;
}

[id^="info"][id$="-toggle"].expanded::after {
  transform: rotate(90deg);
}

/* Estilo para el contenedor principal */
.main-layout {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 20px;
  padding: 20px;
  flex-wrap: wrap;
}

.tablero-container {
  position: relative;
  width: 100%;
  max-width: 839px;
}

.tablero {
  width: 100%;
  height: auto;
  display: block;
  border: 2px solid #5a4d2f;
  border-radius: 6px;
}

.tablero_moral {
  width: 100%;
  max-width: 50%;
  height: auto;
  display: block;
  border: 2px solid #5a4d2f;
  border-radius: 6px;
  margin: 0 auto; /* Center horizontally */
}

.tablero_secuencia {
  width: 100%;
  max-width: 60%;
  height: auto;
  display: block;
  border: 2px solid #5a4d2f;
  border-radius: 6px;
  margin: 0 auto; /* Center horizontally */
}

.tablero_marcadores {
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
  border: 2px solid #5a4d2f;
  border-radius: 6px;
  margin: 0 auto; /* Center horizontally */
}

.zona {
  position: absolute;
  width: 5%;
  height: 6%;
  background-color: rgba(255, 255, 0, 0.352);
  border-radius: 50%;
  cursor: pointer;
  z-index: 2;
  transition: transform 0.2s ease, background-color 0.2s ease;
  transform: scale(1);
}

.zona:hover {
  background-color: rgba(255, 255, 0, 0.5);
}

/* Evitar efectos amarillos en zonas del menú */
.menu .zona {
  background-color: transparent !important;
  border-radius: 4px !important;
}

.menu .zona:hover {
  background-color: transparent !important;
}

.zona[data-size="boton_menu"] {
  width: 160px;
  height: 30px;
  border-radius: 4px;
  text-align: left;
  margin: -20px 0 !important;
}

#tooltip-container {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 100;
}

.tooltip {
  position: absolute;
  background: radial-gradient(ellipse at top left, #fdf5d2 0%, #e9d9a7 100%);
  color: #3b2e18;
  font-family: 'Cinzel', serif; /* Usa una fuente temática si está disponible */
  font-size: 14px;
  padding: 10px 14px;
  border-radius: 8px;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 9999;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
  border: 1px solid #b49c65;
  transform: translateY(-12px);
  text-shadow: 0 1px 1px rgba(255, 255, 255, 0.3);
}

.tooltip.visible {
  opacity: 1;
  transform: translateY(0);
}

.tooltip::after {
  content: '';
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  border-width: 8px;
  border-style: solid;
}

.tooltip-left::after {
  right: -8px;
  border-color: transparent transparent transparent #c9650e98;
}

.tooltip-right::after {
  left: -8px;
  border-color: transparent #c9650e98 transparent transparent;
}

/* Panel de detalle */
.info-detallada {
  background-color: #222;
  color: #fff;
  border-radius: 8px;
  padding: 20px;
  flex-shrink: 1;
  width: 350px;
  font-family: sans-serif;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
}

.info-detallada h2 {
  margin-top: 0;
  font-size: 18px;
  border-bottom: 1px solid #333;
  padding-bottom: 5px;
}

.info-detallada p {
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-line;
}

.info-detallada span {
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-line;
}

/* Estilo top botones */

button {
  padding: 0px 2px;
  margin: 0 10px;
  background: linear-gradient(to bottom, #7b6237, #3e2f1b);
  color: #fdf6d8;
  border: 2px solid #2c1e0f;
  border-radius: 8px;
  font-size: 0.80rem;
  letter-spacing: 1px;
  box-shadow: 0 4px 0 #2c1e0f;
  cursor: pointer;
  transition: all 0.3s ease;
  text-shadow: 1px 1px 1px #000;
}

button:hover {
  background: linear-gradient(to bottom, #a98b59, #5e4b2a);
  box-shadow: 0 2px 0 #1a1209;
  transform: translateY(2px);
}

#btn-eng_version {
  background: linear-gradient(to bottom, #ffe066, #bfa100);
  color: #3b2e18;
  border: 2px solid #bfa100;
  font-weight: bold;
  text-shadow: 1px 1px 1px #fff7d0;
  text-align: left;
}

#btn-eng_version:hover {
  background: linear-gradient(to bottom, #fff3b0, #e6c200);
  color: #000;
}

#btn-esp_version {
  background: linear-gradient(to bottom, #ffe066, #bfa100);
  color: #3b2e18;
  border: 2px solid #bfa100;
  font-weight: bold;
  text-shadow: 1px 1px 1px #fff7d0;
  text-align: left;
}

#btn-esp_version:hover {
  background: linear-gradient(to bottom, #fff3b0, #e6c200);
  color: #000;
}

/* Estilos específicos desactivados - ahora usan el estilo de su categoría
#btn-grog {
  background: linear-gradient(to bottom, #ffe066, #bfa100);
  color: #3b2e18;
  border: 2px solid #bfa100;
  font-weight: bold;
  text-shadow: 1px 1px 1px #fff7d0;
  text-align: left;
}

#btn-grog:hover {
  background: linear-gradient(to bottom, #fff3b0, #e6c200);
  color: #000;
}

#btn-menu-audio {
  background: linear-gradient(to bottom, #ffe066, #bfa100);
  color: #3b2e18;
  border: 2px solid #bfa100;
  font-weight: bold;
  text-shadow: 1px 1px 1px #fff7d0;
  text-align: left;
}

#btn-tablero19 {
  background: linear-gradient(to bottom, #ffe066, #bfa100);
  color: #3b2e18;
  border: 2px solid #bfa100;
  font-weight: bold;
  text-shadow: 1px 1px 1px #fff7d0;
  text-align: left;
}

#btn-tablero19:hover {
  background: linear-gradient(to bottom, #fff3b0, #e6c200);
  color: #000;
}
*/

#btn-web-eclipse_eng {
  background: linear-gradient(to bottom, #ffe066, #bfa100);
  color: #3b2e18;
  border: 2px solid #bfa100;
  font-weight: bold;
  text-shadow: 1px 1px 1px #fff7d0;
  text-align: left;
}

#btn-web-eclipse_eng:hover {
  background: linear-gradient(to bottom, #fff3b0, #e6c200);
  color: #000;
}

.menu {
  position: relative;
  top: 0px;
  left: 0px;
  z-index: 10;
  padding: 0px;
  margin-top: -10px;
}

.menu button {
  margin: 2px;
  padding: 0px 0px;
  background: linear-gradient(to bottom, #b49b5a, #695b35);
  color: #fff7d0;
  border: 1px solid #3b2c13;
  border-radius: 6px;
  font-size: 0.75rem;
  text-shadow: 1px 1px 1px #000;
}

.menu button.activo {
  filter: brightness(1.25) saturate(1.1) !important;
}

/* Animaciones entre tableros */
.tablero-container,
.tablero-board {
  opacity: 0;
  visibility: hidden;
  position: absolute;
  transition: opacity 0.5s ease;
}

.tablero-visible {
  opacity: 1;
  visibility: visible;
  position: relative;
}

/* top SK logo */
.menu-logo {
  display: block;
  width: 160px;
  margin: 0 auto 4px;
}

/* top SK titulo */
.titulo-pirata {
  font-family: 'Pirata One', cursive;
  font-size: 2.5rem;
  color: #c9b37e;
  text-shadow: 2px 2px 4px #000;
  text-align: center;
  margin-bottom: 1rem;
}

/* cabecera pirata font */
.cabecera-pirata {
  font-family: 'Pirata One', cursive;
  font-size: 1.2rem;
  color: #d0c482;
  text-shadow: 2px 2px 4px #000;
  text-align: left;
}

/* adaptación a pantallas pequeñas */
.main-layout {
  display: flex;
  min-height: 100vh;
  justify-content: center;
  align-items: flex-start;
  gap: 10px;
  padding: 10px;
  flex-wrap: nowrap; /* Cambiado: evita que salte debajo */
}

@media (max-width: 1200px) {
  .main-layout {
    flex-wrap: nowrap; /* Vuelve a envolver solo si es necesario */
  }

  .info-detallada {
    flex: 1 1 300px;
    max-width: 100%;
    min-width: 250px;
    margin-top: 20px;
  }

  .tablero-container {
    max-width: 100%;
  }
}

@media (max-width: 768px) {
  /* Ocultar menú lateral en móviles verticales */
  .menu {
    display: none;
  }

  /* Ocultar tooltips en móviles */
  .tooltip {
    display: none !important;
    opacity: 0 !important;
    pointer-events: none !important;
  }

  /* Ajustar layout principal */
  .main-layout {
    flex-direction: column;
    padding: 5px;
    gap: 10px;
    width: 100%;
    box-sizing: border-box;
  }

  /* Contenedor de tablero ocupa todo el ancho */
  .tablero-container {
    max-width: 100%;
    width: 100%;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }

  /* Ajustar imágenes */
  .tablero {
    width: 100%;
    height: auto;
    max-width: 100%;
  }

  .tablero_moral,
  .tablero_secuencia,
  .tablero_marcadores {
    max-width: 100%;
    width: 100%;
  }

  /* Panel de información */
  .info-detallada {
    width: 100%;
    max-width: 100%;
    padding: 10px;
    font-size: 14px;
    box-sizing: border-box;
  }

  .info-detallada h2 {
    font-size: 16px;
    margin-top: 10px;
    margin-bottom: 8px;
  }

  .info-detallada h3 {
    font-size: 14px;
  }

  .info-detallada p,
  .info-detallada ul,
  .info-detallada li {
    font-size: 13px;
    line-height: 1.4;
  }

  /* Título pirata más pequeño */
  .titulo-pirata {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
  }

  /* Banner de orientación */
  #orientation-warning {
    font-size: 16px;
    padding: 15px;
    font-weight: bold;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10000;
  }

  /* Ajustar margen superior cuando el banner esté visible */
  body.portrait-warning {
    padding-top: 70px;
  }

  /* Scroll horizontal si es necesario */
  .main-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Ajustar zonas interactivas para pantallas táctiles pequeñas */
  .zona {
    width: 8%;
    height: 8%;
    min-width: 30px;
    min-height: 30px;
  }
}

/* Media query específico para móviles en portrait (verticales) */
@media (max-width: 500px) and (orientation: portrait) {
  body {
    overflow-x: hidden;
  }

  .main-layout {
    padding: 3px;
    gap: 8px;
  }

  .tablero-container {
    padding: 0;
  }

  .info-detallada {
    padding: 8px;
    font-size: 13px;
  }

  .info-detallada h2 {
    font-size: 15px;
  }

  .info-detallada h3 {
    font-size: 13px;
  }

  .info-detallada p,
  .info-detallada ul,
  .info-detallada li {
    font-size: 12px;
  }

  /* Hacer que las zonas sean más grandes en pantallas pequeñas */
  .zona {
    width: 10%;
    height: 10%;
    min-width: 35px;
    min-height: 35px;
  }

  /* Reducir tamaño del título */
  .titulo-pirata {
    font-size: 1.2rem;
  }
}

.main-scroll {
  overflow-x: auto;
  width: 100%;
}

.main-scroll {
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; /* Firefox */
}
.main-scroll::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}

#orientation-warning {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background-color: #ff2a00;
  color: #000;
  text-align: center;
  font-size: 14px;
  padding: 10px;
  z-index: 9999; /* Aumentado para asegurar que esté por encima de todo */
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  display: none; /* Por defecto oculto, JS lo controla */
}

#orientation-warning p {
  margin: 0;
  line-height: 1.4;
}

 /* Estilo para videos embebidos */

.video-container {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
  height: 0;
  overflow: hidden;
  border: 3px solid #e9d9a7;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  margin: 12px 0;
  background: #1d1b16; /* fondo oscuro estilo pergamino envejecido */
}

.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 10px;
}

/* Search Box Styles */
.search-container {
  position: relative;
  width: 180px;
  margin: 0px 0 4px 0;
  padding-bottom: 4px;
  border-bottom: 2px solid #3a2d1f;
}

.search-input-wrapper {
  position: relative;
  width: 100%;
}

.search-icon {
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.85rem;
  color: #c9b37e;
  pointer-events: none;
  z-index: 1;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
  opacity: 0.8;
}

#search-input {
  width: 100%;
  padding: 5px 8px 5px 28px;
  background: linear-gradient(to bottom, #2a2419, #1a1409);
  color: #fdf6d8;
  border: 2px solid #5a4d2f;
  border-radius: 6px;
  font-size: 0.72rem;
  font-family: 'Pirata One', cursive;
  outline: none;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5), inset 0 1px 2px rgba(0, 0, 0, 0.3);
  height: 28px;
  box-sizing: border-box;
  letter-spacing: 0.5px;
}

#search-input::placeholder {
  color: #8a7c5e;
  font-family: 'Pirata One', cursive;
  letter-spacing: 0.8px;
}

#search-input:focus {
  border-color: #c9b37e;
  box-shadow: 0 0 12px rgba(201, 179, 126, 0.6), 0 3px 6px rgba(0, 0, 0, 0.5);
  background: linear-gradient(to bottom, #322b1f, #1f1709);
}

#search-input:focus + .search-icon,
.search-input-wrapper:has(#search-input:focus) .search-icon {
  opacity: 1;
  color: #ffe066;
}

#search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  max-height: 450px;
  overflow-y: auto;
  background: linear-gradient(to bottom, #1a1409, #0f0a05);
  border: 2px solid #5a4d2f;
  border-top: 2px solid #3a2d1f;
  border-radius: 0 0 8px 8px;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.7), inset 0 1px 2px rgba(0, 0, 0, 0.4);
  z-index: 1000;
  display: none;
  margin-top: 0px;
}

.search-result-item {
  padding: 12px 14px;
  cursor: pointer;
  border-bottom: 1px solid #2a2419;
  transition: all 0.2s ease;
  background: linear-gradient(to right, transparent, rgba(42, 36, 25, 0.3), transparent);
}

.search-result-item:hover {
  background: linear-gradient(to right, rgba(42, 36, 25, 0.5), rgba(58, 45, 31, 0.7), rgba(42, 36, 25, 0.5));
  border-left: 3px solid #c9b37e;
  padding-left: 11px;
}

.search-result-item:last-child {
  border-bottom: none;
  border-radius: 0 0 6px 6px;
}

.search-result-item.no-results {
  cursor: default;
  color: #8a7c5e;
  text-align: center;
  font-family: 'Pirata One', cursive;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
}

.search-result-item.no-results:hover {
  background: transparent;
  border-left: none;
  padding-left: 14px;
}

.search-result-title {
  font-weight: bold;
  color: #c9b37e;
  font-size: 0.85rem;
  margin-bottom: 4px;
  font-family: 'Pirata One', cursive;
  letter-spacing: 0.5px;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.search-result-description {
  color: #a89365;
  font-size: 0.72rem;
  line-height: 1.4;
  font-family: sans-serif;
}

.search-result-title mark {
  background-color: #ffe066;
  color: #1a1409;
  padding: 1px 4px;
  border-radius: 3px;
  font-weight: bold;
}

/* Scrollbar for search results */
#search-results::-webkit-scrollbar {
  width: 8px;
}

#search-results::-webkit-scrollbar-track {
  background: #1a1409;
}

#search-results::-webkit-scrollbar-thumb {
  background: #695b35;
  border-radius: 4px;
}

#search-results::-webkit-scrollbar-thumb:hover {
  background: #8a7c5e;
}

/* =================================
   MENU CATEGORIZADO
   ================================= */

.menu-category {
  margin: 2px 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.menu-category-header {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0;
  margin-bottom: 1px;
  border-radius: 8px;
  font-family: 'Pirata One', cursive;
  font-size: 0.88rem;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  cursor: default;
  border: none;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  height: 34px;
  width: 180px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
  box-sizing: border-box;
  z-index: 1;
}

.menu-category-icon {
  display: none; /* Ocultamos los iconos ya que las imágenes ya los tienen */
}

.menu-category-items {
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0px;
  margin-top: 0;
  position: relative;
  z-index: 0;
  width: 180px;
}

/* Categoría PREPARACIÓN - Con imagen de fondo */
.category-preparacion .menu-category-header {
  background-image: url('assets/secciones/preparacion.png');
  color: #fdf6d8;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.9);
  justify-content: center;
}

/* Categoría TABLEROS - Con imagen de fondo */
.category-tableros .menu-category-header {
  background-image: url('assets/secciones/tableros.png');
  color: #d8e8f8;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.9);
  justify-content: center;
}

/* Categoría COMBATE - Con imagen de fondo */
.category-combate .menu-category-header {
  background-image: url('assets/secciones/combate.png');
  color: #f8d8d8;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.9);
  justify-content: center;
}

/* Categoría TRAVESÍA Y PUERTOS - Con imagen de fondo */
.category-travesia .menu-category-header {
  background-image: url('assets/secciones/islas_puertos.png');
  color: #d8f8d8;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.9);
  justify-content: center;
}

/* Categoría REFERENCIA - Con imagen de fondo */
.category-referencia .menu-category-header {
  background-image: url('assets/secciones/referencia.png');
  color: #fdf6d8;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.9);
  justify-content: center;
}

/* Categoría EXTRAS - Con imagen de fondo */
.category-extras .menu-category-header {
  background-image: url('assets/secciones/extras.png');
  color: #f8f4d8;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.9);
  justify-content: center;
}

/* Botones dentro de categorías */
.menu-category-items button.zona {
  position: static !important;
  display: flex !important;
  align-items: center !important;
  margin: 0 !important;
  padding: 0px 8px !important;
  background-size: cover !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
  color: #f0e8d8 !important;
  border: 1px solid #2c1e0f !important;
  border-radius: 4px !important;
  font-size: 0.75rem !important;
  text-shadow: 1px 1px 2px #000 !important;
  text-align: left !important;
  transition: all 0.2s ease !important;
  box-shadow: inset 0 1px 0 rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.4) !important;
  width: 170px !important;
  min-width: 170px !important;
  max-width: 170px !important;
  height: auto !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
  transform: none !important;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  bottom: auto !important;
}

.menu-category-items button.zona:hover {
  filter: brightness(1.15) !important;
  transform: translateX(3px) !important;
  box-shadow: inset 0 1px 0 rgba(0,0,0,0.2), 0 2px 3px rgba(0,0,0,0.5) !important;
}

/* Botones activos dentro de categorías del menú */
.menu-category-items button.zona.activo {
  filter: brightness(1.3) saturate(1.15) !important;
  box-shadow: inset 0 0 25px rgba(255, 255, 255, 0.1) !important;
}

/* Botones de PREPARACIÓN */
.category-preparacion .menu-category-items button {
  background-image: url('assets/secciones/preparacion_bg.jpg');
}

/* Botones de TABLEROS */
.category-tableros .menu-category-items button {
  background-image: url('assets/secciones/tableros_bg.jpg');
}

/* Botones de COMBATE */
.category-combate .menu-category-items button {
  background-image: url('assets/secciones/combate_bg.jpg');
}

/* Botones de TRAVESÍA */
.category-travesia .menu-category-items button {
  background-image: url('assets/secciones/islas_puertos_bg.jpg');
}

/* Botones de REFERENCIA */
.category-referencia .menu-category-items button {
  background-image: url('assets/secciones/referencia_bg.jpg');
}

/* Botones de EXTRAS */
.category-extras .menu-category-items button {
  background-image: url('assets/secciones/extras_bg.jpg');
}