:root
{
	color-scheme: dark;
	--bg: #141414;
	--panel-bg: rgba(34, 34, 34, 0.88);
	--panel-border: rgba(255, 255, 255, 0.12);
	--text-main: #f5f5f1;
	--text-muted: #c7c7c7;
	--accent: #b81d24;
	--accent-strong: #d45257;
	--accent-soft: rgba(184, 29, 36, 0.12);
	--error: #ff7b72;
	--shadow: 0 22px 60px rgba(0, 0, 0, 0.5);
}

*
{
	box-sizing: border-box;
}

body
{
	margin: 0;
	min-width: 320px;
	font-family: "Segoe UI", "Apple SD Gothic Neo", sans-serif;
	color: var(--text-main);
	background:
		radial-gradient(circle at top center, rgba(184, 29, 36, 0.14), transparent 22%),
		linear-gradient(180deg, #181818 0%, #1b1b1b 45%, #111111 100%);
}

button,
select,
textarea
{
	font: inherit;
}

.launcher-shell
{
	width: min(1440px, calc(100% - 32px));
	margin: 0 auto;
	padding: 32px 0 40px;
}

.launcher-shell::before
{
	content: "";
	position: fixed;
	inset: 0;
	pointer-events: none;
	background:
		linear-gradient(180deg, rgba(0, 0, 0, 0.14), transparent 18%, transparent 72%, rgba(0, 0, 0, 0.42)),
		repeating-linear-gradient(
			90deg,
			rgba(255, 255, 255, 0.015) 0,
			rgba(255, 255, 255, 0.015) 1px,
			transparent 1px,
			transparent 120px
		);
}

.launcher-header,
.launcher-layout,
.launcher-preview-panel
{
	animation: fade-up 240ms ease-out;
}

.launcher-header
{
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 24px;
	margin-bottom: 16px;
}

.launcher-eyebrow
{
	margin: 0 0 8px;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.16em;
	color: #ffffff;
}

.launcher-title
{
	margin: 0;
	font-size: clamp(26px, 4vw, 42px);
	font-weight: 800;
	letter-spacing: -0.03em;
	line-height: 1.05;
}

.launcher-description
{
	max-width: 720px;
	margin: 8px 0 0;
	color: var(--text-muted);
	line-height: 1.5;
}

.launcher-actions
{
	display: flex;
	align-items: center;
}

.launcher-layout
{
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	gap: 20px;
	margin-top: 18px;
}

.launcher-layout-secondary
{
	align-items: start;
}

.launcher-panel
{
	background: var(--panel-bg);
	border: 1px solid var(--panel-border);
	border-radius: 24px;
	box-shadow: var(--shadow);
	backdrop-filter: blur(10px);
}

.launcher-control-panel,
.launcher-list-panel,
.launcher-preview-panel
{
	padding: 22px;
}

.panel-header
{
	margin-bottom: 24px;
}

.panel-header-compact
{
	margin-bottom: 16px;
}

.panel-header h2
{
	margin: 0;
	font-size: 20px;
}

.panel-header p
{
	margin: 6px 0 0;
	color: var(--text-muted);
	line-height: 1.5;
}

.control-stack
{
	display: grid;
	gap: 14px;
}

.control-section
{
	display: grid;
	gap: 12px;
	padding: 14px;
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: 18px;
	background: rgba(255, 255, 255, 0.03);
}

.control-section-header
{
	display: grid;
	gap: 6px;
}

.control-section-header h3
{
	margin: 0;
	font-size: 16px;
}

.control-section-header p
{
	margin: 0;
	color: var(--text-muted);
	font-size: 12px;
	line-height: 1.5;
}

.form-group
{
	display: grid;
	gap: 8px;
}

.form-group label
{
	font-weight: 700;
}

.form-group select
{
	width: 100%;
	padding: 11px 13px;
	border: 1px solid rgba(255, 255, 255, 0.14);
	border-radius: 14px;
	background: rgba(255, 255, 255, 0.06);
	color: var(--text-main);
}

.json-textarea
{
	width: 100%;
	min-height: 96px;
	padding: 11px 13px;
	border: 1px solid rgba(255, 255, 255, 0.14);
	border-radius: 14px;
	background: rgba(255, 255, 255, 0.06);
	color: var(--text-main);
	resize: vertical;
	line-height: 1.5;
}

.form-group select:focus,
.json-textarea:focus
{
	outline: 2px solid rgba(229, 9, 20, 0.5);
	outline-offset: 2px;
	border-color: rgba(229, 9, 20, 0.4);
}

.form-group select option
{
	background: #1f1f1f;
	color: #f5f5f1;
}

.control-actions
{
	display: flex;
	justify-content: flex-start;
	margin-top: 8px;
}

.status-panel
{
	margin-top: 14px;
	padding: 12px 14px;
	border-radius: 16px;
	background: var(--accent-soft);
}

.status-text,
.error-text
{
	margin: 0;
	line-height: 1.5;
}

.error-text
{
	margin-top: 8px;
	color: var(--error);
}

.empty-state
{
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 140px;
	padding: 20px;
	border: 1px dashed rgba(255, 255, 255, 0.14);
	border-radius: 18px;
	color: var(--text-muted);
	background: rgba(255, 255, 255, 0.04);
	text-align: center;
}

.empty-state[hidden]
{
	display: none;
}

.game-list
{
	display: grid;
	gap: 12px;
	padding: 0;
	margin: 0;
	list-style: none;
}

.game-card
{
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	gap: 14px;
	align-items: center;
	padding: 18px;
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: 18px;
	background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.03));
	transition: transform 140ms ease, border-color 140ms ease, background-color 140ms ease;
}

