/* Sticky homepage footer player — mifa.dinbo.de */

body.has-mifa-footer-player {
  padding-bottom: calc(120px + env(safe-area-inset-bottom, 0px));
}

@media (max-width: 767.98px) {
  body.has-mifa-footer-player {
    padding-bottom: calc(168px + env(safe-area-inset-bottom, 0px));
  }
  body.has-mifa-footer-player.mifa-queue-open {
    padding-bottom: calc(62vh + env(safe-area-inset-bottom, 0px));
  }
}

.mifa-footer-player {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 1040;
  display: none;
  pointer-events: none;
}

.mifa-footer-player__label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  float: right;
  margin: 0 6px 8px 0;
  padding: 5px 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(255, 153, 20, 0.95), rgba(255, 179, 71, 0.9));
  color: #1a1208;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 6px 18px rgba(255, 153, 20, 0.35);
  direction: rtl;
  pointer-events: none;
}

.mifa-footer-player__label::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #1a1208;
  box-shadow: 0 0 0 3px rgba(26, 18, 8, 0.15);
}

.mifa-footer-player.is-visible {
  display: block;
  pointer-events: auto;
  animation: mfp-rise 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.mifa-footer-player.is-closing {
  animation: mfp-sink 0.28s ease forwards;
}

@keyframes mfp-rise {
  from {
    opacity: 0;
    transform: translateY(28px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes mfp-sink {
  to {
    opacity: 0;
    transform: translateY(24px) scale(0.98);
  }
}

.mifa-footer-player__shell {
  position: relative;
  clear: both;
  display: grid;
  /* RTL: cover | meta | wave | controls  → visual: controls … cover */
  grid-template-columns: auto minmax(100px, 160px) minmax(0, 1fr) auto;
  grid-template-areas: "cover meta wave controls";
  gap: 12px 14px;
  align-items: center;
  padding: 12px 14px 14px;
  border-radius: 22px;
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(255, 153, 20, 0.2), transparent 55%),
    radial-gradient(90% 120% at 0% 100%, rgba(83, 207, 224, 0.1), transparent 50%),
    rgba(14, 14, 18, 0.94);
  border: 1px solid rgba(255, 153, 20, 0.35);
  box-shadow:
    0 18px 50px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.04) inset;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  overflow: hidden;
  direction: rtl;
}

.mifa-footer-player__cover-wrap {
  grid-area: cover;
  position: relative;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
  display: block;
  text-decoration: none;
  color: inherit;
}

.mifa-footer-player__cover-wrap.is-disabled {
  pointer-events: none;
}

.mifa-footer-player__cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.mifa-footer-player__cover-ring {
  position: absolute;
  inset: 0;
  border-radius: 14px;
  box-shadow: inset 0 0 0 2px rgba(255, 153, 20, 0.55);
  pointer-events: none;
}

.mifa-footer-player.is-playing .mifa-footer-player__cover-ring {
  box-shadow:
    inset 0 0 0 2px rgba(255, 153, 20, 0.85),
    0 0 16px rgba(255, 153, 20, 0.45);
}

.mifa-footer-player__meta {
  grid-area: meta;
  min-width: 0;
  text-align: right;
}

.mifa-footer-player__title {
  margin: 0;
  color: #fff;
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  text-decoration: none;
}

.mifa-footer-player__title:hover {
  color: #ffb347;
  text-decoration: none;
}

.mifa-footer-player__title.is-disabled {
  pointer-events: none;
}

.mifa-footer-player__artist {
  margin: 3px 0 0;
  color: rgba(255, 255, 255, 0.62);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* SoundCloud-like waveform — full width between meta and controls */
.mifa-footer-player__sc {
  grid-area: wave;
  position: relative;
  height: 46px;
  width: 100%;
  min-width: 0;
  align-self: stretch;
  cursor: pointer;
  touch-action: none;
  user-select: none;
  direction: ltr;
  padding: 2px 0;
}

.mifa-footer-player__sc-bars {
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  gap: 2px;
  width: 100%;
  height: 100%;
  direction: ltr;
}

.mifa-footer-player__sc-bars span {
  flex: 1 1 0;
  min-width: 0;
  border-radius: 1px;
  background: rgba(255, 255, 255, 0.28);
  height: 30%;
  transition: background 0.08s linear;
  transform-origin: bottom center;
}

/* unplayed stays gray; played = orange */
.mifa-footer-player__sc-bars span.is-played {
  background: #ff9914;
}

/* vertical playhead — moves L→R with progress */
.mifa-footer-player__playhead {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 2px;
  margin-left: -1px;
  background: #ff9914;
  box-shadow: 0 0 8px rgba(255, 153, 20, 0.85);
  border-radius: 1px;
  pointer-events: none;
  z-index: 2;
}

.mifa-footer-player__playhead::before {
  content: "";
  position: absolute;
  top: -2px;
  left: 50%;
  width: 8px;
  height: 8px;
  margin-left: -4px;
  border-radius: 50%;
  background: #ff9914;
  box-shadow: 0 0 10px rgba(255, 153, 20, 0.9);
}

.mifa-footer-player__controls {
  grid-area: controls;
  display: flex;
  align-items: center;
  gap: 8px;
  direction: ltr;
}

.mifa-footer-player__btn {
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  line-height: 0;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.mifa-footer-player__btn svg {
  display: block;
  flex-shrink: 0;
}

.mifa-footer-player__btn .is-hidden {
  display: none !important;
}

.mifa-footer-player__btn:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.22);
  transform: translateY(-1px);
}

.mifa-footer-player__btn:active {
  transform: scale(0.95);
}

.mifa-footer-player__btn--play {
  width: 48px;
  height: 48px;
  border: 0;
  background: linear-gradient(145deg, #ffb347 0%, #ff9914 55%, #f07a00 100%);
  color: #1a1208;
  box-shadow: 0 8px 22px rgba(255, 153, 20, 0.45);
}

.mifa-footer-player__btn--play:hover {
  background: linear-gradient(145deg, #ffc266 0%, #ff9914 50%, #ff8a00 100%);
  box-shadow: 0 10px 26px rgba(255, 153, 20, 0.55);
}

.mifa-footer-player__btn--close {
  width: 34px;
  height: 34px;
  border-color: transparent;
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.65);
}

.mifa-footer-player__btn--close:hover {
  color: #fff;
  background: rgba(255, 80, 80, 0.25);
  border-color: rgba(255, 80, 80, 0.35);
}

.mifa-footer-player__times {
  position: absolute !important; /* cover-theme must not force relative */
  left: 16px;
  bottom: 6px;
  display: inline-flex;
  align-items: center;
  flex-wrap: nowrap;
  width: max-content;
  max-width: none;
  white-space: nowrap;
  font-size: 10px;
  line-height: 1;
  color: rgba(255, 255, 255, 0.55);
  direction: ltr;
  unicode-bidi: isolate;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
  z-index: 3;
}

.mifa-footer-player__times > span {
  display: inline;
  white-space: nowrap;
}

.mifa-footer-player__times-sep {
  margin: 0 3px;
  opacity: 0.7;
  flex: 0 0 auto;
}

/* Queue panel */
.mifa-footer-player__queue {
  grid-column: 1 / -1;
  margin-top: 4px;
  max-height: 240px;
  overflow: auto;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  direction: rtl;
  -webkit-overflow-scrolling: touch;
}

.mifa-footer-player__queue[hidden] {
  display: none !important;
}

.mifa-footer-player__queue-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px 6px;
  color: rgba(255, 255, 255, 0.85);
  font-size: 12px;
  font-weight: 700;
  position: sticky;
  top: 0;
  background: rgba(14, 14, 18, 0.92);
  z-index: 1;
}

.mifa-footer-player__queue-close {
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}

.mifa-footer-player__queue-list {
  list-style: none;
  margin: 0;
  padding: 0 6px 8px;
}

.mifa-footer-player__queue-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 12px;
  cursor: pointer;
  min-height: 48px;
}

.mifa-footer-player__queue-item:hover,
.mifa-footer-player__queue-item.is-active {
  background: rgba(255, 153, 20, 0.14);
}

.mifa-footer-player__queue-item.is-playing {
  background: rgba(255, 153, 20, 0.22);
}

.mifa-footer-player__queue-item img {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}

.mifa-footer-player__queue-meta {
  min-width: 0;
  flex: 1 1 auto;
  text-align: right;
}

.mifa-footer-player__queue-name {
  display: block;
  color: #fff;
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mifa-footer-player__queue-artist {
  display: block;
  color: rgba(255, 255, 255, 0.55);
  font-size: 11px;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mifa-footer-player__queue-open {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  font-size: 14px;
}

@media (max-width: 767.98px) {
  .mifa-footer-player {
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
  }

  .mifa-footer-player__label {
    margin: 0 12px 6px 0;
    font-size: 11px;
  }

  .mifa-footer-player__shell {
    grid-template-columns: 48px minmax(0, 1fr) auto;
    grid-template-areas:
      "cover meta controls"
      "wave wave wave";
    gap: 8px 10px;
    padding: 10px 12px calc(16px + env(safe-area-inset-bottom, 0px));
    border-radius: 18px 18px 0 0;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
    width: 100%;
    box-sizing: border-box;
  }

  .mifa-footer-player__cover-wrap {
    width: 48px;
    height: 48px;
    max-width: 48px;
    max-height: 48px;
  }

  .mifa-footer-player__sc {
    height: 36px;
  }

  .mifa-footer-player__controls {
    gap: 4px;
    flex-wrap: nowrap;
  }

  .mifa-footer-player__btn {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
  }

  .mifa-footer-player__btn--play {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
  }

  .mifa-footer-player__btn--close {
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
  }

  .mifa-footer-player__times {
    left: 12px;
    right: auto;
    bottom: calc(4px + env(safe-area-inset-bottom, 0px));
    display: inline-flex;
    white-space: nowrap;
    width: max-content;
  }

  .mifa-footer-player__queue {
    max-height: min(52vh, 360px);
    border-radius: 12px;
  }

  .mifa-footer-player__queue-item {
    min-height: 52px;
    padding: 10px 8px;
  }
}

@media (max-width: 420px) {
  .mifa-footer-player__artist {
    font-size: 11px;
  }
}


/* Label readability override */
.mifa-footer-player__label {
  background: #ff9914 !important;
  color: #1a1208 !important;
  -webkit-text-fill-color: #1a1208 !important;
  text-shadow: none !important;
  opacity: 1 !important;
}


/* meta contrast — keep title/artist readable over cover theme */
.mifa-footer-player__title {
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
}
.mifa-footer-player__artist {
  color: rgba(255, 255, 255, 0.82) !important;
  -webkit-text-fill-color: rgba(255, 255, 255, 0.82) !important;
}
