:root {
	color-scheme: dark;
	--bg: #080b0d;
	--panel: rgba(16, 20, 24, 0.82);
	--line: rgba(255, 255, 255, 0.16);
	--text: #f6f7f8;
	--muted: #aab4bd;
	--green: #43d17f;
	--red: #ff6b6b;
}

* {
	box-sizing: border-box;
}

html,
body {
	width: 100%;
	height: 100%;
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
	overflow: hidden;
}

button,
a {
	font: inherit;
}

.video-shell {
	position: fixed;
	inset: 0;
	overflow: hidden;
	background: var(--bg);
}

.call-layout {
	position: absolute;
	inset: 0;
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	background: var(--bg);
}

.video-shell.split-game .call-layout {
	grid-template-columns:
		minmax(300px, var(--video-pane-size, 56fr))
		12px
		minmax(340px, var(--game-pane-size, 44fr));
}

.call-pane {
	position: relative;
	min-width: 0;
	min-height: 0;
	overflow: hidden;
	background: var(--bg);
}

.video-shell.split-game .video-pane {
	border-right: 0;
}

.split-resizer {
	position: relative;
	z-index: 3;
	display: none;
	width: 12px;
	min-width: 12px;
	padding: 0;
	border: 0;
	border-inline: 1px solid rgba(255, 255, 255, 0.08);
	background: rgba(255, 255, 255, 0.055);
	cursor: col-resize;
	touch-action: none;
}

.video-shell.split-game .split-resizer {
	display: block;
}

.split-resizer::before {
	content: "";
	position: absolute;
	inset: 50% auto auto 50%;
	width: 3px;
	height: 42px;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.34);
	transform: translate(-50%, -50%);
}

.split-resizer:hover,
.split-resizer:focus-visible,
.video-shell.resizing .split-resizer {
	background: rgba(67, 209, 127, 0.18);
	outline: none;
}

.split-resizer:hover::before,
.split-resizer:focus-visible::before,
.video-shell.resizing .split-resizer::before {
	background: var(--green);
}

.video-shell.resizing {
	cursor: col-resize;
	user-select: none;
}

.video-shell.resizing iframe {
	pointer-events: none;
}

.video-stage {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	background: var(--bg);
}

.video-stage iframe {
	width: 100%;
	height: 100%;
	border: 0;
	display: block;
}

.game-pane {
	display: grid;
	grid-template-rows: auto minmax(0, 1fr);
}

.game-pane-fit {
	grid-template-rows: minmax(0, 1fr) auto;
}

.game-pane[hidden] {
	display: none;
}

.game-pane-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 10px;
	border-bottom: 1px solid var(--line);
	background: rgba(16, 20, 24, 0.92);
}

.video-shell.split-game .game-pane-header {
	padding-top: max(78px, calc(64px + env(safe-area-inset-top)));
}

.game-pane-spacer {
	order: 2;
	min-height: 18px;
	padding: 0;
	border-bottom: 0;
	border-bottom-color: transparent;
	background: transparent;
	pointer-events: none;
}

.game-pane-spacer > * {
	display: none;
}

.video-shell.split-game .game-pane-spacer {
	padding-top: 0;
}

.game-pane-fit .game-frame-wrap {
	order: 1;
}

.game-pane-header strong {
	display: block;
	margin-top: 2px;
	font-size: 0.98rem;
	line-height: 1.2;
}

.game-pane-actions {
	display: flex;
	align-items: center;
	gap: 8px;
}

.game-pane-actions[hidden] {
	display: none;
}

.game-frame-wrap {
	position: relative;
	min-height: 0;
}

.game-frame {
	width: 100%;
	height: 100%;
	border: 0;
	display: block;
	background: #050607;
}

.game-placeholder {
	position: absolute;
	inset: 0;
	display: grid;
	align-content: center;
	justify-items: center;
	gap: 10px;
	padding: 24px;
	text-align: center;
	background:
		radial-gradient(circle at 50% 38%, rgba(67, 209, 127, 0.11), transparent 34%),
		#050607;
	transition: opacity 180ms ease, visibility 180ms ease;
}

.game-placeholder.hidden {
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
}

