/* Reading Hollow · forest dusk. Shared presentation only; legacy app selectors stay intact. */
:root{
  /* EVERGREEN (Jesse 2026-11-19: "I dont really like the green color of the theme, its kind of washed out. can we get a better
     forest green"): deep pine greens (hue ~150, about half saturation) under the hollow's warm lantern gold. Every text pair here
     is AA or better: ink on panel 12.4:1, soft ink on the lightest sheet 8:1, mint accents 6:1+, gold-button text 6.6:1. */
  --pine-950:#04110b; --pine-900:#061810; --pine-850:#0b2318; --pine-800:#0e2a1d; --pine-750:#133424; --pine-700:#1a422d;
  --pine-650:#1b4630; --pine-600:#23573b; --pine-edge:#3d7b58; --pine-accent:#7bd59c; --pine-mint:#ace2be;
  --lantern:#f1c77c; --lantern-hi:#ffdd94; --lantern-deep:#d9a344;
  --bg1:var(--pine-900); --bg2:var(--pine-850);
  --ink:#fff3d9; --ink-soft:#e4dfc8;
  --panel:var(--pine-750); --panel-edge:#3d7b58b3;
  --cyan:#9ce0cc; --purple:#d3bde1; --rocket:#eab65f; --magenta:#d8a55b;
  --gold:#ffd18a; --green:var(--pine-accent);
  --l1:#9fe0b2; --l2:#9ce0cc; --l3:#d3bde1;
  --glow-cyan:0 0 18px #eab65f40;
  --sg-ui:"Nunito Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --sg-display:"Alegreya", Georgia, serif;
  --sg-grad:linear-gradient(100deg,#f8d995,#dba44f 70%,#f3ce89);
  --sg-line:#3d7b58; --sg-line-hi:#f1c77c;
  --sg-tile:var(--pine-800); --sg-soft:#e8e1c9; --sg-dim:#d9d2b8;
  --sheet-top:var(--pine-650); --sheet-bot:#0c271b; --sheet-edge:#f1c77c4d;
  --ease-out:cubic-bezier(.2,.9,.3,1);
}
html{background:var(--bg1); color-scheme:dark;}
body{background:var(--bg1); isolation:isolate;}
/* CSS backgrounds fetch only when their selector matches. The reader is not preloaded.
   background-position is the background equivalent of object-position: keep the nook on screen. */
body::before{
  content:""; position:fixed; inset:0; z-index:-1; pointer-events:none;
  background-image:linear-gradient(90deg,#06170fb8,#06170f66 65%,#06170f59),url("bg-home-1600.webp");
  background-size:cover; background-position:70% 55%; background-repeat:no-repeat;
}
body.reading::before,body.playing::before{
  background-image:linear-gradient(#06170fad,#06170fbd),url("bg-reader-1600.webp");
  background-position:68% 50%;
}
@media(max-width:600px){
  body::before{background-image:linear-gradient(#06170f99,#06170fb8),url("bg-home-900.webp"); background-position:72% 50%;}
  body.reading::before,body.playing::before{background-image:linear-gradient(#06170fad,#06170fbd),url("bg-reader-900.webp");}
}
/* Animated home background (theme/bg-loop.js): the clip plus the SAME gradient as body::before, faded in as one layer
   so the look matches the still exactly. Hidden in the reader; never loaded under reduced motion. */
#rhBg{position:fixed; inset:0; z-index:-1; pointer-events:none; overflow:hidden; opacity:0; transition:opacity 1.2s ease;}
#rhBg.on{opacity:1;}
#rhBg video{display:block; width:100%; height:100%; object-fit:cover; object-position:70% 55%;}
#rhBg::after{content:""; position:absolute; inset:0; background:linear-gradient(90deg,#06170fb8,#06170f66 65%,#06170f59);}
body.reading #rhBg,body.playing #rhBg{display:none;}
@media(max-width:600px){
  #rhBg video{object-position:72% 50%;}
  #rhBg::after{background:linear-gradient(#06170f99,#06170fb8);}
}
/* Sixteen small fireflies, animated only through opacity and transform. */
.stars .s{position:absolute; width:3px; height:3px; border-radius:50%; background:#ffdf91; box-shadow:0 0 8px 2px #efbf6466; opacity:.65;}
.stars .s:nth-child(3n){background:#a4ead3; box-shadow:0 0 7px 2px #85d5bd55;}
.stars .tw1,.stars .tw2,.stars .tw{animation:rhFirefly 8s ease-in-out infinite;}
.stars .tw2{animation-duration:11s;}
@keyframes rhFirefly{0%,100%{opacity:.25;transform:translate3d(0,0,0)}50%{opacity:.85;transform:translate3d(5px,-9px,0)}}
.drifter{animation:none; opacity:.65;}
.hero-sky{background:radial-gradient(ellipse at 50% 32%,#eab65f1f,transparent 65%);}
.hero-mark{filter:drop-shadow(0 4px 16px #efbf6455); animation:none; width:clamp(64px,10vw,96px);}
.hero-mark .twk{animation:none;}
.hero-planet{animation:none; width:64px; top:40px;}
.hero-comet{width:90px; top:50px;}
.lib-head{padding:24px 18px 14px; border-radius:28px; background:#0b2318eb; border:1px solid #f1c77c40;}
/* Header card as frosted glass over the forest (Jesse 2026-11-18: "improve … the main card"): the hollow glows through,
   a thin lantern-gold edge, no flat clip-art leaf or lantern icons. Browsers without backdrop-filter keep the solid panel. */
@supports ((-webkit-backdrop-filter:blur(1px)) or (backdrop-filter:blur(1px))){
  .lib-head{background:linear-gradient(180deg,#0b281991,#06170fc2); -webkit-backdrop-filter:blur(12px) saturate(1.3);
    backdrop-filter:blur(12px) saturate(1.3); border:1px solid #f1c77c47; border-radius:32px;
    box-shadow:inset 0 1px 0 #ffe7b02e,inset 0 0 70px #e6b25512,0 22px 55px #050a0799;}
}
.lib-head .hero-comet,.lib-head .hero-planet{display:none;}
.lib-head h1{
  font-family:var(--sg-display); font-weight:800; font-size:clamp(34px,6.5vw,64px); line-height:1.05;
  letter-spacing:.005em; text-transform:none; white-space:normal; padding:0; color:#f7d38d; background:none;
  -webkit-text-stroke:.3px #ffe4a9; text-shadow:0 2px 0 #78532a,0 4px 10px #090f0b,0 0 25px #d99c3626;
}
.lib-head .hero-sub,.rules-link.sg-link,#modeOverlay .ears-link{color:var(--ink-soft);}
#library,#modeOverlay .sheet,.topbar,.bottombar,.hint,.sheet,.ctlbar{font-family:var(--sg-ui);}
.coll-title,.sheet h2,#modeTitle,.topbar .ttl,h1#wordmark{font-family:var(--sg-display);}
/* Carved signs: opaque wood protects text contrast even over the lanterns. */
#libTabs{background:none; border:0; border-radius:0; box-shadow:none; gap:10px; padding:5px 0;}
#libTabs .tab{
  border-radius:10px 14px 10px 13px; color:#fff3d9; border:1px solid #ad8654;
  background:repeating-linear-gradient(3deg,transparent 0 7px,#1c140e33 8px 9px),linear-gradient(#62472f,#473220);
  box-shadow:inset 0 2px 0 #c1985a55,inset 0 -3px 0 #281a15,0 5px 12px #080d0a77;
}
#libTabs .tab.active{color:#fff3d9; border:2px solid #f3c875; background:linear-gradient(#705134,#503822); box-shadow:0 0 0 1px #f3c87555,0 0 18px #e6b25566,inset 0 2px 0 #e2bc7655;}
#libTabs .tab .tab-ic{color:#ffe0a2; filter:none;}
.coll-title{padding:10px 14px; border-radius:14px; background:#0e2a1df2; color:var(--ink); border:1px solid #3d7b5866; box-shadow:inset 0 1px 0 #ffe7b014;}
.coll-title .coll-count{color:var(--ink-soft); background:#1a422d; border-color:#3d7b58;}
.card.art-card{border:3px solid #6f6a3c; box-shadow:0 4px 0 #413323,0 12px 28px #090f0ba6;}
.card.art-card .info{background:linear-gradient(180deg,#0e2a1d00 0,#0e2a1d99 18px,#0e2a1df5 42px,#0e2a1d 72px);}
@media(hover:hover){.card.art-card:hover{border-color:#c9b576; box-shadow:0 5px 0 #5d472e,0 20px 34px #090f0ba6;}}
.cov-placeholder{color:#edd49b; background:radial-gradient(ellipse at 68% 25%,#8f7038 0,transparent 52%),linear-gradient(150deg,#245a3a,#0e2a1d 85%);}
.cov-placeholder .ph-glyph{opacity:.8; stroke-width:.85;}
.cov-placeholder .ph-orbit{fill:#83985955; stroke:#b4c681; stroke-width:.8; opacity:.8;}
.cov-placeholder .ph-const circle{fill:#ffe3a3;}
.lvl-badge.b1{background:#174a2b;} .lvl-badge.b2{background:#154438;} .lvl-badge.b3{background:#3c3044;}
.ai-chip{color:#ead7ed; background:#3c3044; border-color:#a58eac;}
.qtoggle.sw,.qtoggle.sw.ptoggle.on{color:var(--ink); background:#133424; border-color:#3d7b58;}
.rules-link.sg-link:hover{background:#1a422d;}
.resume-card{background:linear-gradient(135deg,#1d5236,#133424); border-color:#f1c77c80;}
.shelf-note,.beta-line.sg-info,.abk-link{background:#133424f5; padding:14px 18px; border-radius:16px;}
.sheet,#modeOverlay .sheet,.wordcard,.pcheck,.pic-thanks{background:linear-gradient(180deg,var(--sheet-top),var(--sheet-bot));}
#modeOverlay{background:#04110bcf;}
#modeOverlay .sheet-eyebrow,#modeOverlay #modeSource{color:var(--ink-soft);}
#modeOverlay #modeSource.ai{color:#ead7ed;}
#modeOverlay .modebtn{background:#133424;}
#modeOverlay .modebtn .ic,#modeOverlay #chooseRead .ic,#modeOverlay #chooseSkip .ic{color:#fff3d9; background:linear-gradient(#2f7d50,#1a4f33); box-shadow:inset 0 1px 0 #ace2be55;}
#modeOverlay #chooseListen .ic,#modeOverlay #chooseResume .ic,.abk-link .ic{background:linear-gradient(#f5d58c,#d9a344); color:#332415; box-shadow:0 0 18px #e6b25555;}
#chooseListen{border-color:#c9a063;}
#playBtn,.play,.sheetbtn:not(.ghost),.resume-card .go,.attn-ar,.ask-n{
  background:linear-gradient(#f5d58c,#d9a344); color:#332415; border:2px solid #ffdd94;
  box-shadow:inset 0 -4px 0 #ad783555,0 0 20px #e6b25555,0 6px 15px #080d0a77;
}
/* A lantern silhouette around the existing play control, preserving its label and state. */
#playBtn{position:relative; border-radius:22px 22px 17px 17px;}
#playBtn::before{content:""; position:absolute; width:22px; height:12px; border:3px solid #edcc8a; border-bottom:0; border-radius:12px 12px 0 0; left:50%; top:-13px; transform:translateX(-50%); pointer-events:none;}
#playBtn::after{content:""; position:absolute; left:15%; right:15%; bottom:6px; border-top:2px solid #79512877; pointer-events:none;}
.sheetbtn.ghost{color:var(--ink); background:#1a422d; border:1px solid #3d7b58;}
.topbar,.bottombar,.ctlbar{background:#0b2318f2;}
.topbar{border-radius:0 0 16px 16px;}
.hint,.tb-prog{color:var(--ink-soft); background:#0b2318f2;}
.coach{background:#133424; border-color:#3d7b5899;}
/* Reading font, grade sizes, line heights, and word layout remain in the original stylesheet. */
#pageArea,#textArea{
  color:#382819; background:#f4e6c8; color-scheme:light; border:2px solid #b79c68;
  box-shadow:inset 8px 0 20px #8d633318,inset 0 0 45px #b78b4026,0 8px 28px #03090677;
  --ink:#382819; --ink-soft:#61503b; --gold:#765018; --green:#1a6138; --cyan:#275f50;
}
#pageArea .word.done{color:#1a6138;}
#pageArea .word.now{background:#f1ce7c; color:#382819; box-shadow:0 0 0 2px #a77a2a;}
#reader.mode-read .word.now{animation:rhNudge 1.6s ease-in-out infinite;}
@keyframes rhNudge{50%{background:#e8b957;}}
#pageArea .word.tapped{box-shadow:inset 0 -3px 0 #275f50;}
#pageArea .word.carded{outline-color:#275f50;}
#pageArea .word.heard{animation:rhHeard .55s ease;}
@keyframes rhHeard{0%,60%{background:#c5d8aa;color:#254b2c;}100%{background:transparent;}}
#pageArea .word.pulse-word{animation:rhWordPulse .45s ease;}
@keyframes rhWordPulse{35%{background:#ccdcc2;box-shadow:0 0 0 2px #668657;}}
#pageArea .page-note{color:#61503b; background:#ecdbb7; border-color:#a4864e;}
#pageArea .pn-more{color:#684817; border-color:#96723c;}
#textArea p.on{color:#382819; background:#dfd4b4; box-shadow:0 0 0 6px #dfd4b4;}
#textArea p sup,#textArea p.omit{color:#61503b;}
#textArea .soon{color:#684817; background:#ecdbb7; border-color:#a4864e;}
/* Text-panel switch: the surrounding forest, pictures and audiobook keep their own theme. */
.text-theme-switch{min-height:44px; white-space:nowrap;}
.text-theme-switch:focus-visible{outline:3px solid #f1ce7c; outline-offset:2px;}
.text-theme-setting{display:flex; align-items:center; justify-content:space-between; gap:12px; font-weight:800;}
@media(max-width:640px){
  #reader .topbar{column-gap:6px;}
  #reader .topbar .back{padding-inline:12px; flex-shrink:0;}
  #reader .topbar .pageno{min-width:0; flex-shrink:0; margin-left:auto;}
  #reader .topbar .tb-help{margin-left:0; flex-shrink:0;}
}
@media(max-width:399px){
  #reader .topbar{column-gap:4px;}
  #reader .topbar .back{padding-inline:8px; font-size:.9rem;}
  #reader .topbar .pageno{font-size:.75rem;}
  #picToggleReader{padding-inline:8px; font-size:.75rem;}
  #textThemeReader{width:44px; padding:0;}
  #textThemeReader .text-theme-label{display:none;}
  #textThemeReader .text-theme-icon{font-size:1.1rem;}
}
/* Explicit colours only in dark mode: every existing light declaration above is retained. */
.text-theme-dark :is(#pageArea,#coach,#hintLine,#wordCard,#pageCheck,#attnCard,#askAgainCard,#askOverlay .sheet,#reflectOverlay .sheet,#noteOverlay .sheet){
  --ink:#f2e8d5; --ink-soft:#d7c9ae; --gold:#f1ce7c; --green:#b9d6a3; --cyan:#9cdbc8;
  --panel:#29251e; --panel-edge:#968568;
  color:#f2e8d5; background:#1c1914; color-scheme:dark; border-color:#968568;
}
.text-theme-dark #pageArea{box-shadow:inset 0 0 0 1px #bba47c26,0 8px 28px #080d0a77;}
.text-theme-dark #pageArea .word.done{color:#b9d6a3;}
.text-theme-dark #pageArea .word.now{color:#382819; background:#f1ce7c; box-shadow:0 0 0 2px #bda16b;}
.text-theme-dark #reader.mode-read .word.now{animation:rhDarkNudge 1.6s ease-in-out infinite;}
@keyframes rhDarkNudge{50%{background:#e8b957;}}
.text-theme-dark #pageArea .word.tapped{box-shadow:inset 0 -3px 0 #9cdbc8;}
.text-theme-dark #pageArea .word.now.tapped{box-shadow:inset 0 -3px 0 #275f50,0 0 0 2px #bda16b;}
.text-theme-dark #pageArea .word.carded{outline-color:#9cdbc8;}
.text-theme-dark #pageArea .word.heard{animation:rhDarkHeard .55s ease;}
@keyframes rhDarkHeard{0%,60%{background:#b9d6a3;color:#243021;}100%{background:transparent;}}
.text-theme-dark #pageArea .word.pulse-word{animation:rhDarkWordPulse .45s ease;}
@keyframes rhDarkWordPulse{35%{color:#f2e8d5;background:#3b4b35;box-shadow:0 0 0 2px #b9d6a3;}}
.text-theme-dark #pageArea .page-note{color:#e0d2b9; background:#30291e; border-color:#bba47c;}
.text-theme-dark #pageArea .pn-more{color:#f1ce7c; border-color:#bba47c;}
.text-theme-dark :is(#pageArea,#wordCard,#pageCheck,#askOverlay,#reflectOverlay,#noteOverlay) a{color:#9cdbc8; text-decoration:underline; text-underline-offset:3px;}
.text-theme-dark :is(#pageCheck,#askOverlay) .ask-c{color:#f2e8d5; background:#302b23; border-color:#968568;}
.text-theme-dark :is(#pageCheck,#askOverlay) .ask-c.right{color:#e5f4d9; background:#28432c; border-color:#b9d6a3;}
.text-theme-dark :is(#pageCheck,#askOverlay) .ask-c.try{color:#f6d2bc; background:#493023; border-color:#d1a184; opacity:1; border-style:dashed;}
.text-theme-dark :is(#pageCheck,#askOverlay) .ask-n{color:#382819;}
.text-theme-dark #coach .coach-bar{background:#554a38; box-shadow:inset 0 0 0 1px #968568;}
.text-theme-dark #hintLine{color:#d7c9ae;}
.text-theme-dark #wordCard .wc-pos{color:#d7c9ae; border-color:#968568;}
.text-theme-dark #wordCard .wc-btn,.text-theme-dark #askOverlay .ask-hear,.text-theme-dark #reflectOverlay .rf-box{color:#f2e8d5; background:#302b23; border-color:#968568;}
.text-theme-dark #reflectOverlay .rf-box::placeholder{color:#d7c9ae; opacity:1;}
.text-theme-dark :is(#pageArea,#wordCard,#pageCheck,#askOverlay,#reflectOverlay,#noteOverlay) :is(button,a,textarea):focus-visible{outline:3px solid #9cdbc8; outline-offset:2px;}
/* Enable a 200ms fade only after an intentional flip/device change, never on boot.
   Scope transitions to reading surfaces, preserving coach movement and word animations. */
.text-theme-fade :is(#pageArea,#pageArea p,#pageArea .word,#pageArea .page-note,#pageArea .pn-more,#coach,#hintLine,#wordCard,#pageCheck,#attnCard,#askAgainCard,#askOverlay .sheet,#reflectOverlay .sheet,#noteOverlay .sheet),
.text-theme-fade :is(#wordCard,#pageCheck,#askOverlay,#reflectOverlay,#noteOverlay) :is(button,p,span,h2,a,textarea){
  transition:color .2s ease,background-color .2s ease,border-color .2s ease,box-shadow .2s ease;
}
/* Audiobook shell: same forest, unchanged chapter layout and text metrics. */
h1#wordmark{color:#f7d38d; background:none; text-transform:none; letter-spacing:0;}
#shelf .lib-head{padding-top:16px;}
#shelf .lib-head .back{left:12px; top:12px;}
#shelves,.chapters,.credits,#bookBlurb{font-family:var(--sg-ui);}
.credits,#bookBlurb{background:#0b2318f2; border-radius:12px; padding:12px;}
.chap.heard{background:#1d5236;}
.ring i{background:#133424;}
#toast{background:#133424; border:1px solid #f1c77c66;}
@media(max-width:640px){
  .lib-head{padding:14px 10px 10px;}
  .lib-head h1{font-size:clamp(34px,9vw,50px);}
  #libTabs{gap:8px;}
  #libTabs .tab{font-size:13px; border-radius:10px;}
  #libTabs .tab .tab-long{display:inline;} #libTabs .tab .tab-short{display:none;}
  .coll-title{padding:10px;}
}
@media(prefers-reduced-motion:reduce){
  *,*::before,*::after{animation:none !important; transition:none !important; scroll-behavior:auto !important;}
  .stars{display:none;}
  #rhBg{display:none;}
}
.confetto{width:12px; height:20px; border-radius:90% 0 90% 0; background:#b79b51; border:1px solid #eed097;}
.confetto:nth-child(2n){background:#3bb062;}
#doneEmoji:empty::before{content:""; display:block; width:42px; height:52px; margin:12px auto; border-radius:50% 50% 45% 45%; border:3px solid #eac47c; background:linear-gradient(#8c663b 0 32%,#eac47c 33% 39%,#9f7540 40%); box-shadow:0 0 18px #eac47c22;}

/* ===== Background first (Jesse 2026-11-17: "i want the background to be seen right away first … have them flow into
   view with a really cool effect"). On a page load the hollow shows alone for a moment, then the header rises, the
   tabs follow and the shelves open; theme/hollow-scroll.js flies the first stories out of the tree hollow. Plain CSS
   holds the timing, so the page still opens (with a simple fade) if the script never arrives. A tap skips it. ===== */
/* Jesse 11-17: the first cut came "too soon and too fast": the forest now has ~1.8 s alone and everything moves at half speed. */
#library > .lib-head{animation:rhIntroUp 1.3s cubic-bezier(.2,.8,.2,1) 1.8s backwards;}
#library > #libTabs{animation:rhIntroUp 1.2s cubic-bezier(.2,.8,.2,1) 2.2s backwards;}
#library > #shelves{animation:rhIntroFade .8s ease 2.5s backwards;}
html:not(.rh-intro-done) .lib-head > :is(h1,.hero-sub,.chips,.sg-link){animation-duration:.9s;}
html:not(.rh-intro-done) .lib-head > h1{animation-delay:2s;}
html:not(.rh-intro-done) .lib-head > .hero-sub{animation-delay:2.2s;}
html:not(.rh-intro-done) .lib-head > .chips{animation-delay:2.35s;}
html:not(.rh-intro-done) .lib-head > .sg-link{animation-delay:2.5s;}
@keyframes rhIntroUp{from{opacity:0; transform:translateY(34px);}}
@keyframes rhIntroFade{from{opacity:0;}}
.rh-intro-done #library > :is(.lib-head,#libTabs,#shelves),
.ae-reduced-motion #library > :is(.lib-head,#libTabs,#shelves){animation:none;}
/* the first stories fly from the hollow to their places (--fx/--fy = from the hollow, --rh-d = their turn) */
#shelves .cards > .card.art-card.rh-fly{animation:rhFly 1.8s cubic-bezier(.16,.84,.3,1) var(--rh-d,0ms) backwards; transform-origin:50% 60%;}
@keyframes rhFly{
  0%{opacity:0; transform:translate(var(--fx,0),var(--fy,0)) scale(.1) rotate(-14deg);}
  16%{opacity:1;}
  68%{transform:translate(0,-7px) scale(1.035) rotate(.7deg);}
  86%{transform:translate(0,1px) scale(.995) rotate(-.2deg);}
}
/* a warm glow swells in the hollow just before the stories come out */
#rhHollow .rh-nook{position:absolute; width:340px; height:340px; margin:-170px 0 0 -170px; border-radius:50%; opacity:0;
  background:radial-gradient(circle,#fff0c2b0 0,#f7c062 18%,#f0a8486b 34%,#e0903a00 68%);
  animation:rhNook 2.8s ease-out backwards;}
@keyframes rhNook{0%{opacity:0; transform:scale(.25);} 30%{opacity:.95; transform:scale(1);} 100%{opacity:0; transform:scale(1.6);}}

/* ===== "Into the hollow" scroll scene (theme/hollow-scroll.js, 2026-11-17). Everything sits behind the library at
   z-index -1 (like #rhBg), so nothing covers a word; it moves only with transform and opacity. ===== */
#rhHollow{position:fixed; inset:0; z-index:-1; pointer-events:none; overflow:hidden;}
#rhHollow[hidden],body.reading #rhHollow,body.playing #rhHollow{display:none;}
#rhHollow .rh-layer{position:absolute; left:0; right:0; top:0; will-change:transform;}
/* The still and the clip are both a little taller than the screen (same box, so they line up exactly); the clip's
   slow climb in hollow-scroll.js then never shows an edge. */
body::before,#rhBg,#rhWizard,#rhFriends{bottom:-9vh;}
#rhHollow .rh-warm{position:absolute; left:0; right:0; top:0; height:62vh;
  background:radial-gradient(ellipse 75% 65% at 50% 0%,#f0b65a24,transparent 70%);}
#rhHollow .rh-deep{position:absolute; left:0; right:0; bottom:0; height:75vh; opacity:0;
  background:radial-gradient(ellipse 85% 70% at 50% 100%,#2fb39a2e,transparent 70%),linear-gradient(transparent,#08120e66);}
#rhHollow .rh-tile{position:absolute; left:0; right:0;}
#rhHollow .rh-m{position:absolute; border-radius:50%; opacity:.25;
  background:radial-gradient(circle,#fff1c4 0 16%,#f5c46a99 32%,#f5c46a00 68%); animation:rhMote var(--d,5s) ease-in-out var(--dl,0s) infinite;}
#rhHollow .rh-m.t{background:radial-gradient(circle,#e6fff6 0 16%,#7ee0c799 32%,#7ee0c700 68%);}
@keyframes rhMote{50%{opacity:.95; transform:translate3d(4px,-7px,0);}}
#rhHollow .rh-b{position:absolute; border-radius:50%; background:radial-gradient(circle,#f3c77a 0,#f3c77a00 70%);}
#rhHollow .rh-b.t{background:radial-gradient(circle,#6fd6bd 0,#6fd6bd00 70%);}
/* stories step out of the tree as they come into view; shelf signs swing in on their branch */
.rh-hollow .cards > .card.art-card{animation:none;}
.rh-hollow .cards > .card.art-card.rh-wait,.rh-hollow .coll-title.rh-wait{opacity:0;}
.rh-hollow .cards > .card.art-card.rh-in{animation:rhStepOut .75s cubic-bezier(.2,.8,.25,1) calc(var(--rh-i,0) * 75ms) backwards; transform-origin:50% 100%;}
@keyframes rhStepOut{0%{opacity:0; transform:translateY(34px) scale(.88);} 55%{opacity:1; transform:translateY(-5px) scale(1.02);} 78%{transform:translateY(1px) scale(.996);}}
.rh-hollow .cards > .card.art-card.rh-in:not(.busy)::after,#shelves .cards > .card.art-card.rh-fly:not(.busy)::after{
  content:""; position:absolute; inset:0; z-index:4; pointer-events:none; border-radius:inherit; opacity:0;
  background:radial-gradient(ellipse 95% 75% at 50% 100%,#ffd58a70,#ffd58a00 72%);
  animation:rhLantern 1.1s ease-out calc(var(--rh-i,0) * 75ms + 200ms) backwards;}
#shelves .cards > .card.art-card.rh-fly:not(.busy)::after{animation-delay:calc(var(--rh-d,0ms) + 950ms);}
@keyframes rhLantern{0%{opacity:0;} 35%{opacity:1;} 100%{opacity:0;}}
.rh-hollow .coll-title.rh-in{animation:rhSign .9s cubic-bezier(.3,.7,.3,1) calc(var(--rh-i,0) * 75ms) backwards; transform-origin:50% -30px;}
@keyframes rhSign{0%{opacity:0; transform:translateY(-14px) rotate(-1.4deg);} 45%{opacity:1; transform:rotate(.8deg);} 72%{transform:rotate(-.3deg);}}
@media(prefers-reduced-motion:reduce){ #rhHollow{display:none;} }
.ae-reduced-motion #rhHollow{display:none;}
/* Past the last shelf (hollow-scroll.js addEnd): about a screen of open space so the Hollow painting shows on its own,
   then a small lantern-gold button back up to the stories. */
#rhEnd{height:88vh; min-height:420px; display:flex; align-items:flex-end; justify-content:center; padding-bottom:calc(84px + env(safe-area-inset-bottom,0px));}
#rhEnd .rh-up{font:700 15px/1 var(--sg-ui); color:#332415; padding:12px 18px; min-height:44px; border-radius:999px;
  background:linear-gradient(#f5d58c,#d9a344); border:2px solid #ffdd94; box-shadow:0 0 20px #e6b25555,0 6px 15px #080d0a77; opacity:.92;}
#rhEnd .rh-up:hover{opacity:1;}
#rhEnd .rh-up:focus-visible{outline:3px solid #f1ce7c; outline-offset:3px;}
body.reading #rhEnd,body.playing #rhEnd{display:none;}

/* ===== The Hollow Wizard in the hollow of the painted tree (theme/hollow-wizard.js, 2026-11-19; Jesse: "put him inside
   the tree already in the Hallow background"). #rhWizard shares the painting's box (the -9vh rule above), sits just over
   the still and the clip and under the scroll scene's light, behind the library: never over a card or a word, never
   takes a pointer. The seat is placed in px on the painting by the script; .rh-wiz-ao is his soft shadow on the quilt
   and a little shade on the pillows behind him, so he sits IN the nook. ===== */
#rhWizard{position:fixed; inset:0 0 -9vh; z-index:-1; pointer-events:none; overflow:hidden; opacity:0; transition:opacity 1.1s ease;}
#rhWizard.on{opacity:1;}
#rhWizard .rh-wiz-seat{position:absolute; left:0; top:0; width:0; height:0;}
#rhWizard .rh-wiz-ao{position:absolute; left:0; top:0; width:100%; height:100%;
  background:radial-gradient(ellipse 40% 7% at 56% 91%,#0a0603b3,#0a060300 100%),
    radial-gradient(ellipse 34% 40% at 50% 62%,#0a06034d,#0a060300 100%);}
body.reading #rhWizard,body.playing #rhWizard{display:none;}

/* ★★★ GOLD BOOKS (Jesse 2026-11-18: "once student gets 3 stars on a book, I want them to glow and shimmer").
   A card whose star row reads "3 of 3 stars" (starHTML in index.html) gets a warm gold rim and halo, a slow breathing glow,
   a light sweep across the cover every few seconds and shimmering gold stars. CSS only: the card markup is untouched.
   ::before is free on a card except while it is .busy (the loading veil), and ::after belongs to the hollow's lantern flash.
   Each card starts its sweep at a different moment, so a shelf of gold books never flashes in step.
   Reduced motion: the rule above (*::before animation:none) leaves the gold rim and halo, still. */
.card:has(.card-foot .stars-earned[aria-label^="3 of 3"]){
  border-color:#e9c36f;
  box-shadow:0 0 0 1px #ffe2a077,0 0 26px #f6c86a8c,0 0 56px #f2c25e44,0 14px 34px rgba(0,0,0,.45);}
.card.art-card:has(.card-foot .stars-earned[aria-label^="3 of 3"]){border:2px solid #e9c36f;}
@media(hover:hover){
  .card:has(.card-foot .stars-earned[aria-label^="3 of 3"]):hover{border-color:#ffe09a;
    box-shadow:0 0 0 1px #ffe2a088,0 0 28px #f6cb6a88,0 0 60px #f2c25e44,0 20px 34px rgba(0,0,0,.45);}}
.card:has(.card-foot .stars-earned[aria-label^="3 of 3"]):not(.busy)::before{
  content:""; position:absolute; inset:0; z-index:2; pointer-events:none; border-radius:inherit;
  box-shadow:inset 0 0 0 1px #fff0c477,inset 0 0 26px #f6c86a80;
  background:
    radial-gradient(circle at 14% 18%,#fff6dc 0 1.2px,#fff6dc00 2.6px),
    radial-gradient(circle at 84% 12%,#fff6dc 0 1.4px,#fff6dc00 3px),
    radial-gradient(circle at 90% 62%,#fff6dc 0 1px,#fff6dc00 2.4px),
    radial-gradient(circle at 22% 70%,#fff6dc 0 1px,#fff6dc00 2.2px),
    linear-gradient(112deg,#ffe9b300 38%,#ffe9b35c 47%,#fffaf0a8 50%,#ffe9b35c 53%,#ffe9b300 62%);
  background-size:100% 100%,100% 100%,100% 100%,100% 100%,280% 100%;
  background-repeat:no-repeat;
  background-position:0 0,0 0,0 0,0 0,135% 0;
  mix-blend-mode:screen;
  animation:rhGoldSweep 7.5s cubic-bezier(.45,.05,.35,1) infinite,rhGoldBreath 3.6s ease-in-out infinite alternate;
  animation-delay:calc(var(--rh-gold,0) * -1.9s),calc(var(--rh-gold,0) * -0.7s);}
.cards > .card:nth-child(3n+2){--rh-gold:1;} .cards > .card:nth-child(3n){--rh-gold:2.3;} .cards > .card:nth-child(4n+3){--rh-gold:3.1;}
@keyframes rhGoldSweep{
  0%,58%{background-position:0 0,0 0,0 0,0 0,135% 0;}
  80%,100%{background-position:0 0,0 0,0 0,0 0,-35% 0;}}
@keyframes rhGoldBreath{from{opacity:.62;} to{opacity:1;}}
.card:has(.card-foot .stars-earned[aria-label^="3 of 3"]) .card-foot .stars-earned{
  background:linear-gradient(100deg,#f3c45a 0 35%,#fff7d6 48%,#f3c45a 62% 100%); background-size:300% 100%;
  -webkit-background-clip:text; background-clip:text; color:transparent; -webkit-text-fill-color:transparent;
  filter:drop-shadow(0 0 6px #ffcf6aa8); animation:rhGoldStars 3.8s ease-in-out infinite;}
.card:has(.card-foot .stars-earned[aria-label^="3 of 3"]) .card-foot .stars-earned span{color:inherit; text-shadow:none; opacity:1;}
@keyframes rhGoldStars{0%,30%{background-position:100% 0;} 70%,100%{background-position:0 0;}}
.ae-reduced-motion .card:has(.card-foot .stars-earned[aria-label^="3 of 3"])::before,
.ae-reduced-motion .card:has(.card-foot .stars-earned[aria-label^="3 of 3"]) .card-foot .stars-earned{animation:none;}

/* ===== MENU POLISH (Jesse 2026-11-19: "lets polish the menus a little bit more"). Every sheet shares one shape and rhythm:
   28 px corners, a lantern-gold hairline, a display-font header, 48 px buttons and 44 px links, a gold focus ring. Sheets rise in
   and fade out (index.html sheetMotion adds .closing for 0.2 s); reduced motion keeps them still (the rule above). ===== */
.overlay{background:#030c08b8; -webkit-backdrop-filter:blur(4px); backdrop-filter:blur(4px);}
.overlay.show{animation:rhVeilIn .22s ease both;}
.overlay.show > .sheet{animation:rhSheetIn .32s var(--ease-out) both;}
.overlay.closing{display:flex; pointer-events:none; animation:rhVeilOut .2s ease forwards;}
.overlay.closing > .sheet{animation:rhSheetOut .2s ease forwards;}
@keyframes rhVeilIn{from{opacity:0;}}
@keyframes rhVeilOut{to{opacity:0;}}
@keyframes rhSheetIn{from{opacity:0; transform:translateY(16px) scale(.97);}}
@keyframes rhSheetOut{to{opacity:0; transform:translateY(10px) scale(.985);}}
.sheet{border-radius:28px; padding:28px 24px 22px; border:1px solid var(--sheet-edge);
  box-shadow:inset 0 1px 0 #ffe7b024,0 0 0 1px #00000066,0 24px 64px #000000a6,0 0 46px #e6b25512;}
.sheet h2{font-family:var(--sg-display); font-weight:800; font-size:1.6rem; line-height:1.15; letter-spacing:.005em; color:#f7d38d; margin:0 0 6px;}
.sheet .sub{color:var(--ink-soft); font-size:.98rem; line-height:1.45; margin:0 0 18px;}
.sheet-badge{width:56px; height:56px; margin:0 auto 12px; border-radius:18px; display:grid; place-items:center; font-size:28px; color:#332415;
  background:linear-gradient(#f5d58c,#d9a344); border:1px solid #ffdd94; box-shadow:0 0 24px #e6b25555,inset 0 1px 0 #ffffff55;}
.sheet-badge .i{stroke-width:2;}
.sheet-sec{margin:22px 0 8px; font:700 12px/1.2 var(--sg-ui); letter-spacing:.16em; text-transform:uppercase; color:#f0cf8a; text-align:left;}
.sheetbtn{min-height:48px; padding:12px 26px; border-radius:999px; font-family:var(--sg-ui); font-weight:800; line-height:1.15;
  display:inline-flex; align-items:center; justify-content:center; gap:8px; transition:transform .12s ease,filter .12s ease;}
.sheetbtn:hover{filter:brightness(1.06);}
.sheetbtn:active{transform:scale(.97);}
.sheetbtn.ghost:hover{border-color:#f1c77c99;}
.linkbtn{min-height:44px; display:flex; align-items:center; justify-content:center; gap:7px; border-radius:999px; padding:8px 14px; font-family:var(--sg-ui);}
.linkbtn:hover{background:#ffffff0d;}
.sheet .modebtn:not(#modeOverlay .modebtn){min-height:64px; border-radius:20px; background:#133424; border:1px solid #3d7b5899;}
.sheet .modebtn:not(#modeOverlay .modebtn):hover:not([disabled]){border-color:#f1c77c99; box-shadow:0 8px 22px #00000066;}
.facts li{border-top-color:#3d7b5859;}
.facts li > span:first-child{flex:none; width:1.6em; text-align:center;}
:is(.sheet,.sg-pop,.topbar,.bottombar) :is(button,a,select,textarea):focus-visible{outline:3px solid #ffdd94; outline-offset:3px;}
.md-steps li{background:#0b2318; border-color:#3d7b58;}
.md-meter{background:#0b2318; box-shadow:inset 0 0 0 1px #3d7b58;}
.md-meter i{background:linear-gradient(90deg,#1f844b,#7bd59c);}
#doneOverlay .sheet h2{font-size:1.85rem;}
#doneOverlay .bigstars{color:#ffd18a; text-shadow:0 0 18px #ffcf6a99;}
#doneOverlay .sheetbtn{margin:8px 5px 0;}
.ask-c{background:#133424; border-color:#3d7b5899;}
.ask-c:hover{border-color:#f1c77c99;}
.ask-hear,.wc-btn{background:#133424; border-color:#3d7b58;}
.wordcard{border-color:#f1c77c59; box-shadow:0 18px 50px #000000b3,inset 0 1px 0 #ffe7b01f;}
.pcheck{border-color:#f1c77c99;}
/* HARD PASS pill: lantern gold, so it reads as help, never as an error */
#pageArea .skip-word{background:#fff1cf; color:#4a3000; border-color:#c9902e;}
#pageArea .skip-word:focus-visible{outline:3px solid #1a6138; outline-offset:2px;}

/* ===== READER TOP BAR: Aa (book text) and the listener chip. Every control is a 44 px target. ===== */
.topbar .tb-pic,.topbar .tb-help{min-height:44px;}
.topbar .tb-help{width:44px; height:44px;}
.topbar .back{min-height:44px;}
.tb-aa{width:44px; padding:0; display:grid; place-items:center; font:800 19px/1 var(--sg-display); color:var(--ink); background:#133424; border-color:#3d7b58;}
.tb-aa small{font-size:.74em;}
.tb-aa.on{color:#332415; background:linear-gradient(#f5d58c,#d9a344); border-color:#ffdd94;}   /* not the normal size: it shows */
.tb-aa[aria-expanded="true"],.tb-ears[aria-expanded="true"]{box-shadow:0 0 0 3px #f1c77c55;}
.tb-ears{display:inline-flex; align-items:center; gap:6px; max-width:13.5em; padding:0 11px 0 10px; font:800 .84rem/1 var(--sg-ui); color:var(--ink);
  background:#133424; border:1px solid #3d7b58;}
.tb-ears .i{font-size:17px; color:var(--pine-mint);}
.tb-ears .tb-chev{font-size:13px; color:var(--ink-soft);}
.tb-ears-name{min-width:0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
.tb-ears.fallback{border-color:#f1c77c99;}
.tb-ears.fallback .i:first-child{color:#ffd18a;}
.tb-ears:hover,.tb-aa:not(.on):hover{border-color:#f1c77c99;}
#modeOverlay .ears-link .tb-chev{font-size:14px; color:var(--ink-soft);}
/* the reading-speed switch says its state in words under the 🐇 / 🐢 */
#speedBtn{position:relative;}
#speedBtn::after{content:attr(data-speed); position:absolute; left:50%; top:calc(100% + 4px); transform:translateX(-50%);
  font:800 10.5px/1 var(--sg-ui); letter-spacing:.03em; color:var(--ink-soft); white-space:nowrap; pointer-events:none;}
@media(max-width:640px) and (min-width:1px){
  #reader .topbar{column-gap:6px;}
  #textThemeReader{display:none;}                                   /* phones: Light/Dark lives in the Aa popover */
  /* the page number rides on the title's line, so the controls keep one row and the words keep their room */
  #reader .topbar .ttl{flex:1 1 calc(100% - 66px); min-width:0;}
  #reader .topbar .pageno{order:10; margin-left:0; min-width:0; text-align:right;}
  .tb-ears{max-width:9.5em; padding:0 9px;}
  .tb-ears .tb-chev{display:none;}
}
@media(max-width:399px) and (min-width:1px){
  .tb-ears{padding:0 8px; gap:4px; font-size:.78rem; max-width:8.2em;}
}

/* ===== ONE-TAP POPOVERS: the listener switch (#earsPop) and Book text (#sizePop). A clear scrim takes the outside tap. ===== */
.sg-scrim{position:fixed; inset:0; z-index:94; background:transparent;}
.sg-pop{position:fixed; z-index:95; left:12px; top:12px; box-sizing:border-box; overflow:auto; overscroll-behavior:contain; padding:14px;
  border-radius:22px; color:var(--ink); font-family:var(--sg-ui); text-align:left;
  background:linear-gradient(180deg,#1d4b33,#0e2b1d); border:1px solid #f1c77c59;
  box-shadow:0 18px 50px #000000b8,0 0 0 1px #00000073,inset 0 1px 0 #ffe7b01f;}
.sg-pop.in{animation:rhPopIn .2s var(--ease-out) both; transform-origin:var(--pop-x,50%) 0;}
.sg-pop.above.in{transform-origin:var(--pop-x,50%) 100%;}
@keyframes rhPopIn{from{opacity:0; transform:translateY(-6px) scale(.96);}}
.sg-pop.above.in{animation-name:rhPopUp;}
@keyframes rhPopUp{from{opacity:0; transform:translateY(6px) scale(.96);}}
.sg-pop-h{display:flex; flex-direction:column; gap:3px; padding:2px 4px 10px; margin-bottom:10px; border-bottom:1px solid #3d7b5873;}
.sg-pop-h b{font:800 1.15rem/1.2 var(--sg-display); color:#f7d38d;}
.sg-pop-now{font:700 .8rem/1.3 var(--sg-ui); color:var(--ink-soft);}
.sg-pop-list{display:grid; gap:6px;}
.ears-pick{display:flex; align-items:center; gap:10px; width:100%; min-height:58px; padding:8px 10px; border-radius:16px; text-align:left;
  color:var(--ink); background:#133424; border:1px solid #3d7b5880; transition:border-color .15s,background-color .15s,transform .1s;}
.ears-pick:hover:not([disabled]){border-color:#f1c77c99; background:#174029;}
.ears-pick:active:not([disabled]){transform:scale(.985);}
.ears-pick.on,.ears-opt.on{border:2px solid #f1c77c; background:linear-gradient(180deg,#24583b,#163f29); box-shadow:0 0 0 3px #f1c77c26,0 0 18px #e6b25526;}
.ears-pick[disabled],.ears-opt[disabled]{opacity:.62; cursor:not-allowed;}
.ep-ic,.ears-opt .ic{flex:none; display:grid; place-items:center; border-radius:12px; background:#0b2318; border:1px solid #3d7b5866;}
.ep-ic{width:38px; height:38px; font-size:18px;}
.ears-pick.on .ep-ic,.ears-opt.on .ic{background:linear-gradient(#f5d58c,#d9a344); border-color:#ffdd94;}
.ep-tx{flex:1; min-width:0; display:flex; flex-direction:column; gap:2px;}
.ep-tx b{display:flex; align-items:center; gap:6px; font:800 .98rem/1.2 var(--sg-ui);}
.ep-tx small{font:600 .78rem/1.3 var(--sg-ui); color:var(--ink-soft);}
.ears-pick[disabled] .ep-tx small{color:#ffd9a3;}
.ep-st,.eo-st{flex:none; font:800 .8rem/1 var(--sg-ui); color:#ffdd94; white-space:nowrap;}
.new-tag{display:inline-block; padding:2px 7px; border-radius:999px; font:900 .6rem/1.25 var(--sg-ui); letter-spacing:.08em; text-transform:uppercase;
  color:#332415; background:linear-gradient(#f5d58c,#d9a344); vertical-align:middle;}
.ep-more,.ears-more{display:flex; align-items:center; justify-content:center; gap:4px; width:100%; min-height:44px; border-radius:12px;
  font:700 .86rem/1 var(--sg-ui); color:var(--ink-soft);}
.ears-more::after{content:""; width:8px; height:8px; margin-left:4px; border-right:2px solid currentColor; border-bottom:2px solid currentColor; transform:translateY(-2px) rotate(45deg); transition:transform .15s;}
.ears-more[aria-expanded="true"]::after,.ep-more[aria-expanded="true"] .i{transform:rotate(-135deg);}
.ep-more .i{font-size:15px; transition:transform .15s;}
.ep-more:hover,.ears-more:hover{color:var(--ink); background:#ffffff0a;}
.sg-pop-link{display:flex; align-items:center; justify-content:center; gap:5px; width:100%; min-height:44px; margin-top:8px; border-radius:999px;
  font:700 .86rem/1.2 var(--sg-ui); color:var(--pine-mint); background:#0b231880; border:1px solid #3d7b5899;}
.sg-pop-link:hover:not([disabled]){border-color:#f1c77c99; color:var(--ink);}
.sg-pop-link[disabled]{cursor:default; color:#ffdd94; border-color:#f1c77c55;}
.sg-pop-row{display:flex; align-items:center; justify-content:space-between; gap:12px; margin-top:12px; padding-top:12px; border-top:1px solid #3d7b5873; font-weight:800;}
.sg-pop-row .tb-pic{min-height:44px;}
.sg-pop-keys{margin:10px 2px 0; font:600 .76rem/1.4 var(--sg-ui); color:var(--ink-soft);}
/* Book text: A− · five sizes (smaller left, bigger right) · A+ */
.size-row{display:flex; align-items:center; gap:8px;}
.size-btn{flex:none; width:48px; height:48px; border-radius:14px; font:800 15px/1 var(--sg-display); color:var(--ink); background:#133424; border:1px solid #3d7b58;}
.size-btn.up{font-size:21px;}
.size-btn:hover:not([disabled]){border-color:#f1c77c99;}
.size-btn:active:not([disabled]){transform:scale(.94);}
.size-btn[disabled]{opacity:.4; cursor:default;}
.size-steps{flex:1; min-width:0; display:flex; align-items:stretch; justify-content:space-between; gap:3px;}
.size-step{position:relative; flex:1; min-width:30px; height:48px; display:grid; place-items:end center; padding-bottom:10px; border-radius:12px;
  font-family:var(--sg-display); font-weight:800; color:var(--ink-soft); border:1px solid transparent;}
.size-step:hover{border-color:#3d7b58;}
.size-step .ss-a{line-height:1;}
.size-step .ss-ck{display:none; position:absolute; top:3px; right:4px; font:900 10px/1 var(--sg-ui);}
.size-step.on{color:#332415; background:linear-gradient(#f5d58c,#d9a344); border-color:#ffdd94; box-shadow:0 0 14px #e6b25555;}
.size-step.on .ss-ck{display:block;}
/* book text at every size: a word longer than the line may break inside its own span rather than run off the page */
#pageArea .word{max-width:100%; overflow-wrap:anywhere;}

/* ===== LISTENING SETTINGS sheet: a radio list (state in words + ✓), This device under More, the mic, the Safari tip. ===== */
#earsOverlay .sheet{max-width:470px;}
.ears-now-line{margin:-8px 0 14px; font:700 .9rem/1.4 var(--sg-ui); color:var(--ink-soft);}
.ears-now-chip{display:inline-block; margin-left:4px; padding:4px 11px; border-radius:999px; color:var(--ink); background:#0b2318; border:1px solid #3d7b58;}
.ears-list{display:grid; gap:8px; text-align:left;}
.ears-list .ears-opt{margin:0; min-height:70px; gap:12px; padding:12px 14px;}
.ears-opt .ic{width:44px; height:44px; font-size:21px;}
.eo-tx{flex:1; min-width:0; display:flex; flex-direction:column; gap:3px;}
.eo-tx b{display:flex; align-items:center; gap:8px; color:var(--ink);}
.ears-opt .eo-sub{font-size:.85rem; line-height:1.35; color:var(--ink-soft);}
#earsMoreBox{display:grid;} #earsMoreBox[hidden]{display:none;}
.ears-mic{background:#0b2318; border-color:#3d7b58; color:var(--ink);}
.ears-safari{margin:12px 0 0; padding:9px 12px; border-radius:12px; text-align:left; background:#f1c77c14; border:1px solid #f1c77c40; opacity:1;}
#earsNoteBtn{color:var(--pine-mint);}
#micOverlay .facts{text-align:left;}
#rulesOverlay #rulesClose{display:flex; margin:16px auto 0;}
/* the keys list in How it works: one row per command, every key on it */
.rl-keys{border-top:1px solid #3d7b5859;}
.rl .keys-table td{text-align:left; vertical-align:middle; padding:6px; border-bottom:1px solid #3d7b5840;}
.rl .keys-table td:first-child{white-space:nowrap; width:1%; color:var(--ink-soft);}
kbd{display:inline-block; min-width:1.9em; padding:3px 7px; border-radius:7px; font:800 .8rem/1.2 var(--sg-ui); text-align:center; color:var(--ink);
  background:#0b2318; border:1px solid #3d7b58; box-shadow:inset 0 -2px 0 #00000066;}
.ae-reduced-motion :is(.overlay,.overlay > .sheet,.sg-pop){animation:none !important;}

/* ===== Hollow Friends (theme/hollow-friends.js, 2026-11-20): characters from finished books living in the painting.
   #rhFriends shares the painting's box (the -9vh rule above) and sits behind the library like the painting, so a friend
   never covers a word or takes a pointer; each .rh-friend is placed in px on the painting by the script. The bubble is
   the one thing that rises above the page, only after a tap on the friend, only where it covers nothing (the script
   checks), and it goes away on any other tap, Esc or scroll. ===== */
#rhFriends{position:fixed; inset:0 0 -9vh; z-index:-1; pointer-events:none; overflow:hidden;}
#rhFriends .rh-friend{position:absolute; left:0; top:0; width:0; height:0; opacity:0; transition:opacity 1.1s ease;}
#rhFriends .rh-friend.on{opacity:1;}
body.reading #rhFriends,body.playing #rhFriends,body.reading .rh-friend-bubble,body.playing .rh-friend-bubble{display:none;}
.rh-friend-bubble{position:fixed; z-index:40; display:flex; flex-direction:column; align-items:center; gap:1px; min-height:44px;
  padding:7px 14px 8px; border-radius:16px; border:2px solid #f1cf86; background:linear-gradient(#fff6dc,#f3dfae); color:#3a2814;
  font:800 14px/1.15 var(--sg-ui); box-shadow:0 0 18px #f1c77c55,0 8px 18px #08100c88; cursor:pointer;
  opacity:0; transform:translateY(6px) scale(.86); transform-origin:50% 100%; transition:opacity .22s ease,transform .32s cubic-bezier(.2,1.4,.4,1);}
.rh-friend-bubble.below{transform-origin:50% 0;}
.rh-friend-bubble.show{opacity:1; transform:none;}
.rh-friend-bubble .rh-fb-t{font:700 11.5px/1.15 var(--sg-ui); color:#7a5523;}
.rh-friend-bubble::after{content:""; position:absolute; left:50%; bottom:-8px; width:14px; height:14px; margin-left:-7px; transform:rotate(45deg);
  background:#f3dfae; border-right:2px solid #f1cf86; border-bottom:2px solid #f1cf86;}
.rh-friend-bubble.below::after{bottom:auto; top:-8px; transform:rotate(225deg); background:#fff6dc;}
.rh-friend-bubble:focus-visible{outline:3px solid #f1ce7c; outline-offset:3px;}
@media(hover:hover){.rh-friend-bubble:hover{background:linear-gradient(#fffaea,#f6e4b8);}}

