/* Gemeinsames Mikrofon-Menü: Desktop = PNG-Leiste, Mobil = Pill-Design (Referenz) */
.mic-bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  background: transparent !important;
  border: none;
  pointer-events: none;
}

.mic-bottom-nav .mbn-shell {
  pointer-events: auto;
  position: relative;
  width: 100%;
  max-width: none;
  margin: 0;
  height: clamp(88px, 14vw, 150px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: transparent;
  overflow: hidden;
}

/* Desktop-Laser entlang der PNG-Kanten */
.mic-bottom-nav .mbn-shell::before,
.mic-bottom-nav .mbn-shell::after {
  content: "";
  position: absolute;
  left: -18%;
  width: clamp(56px, 14vw, 120px);
  height: 2px;
  border-radius: 999px;
  pointer-events: none;
  z-index: 5;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 236, 160, 0.2) 18%,
    #fff8dc 42%,
    #ffe566 50%,
    #f5c542 58%,
    rgba(255, 236, 160, 0.2) 82%,
    transparent 100%
  );
  box-shadow:
    0 0 4px 1px rgba(255, 248, 200, 0.95),
    0 0 12px 3px rgba(245, 197, 66, 0.85),
    0 0 26px 7px rgba(245, 197, 66, 0.4);
  opacity: 0;
  animation: mbn-edge-laser 3s linear infinite;
}

.mic-bottom-nav .mbn-shell::before { top: 44%; }
.mic-bottom-nav .mbn-shell::after {
  bottom: calc(env(safe-area-inset-bottom, 0px) + 7%);
}

@keyframes mbn-edge-laser {
  0% { left: -18%; opacity: 0; }
  3% { opacity: 1; }
  45% { left: 104%; opacity: 1; }
  48% { left: 104%; opacity: 0; }
  100% { left: 104%; opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .mic-bottom-nav .mbn-shell::before,
  .mic-bottom-nav .mbn-shell::after {
    animation: none;
    opacity: 0;
  }
}

.mic-bottom-nav picture,
.mic-bottom-nav .mbn-desktop-art {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
  background: transparent;
}

.mic-bottom-nav .mbn-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  object-position: center bottom;
  pointer-events: none;
  user-select: none;
  display: block;
  background: transparent !important;
}

.mic-bottom-nav .mbn-overlay {
  position: absolute;
  left: 4%;
  right: 4%;
  bottom: 6%;
  height: 34%;
  display: grid;
  grid-template-columns: 1fr 1fr 1.45fr 1fr 1fr;
  align-items: center;
  z-index: 2;
  pointer-events: none;
}

.mic-bottom-nav .mbn-overlay .mbn-link {
  pointer-events: auto;
}

.mic-bottom-nav .mbn-center-hit {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  transform: translateX(-50%);
  width: clamp(72px, 22vw, 168px);
  z-index: 6;
  pointer-events: auto;
  cursor: pointer;
  text-decoration: none;
  background: transparent;
  border: 0;
  -webkit-tap-highlight-color: transparent;
}

/* Desktop: Seiten-Icons ausblenden (PNG trägt die Optik); Center-Foto bleibt sichtbar */
.mic-bottom-nav .mbn-ico {
  display: none;
}

.mic-bottom-nav .mbn-center-face {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 72%;
  height: 72%;
  margin: auto;
  border-radius: 50%;
  overflow: hidden;
  position: absolute;
  left: 50%;
  top: 42%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 2px rgba(245, 197, 66, 0.85);
}

.mic-bottom-nav .mbn-center-photo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  border-radius: 50%;
  pointer-events: none;
  user-select: none;
}

.mic-bottom-nav .mbn-mic,
.mic-bottom-nav .mbn-center-label {
  display: none !important;
}

.mic-bottom-nav .mbn-txt {
  display: inline;
}

.mic-bottom-nav .mbn-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  height: 100%;
  padding: 0 2px;
  color: #ffffff !important;
  font-family: 'Oswald', 'Arial Narrow', sans-serif;
  font-size: clamp(1.1rem, 3.9vw, 1.45rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: none;
  text-decoration: none;
  transform: translateY(-2px);
  -webkit-text-fill-color: #ffffff !important;
  background: none !important;
  background-image: none !important;
  text-shadow:
    1.2px 0 0 #000,
    -1.2px 0 0 #000,
    0 1.2px 0 #000,
    0 -1.2px 0 #000,
    1px 1px 0 #000,
    -1px 1px 0 #000,
    1px -1px 0 #000,
    -1px -1px 0 #000,
    0 2px 2px rgba(0, 0, 0, 0.55);
  filter: none;
  transition: transform 0.15s ease, color 0.15s ease, text-shadow 0.15s ease;
}

.mic-bottom-nav .mbn-link:hover {
  transform: translateY(-3px);
}

