.gallery-shell{width:min(1240px,calc(100% - 40px));margin:0 auto;padding:54px 0 90px;color:#ecf8ff}
.gallery-page-heading{margin-bottom:30px}
.gallery-eyebrow{margin:0 0 9px;color:#71d1f4;font-size:11px;font-weight:800;letter-spacing:.13em;text-transform:uppercase}
.gallery-page-heading h1,.gallery-detail h1{margin:0;font-size:clamp(32px,4vw,55px);line-height:1.1}
.gallery-layout{display:grid;grid-template-columns:minmax(0,1fr) 280px;align-items:start;gap:32px}
.gallery-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));align-items:start;gap:14px}
.gallery-column{display:flex;flex-direction:column;gap:14px;min-width:0}
.gallery-card{display:block;overflow:hidden;border:1px solid #264964;border-radius:14px;background:#10283c;color:#f2fbff;text-decoration:none;box-shadow:0 9px 22px #03101a4d}
.gallery-card-image{position:relative;display:block;width:100%;overflow:hidden;background:#18364c;aspect-ratio:1}
.gallery-grid-official .gallery-card-image{aspect-ratio:16/9}
.gallery-grid-fanart{--fanart-columns:4;position:relative}
.gallery-grid-fanart[data-masonry-ready]{display:block}
.gallery-grid-fanart .gallery-card-image{aspect-ratio:auto;min-height:40px}
.gallery-grid-fanart .gallery-card-image img{height:auto;object-fit:contain}
.gallery-card-image img,.gallery-rank-cover img{display:block;width:100%;height:100%;object-fit:cover}
.gallery-image-placeholder{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 48' fill='none' stroke='%234c6b80' stroke-width='2'%3E%3Crect x='2' y='2' width='60' height='44' rx='5'/%3E%3Ccircle cx='19' cy='15' r='5'/%3E%3Cpath d='m5 40 18-18 11 12 9-9 16 15'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:center;background-size:48px 36px}
.gallery-image-placeholder>img{opacity:0}
.gallery-image-placeholder>img[data-gallery-state=loaded]{opacity:1}
.gallery-card-image::after,.gallery-rank-cover::after{content:"";position:absolute;inset:45% 0 0;background:linear-gradient(transparent,#0713209c);pointer-events:none}
.gallery-card-tags{position:absolute;z-index:1;inset-inline-start:8px;bottom:8px;display:flex;flex-wrap:wrap;gap:4px;max-width:calc(100% - 16px)}
.gallery-card-tags span,.gallery-detail-tags span{display:inline-block;padding:3px 9px;border-radius:999px;background:#2185d9;color:#fff;font-size:11px;font-weight:800;line-height:1.25;box-shadow:0 2px 6px #06152280}
.gallery-card>strong{display:block;padding:13px 13px 14px;font-size:16px;line-height:1.4;text-align:center}
.gallery-card:hover,.gallery-card:focus-visible{border-color:#78d7f1;transform:translateY(-2px)}
.gallery-card:focus-visible,.gallery-ranking a:focus-visible,.gallery-artwork-open:focus-visible,.gallery-back:focus-visible{outline:2px solid #91e6fa;outline-offset:3px}
.gallery-ranking{position:sticky;top:22px;padding:18px;border:1px solid #315873;border-radius:15px;background:#0b2337}
.gallery-ranking h2{margin:0 0 15px;font-size:18px;line-height:1.4}
.gallery-ranking ol{margin:0;padding:0;list-style:none;counter-reset:gallery-rank}
.gallery-ranking li{counter-increment:gallery-rank;border-top:1px solid #26465c}
.gallery-ranking li:first-child{border-top:0}
.gallery-ranking a{display:grid;grid-template-columns:88px minmax(0,1fr) auto;align-items:center;gap:10px;padding:9px 0;color:#eaf7fd;text-decoration:none}
.gallery-ranking a::after{content:"#" counter(gallery-rank);color:#65c4ec;font-size:13px;font-weight:900}
.gallery-ranking strong{overflow:hidden;font-size:13px;line-height:1.4;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}
.gallery-rank-cover{position:relative;display:block;width:88px;aspect-ratio:16/9;overflow:hidden;border-radius:8px;background:#193c54}
.gallery-rank-cover .gallery-card-tags{inset-inline-start:3px;bottom:3px;gap:2px;max-width:calc(100% - 6px)}
.gallery-rank-cover .gallery-card-tags span{padding:1px 4px;font-size:8px}
.gallery-empty{padding:38px 20px;border:1px dashed #42667d;border-radius:14px;text-align:center;color:#a9c9da}
.gallery-detail-shell{max-width:1100px}
.gallery-detail{padding:28px;border:1px solid #315873;border-radius:18px;background:#0b2236}
.gallery-back{display:inline-flex;width:38px;height:38px;margin-bottom:18px;align-items:center;justify-content:center}
.gallery-back img{display:block;max-width:100%;max-height:100%}
.gallery-detail>header{margin-bottom:24px}
.gallery-detail-tags{display:flex;flex-wrap:wrap;gap:6px;margin-top:14px}
.gallery-artwork-author{margin:10px 0 0;color:#b9d9e8;font-size:14px}
.gallery-artwork-images{display:grid;gap:18px}
.gallery-artwork-open{display:block;width:100%;padding:0;overflow:hidden;border:0;border-radius:12px;background:#061625;cursor:zoom-in}
.gallery-artwork-open img{display:block;width:100%;height:auto;max-height:78vh;object-fit:contain;margin:auto}
.gallery-lightbox{width:min(96vw,1600px);max-width:none;max-height:96vh;padding:12px;border:1px solid #46718c;border-radius:14px;background:#061a2b;color:#fff;box-shadow:0 30px 90px #000b}
.gallery-lightbox::backdrop{background:#020a12e8}
.gallery-lightbox[open]{display:flex;flex-direction:column;gap:10px}
.gallery-lightbox-actions{display:flex;justify-content:flex-end;gap:9px}
.gallery-lightbox-actions a,.gallery-lightbox-actions button{display:inline-flex;min-height:38px;align-items:center;justify-content:center;padding:7px 13px;border:1px solid #6dc8e8;border-radius:8px;background:#153c56;color:#fff;font:inherit;font-weight:700;text-decoration:none;cursor:pointer}
.gallery-lightbox-actions button{width:38px;padding:0;font-size:25px}
.gallery-lightbox>img{display:block;max-width:100%;max-height:calc(96vh - 72px);width:auto;height:auto;object-fit:contain;margin:auto}
.fanart-description,.fanart-body{line-height:1.7;overflow-wrap:anywhere;margin:0 0 26px}
.fanart-description img,.fanart-body img{max-width:100%;height:auto}
.fanart-group{margin:30px 0;min-width:0}
.fanart-group h2{margin:0 0 18px;font-size:clamp(22px,3vw,30px)}
.fanart-group:focus-visible{outline:2px solid #91e6fa;outline-offset:5px}
.fanart-slides figure{margin:0}
.fanart-slides figure[hidden]{display:none}
.fanart-slides figcaption{text-align:center;line-height:1.5;overflow-wrap:anywhere}
.fanart-slide-author{font-weight:700}
.fanart-controls{display:flex;align-items:center;justify-content:center;gap:18px;margin-top:14px}
.fanart-controls button{width:44px;height:44px;border:1px solid #6dc8e8;border-radius:8px;background:#153c56;color:#fff;font-size:30px;line-height:1;cursor:pointer}
.fanart-controls button:focus-visible{outline:2px solid #91e6fa;outline-offset:3px}
.fanart-controls span{min-width:60px;text-align:center;font-variant-numeric:tabular-nums}
[dir=rtl] .fanart-controls button{transform:scaleX(-1)}
@media(max-width:768px){.gallery-grid-fanart{--fanart-columns:2;grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:850px){.gallery-layout{grid-template-columns:1fr}.gallery-ranking{position:static}.gallery-ranking ol{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));column-gap:20px}}
@media(max-width:600px){.gallery-shell{width:calc(100% - 24px);padding:25px 0 60px}.gallery-page-heading{margin-bottom:20px}.gallery-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.gallery-grid,.gallery-column{gap:8px}.gallery-card{border-radius:10px}.gallery-card>strong{padding:9px 6px 10px;font-size:12px}.gallery-card-tags{inset-inline-start:5px;bottom:5px;gap:2px}.gallery-card-tags span{padding:2px 5px;font-size:9px}.gallery-ranking{padding:13px}.gallery-ranking ol{grid-template-columns:1fr}.gallery-detail{padding:15px;border-radius:13px}.gallery-artwork-open img{max-height:none}}
@media(prefers-reduced-motion:reduce){.gallery-card{transition:none}}
