/* رنگ‌ها، لایه‌ها و کارت‌های قصه روی همان پالت کمپین */
#intro,#story{position:relative;isolation:isolate;background:#06140e;color:#fff;overflow-x:clip;min-height:100vh;min-height:100svh}
.s-top{position:relative;z-index:2;width:min(100%,620px);margin:auto;padding:calc(9px + var(--safe-t)) 14px 8px;display:grid;grid-template-columns:40px minmax(0,1fr) 40px;align-items:center;gap:8px}
.s-top>img{width:40px;height:40px;object-fit:contain;filter:drop-shadow(0 2px 6px #0009)}
.s-top .skip{display:grid;place-items:center;min-height:44px;padding:0 9px;color:var(--gold-l);font-size:12px;font-weight:800}
#storyTitle{min-width:0;font-weight:900;font-size:clamp(12px,3.5vw,20px);line-height:1.5;text-align:center}
.intro-bg{position:absolute;z-index:-2;inset:0;width:100%;height:100%;object-fit:cover;object-position:center 40%;opacity:.56;filter:saturate(.72)}
#intro::before{content:"";position:absolute;z-index:-1;inset:0;background:radial-gradient(ellipse at 50% 48%,#0a261929,transparent 58%),linear-gradient(180deg,#06140ef2 0%,#06140e68 53%,#06140ef5)}
.intro-content{width:min(100%,540px);min-height:calc(100vh - 62px - var(--safe-t));min-height:calc(100svh - 62px - var(--safe-t));margin:auto;padding:clamp(10px,5svh,52px) 18px calc(18px + var(--safe-b));display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;gap:10px}
.intro-content h1{font-size:clamp(37px,10vw,67px);font-weight:900;line-height:1.22;text-shadow:0 4px 22px #06140e}
.intro-content h1 em,.hero-tagline em{font-style:normal;color:var(--gold)}
.hero-tagline{font-size:clamp(20px,6vw,34px);font-weight:850;color:#fff7e6;line-height:1.4;text-shadow:0 2px 10px #00170d}
.hero-wrap{position:relative;width:min(74vw,39vh,330px);width:min(74vw,39svh,330px);aspect-ratio:.9;margin:5px auto;transform-origin:top left}
.story-pom{width:100%;height:100%;display:grid;place-items:center;touch-action:manipulation;border-radius:46%;cursor:pointer}
.story-pom:disabled{cursor:default}
.story-pom img{width:100%;height:100%;object-fit:contain;filter:drop-shadow(0 0 23px #e5485d76) drop-shadow(0 12px 13px #0008);animation:floaty 4.2s ease-in-out infinite}
.hero-wrap.revealed #heroFruit{animation:none;filter:drop-shadow(0 0 20px #f4c14a65)}
.hero-hint{color:var(--gold-l);font-weight:800;font-size:clamp(15px,4.5vw,20px)}
.hero-hint--callout{
  font-size:clamp(23px,6.5vw,34px);font-weight:900;line-height:1.28;
  text-shadow:0 2px 8px var(--night),0 0 18px #f4c14a4d;
}
.hero-guide{display:none}
.demo-note{font-size:11px;color:#e4dfc9}

@media(prefers-reduced-motion:no-preference){
  .hero-guide{display:block;position:absolute;inset:0;width:100%;height:100%;z-index:1;pointer-events:none}
}

.book{width:min(100%,560px);margin:auto;padding:0 12px calc(8px + var(--safe-b))}
.act{overflow:hidden;border-radius:24px;box-shadow:0 12px 32px #0006,inset 0 0 0 1px #f4c14a44;transform-origin:100% 50%}
.act .scene{display:grid;grid-template-rows:auto 1fr auto;position:relative;isolation:isolate;min-height:calc(100vh - 130px - var(--safe-t) - var(--safe-b));min-height:calc(100svh - 130px - var(--safe-t) - var(--safe-b));overflow:hidden;background:#0c2019;padding:12px}
.bgi{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;object-position:center 52%;z-index:-2}
.scene::after{content:"";position:absolute;z-index:-1;inset:0;background:linear-gradient(180deg,#06140e88,transparent 42%,#06140ea0)}
.lyr{position:absolute}
.caption{grid-row:1;z-index:2;background:rgba(248,241,231,.97);color:#2e322d;padding:12px 13px;border-radius:17px;border:1px solid #f4c14a9c;box-shadow:0 5px 18px #0005;text-align:right}
.caption h2{color:var(--green-dd);font-size:clamp(16px,4.45vw,22px);font-weight:900;line-height:1.42;margin-bottom:5px}
.caption p{font-size:clamp(12.5px,3.25vw,15px);line-height:1.75;font-weight:600}
.caption p+p{margin-top:6px}
.scene-art{grid-row:2;position:relative;min-height:210px;overflow:hidden;isolation:isolate}
.scene-art>img{height:auto;max-height:100%;object-fit:contain;filter:drop-shadow(0 9px 10px #0008)}
.scene-art .night-div{width:47%;height:91%;max-width:290px;left:1%;bottom:4%}
.scene-art .story-fruit{width:47%;height:70%;max-width:247px;left:51%;bottom:3%;filter:drop-shadow(0 0 17px #d5324a7f)}
.scene-art .treasure-fruit{width:48%;height:83%;left:51%;bottom:2%;filter:drop-shadow(0 0 15px #f4c14a63)}
.scene-art .character{width:52%;height:96%;bottom:0;object-fit:contain;object-position:bottom}
.scene-art .side{left:0;width:48%;height:92%}
.book-offer{max-width:92%;bottom:4%;left:0;right:0;margin:auto;width:max-content;padding:5px 14px;border-radius:99px;background:var(--gold);color:#472600;font-weight:900;font-size:13px}
.scene-art .foe{width:42%;height:100%;right:-1%;bottom:1%;object-position:bottom right}
.scene-art .ally{left:-1%;width:43%;height:100%;bottom:0;object-position:bottom left}
/* Match the cover crop and object-position of the hall artwork. */
.finale .scene{--finale-crop-y:52%}
.finale .bgi{object-position:50% var(--finale-crop-y)}
.finale-stage{position:absolute;inset:0;container-type:size;z-index:1;pointer-events:none}
.finale-projection{position:absolute;top:var(--finale-crop-y);left:50%;translate:-50% calc(0% - var(--finale-crop-y));width:max(100%,calc(100cqh * 941 / 1672));aspect-ratio:941/1672}
.finale-fruit{top:69.2%;left:50.4%;width:min(29%,29cqw,22cqh);translate:-50% -94.8%;transform-origin:50% 94.8%;filter:drop-shadow(0 4px 7px #2a120d9c)}
.act-progress{grid-row:3;z-index:2;justify-self:end;display:flex;align-items:center;gap:5px;padding:5px 7px;margin-top:3px;background:#0a2018a6;border-radius:20px}
.act-dot{width:6px;height:6px;border:1px solid #ffe9a887;border-radius:50%}
.act-dot.current{background:var(--gold);border-color:var(--gold);box-shadow:0 0 6px #f4c14a88}
.act.night .scene{grid-template-rows:auto auto 1fr auto}
.act.night .scene-art{grid-row:3}
.act.night .act-progress{grid-row:4}
.turn-hint{grid-row:2;justify-self:start;margin-top:4px;padding-inline:5px;color:var(--gold-l);font-size:12px;font-weight:850;line-height:1.55;text-shadow:0 2px 4px #06140e}
.book-nav{direction:rtl;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));align-items:center;gap:7px;margin:10px auto 0;text-align:center}
.book-nav .btn{min-height:44px;padding:0 5px;font-size:clamp(11px,3.35vw,15px)}
.book-nav .btn .ico{width:16px;height:16px}
.skip-story{min-height:44px;font-size:clamp(11px,3.35vw,14px);font-weight:750;color:#eaddc0;text-decoration:underline;text-underline-offset:4px}
@media(prefers-reduced-motion:reduce){
  .story-pom img,.hero-wrap.revealed .story-pom img{animation:none}
}

.scene-art{container-type:size}
.mitra-with-mark{width:100%;height:100%;object-fit:contain;filter:drop-shadow(0 9px 10px #0008)}

body.sheet-open #intro:has(.revealed) .intro-content{justify-content:flex-start;padding-top:0;gap:0}
body.sheet-open #intro:has(.revealed) :is(h1,.hero-tagline,.hero-hint,.demo-note){visibility:hidden;position:absolute}
body.sheet-open #intro:has(.revealed) .hero-wrap{width:min(55vw,24svh,230px);margin:0 auto}

.act .scene{padding-top:31px}
.caption{position:relative;overflow:visible;padding-top:19px}
.caption-voices{position:absolute;z-index:3;top:-24px;left:13px;display:flex;gap:4px;align-items:center}
.voice{width:46px;height:46px;display:grid;place-items:center;padding:2px;background:#c98418;border-radius:50%;box-shadow:0 5px 13px #0007;transition:translate .2s,opacity .2s}
.voice img{width:100%;height:100%;object-fit:cover;border-radius:inherit;border:1px solid #ffe9a8}
.voice[aria-pressed="false"]{opacity:.82;translate:0 2px;background:#79644a}
.voice[aria-pressed="true"],.voice.solo{translate:0 -2px;background:var(--gold)}
.caption h2{min-height:1.42em}
.caption p.speaking{color:var(--green-dd);box-shadow:2px 0 var(--gold-d)}
@media(max-width:355px){
  .caption-voices{left:7px}
  .voice{width:39px;height:39px}
}

/* شکافتن انار؛ هر دو نیمه از همان تصویر بسته ساخته می‌شوند. */
.story-pom :is(.hero-shell,.hero-prize){position:absolute;inset:0;display:none;animation:none;pointer-events:none}
.hero-wrap.cracking #heroFruit{visibility:hidden;animation:none}
.hero-wrap.cracking .hero-shell,.hero-wrap.cracking .hero-prize{display:block}
.hero-wrap.cracking .shell-left{clip-path:polygon(0 0,50% 0,43% 24%,54% 44%,41% 63%,52% 83%,48% 100%,0 100%);animation:shell-split-left .65s var(--ease) both}
.hero-wrap.cracking .shell-right{clip-path:polygon(50% 0,100% 0,100% 100%,48% 100%,52% 83%,41% 63%,54% 44%,43% 24%);animation:shell-split-right .65s var(--ease) both}
.hero-wrap.cracking .hero-prize{animation:prize-rise .65s var(--ease) both}
.hero-wrap::after{content:"";position:absolute;z-index:-1;inset:-15%;border-radius:50%;pointer-events:none;opacity:0;background:radial-gradient(circle,#fff2bf 0%,#eb9f48a9 30%,transparent 69%)}
.hero-wrap.cracking::after{animation:crack-flare .65s ease-out}
@keyframes shell-split-left{0%{transform:none}16%{transform:scale(1.045) rotate(-3deg)}28%{opacity:1}100%{transform:translate(-43%,12%) rotate(-31deg) scale(.88);opacity:0}}
@keyframes shell-split-right{0%{transform:none}16%{transform:scale(1.045) rotate(-3deg)}28%{opacity:1}100%{transform:translate(43%,12%) rotate(31deg) scale(.88);opacity:0}}
@keyframes prize-rise{0%,15%{transform:scale(.61) translateY(12%);opacity:0}65%{transform:scale(1.06);opacity:1}100%{transform:none;opacity:1}}
@keyframes crack-flare{25%{opacity:.78;scale:.81}100%{opacity:0;scale:1.2}}

/* موشن‌های محیطی تنها روی پردهٔ قابل مشاهده اجرا می‌شوند. */
.caption h2,.caption p{text-align:start}
.caption .story-emphasis{color:var(--red);font-weight:900}
.mitra-badge-pose{height:min(98%,96cqw);aspect-ratio:3/4;left:50%;translate:-50% 0;bottom:1%}
.mitra-badge-pose .book-badge{position:absolute;width:19%;max-width:68px;aspect-ratio:1;top:9%;display:grid;place-items:center}
.mitra-badge-pose .subscription{left:74%;top:8%;width:22%;border:1px solid #f4d784bd;border-radius:50%;background:radial-gradient(circle at 30% 20%,#c2fbe14d,#204e3bdf 54%,#102d24);box-shadow:0 0 0 3px #f4c14a2b,0 3px 17px #6bdb96a6,inset 0 0 10px #a3ebaf63}
.mitra-badge-pose .subscription img{width:76%;object-fit:contain;filter:drop-shadow(0 2px 4px #09291c) brightness(1.17)}
.mitra-badge-pose .friends{left:5%;filter:drop-shadow(0 0 12px #f4c14a89)}
.mitra-badge-pose .friends img{width:100%;height:100%;object-fit:contain}
.pact .book-offer{bottom:2%;max-width:92%;padding:4px 12px;border:1px solid #f4c14a9e;background:linear-gradient(var(--red-l),var(--red));color:var(--cream);font-size:clamp(12px,3.55vw,15px);box-shadow:0 3px 0 var(--red-d),0 4px 12px #21091170;text-align:center}
.scene-art .keeper{left:0;height:98%;width:53%;max-width:300px;object-position:bottom left}
.seed-trail{inset:0;pointer-events:none;z-index:1}
.seed-trail i{left:var(--trail-x);top:var(--trail-y);--s:9px;box-shadow:0 0 8px #e5485d}
.book-loot{z-index:2;right:1.5%;bottom:8%;width:43%;display:grid;gap:8px;justify-items:stretch;text-align:start}
.story-ticket{position:relative;min-width:0;display:grid;gap:1px;padding:5px 9px;border-radius:11px;border:1px solid #f5d28c;background:linear-gradient(122deg,#fff5d8,#f7d997);box-shadow:0 4px 0 color-mix(in srgb,var(--ticket-color) 61%,#3b2114),0 8px 16px #20120792;color:#42250f;border-inline-start:4px solid var(--ticket-color)}
.story-ticket>span{display:flex;align-items:center;gap:4px;font-size:9px;font-weight:750;color:#674c24}
.story-ticket strong{font-size:clamp(11px,3.1vw,15px);line-height:1.45}
.story-ticket small{width:auto;font-size:10px;font-weight:750;color:#5b3f21}
@media(prefers-reduced-motion:no-preference){
  .act:not([hidden]).night .night-div{animation:shadow-drift 4.6s ease-in-out infinite}
  .act:not([hidden]) :is(.treasure-fruit,.book-badge){animation:scene-float 4.4s ease-in-out infinite}
  .act:not([hidden]) .book-badge.friends{animation-delay:-1.7s}
  .act:not([hidden]) .keeper{animation:keeper-breathe 5s ease-in-out infinite}
  .act:not([hidden]) .seed-trail i{animation:seed-glint 3s var(--delay) ease-in-out infinite}
  .act:not([hidden]) .story-ticket{animation:ticket-float 4s ease-in-out infinite}
  .act:not([hidden]) .story-ticket:nth-child(2){animation-delay:-1.2s}
}
@keyframes shadow-drift{50%{translate:4px -6px;filter:drop-shadow(0 0 16px #ac69eea6) brightness(1.13)}}
@keyframes scene-float{50%{translate:0 -7px}}
@keyframes keeper-breathe{50%{scale:1.018}}
@keyframes seed-glint{0%,100%{opacity:.26;translate:-5px 10px;scale:.68}48%{opacity:1;translate:7px -7px;scale:1.27}}
@keyframes ticket-float{50%{translate:0 -4px;rotate:-1.5deg}}
@media(max-height:660px){
  .scene-art{min-height:157px}
  .book-nav{margin-top:6px}
  .caption p{line-height:1.56}
}

@media(max-height:625px){
  .finale .scene{--finale-crop-y:8%}
  .finale-fruit{width:min(27%,27cqw,21cqh)}
}

@media(max-width:370px){
  .caption p{font-size:12.5px;line-height:1.62}
  .caption p+p{margin-top:4px}
  .book-nav{gap:5px}
}

/* New Yalda invitation and finale art, scoped to the product scenes. */
.pact .invite-glow .ico{width:62%;height:62%;color:#ffdd89;filter:drop-shadow(0 0 9px #fac66188)}
.invite-finale .scene{--finale-crop-y:65%}
.invite-finale .finale-projection{width:max(100%,calc(100cqh * 2 / 3));aspect-ratio:2/3}
.invite-finale .finale-fruit{top:70.5%;left:50%;width:min(36%,34cqw,27cqh)}
.invite-finale .character.ally{left:6%;bottom:1%;height:min(66%,67cqw)}
.invite-finale .invite-finale-offer{z-index:2;bottom:2%;padding:4px 10px;font-size:clamp(11px,3.2vw,15px);color:#fff2c9;background:#a92038;border:1px solid #ffda7799}

.eclipse-opening .scene{--eclipse-crop-y:60%}
.eclipse-opening .bgi{object-position:50% var(--eclipse-crop-y)}
.eclipse-opening .scene-art .night-div{left:0;width:49%;height:94%;bottom:2%}
.eclipse-stage{position:absolute;inset:0;container-type:size;z-index:1;pointer-events:none}
.eclipse-projection{position:absolute;top:var(--eclipse-crop-y);left:50%;translate:-50% calc(0% - var(--eclipse-crop-y));width:max(100%,calc(100cqh * 2 / 3));aspect-ratio:2/3}
.eclipse-fruit{top:75%;left:75%;width:min(31%,31cqw,22cqh);translate:-50% -94%;transform-origin:50% 94%;filter:drop-shadow(0 0 14px #e1414678)}
@media(prefers-reduced-motion:no-preference){
  .eclipse-fruit{animation:eclipse-fruit-hover 5.8s ease-in-out infinite}
}
@keyframes eclipse-fruit-hover{0%,100%{translate:-50% -94%}50%{translate:-50% calc(-94% - 6px)}}
