/*
  destinos.css — Estilos del modulo "Destinos 3D" (destinos.html).
  Mobile-first (390x844) con panel lateral desde 900 px. Misma estetica que
  Cosmos: oscuro de lujo, acento dorado (#d4af37 / #f2d27a) y vidrio
  (rgba(10,10,15,0.75) + blur(16px) + borde de 1px rgba(255,255,255,0.1)).
  Contraste: texto #f4f5f9 / #c9cde2 sobre vidrio oscuro (>= 7:1).
*/

.dst-page {
  --dx-bg: #0b0b0e;
  --dx-glass: rgba(10, 10, 15, 0.75);
  --dx-glass-strong: rgba(10, 10, 15, 0.92);
  --dx-line: rgba(255, 255, 255, 0.1);
  --dx-gold: #d4af37;
  --dx-gold-hi: #f2d27a;
  --dx-text: #f4f5f9;
  --dx-text-2: #c9cde2;
  --dx-text-3: #9ea3bd;
  --dx-safe-t: env(safe-area-inset-top, 0px);
  --dx-safe-b: env(safe-area-inset-bottom, 0px);
  --dst-bottom-inset: 180px;
  --dx-picker-top: calc(60px + var(--dx-safe-t));
  background: var(--dx-bg);
  overscroll-behavior: none;
}

.dst {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: var(--dx-bg);
  color: var(--dx-text);
  font-family: var(--font-ui);
}

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

/* ---------- vidrio ---------- */
.glass {
  background: var(--dx-glass);
  -webkit-backdrop-filter: blur(16px) saturate(1.1);
  backdrop-filter: blur(16px) saturate(1.1);
  border: 1px solid var(--dx-line);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass { background: var(--dx-glass-strong); }
}

.dst-ico { width: 20px; height: 20px; flex: none; }
.dst-ico--sm { width: 16px; height: 16px; }

:where(.dst) :focus-visible {
  outline: 2px solid var(--focus-ring-color, #e8c766);
  outline-offset: 2px;
}

/* ---------- escenario ---------- */
.dst__stage { position: absolute; inset: 0; z-index: 1; }
.dst-canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  outline: none;
  cursor: grab;
}
.dst-canvas:active { cursor: grabbing; }

.dst-tooltip {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 6;
  pointer-events: none;
  padding: 6px 12px;
  margin: -44px 0 0 0;
  border-radius: 999px;
  background: rgba(10, 10, 15, 0.82);
  border: 1px solid rgba(242, 210, 122, 0.4);
  color: var(--dx-gold-hi);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.01em;
  white-space: nowrap;
  translate: -50% 0;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
}
.dst-tooltip[hidden] { display: none; }

/* ---------- barra superior ---------- */
.dst__topbar {
  position: absolute;
  z-index: 20;
  top: calc(8px + var(--dx-safe-t));
  left: 12px;
  right: 12px;
  height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: none;
}
.dst__topbar > * { pointer-events: auto; }
.dst__title {
  margin-right: auto;
  font-family: var(--font-ui);
  font-weight: 400;
  font-size: 1.05rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--dx-gold-hi);
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.85);
  pointer-events: none;
  white-space: nowrap;
}
.dst__topbar-end { display: flex; align-items: center; gap: 8px; flex: none; }
.dst__lang .lang-selector__trigger {
  background: var(--dx-glass);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border: 1px solid var(--dx-line);
  border-radius: 999px;
  padding: 8px 12px;
  min-height: 44px;
}
.dst__lang .lang-selector__panel {
  background: var(--dx-glass-strong);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border: 1px solid var(--dx-line);
}

.dst-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 16px 0 12px;
  border-radius: 999px;
  color: var(--dx-text);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: border-color 0.2s ease, color 0.2s ease;
}
.dst-pill:hover { border-color: rgba(242, 210, 122, 0.6); color: var(--dx-gold-hi); }
@media (max-width: 420px) {
  .dst-pill span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .dst-pill { width: 44px; padding: 0; justify-content: center; }
}

.dst-iconbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  color: var(--dx-text-2);
  transition: border-color 0.2s ease, color 0.2s ease;
}
.dst-iconbtn:hover { color: var(--dx-gold-hi); border-color: rgba(242, 210, 122, 0.6); }

/* ---------- selector de destinos ---------- */
.dst-picker {
  position: absolute;
  z-index: 18;
  top: var(--dx-picker-top);
  left: 0;
  right: 0;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 14px), transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 14px), transparent 100%);
}
.dst-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  padding: 2px 14px 6px;
  list-style: none;
  margin: 0;
}
.dst-chips::-webkit-scrollbar { display: none; }
.dst-chips > li { flex: none; scroll-snap-align: center; }
.dst-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 48px;
  padding: 6px 14px 6px 10px;
  border-radius: 14px;
  background: rgba(10, 10, 15, 0.62);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border: 1px solid var(--dx-line);
  color: var(--dx-text-2);
  text-align: left;
  transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}
