/* Chapter 03 only. All foreground art, copy and interactions are independent. */
#chapter-3.royal-chapter{position:relative;isolation:isolate;margin-block:30px;padding:36px 18px 32px;border:1px solid #d8a7a0;border-radius:26px;overflow:clip;background:#f0c8d0;color:#64253e;box-shadow:0 18px 60px #99445c18;animation:none;scroll-margin-top:135px}
#chapter-3 .royal-room{position:absolute;inset:0;z-index:-4;pointer-events:none}
#chapter-3 .royal-room img{width:100%;height:100%;object-fit:cover;object-position:65% center;opacity:.84;display:block}
#chapter-3:before{content:'';position:absolute;inset:0;z-index:-3;pointer-events:none;background:linear-gradient(180deg,#ffede3d9 0,#fce4deb0 17%,#f4cbd534 49%,#f3b4c766 100%)}
#chapter-3 .royal-ambient{position:absolute;inset:-10%;z-index:-2;pointer-events:none;background:radial-gradient(ellipse at 48% 22%,#fff7d588,transparent 52%);animation:royal-light 9s ease-in-out infinite alternate}
#chapter-3 .chapter-heading{position:relative;z-index:6;padding-inline:12px}
#chapter-3 .chapter-heading .eyebrow{display:inline-flex;justify-content:center;gap:0;padding:5px 21px;font-size:15px;font-weight:600;color:#892c50;background:#fff6ebee;border:1px solid #dbab96;border-radius:30px;box-shadow:0 4px 12px #91415a19}
#chapter-3 .chapter-heading h2{font-family:'Noto Naskh Arabic',Georgia,serif;max-width:900px;margin:16px auto 3px;font-size:clamp(38px,4.6vw,59px);line-height:1.55;color:#842847;letter-spacing:0;text-shadow:0 2px #fff4e9,0 3px 18px #fff4e3}
#chapter-3 .royal-composition{display:grid;grid-template-columns:minmax(0,.94fr) minmax(0,1.06fr);gap:8px;direction:ltr;align-items:center;position:relative;z-index:3;max-width:1230px;margin:0 auto}
#chapter-3 .royal-court{position:relative;height:620px;min-width:0;direction:ltr;isolation:isolate}
#chapter-3 .royal-court:before{content:'';position:absolute;inset:5% -10% 0;background:radial-gradient(ellipse at 45% 47%,#ffe0ad77,transparent 65%);filter:blur(9px);z-index:-1;animation:royal-throne-glow 5s ease-in-out infinite alternate}
#chapter-3 .royal-throne{position:absolute;left:-5%;top:-10px;width:100%;height:auto;display:block;pointer-events:none;user-select:none;filter:drop-shadow(0 13px 14px #71304c44)}
#chapter-3 .royal-banner{position:absolute;left:30%;top:147px;width:34%;max-width:185px;min-height:180px;padding:18px 9px 29px;background:linear-gradient(110deg,#8d1c46,#b04265 42%,#771c40);color:#fff0bf;border:2px solid #e4b16c;clip-path:polygon(0 0,100% 0,100% 82%,50% 100%,0 82%);text-align:center;transform-origin:50% 0;filter:drop-shadow(0 5px 6px #59223844);animation:royal-banner-sway 7s ease-in-out infinite alternate;pointer-events:none;z-index:2}
#chapter-3 .royal-banner:before{content:'';position:absolute;inset:5px;border:1px dashed #efc38299;clip-path:polygon(0 0,100% 0,100% 80%,50% 100%,0 80%);pointer-events:none}
#chapter-3 .royal-banner svg{width:40px;height:31px;display:block;margin:0 auto 4px;fill:#f2ca7c}
#chapter-3 .royal-banner p{font-family:'Italiana',Georgia,serif;font-size:33px;line-height:1.15;direction:ltr;letter-spacing:.2px;text-shadow:0 2px #5b143266}
#chapter-3 .royal-banner p span{display:block;font-size:36px;margin-top:4px}
#chapter-3 .royal-dragon{position:absolute;left:40%;bottom:0;width:65%;max-width:350px;z-index:5;overflow:visible;filter:drop-shadow(0 12px 10px #682a4a33);pointer-events:none}
#chapter-3 .royal-dragon svg{display:block;width:100%;height:auto;overflow:visible}
#chapter-3 .royal-dragon-breath{transform-box:view-box;transform-origin:48% 68%;animation:royal-breathe 4.4s ease-in-out infinite}
#chapter-3 .royal-dragon-head{transform-origin:705px 620px;animation:royal-head 8s ease-in-out infinite}
#chapter-3 .royal-dragon-tail{transform-origin:195px 1010px;animation:royal-tail 6s ease-in-out infinite}
#chapter-3 .royal-eye-lids{opacity:0;animation:royal-blink 7.4s linear -2.5s infinite}
#chapter-3 .royal-dragon-puff{opacity:0;transform-origin:1030px 510px}
#chapter-3.is-reacting .royal-dragon-head{animation:royal-head-react 1.1s ease-in-out both}
#chapter-3.is-reacting .royal-dragon-tail{animation:royal-tail-react .4s ease-in-out 3 alternate}
#chapter-3.is-reacting .royal-eye-lids{animation:royal-reaction-blink 1.1s linear both}
#chapter-3.is-reacting .royal-dragon-puff{animation:royal-puff 1.1s ease-out .15s both}
#chapter-3 .royal-reading{min-width:0;direction:rtl;position:relative;padding:14px 3px 0 8px;align-self:center;z-index:6}
#chapter-3 .royal-scroll{position:relative;isolation:isolate;padding:66px 60px 67px;text-align:center;min-height:425px;display:flex;flex-direction:column;justify-content:center;filter:drop-shadow(0 12px 12px #6d354c33);transform:rotate(-1deg);transition:filter .4s}
#chapter-3 .royal-scroll-paper{position:absolute;inset:0;z-index:-1;pointer-events:none;user-select:none}
#chapter-3 .royal-scroll-paper{border:65px solid transparent;border-image-source:url(../assets/royal/scroll.webp);border-image-slice:100 70 105 70 fill;border-image-width:65px 44px;border-image-repeat:stretch}
#chapter-3 .royal-scroll h3{font-family:'Noto Naskh Arabic',Georgia,serif;font-size:32px;font-weight:600;line-height:1.65;margin:0 0 16px;color:#78213f}
#chapter-3 .royal-scroll-message{font-family:'Tajawal',Arial,sans-serif;font-size:23px;font-weight:500;line-height:1.85;color:#57303b}
#chapter-3 .royal-divider{display:flex;align-items:center;justify-content:center;gap:10px;color:#a64668;font-size:24px;margin:13px 0 8px}
#chapter-3 .royal-divider:before,#chapter-3 .royal-divider:after{content:'';width:27%;height:1px;background:linear-gradient(90deg,transparent,#ba6b82,transparent)}
#chapter-3 .royal-joke{position:relative;font-family:'Tajawal',Arial,sans-serif;font-size:25px;font-weight:600;line-height:1.7;color:#822448;padding:6px 8px;isolation:isolate}
#chapter-3 .royal-joke:before{content:'';position:absolute;inset:4px -10px 1px;z-index:-1;background:linear-gradient(90deg,#f6b7ca00,#ed9fb780 14%,#f3b7c995 85%,#f6b7ca00);border-radius:35% 6% 17% 5%;transform:rotate(-1deg)}
#chapter-3 .royal-wax{position:absolute;right:8%;top:22px;width:65px;height:91px;pointer-events:none;transform:rotate(13deg);filter:drop-shadow(0 3px 2px #7c294e33)}
#chapter-3 .royal-wax svg{width:100%;height:100%;overflow:visible}
#chapter-3 .royal-stamp{position:absolute;left:8%;bottom:17px;width:103px;height:89px;opacity:0;transform:scale(1.7) rotate(-21deg);pointer-events:none;color:#9e2856;z-index:5}
#chapter-3 .royal-stamp svg{width:100%;height:100%;overflow:visible}
#chapter-3.is-stamped .royal-stamp{opacity:.88;transform:scale(1) rotate(-14deg);transition:transform .27s cubic-bezier(.2,.9,.3,1.3),opacity .1s}
#chapter-3.is-requesting .royal-scroll{filter:drop-shadow(0 0 18px #ffe7a8) drop-shadow(0 8px 15px #9d4d6c55)}
#chapter-3.is-approved .royal-scroll{filter:drop-shadow(0 8px 14px #86445944) drop-shadow(0 0 5px #ffebc977)}
#chapter-3 .royal-progress{position:relative;width:90%;margin:13px auto 0;padding:13px 22px 17px;background:linear-gradient(145deg,#fff8e9,#fce2df);border:2px solid #dfb17c;border-radius:24px;box-shadow:0 0 0 3px #fff4d044,0 5px 14px #aa567333;text-align:center;direction:rtl}
#chapter-3 .royal-progress p{font-size:19px;font-weight:600;color:#82294a;line-height:1.7;margin-bottom:8px}
#chapter-3 .royal-progress-track{display:grid;grid-template-columns:repeat(10,minmax(0,1fr));gap:3px;height:19px;direction:ltr;border:1px solid #dc8da5;border-radius:15px;background:#edbec7;overflow:hidden;padding:2px;box-shadow:inset 0 1px 4px #ae5a7133}
#chapter-3 .royal-progress-track i{display:block;border-radius:3px;background:#f7d0d5}
#chapter-3 .royal-progress-track i.is-watched{background:linear-gradient(#e793b4,#b33968);box-shadow:inset 0 1px #ffd9e5,0 0 5px #ed8caf}
#chapter-3 .royal-progress-track i:first-child{border-radius:12px 3px 3px 12px}
#chapter-3 .royal-actions{position:relative;z-index:9;display:flex;flex-direction:column;align-items:center;gap:14px;padding:10px 16px 0;direction:rtl;text-align:center}
#chapter-3 .royal-button{min-height:60px;max-width:100%;padding:12px 32px;border:1px solid #ffe9ad;border-radius:40px;background:linear-gradient(#b84174,#8c1f50);color:#fff9ee;font-family:'Tajawal',Arial,sans-serif;font-size:22px;font-weight:600;line-height:1.65;box-shadow:0 0 0 3px #dca77d88,0 0 0 6px #fff3d177,0 8px 20px #8e325855;transition:transform .2s,background .2s,box-shadow .2s}
#chapter-3 .royal-button:hover{background:linear-gradient(#aa3569,#74123d);transform:translateY(-2px);box-shadow:0 0 0 3px #dca77d,0 0 0 6px #fff3d199,0 9px 25px #8e325866}
#chapter-3 .royal-button:focus-visible{outline:3px solid #742448;outline-offset:8px}
#chapter-3 .royal-button:disabled{cursor:wait;opacity:.85;transform:none}
#chapter-3 .royal-response{font-family:'Tajawal',Arial,sans-serif;font-size:23px;font-weight:500;line-height:1.8;color:#6b2343;max-width:760px;padding:19px 30px;background:linear-gradient(145deg,#fff7eaf5,#fce4dff5);border:1px solid #c69771;border-radius:20px;box-shadow:0 5px 20px #9d50652b;animation:royal-response-in .4s ease both}
#chapter-3 .royal-continue{background:linear-gradient(#9c3765,#78214a);font-size:20px;min-height:56px}
#chapter-3 .royal-roses{position:absolute;width:19%;height:auto;bottom:20px;left:-6%;z-index:4;pointer-events:none;user-select:none;filter:drop-shadow(0 10px 10px #6a24443b)}
#chapter-3 .royal-roses-right{left:auto;right:-9%;width:17%;bottom:40px;transform:rotate(-15deg)}
#chapter-3 .royal-candelabra{position:absolute;right:-4%;bottom:160px;width:15%;height:230px;z-index:2;pointer-events:none;filter:drop-shadow(0 5px 4px #73334344)}
#chapter-3 .royal-candelabra svg{position:absolute;inset:0;width:100%;height:100%;overflow:visible}
#chapter-3 .royal-flame{transform-box:fill-box;transform-origin:50% 100%;animation:royal-flame 1.7s ease-in-out infinite alternate}
#chapter-3 .royal-flame:nth-of-type(even){animation-delay:-.7s}
#chapter-3 .royal-petals,#chapter-3 .royal-sparkles{position:absolute;inset:0;pointer-events:none;overflow:hidden;z-index:7}
#chapter-3 .royal-petal{position:absolute;top:-30px;left:var(--left);width:var(--size);height:calc(var(--size)*1.4);border-radius:80% 12% 60% 20%;background:linear-gradient(120deg,#ffc5d6,#c55f8c);opacity:0;animation:royal-petal var(--duration) linear var(--delay) infinite}
#chapter-3 .royal-spark{position:absolute;left:var(--left);top:var(--top);width:4px;height:4px;border-radius:50%;background:#fff2be;box-shadow:0 0 8px #ffe3a3;animation:royal-spark var(--duration) ease-in-out var(--delay) infinite}
#chapter-3.royal-sleeping :is(.royal-ambient,.royal-court:before,.royal-banner,.royal-dragon-breath,.royal-dragon-head,.royal-dragon-tail,.royal-eye-lids,.royal-flame,.royal-petal,.royal-spark){animation-play-state:paused}
@keyframes royal-light{to{transform:translate(3%,2%) scale(1.05);opacity:.6}}
@keyframes royal-throne-glow{to{opacity:.55;transform:scale(1.025)}}
@keyframes royal-banner-sway{from{transform:rotate(-1.1deg)}to{transform:rotate(1.1deg)}}
@keyframes royal-breathe{0%,100%{transform:scale(1,1)}50%{transform:scale(1.007,1.013)}}
@keyframes royal-head{0%,100%{transform:rotate(0)}40%,60%{transform:rotate(-1deg)}}
@keyframes royal-tail{0%,100%{transform:rotate(-1deg)}50%{transform:rotate(1.5deg)}}
@keyframes royal-blink{0%,90%,95%,100%{opacity:0}91%,94%{opacity:1}}
@keyframes royal-head-react{0%,100%{transform:rotate(0)}30%{transform:translateY(-9px) rotate(-4deg)}65%{transform:rotate(2deg)}}
@keyframes royal-tail-react{from{transform:rotate(-2deg)}to{transform:rotate(4deg)}}
@keyframes royal-reaction-blink{0%,20%,45%,100%{opacity:0}25%,40%{opacity:1}}
@keyframes royal-puff{0%{opacity:0;transform:translate(0,0) scale(.5)}20%{opacity:.8}100%{opacity:0;transform:translate(90px,-85px) scale(1.5)}}
@keyframes royal-flame{from{transform:rotate(-4deg) scale(.95,1)}to{transform:rotate(5deg) scale(1.04,.93)}}
@keyframes royal-petal{0%{opacity:0;transform:translate(0,-30px) rotate(0)}12%,85%{opacity:.45}100%{opacity:0;transform:translate(70px,1100px) rotate(280deg)}}
@keyframes royal-spark{0%,100%{opacity:.2;scale:.7}50%{opacity:.85;scale:1.2}}
@keyframes royal-response-in{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:none}}
@media(min-width:901px) and (max-width:1150px){#chapter-3 .royal-court{height:540px}#chapter-3 .royal-throne{top:40px}#chapter-3 .royal-banner{top:162px;min-height:150px;padding-top:12px}#chapter-3 .royal-banner p{font-size:27px}#chapter-3 .royal-banner p span{font-size:29px}#chapter-3 .royal-banner svg{width:32px;height:26px}#chapter-3 .royal-scroll{padding:60px 40px;min-height:440px}#chapter-3 .royal-scroll h3{font-size:28px}#chapter-3 .royal-scroll-message{font-size:21px}#chapter-3 .royal-joke{font-size:22px}#chapter-3 .royal-wax{width:53px;height:75px;top:15px}#chapter-3 .royal-progress p{font-size:17px}}
@media(max-width:900px){
  #chapter-3.royal-chapter{margin-block:24px;padding:26px 10px 28px;border-radius:20px;scroll-margin-top:110px}
  #chapter-3 .royal-room img{object-position:70% center;opacity:.72}#chapter-3:before{background:linear-gradient(#ffeadfda,#f6d7df55 35%,#eebdcc70 70%,#f5d1d6cc)}
  #chapter-3 .chapter-heading{padding:0 8px}#chapter-3 .chapter-heading .eyebrow{font-size:13px;padding:4px 14px}#chapter-3 .chapter-heading h2{font-size:clamp(32px,5.8vw,46px);line-height:1.6;margin:12px auto 0;max-width:560px}
  #chapter-3 .royal-composition{display:flex;flex-direction:column;gap:0;max-width:600px;margin:auto}
  #chapter-3 .royal-court{width:100%;max-width:500px;height:420px;margin:5px auto -5px}
  #chapter-3 .royal-throne{width:82%;max-width:370px;left:0;top:0}
  #chapter-3 .royal-banner{left:26%;top:121px;width:29%;min-height:147px;max-width:143px;padding:12px 7px 23px}#chapter-3 .royal-banner svg{width:31px;height:26px}#chapter-3 .royal-banner p{font-size:26px}#chapter-3 .royal-banner p span{font-size:29px}
  #chapter-3 .royal-dragon{width:61%;max-width:290px;left:auto;right:-1%;bottom:0}
  #chapter-3 .royal-reading{width:100%;padding:0;max-width:550px}
  #chapter-3 .royal-scroll{padding:65px 44px 62px;min-height:0;transform:rotate(-.5deg)}#chapter-3 .royal-scroll h3{font-size:30px;line-height:1.6;margin-bottom:13px}#chapter-3 .royal-scroll-message{font-size:22px;line-height:1.85}#chapter-3 .royal-joke{font-size:23px;line-height:1.75;padding:6px 0}#chapter-3 .royal-divider{margin:10px 0 7px}
  #chapter-3 .royal-wax{width:48px;height:67px;right:8%;top:9px}#chapter-3 .royal-stamp{width:84px;height:69px;left:8%;bottom:8px}
  #chapter-3 .royal-progress{width:92%;margin:12px auto 0;padding:12px 15px 15px;border-radius:22px}#chapter-3 .royal-progress p{font-size:18px}
  #chapter-3 .royal-actions{padding:28px 8px 0;gap:17px}#chapter-3 .royal-button{font-size:20px;min-height:58px;padding:12px 23px}#chapter-3 .royal-response{font-size:21px;padding:16px 20px}#chapter-3 .royal-continue{font-size:19px}
  #chapter-3 .royal-roses{width:27%;bottom:200px;left:-14%;opacity:.8}#chapter-3 .royal-roses-right{left:auto;right:-15%;bottom:110px}#chapter-3 .royal-candelabra{right:-12%;bottom:210px;width:25%;height:170px;opacity:.85}
}
@media(max-width:480px){#chapter-3 .royal-court{height:355px;max-width:355px;margin-top:8px}#chapter-3 .royal-throne{width:85%;top:0;left:-2%}#chapter-3 .royal-banner{left:25%;top:95px;min-height:127px;width:31%;padding:9px 5px 24px}#chapter-3 .royal-banner p{font-size:23px}#chapter-3 .royal-banner p span{font-size:25px}#chapter-3 .royal-banner svg{height:23px;width:27px}#chapter-3 .royal-dragon{width:64%;right:-1%;bottom:1px}#chapter-3 .royal-scroll{padding:64px 32px 62px}#chapter-3 .royal-scroll h3{font-size:27px}#chapter-3 .royal-scroll-message{font-size:20px}#chapter-3 .royal-joke{font-size:21px}#chapter-3 .royal-button{font-size:19px;padding:12px 18px}#chapter-3 .royal-progress p{font-size:16px}#chapter-3 .royal-response{font-size:20px;padding:15px}#chapter-3 .royal-progress-track{gap:2px}}
@media(max-width:360px){#chapter-3 .royal-court{height:312px}#chapter-3 .royal-banner{top:84px;min-height:116px;padding-top:7px}#chapter-3 .royal-banner p{font-size:20px}#chapter-3 .royal-banner p span{font-size:22px}#chapter-3 .royal-banner svg{height:21px}#chapter-3 .royal-scroll{padding:60px 27px 58px}#chapter-3 .royal-scroll h3{font-size:25px}#chapter-3 .royal-scroll-message{font-size:19px}#chapter-3 .royal-joke{font-size:20px}#chapter-3 .royal-button{font-size:18px;padding:12px 15px}#chapter-3 .royal-continue{font-size:18px}}
@media(prefers-reduced-motion:reduce){#chapter-3 *,#chapter-3 *:before,#chapter-3 *:after,#chapter-3:before{animation:none!important;transition:none!important}#chapter-3 .royal-petals,#chapter-3 .royal-sparkles{display:none}#chapter-3 .royal-eye-lids,#chapter-3 .royal-dragon-puff{opacity:0}}

#chapter-3.royal-sleeping .royal-court:before{animation-play-state:paused}

#chapter-3 .royal-stamp{width:70px;height:58px;bottom:6px}
#chapter-3 .royal-candelabra{right:0;top:18px;bottom:auto;width:10%;height:180px}
@media(max-width:900px){#chapter-3 .royal-stamp{width:64px;height:53px;bottom:5px}#chapter-3 .royal-wax{width:42px;height:58px;top:5px}#chapter-3 .royal-candelabra{top:235px;right:0;width:18%;height:150px}}

@media(max-width:480px){#chapter-3 .royal-banner{width:37%}#chapter-3 .royal-banner p span{font-size:24px}}
@media(max-width:360px){#chapter-3 .royal-banner{width:40%;left:24%}#chapter-3 .royal-banner p span{font-size:20px}}

@media(max-width:900px){#chapter-3 .royal-scroll-paper{border-image-source:url(../assets/royal/scroll-small.webp);border-image-slice:60 42 63 42 fill;border-image-width:60px 32px}}
