/* ================= Oyat 9: tilovat yodlash, to'liq ekran mushaf, oyatni bosib tinglash ================= */

/* ---------- speed: pages that are not on screen are not laid out or painted ---------- */
.view.pgv.v9cv:not(.on) { content-visibility: hidden; }
.dua, .rec, .vid, .book, .lesson, .hub-card { content-visibility: auto; contain-intrinsic-size: auto 240px; }

/* ---------- mini player: an ayah clicked in the mushaf ---------- */
.v9mini { position: fixed; z-index: 45; left: 50%; bottom: calc(96px + var(--safe-b, 0px)); transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  display: flex; align-items: center; gap: 10px; padding: 6px 8px 6px 14px; border-radius: 999px; max-width: calc(100vw - 24px);
  background: color-mix(in srgb, #0f2a22 92%, transparent); color: #fbf3df; box-shadow: 0 18px 40px -18px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.08);
  border: 1px solid rgba(232,200,120,.35); transition: opacity .3s, transform .35s cubic-bezier(.16,1,.3,1); font-size: 14px; }
.v9mini.on { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.v9mini .eq { display: inline-flex; gap: 2px; align-items: flex-end; height: 16px; }
.v9mini .eq i { width: 3px; background: #e8c878; border-radius: 2px; animation: v9eq .9s ease-in-out infinite; }
.v9mini .eq i:nth-child(2) { animation-delay: -.3s } .v9mini .eq i:nth-child(3) { animation-delay: -.6s }
.v9mini.paused .eq i { animation-play-state: paused; }
@keyframes v9eq { 0%,100% { height: 4px } 50% { height: 16px } }
.v9mini b { font-weight: 500; white-space: nowrap; }
.v9mini small { color: rgba(251,243,223,.7); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 30vw; }
.v9mini button { height: 34px; min-width: 34px; padding: 0 10px; border-radius: 999px; color: #fbf3df; border: 1px solid rgba(255,255,255,.18); display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; }
.v9mini button:hover { background: rgba(255,255,255,.1); }
.v9mini button.on { background: #e8c878; color: #1c1408; border-color: transparent; }
.v9mini svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.7; }
@media (max-width: 860px) { .v9mini { bottom: calc(92px + var(--safe-b, 0px)); } .v9mini small { display: none; } }
body.listening .v9mini { display: none; }
#spread .w.v9cur { background: color-mix(in srgb, #e8c878 32%, transparent); border-radius: 4px; box-shadow: 0 0 0 2px color-mix(in srgb, #e8c878 26%, transparent); }
#spread .page { cursor: pointer; }

/* ---------- full-screen mushaf: no side menus, the book fills the screen ---------- */
body.v9full #gnav, body.v9full #rside, body.v9full #decor, body.v9full .rbar, body.v9full #reader .topbar, body.v9full #reader .dock, body.v9full #reader .m-where, body.v9full .navbtn { display: none !important; }
body.v9full #reader .stagebook, body.v9full.theme-mushaf #reader .stagebook { inset: calc(10px + var(--safe-t, 0px)) 10px calc(10px + var(--safe-b, 0px)) 10px !important; }
body.v9full #reader { background: radial-gradient(120% 90% at 50% 40%, color-mix(in srgb, var(--v6-c120, #b88935) 10%, #1b1a16), #0b0b09) !important; }
.v9fs { position: fixed; z-index: 60; left: 50%; bottom: calc(14px + var(--safe-b, 0px)); transform: translateX(-50%); display: none; gap: 6px; align-items: center; padding: 6px;
  border-radius: 999px; background: rgba(14,16,14,.72); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border: 1px solid rgba(255,255,255,.14); color: #f7efdc; transition: opacity .4s; }
body.v9full .v9fs { display: flex; }
body.v9full.v9idle .v9fs { opacity: 0; pointer-events: none; }
body.v9full.v9idle { cursor: none; }
.v9fs button { width: 42px; height: 42px; border-radius: 999px; display: grid; place-items: center; color: inherit; }
.v9fs button:hover { background: rgba(255,255,255,.12); }
.v9fs svg { width: 19px; height: 19px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.v9fs .pg { font-family: var(--mono, ui-monospace, monospace); font-size: 12px; letter-spacing: .08em; padding: 0 8px; min-width: 92px; text-align: center; white-space: nowrap; }

/* ---------- Tilovat yodlash ---------- */
#v-yodlash .pg-wrap { max-width: 1240px; }
.y9-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 4px 0 16px; }
.y9-bar select, .y9-bar input { height: 42px; border-radius: 12px; padding: 0 12px; border: 1px solid var(--line, rgba(0,0,0,.14)); background: var(--card, rgba(255,255,255,.6)); color: var(--ink); font: inherit; }
.y9-bar .num { display: inline-flex; align-items: center; gap: 4px; }
.y9-bar .num input { width: 66px; text-align: center; }
.y9-bar .ib { width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--line, rgba(0,0,0,.14)); display: grid; place-items: center; color: var(--ink); background: var(--card, transparent); }
.y9-bar .seg { display: inline-flex; padding: 3px; border-radius: 12px; border: 1px solid var(--line, rgba(0,0,0,.14)); background: var(--card, transparent); }
.y9-bar .seg button { height: 34px; padding: 0 12px; border-radius: 9px; color: var(--ink-2, inherit); font-size: 13.5px; }
.y9-bar .seg button[aria-pressed="true"] { background: #13261f; color: #f3dfa6; }
.y9-bar svg, .y9-ctl svg, .y9-side svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.y9-stage { --y-bg: #0b1430; --y-bg2: #0f1d44; --y-gold: #f2cf7a; --y-vio: #b9a2ff; --y-ink: #eef1fb; --y-ink2: rgba(222,230,255,.7); --y-line: rgba(160,180,240,.18);
  position: relative; display: grid; grid-template-columns: minmax(250px, 330px) 1fr; gap: 18px; padding: 18px; border-radius: 26px; color: var(--y-ink);
  background: radial-gradient(90% 70% at 70% 0%, #1b2a5c 0%, transparent 60%), linear-gradient(180deg, var(--y-bg2), var(--y-bg)); box-shadow: 0 30px 60px -30px rgba(5,10,30,.75), inset 0 1px 0 rgba(255,255,255,.06); overflow: hidden; isolation: isolate; }
.y9-stage::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .07; z-index: -1; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
.y9-side { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.y9-video { position: relative; border-radius: 16px; overflow: hidden; background: #050a1a; aspect-ratio: 4 / 5; border: 1px solid var(--y-line); display: grid; place-items: center; }
.y9-video.wide { aspect-ratio: 16 / 9; }
.y9-video iframe, .y9-video video, .y9-video .yt { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.y9-video video { object-fit: cover; background: #000; }
.y9-orb { display: grid; place-items: center; gap: 14px; text-align: center; padding: 18px; }
.y9-orb canvas { width: 170px; height: 170px; }
.y9-orb b { font-weight: 500; font-size: 17px; }
.y9-orb small { color: var(--y-ink2); font-size: 13px; }
.y9-takes { display: flex; flex-direction: column; gap: 8px; }
.y9-take { display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; align-items: center; padding: 9px 12px; border-radius: 14px; border: 1px solid var(--y-line); background: rgba(255,255,255,.03); color: var(--y-ink); text-align: left; transition: border-color .2s, background .2s; }
.y9-take[aria-pressed="true"] { border-color: color-mix(in srgb, var(--y-gold) 60%, transparent); background: rgba(242,207,122,.08); }
.y9-take i { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 12px; font-family: var(--mono, monospace); background: var(--y-gold); color: #1a1406; }
.y9-take.you i { background: var(--y-vio); color: #120a2c; }
.y9-take b { font-weight: 500; font-size: 14px; display: block; }
.y9-take small { color: var(--y-ink2); font-size: 12px; }
.y9-take time { font-family: var(--mono, monospace); font-size: 12px; color: var(--y-ink2); }
.y9-link { display: flex; gap: 6px; }
.y9-link input { flex: 1; min-width: 0; height: 38px; border-radius: 10px; border: 1px solid var(--y-line); background: rgba(255,255,255,.05); color: var(--y-ink); padding: 0 10px; font: inherit; font-size: 13px; }
.y9-link button { height: 38px; padding: 0 12px; border-radius: 10px; background: rgba(255,255,255,.1); color: var(--y-ink); font-size: 13px; }
.y9-note { font-size: 12.5px; color: var(--y-ink2); line-height: 1.45; }

.y9-main { min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.y9-ref { display: flex; justify-content: space-between; align-items: center; font-family: var(--mono, monospace); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--y-ink2); }
.y9-ref .rep { color: var(--y-gold); }
.y9-ayah { direction: rtl; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; padding: 10px 6px 2px; min-height: 92px; }
.y9-w { display: flex; flex-direction: column; align-items: center; gap: 2px; cursor: pointer; border-radius: 10px; padding: 2px 4px; transition: background .2s; }
.y9-w .ar { font-family: var(--ar, "Amiri Quran", serif); font-size: calc(clamp(28px, 3.4vw, 46px) * var(--ar-scale, 1)); line-height: 1.75; color: var(--y-ink); transition: color .25s, text-shadow .25s, opacity .3s, filter .3s; }
.y9-w .sy { direction: ltr; font-family: var(--mono, monospace); font-size: 11.5px; color: var(--y-ink2); letter-spacing: .02em; white-space: nowrap; }
.y9-w .sy span { transition: color .15s; } .y9-w .sy span.on { color: var(--y-gold); text-shadow: 0 0 10px rgba(242,207,122,.6); }
.y9-w.done .ar { color: #fff4d6; }
.y9-w.cur .ar { color: var(--y-gold); text-shadow: 0 0 22px rgba(242,207,122,.45); }
.y9-w.cur { background: rgba(242,207,122,.06); }
.y9-w:hover { background: rgba(255,255,255,.05); }
.y9-stage.hide1 .y9-w:not(.cur):not(.done) .ar { opacity: .16; filter: blur(5px); }
.y9-stage.hide2 .y9-w:not(.cur) .ar { opacity: .06; filter: blur(9px); }
.y9-stage.hide2 .y9-w:not(.cur) .sy { opacity: .25; }
.y9-tr { text-align: center; color: var(--y-ink2); font-size: calc(15px * var(--tr-scale, 1)); line-height: 1.5; min-height: 22px; }
.y9-graph { position: relative; height: clamp(190px, 30vh, 280px); border-radius: 16px; background: linear-gradient(180deg, rgba(255,255,255,.025), rgba(255,255,255,.01)); border: 1px solid var(--y-line); overflow: hidden; }
.y9-graph canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.y9-graph .msg { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 20px; color: var(--y-ink2); font-size: 14px; }
.y9-ctl { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; }
.y9-ctl button { height: 42px; min-width: 42px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--y-line); color: var(--y-ink); display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; transition: background .2s, border-color .2s, transform .15s; }
.y9-ctl button:hover { background: rgba(255,255,255,.07); }
.y9-ctl button:active { transform: scale(.97); }
.y9-ctl .play { width: 58px; height: 58px; padding: 0; justify-content: center; border: 0; background: radial-gradient(circle at 35% 30%, #fff1c4, #e3b85c); color: #1c1406; box-shadow: 0 0 0 6px rgba(242,207,122,.12), 0 10px 26px -10px rgba(242,207,122,.7); }
.y9-ctl .play svg { width: 24px; height: 24px; }
.y9-ctl .y9mic.on { background: var(--y-vio); color: #120a2c; border-color: transparent; animation: y9pulse 1.4s ease-in-out infinite; }
@keyframes y9pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(185,162,255,.5) } 50% { box-shadow: 0 0 0 10px rgba(185,162,255,0) } }
.y9-ctl b { font-family: var(--mono, monospace); font-weight: 500; font-size: 12px; }
.y9-score { display: flex; align-items: center; gap: 16px; padding: 12px 16px; border-radius: 16px; background: rgba(185,162,255,.1); border: 1px solid rgba(185,162,255,.3); }
.y9-score strong { font-family: var(--serif, Georgia, serif); font-weight: 500; font-size: 40px; line-height: 1; color: var(--y-gold); }
.y9-score p { color: var(--y-ink); font-size: 14px; line-height: 1.45; }
.y9-prog { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 16px; align-items: center; }
.y9-prog span { font-family: var(--mono, monospace); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); margin-right: 6px; }
.y9-prog a { width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; font-size: 10px; font-family: var(--mono, monospace); border: 1px solid var(--line, rgba(0,0,0,.14)); color: var(--ink-2); }
.y9-prog a.ok { background: #1e5b43; color: #f6ebcd; border-color: transparent; }
.y9-prog a.cur { outline: 2px solid #c9a24a; outline-offset: 1px; }
@media (max-width: 900px) {
  .y9-stage { grid-template-columns: 1fr; padding: 12px; border-radius: 20px; gap: 12px; }
  .y9-side { display: grid; grid-template-columns: 132px 1fr; gap: 10px; }
  .y9-video { aspect-ratio: 4 / 5; }
  .y9-video.wide { grid-column: 1 / -1; aspect-ratio: 16 / 9; }
  .y9-link { grid-column: 1 / -1; }
  .y9-orb canvas { width: 96px; height: 96px; } .y9-orb { gap: 6px; padding: 8px; } .y9-orb b { font-size: 13px; } .y9-orb small { display: none; }
  .y9-ctl button { padding: 0 11px; font-size: 12.5px; } .y9-ctl .lbl { display: none; }
  .y9-graph { height: 200px; }
}
@media (prefers-reduced-motion: reduce) { .v9mini .eq i, .y9-ctl .y9mic.on { animation: none; } }

.v9fsbtn { display: none; }
@media (max-width: 860px) {
  body.rd-on:not(.v9full):not(.listening):not(.pg-on) .v9fsbtn { display: grid; place-items: center; position: fixed; z-index: 40; top: calc(12px + var(--safe-t, 0px)); right: 12px; width: 42px; height: 42px; border-radius: 14px;
    background: color-mix(in srgb, var(--v6-c50, #fbf6ea) 80%, transparent); border: 1px solid color-mix(in srgb, var(--v6-c120, #b88935) 30%, transparent); color: var(--ink, #1d1a15); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
  .v9fsbtn svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; }
  body.v9full .v9fs { bottom: calc(10px + var(--safe-b, 0px)); }
  body.v9full #reader .stagebook, body.v9full.theme-mushaf #reader .stagebook { inset: calc(6px + var(--safe-t, 0px)) 4px calc(66px + var(--safe-b, 0px)) 4px !important; }
}

body.v9full .v9mini { bottom: auto; top: calc(12px + var(--safe-t, 0px)); transform: translate(-50%, -20px); }
body.v9full .v9mini.on { transform: translate(-50%, 0); }
