.top-text-btn{
  min-height:40px;
  padding:0 13px;
  border:1px solid rgba(230,196,122,.2);
  border-radius:var(--r-sm);
  background:linear-gradient(180deg,rgba(255,255,255,.045),rgba(0,0,0,.18));
  color:var(--text-2);
  font-family:var(--font-ui);
  font-size:10px;
  font-weight:900;
  letter-spacing:.055em;
  text-transform:uppercase;
  white-space:nowrap;
  cursor:pointer;
  transition:all var(--tr);
}
.top-text-btn:hover{
  border-color:var(--gold-d);
  color:var(--gold-b);
  background:rgba(230,196,122,.07);
  box-shadow:0 0 18px rgba(230,196,122,.12);
  transform:translateY(-1px);
}
.story-book-screen{
  flex:1;
  min-height:0;
  display:flex;
  flex-direction:column;
  overflow:hidden;
  padding:20px;
  background:
    radial-gradient(circle at 50% -20%,rgba(183,121,52,.18),transparent 42%),
    linear-gradient(180deg,rgba(12,10,8,.9),rgba(5,5,6,.96)),
    url('/assets/backgrounds/locations/dungeons/ashborn_loc_006.webp') center/cover no-repeat;
}
.story-book-head{
  flex:0 0 auto;
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:20px;
  padding:0 4px 15px;
}
.story-book-eyebrow,.story-book-index-title{
  color:rgba(220,184,111,.62);
  font-size:9px;
  font-weight:900;
  letter-spacing:.18em;
  text-transform:uppercase;
}
.story-book-head h1{
  margin:2px 0 0;
  color:#f0d18c;
  font-family:'Instrument Serif',serif;
  font-size:34px;
  font-weight:500;
  line-height:1;
}
.story-book-head p{
  margin:6px 0 0;
  color:var(--text-3);
  font-size:11px;
}
.story-book-unlock-count{
  display:flex;
  align-items:center;
  gap:8px;
  padding:7px 10px;
  border:1px solid rgba(230,196,122,.18);
  border-radius:6px;
  background:rgba(5,5,5,.35);
}
.story-book-unlock-count b{
  color:var(--gold-b);
  font-family:'Instrument Serif',serif;
  font-size:24px;
  font-weight:500;
}
.story-book-unlock-count span{
  max-width:60px;
  color:var(--text-3);
  font-size:9px;
  font-weight:800;
  line-height:1.2;
  text-transform:uppercase;
}
.story-book-layout{
  flex:1;
  min-height:0;
  display:grid;
  grid-template-columns:220px minmax(0,1fr);
  gap:12px;
}
.story-book-index{
  min-height:0;
  overflow:auto;
  padding:14px 10px;
  border:1px solid rgba(209,151,70,.22);
  border-radius:7px;
  background:linear-gradient(180deg,rgba(31,23,16,.8),rgba(10,9,8,.82));
  box-shadow:inset 0 1px 0 rgba(255,235,193,.05),0 12px 36px rgba(0,0,0,.3);
}
.story-book-index-title{padding:0 7px 10px}
.story-book-chapter{
  width:100%;
  display:grid;
  grid-template-columns:29px minmax(0,1fr) 12px;
  gap:8px;
  align-items:center;
  padding:10px 7px;
  border:0;
  border-top:1px solid rgba(230,196,122,.1);
  background:transparent;
  color:var(--text-3);
  text-align:left;
  cursor:pointer;
}
.story-book-chapter:hover,.story-book-chapter.active{
  background:linear-gradient(90deg,rgba(230,196,122,.1),transparent);
  color:var(--gold-b);
}
.story-book-chapter-number{
  color:rgba(230,196,122,.4);
  font-family:'JetBrains Mono',monospace;
  font-size:10px;
}
.story-book-chapter>span:nth-child(2){display:grid;gap:2px;min-width:0}
.story-book-chapter small{
  color:inherit;
  font-size:8px;
  font-weight:900;
  letter-spacing:.09em;
  text-transform:uppercase;
}
.story-book-chapter b{
  overflow:hidden;
  color:inherit;
  font-family:'Instrument Serif',serif;
  font-size:16px;
  font-weight:500;
  line-height:1.05;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.story-book-chapter i{
  width:8px;
  height:8px;
  border:1px solid currentColor;
  border-radius:50%;
  opacity:.45;
}
.story-book-chapter.unlocked i{
  border-color:#65d77d;
  background:#65d77d;
  box-shadow:0 0 8px rgba(101,215,125,.45);
}
.story-book-shell{
  min-width:0;
  min-height:0;
  display:grid;
  grid-template-rows:minmax(0,1fr) auto;
  padding:10px 12px 8px;
  border:1px solid rgba(210,154,77,.28);
  border-radius:8px;
  background:linear-gradient(120deg,#1a1109,#382414 48%,#171008 52%,#080706);
  box-shadow:0 22px 60px rgba(0,0,0,.46),inset 0 1px 0 rgba(255,230,177,.08);
}
.story-book-pages{
  --story-page-edge-x:clamp(82px,9.6%,138px);
  --story-page-gutter:clamp(34px,4%,64px);
  --story-page-top:clamp(28px,5.2vh,54px);
  --story-page-bottom:clamp(38px,7.2vh,72px);
  min-height:0;
  position:relative;
  overflow:hidden;
  border-radius:7px;
  background:
    #17100b
    url('/assets/images/storybook/ui/aged-open-book-v1.webp') center/100% 100% no-repeat;
  box-shadow:inset 0 0 38px rgba(18,9,4,.28),0 10px 32px rgba(0,0,0,.48);
}
.story-book-pages::after{
  content:'';
  position:absolute;
  z-index:3;
  top:4%;
  bottom:5%;
  left:50%;
  width:42px;
  transform:translateX(-50%);
  background:linear-gradient(90deg,transparent,rgba(41,22,12,.21) 38%,rgba(22,12,7,.34) 48%,rgba(238,211,161,.08) 51%,rgba(48,25,13,.22) 62%,transparent);
  filter:blur(.35px);
  pointer-events:none;
}
.story-book-spread{
  height:100%;
  min-height:0;
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:var(--story-page-gutter);
  box-sizing:border-box;
  padding:var(--story-page-top) var(--story-page-edge-x) var(--story-page-bottom);
}
.story-book-spread.story-book-art-left{grid-template-areas:'art text'}
.story-book-spread.story-book-art-right{grid-template-areas:'text art'}
.story-book-art-page,.story-book-text-page{
  min-width:0;
  min-height:0;
  background:transparent;
}
.story-book-art-page{
  grid-area:art;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:clamp(3px,.8vh,9px) clamp(8px,1vw,16px) clamp(6px,1.2vh,13px);
}
.story-book-art{
  width:auto;
  height:96%;
  max-width:100%;
  max-height:100%;
  min-height:0;
  aspect-ratio:var(--story-art-ratio,4 / 5);
  flex:0 1 auto;
  position:relative;
  overflow:visible;
  background:transparent;
}
.story-book-art-image{
  width:100%;
  height:100%;
  display:block;
  position:relative;
  z-index:1;
  object-fit:contain;
  object-position:center;
  opacity:.86;
  mix-blend-mode:multiply;
  filter:sepia(.58) saturate(.56) contrast(.82) brightness(1.18);
  -webkit-mask-image:linear-gradient(90deg,transparent 0,#000 13%,#000 87%,transparent 100%),linear-gradient(180deg,transparent 0,#000 11%,#000 89%,transparent 100%);
  -webkit-mask-composite:source-in;
  mask-image:linear-gradient(90deg,transparent 0,#000 13%,#000 87%,transparent 100%),linear-gradient(180deg,transparent 0,#000 11%,#000 89%,transparent 100%);
  mask-composite:intersect;
}
.story-book-art span{
  position:absolute;
  z-index:4;
  left:7%;
  right:7%;
  bottom:4%;
  color:#53331f;
  font-family:'Marck Script','Alegreya',serif;
  font-size:clamp(15px,1.15vw,19px);
  line-height:1.1;
  text-align:center;
  text-shadow:0 1px rgba(239,211,158,.6);
}
.story-book-text-page{
  grid-area:text;
  position:relative;
  padding:clamp(8px,1.2vh,16px) clamp(12px,1.4vw,22px) 34px;
  color:#312216;
  text-rendering:optimizeLegibility;
  font-synthesis:none;
}
.story-book-page-kicker{
  color:#75461f;
  font-family:'Alegreya',serif;
  font-size:9px;
  font-weight:700;
  letter-spacing:.19em;
  text-transform:uppercase;
}
.story-book-text-page h2{
  margin:4px 0 8px;
  color:#342013;
  font-family:'Marck Script','Alegreya',serif;
  font-size:clamp(29px,2.45vw,42px);
  font-weight:400;
  line-height:1.02;
  letter-spacing:.005em;
  text-shadow:0 .45px .35px rgba(58,30,14,.38);
}
.story-book-rule{
  width:88px;
  height:1px;
  margin:9px 0 14px;
  background:linear-gradient(90deg,#74431f,rgba(116,67,31,.08));
  box-shadow:31px 4px 0 -1px rgba(116,67,31,.38);
}
.story-book-text-page p{
  margin:0 0 12px;
  color:#392719;
  font-family:'Alegreya',serif;
  font-size:clamp(14px,1.02vw,17px);
  font-weight:500;
  line-height:1.43;
  letter-spacing:.006em;
  text-shadow:0 .35px .3px rgba(58,30,14,.25);
}
.story-book-text-page p:first-of-type::first-letter{
  float:left;
  margin:5px 7px 0 0;
  color:#6e3e1d;
  font-family:'Marck Script','Alegreya',serif;
  font-size:49px;
  line-height:.66;
}
.story-book-page-number{
  position:absolute;
  left:0;
  right:0;
  bottom:15px;
  color:rgba(70,41,22,.62);
  font-family:'Marck Script','Alegreya',serif;
  font-size:16px;
  text-align:center;
}
.story-book-controls{
  min-height:48px;
  display:grid;
  grid-template-columns:42px minmax(0,1fr) 42px;
  gap:12px;
  align-items:center;
  padding:7px 8px 0;
}
.story-book-controls button{
  width:40px;
  height:34px;
  border:1px solid rgba(230,196,122,.28);
  border-radius:5px;
  background:rgba(230,196,122,.06);
  color:var(--gold-b);
  font-size:18px;
  cursor:pointer;
}
.story-book-controls button:hover:not(:disabled){background:rgba(230,196,122,.14)}
.story-book-controls button:disabled{opacity:.22;cursor:default}
.story-book-controls div{min-width:0;display:grid;text-align:center}
.story-book-controls span{
  color:var(--text-3);
  font-size:8px;
  font-weight:900;
  letter-spacing:.12em;
  text-transform:uppercase;
}
.story-book-controls b{
  overflow:hidden;
  color:var(--gold-b);
  font-family:'Instrument Serif',serif;
  font-size:17px;
  font-weight:500;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.story-book-locked-spread{
  height:100%;
  min-height:0;
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:var(--story-page-gutter);
  box-sizing:border-box;
  padding:var(--story-page-top) var(--story-page-edge-x) var(--story-page-bottom);
}
.story-book-locked,.story-book-empty{
  height:100%;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  padding:50px;
  color:#49321f;
  text-align:center;
  background:radial-gradient(circle at center,rgba(122,71,32,.055),transparent 42%);
}
.story-book-locked{padding:clamp(14px,1.7vw,26px)}
.story-book-locked-blank{min-width:0;min-height:0}
.story-book-seal{
  width:64px;
  height:64px;
  margin-bottom:19px;
  border:2px solid #7e4b28;
  border-radius:50%;
  box-shadow:inset 0 0 0 5px rgba(126,75,40,.15),0 4px 10px rgba(70,37,19,.18);
}
.story-book-locked span{
  color:#8b5728;
  font-size:9px;
  font-weight:900;
  letter-spacing:.16em;
  text-transform:uppercase;
}
.story-book-locked h2{
  margin:5px 0 12px;
  font-family:'Marck Script','Alegreya',serif;
  font-size:clamp(32px,2.5vw,40px);
  font-weight:400;
}
.story-book-locked p{max-width:330px;margin:0;font-family:'Alegreya',serif;font-size:15px;line-height:1.45}

@media(max-width:1500px){
  .top-text-btn{min-height:30px;padding:0 9px;font-size:8px}
  .story-book-layout{grid-template-columns:188px minmax(0,1fr)}
  .story-book-screen{padding:14px}
}
@media(max-width:1180px){
  .top-text-btn{min-height:28px;padding:0 7px;font-size:7px;letter-spacing:.035em}
  .story-book-layout{grid-template-columns:150px minmax(0,1fr)}
  .story-book-chapter-number{display:none}
  .story-book-chapter{grid-template-columns:minmax(0,1fr) 10px}
}
@media(max-width:820px){
  .story-book-head{align-items:flex-start}
  .story-book-head h1{font-size:28px}
  .story-book-layout{grid-template-columns:1fr;overflow:auto}
  .story-book-index{display:flex;gap:6px;overflow-x:auto;padding:7px}
  .story-book-index-title{display:none}
  .story-book-chapter{min-width:170px;border:1px solid rgba(230,196,122,.12);border-radius:5px}
  .story-book-shell{min-height:680px}
  .story-book-spread{grid-template-columns:1fr;grid-template-rows:minmax(280px,.8fr) minmax(320px,1fr);grid-template-areas:'art' 'text'!important;padding:38px 46px 54px;gap:10px}
  .story-book-locked-spread{grid-template-columns:1fr;padding:38px 46px 54px}
  .story-book-locked-blank{display:none}
  .story-book-pages::after{display:none}
  .story-book-art-page{padding:0 0 8px}
  .story-book-text-page{padding:20px 20px 38px}
}
@media(max-width:620px){
  .story-book-unlock-count{display:none}
  .story-book-screen{padding:10px}
  .story-book-shell{padding:7px;min-height:640px}
  .story-book-text-page p{font-size:15px}
}
