/* CAST // SIGNAL — WORLD SYSTEM / approved design candidates
   V5 WORLD SELECT cartridges + V4 CENTRAL DOSSIER.
   ONE owner for all current WORLD presentation. Avoid another Study override.
   Source: accepted V5/V4 self-contained visual studies (2026-11-22).
   Existing CLOUD data, edit fields, URLs, and cast crop transforms are preserved. */
#worldsPanel,#worldDetailPanel{
  --ws-lime:#eaff55;
  --ws-paper:#f1efe8;
  --ws-ink:#12191c;
  --ws-coral:#f34b50;
  --ws-metal:#232e32;
}
#worldsPanel .directory-head,
#worldDetailPanel .directory-head{
  background:#101719;
  color:#e9f4ee;
  border-bottom:2px solid #445056;
}
#worldsPanel .directory-content{
  padding:clamp(24px,2.45vw,58px) clamp(22px,4vw,96px) 75px;
  background:
    repeating-linear-gradient(90deg,transparent 0 87px,#ffffff07 87px 88px),
    repeating-linear-gradient(0deg,transparent 0 87px,#ffffff06 87px 88px),
    radial-gradient(ellipse at 90% 0%,#33444b40,transparent 55%),
    #10171a;
  color:#f9faf4;
}
#worldsPanel .directory-kicker{
  color:var(--ws-lime);font:900 clamp(10px,.69vw,15px)/1.3 var(--mono);
  letter-spacing:.09em;
}
#worldsPanel .directory-content h2{
  margin:clamp(8px,.8vw,14px) 0 10px;
  font:1000 clamp(60px,5.55vw,138px)/.92 var(--sans);
  letter-spacing:-.11em;
  white-space:nowrap;
}
#worldsPanel .directory-content h2 i{
  color:transparent;-webkit-text-stroke:1.7px #fff;
  font-style:normal;
}
#worldsPanel .directory-content h2 span{color:var(--ws-lime)}
#worldsPanel .worlds-intro{
  font:700 clamp(12px,.77vw,17px)/1.65 var(--jpn);
  color:#c5d1cf;
}
#worldsPanel .world-cards{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:clamp(13px,1.25vw,28px);
  align-items:stretch;
  width:100%;
  max-width:2320px;
  margin:clamp(22px,1.7vw,42px) auto 0;
}
#worldsPanel .world-card.ws5-card{
  isolation:isolate;
  display:flex;flex-direction:column;justify-content:flex-start;
  position:relative;min-width:0;
  width:100%;height:clamp(408px,26.5vw,615px);
  min-height:0;padding:0;
  text-align:left;color:#141b1e;
  border:4px solid #101719;
  outline:2px solid #526164;outline-offset:-2px;
  border-radius:14px 3px 17px 4px;
  box-shadow:8px 9px 0 #05080a,0 0 0 1px #a7b5b644;
  background:var(--ws-paper);
  overflow:hidden;
  transform:none;
  transition:transform .18s,border-color .18s,outline-color .18s,box-shadow .18s;
}
#worldsPanel .world-card.ws5-card:before,
#worldsPanel .world-card.ws5-card:after{content:none}
#worldsPanel .world-card.ws5-card:hover,
#worldsPanel .world-card.ws5-card:focus-visible{
  z-index:2;transform:translateY(-4px);
  border-color:var(--ws-lime);outline-color:var(--ws-lime);
  box-shadow:8px 9px 0 #05080a,0 0 0 3px var(--ws-lime);
}
#worldsPanel .ws5-visual{
  position:relative;flex:1 1 0%;height:auto;min-height:125px;
  overflow:hidden;background:#1c2529;color:white;
}
#worldsPanel .ws5-visual:before{
  content:"";pointer-events:none;
  position:absolute;z-index:2;inset:0;
  background:
    repeating-linear-gradient(90deg,#cfdcda09 0 1px,transparent 1px 45px),
    linear-gradient(125deg,#080d1145 0,transparent 65%);
}
#worldsPanel .ws5-file-mark{
  position:absolute;left:clamp(12px,.95vw,22px);top:clamp(11px,.85vw,19px);
  z-index:5;
  color:#ecf4ef;
  font:900 clamp(9px,.64vw,15px)/1.3 var(--mono);
  letter-spacing:.04em;
}
#worldsPanel .ws5-file-mark b{color:var(--ws-lime)}
#worldsPanel .ws5-huge{
  position:absolute;left:12px;bottom:-9px;z-index:2;
  font:1000 clamp(90px,9.4vw,225px)/.96 var(--sans);
  letter-spacing:-.09em;color:transparent;
  -webkit-text-stroke:clamp(1.5px,.12vw,2.8px) rgba(255,255,255,.55);
  transform:skewX(-6deg);pointer-events:none;
}
/* Keep the translucent world number in front of uploaded cover artwork. */
#worldsPanel .world-card.ws5-card.has-cover .ws5-huge{z-index:4}
#worldsPanel .ws5-backdrop,
#admin .world-image-studio .ws5-backdrop{
  position:absolute;inset:0;width:100%;height:100%;
  object-fit:cover;
  filter:brightness(.43) saturate(.66) blur(11px);
  transform:scale(1.09);
}
#worldsPanel .ws5-art,
#admin .world-image-studio .ws5-art{
  /* The scan lines and dark overlay (z-index:2) belong BEHIND the clear character.
     FILE labels stay above both (z-index:5); cover numbers sit at z-index:4. */
  position:absolute;z-index:3;right:0;bottom:-9%;
  height:115%;width:auto;max-width:74%;
  object-fit:contain;object-position:right bottom;
  filter:drop-shadow(0 9px 15px #0009);
  transform:translate(var(--wi-x,0%),var(--wi-y,0%)) scale(var(--wi-z,1));
  transform-origin:center;
  transition:transform .28s;
}
#worldsPanel .world-card.ws5-card:hover .ws5-art{
  transform:translate(calc(var(--wi-x,0%) - 2%),var(--wi-y,0%)) scale(calc(var(--wi-z,1) * 1.035));
}
#worldsPanel .ws5-visual[data-motif="research"]{
  background:radial-gradient(circle at 64% 50%,#48434a54,#1b2529 70%);
}
#worldsPanel .ws5-visual[data-motif="research"]:after{
  content:"";position:absolute;z-index:3;top:26%;right:11%;
  width:29%;aspect-ratio:1;border:3px solid #c9d4d13d;
  border-radius:50%;box-shadow:0 0 0 9px #fff1,0 0 0 12px #fff1;
}
#worldsPanel .ws5-visual[data-motif="research"] .ws5-motif{
  position:absolute;z-index:4;right:17%;top:40%;
  font:1000 clamp(27px,2.2vw,52px)/1 var(--mono);
  color:#d7e4dfc9;transform:rotate(-12deg);
}
#worldsPanel .ws5-visual[data-motif="research"] .ws5-motif:after{
  content:"RESEARCH AREA";display:block;text-align:center;
  margin-top:6px;font:900 8px var(--mono);letter-spacing:.12em;
}
#worldsPanel .ws5-visual[data-motif="research"] .ws5-warning{
  position:absolute;z-index:4;top:49%;left:0;width:66%;height:18px;
  background:repeating-linear-gradient(120deg,#f2ff5829 0 12px,#1b2429a0 12px 24px);
  border-block:1px solid #eaff5555;
}
#worldsPanel .ws5-visual[data-motif="unassigned"]{
  background:radial-gradient(ellipse at 80% 90%,#273c3e,#192427 67%);
}
#worldsPanel .ws5-visual[data-motif="unassigned"] .ws5-motif{
  position:absolute;z-index:4;right:14%;top:20%;
  width:42%;height:55%;border:2px dashed #d3dfda8a;
  transform:skewX(-10deg);
  display:flex;flex-direction:column;align-items:center;justify-content:center;
  gap:4px;color:#e7f4eb;
}
#worldsPanel .ws5-visual[data-motif="unassigned"] .ws5-motif b{
  font:800 clamp(60px,5vw,120px)/1 var(--sans);
}
#worldsPanel .ws5-visual[data-motif="unassigned"] .ws5-motif small{
  font:900 clamp(8px,.54vw,12px)/1 var(--mono);
}
#worldsPanel .ws5-info{
  flex:0 0 auto;min-height:0;display:flex;flex-direction:column;
  position:relative;
  padding:clamp(13px,1.1vw,25px) clamp(16px,1.4vw,34px) clamp(10px,.85vw,21px);
  border-top:5px solid #12191c;background:var(--ws-paper);
}
#worldsPanel .ws5-info:before{
  content:"";position:absolute;top:-5px;left:0;
  width:36%;height:5px;background:var(--ws-lime);
}
#worldsPanel .ws5-meta{
  display:flex;align-items:center;justify-content:space-between;gap:8px;
  font:900 clamp(9px,.62vw,14px)/1.2 var(--mono);
  letter-spacing:.04em;color:#45524e;
}
#worldsPanel .ws5-meta b{
  flex:0 0 auto;
  padding:4px 6px;
  background:#1b2326;color:var(--ws-lime);
  font:900 clamp(8px,.54vw,12px)/1 var(--mono);
}
#worldsPanel .ws5-name{
  display:block;margin:clamp(9px,.75vw,19px) 0 0;
  font:1000 clamp(26px,1.95vw,48px)/1.1 var(--jpn);
  letter-spacing:-.05em;color:#13191c;
  overflow-wrap:anywhere;max-width:100%;
  text-shadow:none!important;
}
#worldsPanel .ws5-summary{
  margin:clamp(8px,.55vw,14px) 0 0;
  color:#44514f;
  font:760 clamp(11px,.75vw,17px)/1.48 var(--jpn);
  display:-webkit-box;-webkit-box-orient:vertical;
  -webkit-line-clamp:2;overflow:hidden;
  min-height:2.96em; /* Reserve two complete lines above the CTA even on narrow cards. */
}
#worldsPanel .ws5-action{
  display:flex;align-items:center;justify-content:space-between;gap:8px;
  margin-top:clamp(14px,1.1vw,23px);
  padding-top:clamp(8px,.69vw,17px);
  border-top:1px solid #b5c2bc;
  font:1000 clamp(11px,.74vw,17px)/1 var(--mono);
  color:#161d1e;
}
#worldsPanel .ws5-arrow{
  width:clamp(46px,3.25vw,77px);height:clamp(29px,2.05vw,48px);
  display:grid;place-items:center;
  color:var(--ws-lime);background:#20292c;
  clip-path:polygon(0 0,100% 0,100% 72%,80% 100%,0 100%);
  font:1000 clamp(22px,1.65vw,38px)/1 var(--sans);
  transition:color .15s,background .15s;
}
#worldsPanel .world-card.ws5-card:hover .ws5-arrow,
#worldsPanel .world-card.ws5-card:focus-visible .ws5-arrow{
  background:var(--ws-lime);color:#141a1c;
}