.game-card:hover
{
	transform: translateY(-2px);
	border-color: rgba(184, 29, 36, 0.24);
}

.game-name
{
	margin: 0 0 8px;
	font-size: 18px;
}

.game-meta
{
	margin: 0;
	color: var(--text-muted);
	font-size: 14px;
	line-height: 1.5;
}

.launch-button,
.secondary-button
{
	padding: 12px 16px;
	border: 0;
	border-radius: 999px;
	cursor: pointer;
	transition: transform 120ms ease, background-color 120ms ease, opacity 120ms ease;
}

.launch-button
{
	background: var(--accent);
	color: #fff;
	font-weight: 700;
	box-shadow: 0 10px 24px rgba(184, 29, 36, 0.18);
}

.secondary-button
{
	background: rgba(255, 255, 255, 0.12);
	color: #ffffff;
}

.launch-button:hover,
.secondary-button:hover
{
	transform: translateY(-1px);
}

.launch-button:disabled,
.secondary-button:disabled
{
	cursor: not-allowed;
	opacity: 0.6;
	transform: none;
}

.frame-wrapper
{
	position: relative;
	overflow: hidden;
	border-radius: 18px;
	border: 1px solid rgba(255, 255, 255, 0.08);
	background:
		linear-gradient(180deg, rgba(184, 29, 36, 0.06), transparent 20%),
		#161616;
}

.preview-loading-overlay
{
	position: absolute;
	inset: 0;
	z-index: 2;
	display: grid;
	place-items: center;
	padding: 24px;
	background: rgba(8, 8, 8, 0.72);
	backdrop-filter: blur(6px);
}

.preview-loading-overlay[hidden]
{
	display: none;
}

