/* A readable field guide, separate from the fixed-height selection scene. */
.character-top{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);gap:10px}
.character-top .eyebrow{justify-self:start;text-align:left;max-width:100%;line-height:1.5}
.character-top #characterBack{justify-self:end;white-space:nowrap}
.character-top #characterStats{color:#f2d7a3;border-color:#e8c58655;background:#e6c48610;white-space:nowrap;font-weight:650;padding-inline:13px}
dialog.character-guide{padding:0;width:min(1040px,calc(100vw - 40px));height:min(900px,92dvh);max-width:100vw;max-height:100dvh;overflow:hidden;border:1px solid #bda2dc55;border-radius:24px;background:#171122;color:#f6effc;box-shadow:0 24px 100px #000a}
.character-guide[open]{display:flex;flex-direction:column}
.character-guide::backdrop{background:#090611dc;backdrop-filter:blur(12px)}
.guide-header{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:24px 30px 17px;flex-shrink:0;background:linear-gradient(110deg,#342044,#21172d);border-bottom:1px solid #eed7ff18}
.guide-header h2{font-size:clamp(24px,3vw,32px);letter-spacing:-.04em;margin:10px 0 0}
.guide-header .guide-kicker{transform:translateY(10px);margin:0;color:#e1c18b}
.guide-close{width:44px;height:44px;flex-shrink:0;border-radius:50%;background:#ffffff12;border:1px solid #ffffff24;font-size:29px;line-height:1}
.guide-nav{display:flex;flex-wrap:wrap;gap:6px;padding:13px 24px;flex-shrink:0;background:#1d1529;border-bottom:1px solid #eed7ff18}
.guide-nav button{flex:1 1 auto;min-height:44px;padding:10px 13px;border:1px solid transparent;border-radius:10px;font-size:12px;font-weight:650;background:transparent;color:#c3b6cf;white-space:nowrap}
.guide-nav button[aria-selected=true]{background:#ffffff0c;border-color:var(--guide-accent);color:var(--guide-accent)}
.guide-scroll{min-height:0;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;touch-action:pan-y;scrollbar-color:#6a507c #21172d;scrollbar-width:thin}
.guide-intro{font-size:12px;line-height:1.6;color:#bdafca;margin:0;padding:22px 30px 0;max-width:760px}
.guide-loading{padding:28px 30px;color:#d9cce4;font-size:14px}
.guide-loading p{margin-top:0}
.guide-loading button{background:#e8c98e;color:#33243c;padding:12px 20px;border-radius:12px;min-height:44px}
.guide-profile{--guide-accent:#e8c98e;padding:0 30px 28px;outline-offset:-4px}
.guide-kicker{font-size:10px!important;font-weight:750;letter-spacing:.15em;line-height:1.5;text-transform:uppercase;color:var(--guide-accent,#e8c98e);margin:0 0 9px}
.guide-hero{display:grid;grid-template-columns:minmax(0,.9fr) minmax(0,1.1fr);gap:36px;align-items:center;position:relative;padding:25px 15px 30px}
.guide-portrait{height:360px;display:flex;align-items:center;justify-content:center;position:relative;isolation:isolate}
.guide-portrait::before{content:'';position:absolute;inset:12% 5% 3%;border-radius:50%;background:radial-gradient(ellipse,color-mix(in srgb,var(--guide-accent) 19%,transparent),transparent 68%);z-index:-1}
.guide-portrait img{display:block;width:100%;height:100%;object-fit:contain;filter:drop-shadow(0 16px 18px #0005)}
.guide-hero-copy h3{font-size:clamp(38px,5vw,64px);line-height:1.04;letter-spacing:-.055em;margin:10px 0 18px;color:#fff6ff;overflow-wrap:anywhere}
.guide-lede{color:#d8cae3;font-size:17px;line-height:1.75;margin:0;max-width:40ch}
.guide-section{padding:28px 0;border-top:1px solid #ebd5ff19}
.guide-section h3,.guide-profile-footer h3{font-size:22px;letter-spacing:-.025em;margin:0 0 16px}
.guide-section p,.guide-profile-footer p{font-size:14px;line-height:1.8;color:#cfc0dc;margin:0}
.guide-stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin:0}
.guide-stats>div{padding:18px 15px;background:linear-gradient(140deg,#ffffff08,#ffffff03);border:1px solid #ffffff13;border-radius:14px}
.guide-stats dt{font-size:11px;color:#cdbdd7;margin-bottom:10px}
.guide-stats dd{font-size:21px;line-height:1.25;font-weight:750;color:var(--guide-accent);margin:0;letter-spacing:-.025em}
.guide-stats p{font-size:11px;line-height:1.55;margin-top:10px;color:#b8a8c5}
.guide-editorial{display:grid;grid-template-columns:1fr 1fr;gap:32px}
.guide-identity{margin:24px 0 0;font-size:13px}
.guide-identity>div{padding:13px 0;border-top:1px solid #ffffff0d}
.guide-identity dt{font-size:10px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:#a998b8;margin-bottom:6px}
.guide-identity dd{margin:0;line-height:1.7;color:#e9dcec}
.guide-section .guide-subhead{font-size:18px;margin-top:26px}
.guide-note h4{font-size:14px;line-height:1.6;margin:0 0 8px;font-weight:700;color:#f0e5f7}
.guide-timeline{border-left:1px solid #b495ce3d;margin-left:4px;padding-left:20px}
.guide-timeline .guide-note{position:relative;margin-bottom:22px}
.guide-timeline .guide-note::before{content:'';position:absolute;width:7px;height:7px;left:-24px;top:8px;border-radius:50%;background:var(--guide-accent)}
.guide-power-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.guide-power-grid .guide-note{background:#ffffff04;border:1px solid #ffffff0c;border-radius:14px;padding:20px}
.guide-strategy{display:grid;grid-template-columns:repeat(3,1fr);gap:24px}
.guide-gallery-intro{margin-bottom:20px!important}
.guide-gallery{display:grid;grid-template-columns:1fr 1fr;gap:18px}
.guide-gallery figure{margin:0;border:1px solid #d7b8f322;border-radius:16px;overflow:hidden;background:#100b18;align-self:start}
.guide-art-link{display:block;background:radial-gradient(ellipse,#31233b,#100b18);padding:12px}
.guide-art-link img{display:block;width:100%;height:380px;object-fit:contain;border-radius:5px}
.guide-gallery figcaption{padding:16px 18px 18px;border-top:1px solid #ffffff0d}
.guide-gallery figcaption strong{display:block;font-size:14px;line-height:1.5;margin-bottom:7px}
.guide-gallery figcaption>span{display:block;font-size:12px;line-height:1.6;color:var(--guide-accent);overflow-wrap:anywhere}
.guide-profile a{text-underline-offset:4px;text-decoration-color:#d1b4ec66}
.guide-profile a:hover{text-decoration-color:currentColor}
.guide-profile-footer{border-top:1px solid #ebd5ff19;padding:24px 0 0}
.guide-profile-footer h3{font-size:15px}
.guide-profile-footer ul{list-style:none;display:flex;gap:10px 20px;flex-wrap:wrap;padding:0;margin:0 0 18px;font-size:11px;line-height:1.8;color:#d4bedf}
.guide-profile-footer li{max-width:100%;overflow-wrap:anywhere}
.guide-profile-footer p{font-size:11px;max-width:78ch;color:#ac9cba}
@media(max-width:700px){
 dialog.character-guide{width:100%;height:100dvh;max-height:100dvh;margin:0;border:0;border-radius:0}
 .guide-header{padding:calc(17px + env(safe-area-inset-top)) 20px 15px}
 .guide-nav{padding:10px 16px;gap:5px;display:grid;grid-template-columns:repeat(3,minmax(0,1fr))}
 .guide-nav button{padding:8px 3px;font-size:11px}
 .guide-intro{padding:18px 22px 0;font-size:11px}
 .guide-profile{padding:0 22px calc(28px + env(safe-area-inset-bottom))}
 .guide-hero{grid-template-columns:minmax(0,1fr);gap:16px;text-align:center;padding:20px 0 28px}
 .guide-portrait{height:300px}
 .guide-hero-copy h3{font-size:44px;margin:8px 0 14px}
 .guide-lede{font-size:15px;line-height:1.75;max-width:38ch;margin:auto}
 .guide-stats{grid-template-columns:1fr 1fr}
 .guide-stats>div{padding:17px 14px}
 .guide-stats dd{font-size:20px}
 .guide-editorial,.guide-power-grid,.guide-strategy,.guide-gallery{grid-template-columns:1fr;gap:0}
 .guide-power-grid{gap:12px}
 .guide-strategy{gap:23px}
 .guide-gallery{gap:20px}
 .guide-art-link img{height:auto;max-height:520px;min-height:240px}
 .guide-section{padding:25px 0}
 .guide-section p{font-size:14px}
}
@media(max-width:380px){.character-top{gap:6px}.character-top .eyebrow{font-size:8px;letter-spacing:.08em}.character-top button{padding-inline:8px;font-size:10px}.character-top #characterStats{padding-inline:8px}.guide-profile{padding-inline:18px}.guide-nav{padding-inline:12px}.guide-portrait{height:270px}}
@media(max-height:500px) and (orientation:landscape){.guide-header{padding:10px 22px}.guide-header h2{font-size:22px}.guide-nav{padding:5px 20px}.guide-nav button{min-height:38px}.guide-hero{grid-template-columns:1fr 1fr;gap:24px;text-align:left}.guide-portrait{height:270px}}

.guide-art-credits{display:block;color:#ad9abb;font-size:10px;line-height:1.7;margin-top:8px}
.guide-image-open{display:block;width:100%;border:0;background:transparent;padding:0;cursor:zoom-in}.guide-image-open:focus-visible{outline:2px solid #ffdb98;border-radius:18px}.astra-image-viewer{box-sizing:border-box;width:min(94vw,760px);max-height:92dvh;overflow:auto;border:1px solid #a78bb8;border-radius:22px;background:#191126;color:#ead6fa;padding:56px 22px 22px;box-shadow:0 20px 80px #0009}.astra-image-viewer::backdrop{background:#0c071bbd;backdrop-filter:blur(8px)}.image-close{position:absolute;right:12px;top:8px;font-size:34px;background:none;color:#ead6fa;border:0;min-width:44px;min-height:44px}.image-full{display:block;max-width:100%;width:auto;max-height:65dvh;margin:auto;object-fit:contain}.image-full[hidden]{display:none}.image-actions{display:flex;gap:10px;flex-wrap:wrap;justify-content:center;margin-top:18px}.image-actions>*{font:inherit;padding:12px;border:1px solid #ba99cf;border-radius:12px;background:#31213f;color:#ead6fa;text-decoration:none}.image-actions .image-save{background:#ffdb98;color:#251831}.image-status{text-align:center;font-size:12px}.image-print-frame{position:fixed;width:1px;height:1px;opacity:0;pointer-events:none}

/* Keep the clickable portrait inside its reserved layout space. */
.guide-portrait>.guide-image-open{height:100%;min-height:0;max-height:100%;min-width:0;flex:1;overflow:hidden;box-sizing:border-box}
.guide-portrait>.guide-image-open>img{width:100%;height:100%;max-width:100%;max-height:100%;object-fit:contain;object-position:center;transform:none}
.guide-profile>.guide-portrait{margin-top:24px;margin-bottom:24px}

/* Enlarge only the dragon princess portrait in Stats & Powers; reserve its full height. */
#guide-profile-ember>.guide-portrait{height:540px;margin:36px auto}
@media(max-width:700px){#guide-profile-ember>.guide-portrait{height:450px}}
@media(max-width:380px){#guide-profile-ember>.guide-portrait{height:405px}}
@media(max-height:500px) and (orientation:landscape){#guide-profile-ember>.guide-portrait{height:405px}}

/* One blank-line-sized gap between the biography paragraphs. */
#guide-profile-ember .guide-section p+p{margin-top:1.8em}

.guide-locked{display:flex;align-items:center;justify-content:center;min-height:56px;color:#cbb9dd;font-size:24px;font-weight:700;cursor:default}

/* Center the supplied wide PNG without shrinking Mario into its transparent margins. */
#guide-profile-mario .guide-image-open{display:flex;align-items:center;justify-content:center}
#guide-profile-mario .guide-image-open>img{width:auto;max-width:none;height:100%;flex-shrink:0}

.guide-portrait img{image-rendering:auto;filter:drop-shadow(0 5px 6px #0004)}

/* Wide transparent art must not enlarge the profile grid beyond the viewport. */
.guide-hero>.guide-portrait,.guide-hero>.guide-hero-copy{min-width:0;max-width:100%}