/* V4 WORLD DETAIL — information is read once, through one central spine. */
#worldDetailPanel .world-detail-content{
  overflow:auto;overscroll-behavior:contain;
  scrollbar-color:#dced53 #13191b;scrollbar-width:thin;
  color:white;
  background:repeating-linear-gradient(125deg,#ffffff05 0 1px,transparent 1px 65px),#10171a;
}
#worldDetailPanel .wd4-center{
  width:min(84%,2240px);margin:0 auto;
  padding:clamp(17px,1.2vw,29px) 0 90px;
}
#worldDetailPanel .wd4-dossier{
  position:relative;isolation:isolate;
  border:3px solid #131b1e;outline:2px solid #516065;outline-offset:-8px;
  background:#161e21;box-shadow:8px 9px 0 #04090b;overflow:hidden;
}
#worldDetailPanel .world-detail-hero.wd4-hero{
  position:relative;
  height:clamp(126px,7.9vw,205px);min-height:0;
  border:0;background:
    repeating-linear-gradient(-27deg,#ffffff07 0 1px,transparent 1px 34px),
    radial-gradient(ellipse at 78% 25%,#53636658,transparent 65%),#141c20;
}
#worldDetailPanel .world-detail-hero.wd4-hero:before{
  background:linear-gradient(90deg,#11191ec4,transparent 45%,#11191e50);
}
#worldDetailPanel .world-detail-hero.wd4-hero:after{
  position:absolute;left:7%;right:auto;
  top:-35%;height:175%;width:clamp(47px,4vw,105px);
  background:var(--ws-coral);opacity:.93;transform:skewX(-22deg);
}
#worldDetailPanel .wd4-hero .world-detail-backdrop img,
#admin .world-image-detail-stage .world-detail-art{
  position:absolute;right:10%;bottom:-83%;
  height:200%;width:auto;max-width:none;
  object-fit:contain;object-position:center;
  mask-image:linear-gradient(90deg,transparent 0%,#000 22%,#000 80%,transparent 100%);
  opacity:.74;
  transform:translate(var(--wi-x,0%),var(--wi-y,0%)) scale(var(--wi-z,1));
  transform-origin:center;
}
#worldDetailPanel .wd4-hero .world-detail-hero-content{
  position:relative;z-index:3;
  width:100%;max-width:none;height:100%;
  display:flex;flex-direction:column;align-items:center;justify-content:center;
  gap:clamp(6px,.7vw,14px);
  padding:12px 24px;text-align:center;
}
#worldDetailPanel .wd4-hero .world-detail-kicker{
  color:var(--ws-lime);
  font:950 clamp(10px,.67vw,16px)/1.2 var(--mono);
  letter-spacing:.11em;
}
#worldDetailPanel .wd4-hero .world-detail-hero-content h2{
  color:#fff;margin:0;
  font:1000 clamp(31px,2.3vw,60px)/1.14 var(--jpn);
  letter-spacing:-.06em;
  text-shadow:0 3px 12px #0009;
}
#worldDetailPanel .wd4-hero .world-detail-subtitle{
  display:block;max-width:min(80%,740px);
  color:#e1eae7;background:transparent;
  font:900 clamp(10px,.66vw,15px)/1.25 var(--jpn);
  padding:0;transform:none;
}
#worldDetailPanel .wd4-brief{
  min-height:clamp(110px,7vw,180px);
  position:relative;
  display:flex;flex-direction:column;align-items:center;justify-content:center;
  gap:clamp(7px,.65vw,15px);
  padding:clamp(16px,1.2vw,28px) clamp(21px,2vw,44px);
  border-top:5px solid var(--ws-lime);
  background:var(--ws-paper);
  color:#141b1e;
}
#worldDetailPanel .wd4-brief:after{
  content:"";position:absolute;right:0;bottom:0;
  border-style:solid;border-width:0 0 clamp(22px,2.5vw,61px) clamp(22px,2.5vw,61px);
  border-color:transparent transparent var(--ws-lime) transparent;
}
#worldDetailPanel .wd4-brief-kicker{
  display:flex;align-items:center;gap:10px;
  color:#4c5959;
  font:1000 clamp(10px,.7vw,15px)/1.3 var(--mono);
  letter-spacing:.055em;
}
#worldDetailPanel .wd4-brief-kicker:before{
  content:"";width:6px;height:18px;transform:skew(-15deg);
  background:var(--ws-coral);
}
#worldDetailPanel .wd4-description{
  /* WORLD story lead: centered on desktop at the original 1120px content width. */
  width:min(100%,1120px);
  color:#141d20;
  font:750 clamp(14px,1vw,23px)/1.64 var(--jpn);
  text-align:center;white-space:pre-wrap;overflow-wrap:anywhere;
}
#worldDetailPanel .wd4-description[data-short="true"]{text-align:center}
#worldDetailPanel .wd4-stats{
  display:flex;align-items:center;justify-content:center;flex-wrap:wrap;
  gap:clamp(14px,1.5vw,34px);
  color:#536364;
  font:900 clamp(10px,.59vw,14px)/1 var(--mono);
}
#worldDetailPanel .wd4-stats b{color:#161f22}
#worldDetailPanel .wd4-story-jump{
  display:flex;align-items:center;justify-content:center;
  width:100%;height:clamp(29px,2vw,48px);
  margin:0;padding:6px 0 1px;
  border:0;background:transparent;color:var(--ws-lime);
  font:900 clamp(10px,.64vw,14px)/1 var(--mono);
}
#worldDetailPanel .wd4-story-jump:hover{color:white}
#worldDetailPanel .world-detail-main.wd4-main{
  margin:0;padding:0;max-width:none;
  background:transparent;
}
#worldDetailPanel .world-detail-section-title{
  display:flex;flex-direction:row;align-items:end;justify-content:space-between;
  gap:18px;
  border-bottom:2px solid #58686b;
  padding:clamp(6px,.5vw,14px) 0 clamp(12px,.95vw,23px);
  margin:0 0 clamp(12px,1vw,22px);
}
#worldDetailPanel .world-detail-section-title>.mono{
  color:var(--ws-lime);
  font:900 clamp(10px,.77vw,16px)/1.2 var(--mono);
}
#worldDetailPanel .world-detail-section-title h3{
  color:#fff;margin:2px 0 0;
  font:1000 clamp(36px,3.2vw,78px)/1 var(--sans);
  letter-spacing:-.085em;
}
#worldDetailPanel .world-detail-section-title h3 i{
  color:transparent;font-style:normal;-webkit-text-stroke:1.4px white;
}
#worldDetailPanel .world-detail-section-title p{
  color:#c4d1cc;
  font:800 clamp(9px,.64vw,15px)/1.5 var(--mono);
  text-align:right;
}
#worldDetailPanel .world-story-list{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  align-items:stretch;
  gap:clamp(11px,.94vw,23px);
}
#worldDetailPanel .world-story-entry{
  position:relative;min-width:0;
  display:flex;flex-direction:column;
  border:3px solid #0f191b;border-bottom:5px solid #121c1e;
  background:#dce2df;box-shadow:4px 5px 0 #0008;
  overflow:hidden;
  transition:transform .18s,border-color .18s;
}
#worldDetailPanel .world-story-entry:hover{
  transform:translateY(-3px);
  border-color:var(--ws-lime);
}
#worldDetailPanel .world-story-entry.wd4-main-story{
  grid-column:1/-1;
  background:#f3f2e9;
  border-bottom:6px solid var(--ws-lime);
}
#worldDetailPanel .world-story-entry.wd4-main-story:before{
  content:"";position:absolute;z-index:2;
  left:0;top:0;
  height:clamp(110px,8vw,190px);width:clamp(15px,2.2vw,56px);
  background:var(--ws-coral);
  clip-path:polygon(0 0,75% 0,100% 100%,0 100%);
  pointer-events:none;
}
#worldDetailPanel .world-story-item{
  order:0;
  display:flex;align-items:center;gap:clamp(10px,.83vw,22px);
  flex:0 0 auto;
  width:100%;min-height:clamp(108px,7.6vw,180px);
  padding:clamp(15px,1vw,24px);
  background:transparent;border:0;
  color:#12191b;text-decoration:none;
  transform:none;
}
#worldDetailPanel .world-story-entry.wd4-main-story .world-story-item{
  min-height:clamp(113px,8vw,190px);
  padding-left:clamp(32px,3.9vw,96px);
}
#worldDetailPanel .world-story-item.clickable:hover{background:#fff;transform:none}
#worldDetailPanel .world-story-num{
  flex:0 0 auto;
  display:grid;place-items:center;
  min-width:clamp(43px,3.15vw,74px);
  width:clamp(43px,3.15vw,74px);
  height:clamp(46px,3.5vw,81px);
  background:#202a2d;color:#fff;box-shadow:3px 3px 0 #101617;
  font:1000 clamp(25px,2vw,48px)/1 var(--sans);
  transform:skew(-8deg);
}
#worldDetailPanel .wd4-main-story .world-story-num{
  color:#11191c;background:var(--ws-coral);
}
#worldDetailPanel .world-story-info{
  flex:1;min-width:0;
}
#worldDetailPanel .world-story-info small{
  display:block;color:#4b5857;
  font:1000 clamp(10px,.68vw,15px)/1 var(--mono);
  letter-spacing:.065em;margin-bottom:5px;
}
#worldDetailPanel .wd4-main-story .world-story-info small{color:#da3c40}
#worldDetailPanel .world-story-info b{
  display:block;
  color:#172021;
  font:1000 clamp(17px,1.3vw,29px)/1.32 var(--jpn);
  letter-spacing:-.045em;
  overflow-wrap:anywhere;
}
#worldDetailPanel .wd4-main-story .world-story-info b{
  font-size:clamp(27px,2.05vw,49px);
}
#worldDetailPanel .world-story-info p{
  margin:7px 0 0;color:#54625e;
  font:740 clamp(10px,.67vw,14px)/1.4 var(--jpn);
}
#worldDetailPanel .world-story-arrow{
  flex:0 0 auto;
  display:flex;align-items:center;justify-content:space-between;gap:12px;
  min-width:clamp(116px,9.8vw,233px);
  height:clamp(42px,3.25vw,76px);
  padding:0 clamp(10px,1vw,23px);
  background:#232d30;color:#fff;
  clip-path:polygon(0 0,100% 0,100% 77%,90% 100%,0 100%);
  font:1000 clamp(22px,1.55vw,36px)/1 var(--sans);
}
#worldDetailPanel .world-story-arrow-label{
  font:950 clamp(10px,.78vw,19px)/1 var(--jpn);
  white-space:nowrap;
}
#worldDetailPanel .wd4-main-story .world-story-arrow{
  background:var(--ws-lime);color:#11191b;
}
#worldDetailPanel .world-story-item.clickable:hover .world-story-arrow{
  background:var(--ws-coral);color:#11191b;
}
#worldDetailPanel .world-story-item.pending .world-story-arrow{
  background:#677475;color:#e3e9e6;
}
/* A SIDE story is a compact 3-part file: title → appearing cast → play.
   Give the last row its own solid area so it cannot overlap character faces. */
