
/* Freya v3: book theater in welcome tile */
.magic-path.book-stage-tile{cursor:default;display:flex;flex-direction:column;justify-content:flex-end;overflow:hidden;min-height:470px;isolation:isolate}
.book-stage-tile .path-image{position:absolute;inset:0;background-position:center;background-size:cover;opacity:.53;pointer-events:none}
.book-stage-tile .path-sheen{pointer-events:none}
.freya-bookshelf{position:relative;z-index:2;margin:10px auto 0;width:min(100%,380px);padding:5px 8px 3px;text-align:center}
.freya-bookshelf::before{content:'';position:absolute;width:95%;height:57%;left:2.5%;top:5%;border-radius:50%;background:radial-gradient(ellipse,rgba(226,173,88,.23),transparent 68%);filter:blur(12px);pointer-events:none}
.freya-bookshelf .book-group{height:138px;position:relative;display:flex;align-items:flex-end;justify-content:center;gap:clamp(4px,1vw,12px);margin-bottom:4px}
.freya-bookshelf .book-mini{height:115px;width:auto;max-width:23%;object-fit:contain;box-shadow:4px 7px 9px rgba(0,0,0,.47);border-radius:2px;transform:translateY(0);transition:transform .6s ease,filter .6s ease;filter:brightness(.83);background:#091529}
.freya-bookshelf .book-mini.active{height:135px;filter:brightness(1.1) drop-shadow(0 0 8px rgba(244,204,121,.45));transform:translateY(-5px)}
.freya-bookshelf .book-title{min-height:39px;line-height:1.3;font-size:clamp(.8rem,1.5vw,.96rem);color:#f9e1a6;font-weight:600;text-shadow:0 2px 5px #050c16}
.freya-bookshelf .book-tools{display:flex;align-items:center;justify-content:center;gap:12px;margin:6px auto}
.freya-bookshelf button{color:#f8e3b1;background:rgba(5,19,38,.88);border:1px solid rgba(237,197,123,.7);border-radius:50%;width:34px;height:34px;cursor:pointer;font-size:16px;display:grid;place-items:center}
.freya-bookshelf button:hover,.freya-bookshelf button:focus-visible{background:#3e3650;box-shadow:0 0 12px rgba(242,196,113,.4);outline-offset:3px}
.freya-bookshelf .book-counter{font-size:.75rem;color:#ecce94;min-width:35px;font-variant-numeric:tabular-nums}
.book-stage-tile .path-info{position:relative;z-index:2;margin-top:0;padding-top:4px}
.book-stage-tile .book-open-link{display:inline-flex;align-items:center;justify-content:center;text-decoration:none;color:#f8df9e;padding:9px 14px;border:1px solid #dab979;border-radius:24px;background:rgba(7,23,44,.94);font-size:.84rem;margin-bottom:8px;position:relative;z-index:4}
.book-stage-tile .book-open-link:hover{background:#43364c;box-shadow:0 0 12px rgba(233,180,94,.5)}
.freya-share-row{margin:10px auto;display:flex;flex-wrap:wrap;gap:8px;justify-content:center;position:relative;z-index:3}
.freya-share-row a,.freya-share-row button{font:inherit;font-size:.79rem;cursor:pointer;background:rgba(9,28,49,.87);color:#f0dcae;border:1px solid rgba(210,167,92,.68);border-radius:24px;padding:8px 12px;text-decoration:none}
.freya-share-row button:hover,.freya-share-row a:hover{background:#4b3b4b}
.freya-leaves{position:fixed;inset:0;pointer-events:none;overflow:hidden;z-index:90}
.freya-leaf{position:absolute;top:-40px;left:var(--x);font-size:var(--sz);opacity:0;animation:leafFall var(--duration) linear infinite;animation-delay:var(--delay);filter:drop-shadow(0 2px 2px #261208);will-change:transform}
@keyframes leafFall{0%{transform:translate(0,-30px) rotate(0deg);opacity:0}8%{opacity:.48}85%{opacity:.38}100%{transform:translate(var(--drift),105vh) rotate(410deg);opacity:0}}
.freya-snow{position:absolute;inset:0;pointer-events:none;overflow:hidden;z-index:3}
.freya-snow i{position:absolute;top:-12px;left:var(--x);font-style:normal;font-size:var(--sz);color:#fff6dc;opacity:0;animation:leafFall var(--duration) linear infinite;animation-delay:var(--delay)}
.freya-spring .freya-leaf{filter:none}
.freya-summer .freya-leaf{filter:drop-shadow(0 0 5px #efcf83)}
.freya-xmas-v2{position:relative;isolation:isolate}
.freya-xmas-v2::after{content:'✧ ✦ ✧';position:absolute;right:2%;top:12%;color:#ffe4a7;text-shadow:0 0 14px #ffd77d;animation:xmasGlitter 3.5s ease-in-out infinite alternate;pointer-events:none;font-size:1.1rem}
@keyframes xmasGlitter{from{opacity:.2;transform:scale(.93)}to{opacity:.9;transform:scale(1.07)}}
@media(max-width:500px){.magic-path.book-stage-tile{min-height:430px}.freya-bookshelf .book-group{height:108px}.freya-bookshelf .book-mini{height:88px}.freya-bookshelf .book-mini.active{height:104px}.freya-xmas-v2::after{right:1%;top:4%;font-size:.76rem}}
@media(prefers-reduced-motion:reduce){.freya-leaf,.freya-snow i,.freya-xmas-v2::after{animation:none!important;display:none!important}.freya-bookshelf .book-mini{transition:none}}

/* V4: quiet single-book theater in the compact Books tile */
.magic-path.book-stage-tile{min-height:490px;justify-content:center;gap:0;padding:18px 13px 14px}
.book-stage-tile>.path-image{opacity:.16!important;filter:blur(5px) saturate(.78)}
.freya-bookshelf{width:100%;padding:0;margin:0 auto;display:flex;align-items:center;flex-direction:column;gap:5px}
.freya-bookshelf::before{width:75%;height:160px;left:12.5%;top:15px;filter:blur(21px);background:radial-gradient(ellipse,rgba(238,176,80,.19),transparent 70%)}
.freya-bookshelf .book-group{height:178px;width:100%;display:grid;place-items:center;position:relative;margin:0 0 5px;gap:0}
.freya-bookshelf .book-mini{grid-area:1 / 1;position:absolute;left:50%;bottom:0;max-width:none;width:auto;height:162px;opacity:0;visibility:hidden;pointer-events:none;transform:translate(-50%,6px) scale(.96);transition:opacity .7s ease,transform .7s ease,visibility .7s;box-shadow:7px 11px 19px #0009}
.freya-bookshelf .book-mini.active{height:172px;opacity:1;visibility:visible;transform:translate(-50%,0) scale(1);filter:brightness(1.03) drop-shadow(0 0 8px #eabf6950)}
.freya-bookshelf .book-title{min-height:35px;max-width:100%;font-size:.92rem;line-height:1.3;display:flex;align-items:center;justify-content:center;margin-top:0}
.freya-bookshelf .book-tools{margin:1px auto;gap:10px}
.freya-bookshelf button{height:29px;width:29px;font-size:15px}
.book-stage-tile .book-open-link{margin:2px 0 4px;padding:8px 14px;font-size:.83rem}
.book-stage-tile .path-info{margin:9px 0 4px;padding:10px 0 0;text-align:center;border-top:1px solid rgba(220,182,110,.23)}
.book-stage-tile .path-info .path-title{font-size:1.28rem!important;line-height:1.23}
.book-stage-tile .path-description{display:block;line-height:1.4;margin:7px 0;color:#f4e6c9;font-size:.9rem}
.book-stage-tile .freya-world-link{display:inline-flex;position:relative;z-index:5;text-decoration:none!important;align-items:center;justify-content:center;background:linear-gradient(140deg,#ad7d38,#ebc47d);color:#07182c!important;padding:9px 16px;border:1px solid #f4d69b;border-radius:24px;font-weight:700;font-size:.88rem;transition:box-shadow .25s,transform .25s}
.book-stage-tile .freya-world-link:hover,.book-stage-tile .freya-world-link:focus-visible{box-shadow:0 0 17px #ecba6c91;transform:translateY(-2px)}
.book-stage-tile .freya-share-row{margin:8px 0 0;gap:6px}
.book-stage-tile .freya-share-row a,.book-stage-tile .freya-share-row button{font-size:.71rem;padding:5px 9px;opacity:.88}
@media(max-width:500px){.magic-path.book-stage-tile{min-height:470px}.freya-bookshelf .book-group{height:155px}.freya-bookshelf .book-mini{height:144px}.freya-bookshelf .book-mini.active{height:151px}}
@media(prefers-reduced-motion:reduce){.freya-bookshelf .book-mini{transition:none!important}}

/* V5: position the only active cover exactly in the center of the book stage. */
.freya-bookshelf .book-group{position:relative!important;display:block!important;width:100%!important;max-width:100%!important;height:178px!important;margin:0 auto 5px!important;overflow:visible}
.freya-bookshelf .book-mini{position:absolute!important;left:50%!important;top:50%!important;right:auto!important;bottom:auto!important;max-width:calc(100% - 14px)!important;max-height:100%!important;width:auto!important;height:162px!important;transform:translate(-50%,-48%) scale(.96)!important;transform-origin:center center!important;opacity:0;visibility:hidden;pointer-events:none}
.freya-bookshelf .book-mini.active{position:absolute!important;left:50%!important;top:50%!important;right:auto!important;bottom:auto!important;width:auto!important;max-width:calc(100% - 14px)!important;height:172px!important;transform:translate(-50%,-50%) scale(1)!important;opacity:1;visibility:visible}
/* The share bar belongs to the entire site, not the books tile. */
.freya-share-row.freya-site-share{width:100%;margin:18px auto 5px;padding:0 12px;justify-content:center;align-items:center;gap:10px;box-sizing:border-box}
.freya-site-share .share-caption{color:#e6cb95;font-size:.82rem;letter-spacing:.02em;margin-right:6px}
.freya-share-row.freya-site-share a,.freya-share-row.freya-site-share button{font-size:.8rem;padding:8px 13px;opacity:1}
@media(max-width:500px){.freya-bookshelf .book-group{height:155px!important}.freya-bookshelf .book-mini{height:144px!important}.freya-bookshelf .book-mini.active{height:151px!important}.freya-site-share .share-caption{width:100%;text-align:center}}

/* V6: unified, intrinsically centered cover stage. Overrides legacy position/transform rules. */
.freya-bookshelf .book-group {
  display:grid!important;
  grid-template-columns:minmax(0,1fr)!important;
  grid-template-rows:minmax(0,1fr)!important;
  place-items:center!important;
  position:relative!important;
  box-sizing:border-box!important;
  width:100%!important;
  height:178px!important;
  margin:0 auto 5px!important;
  padding:4px 0!important;
  overflow:hidden!important;
}
.freya-bookshelf .book-group .book-mini,
.freya-bookshelf .book-group .book-mini.active {
  grid-area:1 / 1!important;
  position:relative!important;
  inset:auto!important;
  left:auto!important;
  right:auto!important;
  top:auto!important;
  bottom:auto!important;
  display:block!important;
  box-sizing:border-box!important;
  margin:0 auto!important;
  padding:0!important;
  width:auto!important;
  height:auto!important;
  max-width:100%!important;
  max-height:170px!important;
  object-fit:contain!important;
  object-position:center!important;
  transform:none!important;
  transform-origin:center!important;
  border-radius:2px;
  justify-self:center!important;
  align-self:center!important;
  transition:opacity .55s ease,filter .55s ease!important;
}
.freya-bookshelf .book-group .book-mini {opacity:0!important;visibility:hidden!important;pointer-events:none!important;}
.freya-bookshelf .book-group .book-mini.active {opacity:1!important;visibility:visible!important;filter:brightness(1.03) drop-shadow(0 0 8px #eabf6950)!important;}
@media(max-width:500px){
  .freya-bookshelf .book-group{height:155px!important;}
  .freya-bookshelf .book-group .book-mini,.freya-bookshelf .book-group .book-mini.active{max-height:147px!important;}
}
@media(prefers-reduced-motion:reduce){.freya-bookshelf .book-group .book-mini{transition:none!important;}}
