/* ==========================================================================
   Repertoire archive – song wheel UI (cyber theme)
   ========================================================================== */

.site-main--repertoire {
	padding: 0;
	min-height: 0;
	background: transparent;
}

body.has-ambient-bg .site-main--repertoire {
	padding-top: 0;
}

.repertoire-archive {
	position: relative;
	display: grid;
	grid-template-columns: minmax(280px, 380px) minmax(0, 1fr);
	align-items: start;
	min-height: calc(100svh - 9.5rem);
	padding:
		var(--page-section-top)
		1.25rem
		3rem;
	box-sizing: border-box;
	/* Keep ambient video continuous under header — no hard color edge */
	background-color: transparent;
	background-image:
		linear-gradient(
			180deg,
			transparent 0%,
			color-mix(in srgb, var(--cyber-bg) 22%, transparent) 42%,
			color-mix(in srgb, var(--cyber-bg) 36%, transparent) 72%,
			transparent 100%
		),
		linear-gradient(rgba(63, 152, 208, 0.06) 1px, transparent 1px),
		linear-gradient(90deg, rgba(63, 152, 208, 0.06) 1px, transparent 1px);
	background-size:
		auto,
		48px 48px,
		48px 48px;
}

.repertoire-archive:has(.repertoire-archive__empty) {
	display: block;
	padding-top: var(--page-section-top);
}

.repertoire-archive__character {
	position: absolute;
	top: 50%;
	left: 40%;
	transform: translate(-50%, -50%);
	z-index: 30;
	width: min(380px, 38vw);
	height: min(560px, 72vh);
	display: flex;
	justify-content: center;
	align-items: flex-end;
	flex-direction: column;
	pointer-events: none;
}

.repertoire-archive__character-img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
	object-position: bottom center;
	filter: drop-shadow(0 0 24px rgba(255, 45, 155, 0.3));
}

.repertoire-archive__face {
	width: 100px;
	height: 40px;
	background: rgba(184, 255, 60, 0.35);
	border: 3px solid var(--cyber-cyan);
	border-radius: 20px;
	display: flex;
	justify-content: space-evenly;
	align-items: center;
	margin-bottom: 20px;
}

.repertoire-archive__eye {
	width: 15px;
	height: 15px;
	background: var(--cyber-bg);
	border-radius: 50%;
}

.repertoire-archive__panel-wrap {
	--frame-blue: #1b56d0;
	--frame-dark: #000b29;
	--text-pink: #df649b;
	--accent-pink: #e33b76;
	--accent-cyan: #62d4f5;
	--accent-brown: #966f57;
	--bg-light: #ffffff;
	--text-main: #222222;
	position: relative;
	width: 100%;
	max-width: 380px;
	height: auto;
	padding: 0 0 1.25rem;
	z-index: 200;
}

.repertoire-archive__panel {
	position: relative;
	width: 100%;
	filter: drop-shadow(0 12px 20px rgba(0, 0, 0, 0.6));
	transition: transform 0.2s ease;
}

.repertoire-archive__panel.is-bounce {
	transform: scale(0.985);
}

.repertoire-archive__frame-outer {
	position: absolute;
	inset: 0;
	background-color: var(--frame-blue);
	clip-path: polygon(
		25px 0%, calc(100% - 25px) 0%, 100% 25px,
		100% 180px, calc(100% - 20px) 195px, calc(100% - 20px) calc(100% - 80px), 100% calc(100% - 60px),
		100% calc(100% - 25px), calc(100% - 25px) 100%,
		140px 100%, 130px calc(100% - 20px), 40px calc(100% - 20px), 30px 100%,
		0% calc(100% - 25px),
		0% 120px, 20px 100px, 20px 45px, 0% 25px
	);
}

.repertoire-archive__frame-outer::after {
	content: "";
	position: absolute;
	inset: 0;
	box-shadow: inset 0 0 0 10px var(--frame-dark);
	pointer-events: none;
}

