html {
  font-family: "Trirong", serif;
  font-size: 18px;
}

body {
  margin: 0;
  overflow: hidden;
  touch-action: none;
  font-family: "Trirong", serif;
}

canvas {
  display: block;
}

/* ✅ usar var(--vh) en lugar de vh para evitar bug en rotación */
:root {
  --vh: 1vh;
}

#preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: calc(var(--vh) * 100);
  background: #1976ce;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  color: white;
  z-index: 100000;
  text-align: center;
}

#preloader img {
  width: 60px;
  height: 60px;
  margin-bottom: 15px;
}

#controlsUI {
  position: fixed;
  bottom: 10px;
  left: 0;
  width: 100%;
  z-index: 10000;
  display: flex;
  justify-content: space-around;
  align-items: center;
}

#controlsUI button {
  flex: 1;
  margin: 0 2px;
  
}

#controlsUI button:hover {
  background: rgba(255, 255, 255, 0.3);
}

#profundidadDisplay {
  position: fixed;
  top: 10px;
  left: 5px;
  z-index: 10002;
  color: white;
  background: #1976ced9;
  padding: 6px 10px;
  border-radius: 6px;
  max-width: 90%;
  word-wrap: break-word;
}



#member_referral_img{

    position: fixed;
    bottom: 120px;
    left: 5px;
    z-index: 10002;
    color: white;
    background: #ffffff40;
    padding: 6px 10px;
    border-radius: 6px;
    max-width: 90%;
    word-wrap: break-word;

}



.blue_btn {
  margin-top: 10px;
  margin-left: 5px;
  color: white;
  background: #1976ced9;
  padding: 6px 10px;
  border-radius: 6px;
  max-width: 90%;
  word-wrap: break-word;
  cursor: pointer;
}

#nombre_arrecife {
  position: fixed;
  bottom: 123px;
  left: 5px;
  width: auto;
  z-index: 5;
  color: white;
  background: #1976ced9;
  padding: 6px 10px;
  border-radius: 6px;
  max-width: 100%;
  word-wrap: break-word;
}


#descripcion_arrecife {
  position: fixed;
  bottom: 123px;
  left: 5px;
  width: auto;
  z-index: -1;
}

#menu_camera {
  position: fixed;
  bottom: 65px;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: space-around;
  align-items: center;
}

/* Botón flotante superior derecha */
#nueva_ruta_btn {
  position: fixed;
  top: 60px;
  right: 10px;
  background: #fd6b00d9;
  color: white;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  width: 90px; /* ✅ tamaño fijo */
  text-align: center;
  z-index: 10001;
  transition: background 0.3s;
  text-align: center;
}
#nueva_ruta_btn:hover {
  background: rgba(0, 0, 0, 0.8);
}

/* Menú deslizante hacia abajo */
#nueva_rutaMenu {
  width: 90px;
  position: fixed;
  top: 110px;
  right: 10px;
  height: 0;
  background: #fd6b00d9;
  color: white;
  padding: 0 15px;
  border-radius: 6px;
  z-index: 10001;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
  transition: height 0.3s, padding 0.3s;
}



#rutas_oficialesMenu {
  width: 90px;
  position: fixed;
  top: 160px;
  right: 10px;
  height: 0;
  background: #fdf300d1;
  color: white;
  padding: 0 15px;
  border-radius: 6px;
  z-index: 10001;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
  transition: height 0.3s, padding 0.3s;
}





#fogButton {
  width: 90px; /* ✅ fijo */
  position: fixed;
  top: 10px;
  right: 10px;
  background: #1976ced9;
  color: white;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  z-index: 10001;
  transition: background 0.3s;
  text-align: center;
}
#fogButton:hover {
  background: rgba(0, 0, 0, 0.8);
}




#rutas_reef_oficiales {
  width: 90px; /* ✅ fijo */
  position: fixed;
  top: 110px;
  right: 10px;
  background: #fdf300d1;
  color: white;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  z-index: 10000;
  transition: background 0.3s;
  text-align: center;
}
#rutas_reef_oficiales:hover {
  background: rgba(0, 0, 0, 0.8);
}





#fogMenu {

  width: 90px;
  position: fixed;
  top: 110px;
  right: 10px;
  height: 0;
  background: #1976ce;
  color: white;
  padding: 0 15px;
  border-radius: 6px;
  z-index: 10001;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: auto;
  transition: height 0.3s, padding 0.3s;

}







