/* reader.css — full-screen picture-book reader for /geroi/<hero>/ (no page scroll, fixed boxes, nothing jumps between pages) */
html.reading,html.reading body{height:100%;overflow:hidden;margin:0;overscroll-behavior:none}
.reader{position:fixed;inset:0;height:100vh;height:100dvh;display:grid;grid-template-rows:auto 1fr auto;background:linear-gradient(180deg,#e9f6ff,#fffaf2);
  padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);box-sizing:border-box;color:#2b1d4a;
  font-family:"Andika","Nunito",ui-rounded,system-ui,sans-serif;-webkit-user-select:none;user-select:none;touch-action:pan-y}
.rtop{display:flex;align-items:center;gap:8px;padding:8px 10px}
.rtop a,.rtop button{flex:none;min-width:52px;height:52px;border-radius:16px;border:0;background:#fff;box-shadow:0 3px 0 rgba(0,0,0,.1);display:flex;align-items:center;justify-content:center;
  font-size:24px;text-decoration:none;color:#2b1d4a;cursor:pointer}
.rtop h1{flex:1;min-width:0;margin:0;font-family:"Nunito",sans-serif;font-weight:900;font-size:clamp(17px,4.4vw,26px);text-align:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.rstage{position:relative;min-height:0;margin:0 10px}
.rpage{position:absolute;inset:0;display:grid;grid-template-rows:68% 32%;gap:0;opacity:0;visibility:hidden;transition:opacity .35s ease,transform .35s ease;transform:translateX(18px)}
.rpage.on{opacity:1;visibility:visible;transform:none}
.rpage.prev{transform:translateX(-18px)}
.rimg{min-height:0;display:flex;align-items:center;justify-content:center;background:#fff;border-radius:24px;border:5px solid var(--c,#ffc928);overflow:hidden}
.rimg img{width:100%;height:100%;object-fit:contain;display:block}
.rtext{min-height:0;display:flex;align-items:center;justify-content:center;text-align:center;padding:8px 6px;overflow:hidden}
.rtext p{margin:0;font-weight:700;line-height:1.38;font-size:clamp(20px,5.8vw,34px)}
.rend .rtext{flex-direction:column;gap:8px}
.rend .btns2{display:flex;flex-wrap:wrap;gap:8px;justify-content:center}
.rend .btns2 a,.rend .btns2 button{min-height:54px;padding:0 16px;border-radius:999px;border:0;font-family:"Nunito",sans-serif;font-weight:900;font-size:18px;display:inline-flex;align-items:center;
  text-decoration:none;color:#fff;background:#8a5cff;box-shadow:0 4px 0 rgba(0,0,0,.15);cursor:pointer}
.rend .btns2 .b-again{background:#ff8a1f}.rend .btns2 .b-home{background:#3d8bff}
.rnav{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:10px;padding:8px 12px 10px}
.rnav button{width:78px;height:78px;border-radius:50%;border:0;background:#ff8a1f;color:#fff;font-size:36px;box-shadow:0 5px 0 rgba(0,0,0,.15);cursor:pointer}
.rnav button:disabled{opacity:.3}
.rcount{text-align:center;font-family:"Nunito",sans-serif;font-weight:900;font-size:20px}
.rdots{display:flex;gap:7px;justify-content:center;margin-top:4px}.rdots i{width:12px;height:12px;border-radius:50%;background:#e2d8f6}.rdots i.on{background:#8a5cff}
/* landscape phone/tablet: picture left, text right */
@media (orientation:landscape) and (min-aspect-ratio:5/4){
  .rpage{grid-template-rows:none;grid-template-columns:58% 42%}
  .rtext{padding:8px 14px}.rtext p{font-size:clamp(18px,3.2vw,34px)}
  .rnav button{width:64px;height:64px;font-size:30px}
}
@media (max-height:520px){.rtop{padding:4px 8px}.rtop a,.rtop button{height:44px;min-width:44px;font-size:20px}.rnav{padding:4px 10px 6px}.rnav button{width:56px;height:56px;font-size:26px}.rcount{font-size:16px}}
@media(prefers-reduced-motion:reduce){.rpage{transition:none}}
@media (orientation:landscape) and (min-aspect-ratio:5/4){.rpage{grid-template-rows:100%}.rend{grid-template-columns:38% 62%}}
.rend{grid-template-rows:34% 66%}
.rend .rtext p{font-size:clamp(22px,6vw,34px)}
.rend .btns2{flex-direction:column;align-items:center;gap:8px}
.rend .btns2 a,.rend .btns2 button{min-height:50px;font-size:17px;min-width:220px;justify-content:center}
@media (orientation:landscape) and (min-aspect-ratio:5/4){.rend{grid-template-rows:100%}}
@media (max-height:560px){.rend .btns2{flex-direction:row;flex-wrap:wrap}.rend .btns2 a,.rend .btns2 button{min-width:0;min-height:46px;font-size:15px;padding:0 12px}.rend .rtext p{font-size:22px}}
/* long story with chapters (.reader.long, skazka.py): picture on top + text below; text pages fill the stage */
.long .rpage{padding:0;grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,3fr) minmax(0,2fr)}
.long .rtxt{grid-template-rows:minmax(0,1fr)}
.long .rend{grid-template-rows:minmax(0,1fr) minmax(0,2fr)}
.long .rnav>div{min-width:0}
.long .rdots{gap:2px}.long .rdots i{flex:1;min-width:0;width:auto;height:7px;border-radius:4px}
.long .rtext.flow{display:flex;flex-direction:column;align-items:stretch;justify-content:flex-start;text-align:left;width:100%;max-width:36em;margin:0 auto;box-sizing:border-box;
  padding:6px 8px;font-weight:600;line-height:1.42;font-size:clamp(19px,min(5.4vw,3.3vh),34px)}
.long .rtext.flow>:first-child{margin-top:auto}.long .rtext.flow>:last-child{margin-bottom:auto}
.long .rtext.flow p{font-size:1em;font-weight:600;line-height:1.42;margin:0 0 .5em}
.long .rtext.flow p:last-child{margin-bottom:0}
.long .rtext.flow p.fin{text-align:center;font-weight:900;font-family:"Nunito",sans-serif;font-size:1.25em;margin-top:.3em}
.long .rpic .rtext.flow{font-size:clamp(18px,min(5vw,2.9vh),30px)}
.long .rchap .rtext,.long .rcover .rtext{flex-direction:column;gap:2px}
.long .rchap .rtext span{font-family:"Nunito",sans-serif;font-weight:900;font-size:clamp(18px,2.6vh,28px);color:#8a5cff;text-transform:uppercase;letter-spacing:.06em}
.long .rchap h2,.long .rcover h2{margin:0;font-family:"Nunito",sans-serif;font-weight:900;font-size:clamp(26px,min(7.4vw,5.2vh),56px);line-height:1.12}
.long .rcover .rtext p{font-size:clamp(18px,2.6vh,26px);font-weight:700;color:#8a5cff}
.long .rlist h2{margin:0 0 .4em;font-family:"Nunito",sans-serif;font-weight:900;font-size:1.2em;text-align:center}
.long .rlist ul,.long .rlist ol{margin:0;padding-left:1.3em}.long .rlist li{margin:0 0 .45em;line-height:1.38}
.long .rsong .rtext{flex-direction:column}
.long .rsong{grid-template-rows:minmax(0,1fr) minmax(0,1fr)}
.b-song{display:flex;flex-direction:column;align-items:center;gap:4px;min-height:88px;max-width:92%;box-sizing:border-box;padding:10px 22px;text-align:center;border:0;border-radius:32px;cursor:pointer;
  background:linear-gradient(180deg,#ff6f91,#ff4f6d);color:#fff;font-family:"Nunito",sans-serif;box-shadow:0 6px 0 rgba(0,0,0,.18);animation:bsong 2.4s ease-in-out infinite}
.b-song b{font-size:clamp(24px,min(6.6vw,4.4vh),40px);font-weight:900}.b-song span{font-size:clamp(17px,min(4.6vw,3vh),26px);font-weight:800;opacity:.95}
.b-song:active{transform:translateY(3px);box-shadow:0 3px 0 rgba(0,0,0,.18)}
@keyframes bsong{0%,100%{transform:scale(1)}50%{transform:scale(1.04)}}
@media(prefers-reduced-motion:reduce){.b-song{animation:none}}
/* phone held sideways: picture left, text right */
@media (orientation:landscape) and (max-height:560px){
  .long .rpage{grid-template-rows:minmax(0,1fr);grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
  .long .rtxt{grid-template-columns:minmax(0,1fr)}
  .long .rend{grid-template-columns:minmax(0,2fr) minmax(0,3fr)}
  .long .rtext.flow{font-size:clamp(16px,4.4vh,22px);max-width:44em}
  .long .rpic .rtext.flow{font-size:clamp(15px,4vh,20px)}
  .b-song{min-height:72px;padding:8px 18px}.b-song b{font-size:22px}.b-song span{font-size:16px}
  /* arrows at the sides, page number under the top bar: the text gets the whole height */
  .long .rstage{margin:0 70px 18px}
  .long .rnav{position:absolute;left:0;right:0;top:48px;bottom:0;display:flex;justify-content:space-between;align-items:center;padding:0 6px;pointer-events:none}
  .long .rnav button{pointer-events:auto;width:56px;height:56px;font-size:26px}
  .long .rnav>div{position:absolute;left:0;right:0;bottom:2px;text-align:center}.long .rcount{font-size:13px}.long .rdots{display:none}
}
/* karaoke screen inside the book (skazka.js): no video, back to the same page */
html.bkar-open{overflow:hidden}
.bkar{position:fixed;inset:0;z-index:70;background:linear-gradient(180deg,#2b1d4a,#4b2a7a 60%,#7a3a8a);color:#fff;display:flex;align-items:center;justify-content:center;
  padding:calc(12px + env(safe-area-inset-top)) 14px calc(12px + env(safe-area-inset-bottom));box-sizing:border-box;font-family:"Andika","Nunito",sans-serif;-webkit-user-select:none;user-select:none}
.bkar[hidden]{display:none}
.bkar-in{width:100%;max-width:900px;height:100%;max-height:820px;display:flex;flex-direction:column;gap:12px}
.bkar-top{display:flex;gap:14px;align-items:center}
.bkar-cover{width:84px;height:112px;object-fit:cover;border-radius:18px;border:4px solid var(--c,#ffc928);flex:none;background:#fff}
.bkar-now{font-family:"Nunito",sans-serif;font-weight:900;font-size:18px;color:#ffd84d}
.bkar-title{font-family:"Nunito",sans-serif;font-weight:900;font-size:clamp(24px,5vw,40px);margin:4px 0 0;color:#fff;line-height:1.15}
.bkar-lyrics{flex:1;min-height:0;display:flex;flex-direction:column;justify-content:center;align-items:center;text-align:center;gap:16px;padding:6px 4px;overflow:hidden}
.bkar-line{font-weight:700;font-size:clamp(28px,min(7.6vw,6.4vh),60px);line-height:1.3;min-height:1.3em}
.bkar-line .w{background:linear-gradient(90deg,#ffd84d var(--p,0%),rgba(255,255,255,.55) var(--p,0%));-webkit-background-clip:text;background-clip:text;color:transparent;-webkit-box-decoration-break:clone;box-decoration-break:clone}
.bkar-next{font-size:clamp(20px,min(4.6vw,4vh),34px);color:rgba(255,255,255,.6);line-height:1.3}
.bkar-bar{height:10px;border-radius:5px;background:rgba(255,255,255,.18);overflow:hidden;flex:none}.bkar-bar i{display:block;height:100%;width:0;background:#ffd84d}
.bkar-btns{display:flex;justify-content:center;align-items:center;gap:16px;flex-wrap:wrap;flex:none}
.bkar-play{width:96px;height:96px;border-radius:50%;border:0;background:#ff4f6d;color:#fff;font-size:42px;box-shadow:0 6px 0 rgba(0,0,0,.25);cursor:pointer}
.bkar-back{min-height:72px;padding:0 26px;border-radius:999px;border:0;background:#ffd84d;color:#2b1d4a;font-family:"Nunito",sans-serif;font-weight:900;font-size:clamp(19px,4.6vw,26px);box-shadow:0 6px 0 rgba(0,0,0,.25);cursor:pointer}
@media(min-width:820px){.bkar-cover{width:120px;height:160px}}
@media (max-height:520px){.bkar-in{gap:6px}.bkar-cover{width:52px;height:70px;border-width:3px}.bkar-now{font-size:14px}.bkar-title{font-size:22px}
  .bkar-play{width:64px;height:64px;font-size:28px}.bkar-back{min-height:56px;font-size:18px}.bkar-lyrics{gap:6px}}
@media (max-height:700px),(orientation:landscape) and (max-height:560px){.long .rtext.flow{line-height:1.36}.long .rtext.flow p{line-height:1.36;margin-bottom:.32em}}
.reader{grid-template-columns:minmax(0,1fr)}  /* a long book title must not widen the page (nowrap h1 min-content) */