#worldDetailPanel .world-story-entry.wd4-side-story .world-story-item{
  min-height:clamp(90px,6.25vw,147px);
  padding-bottom:clamp(13px,.95vw,23px);
}
#worldDetailPanel .wd4-side-footer{
  order:2;min-height:clamp(51px,3.4vw,78px);
  display:flex;justify-content:flex-end;align-items:center;
  padding:clamp(7px,.55vw,14px);
  background:#dce2df;
  border-top:1px solid #9caaa6;
}
#worldDetailPanel .wd4-side-play{
  min-width:clamp(117px,7.9vw,180px);
  height:clamp(35px,2.4vw,54px);
  display:flex;align-items:center;justify-content:space-between;
  gap:12px;padding:0 clamp(11px,.7vw,17px);
  background:#202a2d;color:white;
  font:950 clamp(10px,.73vw,17px)/1 var(--jpn);
  text-decoration:none;
  clip-path:polygon(0 0,100% 0,100% 72%,84% 100%,0 100%);
  transition:background .2s,color .2s;
}
#worldDetailPanel .wd4-side-play span{
  font:1000 clamp(18px,1.28vw,28px)/1 var(--sans);
}
#worldDetailPanel .wd4-side-play.clickable:hover,
#worldDetailPanel .wd4-side-play.clickable:focus-visible{
  background:var(--ws-lime);color:#13191c;
}
#worldDetailPanel .wd4-side-play.pending{
  background:#778280;color:#ebeeee;
}