.dst-chip:hover { border-color: rgba(242, 210, 122, 0.45); color: var(--dx-text); }
.dst-chip__n {
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.06em;
  color: var(--dx-text-3);
}
.dst-chip__txt { display: flex; flex-direction: column; line-height: 1.15; }
.dst-chip__name { font-size: 13.5px; font-weight: 500; color: inherit; white-space: nowrap; }
.dst-chip__place { font-size: 11px; color: var(--dx-text-3); white-space: nowrap; }
.dst-chip.is-active {
  background: rgba(212, 175, 55, 0.16);
  border-color: rgba(242, 210, 122, 0.6);
  color: var(--dx-gold-hi);
}
.dst-chip.is-active .dst-chip__n { color: var(--dx-gold); }

/* ---------- capa de UI ---------- */
.dst__main { position: absolute; inset: 0; z-index: 10; pointer-events: none; }
.dst__main > * { pointer-events: auto; }

.dst-hint {
  position: absolute;
  top: calc(var(--dx-picker-top) + 64px);
  left: 50%;
  transform: translateX(-50%);
  max-width: calc(100% - 32px);
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 13px;
  color: var(--dx-text-2);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
  transition: opacity 0.6s ease;
}
.dst-hint.is-gone { opacity: 0; visibility: hidden; }

#dst-reset {
  position: absolute;
  right: 12px;
  bottom: calc(var(--dst-bottom-inset) + 12px);
  transition: bottom 0.32s cubic-bezier(0.2, 0.8, 0.2, 1), border-color 0.2s ease, color 0.2s ease;
}

.dst-credit {
  position: absolute;
  left: 18px;
  right: 72px;
  bottom: calc(var(--dst-bottom-inset) + 14px);
  font-size: 9.5px;
  line-height: 1.35;
  color: #b9bdd2;
  /* el fondo va como sombra extendida: el recorte de lineas (line-clamp) no deja medias lineas */
  padding: 0;
  border-radius: 6px;
  background: rgba(10, 10, 15, 0.55);
  box-shadow: 0 0 0 6px rgba(10, 10, 15, 0.55);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  transition: bottom 0.32s cubic-bezier(0.2, 0.8, 0.2, 1);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.dst-credit a { color: inherit; text-decoration: underline; text-decoration-color: rgba(255, 255, 255, 0.3); text-underline-offset: 2px; }
.dst-credit a:hover { color: var(--dx-gold-hi); }
.dst-credit--panel { position: static; display: block; -webkit-line-clamp: unset; margin-top: 20px; padding: 0; background: none; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; font-size: 11px; color: var(--dx-text-3); }
.dst-credit--panel > span { display: block; }
.dst-credit--panel .dst-credit__sep { display: none; }

/* ---------- panel / hoja inferior ---------- */
.dst-panel {
  --dst-sheet-h: 180px;
  position: absolute;
  z-index: 15;
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(100dvh - var(--dx-picker-top) - 60px);
  display: flex;
  flex-direction: column;
  border-radius: 22px 22px 0 0;
  border-bottom: 0;
  transform: translateY(calc(100% - var(--dst-sheet-h)));
  will-change: transform;
  overflow: hidden;
}
.dst-panel.is-animating { transition: transform 0.34s cubic-bezier(0.2, 0.8, 0.2, 1); }
.dst-panel__grip {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 26px;
  touch-action: none;
  cursor: grab;
}
.dst-panel__grip-bar { width: 40px; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, 0.28); }
.dst-panel__head { flex: none; padding: 0 20px 10px; touch-action: none; }
.dst-kicker {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--dx-gold);
}
.dst-panel__title {
  margin-top: 3px;
  font-family: var(--font-ui);
  font-weight: 400;
  font-size: 1.85rem;
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: var(--dx-text);
}
.dst-panel__title:focus { outline: none; }
.dst-panel__sub { margin-top: 4px; font-size: 14px; color: var(--dx-text-2); }