.btn {
  background-color: #1976ced9;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  width: 120px; /* ✅ fijo */
  height: 50px; /* ✅ fijo */
  font-size: 16px; /* ✅ fijo */
  text-align: center;
  line-height: 50px;
}

#fogMenu.open {
  height: calc(var(--vh) * 100 - 60px); /* ✅ dinámico */
  padding: 15px;
}
#fogMenu input[type="range"] {
  width: 100%;
}




#nueva_rutaMenu.open {
  height: calc(var(--vh) * 90);
  padding: 15px;
}


#rutas_oficialesMenu.open {
  height: calc(var(--vh) * 90);
  padding: 15px;
}



/* Modal */
.modal_general {
  display: none;
  position: fixed;
  z-index: 100000;
  left: 0;
  top: 0;
  width: 100%;
  height: calc(var(--vh) * 100);
  overflow: auto;
  background-color: #1976ced9;
}

.modal_content_general {
  background-color: #fefefe;
  margin: 15% auto;
  padding: 20px;
  border: 1px solid #888;
  width: 80%;
  overflow: auto;
  border-radius: 20px;
}

.close_general {
  color: #aaa;
  float: right;
  font-weight: bold;
}
.close_general:hover,
.close_general:focus {
  color: black;
  text-decoration: none;
  cursor: pointer;
}

/* Responsive */
@media screen and (max-width: 600px) {
  .modal_content_general {
    width: 90%;
  }

  #fogMenu {
    width: 85%;
  }

  #nueva_rutaMenu {
    width: 85%;
  }

  #rutas_oficialesMenu {
    width: 85%;
  }
}

@media screen and (min-width: 900px) {
  .modal_content_general {
    width: 40%;
  }

  #fogMenu {
    width: 30%;
  }

  #nueva_rutaMenu {
    width: 30%;
  }

  #rutas_oficialesMenu {
    width: 30%;
  }
}

/* Slider */
.slider {
  display: flex;
  transition: transform 0.3s ease;
}
.slider img {
  width: 100%;
  flex-shrink: 0;
}
.nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  border: none;
  cursor: pointer;
  padding: 5px 10px;
  border-radius: 50%;
}
.prev {
  left: 10px;
}
.next {
  right: 10px;
}
.close-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: #ff4444;
  color: #fff;
  border: none;
  padding: 6px 10px;
  border-radius: 50%;
  cursor: pointer;
}

/* Reporte inmersión */
.dive-report {
  font-family: Inter, Roboto, Arial, sans-serif;
  color: #222;
  max-width: 980px;
  margin: 10px auto;
}
.summary {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.card {
  background: #fff;
  border: 1px solid #e6e6e6;
  border-radius: 10px;
  padding: 10px 12px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
  min-width: 160px;
  display: flex;
  gap: 8px;
  align-items: center;
}
.card .icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f6f8fb;
  border-radius: 8px;
  color: #0b5cff;
}
.card .value {
  font-weight: 700;
  font-size: 1.05rem;
}
.card .label {
  font-size: 0.78rem;
  color: #666;
}
.segments {
  margin-top: 8px;
  border-top: 1px dashed #eee;
  padding-top: 12px;
}
.segment {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-radius: 8px;
}
.segment-row {
  display: flex;
  gap: 10px;
  align-items: center;
}
.seg-title {
  font-weight: 600;
}
.seg-meta {
  font-size: 0.86rem;
  color: #444;
}
.small {
  font-size: 0.85rem;
  color: #666;
}
.status {
  display: flex;
  gap: 8px;
  align-items: center;
}
.ok {
  color: #0a9d58;
  font-weight: 700;
}
.warn {
  color: #d97706;
  font-weight: 700;
}
.danger {
  color: #d32f2f;
  font-weight: 700;
}
.grid-head {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 10px;
  margin: 8px 0;
  font-weight: 700;
  color: #555;
}
@media (max-width: 760px) {
  .segment,
  .grid-head {
    grid-template-columns: 1fr 1fr;
  }
}
.low-gas {
  color: #ff4444;
  font-weight: 700;
}
.consumption {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}
.consumption th,
.consumption td {
  border: 1px solid #ccc;
  padding: 6px;
  text-align: center;
}
.consumption th {
  background: #f0f0f0;
}
.warn {
  background: #fff3cd;
}
.danger {
  background: #f8d7da;
}
.low-gas {
  color: orange;
  font-weight: 700;
  background: #fff3e0;
}
.segment {
  border-radius: 6px;
  margin-bottom: 8px;
  overflow: hidden;
  position: relative;
}
.segment-color-indicator {
  position: absolute;
  left: 0;
  top: 0;
  width: 6px;
  height: 100%;
  background: currentColor;
  border-radius: 3px 0 0 3px;
}
.ok .segment-color-indicator {
  background: #28a745;
}
.danger .segment-color-indicator {
  background: #dc3545;
}