#worldDetailPanel .world-story-entry.wd4-side-story .world-story-item{
  display:grid;grid-template-columns:auto minmax(0,1fr);
  min-height:clamp(94px,5.2vw,132px);
  align-items:start;
  padding-bottom:clamp(14px,.96vw,24px);
}
#worldDetailPanel .world-story-entry.wd4-side-story .world-story-num{
  min-width:42px;width:42px;height:47px;
  font-size:24px;
}
#worldDetailPanel .world-story-entry.wd4-side-story .world-story-arrow{
  position:absolute;right:12px;bottom:11px;
  height:clamp(35px,2.25vw,50px);min-width:clamp(115px,7.6vw,172px);
}
#worldDetailPanel .world-story-entry.wd4-side-story .world-story-arrow-label{
  font-size:clamp(10px,.67vw,15px);
}
#worldDetailPanel .world-story-cast{
  order:1;
  display:flex;align-items:center;gap:clamp(12px,1.25vw,30px);
  min-height:clamp(72px,5.1vw,120px);
  padding:clamp(10px,.82vw,18px) clamp(12px,1.1vw,26px);
  background:#222d31;color:white;
  border-top:3px solid #101a1e;
}
#worldDetailPanel .world-story-entry.wd4-side-story .world-story-cast{
  position:relative;
  flex:0 0 auto;min-height:60px;padding:7px 12px;
  gap:10px;
}
#worldDetailPanel .world-story-cast-caption{
  display:flex;flex:0 0 clamp(102px,8vw,180px);
  flex-direction:column;
  font:1000 clamp(10px,.76vw,17px)/1.25 var(--jpn);
  color:#fff;white-space:nowrap;
}
#worldDetailPanel .world-story-cast-caption b{color:var(--ws-lime)}
#worldDetailPanel .world-story-cast-caption small{
  font:900 clamp(9px,.55vw,13px)/1.2 var(--mono);
  color:var(--ws-lime);margin-top:3px;
}
#worldDetailPanel .world-story-entry.wd4-side-story .world-story-cast-caption{
  flex:0 0 auto;font-size:10px;
}
#worldDetailPanel .world-story-entry.wd4-side-story .world-story-cast-caption small{
  display:none;
}
#worldDetailPanel .world-story-cast-faces{
  display:flex;align-items:center;flex-wrap:wrap;gap:clamp(8px,.7vw,18px);
}
#worldDetailPanel .world-story-avatar{
  width:auto;min-width:0;
  display:flex;align-items:center;gap:7px;
  flex:0 0 auto;
  padding:0;color:white;
  background:transparent;border:0;
}
#worldDetailPanel .world-story-avatar-portrait{
  display:block;position:relative;isolation:isolate;
  width:clamp(42px,3.1vw,76px);
  height:clamp(42px,3.1vw,76px);
  flex:0 0 auto;
  border:2px solid #f8fbf6;border-radius:9px;
  overflow:hidden;
  box-shadow:3px 3px 0 #05090b;
}
#worldDetailPanel .world-story-avatar-portrait img{
  width:100%;height:100%;
  object-fit:cover;
}
#worldDetailPanel .world-story-avatar-name{
  max-width:clamp(70px,7vw,155px);
  color:#edf3ee;
  font:850 clamp(9px,.65vw,15px)/1.3 var(--jpn);
  white-space:normal;text-align:left;
}
#worldDetailPanel .wd4-side-story .world-story-avatar-portrait{
  width:34px;height:34px;
}
#worldDetailPanel .wd4-side-story .world-story-avatar-name{font-size:10px}
#worldDetailPanel .world-story-cast-unlinked{
  color:#b8c6c3;font:900 10px var(--mono);
}
#worldDetailPanel .world-detail-section-title.cast-section{
  margin-top:clamp(32px,3vw,79px);
}
#worldDetailPanel .world-cast-grid{
  display:grid;grid-template-columns:repeat(4,minmax(0,1fr));
  gap:clamp(12px,1vw,24px);
}
#worldDetailPanel .world-cast-card{
  display:flex;align-items:stretch;
  min-width:0;min-height:clamp(117px,7.7vw,188px);
  gap:0;padding:0;
  border:2px solid #536166;border-bottom:4px solid #11191c;
  color:#121a1d;background:#e5e9e3;
  box-shadow:4px 5px 0 #05090b;
  transition:transform .17s,border-color .17s;
}
#worldDetailPanel .world-cast-card:hover,
#worldDetailPanel .world-cast-card:focus-visible{
  border-color:var(--ws-lime);transform:translateY(-3px);
}
#worldDetailPanel .world-cast-visual{
  display:block;flex:0 0 clamp(93px,8vw,198px);
  height:auto;min-height:100%;
  width:clamp(93px,8vw,198px);
  background:#151e21;border-right:3px solid #141d1e;
}
#worldDetailPanel .world-cast-visual img{
  object-fit:cover;width:100%;height:100%;
}
#worldDetailPanel .world-cast-info{
  display:flex;flex-direction:column;justify-content:center;
  gap:clamp(7px,.65vw,14px);min-width:0;
  padding:clamp(10px,.83vw,21px);
}
#worldDetailPanel .world-cast-info small{
  color:#5c6967;
  font:900 clamp(9px,.58vw,14px)/1.25 var(--mono);
}
#worldDetailPanel .world-cast-info strong{
  color:#12191a;
  font:1000 clamp(13px,.97vw,22px)/1.25 var(--jpn);
  overflow-wrap:anywhere;
}
#worldDetailPanel .world-cast-info em{
  color:#27373a;font:900 clamp(9px,.57vw,14px)/1 var(--mono);
  font-style:normal;
}
#worldDetailPanel .world-primary-link{
  color:#11191b;background:var(--ws-lime);
  margin-top:15px;box-shadow:4px 4px 0 #070c0d;
}
#worldDetailPanel .world-detail-foot{
  margin-top:clamp(28px,2.5vw,60px);
  color:#9eafac;border-top:1px solid #526164;
}
/* Mid desktop: prioritize readable cards, keep all data. */
@media(min-width:801px) and (max-width:1399px){
  #worldsPanel .world-cards{grid-template-columns:repeat(2,minmax(0,1fr))}
  #worldsPanel .world-card.ws5-card{height:clamp(408px,32vw,485px)}
  #worldDetailPanel .world-story-list{grid-template-columns:repeat(2,minmax(0,1fr))}
  #worldDetailPanel .world-cast-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  #worldDetailPanel .wd4-center{width:92%}
}
/* Mobile: always one cartridge per row, title / button / cast never overlap. */
@media(max-width:800px){
  #worldsPanel .directory-content{
    padding:23px 16px 62px;
  }
  #worldsPanel .directory-content h2{
    font-size:clamp(46px,12.5vw,71px);
  }
  #worldsPanel .world-cards{
    grid-template-columns:1fr;gap:16px;
    margin-top:20px;
  }
  #worldsPanel .world-card.ws5-card{
    height:clamp(410px,108vw,475px);
  }
  #worldsPanel .ws5-visual{flex:1 1 0%;height:auto;min-height:125px}
  #worldsPanel .ws5-huge{font-size:125px}
  #worldsPanel .ws5-name{font-size:clamp(26px,7.1vw,35px)}
  #worldsPanel .ws5-summary{font-size:12px}
  #worldsPanel .ws5-file-mark{font-size:10px}
  #worldsPanel .ws5-info{padding:16px 18px 13px}
  #worldsPanel .ws5-action{font-size:12px}
  #worldDetailPanel .wd4-center{width:94%;padding:13px 0 60px}
  #worldDetailPanel .wd4-hero.world-detail-hero{height:145px}
  #worldDetailPanel .wd4-hero .world-detail-backdrop img{
    right:-13%;width:230px;opacity:.65;
  }
  #worldDetailPanel .wd4-hero .world-detail-hero-content{
    padding:11px 14px;
  }
  #worldDetailPanel .wd4-hero .world-detail-kicker{
    font-size:9px;
  }
  #worldDetailPanel .wd4-hero .world-detail-hero-content h2{
    font-size:clamp(28px,8vw,42px);
  }
  #worldDetailPanel .wd4-hero .world-detail-subtitle{
    font-size:10px;max-width:85%;
  }
  #worldDetailPanel .wd4-brief{
    min-height:125px;padding:16px 14px;gap:9px;
  }
  #worldDetailPanel .wd4-brief-kicker{font-size:9px}
  #worldDetailPanel .wd4-description{
    /* Long-form world lore stays scannable on narrow screens. */
    font-size:13px;line-height:1.65;text-align:left;
  }
  #worldDetailPanel .wd4-stats{font-size:9px;gap:15px}
  #worldDetailPanel .wd4-story-jump{height:32px;font-size:10px}
  #worldDetailPanel .world-detail-section-title{
    align-items:start;flex-direction:column;gap:5px;
  }
  #worldDetailPanel .world-detail-section-title h3{
    font-size:clamp(30px,8.5vw,44px);
    white-space:nowrap;
  }
  #worldDetailPanel .world-detail-section-title p{
    font-size:10px;text-align:left;
  }
  #worldDetailPanel .world-story-list{grid-template-columns:1fr;gap:13px}
  #worldDetailPanel .world-story-entry.wd4-main-story{grid-column:auto}
  #worldDetailPanel .world-story-entry.wd4-main-story:before{
    width:12px;height:140px;
  }
  #worldDetailPanel .world-story-item,
  #worldDetailPanel .world-story-entry.wd4-main-story .world-story-item{
    position:relative;
    display:grid;grid-template-columns:auto minmax(0,1fr);
    align-items:start;
    gap:9px;min-height:130px;
    padding:13px 11px 58px;
  }
  #worldDetailPanel .world-story-entry.wd4-main-story .world-story-item{
    padding-left:24px;min-height:168px;
  }
  #worldDetailPanel .world-story-num,
  #worldDetailPanel .world-story-entry.wd4-side-story .world-story-num{
    width:40px;min-width:40px;height:43px;
    font-size:23px;
  }
  #worldDetailPanel .world-story-info b,
  #worldDetailPanel .wd4-main-story .world-story-info b{
    font-size:clamp(16px,5vw,22px);
    line-height:1.33;
  }
  #worldDetailPanel .world-story-info small{font-size:9px}
  #worldDetailPanel .world-story-arrow,
  #worldDetailPanel .world-story-entry.wd4-side-story .world-story-arrow{
    position:absolute;right:10px;bottom:10px;
    width:auto;min-width:140px;height:38px;
    padding:0 12px;gap:12px;
    font-size:21px;
  }
  #worldDetailPanel .world-story-arrow-label{
    font-size:11px;
  }
  #worldDetailPanel .wd4-side-footer{min-height:51px;padding:7px 8px}
  #worldDetailPanel .wd4-side-play{height:36px;min-width:133px;font-size:11px;padding:0 12px}
  #worldDetailPanel .world-story-cast{
    flex-direction:column;align-items:flex-start;
    gap:9px;min-height:0;
    padding:10px 9px;
  }
  #worldDetailPanel .world-story-cast-caption{
    flex:0 0 auto;flex-direction:row;align-items:center;gap:9px;
    font-size:11px;
  }
  #worldDetailPanel .world-story-cast-caption small{
    margin-top:0;font-size:9px;
  }
  #worldDetailPanel .world-story-avatar-portrait{width:40px;height:40px}
  #worldDetailPanel .world-story-avatar-name{font-size:9px}
  #worldDetailPanel .world-cast-grid{
    grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;
  }
  #worldDetailPanel .world-cast-card{flex-direction:column}
  #worldDetailPanel .world-cast-visual{
    width:100%;height:110px;min-height:110px;flex:0 0 110px;
    border-right:0;border-bottom:2px solid #161e20;
  }
  #worldDetailPanel .world-cast-info{padding:9px;gap:6px}
  #worldDetailPanel .world-cast-info strong{font-size:12px}
  #worldDetailPanel .world-cast-info small,
  #worldDetailPanel .world-cast-info em{font-size:8px}
}
@media(prefers-reduced-motion:reduce){
  #worldsPanel .ws5-art,
  #worldsPanel .world-card.ws5-card,
  #worldDetailPanel .world-story-entry,
  #worldDetailPanel .world-cast-card{transition:none!important}
}