.mic-bottom-nav .mbn-link.is-active {
  transform: translateY(-3px);
  color: #f5c542 !important;
  -webkit-text-fill-color: #f5c542 !important;
  background: none !important;
  background-image: none !important;
  text-shadow:
    1.2px 0 0 #000,
    -1.2px 0 0 #000,
    0 1.2px 0 #000,
    0 -1.2px 0 #000,
    1px 1px 0 #000,
    -1px 1px 0 #000,
    1px -1px 0 #000,
    -1px -1px 0 #000,
    0 0 6px rgba(245, 197, 66, 0.55),
    0 2px 2px rgba(0, 0, 0, 0.55);
  filter: none;
}

.mic-bottom-nav .mbn-center-spacer {
  pointer-events: none;
  height: 100%;
}

body.has-upload-bottom-nav {
  padding-bottom: clamp(96px, 16vw, 168px);
}

body.has-upload-bottom-nav .toast-stack {
  bottom: 120px;
}

body.has-upload-bottom-nav .shell {
  padding-bottom: 1rem;
}

/* ========== MOBIL: Pill-Design wie Referenz ========== */
@media (max-width: 899px) {
  .mic-bottom-nav {
    padding: 0 10px calc(10px + env(safe-area-inset-bottom, 0px));
  }

  .mic-bottom-nav .mbn-shell {
    height: 64px;
    margin: 0 auto;
    max-width: 520px;
    padding-bottom: 0;
    overflow: visible;
    border-radius: 999px;
    background:
      radial-gradient(120% 140% at 50% 0%, rgba(80, 70, 40, 0.35), transparent 55%),
      linear-gradient(180deg, #2a2a2a 0%, #141414 45%, #0c0c0c 100%);
    border: 1.5px solid rgba(212, 175, 55, 0.85);
    box-shadow:
      0 0 0 1px rgba(0, 0, 0, 0.55),
      0 8px 24px rgba(0, 0, 0, 0.55),
      0 0 18px rgba(245, 197, 66, 0.28),
      inset 0 1px 0 rgba(255, 230, 160, 0.12);
  }

  /* PNG + alter Laser aus */
  .mic-bottom-nav .mbn-desktop-art,
  .mic-bottom-nav picture {
    display: none !important;
  }
  .mic-bottom-nav .mbn-shell::before,
  .mic-bottom-nav .mbn-shell::after {
    display: none;
  }

  /* Goldrand-Laser um die Pill */
  .mic-bottom-nav .mbn-shell {
    isolation: isolate;
  }
  .mic-bottom-nav .mbn-shell > .mbn-laser {
    display: none;
  }

  .mic-bottom-nav .mbn-overlay {
    position: absolute;
    inset: 0;
    left: 0;
    right: 0;
    bottom: 0;
    height: auto;
    display: grid;
    grid-template-columns: 1fr 1fr 1.35fr 1fr 1fr;
    align-items: center;
    z-index: 2;
    pointer-events: none;
    padding: 0 6px;
  }

  .mic-bottom-nav .mbn-center-spacer {
    display: block;
    visibility: hidden;
  }

  .mic-bottom-nav .mbn-ico {
    display: block;
    width: 22px;
    height: 22px;
    color: #e8c04a;
    filter: drop-shadow(0 0 4px rgba(245, 197, 66, 0.45));
  }

  .mic-bottom-nav .mbn-txt {
    display: block;
    margin-top: 2px;
    line-height: 1;
  }

  .mic-bottom-nav .mbn-link {
    position: relative;
    width: auto;
    height: auto;
    min-height: 52px;
    gap: 3px;
    padding: 4px 2px 6px;
    color: #e8c04a !important;
    -webkit-text-fill-color: #e8c04a !important;
    font-family: 'Oswald', 'Segoe UI', sans-serif;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.75);
    transform: none;
  }

  .mic-bottom-nav .mbn-link:hover,
  .mic-bottom-nav .mbn-link.is-active {
    transform: translateY(-1px);
    color: #ffe08a !important;
    -webkit-text-fill-color: #ffe08a !important;
  }

  .mic-bottom-nav .mbn-link.is-active::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 2px;
    width: 22px;
    height: 2px;
    transform: translateX(-50%);
    border-radius: 2px;
    background: linear-gradient(90deg, transparent, #f5c542, transparent);
    box-shadow: 0 0 8px rgba(245, 197, 66, 0.8);
  }

  /* Reset absoluteoffsets aus älterem Mobil-CSS */
  .mic-bottom-nav .mbn-overlay .mbn-link:nth-child(1),
  .mic-bottom-nav .mbn-overlay .mbn-link:nth-child(2),
  .mic-bottom-nav .mbn-overlay .mbn-link:nth-child(4),
  .mic-bottom-nav .mbn-overlay .mbn-link:nth-child(5) {
    left: auto;
    top: auto;
    bottom: auto;
    width: auto;
    transform: none;
  }
  .mic-bottom-nav .mbn-overlay .mbn-link:nth-child(1):hover,
  .mic-bottom-nav .mbn-overlay .mbn-link:nth-child(1).is-active,
  .mic-bottom-nav .mbn-overlay .mbn-link:nth-child(2):hover,
  .mic-bottom-nav .mbn-overlay .mbn-link:nth-child(2).is-active,
  .mic-bottom-nav .mbn-overlay .mbn-link:nth-child(4):hover,
  .mic-bottom-nav .mbn-overlay .mbn-link:nth-child(4).is-active,
  .mic-bottom-nav .mbn-overlay .mbn-link:nth-child(5):hover,
  .mic-bottom-nav .mbn-overlay .mbn-link:nth-child(5).is-active {
    transform: translateY(-1px);
  }

  /* Goldener Kreis – innen Foto statt Mikro/INTERSOUND */
  .mic-bottom-nav .mbn-center-hit {
    top: 50%;
    bottom: auto;
    width: 78px;
    height: 78px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: #0a0a0a;
    border: 2px solid rgba(255, 236, 170, 0.95);
    box-shadow:
      0 0 0 3px rgba(20, 16, 8, 0.55),
      0 0 22px rgba(245, 197, 66, 0.75),
      0 0 40px rgba(245, 197, 66, 0.35);
    display: grid;
    place-items: center;
    overflow: hidden;
    z-index: 8;
  }

  .mic-bottom-nav .mbn-center-face {
    display: block;
    position: absolute;
    inset: 4px;
    width: auto;
    height: auto;
    margin: 0;
    left: 4px;
    top: 4px;
    right: 4px;
    bottom: 4px;
    transform: none;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: none;
  }

  .mic-bottom-nav .mbn-center-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
  }

  /* Laser-Glanz auf dem Goldrand (alle 3s rundum) */
  .mic-bottom-nav .mbn-shell::before {
    display: block;
    content: "";
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    padding: 2px;
    background: conic-gradient(
      from 0deg,
      transparent 0deg 300deg,
      rgba(255, 248, 200, 0.15) 325deg,
      #fff8dc 340deg,
      #f5c542 350deg,
      #fff8dc 355deg,
      transparent 360deg
    );
    -webkit-mask:
      linear-gradient(#000 0 0) content-box,
      linear-gradient(#000 0 0);
    mask:
      linear-gradient(#000 0 0) content-box,
      linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0.95;
    animation: mbn-pill-laser 3s linear infinite;
    z-index: 1;
    pointer-events: none;
    box-shadow: none;
    width: auto;
    height: auto;
    left: auto;
    top: auto;
    bottom: auto;
  }

  @keyframes mbn-pill-laser {
    to { transform: rotate(360deg); }
  }

  body.has-upload-bottom-nav,
  body:has(.mic-bottom-nav) {
    padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px));
  }
}