.repertoire-archive__frame-inner {
	position: absolute;
	inset: 14px;
	background-color: var(--bg-light);
	clip-path: polygon(
		16px 0%, calc(100% - 16px) 0%, 100% 16px,
		100% 173px, calc(100% - 16px) 188px, calc(100% - 16px) calc(100% - 86px), 100% calc(100% - 70px),
		100% calc(100% - 16px), calc(100% - 16px) 100%,
		133px 100%, 123px calc(100% - 16px), 47px calc(100% - 16px), 37px 100%,
		0% calc(100% - 16px),
		0% 127px, 16px 111px, 16px 52px, 0% 36px
	);
	overflow: hidden;
}

.repertoire-archive__decor-dots {
	position: absolute;
	width: 100px;
	height: 80px;
	background-image: radial-gradient(var(--accent-cyan) 2.5px, transparent 2.5px);
	background-size: 14px 14px;
	opacity: 0.6;
	pointer-events: none;
}

.repertoire-archive__decor-dots--tl {
	top: 10px;
	left: 10px;
}

.repertoire-archive__decor-dots--br {
	right: 10px;
	bottom: 30px;
	opacity: 0.4;
}

.repertoire-archive__decor-gauge {
	position: absolute;
	top: -2px;
	right: 35px;
	display: flex;
	width: 180px;
	height: 24px;
}

.repertoire-archive__gauge-slits {
	width: 40px;
	height: 100%;
	margin-right: 4px;
	background: repeating-linear-gradient(
		-45deg,
		var(--frame-dark) 0,
		var(--frame-dark) 4px,
		transparent 4px,
		transparent 8px
	);
}

