/* =========================================================
   Mechanical Theatre Gallery 41 – Frontend Styles
   ========================================================= */

.mtg41-theatre-wrapper {
	position: relative;
	width: 100%;
	height: 600px;
	max-height: 65vh;
	overflow: hidden;
	background: #0a0005;
	border-radius: 4px;
	user-select: none;
	-webkit-user-select: none;
	touch-action: none;
	cursor: grab;
}

.mtg41-theatre-wrapper:active {
	cursor: grabbing;
}

.mtg41-canvas {
	display: block;
	width: 100% !important;
	height: 100% !important;
	outline: none;
}

/* ── Controls ───────────────────────────────────────────── */
.mtg41-controls {
	position: absolute;
	bottom: 16px;
	left: 50%;
	transform: translateX(-50%);
	display: flex;
	align-items: center;
	gap: 8px;
	z-index: 20;
	background: rgba(10, 0, 5, 0.55);
	backdrop-filter: blur(6px);
	border: 1px solid rgba(200, 144, 64, 0.4);
	border-radius: 30px;
	padding: 6px 14px;
}

.mtg41-btn {
	background: transparent;
	border: none;
	color: #e8c870;
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
	padding: 4px 8px;
	border-radius: 50%;
	transition: background 0.2s, color 0.2s, transform 0.15s;
}

.mtg41-btn:hover {
	background: rgba(200, 144, 64, 0.25);
	color: #ffe090;
	transform: scale(1.15);
}

.mtg41-btn:focus-visible {
	outline: 2px solid #e8c870;
	outline-offset: 2px;
}

/* ── Scene Indicator ────────────────────────────────────── */
.mtg41-scene-indicator {
	position: absolute;
	top: 12px;
	right: 14px;
	color: rgba(232, 200, 112, 0.75);
	font-size: 11px;
	font-family: Georgia, serif;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	z-index: 20;
	pointer-events: none;
}

/* ── Lightbox ───────────────────────────────────────────── */
.mtg41-lightbox {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	background: rgba(5, 0, 10, 0.92);
	z-index: 100;
	opacity: 0;
	transition: opacity 0.35s ease;
}

.mtg41-lightbox:not([hidden]) {
	opacity: 1;
}

.mtg41-lightbox[hidden] {
	display: none;
}

.mtg41-lightbox-close {
	position: absolute;
	top: 14px;
	right: 18px;
	background: transparent;
	border: 1px solid rgba(200, 144, 64, 0.5);
	color: #e8c870;
	font-size: 20px;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.2s;
}

.mtg41-lightbox-close:hover {
	background: rgba(200, 144, 64, 0.25);
}

.mtg41-lightbox-close:focus-visible {
	outline: 2px solid #e8c870;
}

.mtg41-lightbox-inner {
	position: relative;
	max-width: 88%;
	max-height: 70%;
	display: flex;
	flex-direction: column;
	align-items: center;
}

/* Baroque-gold frame */
.mtg41-lightbox-inner::before {
	content: '';
	position: absolute;
	inset: -14px;
	border: 6px solid transparent;
	border-image: repeating-linear-gradient(
		45deg,
		#c89040 0px,
		#ffe090 4px,
		#c89040 8px,
		#8b5a00 12px,
		#c89040 16px
	) 10;
	pointer-events: none;
	border-radius: 2px;
}

.mtg41-lightbox-img {
	max-width: 100%;
	max-height: 60vh;
	object-fit: contain;
	border-radius: 2px;
	display: block;
}

.mtg41-lightbox-caption {
	margin-top: 12px;
	color: #e8c870;
	font-family: Georgia, serif;
	font-size: 13px;
	letter-spacing: 0.08em;
	text-align: center;
}

/* ── Lightbox Navigation ────────────────────────────────── */
.mtg41-lightbox-nav {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-top: 16px;
}

.mtg41-lb-prev,
.mtg41-lb-next {
	background: transparent;
	border: 1px solid rgba(200, 144, 64, 0.4);
	color: #e8c870;
	font-size: 22px;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.2s;
}

.mtg41-lb-prev:hover,
.mtg41-lb-next:hover {
	background: rgba(200, 144, 64, 0.2);
}

.mtg41-lb-prev:focus-visible,
.mtg41-lb-next:focus-visible {
	outline: 2px solid #e8c870;
}

.mtg41-scene-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	gap: 6px;
	flex-wrap: wrap;
	justify-content: center;
}

.mtg41-scene-list li button {
	background: rgba(200, 144, 64, 0.15);
	border: 1px solid rgba(200, 144, 64, 0.35);
	color: #c89040;
	font-size: 11px;
	font-family: Georgia, serif;
	padding: 3px 8px;
	border-radius: 3px;
	cursor: pointer;
	transition: background 0.2s, color 0.2s;
	white-space: nowrap;
}

.mtg41-scene-list li button:hover,
.mtg41-scene-list li button.is-active {
	background: rgba(200, 144, 64, 0.4);
	color: #ffe090;
}

.mtg41-scene-list li button:focus-visible {
	outline: 2px solid #e8c870;
}

/* ── Curtain transition overlay ─────────────────────────── */
.mtg41-curtain-overlay {
	position: absolute;
	inset: 0;
	background: #8b0000;
	z-index: 50;
	transform: scaleY(0);
	transform-origin: top;
	pointer-events: none;
}

/* ── Loading indicator ──────────────────────────────────── */
.mtg41-loading {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #0a0005;
	color: #c89040;
	font-family: Georgia, serif;
	font-size: 14px;
	letter-spacing: 0.15em;
	z-index: 10;
}

.mtg41-loading::after {
	content: '…';
	animation: mtg41-dots 1.2s steps(4, end) infinite;
}

@keyframes mtg41-dots {
	0%  { content: ''; }
	25% { content: '.'; }
	50% { content: '..'; }
	75% { content: '...'; }
}

/* ── Reduced motion ─────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
	.mtg41-lightbox,
	.mtg41-btn {
		transition: none !important;
	}
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 600px) {
	.mtg41-theatre-wrapper {
		height: 340px;
	}

	.mtg41-controls {
		gap: 4px;
		padding: 4px 10px;
	}

	.mtg41-btn {
		font-size: 15px;
		padding: 3px 6px;
	}
}
