@media (max-width:760px) {
 html { overflow-x:clip; scrollbar-width:none; }
 html::-webkit-scrollbar { display:none; }
 body { width:100%; overflow-x:clip; }
 .bestiary-page { padding:32px 0 48px; }
 .bestiary-intro { margin-bottom:28px; }
 .bestiary-heading { margin:0 16px; gap:12px; }
 .bestiary-heading span { width:auto; flex:1; }
 .bestiary-heading h2 { font-size:30px; letter-spacing:4px; }
 .bestiary-grid { grid-template-columns:repeat(2,minmax(0,1fr)); padding:0 12px; gap:18px 12px; }
 .creature-card { height:auto; aspect-ratio: .61; min-width:0; }
 .creature-image { position:absolute; top:3.8%; left:3%; right:3%; height:66%; margin:0; clip-path:polygon(15px 0,calc(100% - 15px) 0,100% 15px,100% 100%,0 100%,0 15px); }
 .creature-image img { padding:4px; }
 .creature-info { top:71%; left:9px; right:9px; padding:0; }
 .creature-info h3 { font-size:clamp(12px,3.5vw,18px); letter-spacing:1px; line-height:1.15; margin-bottom:5px; overflow-wrap:anywhere; }
 .creature-type { font-size:clamp(10px,2.8vw,14px); line-height:1.3; letter-spacing:.3px; }
 .nav-link.active::before,.nav-link.active::after { display:none; }
}