.repertoire-archive__gauge-bar {
	flex-grow: 1;
	height: 100%;
	background: linear-gradient(90deg, var(--text-pink), #a81c42);
	border: 3px solid var(--frame-dark);
	border-top: none;
}

.repertoire-archive__decor-brown {
	position: absolute;
	left: -20px;
	bottom: -20px;
	width: 100px;
	height: 100px;
	background-color: var(--accent-brown);
	clip-path: polygon(0 50%, 100% 100%, 0 100%);
}

.repertoire-archive__decor-lamps {
	position: absolute;
	bottom: 5px;
	left: 45px;
	display: flex;
	gap: 5px;
}

.repertoire-archive__lamp {
	width: 18px;
	height: 10px;
	background-color: #2ed573;
	border: 2px solid var(--frame-dark);
	transform: skewX(-20deg);
}

.repertoire-archive__lamp:last-child {
	background-color: var(--accent-cyan);
}

.repertoire-archive__decor-bottom-right {
	position: absolute;
	right: 25px;
	bottom: -2px;
	display: flex;
	align-items: flex-end;
	gap: 10px;
}

.repertoire-archive__bottom-triangle {
	width: 0;
	height: 0;
	margin-bottom: 2px;
	border-right: 10px solid transparent;
	border-bottom: 16px solid #f9d877;
	border-left: 10px solid transparent;
	filter:
		drop-shadow(0 -3px 0 var(--frame-dark))
		drop-shadow(3px 2px 0 var(--frame-dark))
		drop-shadow(-3px 2px 0 var(--frame-dark));
}

.repertoire-archive__bottom-slits {
	width: 70px;
	height: 16px;
	background-color: var(--frame-blue);
	background-image: repeating-linear-gradient(
		-45deg,
		transparent 0,
		transparent 6px,
		var(--frame-dark) 6px,
		var(--frame-dark) 10px
	);
	border: 3px solid var(--frame-dark);
	border-bottom: none;
}

.repertoire-archive__modal-content {
	position: relative;
	z-index: 10;
	display: flex;
	flex-direction: column;
	gap: 0.7rem;
	padding: 2.35rem 2rem 2.25rem 2.65rem;
}

.repertoire-archive__title {
	margin: 0;
	font-size: clamp(1.25rem, 2.4vw, 1.625rem);
	font-weight: 900;
	letter-spacing: 0.08em;
	line-height: 1.3;
	color: var(--text-pink);
	word-break: break-word;
	text-shadow:
		2px 2px 0 var(--frame-dark),
		-2px -2px 0 var(--frame-dark),
		2px -2px 0 var(--frame-dark),
		-2px 2px 0 var(--frame-dark),
		0 3px 0 var(--frame-dark),
		0 -3px 0 var(--frame-dark),
		3px 0 0 var(--frame-dark),
		-3px 0 0 var(--frame-dark),
		0 0 0 7px white;
}

.repertoire-archive__divider {
	height: 4px;
	margin: 0.1rem 0 0.35rem;
	background: repeating-linear-gradient(
		90deg,
		var(--accent-cyan) 0,
		var(--accent-cyan) 15px,
		transparent 15px,
		transparent 25px
	);
	opacity: 0.8;
}

.repertoire-archive__details {
	display: flex;
	flex-direction: column;
	gap: 0.65rem;
}

.repertoire-archive__info {
	display: flex;
	flex-direction: column;
	gap: 0.12rem;
}

.repertoire-archive__info-label {
	display: flex;
	align-items: center;
	font-size: 0.75rem;
	font-weight: 900;
	line-height: 1.2;
	color: var(--frame-blue);
}

.repertoire-archive__info-label::before {
	content: "";
	display: inline-block;
	width: 9px;
	height: 9px;
	margin-right: 0.45rem;
	flex-shrink: 0;
	background-color: var(--text-pink);
	clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
}

.repertoire-archive__info-value {
	padding-left: 1.05rem;
	font-size: 1rem;
	font-weight: 700;
	color: var(--text-main);
	line-height: 1.35;
}

.repertoire-archive__details [data-repertoire-formation] {
	white-space: pre-line;
}

.repertoire-archive__btn-group {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 0.4rem;
	margin-top: 0.15rem;
	padding-left: 1.05rem;
}

.repertoire-archive__scores {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
}

.repertoire-archive__btn {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	flex: 0 1 auto;
	min-width: 0;
	max-width: 100%;
	min-height: 2.75rem;
	margin: 0;
	padding: 0.7rem 1.85rem 0.8rem;
	border: none;
	background-color: var(--frame-dark);
	clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
	color: var(--accent-cyan);
	font-size: 0.9375rem;
	font-weight: 900;
	line-height: 1.55;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.repertoire-archive__btn::before {
	content: "";
	position: absolute;
	inset: 2px;
	border: 2px solid var(--accent-cyan);
	clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
	pointer-events: none;
	transition: border-color 0.2s ease;
}

.repertoire-archive__btn:hover {
	background-color: var(--accent-cyan);
	color: var(--frame-dark);
	text-decoration: none;
}

.repertoire-archive__btn:hover::before {
	border-color: var(--frame-dark);
}

.repertoire-archive__btn--score {
	color: #b8ff3c;
}

.repertoire-archive__btn--score::before {
	border-color: #b8ff3c;
}

.repertoire-archive__btn--score:hover {
	background-color: #b8ff3c;
	color: var(--frame-dark);
}

.repertoire-archive__btn--score:hover::before {
	border-color: var(--frame-dark);
}

.repertoire-archive__btn.is-hidden {
	display: none;
}

.repertoire-archive__wheel {
	position: relative;
	right: auto;
	top: auto;
	width: auto;
	min-height: calc(100svh - 12rem);
	display: flex;
	align-items: center;
	justify-content: flex-end;
	touch-action: none;
	padding: 0;
	box-sizing: border-box;
	overflow: hidden;
}

.repertoire-archive__list {
	position: relative;
	width: 100%;
	height: 672px;
	max-height: min(672px, calc(100svh - 14rem));
	overflow: hidden;
}

.repertoire-archive__item {
	position: absolute;
	top: 50%;
	right: 0;
	width: 340px;
	height: 96px;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	color: inherit;
	font: inherit;
	text-align: left;
	appearance: none;
	-webkit-appearance: none;
	display: none;
	box-sizing: border-box;
	transition: width 0.25s ease, opacity 0.2s ease, transform 0.25s ease;
	user-select: none;
	cursor: pointer;
	overflow: visible;
}

.repertoire-archive__list.is-ready .repertoire-archive__item:not([hidden]):not(.is-offscreen) {
	display: block;
}

.repertoire-archive__item[hidden],
.repertoire-archive__item.is-offscreen {
	display: none !important;
	visibility: hidden;
	pointer-events: none;
}

.repertoire-archive__cyber-box {
	position: relative;
	display: block;
	width: 100%;
	height: 100%;
	background: #020617;
	clip-path: polygon(
		16px 0, 100% 0,
		100% calc(100% - 16px), calc(100% - 16px) 100%,
		0 100%, 0 16px
	);
	padding: 3px;
	box-shadow: 0 0 16px rgba(6, 182, 212, 0.18);
	box-sizing: border-box;
	transition: box-shadow 0.2s ease;
}

.repertoire-archive__cyber-inner {
	position: relative;
	display: block;
	width: 100%;
	height: 100%;
	background: #1e293b;
	clip-path: polygon(
		14px 0, 100% 0,
		100% calc(100% - 14px), calc(100% - 14px) 100%,
		0 100%, 0 14px
	);
	overflow: hidden;
}

.repertoire-archive__cyber-inner::before {
	content: "";
	position: absolute;
	inset: 0;
	background: repeating-linear-gradient(
		-45deg,
		rgba(0, 0, 0, 0.12) 0,
		rgba(0, 0, 0, 0.12) 2px,
		transparent 2px,
		transparent 8px
	);
	pointer-events: none;
}

.repertoire-archive__scanline {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 8px;
	background: linear-gradient(
		to bottom,
		transparent,
		rgba(6, 182, 212, 0.22),
		transparent
	);
	opacity: 0;
	pointer-events: none;
}

.repertoire-archive__decor-line-top {
	position: absolute;
	top: 0;
	left: 14px;
	width: 72px;
	height: 3px;
	background: #06b6d4;
	box-shadow: 0 0 8px #06b6d4;
}

.repertoire-archive__decor-line-bottom {
	position: absolute;
	right: 14px;
	bottom: 0;
	width: 96px;
	height: 3px;
	background: #f43f5e;
	box-shadow: 0 0 8px #f43f5e;
}

.repertoire-archive__decor-caution {
	position: absolute;
	top: 50%;
	left: 10px;
	display: flex;
	flex-direction: column;
	gap: 4px;
	transform: translateY(-50%);
}

.repertoire-archive__caution-bar {
	width: 6px;
	height: 16px;
	background: #facc15;
	transform: skewX(-20deg);
}

.repertoire-archive__caution-bar:nth-child(2) {
	height: 11px;
	opacity: 0.7;
}

.repertoire-archive__caution-bar:nth-child(3) {
	height: 7px;
	opacity: 0.4;
}

.repertoire-archive__decor-ui {
	position: absolute;
	top: 8px;
	right: 12px;
	text-align: right;
	opacity: 0.55;
	transition: opacity 0.2s ease;
}

.repertoire-archive__ui-text {
	display: block;
	margin-bottom: 3px;
	font-family: var(--font-mono, ui-monospace, monospace);
	font-size: 8px;
	letter-spacing: 0.12em;
	color: #06b6d4;
	line-height: 1;
}

.repertoire-archive__ui-meter {
	display: flex;
	gap: 3px;
	justify-content: flex-end;
}

.repertoire-archive__meter-block {
	width: 9px;
	height: 4px;
	background: rgba(255, 255, 255, 0.18);
	transform: skewX(-30deg);
}

.repertoire-archive__meter-block.is-active {
	background: #06b6d4;
	box-shadow: 0 0 4px #06b6d4;
}

.repertoire-archive__item-title {
	position: absolute;
	top: 50%;
	left: 50%;
	z-index: 1;
	max-width: calc(100% - 5.5rem);
	overflow: hidden;
	padding-block: 0.25em;
	font-size: 1rem;
	font-weight: 800;
	letter-spacing: 0.06em;
	line-height: 1.55;
	color: #f8fafc;
	white-space: nowrap;
	text-overflow: ellipsis;
	text-shadow:
		2px 2px 0 rgba(0, 0, 0, 0.45),
		-1px -1px 6px rgba(6, 182, 212, 0.35),
		1px 1px 6px rgba(244, 63, 94, 0.3);
	transform: translate(-46%, -50%);
	transition: font-size 0.2s ease, letter-spacing 0.2s ease, text-shadow 0.2s ease;
}

.repertoire-archive__item.is-active .repertoire-archive__cyber-box {
	box-shadow:
		0 0 22px rgba(6, 182, 212, 0.35),
		0 0 10px rgba(244, 63, 94, 0.2);
}

.repertoire-archive__item.is-active .repertoire-archive__cyber-inner {
	background: #243447;
}

.repertoire-archive__item.is-active .repertoire-archive__decor-ui {
	opacity: 0.95;
}

.repertoire-archive__item.is-active .repertoire-archive__scanline {
	opacity: 0.55;
	animation: repertoire-scan 3s linear infinite;
}

.repertoire-archive__item.is-active .repertoire-archive__item-title {
	font-size: 1.15rem;
	letter-spacing: 0.08em;
	color: #ffffff;
	text-shadow:
		3px 3px 0 rgba(0, 0, 0, 0.5),
		-2px -2px 10px rgba(6, 182, 212, 0.55),
		2px 2px 10px rgba(244, 63, 94, 0.5);
}

@keyframes repertoire-scan {
	0% {
		top: -12%;
	}

	100% {
		top: 110%;
	}
}

@media (prefers-reduced-motion: reduce) {
	.repertoire-archive__item.is-active .repertoire-archive__scanline {
		animation: none;
		opacity: 0;
	}
}

.repertoire-archive__detail-close,
.repertoire-archive__detail-backdrop {
	display: none;
}

.repertoire-archive__empty {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 2rem;
	text-align: center;
	font-weight: 700;
	color: var(--cyber-cyan);
}

@media (max-width: 900px) {
	.repertoire-archive {
		display: block;
		grid-template-columns: none;
		padding-inline: 1rem;
		min-height: auto;
	}

	.repertoire-archive__character {
		display: none;
	}

	.repertoire-archive__panel-wrap {
		position: fixed;
		inset: 0;
		z-index: 1200;
		display: none;
		align-items: center;
		justify-content: center;
		width: 100%;
		max-width: none;
		padding: 1rem;
		box-sizing: border-box;
	}

	.repertoire-archive.is-mobile-detail-open .repertoire-archive__panel-wrap {
		display: flex;
	}

	.repertoire-archive__detail-backdrop {
		display: block;
		position: absolute;
		inset: 0;
		background: rgba(6, 13, 24, 0.72);
		border: 0;
		cursor: pointer;
	}

	.repertoire-archive__detail-close {
		display: flex;
		position: absolute;
		top: 0.85rem;
		right: 0.85rem;
		z-index: 3;
		align-items: center;
		justify-content: center;
		width: 2.5rem;
		height: 2.5rem;
		padding: 0;
		border: 0;
		background: rgba(0, 11, 41, 0.85);
		color: #62d4f5;
		font-size: 1.5rem;
		line-height: 1;
		cursor: pointer;
	}

	.repertoire-archive__panel {
		position: relative;
		z-index: 2;
		width: min(100%, 380px);
		max-height: min(88vh, 720px);
		overflow: auto;
		filter: drop-shadow(0 16px 28px rgba(0, 0, 0, 0.55));
	}

	.repertoire-archive__wheel {
		position: relative;
		min-height: 0;
		padding: 0.5rem 0 1.5rem;
		justify-content: stretch;
		overflow: visible;
		touch-action: pan-y;
	}

	.repertoire-archive__list {
		position: static;
		display: flex;
		flex-direction: column;
		gap: 0.65rem;
		width: 100%;
		height: auto !important;
		max-height: none;
	}

	.repertoire-archive__list.is-ready .repertoire-archive__item:not([hidden]):not(.is-offscreen) {
		display: block;
	}

	.repertoire-archive__item {
		position: static;
		top: auto;
		right: auto;
		display: block;
		width: 100% !important;
		height: 72px;
		transform: none !important;
		opacity: 1 !important;
	}

	.repertoire-archive__item.is-active {
		width: 100% !important;
	}

	.repertoire-archive__item-title {
		max-width: calc(100% - 4.5rem);
		font-size: 0.9375rem;
	}

	.repertoire-archive__item.is-active .repertoire-archive__item-title {
		font-size: 1.05rem;
	}

	.repertoire-archive__decor-ui {
		display: none;
	}
}

body.repertoire-detail-open {
	overflow: hidden;
}
