/* =====================================================================
   LUNAR HAZE: THE INSTRUCTION BOOKLET VIEWER (assets/css/booklet.css)  · Nov 17 2026
   Tap the booklet in "Everything inside, laid out", then "📖 Open it":
   it lifts to the middle of the screen and unfolds like the real one.
   Phones: after it unfolds you swipe through the panels one at a time.
   Script: assets/js/booklet.js   Pictures: assets/images/kit-items/booklet/
   ===================================================================== */
.bk{position:fixed;inset:0;z-index:200;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:18px;padding:16px;perspective:1800px;overflow:hidden}
.bk[hidden]{display:none}
.bk-dark{position:absolute;inset:0;background:radial-gradient(ellipse at 50% 45%,rgba(52,28,50,.9),rgba(8,4,10,.97) 70%);opacity:0}
.bk-glow{position:absolute;left:50%;top:44%;width:min(620px,120vw);aspect-ratio:1;transform:translate(-50%,-50%);border-radius:50%;background:radial-gradient(circle,rgba(242,196,90,.16),rgba(242,157,192,.08) 40%,transparent 68%);opacity:0;pointer-events:none}
.bk-stage{position:relative;z-index:1;display:flex;align-items:center;justify-content:center;transform-style:preserve-3d}
.bk-fly{--w:min(300px,30vw,calc(100vh - 220px));width:var(--w);height:var(--w);transform-style:preserve-3d;will-change:transform}
.bk-shift{position:relative;width:100%;height:100%;transform-style:preserve-3d;will-change:transform}
.bk-pn{position:absolute;top:0;width:100%;height:100%;transform-style:preserve-3d;will-change:transform}
.bk-pn-m{left:0}
.bk-pn-l{left:-100%;transform-origin:right center;transform:translateZ(3px) rotateY(180deg)}
.bk-pn-r{left:100%;transform-origin:left center;transform:translateZ(1.5px) rotateY(-180deg)}
.bk-fc{position:absolute;inset:0;backface-visibility:hidden;-webkit-backface-visibility:hidden;background:center/cover no-repeat;overflow:hidden}
.bk-fc.bk-back{transform:rotateY(180deg)}
.bk-fc::after{content:"";position:absolute;inset:0;pointer-events:none}
.bk-pn-l .bk-fc:not(.bk-back)::after{background:linear-gradient(270deg,rgba(90,50,80,.07),transparent 6%)}
.bk-pn-r .bk-fc:not(.bk-back)::after{background:linear-gradient(90deg,rgba(90,50,80,.07),transparent 6%)}
.bk-pn-m .bk-fc:not(.bk-back)::after{background:linear-gradient(90deg,rgba(90,50,80,.05),transparent 4%,transparent 96%,rgba(90,50,80,.05))}
/* (Nov 17 2026) one soft shadow under the whole booklet (it widens as it opens), instead of one per page */
.bk-floor{position:absolute;left:-15%;top:78%;width:130%;height:45%;transform:translateZ(-2px) scaleX(1);background:radial-gradient(closest-side,rgba(0,0,0,.5),rgba(0,0,0,.22) 55%,transparent);pointer-events:none}
/* (a plain soft gradient, not a box-shadow: Safari has to redraw a blurred shadow on every frame, which made it stutter) */
/* folded shut: only the cover shows (the pages under it can't peek out at the edges) */
.bk.is-shut .bk-pn-r, .bk.is-shut .bk-pn-m > .bk-fc:not(.bk-back){visibility:hidden}
.bk-hint{position:relative;z-index:2;margin:0;min-height:19px;color:#e9dcf2;font-size:12.5px;text-align:center;opacity:0;transition:opacity .35s}
.bk-ctrl{position:relative;z-index:2;display:flex;flex-wrap:wrap;justify-content:center;gap:10px;opacity:0;transform:translateY(10px);transition:opacity .35s,transform .35s;pointer-events:none}
.bk.is-ready .bk-hint{opacity:1}
.bk.is-ready .bk-ctrl{opacity:1;transform:none;pointer-events:auto}
.bk-btn{display:inline-flex;align-items:center;gap:7px;height:40px;padding:0 16px;border:3px solid;border-color:#FFFFFF #9F86B8 #9F86B8 #FFFFFF;background:#F8F1FD;color:var(--plum,#5E3F7A);font:700 14px var(--body,monospace);cursor:pointer;text-decoration:none;white-space:nowrap}
.bk-btn:hover{text-decoration:none}
.bk-btn:active{border-color:#9F86B8 #FFFFFF #FFFFFF #9F86B8}
.bk-btn-lime{background:var(--lime,#E1F66B);border-color:#F4FBC8 #9DB02E #9DB02E #F4FBC8;color:var(--ink,#2B2A5E)}
.bk-x{position:absolute;z-index:4;top:14px;right:14px;width:42px;height:42px;padding:0;justify-content:center;background:#F29DC0;border-color:#FFFFFF #D65B8C #D65B8C #FFFFFF;color:#FFFFFF;font-size:18px;opacity:0;transition:opacity .3s}
.bk.is-on .bk-x{opacity:1}
/* the item it came from hides while it's out (so there aren't two) */
.spread-item.bk-out{visibility:hidden}
/* "📖 Open it" in the item pop-up */
.st-body .bk-open{justify-self:start;margin-top:4px;height:36px;font-size:13.5px}
/* Phones: unfold small, then read one panel at a time */
.bk-swipe, .bk-dots{display:none}
.bk-dots{gap:7px;justify-content:center;position:relative;z-index:2}
.bk-dots i{width:8px;height:8px;border-radius:50%;background:rgba(255,255,255,.35)}
.bk-dots i.on{background:var(--lime,#E1F66B)}
@media (max-width:720px){
  .bk{padding-top:64px}
  .bk-fly{--w:min(62vw,260px)}
  .bk.is-read .bk-stage{display:none}
  .bk.is-read .bk-swipe, .bk.is-read .bk-dots{display:flex}
  .bk-swipe{position:relative;z-index:2;width:100vw;margin:0 -16px;gap:12px;overflow-x:auto;scroll-snap-type:x mandatory;padding:0 7vw;scrollbar-width:none}
  .bk-swipe::-webkit-scrollbar{display:none}
  .bk-swipe img{flex:none;width:86vw;max-width:420px;aspect-ratio:1;scroll-snap-align:center;box-shadow:0 14px 34px rgba(0,0,0,.5);animation:bk-pop .4s both}
  .bk-turn{display:none}
}
@keyframes bk-pop{from{opacity:0;transform:scale(.9) rotate(-2deg)}}
/* while it's open: the floating items behind it hold still (keeps Safari smooth) */
html.bk-lock .spread-item, html.bk-lock .spread-item *{animation-play-state:paused!important}
