/* Quran page */

.qHero { padding: 34px 0 10px; display: flex; justify-content: space-between; align-items: end; gap: 16px; flex-wrap: wrap; }
.qHero h1 { margin: 0; font-size: clamp(1.7rem, 4vw, 2.4rem); }
.qHero p { margin: 4px 0 0; color: var(--muted); }
.modeTabs { display: inline-flex; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 4px; gap: 2px; }
.modeTabs button { border: 0; background: transparent; padding: .5rem 1rem; border-radius: 10px; font-weight: 600; color: var(--muted); cursor: pointer; }
.modeTabs button.active { background: var(--primary); color: #fff; }

.panel { background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 16px; box-shadow: var(--shadow-sm); }
.controls { display: grid; grid-template-columns: 1.4fr 1.4fr repeat(4, 1fr); gap: 10px; align-items: end; }
.controls label { display: flex; flex-direction: column; gap: 4px; font-size: .82rem; color: var(--muted); font-weight: 600; min-width: 0; }
.controls select, .controls input { width: 100%; }
.toggles { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; align-items: center; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--bg);
  border-radius: 99px; padding: .3rem .8rem; cursor: pointer; font-size: .88rem; font-weight: 600; color: var(--muted); user-select: none;
}
.chip input { display: none; }
.chip:has(input:checked) { background: var(--primary-soft); border-color: transparent; color: var(--primary); }
.chip.btnlike { background: #fff; }
.spacer { flex: 1; }

/* mushaf */
.mushaf {
  margin-top: 16px; background: #fffdf8; border: 1px solid #efe6d2; border-radius: 22px; padding: 26px clamp(16px, 4vw, 44px) 34px;
  box-shadow: inset 0 0 0 6px #fffaf0, inset 0 0 0 7px #f1e5c8, var(--shadow-sm);
}
.surahHead {
  margin: 0 auto 10px; max-width: 520px; text-align: center; padding: 10px 16px; border-radius: 14px;
  background: linear-gradient(90deg, transparent, #f6ecd4 15%, #f6ecd4 85%, transparent);
}
.surahHead h2 { margin: 0; font-family: var(--quran); font-size: 1.9rem; color: #5b4416; font-weight: 400; }
.surahHead small { color: #8a7346; }
.basmala { text-align: center; font-family: var(--quran); font-size: 1.75rem; color: #133b35; margin: 8px 0 14px; }
.ayat { font-family: var(--quran); font-size: var(--qsize, 1.9rem); line-height: 2.3; text-align: justify; text-align-last: center; color: #14322d; }
.ayah { cursor: pointer; border-radius: 10px; padding: 2px 3px; transition: background .25s ease; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.ayah:hover { background: #f3efe2; }
.ayah.current { background: #fbe9b7; }
.ayah.inrange { }
/* ayah number: our own ornament with the digits centred, so it looks the same in every browser and font */
.ayah .num {
  display: inline-grid; place-items: center; width: 1.05em; height: 1.05em; margin: 0 .1em; vertical-align: -.12em;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cg fill='none' stroke='%23A07C2E'%3E%3Ccircle cx='50' cy='50' r='39' stroke-width='5'/%3E%3Ccircle cx='50' cy='50' r='31.5' stroke-width='2'/%3E%3C/g%3E%3Cg fill='%23A07C2E'%3E%3Ccircle cx='95' cy='50' r='4.2'/%3E%3Ccircle cx='81.8' cy='81.8' r='4.2'/%3E%3Ccircle cx='50' cy='95' r='4.2'/%3E%3Ccircle cx='18.2' cy='81.8' r='4.2'/%3E%3Ccircle cx='5' cy='50' r='4.2'/%3E%3Ccircle cx='18.2' cy='18.2' r='4.2'/%3E%3Ccircle cx='50' cy='5' r='4.2'/%3E%3Ccircle cx='81.8' cy='18.2' r='4.2'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
  font-family: "Scheherazade New", "Amiri", serif; color: #7a5d17; line-height: 1; letter-spacing: 0; white-space: nowrap;
}
.ayah .num b { font-weight: 700; font-size: .5em; letter-spacing: 0; transform: translateY(.04em); }
.ayah .num.d2 b { font-size: .43em; }
.ayah .num.d3 b { font-size: .36em; }
/* list layout (with tafsir) */
.ayat.list { text-align: right; text-align-last: auto; }
.ayat.list .ayah { display: block; padding: 10px 12px; margin: 4px 0; border-bottom: 1px dashed #eadfc6; }
.tafsir { display: block; font-family: var(--font); font-size: .95rem; line-height: 1.9; color: var(--muted); margin-top: 4px; }
/* memorization mode */
.hifz .ayah:not(.current):not(.shown) .t { filter: blur(7px); opacity: .55; }
.hifzHint { text-align: center; color: var(--muted); font-size: .88rem; margin: 0 0 8px; }
.loading { text-align: center; color: var(--muted); padding: 40px 0; font-family: var(--font); font-size: 1rem; }

/* player bar */
.player {
  position: sticky; top: 72px; z-index: 40; margin: 0 0 14px; background: #0F6E56; color: #fff;
  border-radius: 20px; box-shadow: 0 12px 30px rgba(15, 110, 86, .28);
}
.player .container { width: 100%; padding: 0 14px; display: flex; align-items: center; gap: 14px; min-height: 72px; }
.pbtns { display: flex; align-items: center; gap: 6px; }
.round { width: 42px; height: 42px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .14); color: #fff; cursor: pointer; display: grid; place-items: center; transition: background .2s ease; }
.round:hover { background: rgba(255, 255, 255, .26); }
.round svg { width: 19px; height: 19px; fill: currentColor; }
.round.main { width: 56px; height: 56px; background: #FAC775; color: #0F6E56; box-shadow: 0 6px 18px rgba(0, 0, 0, .18); position: relative; transition: transform .15s ease, background .3s ease; }
.round.main svg { width: 26px; height: 26px; }
.round.main:hover { background: #ffd58f; transform: scale(1.04); }
/* while reciting: a soft gold pulse */
.round.main.playing { background: #fff; }
.round.main.playing::after { content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 2px solid rgba(250, 199, 117, .85); animation: pulseRing 1.6s ease-out infinite; }
@keyframes pulseRing { from { transform: scale(.9); opacity: 1; } to { transform: scale(1.35); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .round.main.playing::after { animation: none; } }
.pinfo { flex: 1; min-width: 0; }
.pinfo b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pinfo b { color: #fff; }
.pinfo small { color: rgba(255, 255, 255, .78); }
.prog { height: 5px; background: rgba(255, 255, 255, .22); border-radius: 99px; margin-top: 6px; overflow: hidden; }
.prog i { display: block; height: 100%; width: 0; background: #FAC775; transition: width .3s ease; }

/* tajweed colours (AlQuran Cloud quran-tajweed markup) */
.tj-h, .tj-s, .tj-l { color: #a3a3a3; }
.tj-n { color: #537fff; } .tj-p { color: #4050ff; } .tj-m { color: #000ebc; } .tj-o { color: #2144c1; }
.tj-q { color: #dd0008; } .tj-c { color: #d500b7; } .tj-f { color: #9400a8; } .tj-w { color: #58b800; }
.tj-i { color: #26bffd; } .tj-a { color: #169777; } .tj-u { color: #169200; } .tj-d, .tj-b { color: #a1a1a1; } .tj-g { color: #ff7e1e; }
.tjLegend { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; margin: 0 0 10px; font-size: .85rem; color: var(--muted); }
.tjLegend span { display: inline-flex; align-items: center; gap: 5px; }
.tjLegend i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }

/* volume */
.vol { display: flex; align-items: center; gap: 6px; flex: none; }
.volIcon { border: 0; background: transparent; color: #fff; cursor: pointer; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; }
.volIcon svg { width: 22px; height: 22px; fill: currentColor; }
.volIcon:hover { background: rgba(255, 255, 255, .14); }
.vol input[type=range] { width: 120px; accent-color: #FAC775; cursor: pointer; }
@media (max-width: 560px) { .vol input[type=range] { width: 70px; } }

/* listen mode */
.listen { display: grid; grid-template-columns: 340px 1fr; gap: 16px; margin-top: 16px; align-items: start; }
.reciterList { max-height: 560px; overflow: auto; display: flex; flex-direction: column; gap: 4px; margin-top: 10px; }
.reciter { text-align: right; border: 1px solid transparent; background: transparent; border-radius: 12px; padding: .55rem .7rem; cursor: pointer; }
.reciter:hover { background: var(--bg); }
.reciter.active { background: var(--primary-soft); color: var(--primary); font-weight: 700; }
.reciter small { display: block; color: var(--muted); font-weight: 400; font-size: .78rem; }
.surahGrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-top: 12px; max-height: 470px; overflow: auto; }
.sbtn { border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: .5rem .7rem; text-align: right; cursor: pointer; display: flex; gap: 8px; align-items: center; }
.sbtn:hover { border-color: var(--primary); }
.sbtn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.sbtn span { width: 28px; height: 28px; border-radius: 8px; background: var(--bg); display: grid; place-items: center; font-size: .78rem; font-weight: 700; color: var(--muted); flex: none; }
.sbtn.active span { background: rgba(255, 255, 255, .2); color: #fff; }
audio { width: 100%; margin-top: 10px; }

/* search mode */
.results { margin-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.result { background: #fffdf8; border: 1px solid #efe6d2; border-radius: 16px; padding: 14px 16px; }
.result .t { font-family: var(--quran); font-size: 1.45rem; line-height: 2.1; color: #14322d; }
.result .meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; color: var(--muted); font-size: .88rem; flex-wrap: wrap; }
mark { background: #fbe9b7; border-radius: 4px; padding: 0 2px; }

@media (max-width: 900px) {
  .controls { grid-template-columns: 1fr 1fr; }
  .listen { grid-template-columns: 1fr; }
  .reciterList { max-height: 280px; }
}
@media (max-width: 560px) {
  .player .container { gap: 8px; padding: 0 8px; }
  .round { width: 38px; height: 38px; }
  .round.main { width: 48px; height: 48px; }
  .mushaf { padding: 18px 14px 24px; }
}
