*{box-sizing:border-box; margin:0; padding:0; font-family:'Cairo',sans-serif;}
html,body{min-height:100%;}
body{min-height:100vh; color:#123; background:linear-gradient(180deg,#8ed8f0 0%,#bfeaf7 35%,#7ec8e3 70%,#4aa8cf 100%); background-attachment:fixed; display:flex; flex-direction:column;}
:root{--ink:#251f21;--ink2:#5b6b73;--hair:#dbe7ec;--page:#ffffff;}
/* ---- platform identity: header ---- */
.hd{background:linear-gradient(135deg,#312e81 0%,#5b21b6 55%,#2563eb 100%);color:#fff;box-shadow:0 6px 20px rgba(49,46,129,.35);}
.hd-in{max-width:980px;margin:0 auto;padding:12px 16px;display:flex;align-items:center;gap:14px;flex-wrap:wrap;}
.hd a{color:#fff;text-decoration:none;}
.hd .brand{display:flex;align-items:center;gap:10px;}
.hd .logo{display:flex;align-items:center;gap:10px;font-weight:900;font-size:22px;}
.hd .lm{width:42px;height:42px;flex:none;filter:drop-shadow(0 2px 4px rgba(0,0,0,.3));}
.hd .slg{font-size:11px;font-weight:700;color:#c9c4f2;letter-spacing:.5px;}
.hd nav{margin-inline-start:auto;display:flex;gap:6px;flex-wrap:wrap;align-items:center;}
.hd nav a,.hd nav button{background:rgba(255,255,255,.14);border:1px solid rgba(255,255,255,.28);color:#fff;border-radius:20px;padding:7px 14px;font-weight:700;font-size:14px;cursor:pointer;font-family:inherit;}
.hd nav a:hover,.hd nav button:hover{background:rgba(255,255,255,.26);}
.hd nav .cta{background:#f59e0b;border-color:#f59e0b;color:#1e1b4b;font-weight:800;}
/* ---- platform identity: footer ---- */
.site-copy{text-align:center;padding:16px 12px;margin-top:24px;font-size:14px;font-weight:600;color:#1f3a4d;direction:rtl;}
/* ---- contact modal (platform style) ---- */
#cm-modal{position:fixed;inset:0;background:rgba(0,0,0,.5);z-index:9999;display:flex;align-items:center;justify-content:center;padding:14px;}
#cm-modal[hidden]{display:none;}
.cm-card{background:#fff;border-radius:18px;max-width:420px;width:100%;max-height:92vh;overflow:auto;padding:18px;direction:rtl;}
.cm-h{font-weight:900;font-size:20px;color:#0a7d8c;margin-bottom:6px;}
.cm-sub{font-size:14px;color:#555;margin-bottom:10px;}
.cm-card input,.cm-card textarea,.cm-card select{width:100%;box-sizing:border-box;padding:11px;border:2px solid #cde;border-radius:10px;margin:5px 0;font-family:inherit;font-size:16px;background:#fff;color:#123;}
#cm-web{position:absolute;left:-9999px;opacity:0;height:0;}
.cm-ts{margin:6px 0;min-height:0;}
.cm-status{min-height:20px;font-weight:700;margin:4px 0;font-size:14px;}
.cm-btns{display:flex;gap:8px;}
.cm-send{flex:1;background:#0a7d8c;color:#fff;border:0;border-radius:12px;padding:12px;font-weight:800;font-size:16px;font-family:inherit;cursor:pointer;}
.cm-cancel{background:#e8eef0;color:#333;border:0;border-radius:12px;padding:12px 16px;font-weight:700;font-family:inherit;cursor:pointer;}
/* ---- game layout ---- */
.wrap{flex:1;width:100%;max-width:820px;margin:0 auto;padding:22px 16px 40px;}
.card{background:rgba(255,255,255,.92);border-radius:22px;padding:18px 16px;box-shadow:0 8px 20px rgba(0,60,90,.18);margin-bottom:14px;}
h1.game-title{text-align:center;font-weight:900;color:#0a5a62;font-size:30px;text-shadow:0 3px 0 #ffd94d,0 6px 12px rgba(0,60,40,.2);}
.game-sub{text-align:center;font-weight:700;color:#0a5a62;margin:8px 0 18px;}
.h1row{display:flex;align-items:center;gap:12px;justify-content:center;flex-wrap:wrap;}
.hakim-hero{width:110px;height:110px;border-radius:50%;object-fit:cover;border:5px solid #0e7c86;background:#dff3fa;display:block;margin:0 auto;}
.btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:44px;padding:10px 18px;border:0;border-radius:14px;background:#0e7c86;color:#fff;font-weight:800;font-size:16px;font-family:inherit;cursor:pointer;box-shadow:0 4px 10px rgba(14,124,134,.35);}
.btn:active{transform:scale(.98);}
.btn.secondary{background:#fff;color:#0e7c86;border:2px solid #0e7c86;box-shadow:none;}
.btn.amber{background:#f59e0b;color:#1e1b4b;box-shadow:0 4px 10px rgba(245,158,11,.4);}
.btn:disabled{opacity:.55;cursor:not-allowed;}
.name-input{width:100%;max-width:340px;display:block;margin:12px auto;padding:12px 14px;border:2px solid #cde;border-radius:14px;font-size:20px;font-weight:800;text-align:center;font-family:inherit;color:#123;background:#fff;}
/* chapters map */
.chapters{display:grid;grid-template-columns:repeat(2,1fr);gap:10px;}
.chap{position:relative;display:flex;flex-direction:column;gap:2px;text-align:start;min-height:64px;padding:12px;border:2px solid var(--hair);border-radius:16px;background:var(--page);font:inherit;color:var(--ink);cursor:pointer;border-top:7px solid var(--c,#0e7c86);}
.chap:active{transform:scale(.98);}
.chap .n{font-size:12px;color:var(--ink2);font-weight:700;}
.chap .nm{font-weight:800;line-height:1.5;color:#0a5a62;}
.chap .pr{font-size:12px;color:var(--ink2);font-weight:700;}
.chap .st{font-size:13px;color:#b8860b;font-weight:800;letter-spacing:2px;}
.chap.locked{opacity:.6;cursor:pointer;background:#f2f6f7;}
.chap .lock{position:absolute;top:8px;inset-inline-end:10px;font-size:18px;}
@media(min-width:768px){.chapters{grid-template-columns:repeat(3,1fr);}}
/* steps */
.steps{display:flex;gap:8px;flex-wrap:wrap;justify-content:center;margin:6px 0 10px;}
.step{min-width:44px;min-height:44px;border-radius:22px;border:1px solid var(--hair);background:var(--page);color:var(--ink);font:inherit;font-weight:700;cursor:pointer;}
.step.is-on{border-color:#0e7c86;box-shadow:inset 0 0 0 2px #0e7c86;}
.step.is-done{background:#fff6dc;}
.task{margin:10px 0;line-height:1.8;font-weight:700;color:#123;}
.ref{font-size:12px;color:var(--ink2);font-weight:600;}
.canvas{border:2px dashed var(--hair);border-radius:24px;padding:20px 8px;text-align:center;background:#fffdf8;}
.canvas.is-done{border-style:solid;border-color:#f2b705;background:#fff9e6;}
.word{font-size:var(--hs,120px);line-height:1.7;font-weight:700;user-select:none;-webkit-tap-highlight-color:transparent;}
.letter{cursor:pointer;color:#fff;-webkit-text-stroke:2px var(--ink);paint-order:stroke fill;outline-offset:4px;}
.letter.is-filled{-webkit-text-stroke:2px var(--ink);}
.letter:focus-visible{outline:2px solid #0e7c86;border-radius:8px;}
.letter.is-target{text-decoration:underline dotted var(--ink) 3px;text-underline-offset:14px;}
.win{margin:6px 0 0;font-weight:700;color:#8a6400;}
.stars-line{text-align:center;font-size:22px;color:#b8860b;letter-spacing:6px;min-height:26px;}
/* palette */
.palette{display:grid;grid-template-columns:repeat(2,1fr);gap:10px;margin-top:8px;}
.swatch{display:grid;grid-template-columns:36px 1fr;column-gap:10px;align-items:center;min-height:56px;text-align:start;padding:10px;border:2px solid var(--hair);border-radius:16px;background:var(--page);font:inherit;color:var(--ink);cursor:pointer;}
.swatch.is-on{border-color:#0e7c86;box-shadow:inset 0 0 0 1px #0e7c86;}
.dot{width:36px;height:36px;border-radius:50%;}
.swatch .nm{font-weight:700;}
@media(min-width:768px){.palette{grid-template-columns:repeat(3,1fr);}}
/* bubble */
.bubble{display:flex;gap:12px;align-items:flex-start;background:#f4efec;border-radius:24px;padding:14px;margin-top:10px;}
.bubble img{flex:none;width:64px;height:64px;border-radius:50%;object-fit:cover;background:#fff;}
.bubble p{margin:0;line-height:1.9;font-size:16px;font-weight:600;}
.actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px;justify-content:center;}
.note{color:var(--ink2);font-size:13px;margin-top:8px;font-weight:600;}
/* congrats overlay */
.overlay{position:fixed;inset:0;background:rgba(20,16,60,.55);z-index:9000;display:flex;align-items:center;justify-content:center;padding:16px;}
.overlay[hidden]{display:none;}
.ov-card{background:#fff;border-radius:24px;max-width:440px;width:100%;padding:24px 18px;text-align:center;box-shadow:0 20px 60px rgba(0,0,0,.4);}
.ov-card .big{font-size:44px;}
.ov-card h2{color:#0a5a62;font-weight:900;margin:6px 0;}
.ov-card .st{font-size:30px;color:#b8860b;letter-spacing:8px;margin:4px 0 10px;}
.ov-card p{font-weight:700;color:#345;line-height:1.9;}
/* gallery */
.gallery{display:grid;grid-template-columns:repeat(auto-fill,minmax(120px,1fr));gap:10px;}
.thumb{border:2px solid var(--hair);border-radius:16px;background:#fffdf8;padding:10px;font:inherit;color:var(--ink);cursor:pointer;min-height:44px;}
.thumb .w{display:block;font-size:30px;line-height:1.6;font-weight:700;}
.thumb .r{display:block;font-size:12px;color:var(--ink2);font-weight:700;}
/* certificate */
.cert-img{display:block;width:100%;max-width:640px;margin:10px auto;border-radius:16px;box-shadow:0 10px 30px rgba(0,40,60,.35);}
.reviewer{margin-top:14px;text-align:center;}
.reviewer button{background:none;border:0;color:#1f3a4d;font:inherit;font-size:13px;font-weight:700;text-decoration:underline;cursor:pointer;}
.section-t{font-weight:900;color:#0a5a62;font-size:19px;margin:18px 0 8px;text-align:center;}
.center{text-align:center;}

.hd nav a.cta{background:#f59e0b;border-color:#f59e0b;color:#1e1b4b;font-weight:800;text-decoration:none;}
.linkbtn{background:none;border:0;color:#1f3a4d;font:inherit;font-weight:700;text-decoration:underline;cursor:pointer;}
.cm-status.err{color:#c62828;}.cm-status.ok{color:#2e7d32;}
.wrap{max-width:1100px;}
.prog{font-weight:800;color:#0a5a62;margin-bottom:8px;}
.pg-n{text-align:center;font-weight:800;color:#5b6b73;font-size:14px;}
.story-art{display:block;width:100%;max-width:520px;margin:8px auto;border-radius:16px;border:2px solid var(--hair);background:#fff;}
.story-art.small{max-width:260px;}
.jmap{display:block;width:100%;max-width:440px;margin:0 auto;}
.jpath-bg{stroke:#cfe9f2;stroke-width:16;stroke-linecap:round;}
.jpath{stroke:#0e7c86;stroke-width:4;stroke-dasharray:2 12;stroke-linecap:round;}
.jst{cursor:pointer;outline:none;}
.jst:focus-visible .jring{stroke:#f59e0b;stroke-width:5;}
.jnum{font-size:34px;font-weight:900;}
.jlbl{font-size:15px;font-weight:800;fill:#0a5a62;paint-order:stroke;stroke:#fff;stroke-width:4px;}
.jck{font-size:16px;fill:#fff;font-weight:900;}
.jst:not(.done) .jring{opacity:.75;}
.gcell{display:flex;flex-direction:column;gap:6px;}
.gimg{display:block;width:100%;border-radius:10px;}
.gph{display:block;font-size:34px;font-weight:900;color:#9bb;padding:20px 0;}
.opts{display:flex;flex-direction:column;gap:10px;max-width:420px;margin:12px auto;}
.opt{width:100%;font-size:18px;}
.opt.good{background:#dff5e3;border-color:#2e7d32;color:#1b5e20;}
.fb{min-height:28px;font-weight:800;margin:6px 0;}.fb.ok{color:#2e7d32;}.fb.no{color:#b45309;}
.review{background:#fff8e1;border:2px solid #f2b705;}
.rv-h{font-weight:900;color:#8a6400;margin-bottom:6px;}
.review p,.review li{line-height:1.9;font-weight:600;font-size:14px;}
.review ul{padding-inline-start:20px;margin-top:6px;}
/* ---- studio ---- */
.studio-card{padding:12px;}
.st-root{direction:rtl;}
.st-tools{display:flex;flex-wrap:wrap;gap:6px;align-items:center;margin-bottom:8px;}
.st-btn{display:flex;flex-direction:column;align-items:center;justify-content:center;min-width:52px;min-height:50px;padding:4px 6px;border:2px solid var(--hair);border-radius:12px;background:#fff;font:inherit;color:var(--ink);cursor:pointer;}
.st-btn .st-ic{font-size:20px;line-height:1.1;}.st-btn .st-lb{font-size:11px;font-weight:700;}
.st-btn.on{border-color:#0e7c86;background:#e3f6f8;box-shadow:inset 0 0 0 1px #0e7c86;}
.st-btn:disabled{opacity:.4;cursor:not-allowed;}
.st-sep{flex:1;}
.st-main{display:flex;flex-direction:column;gap:10px;}
.st-vp{position:relative;width:100%;height:min(62vh,560px);min-height:300px;overflow:hidden;border-radius:14px;background:#e9eef0;border:2px solid var(--hair);touch-action:none;user-select:none;-webkit-user-select:none;}
.st-vp[data-tool=bucket]{cursor:cell;}.st-vp[data-tool=brush],.st-vp[data-tool=eraser]{cursor:crosshair;}.st-vp[data-tool=hand]{cursor:grab;}.st-vp[data-tool=pick]{cursor:copy;}
.st-cv{position:absolute;left:0;top:0;width:1200px;height:900px;transform-origin:0 0;background:#fff;isolation:isolate;box-shadow:0 4px 18px rgba(0,0,0,.25);}
.st-paint,.st-stroke,.st-lines{position:absolute;left:0;top:0;width:1200px;height:900px;pointer-events:none;}
.st-lines{mix-blend-mode:multiply;}
.st-side{display:flex;flex-direction:column;gap:8px;}
.st-cur{display:flex;align-items:center;gap:10px;}
.st-cursw{width:44px;height:44px;border-radius:50%;border:3px solid #fff;box-shadow:0 0 0 2px #2b2230;}
.st-curhex{font-weight:800;color:#345;font-size:15px;}
.st-brushes{display:grid;grid-template-columns:repeat(4,1fr);gap:6px;}
.st-bb{display:flex;flex-direction:column;align-items:center;min-height:50px;padding:4px;border:2px solid var(--hair);border-radius:12px;background:#fff;font:inherit;color:var(--ink);cursor:pointer;}
.st-bb.on{border-color:#0e7c86;background:#e3f6f8;}.st-bb .st-ic{font-size:20px;}.st-bb .st-lb{font-size:11px;font-weight:700;}
.st-row{display:grid;grid-template-columns:62px 1fr 34px;align-items:center;gap:8px;font-weight:700;font-size:14px;}
.st-row input[type=range]{width:100%;accent-color:#0e7c86;height:32px;}
.st-ins{display:flex;gap:8px;align-items:center;font-weight:700;font-size:14px;}
.st-h{font-weight:900;color:#0a5a62;font-size:14px;margin-top:4px;}
.st-pal{display:grid;grid-template-columns:repeat(8,1fr);gap:6px;}
.st-sw{aspect-ratio:1;min-height:30px;border-radius:50%;border:2px solid #fff;box-shadow:0 0 0 1.5px #9aa;cursor:pointer;padding:0;}
.st-none{grid-column:1/-1;font-size:13px;color:var(--ink2);}
.st-wheelwrap{display:flex;flex-direction:column;align-items:center;gap:6px;}
.st-wheel{width:180px;height:180px;border-radius:50%;touch-action:none;cursor:crosshair;}
.st-wheelwrap .st-row{width:100%;grid-template-columns:62px 1fr;}
@media(min-width:900px){.st-main{flex-direction:row;align-items:flex-start;}.st-vp{flex:1;height:min(72vh,680px);}.st-side{width:290px;flex:none;}}
