.gallery-page { background: #071522; color: #eaf5ff; }
.gallery-page .site-header { background: rgba(247,248,246,.96); }
.gallery-main { display: grid; grid-template-columns: 340px minmax(0, 1fr); min-height: calc(100vh - 82px); background: radial-gradient(circle at 80% 15%, rgba(23,105,255,.22), transparent 30%), #071522; }
.gallery-sidebar { border-right: 1px solid rgba(124,190,232,.24); background: rgba(6,18,30,.85); }
.gallery-hero { display: grid; place-items: center start; min-height: 112px; padding: 26px 22px; border-bottom: 1px solid rgba(124,190,232,.24); background: linear-gradient(135deg, rgba(15,55,91,.68), transparent 62%); }
.gallery-kicker, .gallery-filter-label { color: #ff7864; font: 700 10px var(--body); letter-spacing: 1.7px; text-transform: uppercase; }
.gallery-hero h1 { margin: 0; color: white; font-size: 44px; line-height: .9; }
.gallery-hero h1 em { color: #6dccff; }
.gallery-hero p:last-child { margin: 0; color: #a9c7db; font-size: 14px; }
.gallery-hero-index { display: flex; flex-direction: column; align-items: flex-start; color: #6dccff; }
.gallery-hero-index span { font: 800 48px var(--display); line-height: .8; }
.gallery-hero-index small { margin-top: 9px; color: #9bb5c7; font-size: 10px; letter-spacing: 1px; text-transform: uppercase; }
.gallery-controls { padding: 22px 18px 16px; border-bottom: 1px solid rgba(124,190,232,.24); background: rgba(3,15,27,.78); }
.gallery-search { display: block; margin-top: 12px; }
.gallery-search span { display: block; margin-bottom: 6px; color: #a9c7db; font: 700 9px var(--body); letter-spacing: 1px; text-transform: uppercase; }
.gallery-search input { width: 100%; height: 36px; padding: 0 10px; border: 1px solid rgba(124,190,232,.32); border-radius: 0; color: white; background: rgba(8,35,61,.82); font: 12px var(--body); outline: none; }
.gallery-search input::placeholder { color: #7891a4; }
.gallery-search input:focus { border-color: #6dccff; box-shadow: 0 0 0 2px rgba(109,204,255,.2); }
.gallery-rarity-filters { display: flex; gap: 7px; margin-top: 12px; }
.gallery-category-dropdown { position: relative; margin-top: 12px; }
.gallery-category-dropdown .gallery-filter-label { display: block; margin-bottom: 6px; }
.gallery-category-trigger { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; height: 36px; padding: 0 10px; border: 1px solid rgba(124,190,232,.32); color: white; background: rgba(8,35,61,.82); font: 700 11px var(--body); letter-spacing: .3px; text-align: left; cursor: pointer; }
.gallery-category-trigger span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.gallery-category-trigger i { flex-shrink: 0; color: #6dccff; font-style: normal; transition: transform .2s ease; }
.gallery-category-dropdown.open .gallery-category-trigger { border-color: #6dccff; box-shadow: 0 0 0 2px rgba(109,204,255,.2); }
.gallery-category-dropdown.open .gallery-category-trigger i { transform: rotate(180deg); }
.gallery-category-list { display: none; position: absolute; z-index: 5; top: calc(100% + 4px); left: 0; right: 0; max-height: 260px; overflow-y: auto; border: 1px solid rgba(109,204,255,.5); background: #081c2e; box-shadow: 0 12px 24px rgba(0,0,0,.45); }
.gallery-category-dropdown.open .gallery-category-list { display: block; }
.gallery-category-option { display: block; width: 100%; padding: 8px 10px; border: 0; border-bottom: 1px solid rgba(124,190,232,.16); background: transparent; color: #cfe6f5; font: 600 11px var(--body); text-align: left; cursor: pointer; }
.gallery-category-option:last-child { border-bottom: 0; }
.gallery-category-option:hover { background: rgba(109,204,255,.14); color: white; }
.gallery-category-option.active { background: #6dccff; color: #071522; font-weight: 800; }
.gallery-rarity-filter { padding: 7px 10px; border: 1px solid rgba(124,190,232,.32); color: #a9c7db; background: transparent; font: 700 9px var(--body); letter-spacing: .7px; text-transform: uppercase; }
.gallery-rarity-filter:hover, .gallery-rarity-filter.active { border-color: #6dccff; color: #071522; background: #6dccff; }
.gallery-tools { margin-top: 16px; }
.gallery-edit-toggle { display: inline-flex; align-items: center; justify-content: center; padding: 10px 14px; border: 1px solid rgba(109,204,255,.7); background: rgba(109,204,255,.18); color: white; font: 700 10px var(--body); letter-spacing: .8px; text-transform: uppercase; }
.gallery-edit-toggle[hidden] { display: none; }
.character-filter-list { display: flex; flex-direction: column; gap: 9px; margin-top: 12px; }
.gallery-translation-note { margin: 17px 0 0; padding-top: 14px; border-top: 1px solid rgba(255,120,100,.32); color: #ff7864; font: 600 10px/1.45 var(--body); letter-spacing: .25px; text-shadow: 0 0 10px rgba(255,72,52,.65), 0 0 22px rgba(255,72,52,.3); }
.filter-team-row { display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 9px; align-items: center; }
.filter-team-agents { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 7px; }
.character-filter { position: relative; display: block; min-width: 0; aspect-ratio: 1; padding: 0; overflow: hidden; border: 1px solid rgba(255,255,255,.1); border-radius: 5px; background: #172431; box-shadow: 0 2px 4px rgba(0,0,0,.45); }
.character-filter img { width: 100%; height: 100%; display: block; object-fit: cover; object-position: center 16%; transition: transform .2s ease, filter .2s ease; }
.character-filter span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.character-filter[data-agent="all"] { display: grid; place-items: center; width: 42px; border-color: rgba(109,204,255,.6); color: #d9f3ff; font: 800 11px var(--display); }
.character-filter[data-agent="all"] span { position: static; width: auto; height: auto; clip: auto; }
.character-filter:hover img, .character-filter:focus-visible img { transform: scale(1.08); filter: brightness(1.15); }
.character-filter:hover, .character-filter:focus-visible, .character-filter.active { border-color: #6dccff; outline: 2px solid rgba(109,204,255,.45); outline-offset: 1px; }
.character-filter.active { box-shadow: 0 0 0 2px #071522, 0 0 0 4px #ff7864; }
.gallery-team-filter { display: grid; place-items: center; width: 42px; height: 42px; padding: 0; border: 1px solid rgba(124,190,232,.32); border-radius: 50%; color: #a9c7db; background: transparent; font: 800 9px var(--body); }
.gallery-team-filter img { width: 100%; height: 100%; object-fit: contain; padding: 3px; filter: saturate(.8); }
.gallery-team-filter:hover, .gallery-team-filter.active { border-color: #6dccff; color: #071522; background: #6dccff; }
.gallery-team-filter:hover img, .gallery-team-filter.active img { filter: saturate(1.1); }
.gallery-content { padding: 30px 28px; }
.gallery-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.gallery-tile { position: relative; min-height: 0; overflow: hidden; border: 1px solid rgba(124,190,232,.27); background: #0a2944; box-shadow: 0 15px 30px rgba(0,0,0,.25); cursor: pointer; }
.gallery-tile-image { background: #fff; aspect-ratio: 3 / 4; overflow: hidden; }
.gallery-tile-image img { display: block; width: 100%; height: 100%; object-fit: contain; object-position: center; filter: saturate(.9); transition: filter .3s; }
.gallery-tile:hover img { filter: saturate(1.1); }
.gallery-tile-caption { position: relative; padding: 14px 15px 15px; background: #0a2944; }
.gallery-tile-meta { display: flex; align-items: center; gap: 7px; color: #6dccff; font-size: 9px; letter-spacing: 1px; text-transform: uppercase; }
.gallery-tile-meta img { width: 19px; height: 19px; object-fit: contain; }
.gallery-title-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; }
.gallery-title-row h2 { flex: 1 1 auto; min-width: 0; margin: 0; color: white; font-size: 20px; line-height: 1; }
.gallery-title-edit { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; padding: 0; border: 1px solid rgba(109,204,255,.5); background: rgba(109,204,255,.12); color: #d9f3ff; font-size: 14px; cursor: pointer; }
.gallery-inline-name-editor { width: 100%; min-width: 0; height: 34px; padding: 6px 8px; border: 1px solid rgba(109,204,255,.8); background: #081c2e; color: white; font: 700 16px var(--body); }
.gallery-slot-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; }
.gallery-variant-switch { display: flex; gap: 7px; }
.gallery-variant-dot { width: 20px; height: 20px; padding: 0; border: 2px solid rgba(255,255,255,.35); border-radius: 50%; background: var(--variant-color, #6dccff); cursor: pointer; transition: transform .15s ease, border-color .15s ease; box-shadow: 0 2px 5px rgba(0,0,0,.4); }
.gallery-variant-dot:hover { transform: scale(1.15); }
.gallery-variant-dot.active { border-color: white; box-shadow: 0 0 0 2px #0a2944, 0 0 0 4px var(--variant-color, #6dccff); }
.gallery-variant-special { flex-shrink: 0; padding: 3px 10px; border: 2px solid transparent; border-radius: 10px; background: linear-gradient(135deg, #ff7864, #ff3d7f); color: white; font: 800 9px var(--body); letter-spacing: .6px; text-transform: uppercase; cursor: pointer; box-shadow: 0 2px 8px rgba(255,61,127,.45); transition: transform .15s ease; }
.gallery-variant-special:hover { transform: scale(1.06); }
.gallery-variant-special.active { border-color: white; }
.gallery-variant-special-static { cursor: default; pointer-events: none; }
.gallery-rarity-badge { flex-shrink: 0; margin-left: auto; padding: 4px 9px; border-radius: 3px; color: #071522; font: 800 9px var(--body); letter-spacing: .8px; text-transform: uppercase; pointer-events: none; }
.gallery-rarity-badge-common { background: #a9c7db; }
.gallery-rarity-badge-rare { background: #6dccff; }
.gallery-rarity-badge-unique { background: #f7a531; }
.gallery-reference-note { display: none; }
.gallery-page footer { background: #f7f8f6; }
.gallery-footer-controls {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	max-width: 1180px;
	margin: 18px auto 0;
	padding: 0 0 18px;
}
.gallery-footer-reference {
	position: absolute;
	right: 0;
	bottom: 0;
	color: rgba(208, 224, 236, .72);
	font: 700 9px var(--body);
	letter-spacing: .7px;
	text-align: right;
	white-space: nowrap;
}
.gallery-pagination {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	padding: 0;
	margin: 0;
	width: fit-content;
}
.gallery-page-button {
	width: 42px;
	height: 42px;
	border: 1px solid rgba(124,190,232,.38);
	background: rgba(8,35,61,.82);
	color: white;
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
}
.gallery-page-button:disabled { opacity: .35; cursor: not-allowed; }
.gallery-page-numbers {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-wrap: wrap;
	gap: 8px;
}
.gallery-page-number {
	width: 34px;
	height: 34px;
	padding: 0;
	border: 1px solid rgba(124,190,232,.38);
	background: rgba(8,35,61,.82);
	color: #dfeaf4;
	font: 700 13px var(--body);
	cursor: pointer;
}
.gallery-page-number.active {
	border-color: #f7d863;
	background: #f7d863;
	color: #071522;
}
.gallery-page-jump {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin-left: 6px;
}
.gallery-page-jump-input {
	width: 42px;
	height: 42px;
	padding: 0 8px;
	border: 1px solid rgba(124,190,232,.38);
	background: rgba(8,35,61,.82);
	color: white;
	font: 700 14px var(--body);
	text-align: center;
}
.gallery-page-total {
	min-width: 30px;
	color: #dfeaf4;
	font: 700 13px var(--body);
	text-align: center;
}
.gallery-page-jump-button {
	width: 42px;
	height: 42px;
	border: 1px solid rgba(124,190,232,.38);
	background: rgba(8,35,61,.82);
	color: white;
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
}
.gallery-name-panel { position: fixed; top: 0; right: 0; z-index: 30; width: min(420px, 100%); height: 100vh; padding: 90px 28px 28px; background: #f3f8fb; color: #17202b; box-shadow: -12px 0 30px rgba(0,0,0,.16); transform: translateX(100%); transition: transform .25s ease; }
.gallery-name-panel.open { transform: translateX(0); }
.gallery-name-panel h2 { margin: 0 0 20px; font: 700 48px var(--display); line-height: .88; text-transform: uppercase; }
.gallery-name-editor-list { display: grid; gap: 12px; max-height: calc(100vh - 220px); overflow-y: auto; padding-right: 4px; }
.gallery-name-editor-item { display: grid; gap: 6px; color: #4d5f73; font: 700 10px var(--body); letter-spacing: .8px; text-transform: uppercase; }
.gallery-name-editor-item input { margin-top: 0; border: 1px solid rgba(23,105,255,.18); background: white; color: #17202b; }
.gallery-name-panel .primary-action { margin-top: 20px; }
.gallery-modal { position: fixed; inset: 0; z-index: 999; display: none; }
.gallery-modal.open { display: block; }
.gallery-modal-backdrop { position: absolute; inset: 0; background: rgba(2, 8, 16, .82); }
.gallery-modal-panel { position: relative; width: min(70vw, 980px); max-height: 88vh; margin: 6vh auto 0; background: rgba(7,21,34,.9); border: 1px solid rgba(124,190,232,.35); box-shadow: 0 25px 60px rgba(0,0,0,.5); }
.gallery-modal-panel img { display: block; width: 100%; max-height: 88vh; object-fit: contain; background: #06131f; }
.gallery-modal-close { position: absolute; top: 14px; right: 14px; width: 42px; height: 42px; border: 1px solid rgba(255,255,255,.4); background: rgba(9,19,30,.72); color: white; font-size: 32px; line-height: 1; cursor: pointer; }
@media (max-width: 900px) {
	.gallery-main { grid-template-columns: 1fr; }
	.gallery-sidebar { border-right: none; border-bottom: 1px solid rgba(124,190,232,.24); }
	.gallery-content { padding: 20px 16px 24px; }
	.gallery-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.filter-team-agents { grid-template-columns: repeat(10, minmax(34px, 1fr)); }
	.gallery-modal-panel { width: min(88vw, 980px); }
}
@media (max-width: 760px) {
	.gallery-main { grid-template-columns: 1fr; }
	.gallery-hero { min-height: 200px; padding: 38px 18px 18px; }
	.gallery-controls { padding: 18px 16px 12px; }
	.filter-team-agents { grid-template-columns: repeat(6, 42px); overflow-x: auto; padding: 3px; }
	.gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
	.gallery-tile-caption h2 { font-size: 21px; }
	.gallery-pagination { padding-top: 18px; }
}
