/* Player page — responsive, portrait & landscape friendly */
:root {
	color-scheme: dark;
	--bg: #0e1116;
	--card: #171c24;
	--text: #e8ecf1;
	--muted: #8b95a3;
	--accent: #4da3ff;
	--radius: 12px;
}

* { box-sizing: border-box; }

html, body {
	margin: 0;
	padding: 0;
	background: var(--bg);
	color: var(--text);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	min-height: 100dvh;
}

.stage {
	max-width: 1100px;
	margin: 0 auto;
	padding: 12px;
	min-height: 100dvh;
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 12px;
}

#player-container {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 9;
	max-height: 78dvh;
	background: #000;
	border-radius: var(--radius);
	overflow: hidden;
}

/* Portrait phones: use the full height instead of a wide letterbox */
@media (orientation: portrait) and (max-width: 600px) {
	#player-container {
		aspect-ratio: 9 / 16;
		max-height: 82dvh;
		max-width: 100%;
		margin: 0 auto;
	}
}

.player-host,
.player-host video {
	width: 100%;
	height: 100%;
	background: #000;
}

/* OvenPlayer injects its own controls; keep them above the overlay */
.player-host video { object-fit: contain; }

.overlay {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(10, 12, 16, 0.82);
	backdrop-filter: blur(2px);
	z-index: 20;
	transition: opacity 0.25s ease;
}

.overlay.hidden {
	opacity: 0;
	pointer-events: none;
}

.overlay-card {
	text-align: center;
	padding: 24px;
	max-width: 90%;
}

.overlay-title {
	font-size: 1.15rem;
	font-weight: 600;
	margin: 12px 0 4px;
}

.overlay-detail {
	color: var(--muted);
	font-size: 0.9rem;
	min-height: 1.2em;
	white-space: pre-line;
}

.spinner {
	width: 34px;
	height: 34px;
	margin: 0 auto;
	border: 3px solid rgba(255, 255, 255, 0.2);
	border-top-color: var(--accent);
	border-radius: 50%;
	animation: spin 0.9s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.btn-play,
.btn-retry {
	appearance: none;
	border: 0;
	border-radius: 999px;
	padding: 12px 28px;
	margin: 14px 6px 0;
	font-size: 1rem;
	font-weight: 600;
	cursor: pointer;
}

.btn-play { background: var(--accent); color: #04121f; }
.btn-retry { background: #2a323d; color: var(--text); }

.btn-diagnostics {
	align-self: flex-end;
	background: none;
	border: 1px solid #2a323d;
	color: var(--muted);
	border-radius: 8px;
	padding: 6px 12px;
	font-size: 0.8rem;
	cursor: pointer;
}

.diagnostics {
	background: var(--card);
	border-radius: var(--radius);
	padding: 14px 18px;
	font-size: 0.85rem;
}

.diagnostics h2 {
	margin: 0 0 8px;
	font-size: 0.9rem;
	color: var(--muted);
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.diagnostics dl {
	display: grid;
	grid-template-columns: auto 1fr;
	gap: 4px 14px;
	margin: 0;
}

.diagnostics dt { color: var(--muted); }
.diagnostics dd { margin: 0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere; }