.game-placeholder h2 {
	margin: 0;
	font-size: clamp(1.6rem, 4vw, 3rem);
	line-height: 1;
	letter-spacing: 0;
}

.game-placeholder p:not(.kicker) {
	max-width: 420px;
	margin: 0;
	color: var(--muted);
	font-weight: 760;
	line-height: 1.5;
}

.video-placeholder {
	position: absolute;
	inset: 0;
	display: grid;
	align-content: center;
	justify-items: center;
	gap: 10px;
	padding: 24px;
	text-align: center;
	background:
		radial-gradient(circle at 50% 35%, rgba(67, 209, 127, 0.13), transparent 34%),
		var(--bg);
	transition: opacity 180ms ease, visibility 180ms ease;
}

.video-placeholder.hidden {
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
}

.video-placeholder img {
	width: 74px;
	height: 74px;
	border-radius: 18px;
	box-shadow: 0 18px 70px rgba(0, 0, 0, 0.34);
}

.kicker {
	margin: 0;
	color: var(--green);
	font-size: 0.74rem;
	font-weight: 900;
	letter-spacing: 0;
	text-transform: uppercase;
}

h1 {
	margin: 0;
	font-size: clamp(2rem, 6vw, 4.5rem);
	line-height: 0.98;
	letter-spacing: 0;
}

.video-placeholder p:not(.kicker) {
	max-width: 520px;
	margin: 0;
	color: var(--muted);
	font-weight: 760;
	line-height: 1.5;
}

.video-toolbar {
	position: absolute;
	top: max(14px, env(safe-area-inset-top));
	left: max(14px, env(safe-area-inset-left));
	right: max(14px, env(safe-area-inset-right));
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 10px;
	border: 1px solid var(--line);
	border-radius: 8px;
	background: var(--panel);
	backdrop-filter: blur(18px);
	box-shadow: 0 18px 60px rgba(0, 0, 0, 0.28);
}

.video-toolbar[hidden] {
	display: none;
}

.video-toolbar strong {
	display: block;
	margin-top: 2px;
	font-size: 0.98rem;
	line-height: 1.2;
}

.video-toolbar.success strong {
	color: var(--green);
}

.video-toolbar.error strong {
	color: var(--red);
}

.video-actions,
.video-recovery-actions {
	display: flex;
	align-items: center;
	gap: 8px;
}

.video-button {
	min-height: 42px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0 14px;
	border: 1px solid rgba(67, 209, 127, 0.42);
	border-radius: 8px;
	background: var(--green);
	color: #07110b;
	font-weight: 900;
	text-decoration: none;
	cursor: pointer;
}

.video-button.secondary {
	border-color: var(--line);
	background: rgba(255, 255, 255, 0.08);
	color: var(--text);
}

.video-button:disabled {
	opacity: 0.58;
	cursor: wait;
}

@media (max-width: 720px) {
	.video-toolbar {
		align-items: stretch;
		display: grid;
	}

	.video-actions,
	.game-pane-actions,
	.video-recovery-actions {
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.video-actions {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}

	.video-button {
		min-width: 0;
		padding-inline: 10px;
	}
}

@media (max-width: 920px) {
	.video-shell.split-game .call-layout {
		grid-template-columns: 1fr;
		grid-template-rows:
			minmax(220px, var(--video-pane-size-mobile, 46svh))
			12px
			minmax(260px, 1fr);
	}

	.video-shell.split-game .video-pane {
		border-right: 0;
		border-bottom: 0;
	}

	.split-resizer {
		width: auto;
		min-width: 0;
		height: 12px;
		min-height: 12px;
		border-inline: 0;
		border-block: 1px solid rgba(255, 255, 255, 0.08);
		cursor: row-resize;
	}

	.split-resizer::before {
		width: 42px;
		height: 3px;
	}

	.video-shell.resizing {
		cursor: row-resize;
	}

	.game-pane-header {
		align-items: stretch;
		display: grid;
		padding-top: max(126px, calc(112px + env(safe-area-inset-top)));
	}

	.video-shell.split-game .game-pane-spacer {
		min-height: 12px;
		padding-top: 0;
	}
}
