/* The Story Room's own styles (W4b, 2026-11-17). Loaded after stories.css, which the books share:
   nothing here touches the book reader. One shelf row that grows sideways: covers never shrink,
   more books simply means more to swipe (or the big arrows). */
body.sroom { background: #b9773a; }                /* the library's warm base colour: shown at once, before any picture loads */
.sroom .lib { background: #b9773a; }

/* room title: near the top on every screen, shown at once (above the door too) */
.sr-head { position: fixed; z-index: 72; left: 0; right: 0; top: calc(max(12px, env(safe-area-inset-top)) + 64px); padding: 0 var(--gutter); text-align: center; pointer-events: none; }
.sr-head h1 { margin: 0; font-size: clamp(34px, 5.2vw, 54px); line-height: 1.05; text-shadow: 0 2px 4px rgba(60, 25, 8, .55), 0 0 22px rgba(60, 25, 8, .55); }

/* the shelf */
.sr-shelf { --cw: clamp(132px, 40vw, 200px); --gap: clamp(16px, 3vw, 30px); position: fixed; z-index: 20; left: 0; right: 0; top: 48%; transform: translateY(-50%); }
.sr-shelf::before { content: ""; position: absolute; left: 0; right: 0; top: -6%; bottom: -10%; pointer-events: none; background: radial-gradient(ellipse 75% 62% at 50% 56%, rgba(48, 22, 8, .42), transparent 76%); }
.sr-shelf::after { content: ""; position: absolute; left: 0; right: 0; bottom: 8px; height: 16px; pointer-events: none; border-radius: 3px;
  background: linear-gradient(#c58a4f, #8c5229 55%, #643718); box-shadow: 0 12px 18px -8px rgba(40, 16, 4, .7), inset 0 2px 0 rgba(255, 220, 170, .45); }
.sr-row { position: relative; z-index: 1; display: flex; gap: var(--gap); width: max-content; max-width: 100%; box-sizing: border-box; margin: 0 auto; padding: 30px 22px 22px;
  list-style: none; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x proximity; scroll-padding: 0 22px; scrollbar-width: none; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
.sr-row::-webkit-scrollbar { display: none; }
.sr-item { position: relative; flex: 0 0 auto; width: var(--cw); scroll-snap-align: start; }

.sr-cover { position: relative; display: block; width: 100%; aspect-ratio: 2 / 3; border-radius: 5px 10px 10px 5px; overflow: hidden; text-decoration: none; color: inherit; background: #e9d3ac;
  box-shadow: inset 7px 0 0 rgba(40, 18, 6, .22), 0 16px 22px -10px rgba(30, 12, 4, .75); transform-origin: 50% 100%; transition: transform .35s cubic-bezier(.3, .7, .2, 1.2), box-shadow .35s; -webkit-tap-highlight-color: transparent; }
.sr-cover img { display: block; width: 100%; height: 100%; object-fit: cover; }
a.sr-cover:hover { transform: translateY(-5px); box-shadow: inset 7px 0 0 rgba(40, 18, 6, .22), 0 24px 26px -10px rgba(30, 12, 4, .8), 0 0 28px rgba(255, 214, 140, .55); }
a.sr-cover:focus-visible { outline: 4px solid #FFE08A; outline-offset: 3px; }
a.sr-cover.lift { transform: translateY(-6%) scale(1.06); box-shadow: 0 30px 40px -12px rgba(30, 12, 4, .8), 0 0 46px rgba(255, 220, 150, .8); }

/* the title, ON the cover, readable at phone size (17px or more, dark ink on cream: about 12:1) */
.sr-title { position: absolute; left: 6%; right: 6%; bottom: 5%; padding: 6px 8px 7px; border-radius: 10px; background: rgba(255, 248, 232, .95); color: #3a2416;
  font: 400 clamp(17px, 1.7vw, 21px)/1.08 var(--hand); text-align: center; box-shadow: 0 4px 10px -4px rgba(0, 0, 0, .4); }
.sr-title small { display: block; margin-bottom: 1px; font: 400 16px/1.1 var(--hand); color: #9a3b22; }

/* read / new marks (from the shared progress record) */
.sr-mark { position: absolute; z-index: 2; top: -14px; right: -6px; padding: 5px 12px 7px; border-radius: 999px; font: 400 17px/1 var(--hand); font-style: normal; color: #fff;
  transform: rotate(6deg); box-shadow: 0 6px 12px -5px rgba(0, 0, 0, .6); pointer-events: none; }
.sr-mark--read { background: #2f6b3a; }          /* white on this green: 6.6:1 */
.sr-mark--new { background: #b33d26; }           /* white on this red: 5.7:1 */

/* the one teaser: a wrapped book, not a link */
.sr-cover--next { box-shadow: 0 16px 22px -10px rgba(30, 12, 4, .6); background: #fbf1dc; }
.sr-cover--next img { object-fit: contain; }

/* big arrows, only when the row is longer than the screen */
.sr-arrow { position: absolute; z-index: 3; top: calc(50% + 4px); transform: translateY(-50%); display: grid; place-items: center; width: 52px; height: 52px; padding: 0; border: 0; border-radius: 50%;
  background: rgba(255, 248, 232, .96); box-shadow: 0 8px 18px -6px rgba(30, 12, 4, .7); cursor: pointer; -webkit-tap-highlight-color: transparent; transition: opacity .25s, transform .25s; }
.sr-arrow[hidden] { display: none; }
.sr-arrow:disabled { opacity: 0; pointer-events: none; }
.sr-arrow--prev { left: 6px; } .sr-arrow--next { right: 6px; }
.sr-arrow span { width: 14px; height: 14px; border: solid #3a2416; border-width: 0 4px 4px 0; border-radius: 2px; transform: rotate(-45deg); margin-right: 5px; }
.sr-arrow--prev span { transform: rotate(135deg); margin: 0 0 0 5px; }
.sr-arrow:hover { transform: translateY(-50%) scale(1.06); }
.sr-arrow:focus-visible { outline: 4px solid #FFE08A; outline-offset: 2px; }

/* footer: world.js fills it with the disclaimer and the Grown-ups link */
.sroom .lib__foot { padding-top: 26px; background: linear-gradient(transparent, rgba(43, 22, 12, .72) 45%); color: rgba(255, 246, 230, .92); }

@media (max-height: 600px) { .sr-shelf { --cw: clamp(120px, 32vh, 170px); top: 55%; } }
@media (prefers-reduced-motion: reduce) { .sr-cover, .sr-arrow { transition: none; } .sr-row { scroll-behavior: auto; } }
.sroom .lib__foot { text-align: center; }
.sroom .lib__foot p { margin-left: auto; margin-right: auto; }
