/* Basic chapter presentation. Counts, scores, locks and questions come from QG. */
body.basic-chapter-flow{--ch-bg:#20150f;--ch-panel:#3e291d;--ch-panel2:#302016;--ch-rim:#b79b74;--ch-light:#ead6b5;--ch-shadow:#806249;--ch-text:#f5ead9;--ch-muted:#cfbaa0;--bg:var(--ch-bg);--wood:var(--ch-panel2);--wood-raised:var(--ch-panel);--text:var(--ch-text);--muted:var(--ch-muted);--line:var(--ch-shadow);--gold:var(--ch-rim);--quest-bg:var(--ch-bg);--quest-header:var(--ch-panel2);--quest-brass:var(--ch-shadow);--quest-heading:var(--ch-text);--quest-title:var(--ch-light);--quest-owner:var(--ch-muted);--quest-card:var(--ch-panel2);--quest-text:var(--ch-text);--quest-border:var(--ch-shadow);--quest-ayah:var(--ch-text);--quest-muted:var(--ch-muted);--quest-answer:var(--ch-panel);--quest-line:var(--ch-shadow);--quest-answer-text:var(--ch-text);--quest-button:var(--ch-rim);--quest-button-text:var(--ch-bg);--quest-gold:var(--ch-light);--quest-feedback:var(--ch-panel);background:var(--ch-bg);color:var(--ch-text)}
html[data-color=midnight] body.basic-chapter-flow{--ch-rim:#d2b77e;--ch-light:#ead6b5;--ch-shadow:#806b49}
html:is([data-color=maroon],[data-color=rich-maroon]) body.basic-chapter-flow{--ch-rim:#cf9a9c;--ch-light:#f0d3ce;--ch-shadow:#88644f}
html[data-color=purple] body.basic-chapter-flow{--ch-rim:#baa4d4;--ch-light:#dfd1ed}
html:is([data-color=forest],[data-color=sage]) body.basic-chapter-flow{--ch-rim:#9cbaa5;--ch-light:#d4e4d7}
html[data-color=aqua] body.basic-chapter-flow{--ch-rim:#9fc5c7;--ch-light:#d4e8e7}
html[data-color=charcoal] body.basic-chapter-flow{--ch-rim:#b6b8b3;--ch-light:#e1e1d9}
body.basic-chapter-flow.mumin-layout .app{max-width:420px;background:var(--ch-bg);min-height:100svh;padding-bottom:16px}

body.basic-chapter-flow.mumin-layout #main{width:100%;max-width:390px;padding:26px 14px 18px;color:var(--ch-text)}
.chapters-page{container-type:inline-size;font:14px/1.5 Arial,sans-serif;color:var(--ch-text);background:transparent}
.chapters-page h1{font:400 27px/1.25 Georgia,serif;text-align:center;margin:0 0 12px;color:var(--ch-text)}
.chapters-page .chapter-player{display:grid;justify-items:center;gap:3px;background:transparent;border:0;border-radius:0;padding:0;margin:0 auto 10px;color:var(--ch-text);width:auto}
.chapter-player .chapter-avatar{display:grid;place-items:center;width:38px;height:38px;border-radius:50%;background:var(--ch-panel);font-size:25px}
.chapter-player strong{font-size:15px;font-weight:500}.chapter-player>span:last-child{font-size:12px;color:var(--ch-light)}
.chapter-instruction{text-align:center;color:var(--ch-muted);font-size:13px;margin:0 0 16px}
.chapter-doors{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:22px 8px;align-items:start}
.chapters-page .chapter-door{display:grid;justify-items:center;align-content:start;gap:7px;position:relative;width:100%;min-width:0;min-height:44px;padding:0;border:0;border-radius:0;background:transparent;color:var(--ch-text);font:inherit;text-align:center}
.chapter-special-doors{display:grid;grid-template-columns:repeat(2,minmax(0,84px));justify-content:center;gap:18px;margin:0 auto 24px}
.chapter-mode small{display:block;margin-top:5px;font-size:11px;line-height:1.5}
.pooled-coverage{display:grid;gap:4px;font-size:13px;line-height:1.55;margin-bottom:12px;color:var(--ch-light)}
.pooled-choice-round{grid-column:auto}
.pooled-choice-result .pooled-coverage{margin:18px auto;max-width:320px}
.chapter-number{position:absolute;top:19%;inset-inline:0;font:400 26px/1 Georgia,serif;color:var(--ch-light);pointer-events:none}
.chapter-number.special{font-size:23px}
.chapter-caption{display:grid;justify-items:center;gap:3px;width:100%;pointer-events:none}
.chapter-name{font:400 16px/1.4 Arial,sans-serif;max-width:100%;overflow-wrap:anywhere}
.chapter-count{font-size:12px;color:var(--ch-light);font-variant-numeric:tabular-nums}
.chapter-count>span{display:block;line-height:1.5}
.chapter-best{position:absolute;left:35%;right:9%;bottom:22%;display:grid;gap:2px;color:var(--ch-text);pointer-events:none}
.chapter-best small{font-size:11px;line-height:1.4}.chapter-best strong{font:400 19px/1.2 Georgia,serif}
.chapter-door:disabled{opacity:1}

.chapter-content-notice{font-size:11px;line-height:1.6;text-align:center;color:var(--ch-muted);margin:20px 0 0}
.chapter-top-actions,.chapter-grid-tools{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:20px}
.chapters-page .chapter-back,.chapters-page .chapter-grid-tools button{border:0;background:transparent;color:var(--ch-light);padding:8px 0;font-size:13px;min-height:44px}
.chapter-english{text-align:center;color:var(--ch-light);font-size:15px;margin:0 0 18px}
.chapter-info{border-block:1px solid var(--ch-shadow);padding:16px 0 8px;margin:0 0 18px}.chapter-info h2{font:500 14px/1.5 Arial,sans-serif;margin:0 0 6px;color:var(--ch-light)}
.chapter-info p{font-size:13px;line-height:1.65;color:var(--ch-muted);margin:0 0 10px}.chapter-info .chapter-current{color:var(--ch-light)}
.chapter-mode{display:grid;gap:8px;grid-template-columns:1fr 1fr}.chapters-page .chapter-mode button{font-size:12px;padding:10px 8px;min-height:48px;background:var(--ch-panel2);color:var(--ch-text);border:1px solid var(--ch-shadow)}.chapters-page .chapter-mode button.active{border-color:var(--ch-light);background:var(--ch-panel)}.chapters-page .chapter-mode button:disabled{opacity:1;color:var(--ch-muted);border-color:var(--ch-shadow)}
.chapter-mode-note{font-size:12px;color:var(--ch-muted);margin:8px 0 20px}.chapter-rounds-heading{font:400 21px/1.3 Georgia,serif;color:var(--ch-text);margin:24px 0 18px}
.chapter-rounds{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:22px 18px;align-items:start}
.chapters-page .chapter-round{display:grid;justify-items:center;align-content:start;gap:8px;background:transparent;border:0;border-radius:0;padding:0;color:var(--ch-text);width:100%;min-height:120px}
.round-circle{display:grid;place-items:center;width:52px;height:52px;border-radius:50%;border:1px solid var(--ch-light);background:var(--ch-panel);font:400 23px/1 Georgia,serif;color:var(--ch-light)}
.chapter-round strong{font:500 12px/1.4 Arial,sans-serif;color:var(--ch-light)}.round-coverage{display:grid;gap:4px;color:var(--ch-muted);font-size:12px;line-height:1.5;text-align:center;overflow-wrap:anywhere}.round-coverage bdi{white-space:nowrap;display:inline-block}
.chapters-page .chapter-round.locked{opacity:1}.chapter-round.locked .round-circle{background:var(--ch-bg);border-color:var(--ch-shadow);color:var(--ch-muted)}.chapter-round.locked strong{color:var(--ch-muted)}.chapter-round.passed .round-circle{border-width:3px}
.chapter-result{text-align:center}.chapter-result-score{font:400 56px/1.3 Georgia,serif;margin:28px 0 4px}.chapter-result-actions{display:grid;gap:10px;margin:24px 0}.chapter-result-actions button,.chapter-complete button{background:var(--ch-panel);border-color:var(--ch-rim);color:var(--ch-text)}.chapter-result-actions button.primary{background:var(--ch-rim);color:var(--ch-bg)}.chapter-verdict{color:var(--ch-light);font-size:20px}.chapter-complete{margin-top:24px;padding-top:18px;border-top:1px solid var(--ch-shadow)}
@container(max-width:300px){.chapter-name{font-size:14px}.chapter-number{font-size:24px}.chapter-number.special{font-size:22px}.chapter-basic-frame{height:107px}.chapter-count{font-size:11px}.chapter-doors{gap:20px 6px}}

.chapter-resume{display:grid;gap:4px;width:100%;min-height:64px;margin:10px 0 16px;padding:12px;background:#695033;color:#f4e6c7;border:1px solid #c5a66d;border-radius:10px;text-align:center}
.chapter-resume strong{font-size:16px;font-weight:500}.chapter-resume small{font-size:13px;color:#e5d5b5}

/* The active Missing Word question uses the requested brown/gold surface even
   when a player retains the former default Midnight accent preference. */
html body.basic-chapter-flow[data-view=quiz]{--ch-bg:#201b17;--ch-panel:#3b3023;--ch-panel2:#2e261d;--gold:#d2b77e;--line:#92764e;--quest-line:#a28555;--quest-border:#92764e;--quest-gold:#d2b77e;--ch-light:#ead6b5;--ch-rim:#d2b77e;--ch-shadow:#806b49}

/* Type-first navigation and compact game-like round cards. */
.chapter-track{text-align:center;font-size:13px;color:var(--ch-light);margin:0 0 20px}
.chapter-round-progress{display:flex;align-items:center;gap:14px;color:var(--ch-light);font-size:13px;margin:22px 0}
.chapter-round-progress progress{flex:1;min-width:0;height:6px;accent-color:var(--ch-rim)}
.chapter-intro .chapter-rounds{grid-template-columns:1fr;gap:16px}
.chapter-intro .chapter-round{grid-template-columns:58px 1fr;align-items:center;justify-items:stretch;gap:13px;text-align:start;padding:17px 15px;border:1px solid var(--ch-shadow);border-radius:17px;min-height:120px;background:var(--ch-panel2)}
.chapter-intro .round-circle{border:2px solid var(--ch-rim);background:var(--ch-panel);justify-self:center;box-shadow:0 0 0 4px var(--ch-bg)}
.chapter-intro .chapter-round:not(.locked) .round-circle{background:var(--ch-rim);color:var(--ch-bg)}
.chapter-intro .round-details{display:grid;gap:6px}.chapter-intro .round-details>strong{font-size:15px}.chapter-intro .round-details>small{font-size:11px;color:var(--ch-light)}
.chapter-intro .round-coverage{text-align:start;font-size:13px;gap:3px}.round-surahs-ar{display:block;font-size:18px;line-height:1.65}.round-surahs-en{display:block;font-size:12px;line-height:1.5}
.chapter-intro .chapter-round.locked{background:var(--ch-bg);border-style:dashed;color:var(--ch-muted)}.chapter-intro .chapter-round.locked .round-circle{color:var(--ch-muted);background:var(--ch-panel2);border-color:var(--ch-shadow)}
.chapter-intro .chapter-round.passed{border-color:var(--ch-rim)}
.chapter-grid-tools .chapter-practice{border:1px solid var(--ch-shadow);padding:8px 17px;border-radius:11px;background:var(--ch-panel2)}
.instructions-dialog:has(.chapter-round-parchment){background:#ecdfc3;color:#43311f;border:1px solid #ad8d57;border-radius:20px;max-width:390px}
.chapter-round-parchment{text-align:center;padding:13px 4px;line-height:1.7}.chapter-round-parchment h2{font:30px Georgia,serif}.chapter-round-parchment .round-coverage{color:#59452b;gap:8px}.chapter-round-parchment button{display:block;width:100%;margin-top:14px;border:1px solid #8e7044;border-radius:12px;padding:13px;background:transparent;color:#49351f}.chapter-round-parchment button.primary{background:#654c2d;color:#fff0d2}
.instructions-dialog:has(.chapter-round-parchment)::backdrop{background:rgba(18,14,10,.83)}
.chapter-round-progress progress{appearance:none;border:0;border-radius:8px;background:var(--ch-shadow);overflow:hidden}.chapter-round-progress progress::-webkit-progress-bar{background:var(--ch-shadow)}.chapter-round-progress progress::-webkit-progress-value{background:var(--ch-rim)}.chapter-round-progress progress::-moz-progress-bar{background:var(--ch-rim)}
.chapters-page .chapter-grid-tools button.chapter-practice{border:1px solid var(--ch-shadow);padding:8px 17px;border-radius:11px;background:var(--ch-panel2)}
