/* A chapter is a place, not another card. Roots stay outside the reading area. */
.chapter-gate{position:relative;isolation:isolate;display:grid;place-items:center;min-height:230px;overflow:hidden;background:#022c32;border-block:1px solid #e5bc662b;text-align:center}
.chapter-gate::before{content:"";position:absolute;inset:0;background:radial-gradient(ellipse at 50% 100%,#bb873d26,transparent 65%);opacity:calc(.3 + var(--gate-light,0)*.7);pointer-events:none}
.gate-caption{position:relative;z-index:1;padding:32px 24px;transform:translateY(var(--gate-shift,0px))}
.gate-caption>span{font-size:10px;font-weight:800;letter-spacing:.32em;color:#ddb973}
.gate-caption p{font-size:clamp(22px,3vw,37px);font-weight:700;color:#fff0d1;margin:10px 0 7px;line-height:1.2}
.gate-caption i{font-size:22px;color:#edc777;font-style:normal;display:block;opacity:.7}
.gate-roots{position:absolute;inset:-150px 0;opacity:calc(.12 + var(--gate-light,0)*.38);background:url('assets/magic-roots.png') left center/240px 540px no-repeat,url('assets/magic-roots.png') right center/240px 540px no-repeat;pointer-events:none;transform:translateY(var(--gate-shift,0px))}
.root-chapter{position:relative;isolation:isolate;scroll-margin-top:100px}
.root-chapter>.chapter-roots{position:absolute;inset:0;z-index:-1;overflow:hidden;pointer-events:none;contain:paint}
.section.root-chapter{width:100%;padding-inline:max(7%,calc((100% - 1400px)/2));box-sizing:border-box}
.chapter-roots .root-strand{position:absolute;top:0;bottom:0;width:clamp(70px,12vw,210px);background:url('assets/magic-roots.png') center top/100% 680px repeat-y;opacity:.2;mask-image:linear-gradient(transparent,#000 100px,#000 calc(100% - 100px),transparent)}
.root-strand.left{left:-5%}.root-strand.right{right:-5%;transform:scaleX(-1)}
.chapter-roots .root-strand i{display:block;position:absolute;inset:0;background:inherit;filter:brightness(2) saturate(.8) drop-shadow(0 0 9px #ffc857);mask-image:linear-gradient(to bottom,transparent calc(var(--root-light,-500px) - 190px),#000 var(--root-light,-500px),transparent calc(var(--root-light,-500px) + 190px));opacity:0}
.chapter-active .root-strand{opacity:.55}.chapter-active .root-strand i{opacity:1}
/* The pinned gallery keeps its roots, without repainting a screen-height filter per frame. */
#hrdinove .root-strand i{display:none}
.friends-viewport{overscroll-behavior-x:contain}
.friend{contain:paint;backface-visibility:hidden}
@media(hover:hover){.friends-chapter.chapter-active .friend{will-change:transform}}
@media(hover:none){.friend:hover{box-shadow:none}}
#svety.root-chapter{background:linear-gradient(135deg,#124b44aa,#073e4200)}
#pribehy.root-chapter{background:linear-gradient(135deg,#173e48aa,#073e4200)}
#festival.root-chapter{background:radial-gradient(ellipse at 75% 50%,#13736544,transparent 65%)}
#produkty.root-chapter{background:linear-gradient(160deg,#4d4c222b,transparent)}
#partneri.root-chapter{background:linear-gradient(135deg,#093340aa,transparent)}
.all-friends{padding-bottom:90px}
.still .gate-caption,.still .gate-roots{transform:none}.still .chapter-roots .root-strand{opacity:.18}.still .root-strand i{display:none}
@media(max-width:680px){
 .chapter-gate{min-height:180px}.gate-caption{padding:30px 35px}.gate-caption p{font-size:24px}.gate-roots{background-size:100px 360px;opacity:calc(.1 + var(--gate-light,0)*.25)}
 .section.root-chapter{margin:0;width:100%;padding:65px 24px}.root-strand.left{left:-45px}.root-strand.right{right:-45px}.chapter-roots .root-strand{width:72px;background-size:100% 500px}.chapter-active .root-strand{opacity:.4}
}
@media(prefers-reduced-motion:reduce){.gate-caption,.gate-roots{transform:none!important}.chapter-roots .root-strand{opacity:.18!important}.root-strand i{display:none!important}}
