/* Child Qur'an (quran/child/). The surah name in the header uses the house font (KFGQPC Uthmanic Hafs v2.2), as the
   site rules say; the Qur'an words themselves use the mushaf page fonts, loaded by app.js. */
@font-face { font-family: "KFGQPC Uthmanic Hafs"; src: url("/fonts/kfgqpc-uthmanic-hafs-v22.woff") format("woff"); font-display: swap; }
:root {
  --sand:#fff6e9; --card:#fffdf8; --navy:#0b1f4d; --blue:#0f4fa0; --edge:#0b1f4d; --text:#1e2433; --muted:#535a6b; --line:#eadfca;
  --sun:#ffcf5c; --mint:#c9eadb; --sky:#cfe9f7; --soft:#ffe2c7; --hl:rgba(255,207,92,.55);
  --f-ui:"Figtree",system-ui,sans-serif; --f-name:"KFGQPC Uthmanic Hafs","Amiri Quran",serif;
  --size:1; --ar:calc(clamp(40px, 7.5vw, 70px) * var(--size)); --wgap:0.22em; --tap:52px;
  --pattern: radial-gradient(circle at 1px 1px, rgba(11,31,77,.09) 1.5px, transparent 0) 0 0/22px 22px;
}
:root[data-theme=dark] { --sand:#121a2b; --card:#1a2438; --navy:#dfe7ff; --blue:#8fb4ff; --edge:#7d8bb0; --text:#eef1f8; --muted:#aab3c7; --line:#2c3750;
  --sun:#7a6420; --mint:#1f4d3c; --sky:#1f3d55; --hl:rgba(255,207,92,.28); --pattern:none; }
* { box-sizing:border-box; }
html,body { margin:0; }
body { background: var(--pattern), var(--sand); color:var(--text); font:500 18px/1.55 var(--f-ui); min-height:100vh; }
.wrap { max-width:960px; margin:0 auto; padding:14px 18px 60px; }
.mock { font-size:14px; color:var(--muted); background:var(--card); border:1.5px dashed #d8c8a8; border-radius:12px; padding:8px 12px; margin:0 0 14px; }
header { display:flex; align-items:center; gap:14px; flex-wrap:wrap; margin:0 0 14px; }
header h1 { font:800 clamp(26px,4.4vw,40px)/1.05 "Bricolage Grotesque",sans-serif; color:var(--navy); margin:0; letter-spacing:-0.02em; }
header h1 .ar { font:400 1.05em var(--f-name); margin-inline-start:.35em; color:var(--navy); }
header .sp { flex:1; }
.btn { display:inline-flex; align-items:center; justify-content:center; gap:8px; min-height:var(--tap); padding:10px 18px; border-radius:16px;
  border:2.5px solid var(--edge); background:var(--card); color:var(--navy); font:800 17px/1.1 var(--f-ui); box-shadow:4px 4px 0 var(--edge); cursor:pointer; }
.btn:active { transform:translate(3px,3px); box-shadow:1px 1px 0 var(--edge); }
.btn.sun { background:var(--sun); } .btn.mint { background:var(--mint); } .btn.sky { background:var(--sky); }
.btn[aria-pressed=true] { background:var(--navy); color:var(--card); }
.btn:disabled { opacity:.45; cursor:default; }
.btn.small { min-height:42px; padding:6px 12px; font-size:15px; box-shadow:3px 3px 0 var(--edge); }
button:focus-visible, a:focus-visible, .w:focus-visible, select:focus-visible, input:focus-visible { outline:3px solid var(--blue); outline-offset:3px; }
.keys button:focus-visible, .keys .w:focus-visible { outline-width:6px; }

.progress { display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin:0 0 12px; font-weight:700; color:var(--navy); }
.dots { display:flex; gap:6px; }
.dots i { width:14px; height:14px; border-radius:50%; border:2px solid var(--navy); background:var(--card); }
.dots i.done { background:var(--navy); } .dots i.now { background:var(--sun); }
.stars { color:#b98a00; font-size:17px; letter-spacing:1px; }
.target { display:none; align-items:center; gap:8px; flex-wrap:wrap; background:var(--card); border:2px solid var(--navy); border-radius:14px; padding:6px 12px; margin:0 0 12px; font-weight:700; color:var(--navy); }
.target.on { display:flex; }
.target .t { display:inline-flex; gap:5px; }
.target .t span { min-width:30px; text-align:center; border:2px solid var(--navy); border-radius:9px; padding:0 6px; font-size:15px; }
.target .t span.ok { background:var(--mint); }

.next-strip { display:none; gap:8px; flex-wrap:wrap; margin:0 0 12px; }
.next-strip span { background:var(--card); border:2px solid var(--navy); border-radius:999px; padding:4px 12px; font-weight:700; font-size:16px; }
.next-strip span.now { background:var(--sun); }

.stage { background:var(--card); border:3px solid var(--edge); border-radius:26px; box-shadow:6px 6px 0 var(--edge); padding:22px 18px 18px; position:relative; }
.bsm { text-align:center; direction:rtl; font-size:calc(var(--ar) * .7); color:var(--navy); margin:0 0 6px; line-height:1.8; }
.bsm span { padding:0 .12em; }
.ayah { direction:rtl; text-align:center; font-size:var(--ar); line-height:2.3; color:var(--text); margin:0; }
.w { display:inline-block; position:relative; padding:0 .06em .22em; margin:0 var(--wgap); border-radius:.25em; cursor:pointer; vertical-align:top; }
.w:hover { background:rgba(255,207,92,.25); }
.w.on, .w.say { background:var(--hl); }
.w.practise::after { content:""; position:absolute; left:8%; right:8%; bottom:.02em; border-bottom:3px dotted var(--navy); }
.w .bars { position:absolute; left:10%; right:10%; bottom:.12em; display:flex; flex-direction:column; gap:2px; pointer-events:none; }
.w .bars i { height:4px; border-radius:3px; display:block; }
.nocolour .w .bars { display:none; }
.w .beats { display:none; position:absolute; left:0; right:0; top:100%; text-align:center; font:700 13px/1 var(--f-ui); letter-spacing:2px; direction:ltr; color:#8a6500; white-space:nowrap; }
.need-dyscalculia .w .beats { display:block; }
.need-dyscalculia .ayah { line-height:2.7; }
.w.fade { opacity:.18; } .w.gone { opacity:0; } .w.gone.peek, .w.fade.peek { opacity:1; }
.hide-hint { display:none; text-align:center; font-size:15px; color:var(--muted); margin:4px 0 0; }
.hiding .hide-hint { display:block; }
.end { display:inline-block; font-size:.8em; margin:0 .15em; color:#8a6500; }

.turn { display:none; margin:12px auto 0; max-width:420px; text-align:center; font-weight:800; color:var(--navy); }
.turn.on { display:block; }
.turn .bar { height:10px; border-radius:6px; background:var(--line); overflow:hidden; margin-top:6px; }
.turn .bar i { display:block; height:100%; width:0; background:var(--navy); }

.meaning { display:none; margin:14px auto 0; max-width:640px; font-size:17px; line-height:1.55; color:var(--text); background:var(--soft); border-radius:14px; padding:10px 14px; }
:root[data-theme=dark] .meaning { background:#2a2f45; }
.meaning small { display:block; color:var(--muted); font-size:13px; margin-top:4px; }
.meaning.on { display:block; }

.ctrls { display:flex; justify-content:center; gap:10px; flex-wrap:wrap; margin:16px 0 4px; }
.aud { display:none; } .need-auditory .aud { display:inline-flex; }
.rec { display:none; } .opt-record .rec { display:inline-flex; }
.readit { display:none; } .opt-stars .readit, .opt-target .readit, .opt-grownup .readit { display:inline-flex; }
.keyhint { display:none; text-align:center; font-size:14px; color:var(--muted); margin:6px 0 0; }
.keys .keyhint { display:block; }

.key { display:flex; flex-wrap:wrap; justify-content:center; gap:8px 14px; margin:16px 0 0; font:700 15px/1.3 var(--f-ui); }
.key span { display:inline-flex; align-items:center; gap:6px; }
.key b { width:22px; height:6px; border-radius:3px; display:inline-block; }
.key .pr { width:22px; height:0; border-bottom:3px dotted var(--navy); border-radius:0; }
.need-adhd .mock { display:none; }

.card { display:none; margin:14px auto 0; max-width:560px; background:var(--card); border:2.5px solid var(--edge); border-radius:18px; padding:12px 16px; box-shadow:4px 4px 0 var(--edge); }
.card.on { display:block; }
.card .big { direction:rtl; text-align:center; font-size:calc(var(--ar) * 1.25); line-height:1.8; }
.card ul { list-style:none; padding:0; margin:6px 0 10px; display:flex; flex-wrap:wrap; gap:8px; justify-content:center; }
.card li { display:inline-flex; align-items:center; gap:6px; border:2px solid; border-radius:999px; padding:3px 12px; font-weight:700; font-size:15px; background:var(--card); }
.card li b { width:16px; height:5px; border-radius:3px; display:inline-block; }
.card .none { text-align:center; color:var(--muted); font-size:15px; }
.card .row { display:flex; justify-content:center; gap:10px; }

/* Supports panel: docked at the side so each change shows as you make it */
dialog#dlg { position:fixed; inset:0 auto 0 0; margin:0; width:min(380px, 92vw); max-width:none; height:100vh; max-height:none; overflow:auto;
  border:3px solid var(--edge); border-left:0; border-radius:0 22px 22px 0; padding:0; box-shadow:6px 0 0 var(--edge); color:var(--text); background:var(--card); z-index:20; }
@media (min-width:1000px) { html.sup-open .wrap { margin-left:400px; margin-right:auto; } }
@media (max-width:999px) {
  dialog#dlg { inset:auto 0 0 0; width:100%; height:46vh; border:3px solid var(--edge); border-bottom:0; border-radius:22px 22px 0 0; box-shadow:0 -6px 0 var(--edge); }
  html.sup-open .wrap { padding-bottom:48vh; }
}
.dlg { padding:18px 18px 16px; }
.dlg h2 { font:800 26px/1.1 "Bricolage Grotesque",sans-serif; color:var(--navy); margin:0 0 4px; }
.dlg h3 { font:800 15px/1.2 var(--f-ui); color:var(--muted); margin:16px 0 2px; }
.dlg p.lead { margin:0 0 12px; color:var(--muted); font-size:15.5px; }
.dlg .grp { border-top:2px solid var(--navy); margin-top:14px; padding-top:4px; }
.sw { display:flex; gap:12px; align-items:flex-start; padding:9px 0; border-top:1.5px solid var(--line); }
.sw input[type=checkbox] { width:26px; height:26px; margin-top:2px; accent-color:var(--navy); flex:none; }
.sw b { display:block; font-size:17px; color:var(--navy); }
.sw small { display:block; color:var(--muted); font-size:14.5px; line-height:1.4; }
.sw.off { opacity:.6; }
.sw select, .sw input[type=range] { margin-top:6px; font:600 15px var(--f-ui); max-width:100%; }
.sw select { border:2px solid var(--edge); border-radius:10px; padding:4px 8px; background:var(--card); color:var(--text); }
.sw .draft { display:inline-block; font-size:12px; font-weight:800; color:#8a3b00; background:#ffe7cf; border-radius:6px; padding:0 6px; margin-left:4px; }

/* Big 8: what each switch does here */
.ruler { position:fixed; left:0; right:0; height:72px; background:rgba(255,207,92,.22); border-top:2px solid rgba(11,31,77,.22); border-bottom:2px solid rgba(11,31,77,.22); pointer-events:none; z-index:5; display:none; }
.need-dyslexia { --ar:calc(clamp(46px, 9vw, 84px) * var(--size)); --wgap:0.45em; --f-ui:"Lexend","Figtree",system-ui,sans-serif; }
.need-dyslexia body { background:#fdf6e7; letter-spacing:.02em; word-spacing:.1em; line-height:1.7; }
:root[data-theme=dark].need-dyslexia body { background:#1a1f2e; }
.need-dyslexia .ayah { line-height:2.6; }
.need-dyslexia .ruler { display:block; }
.need-visual-stress { --sand:#eef3ea; --card:#f4f7f1; --sun:#d9c98a; --mint:#cfe0d2; --sky:#d7e3da; --text:#2b303b; --edge:#3a4660; }
.need-visual-stress body { background:var(--sand) !important; }
.need-visual-stress.need-dyslexia body { background:#eef1e6 !important; }
.need-visual-stress .ruler { background:rgba(120,140,110,.16); }
:root[data-theme=dark].need-visual-stress { --sand:#1b2320; --card:#222c28; --sun:#6b6030; --mint:#2c4a3c; --sky:#2a4040; --text:#dfe6df; --edge:#8a9a90; }
:root[data-theme=dark].need-visual-stress body, :root[data-theme=dark].need-visual-stress.need-dyslexia body { background:var(--sand) !important; }
.need-visual-stress *, .need-visual-stress *::before, .need-visual-stress *::after { animation:none !important; transition:none !important; }
.need-dyspraxia { --tap:66px; }
.need-dyspraxia .btn { font-size:19px; padding:14px 22px; }
.need-dyspraxia .w { padding:.06em .16em .24em; }
.need-autism .next-strip { display:flex; }
.need-autism .ruler { display:none; }

/* family language (DRAFT translations): Urdu and Bengali in their own script fonts */
html[data-lang=ur] .tr { font-family:"Noto Nastaliq Urdu",var(--f-ui); line-height:2; }
html[data-lang=bn] .tr { font-family:"Noto Sans Bengali",var(--f-ui); }
@media (prefers-reduced-motion: reduce) { * { animation:none !important; transition:none !important; } }
@media (max-width:600px) { .btn { padding:10px 13px; font-size:16px; } .stage { padding:16px 10px 14px; } }

/* --- the real page --- */
.hide { display:none !important; }
.savedfor { font-size:14px; font-weight:700; color:#1d5e2c; background:#e6f4ea; border:1.5px solid #9cc9a8; border-radius:12px; padding:6px 12px; margin:0 0 12px; }
.pageno { font-weight:600; color:var(--muted); font-size:15px; }
.shead { text-align:center; margin:0 auto 6px; padding:6px 16px; max-width:520px; border:2px solid var(--line); border-radius:14px; background:linear-gradient(90deg, transparent, rgba(255,207,92,.18), transparent); }
.shead .ar { display:block; font:400 calc(var(--ar) * .55)/1.6 var(--f-name); color:var(--navy); }
.shead small { display:block; font-weight:700; color:var(--muted); font-size:15px; }
.split-note { text-align:center; font-size:14.5px; color:var(--muted); margin:4px 0 0; }
.loadmsg { text-align:center; color:var(--muted); font-size:15px; min-height:1em; }
.saved { font-size:14px; color:#1d5e2c; min-height:1.2em; margin:8px 0 0; }
.sw input[type=text] { margin-top:6px; width:6.5em; font:600 15px var(--f-ui); border:2px solid var(--edge); border-radius:10px; padding:4px 8px; background:var(--card); color:var(--text); }
.sw .row2 { display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.sw.locked { opacity:.75; }
.embed .wrap { padding-top:10px; }

/* --- OCD and SEMH supports (5 Dec) --- */
.month { font-weight:700; color:var(--navy); font-size:16px; margin:-4px 0 12px; }
.seal { text-align:center; font-weight:800; color:#1d5e2c; background:#e6f4ea; border:2px solid #9cc9a8; border-radius:999px; padding:4px 14px; width:fit-content; margin:10px auto 0; font-size:16px; }
:root[data-theme=dark] .seal { background:#1d3a2a; color:#bfe8cc; border-color:#3d6b4e; }
.semhrow { display:none; }
.need-semh .semhrow { display:flex; }
.need-ocd .readit, .need-ocd #rep { display:none !important; }
.calm { text-align:center; font-weight:700; color:var(--navy); min-height:1.4em; margin:8px 0 0; font-size:16.5px; }
.overlay { position:fixed; inset:0; z-index:50; background:rgba(11,31,77,.35); display:flex; align-items:center; justify-content:center; padding:16px; }
.ovbox { background:var(--card); color:var(--text); border:3px solid var(--edge); border-radius:24px; box-shadow:6px 6px 0 var(--edge); max-width:520px; width:100%; padding:20px 20px 18px; text-align:center; max-height:92vh; overflow:auto; }
.ovbox h2 { font:800 26px/1.15 "Bricolage Grotesque",sans-serif; color:var(--navy); margin:0 0 10px; }
.ovbox p { margin:0 0 12px; font-size:17px; }
.ovbox .faces { display:flex; flex-wrap:wrap; justify-content:center; gap:10px; margin:6px 0 10px; }
.ovbox .faces button { display:flex; flex-direction:column; align-items:center; gap:4px; min-width:84px; min-height:var(--tap); padding:8px 10px; border-radius:16px; border:2.5px solid var(--edge); background:var(--card); color:var(--navy); font:700 15px var(--f-ui); cursor:pointer; }
.ovbox .faces button span { font-size:34px; line-height:1; }
.ovbox .faces button:focus-visible { outline:3px solid var(--blue); outline-offset:3px; }
.ovbox select { font:600 16px var(--f-ui); border:2px solid var(--edge); border-radius:10px; padding:6px 10px; background:var(--card); color:var(--text); margin:4px 0 12px; }
.breath { width:150px; height:150px; margin:8px auto 14px; border-radius:50%; background:radial-gradient(circle, var(--mint), var(--sky)); border:3px solid var(--edge); display:flex; align-items:center; justify-content:center; font:800 18px var(--f-ui); color:var(--navy); animation:breathe 8s ease-in-out infinite; }
@keyframes breathe { 0%,100% { transform:scale(.72); } 50% { transform:scale(1); } }
.need-visual-stress .breath { animation:none; }
@media (prefers-reduced-motion: reduce) { .breath { animation:none; } }
.sw textarea { margin-top:6px; width:100%; min-height:60px; font:500 15px var(--f-ui); border:2px solid var(--edge); border-radius:10px; padding:6px 8px; background:var(--card); color:var(--text); resize:vertical; }
/* the child's own colour theme (SEMH: small choices) */
:root[data-tint=warm] { --sand:#fff1e0; --card:#fffaf2; }
:root[data-tint=mint] { --sand:#e9f6ef; --card:#f6fcf8; }
:root[data-tint=sky] { --sand:#e8f2fb; --card:#f6fafe; }
:root[data-tint=lavender] { --sand:#f1ecfa; --card:#faf8fe; }
:root[data-tint] body { background:var(--sand); }
/* the teacher sees what the child sees, but the child's own buttons (break, finish, choices) would
   speak for the child, so they're left off the teacher's copy */
.is-teacher .semhrow { display:none !important; }
