/* Quran Hifz - mobile PWA layer (copied into mobile\ by build-mobile.ps1; not part of the desktop app). Loaded last. */

/* update toast */
#qhUpd { position: fixed; left: 50%; transform: translateX(-50%); top: calc(10px + env(safe-area-inset-top)); z-index: 9999;
  display: flex; align-items: center; gap: 10px; max-width: calc(100vw - 24px); box-sizing: border-box; padding: 8px 8px 8px 14px;
  background: var(--bar2, #1a3328); color: var(--text, #f1ead2); border: 1px solid var(--gold, #d4af37); border-radius: 14px;
  box-shadow: 0 8px 28px #0007; font-size: 14px; direction: rtl; }
#qhUpd[hidden] { display: none; }
#qhUpd .qu-go { background: var(--gold, #d4af37); color: #1a1a1a; border: 0; border-radius: 10px; padding: 7px 12px; font: inherit; font-weight: 700; cursor: pointer; white-space: nowrap; }
#qhUpd .qu-x { background: none; border: 0; color: inherit; padding: 4px; cursor: pointer; display: grid; place-items: center; }

/* keyboard shortcuts mean nothing on a touch phone */
body.qh-touch .gd-keys, body.qh-touch .ob-note:has(kbd), body.qh-phone .gd-keys { display: none !important; }

/* no horizontal page scroll, ever */
html, body { overflow-x: hidden; max-width: 100vw; }

/* ---------------------------------------------------------------- phones (<= 700px)
   The player bar stays docked at the bottom (side docks leave too little width for the mushaf): no drag grip.
   Second row must fit 360-430px: qari pill, the four buttons, 3/7, focus, mic. */
@media (max-width: 700px) {
  #dock #mini .dk-grip { display: none !important; }
  .dk-mini, body.cap2 .dk-mini { grid-template-columns: auto auto minmax(0, 1fr) auto auto auto !important; grid-template-areas: "ay ay ay ay ay ay" "av ctl . rep fo mic" !important;
    column-gap: 3px !important; padding-left: max(6px, env(safe-area-inset-left)) !important; padding-right: max(6px, env(safe-area-inset-right)) !important; }
  #dock #dkAv.dk-qb { max-width: 92px; min-width: 0; padding: 0 8px; }
  .dk-mini .dk-b { width: 40px; height: 40px; }
  .dk-mini .dk-play { width: 44px; height: 44px; }
  .dk-mini .dk-focus { width: 38px !important; min-width: 38px !important; }
  .dk-mic { width: 40px; height: 40px; }
  .dk-rep { min-width: 26px; }
  /* the player sheet's qari badge: the name must stay inside its circle */
  .pl-av.dk-av { width: 58px; height: 58px; font-size: 11.5px; line-height: 1.25; text-align: center; overflow: hidden; padding: 4px; box-sizing: border-box; word-break: break-word; }
  /* home-screen bar on iPhones */
  #dock { padding-bottom: env(safe-area-inset-bottom); }
}
@media (max-width: 360px) {
  #dock #dkAv.dk-qb { max-width: 70px; }
  .dk-mini .dk-b { width: 36px; height: 36px; }
  .dk-rep { display: none; }
}
/* live class: no screen share where the browser has none (body.qh-noshare from pwa.js) */
body.qh-noshare .lv-tile-btn[data-lv=sharejoin], body.qh-noshare .lv-tb[data-m=share] { display: none !important; }
body.qh-noshare .lv-tiles { grid-template-columns: repeat(3, 1fr); }
/* touch: no hover-only affordances, bigger tap rows, no grey tap flash */
body.qh-touch { -webkit-tap-highlight-color: transparent; }
body.qh-touch #twPill, body.qh-touch .dk-grip { touch-action: none; }

/* Google Play build (html.qh-play set by pwa-early.js): no donation call-to-action inside the Play app (Payments policy) */
html.qh-play .st-row[data-page="support"], html.qh-play .ob-support, html.qh-play .st-don { display: none !important; }