@media (max-width: 760px) {
  .consumption thead {
    display: none;
  }
  .consumption tr {
    display: grid;
    grid-template-columns: 1fr 1fr;
    margin-bottom: 10px;
    border-radius: 6px;
    overflow: hidden;
  }
  .consumption td {
    display: flex;
    justify-content: space-between;
    padding: 4px 6px;
  }
  .consumption td::before {
    content: attr(data-label);
    font-weight: 600;
    margin-right: 6px;
  }
}

/* Segment diagram */
.segment-diagram {
  max-width: 700px;
  margin: 20px auto;
  padding: 16px;
  border-radius: 10px;
  background: #f9f9f9;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
  font-family: Arial, sans-serif;
  margin-bottom: 12px;
}
.segment-header {
  display: flex;
  justify-content: space-between;
  font-weight: bold;
  margin-bottom: 10px;
  font-size: 16px;
  color: #333;
}
.segment-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid #ddd;
}
.segment-row:last-child {
  border-bottom: none;
}
.label {
  font-weight: bold;
  color: #1a1a1a;
  flex: 0 0 150px;
}
.value {
  flex: 1;
  padding-left: 10px;
  font-weight: 700;
}
@media (max-width: 600px) {
  .segment-row {
    flex-direction: column;
    align-items: flex-start;
  }
  .label {
    margin-bottom: 4px;
  }
}

/* Toast */
.toast {
  position: fixed;
  top: 100px;
  left: 10px;
  width: 240px;
  background-color: orange;
  color: white;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 16px;
  box-shadow: #fd6b00d9;
  opacity: 0;
  transition: opacity 0.5s ease;
  z-index: 9999;
}
.toast.show {
  opacity: 1;
}

.icon-flag {
  vertical-align: middle;
  margin: 2px 2px;
  padding-bottom: 5px;
}
















.plan-wrapper{
  display:grid;
  grid-template-columns: repeat(2, 1fr); /* ⬅️ 50% / 50% */
  gap:12px;
  margin:20px 0;
}

/* Mobile */
@media (max-width: 520px){
  .plan-wrapper{
    grid-template-columns: 1fr;
  }
}









.font_responsive {
    
    align-items: center;
    gap: 0.4em;
}

.icono_responsive {
    width: 1.2em;
    height: 1.2em;
    object-fit: contain;
}

@media (min-width: 768px) {
    .font_responsive {
        font-size: 18px;
    }
}

@media (min-width: 1200px) {
    .font_responsive {
        font-size: 24px;
    }
}

@media (min-width: 1800px) {
    .font_responsive {
        font-size: 32px;
    }
}


@media (min-width: 1024px) {




#fogButton {
  min-width: 230px; 
  
  top: 10px;
  padding: 10px 14px;
  
  
}


#nueva_ruta_btn {
  min-width: 230px; 
  right: 10px;
  top: 80px;
  
  padding: 10px 14px;
  
}



#rutas_reef_oficiales {
  min-width: 230px;
  right: 10px;
  
  padding: 10px 14px;
  top: 150px;
  
}




  #fogMenu,
  #nueva_rutaMenu,
  #rutas_oficialesMenu {
    min-width: 360px;
  }

  #profundidadDisplay {
    
    padding: 10px 14px;
  }

  #controlsUI button {
    height: 60px;
    
  }

  #menu_camera {
    bottom: 80px;
  }

  #joystick_area {
    width: 130px;
    height: 130px;
    bottom: 90px;
    right: 30px;
  }

  #joystick_inner {
    width: 70px;
    height: 70px;
    background-size: 75%;
  }

  .modal_content_general {
    width: 40%;
    font-size: 16px;
  }
}