/* Mobile creature details use a single parchment scroll. */
.mobile-beast-dialog {
 width:calc(100vw - 20px);max-width:480px;height:calc(100dvh - 32px);max-height:820px;
 padding:0;border:0;background:transparent;overflow:visible;
}
.mobile-beast-dialog::backdrop { background:#02070ee8; }
.mobile-beast-scroll {
 position:relative;width:100%;height:100%;
 background:url('../Elderwoods/images/backgrounds/profile-scroll.png') center / 100% 100% no-repeat;
 clip-path:polygon(3% 4%,14% 4.5%,50% 5%,94% 3.5%,98% 5%,99% 12%,95% 14%,95% 21%,92% 24%,96% 28%,94% 35%,96% 42%,93% 48%,96% 54%,94% 62%,96% 70%,94% 78%,95% 85%,98% 87%,99% 95%,94% 96%,50% 95%,6% 96%,1% 94%,2% 87%,6% 85%,5% 80%,6% 74%,4% 68%,6% 62%,4% 56%,6% 49%,4% 43%,6% 36%,4% 30%,6% 24%,5% 16%,2% 13%,1% 7%);
}
.mobile-beast-text {
 position:absolute;top:15%;bottom:15%;left:0;width:100%;box-sizing:border-box;
 overflow-y:auto;padding:12px 12% 24px;overscroll-behavior:contain;scrollbar-width:none;
 font-family:Georgia,serif;color:#392719;font-size:16px;line-height:1.65;text-align:left;
}
.mobile-beast-text::-webkit-scrollbar { display:none; }
.mobile-beast-text h2 { margin:0 0 24px;text-align:center;font-size:27px;line-height:1.3; }
.mobile-beast-text section { margin:0 0 22px; }
.mobile-beast-text h3 { margin:0 0 8px;padding-bottom:5px;border-bottom:1px solid #76502b66;font-size:17px;line-height:1.4; }
.mobile-beast-close { position:absolute;top:7%;right:10%;width:34px;height:34px;border:1px solid #bc9456;border-radius:50%;background:#533216;color:#fae8bf;font-size:24px;cursor:pointer; }

/* Manuscript details echo the illustrated desktop bestiary. */
.mobile-beast-text { padding-left:11%;padding-right:11%; }
.mobile-beast-text h2 {
 position:relative;padding:18px 12px;margin:4px 0 24px;
 border-top:3px double #624019;border-bottom:3px double #624019;
 font-variant:small-caps;letter-spacing:1px;
 background:linear-gradient(90deg,transparent,#fff0bd33,transparent);
}
.mobile-beast-text h2::before,.mobile-beast-text h2::after {
 content:'◆';position:absolute;left:50%;transform:translateX(-50%);font-size:12px;line-height:14px;color:#624019;
}
.mobile-beast-text h2::before { top:-8px; }
.mobile-beast-text h2::after { bottom:-8px; }
.mobile-beast-text .beast-detail { position:relative;margin-bottom:26px; }
.mobile-beast-text .beast-detail h3 { position:relative;text-transform:uppercase;font-size:16px;letter-spacing:.6px;border-bottom:1px solid #62401999;padding-bottom:9px; }
.mobile-beast-text .beast-detail h3::after { content:'◆';position:absolute;right:0;bottom:-8px;font-size:10px;line-height:14px; }
.mobile-beast-text .beast-detail-class { text-align:center;font-style:italic; }
.mobile-beast-text .beast-detail-class h3 { font-size:12px;letter-spacing:2px;border:0;margin:0; }
.mobile-beast-text .beast-detail-class h3::after { display:none; }
.mobile-beast-text .beast-detail-evolution-stage {
 display:flex;align-items:center;justify-content:center;gap:14px;
 padding:10px 12px;border:3px double #624019;box-shadow:inset 0 0 10px #71461b14;
}
.mobile-beast-text .beast-detail-evolution-stage h3 { font-size:13px;text-transform:none;border:0;margin:0;padding:0;letter-spacing:0; }
.mobile-beast-text .beast-detail-evolution-stage h3::after { display:none; }
.mobile-beast-text .beast-detail-evolution-stage > div { font-size:22px;line-height:1.3; }
.mobile-beast-text .beast-detail:has(.beast-detail-icon) h3 { min-height:58px;display:flex;align-items:center;padding-left:66px; }
.beast-detail-icon {
 position:absolute;left:0;top:0;width:56px;height:60px;
 background-image:url('images/backgrounds/parchment.png');background-repeat:no-repeat;background-size:768px 512px;
 mix-blend-mode:multiply;
}
.beast-icon-habitat { background-position:-395px -115px; }
.beast-icon-diet { background-position:-395px -185px; }
.beast-icon-traits { background-position:-395px -255px; }
.beast-icon-attacks { background-position:-395px -325px; }
.beast-icon-evolution { background-position:-395px -395px; }
.mobile-beast-text .beast-detail-notes { border:3px double #624019;padding:17px 14px;margin-top:32px;box-shadow:inset 0 0 0 3px #62401911; }
.mobile-beast-text .beast-detail-notes::before,.mobile-beast-text .beast-detail-notes::after { content:'◇';position:absolute;color:#624019;font-size:24px;line-height:22px; }
.mobile-beast-text .beast-detail-notes::before { top:-13px;left:calc(50% - 12px); }
.mobile-beast-text .beast-detail-notes::after { bottom:-11px;left:calc(50% - 12px); }
.mobile-beast-text .beast-detail-notes h3 { text-align:center;font-size:15px; }
.mobile-beast-text .beast-detail-recorded,.mobile-beast-text .beast-detail-date,.mobile-beast-text .beast-detail-location { font-size:14px;font-style:italic;margin-bottom:14px; }

/* Match the original bestiary manuscript typography. */
.mobile-beast-text {
 font-family:Georgia,serif;
 font-style:italic;
 line-height:1.4;
}
.mobile-beast-text h2 {
 font-family:Georgia,serif;
 font-style:italic;
 font-weight:400;
 font-variant:normal;
 letter-spacing:0;
}
.mobile-beast-text .beast-detail h3 {
 font-family:Georgia,serif;
 font-style:normal;
 font-weight:700;
 letter-spacing:0;
}
.mobile-beast-text .beast-detail > div {
 font-family:Georgia,serif;
 font-style:italic;
 font-weight:400;
 line-height:1.4;
}
.mobile-beast-text .beast-detail-evolution-stage > div { font-style:normal; }

/* A narrower scroll keeps the bestiary visible around it. */
.mobile-beast-dialog { width:calc(100vw - 56px); max-width:420px; }
.mobile-beast-dialog::backdrop { background:rgba(2,7,14,.42); }

/* Shorter details window, retaining its previous readable width. */
.mobile-beast-dialog {
 width:calc(100vw - 20px);
 max-width:480px;
 height:76dvh;
 max-height:640px;
}

/* Slightly more compact mobile creature details. */
.mobile-beast-dialog {
 width:calc(100vw - 40px);
 max-width:440px;
 height:70dvh;
 max-height:590px;
}
.mobile-beast-text { font-size:15px; }
.mobile-beast-text h2 { font-size:25px; }
.mobile-beast-text .beast-detail h3 { font-size:15px; }
.mobile-beast-text .beast-detail-class h3 { font-size:11px; }
.mobile-beast-text .beast-detail-evolution-stage h3 { font-size:12px; }
.mobile-beast-text .beast-detail-evolution-stage > div { font-size:20px; }
.mobile-beast-text .beast-detail-notes h3 { font-size:14px; }
.mobile-beast-text .beast-detail-recorded,
.mobile-beast-text .beast-detail-date,
.mobile-beast-text .beast-detail-location { font-size:13px; }
