/* ==========================================================
   MÜZİK AÇ/KAPAT DÜĞMESİ — sağ alt köşe, site boyunca sabit
   ========================================================== */

.muzik-dugme {
  position: fixed;
  z-index: 50;
  /* geniş ekranda da 9:16 sahnenin içinde kalsın */
  right: calc((100vw - min(100vw, 100dvh * 9 / 16)) / 2 + 16px);
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  width: 40px;
  height: 40px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border: 1px solid rgba(255, 233, 200, .6);
  border-radius: 50%;
  background: rgba(43, 28, 48, .22);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 18px rgba(43, 28, 48, .3);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity 1.2s ease, transform 1.2s ease, visibility 0s linear 1.2s, background .25s ease;
  -webkit-tap-highlight-color: transparent;
}

@media (max-aspect-ratio: 9/16) {
  .muzik-dugme { right: 16px; }
}

.muzik-dugme.gorunur {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition-delay: 0s;
}

.muzik-dugme:active { background: rgba(255, 244, 226, .2); }
.muzik-dugme:focus-visible { outline: 2px solid #ffd9a0; outline-offset: 4px; }

/* küçük ses çubukları */
.muzik-dugme i {
  display: block;
  width: 2px;
  height: 14px;
  border-radius: 2px;
  background: #fff4e2;
  transform-origin: center;
  animation: muzik-cubuk 1.2s ease-in-out infinite;
}
.muzik-dugme i:nth-child(1) { animation-delay: -.9s; }
.muzik-dugme i:nth-child(2) { animation-delay: -.3s; }
.muzik-dugme i:nth-child(3) { animation-delay: -.6s; }
.muzik-dugme i:nth-child(4) { animation-delay: 0s; }

@keyframes muzik-cubuk {
  0%, 100% { transform: scaleY(.3); }
  50%      { transform: scaleY(1); }
}

/* kapalıyken: çubuklar durur, üstünden ince bir çizgi geçer */
.muzik-dugme.kapali i {
  animation: none;
  transform: scaleY(.25);
  opacity: .7;
}
.muzik-dugme::after {
  content: "";
  position: absolute;
  width: 22px;
  height: 1.5px;
  border-radius: 2px;
  background: #fff4e2;
  transform: rotate(-45deg) scaleX(0);
  transition: transform .3s ease;
}
.muzik-dugme.kapali::after { transform: rotate(-45deg) scaleX(1); }

@media (prefers-reduced-motion: reduce) {
  .muzik-dugme i { animation: none; transform: scaleY(.6); }
}