/* Desktop: Bottom-Menü aus – Navigation sitzt im Header */
@media (min-width: 768px) {
  .mic-bottom-nav {
    display: none !important;
  }
  body.has-upload-bottom-nav,
  body:has(.mic-bottom-nav) {
    padding-bottom: 0 !important;
  }
}

@media (min-width: 900px) {
  .mic-bottom-nav .mbn-shell {
    height: clamp(110px, 9vw, 160px);
  }
  .mic-bottom-nav .mbn-shell::before {
    top: 40%;
  }
  .mic-bottom-nav .mbn-shell::after {
    bottom: calc(env(safe-area-inset-bottom, 0px) + 9%);
  }
  .mic-bottom-nav .mbn-overlay {
    left: 2%;
    right: 2%;
    bottom: 8%;
    max-width: none;
    margin: 0;
  }
  .mic-bottom-nav .mbn-center-hit {
    width: clamp(100px, 14vw, 180px);
  }
  .mic-bottom-nav .mbn-overlay .mbn-link:nth-child(1) {
    transform: translate(-56px, -2px);
  }
  .mic-bottom-nav .mbn-overlay .mbn-link:nth-child(1):hover,
  .mic-bottom-nav .mbn-overlay .mbn-link:nth-child(1).is-active {
    transform: translate(-56px, -3px);
  }
  .mic-bottom-nav .mbn-overlay .mbn-link:nth-child(2) {
    transform: translate(-36px, -2px);
  }
  .mic-bottom-nav .mbn-overlay .mbn-link:nth-child(2):hover,
  .mic-bottom-nav .mbn-overlay .mbn-link:nth-child(2).is-active {
    transform: translate(-36px, -3px);
  }
  .mic-bottom-nav .mbn-overlay .mbn-link:nth-child(4) {
    transform: translate(36px, -2px);
  }
  .mic-bottom-nav .mbn-overlay .mbn-link:nth-child(4):hover,
  .mic-bottom-nav .mbn-overlay .mbn-link:nth-child(4).is-active {
    transform: translate(36px, -3px);
  }
  .mic-bottom-nav .mbn-overlay .mbn-link:nth-child(5) {
    transform: translate(56px, -2px);
  }
  .mic-bottom-nav .mbn-overlay .mbn-link:nth-child(5):hover,
  .mic-bottom-nav .mbn-overlay .mbn-link:nth-child(5).is-active {
    transform: translate(56px, -3px);
  }
}
