.mf-bnav-wrap,
.mf-bnav-wrap *,
.mf-bnav-wrap *::before,
.mf-bnav-wrap *::after {
  box-sizing: border-box;
}

.mf-bnav-wrap {
  position: fixed;
  left: 50%;
  bottom: calc(14px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 9990;
  width: min(92vw, 390px);
  overflow: visible;
  font-family: "Shippori Mincho", "Yu Mincho", "Hiragino Mincho ProN", serif;
}

.mf-bnav {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: center;
  height: 38px;
  padding: 0 8px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(162, 155, 212, 0.35);
  border-radius: 999px;
  box-shadow: 0 6px 20px rgba(44, 40, 56, 0.08);
  overflow: visible;
}

.mf-bnav-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 38px;
  background: transparent;
  border: 0;
  padding: 0;
  margin: 0;
  color: #2c2838;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.mf-bnav-icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.24s ease, color 0.2s ease;
}

.mf-bnav-item--home {
  width: 44px;
  height: 44px;
  margin: -6px auto 0;
  border-radius: 50%;
  background: #ffffff;
  border: 1px solid rgba(194, 164, 99, 0.65);
  box-shadow: 0 4px 12px rgba(123, 104, 238, 0.16);
  color: #7b68ee;
}

.mf-bnav-label {
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translate(-50%, 6px);
  font-size: 9px;
  line-height: 1;
  letter-spacing: 0.02em;
  color: #7b68ee;
  background: rgba(255, 255, 255, 0.88);
  padding: 0 3px;
  border-radius: 3px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.mf-bnav.is-scrolled .mf-bnav-icon {
  transform: translateY(-3px);
}

.mf-bnav.is-scrolled .mf-bnav-label {
  opacity: 1;
  transform: translate(-50%, 0);
}

.mf-dropup {
  position: absolute;
  right: 6px;
  bottom: 48px;
  z-index: 9995;
  min-width: 132px;
  padding: 6px 0;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(162, 155, 212, 0.4);
  border-radius: 12px;
  box-shadow: 0 10px 26px rgba(44, 40, 56, 0.12);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
}

.mf-dropup.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.mf-dropup-link {
  display: block;
  padding: 9px 16px;
  font-size: 0.84rem;
  color: #2c2838;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.mf-dropup-link:hover,
.mf-dropup-link:focus-visible {
  background: rgba(162, 155, 212, 0.12);
  color: #7b68ee;
}

@media (min-width: 768px) {
  .mf-bnav-wrap {
    top: 16px;
    bottom: auto;
    width: auto;
  }

  .mf-bnav {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 42px;
    padding: 0 10px;
    box-shadow: 0 6px 24px rgba(44, 40, 56, 0.08);
  }

  .mf-bnav-item {
    flex-direction: row;
    gap: 6px;
    height: 32px;
    padding: 0 12px;
    border-radius: 999px;
    transition: background-color 0.18s ease, color 0.18s ease;
  }

  .mf-bnav-item:hover,
  .mf-bnav-item:focus-visible {
    background: rgba(162, 155, 212, 0.12);
    color: #7b68ee;
  }

  .mf-bnav-icon {
    width: 15px;
    height: 15px;
  }

  .mf-bnav.is-scrolled .mf-bnav-icon {
    transform: none;
  }

  .mf-bnav-item--home {
    width: auto;
    height: 32px;
    margin: 0;
    padding: 0 14px;
    border-radius: 999px;
    background: rgba(123, 104, 238, 0.08);
    border: 1px solid rgba(194, 164, 99, 0.52);
    box-shadow: none;
    color: #7b68ee;
  }

  .mf-bnav-item--home:hover,
  .mf-bnav-item--home:focus-visible {
    background: rgba(123, 104, 238, 0.14);
  }

  .mf-bnav-label {
    position: static;
    transform: none;
    opacity: 1;
    background: transparent;
    padding: 0;
    font-size: 0.78rem;
    line-height: 1;
    color: inherit;
    pointer-events: auto;
  }

  .mf-bnav.is-scrolled .mf-bnav-label {
    transform: none;
  }

  .mf-dropup {
    top: 50px;
    bottom: auto;
    right: 0;
    transform: translateY(-8px);
  }

  .mf-dropup.is-open {
    transform: translateY(0);
  }
}
