/**
 * Gooey / liquid bottom nav — style @code_candy
 * SVG blur + alpha threshold ; bead actif melt → slide → reform
 */

.lgk-gooey-dock {
  --lgk-gooey-accent: var(--lgk-acc-accent, #00d4aa);
  --lgk-gooey-bar: #141a22;
  --lgk-gooey-bead: var(--lgk-gooey-accent);
  --lgk-gooey-ink: #9aa4b2;
  --lgk-gooey-ink-active: #070b10;
  --lgk-gooey-h: 3.65rem;
  --lgk-gooey-pad-x: 0.55rem;
  --lgk-gooey-n: 5;
  position: relative;
  isolation: isolate;
  pointer-events: none;
}

.lgk-gooey-dock__svg {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
  pointer-events: none;
}

.lgk-gooey-dock__stage {
  position: absolute;
  inset: 0.35rem var(--lgk-gooey-pad-x) calc(0.35rem + env(safe-area-inset-bottom, 0px));
  height: var(--lgk-gooey-h);
  pointer-events: none;
  z-index: 0;
}

.lgk-gooey-dock__bar {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: var(--lgk-gooey-bar);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
}

.lgk-gooey-dock__bead {
  --x: 0px;
  --y: 0px;
  --sx: 1;
  --sy: 1;
  position: absolute;
  top: 50%;
  left: 0;
  width: calc(100% / var(--lgk-gooey-n));
  height: calc(var(--lgk-gooey-h) - 0.45rem);
  margin-top: calc((var(--lgk-gooey-h) - 0.45rem) / -2);
  display: grid;
  place-items: center;
  transform: translate3d(var(--x), var(--y), 0) scale(var(--sx), var(--sy));
  transform-origin: center center;
  transition:
    transform 0.52s cubic-bezier(0.34, 1.35, 0.64, 1);
  will-change: transform;
  pointer-events: none;
}

.lgk-gooey-dock__bead::before {
  content: "";
  width: 2.55rem;
  height: 2.55rem;
  border-radius: 50%;
  background: var(--lgk-gooey-bead);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--lgk-gooey-bead) 35%, transparent),
    0 0 18px color-mix(in srgb, var(--lgk-gooey-bead) 55%, transparent);
}

.lgk-gooey-dock__bead.is-melting {
  --sx: 1.15;
  --sy: 0.28;
  transition-duration: 0.16s;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

.lgk-gooey-dock__tabs {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(var(--lgk-gooey-n), minmax(0, 1fr));
  align-items: stretch;
  margin: 0.35rem var(--lgk-gooey-pad-x) calc(0.35rem + env(safe-area-inset-bottom, 0px));
  height: var(--lgk-gooey-h);
  padding: 0;
  list-style: none;
  pointer-events: auto;
}

.lgk-gooey-dock__tabs > li {
  display: grid;
  min-width: 0;
}

.lgk-gooey-dock__tab {
  display: grid;
  place-items: center;
  gap: 0.12rem;
  border: 0;
  background: transparent;
  color: var(--lgk-gooey-ink);
  text-decoration: none;
  font: inherit;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  padding: 0.2rem;
  border-radius: 999px;
  transition: color 0.25s ease, transform 0.25s ease;
  -webkit-tap-highlight-color: transparent;
}

.lgk-gooey-dock__tab svg {
  width: 1.2rem;
  height: 1.2rem;
  transition: transform 0.28s cubic-bezier(0.34, 1.4, 0.64, 1);
}

.lgk-gooey-dock__tab span {
  line-height: 1;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lgk-gooey-dock__tab.is-active {
  color: var(--lgk-gooey-ink-active);
}

.lgk-gooey-dock__tab.is-active svg {
  transform: translateY(-0.15rem) scale(1.06);
}

.lgk-gooey-dock__badge {
  position: absolute;
  top: 0.35rem;
  right: calc(50% - 1.05rem);
  min-width: 1rem;
  height: 1rem;
  padding: 0 0.22rem;
  border-radius: 999px;
  background: #ff4d6d;
  color: #fff;
  font-size: 0.55rem;
  font-weight: 800;
  line-height: 1rem;
  text-align: center;
  pointer-events: none;
}

.lgk-gooey-dock__tab {
  position: relative;
}

@media (prefers-reduced-motion: reduce) {
  .lgk-gooey-dock__bead,
  .lgk-gooey-dock__tab,
  .lgk-gooey-dock__tab svg {
    transition: none !important;
  }
  .lgk-gooey-dock__bead.is-melting {
    --sx: 1;
    --sy: 1;
  }
}
