/* Navegación principal «Waterline» (app/publico.php: pub_nav; js/nav.js; idea de «Liquid Navbar — Waterline», 21st.dev, ver LICENCIAS.md).
   Una píldora de vidrio con la gota de agua que se estira hacia la opción actual. Abajo y centrada en celular (al alcance del pulgar), arriba y centrada
   en escritorio. Todo en tonos miel, caramelo y crema: nada de azul. Sin JavaScript son enlaces comunes con la opción actual marcada. */
.nav {
  --n-fg: #3a2512; --n-fg-soft: #5a4636;
  position: fixed; left: 50%; z-index: 45; display: inline-flex; align-items: center; gap: 2px; max-width: calc(100% - 20px); padding: 6px; border-radius: 999px; isolation: isolate;
  transform: translateX(-50%); font: 600 var(--t-2) var(--sans); user-select: none; -webkit-tap-highlight-color: transparent;
}
.nav__svg { position: absolute; width: 0; height: 0; }
@media (min-width: 720px) { .nav { top: 14px; } body.con-mesa .nav { top: 50px; } }
@media (max-width: 719px) { .nav { bottom: calc(14px + env(safe-area-inset-bottom, 0px)); } }

/* El vidrio: sólido equivalente si no hay desenfoque o se pide menos transparencia (ver el bloque de vidrio de app.css) */
.nav__vidrio {
  position: absolute; inset: 0; z-index: -2; overflow: hidden; border-radius: inherit; background: #f6ebd3;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, .9), inset 0 0 0 1px rgba(214, 170, 90, .35), 0 14px 32px -14px rgba(90, 56, 12, .5), 0 2px 6px rgba(90, 56, 12, .12);
}
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  @media (prefers-reduced-transparency: no-preference) {
    .nav__vidrio { background: rgba(255, 244, 218, .78); -webkit-backdrop-filter: blur(14px) saturate(1.5); backdrop-filter: blur(14px) saturate(1.5); }
    .nav[data-refract="on"] .nav__vidrio { -webkit-backdrop-filter: url(#nav-refraccion) blur(3px) saturate(1.5); backdrop-filter: url(#nav-refraccion) blur(3px) saturate(1.5); }
  }
}
.nav__agua { position: absolute; left: -14px; top: -14px; z-index: -1; pointer-events: none; }
.nav[data-gl="off"] .nav__agua, .nav:not(.nav--js) .nav__agua { display: none; }
/* gota hecha en CSS: sin WebGL (la mueve nav.js con transform y width) */
.nav__gota {
  display: none; position: absolute; top: 6px; bottom: 6px; left: 0; z-index: -1; border-radius: 999px; pointer-events: none; will-change: transform, width;
  background: radial-gradient(120% 140% at 30% 0%, rgba(255, 255, 255, .8), rgba(255, 255, 255, 0) 55%), rgba(255, 226, 160, .55);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, .95), inset 0 -2px 6px rgba(201, 140, 40, .3), inset 0 0 0 1px rgba(255, 236, 190, .8), 0 6px 16px -6px rgba(120, 70, 10, .45);
}
.nav[data-gl="off"] .nav__gota { display: block; }

.nav__it {
  position: relative; z-index: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; min-width: 44px; padding: 0 16px; border-radius: 999px;
  color: var(--n-fg-soft); text-decoration: none; white-space: nowrap; transition: color .25s;
}
.nav__it:hover, .nav__it[aria-current="page"] { color: var(--n-fg); }
.nav__it:focus-visible { outline: 3px solid var(--oro-osc); outline-offset: 2px; }
/* sin JavaScript no hay gota: la opción actual lleva su propio fondo */
.nav:not(.nav--js) .nav__it[aria-current="page"] { background: rgba(255, 226, 160, .6); box-shadow: inset 0 0 0 1px rgba(214, 170, 90, .5); }
.nv-ico { position: relative; display: inline-flex; flex: none; }
.nv-ico svg { transition: transform .45s cubic-bezier(.3, 1.6, .5, 1); }
.nav__it[aria-current="page"] .nv-ico svg { transform: translateY(-1px) scale(1.08); }
.nav__total { padding: .1rem .55rem; border-radius: 999px; background: var(--cafe); color: var(--papel); font: 700 .78rem/1.5 var(--sans); font-variant-numeric: tabular-nums; }
.nav__total[hidden] { display: none; }

