.world-section{background:#f1efe5;border-top:1px solid #dcd9cb;scroll-margin-top:24px}
.world-intro{max-width:780px;color:#4d6259}.cast-count{font-size:12px;white-space:nowrap}
.world-controls{margin:30px 0}.world-controls[hidden],.character-card[hidden]{display:none!important}
.world-tabs{display:inline-flex;gap:4px;padding:5px;background:#e5e5d8;border:1px solid #d6d5c4;border-radius:30px;max-width:100%}
.world-tabs button{border:0;border-radius:24px;padding:12px 20px;background:transparent;color:#365448;font:600 13px Arial,sans-serif;cursor:pointer;white-space:nowrap;min-height:44px}
.world-tabs button[aria-selected=true]{background:#244c40;color:#fff;box-shadow:0 2px 5px #203c3720}
.world-result{font-size:12px;color:#5c6c60;margin:14px 0 0}
.character-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:28px}
.character-card{position:relative;display:flex;flex-direction:column;background:#fbf8f0;border:1px solid #dedbcb;border-radius:10px;overflow:hidden;transition:box-shadow .18s,border-color .18s}
.character-card:hover{border-color:#a7925a;box-shadow:0 9px 24px #203c3710}
.character-card:focus-within{outline:3px solid #a77a2d;outline-offset:4px}
.character-copy{display:flex;flex-direction:column;flex:1;padding:24px}
.character-copy h3{font-size:27px;margin:12px 0 16px}.character-copy .eyebrow{font-size:10px;margin:0}
.character-copy>p:not(.eyebrow){font-size:14px;margin:0 0 22px}
.character-open{border:0;background:none;padding:5px 0;color:#244c40;text-align:left;font:600 13px Arial,sans-serif;cursor:pointer;margin-top:auto;min-height:38px}
.character-open::after{content:"";position:absolute;inset:0}.character-open:focus-visible{outline:none}
.profile-is-open{overflow:hidden}
#character-dialog{border:1px solid #e5deca;padding:0;border-radius:18px;width:min(900px,calc(100vw - 40px));max-height:calc(100dvh - 48px);background:#fbf8f0;color:#203c37;box-shadow:0 25px 90px #10282055;overflow:auto;overscroll-behavior:contain}
#character-dialog::backdrop{background:#122b26ad;backdrop-filter:blur(4px)}
.profile-close{position:sticky;top:14px;float:right;margin:14px 14px -58px 0;z-index:2;border:1px solid #c8c7b7;border-radius:50%;height:44px;width:44px;background:#fbf8f0;color:#203c37;font-size:28px;cursor:pointer;line-height:1}
.profile-hero{display:grid;grid-template-columns:290px minmax(0,1fr);gap:35px;align-items:center;padding:64px 45px 35px;background:#f0eddf}
.profile-art{padding:16px;background:#fbf9f3;border-radius:14px;aspect-ratio:1;display:flex;align-items:center;justify-content:center}
.profile-art .character-portrait{max-height:290px}.profile-hero h2{font-size:42px;margin:10px 0 20px;overflow-wrap:anywhere}.profile-description{font-size:16px;line-height:1.7}
.profile-stories{padding:30px 45px 45px}.profile-stories h3{font-size:29px;margin:0 0 24px}
.character-story-list{display:grid;gap:22px}.character-story{display:grid;grid-template-columns:112px minmax(0,1fr);gap:24px;border-bottom:1px solid #dfdece;padding-bottom:22px}.character-story:last-child{border-bottom:0;padding-bottom:0}
.character-story img{width:112px;aspect-ratio:1;object-fit:contain;border-radius:4px}.character-story h4{font-family:Georgia,serif;font-weight:400;font-size:22px;line-height:1.25;margin:0 0 7px}.character-story p{font-size:13px;margin:8px 0}.character-story .story-status{display:inline-block;font-size:10px;letter-spacing:1px;text-transform:uppercase;color:#5c572e;background:#ede8d2;border-radius:20px;padding:4px 10px;margin:0}
.story-placeholder{width:112px;aspect-ratio:1;background:#e6e9dc;display:grid;place-items:center;border:1px dashed #b6bd9c;border-radius:4px;color:#607252;text-align:center;font:italic 19px/1.35 Georgia,serif}
.story-note,.coming-note{font-size:13px;color:#5c695d}.coming-note{border-left:3px solid #b99c50;padding-left:14px}
@media(max-width:1050px){.character-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:650px){.character-grid{grid-template-columns:1fr}.world-tabs{display:flex;width:100%;gap:0}.world-tabs button{flex:1;padding:10px 8px;font-size:11px}.profile-hero{grid-template-columns:1fr;padding:62px 24px 22px;gap:22px}.profile-art{width:220px;max-width:100%;margin:auto}.profile-hero h2{font-size:34px}.profile-stories{padding:26px 24px}.character-story{grid-template-columns:80px minmax(0,1fr);gap:16px}.character-story img,.story-placeholder{width:80px}.character-story h4{font-size:20px}#character-dialog{width:calc(100vw - 20px);max-height:calc(100dvh - 24px)}}
@media(prefers-reduced-motion:reduce){.character-card{transition:none}}

/* Uniform picture stages v0.5: independent of source aspect ratio and text length. */
.character-card > .character-image{
  width:100%;height:280px;min-height:280px;max-height:280px;
  aspect-ratio:auto;flex:0 0 280px;padding:20px;
  display:grid;place-items:center;overflow:hidden;
}
.character-image > .character-portrait{
  display:block;width:240px;height:240px;min-height:0;
  max-width:100%;max-height:240px;flex:none;
}
.profile-hero > .profile-art{
  width:280px;height:280px;min-height:280px;max-width:100%;
  aspect-ratio:auto;padding:20px;display:grid;place-items:center;
  justify-self:center;overflow:hidden;
}
.profile-art > .character-portrait{
  display:block;width:240px;height:240px;min-height:0;
  max-width:100%;max-height:240px;flex:none;
}
@media(max-width:360px){
  .character-card > .character-image{padding:20px 10px}
  .profile-hero{padding-left:14px;padding-right:14px}
}
.story-book-link{display:inline-block;min-height:44px;padding:4px 0;color:inherit;text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:4px;overflow-wrap:anywhere}.story-book-link:hover{color:#806326}.story-book-link:focus-visible{outline:3px solid #987a33;outline-offset:4px;border-radius:3px}
