.main-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;

  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.1rem 0.6rem;

  --nav-bg: rgba(249, 232, 139, 0.30);
  background: var(--nav-bg);

  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  z-index: 999;
  box-sizing: border-box;
  overflow: visible;

  --lm-fab-size: clamp(66px, 14vw, 92px);
}

.main-nav-inner {
  display: flex;
  justify-content: center;
  width: 100%;
}

.main-nav-list {
  list-style: none;
  display: flex;
  flex-wrap: nowrap;
  gap: 0.25rem;
  margin: 3px;
  padding: 5px;
  width: 100%;
  align-items: center;
}

.main-nav-list > li {
  display: flex;
  min-width: 0;
}

.main-nav-item {
  flex: 1 1 0;
  min-width: 0;
}

.main-nav-link {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;

  min-height: 38px;
  padding: clamp(0.28rem, 0.7vw, 0.4rem) clamp(0.45rem, 1.2vw, 0.9rem);

  font-size: clamp(0.7rem, 1.9vw, 1rem);
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  border-radius: 5px;

  background: url("/images/b.jpg") center / cover no-repeat #fce4bb;
  border: 3px double #000;
  color: #000;

  text-shadow:
    0 1px 0 rgba(255, 244, 160, .90),
    0 -1px 0 rgba(255, 244, 160, .90),
    1px 0 0 rgba(255, 244, 160, .90),
    -1px 0 0 rgba(255, 244, 160, .90);

  box-shadow: 0 3px 6px rgba(0,0,0,.15);
  text-decoration: none;
  white-space: nowrap;
  box-sizing: border-box;

  transition:
    background 0.2s ease,
    box-shadow 0.2s ease,
    transform 80ms ease,
    opacity 0.18s ease;

  font-weight: 800 !important;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
}

.main-nav-link:focus-visible {
  outline: 2px solid rgba(0,0,0,.7);
  outline-offset: 2px;
}

@media (hover: hover) and (pointer: fine) {
  .main-nav-link:hover {
    border: 3px solid black;
  }
}

/* Floating thread / notification button */
.thread-menu-item {
  position: fixed;
  right: 14px;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 68px);
  z-index: 1100;

  display: flex;
  align-items: center;
  justify-content: center;
}

.thread-menu-item.is-hidden {
  display: none;
}

.thread-menu-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  min-width: 52px;
  padding: 0;
  border-radius: 999px;
  text-decoration: none;
  cursor: pointer;

  background: #fefefe;
  border: 1px solid rgba(0,0,0,.12);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  box-shadow: 0 8px 18px rgba(0,0,0,.18);

  transition:
    transform 80ms ease,
    box-shadow 0.2s ease,
    opacity 0.18s ease;
}

.thread-menu-link:active {
  transform: scale(0.97);
}

.thread-menu-link:focus-visible {
  outline: 2px solid rgba(255,255,255,.85);
  outline-offset: 2px;
}

.thread-menu-link[aria-disabled="true"] {
  pointer-events: none;
  cursor: default;
}

.thread-menu-icon-mount {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 37px;
  height: 37px;
  flex: 0 0 37px;
}

.thread-menu-icon-mount img {
  display: block;
  width: 37px;
  height: 37px;
}

.load-more-fab {
  position: absolute;
  left: 50%;
  top: calc(-1.12 * var(--lm-fab-size));

  width: var(--lm-fab-size);
  height: var(--lm-fab-size);
  border-radius: 50%;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);

  box-shadow: 0 6px 14px rgba(0,0,0,.20);

  color: rgba(0,0,0,0.70);
  font-size: clamp(26px, 6vw, 36px);
  font-weight: 900;

  transform: translateX(-50%) translateY(6px);
  animation: fabHint 2.3s ease-in-out infinite;
  will-change: transform, opacity;
}

.load-more-fab.is-tapped {
  opacity: 1 !important;
  animation: fabTap 260ms ease-out 1;
}

@keyframes fabHint {
  0%   { opacity: 0.99; transform: translateX(-50%) translateY(6px)  scale(1); }
  12%  { opacity: 0.99; transform: translateX(-50%) translateY(-6px) scale(1); }
  30%  { opacity: 0.50; transform: translateX(-50%) translateY(-6px) scale(1); }
  78%  { opacity: 0.50; transform: translateX(-50%) translateY(-6px) scale(1); }
  100% { opacity: 0.99; transform: translateX(-50%) translateY(6px)  scale(1); }
}

@keyframes fabTap {
  0%   { transform: translateX(-50%) translateY(6px)   scale(1); }
  60%  { transform: translateX(-50%) translateY(-16px) scale(1.10); }
  100% { transform: translateX(-50%) translateY(-8px)  scale(1.04); }
}

@media (max-width: 360px) {
  .main-nav-link {
    font-size: 0.78rem;
    padding: 0.28rem 0.35rem;
  }

  .thread-menu-item {
    right: 12px;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 64px);
  }
}