.preview-loading-card
{
	width: min(420px, 100%);
	padding: 22px 20px;
	border: 1px solid rgba(255, 255, 255, 0.12);
	border-radius: 22px;
	background: rgba(20, 20, 20, 0.94);
	box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

.preview-loading-card.is-error
{
	border-color: rgba(255, 123, 114, 0.4);
	background: rgba(28, 16, 16, 0.96);
}

.preview-loading-eyebrow
{
	margin: 0 0 8px;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: rgba(255, 255, 255, 0.72);
}

.preview-loading-eyebrow.is-error
{
	color: var(--error);
}

.preview-loading-title
{
	margin: 0;
	font-size: 22px;
	line-height: 1.2;
}

.preview-loading-text
{
	margin: 10px 0 0;
	color: var(--text-muted);
	line-height: 1.5;
}

.preview-loading-progress
{
	position: relative;
	margin-top: 18px;
	height: 8px;
	border-radius: 999px;
	overflow: hidden;
	background: rgba(255, 255, 255, 0.08);
}

.preview-loading-progress[hidden]
{
	display: none;
}

.preview-loading-progress-bar
{
	position: absolute;
	top: 0;
	left: -35%;
	width: 35%;
	height: 100%;
	border-radius: inherit;
	background: linear-gradient(90deg, rgba(184, 29, 36, 0.3), rgba(212, 82, 87, 0.95), rgba(184, 29, 36, 0.3));
	animation: loading-slide 1.1s ease-in-out infinite;
}

.game-frame
{
	display: block;
	width: 100%;
	min-height: 76vh;
	border: 0;
	background: #161616;
}

.modal-backdrop
{
	position: fixed;
	inset: 0;
	z-index: 20;
	display: grid;
	place-items: center;
	padding: 20px;
	background: rgba(0, 0, 0, 0.7);
	backdrop-filter: blur(8px);
}

.modal-backdrop[hidden]
{
	display: none;
}

.modal-panel
{
	width: min(720px, 100%);
	padding: 22px;
	border: 1px solid rgba(255, 255, 255, 0.12);
	border-radius: 24px;
	background: rgba(24, 24, 24, 0.96);
	box-shadow: var(--shadow);
}

.modal-header
{
	margin-bottom: 16px;
}

.modal-header h2
{
	margin: 0;
	font-size: 20px;
}

.modal-header p
{
	margin: 6px 0 0;
	color: var(--text-muted);
	line-height: 1.5;
}

.api-param-fields
{
	display: grid;
	gap: 12px;
	max-height: 320px;
	overflow-y: auto;
	padding-right: 4px;
}

.api-param-row
{
	display: grid;
	grid-template-columns: minmax(120px, 180px) 1fr;
	gap: 12px;
	align-items: center;
}

.api-param-key
{
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	padding: 0 14px;
	border-radius: 12px;
	border: 1px solid rgba(255, 255, 255, 0.08);
	background: rgba(255, 255, 255, 0.04);
	color: var(--text-muted);
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.02em;
}

.api-param-value
{
	width: 100%;
	min-height: 44px;
	padding: 0 14px;
	border: 1px solid rgba(255, 255, 255, 0.12);
	border-radius: 12px;
	background: rgba(15, 15, 15, 0.9);
	color: var(--text-main);
	font: inherit;
}

.api-param-value:focus
{
	outline: none;
	border-color: rgba(229, 9, 20, 0.55);
	box-shadow: 0 0 0 3px rgba(229, 9, 20, 0.16);
}

.modal-actions
{
	display: flex;
	justify-content: flex-end;
	gap: 10px;
	margin-top: 18px;
}

@keyframes fade-up
{
	from
	{
		opacity: 0;
		transform: translateY(12px);
	}

	to
	{
		opacity: 1;
		transform: translateY(0);
	}
}

@keyframes loading-slide
{
	from
	{
		left: -35%;
	}

	to
	{
		left: 100%;
	}
}

@media (max-width: 960px)
{
	.launcher-shell
	{
		width: min(100% - 20px, 1440px);
		padding-top: 20px;
	}

	.launcher-header
	{
		flex-direction: column;
	}

	.launcher-layout
	{
		grid-template-columns: 1fr;
	}

	.api-param-row
	{
		grid-template-columns: 1fr;
	}

	.game-card
	{
		grid-template-columns: 1fr;
	}

	.game-frame
	{
		min-height: 62vh;
	}
}
