/* Preserve the original cyberpunk cards; open the editorial character file in a native modal. */
#characters .character-showcase{display:block}
#characters .character-dialog button:focus-visible{outline:3px solid #51a1ff;outline-offset:4px}
#characters .character-card>img{height:calc(100% - 48px)}
#characters .character-name{min-height:48px}
html:has(.character-dialog[open]){overflow:hidden}
#characters .character-dialog{
 position:fixed;inset:0;margin:0;padding:0;border:0;width:100%;max-width:none;height:100dvh;max-height:none;overflow:auto;
 color:#141820;background:#fff;overscroll-behavior:contain;text-align:left
}
#characters .character-dialog::backdrop{background:#080b11}
#characters .character-dialog-bar{
 position:sticky;top:0;z-index:4;min-height:68px;padding:10px max(24px,env(safe-area-inset-right)) 10px max(24px,env(safe-area-inset-left));
 display:flex;align-items:center;justify-content:space-between;gap:20px;background:#10141d;color:#fff;border-bottom:2px solid #2678f0
}
#characters .character-dialog-brand{font-size:11px;font-weight:800;letter-spacing:.19em;color:#b6ceef}
#characters .character-dialog-close{
 padding:8px 14px;min-height:44px;border:1px solid #5b7091;background:transparent;color:#fff;font-size:13px;font-weight:800;text-transform:uppercase;letter-spacing:.09em
}
#characters .character-dialog-close:hover{background:#1261dc;border-color:#1261dc}
#characters .character-stage{display:grid;grid-template-columns:minmax(0,1.08fr) minmax(0,1fr);min-height:calc(100dvh - 68px)}
#characters .character-stage-visual{
 min-width:0;position:relative;display:grid;place-items:end center;overflow:hidden;isolation:isolate;
 background:linear-gradient(128deg,transparent 72%,#061f633d 72%),radial-gradient(ellipse at 55% 70%,#1c78f1,#0646a9 76%)
}
#characters .character-stage-visual::after{
 content:'IRIDESCENT';position:absolute;bottom:24px;left:22px;color:#fff9;font-size:10px;letter-spacing:.45em;writing-mode:vertical-rl;transform:rotate(180deg)
}
#characters .character-stage-art{
 position:relative;z-index:1;max-width:93%;width:100%;height:clamp(380px,calc(100dvh - 78px),980px);
 object-fit:contain;object-position:center bottom;filter:drop-shadow(12px 12px 0 #061c4950)
}
#characters .character-stage-content{padding:clamp(36px,7vw,115px);align-self:center;min-width:0;background:#fff}
#characters .character-stage-kicker{display:block;color:#0f5cd8;font-size:10px;font-weight:800;letter-spacing:.17em;margin-bottom:22px}
#characters .character-stage-title{
 font-family:var(--font-heading),sans-serif;text-transform:uppercase;font-size:clamp(38px,6vw,96px);font-weight:900;
 letter-spacing:-.055em;line-height:.93;margin:0 0 26px;color:#12151b;overflow-wrap:anywhere
}
#characters .character-stage-bio{font-size:clamp(14px,1.15vw,17px);line-height:1.8;color:#485464;margin:0;max-width:53ch}
#characters .character-stage-controls{display:flex;gap:20px;align-items:center;margin-top:34px}
#characters .character-stage-controls button{display:grid;place-items:center;width:46px;height:46px;border:1px solid #bfcadb;background:#fff;color:#0f5cd8;font-size:22px}
#characters .character-stage-controls button:hover{background:#0f5cd8;color:#fff;border-color:#0f5cd8}
#characters .character-stage-count{font-size:11px;letter-spacing:.14em;font-weight:800;color:#596475}
#characters .character-sketch-panel{
 min-width:0;display:flex;flex-direction:column;justify-content:center;gap:16px;
 padding:clamp(26px,3vw,54px);background:#fff;border-top:1px solid #dce4ef
}
#characters .character-sketch-kicker{
 color:#0f5cd8;font-size:10px;font-weight:800;letter-spacing:.18em
}
#characters .character-sketches{display:grid;align-items:start;gap:18px;min-width:0}
#characters .character-sketch-image{
 display:block;width:100%;height:auto;max-height:68dvh;object-fit:contain;object-position:center
}
@media(min-width:701px) and (max-width:1049px){
 #characters .character-stage.has-sketches .character-sketch-panel{grid-column:1/-1}
 #characters .character-stage.has-sketches .character-sketches{width:min(100%,560px);margin:auto}
}
@media(min-width:1050px){
 #characters .character-stage.has-sketches{grid-template-columns:minmax(0,1.10fr) minmax(0,1fr) minmax(0,.92fr)}
 #characters .character-stage.has-sketches .character-stage-content{padding:clamp(27px,3.3vw,70px)}
 #characters .character-stage.has-sketches .character-stage-title{font-size:clamp(37px,4.1vw,79px)}
 #characters .character-stage.has-sketches .character-sketch-panel{border-top:0;border-left:0}
}

