/* Basaer: Hafs_20 must come from the same QuranEnc source bundle as Quran_text.csv. */
@font-face {
  font-family: "BasaerHafs20";
  src: url("./fonts/Hafs_20.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: block;
}

*{box-sizing:border-box}body{margin:0;background:#0b211d;color:#e9dfc6;font-family:system-ui,sans-serif}main{max-width:850px;margin:6vh auto;padding:24px}button,input,select{font:inherit;padding:12px;border:1px solid #8e8059;border-radius:10px;background:#17382e;color:#fff;margin:5px}button{cursor:pointer}a{color:#e5c77c}p{line-height:1.7}.panel{border:1px solid #43564a;border-radius:18px;padding:20px}#viewport{height:100dvh;overflow:hidden;display:flex;align-items:center;justify-content:center;padding:4vh 4vw}#track{width:100%;display:flex;flex-direction:column;gap:10px;transform:translateY(0)}.verse{direction:rtl;text-align:center;font-family:'BasaerHafs20','Amiri','Traditional Arabic',serif;font-weight:400;font-style:normal;font-synthesis:none;font-kerning:normal;letter-spacing:normal;word-spacing:normal;font-size:var(--fs,clamp(28px,4vw,76px));line-height:1.65;padding:14px 24px;color:#d4d9c8;border:1px solid transparent;border-radius:14px;overflow-wrap:normal;word-break:normal}.active{background:#ffffff08;border-color:#bda56b55;color:#f0dfad}.verse:empty{min-height:1em}#viewport:fullscreen{background:#0b211d}body.tv{overflow:hidden}#track .verse{flex-shrink:0}

#viewport{position:relative;display:block;padding:0}#track{position:absolute;top:0;left:4%;width:92%;gap:12px;will-change:transform}#display-status{position:absolute;bottom:12px;left:15px;right:15px;text-align:center;font-size:15px;color:#e5c77c;z-index:2;pointer-events:none}

/* Surah banner: pinned to the top; never part of the moving verse track. */
#surah-banner{position:absolute;top:clamp(8px,1.8vh,22px);left:50%;transform:translateX(-50%);z-index:4;pointer-events:none;max-width:90%;min-width:min(370px,70vw);padding:6px 30px 12px;text-align:center;color:#f0dfad;background:linear-gradient(90deg,transparent 0%,#0b211de6 14%,#0b211de6 86%,transparent 100%);font-family:'BasaerHafs20','Amiri','Traditional Arabic',serif;font-size:clamp(24px,2.25vw,43px);line-height:1.6;white-space:nowrap;text-shadow:0 2px 8px #0b211d}
#surah-banner:after{content:'';display:block;width:75%;height:1px;margin:0 auto;background:linear-gradient(90deg,transparent,#bda56b,transparent)}
#surah-name:empty{display:none}
#surah-banner:has(#surah-name:empty){display:none}

.session-intro{background:#17382e;border:1px solid #8e8059;padding:12px;border-radius:12px;overflow-wrap:anywhere} .session-intro code{font-size:12px;color:#e5c77c}#create-session{padding:16px 25px}

/* v9: Separate Mushaf-style Basmala for the beginning of a new Surah.
   This stays inside the first-ayah node so the original 3-ayah scrolling works. */
.basmala-separator{
  font-family:'BasaerHafs20','Amiri','Traditional Arabic',serif;
  font-weight:400;
  font-style:normal;
  font-synthesis:none;
  font-size:clamp(25px,calc(var(--fs,56px) * .77),62px);
  line-height:1.95;
  letter-spacing:normal;
  word-spacing:normal;
  color:#f0dfad;
  text-align:center;
  padding:4px 12px 12px;
  margin-bottom:12px;
  border-bottom:1px solid #bda56b66;
  white-space:normal;
  overflow-wrap:normal;
  word-break:normal;
}
.ayah-text{direction:rtl;unicode-bidi:plaintext}

/* v10 user / admin UI (TV styling stays unchanged) */
main.simple{max-width:740px;margin:3vh auto;padding:22px}main.simple header{text-align:center;margin-bottom:24px}main.simple h1{color:#f0dfad;font-size:2rem;margin-bottom:4px}main.simple h1 small{font-size:.6em}main.simple .panel{padding:26px;border-color:#665c40}main.simple .session-intro{font-size:.9rem;border-bottom:1px solid #42584b;padding-bottom:16px;margin-bottom:22px}main.simple .session-intro code{font-size:11px;overflow-wrap:anywhere}main.simple .actions{display:flex;flex-wrap:wrap;gap:10px;margin:14px 0;align-items:center}main.simple .actions button, main.simple .actions a{margin:0;text-decoration:none;border:1px solid #9b8553;border-radius:9px;padding:12px 17px;background:#17382e;color:#f0dfad}main.simple .actions.primary #start{background:#806a32;color:white}main.simple .controls{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:15px;margin:22px 0}main.simple label{display:flex;flex-direction:column;gap:8px;font-size:14px}main.simple label input,main.simple label select{width:100%;margin:0}main.simple #status{min-height:30px;color:#f0dfad;background:#ffffff0a;border-radius:7px;padding:8px 12px}main.simple footer{text-align:center;margin-top:18px;color:#b6b8a6;font-size:13px}main.admin{max-width:900px}main.auth{max-width:500px}main.auth input[type=password]{display:block;width:100%;margin:12px 0}.admin-logout{display:inline-block}button:disabled{opacity:.5;cursor:not-allowed}@media(max-width:520px){main.simple{padding:12px}main.simple .panel{padding:15px}main.simple .controls{grid-template-columns:1fr}}

/* v11: Tajweed color highlighting, applied only to strictly matching annotations. */
.tw-rule{color:inherit}
.tw-ghunnah,.tw-ikhfa,.tw-ikhfa_shafawi,.tw-idgham_ghunnah,.tw-idgham_shafawi,.tw-iqlab{color:#3fd888}
.tw-madda_normal,.tw-madda_permissible,.tw-madda_obligatory,.tw-madda_necessary,.tw-madda_long,.tw-madda_separate{color:#f174b5}
.tw-qalqalah{color:#4acaff}
.tw-ham_wasl,.tw-laam_shamsiyah,.tw-silent,.tw-hamza_wasl{color:#b4b8ad}
.tajweed-switch{margin:12px 0;color:#f0dfad}.tajweed-switch label{display:flex!important;align-items:center;gap:10px;flex-direction:row!important}.tajweed-switch input,.tajweed-admin input[type=checkbox]{width:auto!important}
.tajweed-admin{border:1px solid #77673f;padding:18px;border-radius:12px;margin-bottom:18px}.tajweed-admin h2{margin-top:0}

/* v12: verified colored tajweed spans, distinct from legacy tw-rule annotations */
/* Basaer Tajweed overlay: original Quran text stays unchanged. Colors are UI preferences, not identical to any licensed printed Mushaf palette. */
.ayah-text .taj-ghunnah { color: #159c54 !important; }
.ayah-text .taj-ham_wasl { color: #8a8f85 !important; }
.ayah-text .taj-idgham_ghunnah { color: #159c54 !important; }
.ayah-text .taj-idgham_mutajanisayn { color: #159c54 !important; }
.ayah-text .taj-idgham_mutaqaribayn { color: #159c54 !important; }
.ayah-text .taj-idgham_shafawi { color: #14965b !important; }
.ayah-text .taj-idgham_wo_ghunnah { color: #7e9b51 !important; }
.ayah-text .taj-ikhafa { color: #ed3882 !important; }
.ayah-text .taj-ikhafa_shafawi { color: #ed3882 !important; }
.ayah-text .taj-iqlab { color: #159c54 !important; }
.ayah-text .taj-laam_shamsiyah { color: #8a8f85 !important; }
.ayah-text .taj-madda_necessary { color: #c21878 !important; }
.ayah-text .taj-madda_normal { color: #168ac6 !important; }
.ayah-text .taj-madda_obligatory { color: #db1681 !important; }
.ayah-text .taj-madda_permissible { color: #168ac6 !important; }
.ayah-text .taj-qalaqah { color: #138bc1 !important; }
.ayah-text .taj-slnt { color: #8a8f85 !important; }


/* Optional debug appears only when ?debugTajweed=1 is used */
#tajweed-debug{position:fixed;z-index:30;top:4px;left:4px;right:4px;padding:6px 12px;direction:ltr;text-align:left;font:12px/1.5 system-ui,sans-serif;background:#172e26;color:#ffd97b;border:1px solid #d7bc77;border-radius:6px;pointer-events:none;}
#tajweed-debug[hidden]{display:none!important}

/* v12.4 TV Tajweed default-on. Colors remain tied to verified source annotations. */

/* v12.5: local display diagnostics only when explicitly requested or coloring fails */
#tajweed-debug{max-height:28vh;overflow:hidden;white-space:normal;overflow-wrap:anywhere;}

/* v12.7: explicit in-verse Tajweed highlighting, no changes to Quran text */
.ayah-text [class^="taj-"] { text-shadow:none; }

/* v12.8: colorful Tajweed spans inside both TV verses and standalone preview. */
.ayah-text span[class^="taj-"] { color: var(--taj-color, inherit) !important; }