/* celular: solo iconos, y la opción actual muestra su nombre (en pantallas muy angostas, ni eso: cabe todo) */
@media (max-width: 719px) {
  .nav__it { padding: 0 11px; gap: 6px; }
  .nav__txt { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .nav__it[aria-current="page"] .nav__txt { position: static; width: auto; height: auto; overflow: visible; clip: auto; }
}
@media (max-width: 379px) { .nav__it[aria-current="page"] .nav__txt { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); } }
@media (min-width: 720px) and (max-width: 899px) { .nav__it { padding: 0 12px; } .nav__txt { font-size: var(--t-1); } }

/* la pequeña escena de cada icono al tocarlo (solo transform y opacity; con «reducir movimiento» no se juega) */
.nv-puerta { fill: transparent; }
.nv-ico[data-juega="pop"] svg { animation: nvPop .5s cubic-bezier(.3, 1.6, .5, 1) both; }
@keyframes nvPop { 0% { transform: scale(.72); } 60% { transform: scale(1.2); } 100% { transform: translateY(-1px) scale(1.08); } }
.nv-ico[data-juega="drop"] svg { animation: nvGota .95s cubic-bezier(.4, 0, .3, 1) both; transform-origin: 50% 100%; }
@keyframes nvGota { 0% { transform: translateY(-1px); } 26% { transform: translateY(-13px) scale(.88, 1.12); } 46% { transform: translateY(3px) scale(1.3, .68); } 62% { transform: translateY(-3px) scale(.92, 1.08); } 80% { transform: translateY(0) scale(1.04, .97); } 100% { transform: translateY(-1px) scale(1.08); } }
.nv-ico[data-juega="drop"]::before, .nv-ico[data-juega="drop"]::after { content: ""; position: absolute; bottom: 0; left: 50%; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: currentColor; opacity: 0; pointer-events: none; }
.nv-ico[data-juega="drop"]::before { animation: nvSalpL .95s ease-out both; }
.nv-ico[data-juega="drop"]::after { animation: nvSalpR .95s ease-out both; }
@keyframes nvSalpL { 0%, 44% { opacity: 0; transform: none; } 50% { opacity: .9; transform: translate(-5px, -6px); } 75%, 100% { opacity: 0; transform: translate(-11px, 1px) scale(.4); } }
@keyframes nvSalpR { 0%, 44% { opacity: 0; transform: none; } 50% { opacity: .9; transform: translate(5px, -7px); } 75%, 100% { opacity: 0; transform: translate(12px, 1px) scale(.4); } }
.nv-ico[data-juega="spin"] svg { animation: nvGira 1s cubic-bezier(.2, .75, .25, 1) both; }
@keyframes nvGira { 0% { transform: perspective(80px) rotateY(0); } 100% { transform: perspective(80px) rotateY(360deg) translateY(-1px) scale(1.08); } }
.nv-ico[data-juega="glow"] svg { animation: nvSalto .8s cubic-bezier(.3, 1.4, .5, 1) both; transform-origin: 50% 100%; }
@keyframes nvSalto { 0% { transform: none; } 30% { transform: translateY(-5px) scale(1.04, .96); } 55% { transform: translateY(0) scale(1.12, .88); } 75% { transform: translateY(-2px) scale(.98, 1.04); } 100% { transform: translateY(-1px) scale(1.08); } }
.nv-ico[data-juega="glow"] .nv-puerta { animation: nvPuerta 1.3s ease both; }   /* la puerta de la catedral se enciende, en miel */
@keyframes nvPuerta { 0% { fill: transparent; } 30% { fill: #ffe08a; } 100% { fill: rgba(255, 196, 92, .75); } }
.nv-ico[data-juega="wave"] svg { animation: nvOla .9s ease-in-out both; transform-origin: 50% 92%; }
@keyframes nvOla { 0% { transform: none; } 20% { transform: rotate(-15deg); } 40% { transform: rotate(12deg); } 60% { transform: rotate(-8deg); } 80% { transform: rotate(4deg); } 100% { transform: translateY(-1px) scale(1.08); } }
@media (prefers-reduced-motion: reduce) { .nv-ico svg, .nv-ico::before, .nv-ico::after, .nv-puerta { animation: none !important; transition: none; } }