@media(max-width:700px){
 #characters .character-dialog-bar{min-height:58px;padding:6px 16px}
 #characters .character-stage{grid-template-columns:1fr;min-height:calc(100dvh - 58px)}
 #characters .character-stage-art{height:clamp(215px,43dvh,390px)}
 #characters .character-stage-content{padding:28px 22px max(28px,env(safe-area-inset-bottom))}
 #characters .character-stage-kicker{margin-bottom:12px}
 #characters .character-stage-title{margin-bottom:17px}
 #characters .character-stage-controls{margin-top:23px}
}
/* Iridescent entrance: an angled aperture, a blue sweep, then a staggered portrait and typography reveal. */
@media(prefers-reduced-motion:no-preference){
 #characters .character-dialog[open]{
  animation:character-aperture .42s cubic-bezier(.2,.75,.24,1) backwards
 }
 #characters .character-dialog[open]::before{
  content:"";position:fixed;z-index:6;inset:-15% -42%;pointer-events:none;
  background:linear-gradient(115deg,transparent 45%,#1575ff46 48%,#6ddaffac 50%,#247cfe52 51%,transparent 55%);
  animation:character-blue-sweep .46s cubic-bezier(.22,.66,.3,1) both
 }
 #characters .character-dialog[open] .character-reveal .character-stage-art{
  animation:character-art-in .54s cubic-bezier(.15,.75,.24,1) .08s both
 }
 #characters .character-dialog[open] .character-reveal .character-stage-kicker{
  animation:character-label-in .28s ease-out .17s both
 }
 #characters .character-dialog[open] .character-reveal .character-stage-title{
  animation:character-title-in .45s cubic-bezier(.16,.74,.27,1) .21s both
 }
 #characters .character-dialog[open] .character-reveal .character-stage-bio{
  animation:character-bio-in .36s ease-out .36s both
 }
 #characters .character-dialog[open] .character-reveal .character-sketch-panel:not([hidden]){
  animation:character-sketch-in .39s ease-out .29s both
 }
}
@keyframes character-aperture{
 from{clip-path:polygon(0 0,0 0,0 100%,0 100%)}
 18%{clip-path:polygon(0 0,26% 0,8% 100%,0 100%)}
 to{clip-path:polygon(0 0,100% 0,100% 100%,0 100%)}
}
@keyframes character-blue-sweep{
 0%{transform:translateX(-49%);opacity:.1}
 32%{opacity:1}
 100%{transform:translateX(54%);opacity:0}
}
@keyframes character-art-in{
  from{opacity:0;transform:translate3d(-48px,18px,0) scale(.965)}
  to{opacity:1;transform:none}
}
@keyframes character-label-in{
  from{opacity:0;transform:translateX(12px)}
  to{opacity:1;transform:none}
}
@keyframes character-title-in{
  from{opacity:0;clip-path:inset(100% -8% -16% -8%);transform:translateY(22px)}
  to{opacity:1;clip-path:inset(-12% -8% -16% -8%);transform:none}
}
@keyframes character-bio-in{
  from{opacity:0;transform:translateY(11px)}
  to{opacity:1;transform:none}
}
@keyframes character-sketch-in{from{opacity:0;transform:translateX(16px)}to{opacity:1;transform:none}}
@media(prefers-reduced-motion:reduce){#characters *{transition:none!important;animation:none!important}}

/* Manga panels from the supplied artwork, behind the open portrait only. */
#characters .character-stage-visual{
 background:#fff url("assets/character-manga-panels.webp") center center / cover no-repeat;
}
#characters .character-stage-visual::after{display:none}
/* Preserve the color backdrop's original alpha so the manga panels show around it. */
#characters .character-stage-backdrop{
 position:absolute;inset:0;z-index:0;width:100%;height:100%;
 object-fit:contain;object-position:left bottom;pointer-events:none;
}

#characters .character-grid .character-card{height:auto;aspect-ratio:auto}
#characters .character-grid .character-card>img{width:100%;height:auto;aspect-ratio:4/5;object-fit:contain;object-position:center bottom}
#characters .character-grid .character-name{position:relative;inset:auto}