/* WORLD IMAGE STUDIO v2 — preview is the actual public DOM + CSS in an isolated
   viewport. The parent only scales and crops that viewport to the selected item. */
#admin .world-image-studio{
  grid-column:1/-1;min-width:0;
  padding:clamp(13px,1.5vw,23px);
  background:#12191c;border:1px solid #63706e;outline:1px solid #101416;
}
#admin .world-image-studio-head{
  display:flex;justify-content:space-between;align-items:center;
  gap:12px;flex-wrap:wrap;
}
#admin .world-image-studio-kicker{
  font:900 11px/1.4 var(--mono);letter-spacing:.07em;color:#eaff55;
}
#admin .world-image-studio-head small{
  font:600 11px/1.5 var(--jpn);color:#b5c5c1;
}
#admin .world-image-tabs{
  display:flex;gap:5px;flex-wrap:wrap;margin:14px 0;
}
#admin .world-image-tabs button{
  background:#263034;color:#dde6e1;
  border:1px solid #526362;padding:9px 12px;
  font:900 11px/1.2 var(--mono);cursor:pointer;
}
#admin .world-image-tabs button[aria-pressed=true]{
  background:#eaff55;color:#172022;border-color:#eaff55;
}
#admin .world-image-canvas{
  display:flex;align-items:flex-start;justify-content:center;
  width:100%;min-height:160px;min-width:0;
  padding:16px;background:repeating-linear-gradient(90deg,#ffffff07 0 1px,transparent 1px 33px),#192225;
  overflow:hidden;
}
#admin .world-image-frame-shell{
  position:relative;flex:none;min-width:0;
  width:100%;min-height:80px;
  overflow:hidden;touch-action:none;user-select:none;
  cursor:grab;background:#11191b;
}
#admin .world-image-frame-shell.is-dragging{cursor:grabbing}
#admin .world-image-frame-shell iframe{
  position:absolute;top:0;left:0;display:block;
  max-width:none!important;border:0;
  pointer-events:none;transform-origin:top left;
  visibility:hidden;user-select:none;
}
#admin .world-image-drag-cover{
  position:absolute;z-index:3;inset:0;
  cursor:inherit;touch-action:none;
}
#admin .world-image-control-grid{
  display:grid;grid-template-columns:repeat(3,minmax(0,1fr));
  gap:14px;margin-top:17px;
}
#admin .world-image-range{
  display:flex;flex-direction:column;gap:8px;min-width:0;
}
#admin .world-image-range label{
  display:flex;justify-content:space-between;align-items:center;gap:8px;
  font:800 11px var(--jpn);color:#dce7e0;
}
#admin .world-image-range output{
  font:900 12px var(--mono);color:#eaff55;white-space:nowrap;
}
#admin .world-image-range input[type=range]{
  width:100%;accent-color:#eaff55;cursor:pointer;
}
#admin .world-image-range input:disabled{opacity:.35;cursor:not-allowed}
#admin .world-image-studio-foot{
  display:flex;align-items:center;justify-content:space-between;
  gap:10px;flex-wrap:wrap;margin-top:14px;
}
#admin .world-image-studio-foot small{
  font:600 11px/1.5 var(--jpn);color:#b5c5c1;
}
#admin .world-image-studio-actions{
  display:flex;flex-wrap:wrap;gap:7px;
}
#admin .world-image-studio-foot button{
  background:#1b2326;color:#eaff55;border:1px solid #758684;
  padding:9px 12px;font:900 11px var(--mono);cursor:pointer;
}
#admin .world-image-studio-foot button:disabled{opacity:.3;cursor:not-allowed}
#admin .world-image-studio.is-expanded{
  position:fixed;inset:clamp(12px,3vw,42px);
  z-index:4000;overflow-y:auto;
  background:#11181b;padding:clamp(15px,2vw,32px);
  border:2px solid #eaff55;outline:none;
  box-shadow:0 0 0 9999px #05090be6,10px 12px 0 #05090b;
}
#admin .world-image-studio.is-expanded .world-image-canvas{
  min-height:280px;padding:20px;
}
@media(max-width:600px){
 #admin .world-image-control-grid{grid-template-columns:1fr;gap:16px}
 #admin .world-image-tabs button{flex:1 1 30%;padding:9px 6px;font-size:9px}
 #admin .world-image-canvas{padding:12px 6px}
 #admin .world-image-studio.is-expanded{inset:8px;padding:14px}
}
