/* Flame, glass glow and shelf reflection share the painted room's coordinates.
   Unequal cycles keep the candle organic without flashing or moving the lantern. */
.living-lantern{position:absolute;inset:0;overflow:hidden;pointer-events:none;z-index:0}
.living-lantern svg{position:absolute;height:100%;width:auto;max-width:none;aspect-ratio:3/2;left:50%;top:0;transform:translateX(-50%)}
.candle-flame{transform-origin:1381px 294px;animation:candle-sway 2.7s ease-in-out infinite}
.candle-core{opacity:.85;animation:candle-core-light 1.7s ease-in-out infinite}
.candle-glow{mix-blend-mode:screen;opacity:.65;transform-origin:1381px 282px;animation:candle-glow-light 4.7s ease-in-out infinite}
.candle-reflection{mix-blend-mode:screen;opacity:.65;transform-origin:1381px 349px;animation:candle-reflected-light 4.7s ease-in-out infinite}
@keyframes candle-sway{0%,100%{transform:rotate(-2deg) scale(.97,1)}19%{transform:rotate(3deg) scale(1.03,.94)}43%{transform:rotate(-4deg) scale(.94,1.06)}61%{transform:rotate(1deg) scale(1,.98)}79%{transform:rotate(3deg) scale(.98,1.03)}}
@keyframes candle-core-light{0%,100%{opacity:.65}23%{opacity:.85}47%{opacity:.72}71%{opacity:.95}}
@keyframes candle-glow-light{0%,100%{opacity:.62;transform:scale(1)}31%{opacity:.7;transform:scale(1.012)}54%{opacity:.64;transform:scale(1.003)}78%{opacity:.68;transform:scale(1.008)}}
@keyframes candle-reflected-light{0%,100%{opacity:.6;transform:scaleX(1)}31%{opacity:.68;transform:scaleX(1.025)}54%{opacity:.62;transform:scaleX(1.008)}78%{opacity:.66;transform:scaleX(1.018)}}
.tab-away .living-lantern *, .lights-paused .living-lantern *{animation-play-state:paused}
@media(prefers-reduced-motion:reduce){.living-lantern *{animation:none!important}}
/* The mobile shelf uses different wall artwork, with no visible lantern. */
@media(max-width:700px){.shelf-lantern{display:none}}

/* Same scaling and anchoring as the single-shelf room background. */
.room-lantern{position:fixed;z-index:0}
.room-lantern svg{width:max(100vw,177.7vh);height:auto;aspect-ratio:1672/941;left:50%;top:70%;transform:translate(-50%,-70%)}
.room-lantern .candle-reflection{transform-origin:1381px 361px}
body[data-view="library"]>.room-lantern{display:none}
body[data-view="cover"]>.room-lantern{opacity:.75}
body[data-view="reader"]>.room-lantern{opacity:.62}
body.auth>.room-lantern{z-index:-1;opacity:.65}
body.auth>.room-lantern svg{width:max(100vw,177.6833156vh);left:82%;top:42%;transform:translate(-82%,-42%)}
