/* The book ledge, fire and window use the coordinates of each painted room. */
.room,.library-wall{overflow:hidden;background:#241912;container-type:size}
.hearth-plate{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:max(100%,min(150cqh,125cqw));aspect-ratio:3/2;background:url(art/room/oak-library.webp?v=38014c635ada6edc) center/100% 100%;isolation:isolate}
.hearth-fire,.window-snow{position:absolute;pointer-events:none}
.hearth-fire{left:18.6%;top:54.85%;width:12.7%;height:11.7%;mix-blend-mode:screen}
.window-snow{left:.45%;top:13.3%;width:5.65%;height:33.5%;clip-path:polygon(0 10%,50% 0,100% 12%,100% 100%,0 100%)}
.hearth-plate:after{content:"";position:absolute;left:14%;top:71.2%;width:21%;height:15%;background:radial-gradient(ellipse at 50% 8%,#ffbb5e55,transparent 66%);mix-blend-mode:screen;opacity:var(--fire-light,.44);pointer-events:none}
.room:before{z-index:2;background:linear-gradient(90deg,#071615d9 0%,#0a191abd 23%,#131c1b2b 54%,#1516130a),linear-gradient(0deg,#0b191ced 0%,#101a1a73 20%,transparent 58%,#15141036)}
.room:after{z-index:2;box-shadow:inset 0 0 7vw #100c0f55}
#shelfDialog{position:fixed;inset:0;margin:0;padding:0;border:0;border-radius:0;max-width:none;max-height:none;width:100%;height:100%;color:#fceacf;overflow:hidden;background:#221715;font-family:var(--serif)}
#shelfDialog::backdrop{background:#171715}
.library-wall{position:absolute;inset:0;background:radial-gradient(ellipse at 51% 47%,#593a22,#261c18 64%,#151819)}
.library-heading{position:absolute;z-index:2;inset:0 0 auto;display:flex;align-items:center;justify-content:space-between;padding:clamp(12px,2vw,30px) clamp(18px,3vw,56px);background:linear-gradient(#180e0dda,transparent)}
.library-heading div{display:flex;align-items:center;gap:.8em;text-shadow:0 2px 6px #130b08,0 0 16px #21110e}
.library-heading img{width:clamp(32px,3.4vw,54px)}
.library-heading h2{margin:0;font:600 clamp(1.1rem,2.1vw,2rem)/1.4 var(--serif);letter-spacing:.15em}
#closeShelf{width:44px;height:44px;border:1px solid #d5b282;border-radius:50%;background:#261e18de;color:#ffedc9;font:1.65rem/1 var(--serif)}
.library-instruction{position:absolute;bottom:4.2%;left:50%;transform:translateX(-50%);white-space:nowrap;margin:0;padding:.64em 1.4em;color:#f9e8c4;background:#2a201aed;border:1px solid #ae8861;border-radius:3px;font:600 clamp(.86rem,1.2vw,1.1rem) var(--serif);letter-spacing:.12em;box-shadow:0 3px 12px #21110f69}
.hearth-plate .shelf-books{position:absolute;left:44.3%;width:46.8%;top:24.3%;height:27.0%;display:flex;flex-direction:row;align-items:flex-end;justify-content:space-evenly;gap:1.5%;margin:0}
.shelf-books .binding,.binding.flying{--cloth:#75362e;--shine:#a85947;--edge:#583024;--foil:#f3d6a1;position:relative;display:block;container-type:inline-size;width:28%;height:94%;margin:0;padding:0;border:0;border-radius:2px 4px 4px 2px;background:repeating-linear-gradient(0deg,#9c754e 0px,#e5c99b 1px,#e5c99b 2px,#c0a479 3px);color:var(--foil);font-family:var(--serif);text-decoration:none;box-shadow:3px 1px 0 #5c3825,5px 4px 0 #2c1e18,9px 6px 9px #1e100ccc}
.binding.bremen{--cloth:#29574c;--shine:#47776b;--edge:#193e35;height:98%}
.binding.koguma{--cloth:#313f60;--shine:#52688c;--edge:#263148;height:92%}
.book-board{position:absolute;inset:0 3% 0 0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2.5%;padding:8% 4% 8% 9%;border-radius:2px 3px 3px 2px;border:1px solid var(--edge);background:linear-gradient(90deg,#120d0c4d,transparent 4%,#fff3d02b 6%,#140e104d 8%,transparent 11%,#fff2db0a 70%,#0b09131c),repeating-linear-gradient(23deg,transparent 0px,transparent 2px,#ffe6ad09 3px),linear-gradient(115deg,var(--shine),var(--cloth) 56%,var(--edge));box-shadow:inset -2px 0 2px #20161085,1px 1px 1px #291f18;transform-origin:left center}
.book-board:before,.book-board:after{content:"";position:absolute;inset:4% 4% 4% 10%;border:1px solid #e4c48c94;pointer-events:none}
.book-board:after{inset:5.8% 6% 5.8% 12%;border:1px solid #e6c68b4f}
.book-title{text-align:center;font-weight:700;font-size:clamp(10px,12.2cqw,43px);line-height:1.5;letter-spacing:.03em;text-shadow:0 1px 1px #301e1a}
.book-board svg{width:75%;height:43%;flex-shrink:1}
.shelf-books .binding small,.binding.flying small{color:var(--foil);font:600 clamp(6px,5.6cqw,18px)/1.4 var(--serif);letter-spacing:.045em}
.shelf-books a:focus-visible{outline:3px solid #ffe0a0;outline-offset:5px}
.room .shelf-books{pointer-events:none}.room .binding[aria-current],.binding.is-lifted{visibility:hidden}
.binding.flying,.landing-book{position:fixed;z-index:5;pointer-events:none;margin:0;transform-origin:center;will-change:transform}
.binding.flying{perspective:1000px}
.binding.flying .book-board{transform-style:preserve-3d;backface-visibility:hidden}
.binding.flying:before{content:"";position:absolute;inset:3% 3% 2% 2%;border:1px solid #b79965;background:linear-gradient(90deg,#ae8d5a,#e1c99b 5%,#f6e6c1 13%,#e5cfaa)}
.landing-book{object-fit:contain}
@media(max-aspect-ratio:4/5){
  .hearth-plate{width:100%;aspect-ratio:2/3;background-image:url(art/room/oak-library-portrait.webp?v=2687a92cd38890f3)}
  .hearth-plate .shelf-books{left:9.2%;width:81.8%;top:22.8%;height:22.9%}
  .hearth-fire{left:37.1%;top:64%;width:26%;height:11%}
  .window-snow{left:12%;top:53.5%;width:7.3%;height:13%;clip-path:polygon(0 16%,53% 0,100% 16%,100% 100%,0 100%)}
  .hearth-plate:after{left:29%;top:83%;width:43%}
  .room:before{background:linear-gradient(180deg,#102022aa 0%,#17211c11 28%,#101e20b8 53%,#0c1c1ced 100%)}
}
@media(max-height:530px) and (min-aspect-ratio:4/5){.library-heading{padding:6px 18px}.library-instruction{bottom:2%}}
.room .hearth-plate{filter:blur(1.5px) saturate(.84) brightness(.86)}
.library-heading h2:focus{outline:none}
@media(max-aspect-ratio:4/5){
  .library-wall .hearth-plate{width:min(112%,max(100%,66.67cqh))}
  .library-wall .hearth-plate:before{content:"";position:absolute;inset:-1px 0;background:linear-gradient(#241b16,transparent 6%,transparent 93%,#241b16);pointer-events:none}
  .book-title{font-size:clamp(11px,13cqw,26px)}
  .shelf-books .binding small,.binding.flying small{font-size:clamp(8px,7cqw,15px)}
}
.fly-hinge,.fly-sheet,.fly-liner{position:absolute;inset:1% 2% 1% 0;transform-origin:left center}
.fly-hinge{inset:0;transform-style:preserve-3d}
.fly-hinge .book-board{transform:translateZ(1px)}
.fly-liner,.fly-sheet{background:#e4cea2 url(paper.svg);border:1px solid #b7996b;border-radius:1px 3px 3px 1px;box-shadow:inset 4px 0 7px #99734766}
.fly-liner{inset:0 3% 0 0;transform-origin:center;transform:rotateY(180deg);backface-visibility:hidden;outline:1px solid #b8945a;outline-offset:-6px}
.library-heading,.library-instruction{transition:opacity .3s}
.library-arriving .library-heading,.library-arriving .library-instruction{opacity:0}
.library-wall:after{content:"";position:absolute;inset:0;pointer-events:none;background:#0e1b1c;opacity:0}
.library-arriving .library-wall:after{animation:desk-shade 1.45s both}
@keyframes desk-shade{0%,40%{opacity:0}100%{opacity:.39}}

.shelf-books .binding[hidden]{display:none}
.shelf-turns{display:flex;align-items:center;gap:1em;padding:.18em .4em}
.shelf-turns button{width:44px;height:44px;border:0;background:transparent;color:inherit;font:1.8rem Georgia,serif;cursor:pointer}
.shelf-turns button:disabled{opacity:.3;cursor:default}
.library-arriving .shelf-turns{pointer-events:none}
.book-board img{width:69%;height:43%;object-fit:contain;filter:drop-shadow(1px 2px 1px #1c110c88)}
.binding.race{--cloth:#426542;--shine:#73855d;--edge:#284731}
.binding.lion{--cloth:#8b5a23;--shine:#ab7941;--edge:#69401f}
.binding.grapes{--cloth:#65405e;--shine:#91647b;--edge:#50324b}
.binding.pitcher{--cloth:#265e72;--shine:#498596;--edge:#1e4355}
.binding.wind{--cloth:#854830;--shine:#a66d41;--edge:#643823}

.room .hearth-plate{visibility:hidden}
.room:before{background:linear-gradient(90deg,#11201cef 0%,#152421d8 24%,#17252283 53%,#15222055),linear-gradient(0deg,#0e1b1df5 0%,#111f1f88 30%,transparent 70%)}
@media(max-width:700px){.room:before{background:linear-gradient(180deg,#152323cb,#14201f68 24%,#122221a3 52%,#0c1b1bf2 86%)}}

.room{background:radial-gradient(ellipse at 73% 36%,var(--horizon,#cbb493),transparent 53%),linear-gradient(var(--zenith,#455764),var(--horizon,#cbb493) 57%,var(--earth,#465444) 88%)}
.scene-surround{position:absolute;inset:0;overflow:hidden;pointer-events:none}
.scene-surround .wing{position:absolute;object-fit:contain;max-width:none;transition:transform .55s ease;filter:drop-shadow(1px 6px 8px #18232337)}
.wing[data-edge=left]{left:var(--inset);object-position:left bottom}
.wing[data-edge=right]{right:var(--inset);object-position:right bottom}
.wing-0,.wing-1{--inset:-3%;width:55%;height:64%;bottom:26%;opacity:.52;--shift:1.3vw}
.wing-1{height:57%;bottom:25%;opacity:.65;--shift:2.4vw}
.wing-2{--inset:-9%;width:45%;height:86%;bottom:-6%;opacity:.82;--shift:5.5vw}
.wing-3{--inset:-7%;width:38%;height:49%;bottom:-7%;--shift:8vw}
body:has(#peekView[aria-pressed=true]) .wing{transform:translateX(var(--shift))}
@media(prefers-reduced-motion:reduce){.scene-surround .wing{transition:none}}

.scene-surround .wing-2[data-part=curtain]{top:-12%;bottom:auto;height:112%;--inset:-15%;opacity:.63}