.dst-panel__actions {
  flex: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 2px 20px 12px;
}
.dst-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: var(--dx-text);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
  flex: 1 1 auto;
}
.dst-btn:hover { border-color: rgba(242, 210, 122, 0.55); color: var(--dx-gold-hi); }
.dst-btn--gold {
  background: linear-gradient(180deg, #ecca6e 0%, #d4af37 55%, #c29b2c 100%);
  border-color: rgba(255, 236, 170, 0.6);
  color: var(--text-on-gold, #1a1206);
  font-weight: 600;
  box-shadow: 0 6px 22px rgba(212, 175, 55, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.dst-btn--gold:hover { color: var(--text-on-gold, #1a1206); box-shadow: 0 8px 28px rgba(212, 175, 55, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.4); }
.dst-note { flex-basis: 100%; font-size: 11px; line-height: 1.4; color: var(--dx-text-3); }

.dst-panel__body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 4px 20px calc(24px + var(--dx-safe-b));
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  scrollbar-width: thin;
  scrollbar-color: rgba(242, 210, 122, 0.35) transparent;
}
.dst-sec { margin-top: 18px; }
.dst-sec[hidden] { display: none; }
.dst-sec__title {
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--dx-gold-hi);
}
.dst-prose p { font-size: 14.5px; line-height: 1.65; color: #dadded; }
.dst-prose p + p { margin-top: 10px; }
.dst-curios { display: grid; gap: 8px; list-style: none; margin: 0; padding: 0; }
.dst-curios li {
  position: relative;
  padding-left: 16px;
  font-size: 14px;
  line-height: 1.55;
  color: #dadded;
}
.dst-curios li::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 0.62em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--dx-gold);
}
.dst-pois { display: grid; gap: 6px; list-style: none; margin: 0; padding: 0; }
.dst-poi {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 46px;
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  color: var(--dx-text);
  font-size: 14px;
  text-align: left;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}
.dst-poi:hover { border-color: rgba(242, 210, 122, 0.4); }
.dst-poi[aria-pressed="true"] { background: rgba(212, 175, 55, 0.14); border-color: rgba(242, 210, 122, 0.55); color: var(--dx-gold-hi); }
.dst-poi__dot {
  width: 9px; height: 9px; border-radius: 50%; flex: none;
  background: var(--dx-gold-hi);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.18), 0 0 12px rgba(242, 210, 122, 0.7);
}
.dst-poi__name { flex: 1; min-width: 0; }
.dst-poi__tag {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dx-text-3);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  padding: 2px 7px;
}
.dst-poi .dst-ico { color: var(--dx-text-3); }

.dst-focus {
  margin-top: 14px;
  padding: 14px 16px 12px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(212, 175, 55, 0.12), rgba(212, 175, 55, 0.04));
  border: 1px solid rgba(242, 210, 122, 0.3);
  animation: dst-rise 0.32s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.dst-focus[hidden] { display: none; }
.dst-focus__title { margin-top: 2px; font-size: 1.25rem; font-weight: 500; letter-spacing: -0.01em; color: var(--dx-text); }
.dst-focus__title:focus { outline: none; }
.dst-focus__text { margin-top: 6px; font-size: 14.5px; line-height: 1.6; color: #dadded; }
.dst-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  min-height: 40px;
  padding: 0 4px;
  color: var(--dx-gold-hi);
  font-size: 13.5px;
  font-weight: 500;
}
.dst-link:hover { text-decoration: underline; text-underline-offset: 3px; }
@keyframes dst-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- fundido y carga ---------- */
.dst-fade {
  position: absolute;
  inset: 0;
  z-index: 30;
  background: #050507;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}
.dst-fade.is-on { opacity: 1; }
.dst:not(.is-loading) .dst-fade.is-on { pointer-events: none; }
.dst-fade:not(.is-on) { transition-duration: 0.6s; }
.dst-loading { display: flex; flex-direction: column; align-items: center; gap: 14px; opacity: 0; transition: opacity 0.3s ease; }
.dst-fade.is-busy .dst-loading, .dst.is-loading .dst-loading { opacity: 1; }
.dst-loading__ring {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid rgba(242, 210, 122, 0.18);
  border-top-color: var(--dx-gold-hi);
  animation: dst-spin 1s linear infinite;
}
.dst-loading__text { font-size: 13px; letter-spacing: 0.04em; color: var(--dx-text-2); }
@keyframes dst-spin { to { transform: rotate(360deg); } }
/* durante la carga, la UI de arriba queda por encima del fundido */
.dst__topbar, .dst-picker { z-index: 35; }

/* ---------- fallback sin WebGL ---------- */
.dst-fallback {
  position: absolute;
  inset: 0;
  z-index: 25;
  overflow-y: auto;
  padding: calc(120px + var(--dx-safe-t)) 14px 40px;
  background: var(--dx-bg);
}
.dst-fallback[hidden] { display: none; }
.dst-fallback__inner { max-width: 760px; margin: 0 auto; display: grid; gap: 14px; }
.dst-fallback__note { padding: 12px 16px; border-radius: 14px; font-size: 14px; color: var(--dx-text-2); }
.dst-card { padding: 18px 20px; border-radius: 18px; }
.dst-card .dst-panel__actions { padding: 14px 0 0; }
.dst--fallback .dst__main, .dst--fallback .dst-picker { display: none; }

/* ---------- escritorio: panel lateral ---------- */
@media (min-width: 900px) {
  .dst-page { --dx-picker-top: calc(66px + var(--dx-safe-t)); }
  .dst__topbar { top: calc(14px + var(--dx-safe-t)); left: 18px; right: 18px; }
  .dst__title { font-size: 1.1rem; position: absolute; left: 50%; transform: translateX(-50%); }
  .dst__topbar-end { margin-left: auto; }
  .dst-picker { left: 18px; right: 418px; }
  .dst-chips { padding: 2px 4px 6px; }
  .dst-panel {
    top: calc(14px + var(--dx-safe-t) + 58px);
    right: 18px;
    left: auto;
    bottom: 18px;
    width: 380px;
    height: auto;
    border-radius: 22px;
    border-bottom: 1px solid var(--dx-line);
    transform: none;
  }
  .dst-panel__grip { display: none; }
  .dst-panel__head { padding: 22px 24px 12px; touch-action: auto; }
  .dst-panel__title { font-size: 2.15rem; }
  .dst-panel__actions { padding: 4px 24px 16px; }
  .dst-panel__body { padding: 6px 24px 24px; }
  .dst-hint { top: calc(var(--dx-picker-top) + 64px); left: calc((100% - 400px) / 2); }
  #dst-reset { right: 418px; bottom: 18px; }
  .dst-credit { left: 18px; right: 480px; bottom: 18px; font-size: 10.5px; -webkit-line-clamp: 3; }
  .dst-credit--panel { display: none; }
}
@media (min-width: 900px) and (max-height: 620px) {
  .dst-panel__title { font-size: 1.7rem; }
}

@media (prefers-reduced-motion: reduce) {
  .dst-panel.is-animating, #dst-reset, .dst-credit { transition: none; }
  .dst-focus { animation: none; }
  .dst-loading__ring { animation-duration: 3s; }
  .dst-fade { transition-duration: 0.25s; }
}

/* fallback: barra superior con fondo para que el contenido no pase por debajo */
.dst--fallback .dst__topbar {
  top: 0; left: 0; right: 0;
  height: calc(60px + var(--dx-safe-t));
  padding: var(--dx-safe-t) 12px 0;
  background: linear-gradient(180deg, var(--dx-bg) 72%, rgba(11, 11, 14, 0));
}
.dst--fallback .dst-fallback { padding-top: calc(76px + var(--dx-safe-t)); }
.dst-card { scroll-margin-top: 80px; }
.dst-card .dst-sec__title { margin-top: 18px; }
.dst-card .dst-prose { margin-top: 10px; }

/* marcadores fuera de la maqueta y aviso de distancia */
.dst-poi__dot.is-far { background: transparent; box-shadow: inset 0 0 0 2px var(--dx-gold), 0 0 10px rgba(242, 210, 122, 0.4); }
.dst-focus__far { margin-top: 8px; font-size: 13px; color: var(--dx-text-3); }
.destino-cielo:empty { display: none; }
.destino-cielo { margin-top: 18px; }
/* barra en celulares chicos (360 px): titulo mas compacto para dejar lugar al sonido y al idioma */
@media (max-width: 400px) {
  .dst__title { font-size: 0.86rem; letter-spacing: 0.14em; }
  .dst__lang .lang-selector__trigger { padding: 8px 10px; }
}
@media (max-width: 370px) {
  .dst__title { font-size: 0.78rem; letter-spacing: 0.1em; }
}

/* indicacion "Activá el sonido": en Destinos va a la izquierda del boton para no tapar el selector de destinos */
.dst__topbar .sv-tip { top: 50%; right: calc(100% + 10px); margin-top: -15px; z-index: 40; }
.dst__topbar .sv-tip::before { top: 10px; right: -5px; transform: rotate(135deg); }
.dst__topbar .sv.is-hint .sv-tip { transform: none; }
@media (max-width: 420px) { .dst__topbar .sv.is-hint ~ * { position: relative; } .dst__topbar:has(.sv.is-hint) .dst__title { opacity: 0; transition: opacity 0.3s; } }

/* volumen del sonido: en Destinos se abre a la izquierda del boton (no tapa el selector de destinos) */
.dst__topbar .sv-vol { top: 50%; right: 100%; margin-top: -26px; padding-top: 0; padding-right: 8px; }
