/* Phone full player (Quran + Nasheeds): one calm full-screen sheet instead of
   a floating card inside a card. Colours stay with the existing theme files. */
@media (max-width:768px) {
  html body:is(.quran-refreshed,.nasheed-refreshed) dialog:is(.qrf-player-dialog,.nsf-player-dialog) {
    box-sizing:border-box !important;
    width:100% !important; max-width:none !important;
    height:100dvh !important; max-height:100dvh !important;
    margin:0 !important; inset:0 !important;
    border:0 !important; border-radius:0 !important;
    padding:max(8px,env(safe-area-inset-top)) 18px max(24px,env(safe-area-inset-bottom)) !important;
  }
  html body:is(.quran-refreshed,.nasheed-refreshed) dialog:is(.qrf-player-dialog,.nsf-player-dialog)[open] {
    animation:nbk-sheet-up 220ms cubic-bezier(.2,.8,.2,1) both !important;
  }

  /* Close: a quiet "down" chevron at the top left, like native music apps.
     The text stays in the DOM, so screen readers still hear "Schließen". */
  html body:is(.quran-refreshed,.nasheed-refreshed) :is(.qrf-player-close,.nsf-player-close) {
    position:sticky !important; top:0; z-index:30;
    display:grid !important; place-items:center;
    width:44px !important; height:44px !important; min-height:44px !important;
    margin:0 0 6px !important; padding:0 !important;
    border:0 !important; border-radius:50% !important;
    background:rgba(10,12,9,.55) !important; box-shadow:none !important;
    -webkit-backdrop-filter:blur(8px); backdrop-filter:blur(8px);
    font-size:0 !important; color:inherit; overflow:hidden;
  }
  html body:is(.quran-refreshed,.nasheed-refreshed) :is(.qrf-player-close,.nsf-player-close)::before {
    content:''; width:12px; height:12px; margin-top:-6px;
    border-right:2px solid currentColor; border-bottom:2px solid currentColor;
    transform:rotate(45deg); opacity:.85;
  }

  /* Flatten the inner card: no second frame, no second background. */
  html body.quran-refreshed .qrf-player-dialog .player-panel,
  html body.nasheed-refreshed .nsf-player-dialog #main-player {
    padding:0 !important; border:0 !important; border-radius:0 !important;
    background:transparent !important; box-shadow:none !important;
  }
  html body.quran-refreshed .qrf-player-dialog .reciter-name { font-size:14px !important; opacity:.7; margin:0 0 10px !important; }
  html body.quran-refreshed .qrf-player-dialog .qrf-player-label { display:none !important; }
  html body.quran-refreshed .qrf-player-dialog .qrf-cover { height:auto !important; aspect-ratio:16/9; max-height:34dvh; }

  /* Phones change volume with their hardware buttons. */
  @media (pointer:coarse) {
    html body.quran-refreshed .qrf-player-dialog .volume-row,
    html body.nasheed-refreshed .nsf-player-dialog .mp-volume { display:none !important; }
  }
}
/* The queue lives inside the player only. The floating bubble sat on top of
   the list; the player's "Warteschlange" button still opens the drawer
   (it triggers the hidden toggle via .click()). */
html body.quran-refreshed #queueToggleBtn,
html body.nasheed-refreshed #toggleQueue { display:none !important; }

/* Make the in-player queue entry read as a real button, not a loose label. */
html body.quran-refreshed .qrf-player-links button[data-player-queue],
html body.nasheed-refreshed .nsf-player-footer button[data-player-queue] {
  gap:8px; padding:8px 16px !important; min-height:44px;
  border:1px solid color-mix(in srgb, var(--listen-gold,#dfc18b) 40%, transparent) !important;
  border-radius:999px !important;
}
html body.quran-refreshed .qrf-player-links button[data-player-queue]::before,
html body.nasheed-refreshed .nsf-player-footer button[data-player-queue]::before {
  content:''; width:16px; height:12px; flex:0 0 16px;
  background:linear-gradient(currentColor,currentColor) 0 0/100% 2px no-repeat,
             linear-gradient(currentColor,currentColor) 0 5px/100% 2px no-repeat,
             linear-gradient(currentColor,currentColor) 0 10px/60% 2px no-repeat;
}
/* Mini player above the tab bar: blur what scrolls underneath so list text
   does not shine through the translucent card. */
@media (max-width:768px) {
  html body.quran-refreshed .qrf-mini,
  html body.nasheed-refreshed .nsf-mini {
    -webkit-backdrop-filter:blur(16px) saturate(1.1); backdrop-filter:blur(16px) saturate(1.1);
  }
}
@keyframes nbk-sheet-up { from { transform:translateY(24px); opacity:0; } to { transform:none; opacity:1; } }
@media (prefers-reduced-motion:reduce) {
  html body:is(.quran-refreshed,.nasheed-refreshed) dialog:is(.qrf-player-dialog,.nsf-player-dialog)[open] { animation:none !important; }
}
