/* Full-width, contained artwork. Only the Gallery mode overrides the shared dialog. */
.character-appearances.is-gallery{width:calc(100vw - 24px);max-height:calc(100dvh - 24px);height:calc(100dvh - 24px);border:0;border-radius:0;background:transparent;box-shadow:none;overflow:hidden}
.character-appearances.is-gallery::backdrop{background:#000d;backdrop-filter:blur(5px)}
.is-gallery .character-info-header{width:min(1240px,100%);margin:0 auto;box-sizing:border-box;padding:8px 18px 16px;grid-template-columns:100px 56px minmax(0,1fr) 56px clamp(100px,14vw,176px);grid-template-rows:auto auto;gap:8px 20px;align-items:center}
.is-gallery .character-info-toolbar .character-info-back{grid-column:1;grid-row:1 / span 2;align-self:center}
.is-gallery .character-info-arrows{display:contents}
.is-gallery .character-info-arrows button{min-width:56px;min-height:56px;font-size:2.2rem}
.is-gallery .character-info-toolbar .character-info-back{min-height:56px;font-size:1.5rem;padding:8px 14px}
.is-gallery #character-info-previous{grid-column:2;grid-row:1 / span 2}
.is-gallery #character-info-next{grid-column:4;grid-row:1 / span 2}
.is-gallery .character-info-name{grid-column:3;grid-row:1;align-self:end;font-size:clamp(2.4rem,5vw,4.8rem)}
.is-gallery .character-info-icon{grid-column:5;grid-row:1 / span 2;width:100%;max-height:176px;align-self:center;object-fit:contain}
.is-gallery .character-info-header h2{grid-column:3;grid-row:2;align-self:start;text-align:center;text-transform:uppercase;border:0;padding:0;color:var(--green);font:400 clamp(1.7rem,2.8vw,2.6rem)/1.1 var(--pixel)}
.is-gallery .character-info-facts{display:none}
.is-gallery .character-appearances-content{display:flex;flex:1;min-height:0;max-height:none;padding:0;overflow-y:auto;overflow-x:hidden}
.character-gallery-viewer{display:flex;flex-direction:column;flex:1;width:100%;min-height:0}
.character-gallery-stage{position:relative;flex:1;min-height:180px;overflow:hidden;cursor:grab;touch-action:pan-y pinch-zoom;user-select:none;-webkit-user-select:none;outline-offset:-3px}
.character-gallery-stage:focus-visible{outline:2px solid #61bf2b}
.character-gallery-stage.is-dragging{cursor:grabbing}
.character-gallery-photo{position:absolute;left:50%;top:0;bottom:0;width:var(--gallery-card-width);margin-left:calc(var(--gallery-card-width) / -2);display:grid;place-items:center;transform-origin:center;will-change:transform,opacity}
.character-gallery-artwork{position:relative;flex:none;overflow:hidden;max-width:100%;max-height:100%;pointer-events:none}
.character-gallery-photo img{display:block;position:absolute;max-width:none;max-height:none;object-fit:contain;pointer-events:none;-webkit-user-drag:none;image-rendering:auto}
.character-photo-controls{flex:0 0 auto;width:min(1160px,calc(100% - 32px));margin:20px auto 12px;display:grid;grid-template-columns:48px minmax(0,1fr) 48px;align-items:center;gap:20px}
.character-photo-arrow{width:48px;min-height:48px;padding:0;border:1px solid #4d7b34;background:#081006;color:var(--green);font:400 2rem/1 var(--pixel);cursor:pointer}
.character-photo-arrow:hover{background:#14250b}
.character-photo-arrow:focus-visible{outline:2px solid var(--green);outline-offset:3px}
.character-photo-arrow:disabled{opacity:.4;cursor:default}
.character-photo-caption{text-align:center;padding:12px 18px;border:2px solid var(--green);background:#112b07;color:var(--green);min-height:76px;display:flex;flex-direction:column;justify-content:center;box-sizing:border-box}
.character-photo-description{margin:0;font:400 clamp(1.05rem,1.65vw,1.6rem)/1.4 Arial,Helvetica,sans-serif;overflow-wrap:anywhere}
.character-photo-counter{display:block;margin-top:5px;font:400 1rem/1.1 var(--pixel);color:#b8c8af}
.character-gallery-empty{width:100%;margin:auto;text-align:center;color:#b8c8af;font-size:1.1rem}
.character-gallery-image-error{text-align:center;color:#b8c8af;padding:24px}
@media(max-width:600px){
 .character-appearances.is-gallery{width:100%;height:calc(100dvh - 16px);max-height:calc(100dvh - 16px)}
 .is-gallery .character-info-header{padding:8px 12px 12px;grid-template-columns:64px minmax(0,1fr) 88px;grid-template-rows:auto auto 48px;gap:6px 10px}
 .is-gallery .character-info-toolbar .character-info-back{font-size:1.2rem;padding:6px;min-height:48px}
 .is-gallery .character-info-name{grid-column:2;grid-row:1;font-size:clamp(1.8rem,6vw,2.5rem);line-height:1.05}
 .is-gallery .character-info-icon{grid-column:3;grid-row:1 / span 2;max-height:88px}
 .is-gallery .character-info-header h2{grid-column:2;grid-row:2;font-size:1.6rem}
 .is-gallery .character-info-arrows button{min-width:48px;min-height:48px;font-size:2rem}
 .is-gallery #character-info-previous{grid-column:2;grid-row:3;justify-self:start}
 .is-gallery #character-info-next{grid-column:2;grid-row:3;justify-self:end}
 .character-photo-controls{width:calc(100% - 20px);grid-template-columns:44px minmax(0,1fr) 44px;gap:6px;margin:12px auto 8px}
 .character-photo-arrow{width:44px;min-height:44px}
 .character-photo-caption{padding:10px 8px;min-height:90px}
 .character-photo-description{font-size:1rem;line-height:1.35}
}
@media(max-height:500px) and (min-width:601px){
 .is-gallery .character-info-header{grid-template-columns:90px 48px minmax(0,1fr) 48px 84px;padding-bottom:8px}
 .is-gallery .character-info-icon{max-height:84px}
 .is-gallery .character-info-name{font-size:2.4rem}
 .is-gallery .character-info-arrows button{min-width:48px;min-height:48px}
 .is-gallery .character-info-toolbar .character-info-back{min-height:48px;font-size:1.3rem}
 .character-photo-controls{margin:8px auto 0}
 .character-photo-caption{min-height:55px;padding:5px 10px}
 .character-photo-description{font-size:1rem}
 .character-gallery-stage{min-height:120px}
}
@media(prefers-reduced-motion:reduce){.character-gallery-photo{transition:none!important}}
