/* Chapter 05 only: full-width celestial scene, stable interactive stars. */
#chapter-5.wish-chapter{--wish-px:0px;--wish-py:0px;grid-column:full-start/full-end;position:relative;isolation:isolate;width:100%;max-width:none;margin:0;padding:34px 0 34px;border:0;border-radius:0;overflow:clip;background:#44203f;color:#fff2ed;animation:none;scroll-margin-top:0}
#chapter-5 .wishing-sky{position:absolute;inset:0;z-index:-5;pointer-events:none;transform:translate(calc(var(--wish-px)*.2),calc(var(--wish-py)*.2)) scale(1.025);transition:transform .7s ease-out}
#chapter-5 .wishing-sky img{display:block;width:100%;height:100%;object-fit:cover;object-position:50% 75%}
#chapter-5:before{content:'';position:absolute;inset:0;z-index:-4;pointer-events:none;background:linear-gradient(#32152b77 0,#46224315 50%,#381c4b20 100%)}
#chapter-5 .wishing-ambient{position:absolute;inset:0;z-index:-3;background:radial-gradient(ellipse at 50% 72%,#ffc4be22,transparent 60%);pointer-events:none;animation:wishing-ambient 9s ease-in-out infinite alternate}
#chapter-5 .chapter-heading{position:relative;z-index:8;padding:0 20px;text-align:center}
#chapter-5 .chapter-heading .eyebrow{display:inline-flex;justify-content:center;gap:0;padding:5px 22px;border:1px solid #f6cfac;border-radius:30px;background:linear-gradient(#fff3e6,#f5cad7);color:#772847;font-size:15px;font-weight:600;box-shadow:0 0 20px #e7a2c128}
#chapter-5 .chapter-heading h2{font-family:'Noto Naskh Arabic',Georgia,serif;font-size:clamp(40px,4.5vw,60px);line-height:1.6;letter-spacing:0;max-width:880px;margin:15px auto 6px;color:#fff5ed;text-shadow:0 2px 14px #eeb0c34d}
#chapter-5 .chapter-heading .wishing-subtitle{font-size:20px;line-height:1.8;color:#fff0e7}
#chapter-5 .wishing-subtitle span{display:block}
#chapter-5 .wishing-stage{position:relative;max-width:1500px;height:610px;margin:0 auto;direction:ltr;isolation:isolate;z-index:5}
#chapter-5 .wishing-moon{position:absolute;left:2%;top:3px;width:285px;z-index:2;pointer-events:none;translate:calc(var(--wish-px)*.55) calc(var(--wish-py)*.55);transition:translate .7s ease-out;animation:wishing-moon-float 8s ease-in-out infinite}
#chapter-5 .wishing-moon img{display:block;width:100%;height:auto;filter:drop-shadow(0 0 18px #ffe2bd77)}
#chapter-5 .wishing-inscription{position:absolute;left:43%;top:34%;width:95%;font-family:'Birthday Script',cursive;font-size:36px;line-height:1.3;direction:ltr;color:#fff2dc;text-align:left;transform:rotate(-8deg);text-shadow:0 0 8px #d58ba5}
#chapter-5 .wishing-lantern{position:absolute;top:84%;left:19%;width:48px;height:135px;transform-origin:50% 0;animation:wishing-lantern-sway 7s ease-in-out infinite alternate;filter:drop-shadow(0 0 9px #ffce9966)}
#chapter-5 .wishing-lantern.second{left:47%;top:80%;width:37px;height:108px;animation-delay:-3s}
#chapter-5 .wishing-lantern svg{width:100%;height:100%;display:block;overflow:visible}
#chapter-5 .wishing-lantern-light{animation:wishing-lantern-light 2.1s ease-in-out infinite alternate;transform-box:fill-box;transform-origin:50% 80%}
#chapter-5 .wishing-constellation{position:absolute;left:24%;top:64px;width:66%;height:450px;direction:ltr;transition:left .6s ease,width .6s ease}
#chapter-5:is(.has-wish-card,.wishes-all) .wishing-constellation{left:18%;width:52%}
#chapter-5 .wishing-trails{position:absolute;inset:0;width:100%;height:100%;overflow:visible;pointer-events:none;opacity:1;transition:opacity .8s}
#chapter-5 .wishing-trail-base{fill:none;stroke:#ffe8b6;stroke-width:2;opacity:.7;filter:drop-shadow(0 0 4px #ef9bba)}
#chapter-5 .wishing-trail-dust{fill:none;stroke:#fff7db;stroke-width:3;stroke-dasharray:2 17;filter:drop-shadow(0 0 3px #ffe1a9);animation:wishing-trail-flow 15s linear infinite}
#chapter-5.wishes-all .wishing-trail-base{stroke:#ffdda5;stroke-width:3;opacity:1;filter:drop-shadow(0 0 7px #ffb7c3)}
#chapter-5.wishes-all .wishing-trail-dust{animation-duration:7s}
#chapter-5 #wish-stars{position:absolute;inset:0;z-index:5}
#chapter-5 .star-button{position:absolute;width:88px;height:88px;display:block;padding:0;border:0;border-radius:50%;background:transparent;transform:translate(-50%,-50%);scale:1;color:#783448;cursor:pointer;isolation:isolate;text-shadow:none;transition:left 1.2s ease,top 1.2s ease,width .7s,height .7s}
#chapter-5 .star-button:focus-visible{outline:3px solid #fff0c4;outline-offset:8px;background:#f7c3d31a}
#chapter-5 .wishing-star-svg{display:block;width:100%;height:100%;overflow:visible;filter:drop-shadow(0 0 10px #ffcf9d99);animation:wishing-star-pulse 4.5s ease-in-out var(--twinkle-delay,0s) infinite;pointer-events:none}
#chapter-5 .star-button:hover .wishing-star-svg,#chapter-5 .star-button:focus-visible .wishing-star-svg{filter:drop-shadow(0 0 17px #fff1bc);scale:1.08}
#chapter-5 .star-button .wishing-star-number{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;padding-top:5px;font-family:'Tajawal',Arial,sans-serif;font-size:28px;font-weight:700;color:#762b44;line-height:1;pointer-events:none}
#chapter-5 .wishing-star-check{position:absolute;left:auto;bottom:auto;right:-1px;top:2px;display:flex;align-items:center;justify-content:center;width:25px;height:25px;border-radius:50%;background:#a13567;border:1px solid #ffe9b7;opacity:0;scale:.6;transition:opacity .3s,scale .3s;pointer-events:none}
#chapter-5 .wishing-star-check svg{width:15px;height:15px;fill:none;stroke:#fff5e4;stroke-width:2.5}
#chapter-5 .star-button.is-discovered .wishing-star-check{opacity:1;scale:1}
#chapter-5 .star-button.is-selected .wishing-star-svg{filter:drop-shadow(0 0 23px #ffefc0);scale:1.12}
#chapter-5 .star-button.is-selected:after{content:'';position:absolute;inset:-12px;border:1px solid #ffecad88;border-radius:50%;box-shadow:0 0 20px #ffd5b633;pointer-events:none;animation:wishing-selection-in .5s ease both}
#chapter-5 .wishing-heart{position:absolute;inset:0;z-index:3;opacity:0;pointer-events:none;transform:scale(.88);transition:opacity .8s,transform 1.2s ease}
#chapter-5 .wishing-heart svg{width:100%;height:100%;overflow:visible}
#chapter-5 .wishing-heart-line{fill:none;stroke:#fff0bf;stroke-width:3;stroke-linecap:round;stroke-dasharray:1900;stroke-dashoffset:1900;filter:drop-shadow(0 0 8px #ffa6c4);transition:stroke-dashoffset 1.4s ease}
#chapter-5 .wishing-heart-halo{fill:#f5a8c308;stroke:#f4a5c5;stroke-width:12;opacity:.4;filter:blur(5px)}
#chapter-5 .wishing-heart-dot{fill:#fff5d4;opacity:.65}
#chapter-5 .wishing-heart-message{position:absolute;left:21%;right:21%;top:28%;font-family:'Noto Naskh Arabic',Georgia,serif;font-size:clamp(27px,3vw,42px);font-weight:500;line-height:1.65;direction:rtl;color:#fff1e0;text-align:center;text-shadow:0 0 14px #e3a0ba}
#chapter-5 .wishing-heart-message span{display:block}
#chapter-5.is-heart .wishing-heart{opacity:1;transform:scale(1)}
#chapter-5.is-heart .wishing-heart-line{stroke-dashoffset:0}
#chapter-5.is-heart .wishing-heart-dot{animation:wishing-heart-dust 3s ease-in-out var(--dust-delay) infinite alternate}
#chapter-5.is-heart .wishing-trails{opacity:0}
#chapter-5.is-heart .star-button{left:var(--heart-x)!important;top:var(--heart-y)!important;width:62px;height:62px}
#chapter-5.is-heart .star-button .wishing-star-number{font-size:20px}
#chapter-5.is-heart .wishing-star-check{width:20px;height:20px;right:-2px;top:-1px}
#chapter-5 .wishing-summary{position:absolute;right:2%;top:83px;width:310px;padding:27px 24px 24px;border:1px solid #edc3a1;border-radius:26px 13px 26px 13px;background:linear-gradient(145deg,#ffecedee,#efbfd6f2);box-shadow:0 0 0 4px #e9a8c02b,0 12px 35px #28122d55;color:#702b4b;direction:rtl;z-index:7}
#chapter-5 .wishing-summary:before,#chapter-5 .wishing-card:before{content:'';position:absolute;inset:8px;border:1px solid #cb93a1;border-radius:20px 8px 20px 8px;pointer-events:none}
#chapter-5 .wishing-summary h3{font-family:'Noto Naskh Arabic',Georgia,serif;font-size:28px;line-height:1.6;color:#772a4d;margin:0 0 12px}
#chapter-5 .wishing-summary ul{list-style:none;margin:0;padding:0}
#chapter-5 .wishing-summary button{width:100%;min-height:43px;padding:5px 3px;display:flex;gap:9px;align-items:center;text-align:right;border:0;background:transparent;color:#6f2949;font-size:19px;line-height:1.6;border-radius:8px}
#chapter-5 .wishing-summary button:hover,#chapter-5 .wishing-summary button:focus-visible{background:#fff4e975;outline-color:#a44370}
#chapter-5 .wishing-summary button svg{width:21px;height:21px;flex:none;fill:none;stroke:#a23b68;stroke-width:2.5}
#chapter-5 .wishing-card{position:absolute;right:2%;top:64px;width:330px;z-index:15;direction:rtl;text-align:center;padding:53px 28px 25px;background:linear-gradient(145deg,#fff0ecef,#f6c7ddfa);border:2px solid #f2c8ad;border-radius:30px 14px 30px 14px;box-shadow:0 0 0 5px #efb2ca33,0 14px 45px #25102866;color:#652443;animation:wishing-card-in .3s ease both}
#chapter-5 .wishing-card:focus{outline:none}
#chapter-5 .wishing-card-close{position:absolute;right:12px;top:12px;width:44px;height:44px;display:flex;align-items:center;justify-content:center;padding:0;border:1px solid #c88ba2;border-radius:50%;background:#fff5ef;color:#922d58;z-index:2}
#chapter-5 .wishing-card-close svg{width:22px;height:22px;stroke:currentColor;stroke-width:2;fill:none}
#chapter-5 .wishing-card-close:hover{background:#fbe0e8}
#chapter-5 .wishing-card-number{font-size:15px;line-height:1.7;color:#8c3d60;margin:0 0 5px}
#chapter-5 .wishing-card h3{font-family:'Noto Naskh Arabic',Georgia,serif;font-size:30px;line-height:1.6;color:#7b254d;margin:0 0 14px}
#chapter-5 .wishing-card-text{font-family:'Tajawal',Arial,sans-serif;font-size:23px;font-weight:500;line-height:1.9;margin:0;color:#662440;min-height:100px}
#chapter-5 .wishing-card-done{margin:19px auto 0;min-height:48px;padding:9px 18px;border:1px solid #b87892;border-radius:25px;background:#fff2e9;color:#7d2b4e;font-size:17px;font-weight:500;line-height:1.7}
#chapter-5 .wishing-card button:focus-visible{outline:3px solid #97345f;outline-offset:4px}
#chapter-5 .wishing-actions{position:relative;z-index:9;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:13px;padding:0 18px;text-align:center;min-height:92px}
#chapter-5 #wish-count{font-size:17px;line-height:1.7;color:#fff0e1;letter-spacing:0;text-shadow:0 1px 5px #3c1b3d}
#chapter-5 .wishing-next{min-height:62px;max-width:100%;padding:12px 33px;border:1px solid #ffe9af;border-radius:38px;background:linear-gradient(#b9447a,#87234f);color:#fff5e9;box-shadow:0 0 0 3px #efc49577,0 0 25px #f7a9c166;font-size:23px;font-weight:600;line-height:1.7}
#chapter-5 .wishing-next:hover{background:linear-gradient(#a6386c,#741540);transform:translateY(-2px)}
#chapter-5 .wishing-next:focus-visible{outline:3px solid #fff1bd;outline-offset:7px}
#chapter-5 .wishing-next:disabled{opacity:.6;cursor:default}
#chapter-5 .wishing-branch{position:absolute;width:29%;max-width:460px;height:auto;top:-14px;left:-25px;z-index:3;pointer-events:none;translate:calc(var(--wish-px)*.2) calc(var(--wish-py)*.2);transition:translate .8s ease-out}
#chapter-5 .wishing-branch.right{left:auto;right:-25px;scale:-1 1}
#chapter-5 .wishing-cloud{position:absolute;left:-12%;bottom:20px;width:75%;height:auto;opacity:.4;z-index:1;pointer-events:none;animation:wishing-cloud-drift 24s ease-in-out infinite alternate;translate:calc(var(--wish-px)*-.3) calc(var(--wish-py)*-.3)}
#chapter-5 .wishing-cloud.far{left:auto;right:-20%;bottom:190px;width:65%;opacity:.25;scale:-1 1;animation-duration:31s;animation-delay:-12s}
#chapter-5 .wishing-petals,#chapter-5 .wishing-sparks,#chapter-5 .wishing-burst{position:absolute;inset:0;pointer-events:none;overflow:hidden;z-index:10}
#chapter-5 .wishing-petal{position:absolute;top:-25px;left:var(--left);width:var(--size);height:calc(var(--size)*1.4);border-radius:80% 10% 65% 20%;background:linear-gradient(120deg,#ffd3df,#d17da1);opacity:0;animation:wishing-petal-fall var(--duration) linear var(--delay) infinite}
#chapter-5 .wishing-spark{position:absolute;left:var(--left);top:var(--top);width:3px;height:3px;background:#ffeac1;border-radius:50%;box-shadow:0 0 7px #ffc8bb;animation:wishing-spark var(--duration) ease-in-out var(--delay) infinite}
#chapter-5 .wishing-burst i{position:absolute;left:56%;top:49%;width:5px;height:5px;border-radius:50%;background:#ffe7ba;opacity:0}
#chapter-5.wish-celebrate .wishing-burst i{animation:wishing-celebrate 1.6s ease-out var(--delay) both}
#chapter-5.wishing-sleeping :is(.wishing-ambient,.wishing-moon,.wishing-lantern,.wishing-lantern-light,.wishing-star-svg,.wishing-trail-dust,.wishing-heart-dot,.wishing-cloud,.wishing-petal,.wishing-spark){animation-play-state:paused}
@keyframes wishing-ambient{to{opacity:.5}}
@keyframes wishing-moon-float{0%,100%{transform:translateY(0)}50%{transform:translateY(-6px)}}
@keyframes wishing-lantern-sway{from{transform:rotate(-3deg)}to{transform:rotate(3deg)}}
@keyframes wishing-lantern-light{to{opacity:.7;transform:scale(.96,1.03)}}
@keyframes wishing-trail-flow{to{stroke-dashoffset:-190}}
@keyframes wishing-star-pulse{0%,100%{scale:1;opacity:.92}50%{scale:1.04;opacity:1}}
@keyframes wishing-selection-in{from{opacity:0;scale:.7}to{opacity:1;scale:1}}
@keyframes wishing-heart-dust{to{opacity:1;r:3.5}}
@keyframes wishing-card-in{from{opacity:0;translate:0 14px}to{opacity:1;translate:0 0}}
@keyframes wishing-cloud-drift{from{transform:translate(-1%,0)}to{transform:translate(3%,7px)}}
@keyframes wishing-petal-fall{0%{opacity:0;transform:translate(0,-25px) rotate(0)}15%,85%{opacity:.4}100%{opacity:0;transform:translate(60px,1300px) rotate(270deg)}}
@keyframes wishing-spark{0%,100%{opacity:.15;scale:.6}50%{opacity:.8;scale:1.2}}
@keyframes wishing-celebrate{0%{opacity:0;transform:translate(0,0) scale(.5)}20%{opacity:1}100%{opacity:0;transform:translate(var(--dx),var(--dy)) scale(.2)}}
@media(min-width:901px) and (max-width:1150px){#chapter-5 .wishing-moon{width:235px;left:0;top:10px}#chapter-5 .wishing-inscription{font-size:30px}#chapter-5 .wishing-card{width:290px;right:2%;padding:53px 23px 23px}#chapter-5 .wishing-card-text{font-size:21px}#chapter-5 .wishing-card h3{font-size:27px}#chapter-5 .wishing-summary{width:270px;padding:25px 20px}#chapter-5 .wishing-summary button{font-size:18px}#chapter-5:is(.has-wish-card,.wishes-all) .wishing-constellation{left:15%;width:51%}#chapter-5 .star-button{width:78px;height:78px}#chapter-5 .wishing-heart-message{font-size:32px}}
@media(max-width:900px){
  #chapter-5.wish-chapter{padding:27px 0 30px;scroll-margin-top:0}#chapter-5 .chapter-heading{padding-inline:22px}#chapter-5 .chapter-heading .eyebrow{font-size:13px;padding:4px 17px}#chapter-5 .chapter-heading h2{font-size:clamp(34px,6vw,47px);line-height:1.6;margin:14px 0 7px}#chapter-5 .chapter-heading .wishing-subtitle{font-size:18px;line-height:1.8}
  #chapter-5 .wishing-stage{max-width:650px;height:655px}#chapter-5.wishes-all .wishing-stage{height:1030px}#chapter-5 .wishing-moon{width:185px;left:4%;top:9px}#chapter-5 .wishing-inscription{font-size:27px;width:115%}#chapter-5 .wishing-lantern{width:36px;height:105px}#chapter-5 .wishing-lantern.second{width:28px;height:84px}
  #chapter-5 .wishing-constellation,#chapter-5:is(.has-wish-card,.wishes-all) .wishing-constellation{left:0;top:230px;width:100%;height:370px}#chapter-5 .star-button{width:78px;height:78px}#chapter-5 .star-button .wishing-star-number{font-size:25px}#chapter-5 .wishing-heart-message{font-size:32px;top:29%}
  #chapter-5 .wishing-card{position:fixed;top:auto;right:auto;left:50%;bottom:16px;translate:-50% 0;width:min(420px,calc(100% - 28px));max-height:calc(100vh - 165px);max-height:calc(100dvh - 165px);overflow-y:auto;overscroll-behavior:contain;padding:51px 28px 23px;z-index:30;animation:wishing-sheet-in .3s ease both}#chapter-5 .wishing-card h3{font-size:29px}#chapter-5 .wishing-card-text{font-size:22px;min-height:0}#chapter-5 .wishing-card-done{margin-top:15px}
  #chapter-5 .wishing-summary{left:50%;right:auto;top:655px;transform:translateX(-50%);width:min(370px,calc(100% - 36px));padding:25px 26px}#chapter-5 .wishing-summary h3{font-size:26px}#chapter-5 .wishing-summary button{font-size:19px}
  #chapter-5 .wishing-branch{width:37%;top:-6px;left:-20px}#chapter-5 .wishing-branch.right{right:-20px;left:auto}#chapter-5 .wishing-cloud{width:115%;left:-35%;bottom:50px;opacity:.28}#chapter-5 .wishing-cloud.far{width:95%;right:-38%;bottom:310px;opacity:.18}#chapter-5 .wishing-next{font-size:21px;padding:12px 24px}#chapter-5 #wish-count{font-size:16px}
}
@keyframes wishing-sheet-in{from{opacity:0;transform:translateY(25px)}to{opacity:1;transform:translateY(0)}}
@media(max-width:480px){#chapter-5 .wishing-stage{height:595px}#chapter-5.wishes-all .wishing-stage{height:975px}#chapter-5 .wishing-moon{width:155px;left:2%;top:7px}#chapter-5 .wishing-inscription{font-size:24px;width:120%}#chapter-5 .wishing-constellation,#chapter-5:is(.has-wish-card,.wishes-all) .wishing-constellation{top:185px;height:325px}#chapter-5 .star-button{width:72px;height:72px}#chapter-5 .star-button .wishing-star-number{font-size:24px}#chapter-5 .wishing-heart-message{font-size:28px;top:29%}#chapter-5 .wishing-card{padding:51px 25px 22px}#chapter-5 .wishing-card-text{font-size:21px;line-height:1.85}#chapter-5 .wishing-card h3{font-size:27px}#chapter-5 .wishing-summary{top:595px}#chapter-5 .wishing-next{font-size:20px;padding:12px 20px}#chapter-5.is-heart .star-button{width:55px;height:55px}}
@media(max-width:360px){#chapter-5 .chapter-heading h2{font-size:32px}#chapter-5 .chapter-heading .wishing-subtitle{font-size:17px}#chapter-5 .wishing-moon{width:143px}#chapter-5 .wishing-inscription{font-size:23px}#chapter-5 .star-button{width:60px;height:60px}#chapter-5 .star-button .wishing-star-number{font-size:22px}#chapter-5 .wishing-card-text{font-size:20px}#chapter-5 .wishing-card h3{font-size:25px}#chapter-5 .wishing-heart-message{font-size:25px}#chapter-5 .wishing-summary button{font-size:18px}#chapter-5 .wishing-next{font-size:18px}#chapter-5.is-heart .star-button{width:50px;height:50px}}
@media(prefers-reduced-motion:reduce){#chapter-5 *,#chapter-5 *:before,#chapter-5 *:after{animation:none!important;transition:none!important}#chapter-5 .wishing-petals,#chapter-5 .wishing-sparks,#chapter-5 .wishing-burst{display:none}#chapter-5 .wishing-sky,#chapter-5 .wishing-moon,#chapter-5 .wishing-branch,#chapter-5 .wishing-cloud{translate:none;transform:none}}

#chapter-5 #wish-count{padding:5px 15px;border:1px solid #efbdc766;border-radius:24px;background:#492445cc}
@media(max-width:360px){#chapter-5 .wishing-stage{height:545px}#chapter-5.wishes-all .wishing-stage{height:925px}#chapter-5 .wishing-summary{top:545px}#chapter-5 .wishing-moon{width:130px}#chapter-5 .wishing-constellation,#chapter-5:is(.has-wish-card,.wishes-all) .wishing-constellation{top:165px;height:300px}}

#chapter-5.has-wish-card .wishing-stage{z-index:20}
#chapter-5 .wishing-petals,#chapter-5 .wishing-sparks,#chapter-5 .wishing-burst{z-index:2}
