@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap');

:root {
	--brand-purple: #6437ff;
	--brand-green: #4ffd7a;
	--brand-primary: var(--brand-green);
	--bg-base: #09090b;
	--bg-card: rgba(24, 24, 27, 1);
	--bg-elevated: rgba(39, 39, 42, 0.5);
	--border: rgba(63, 63, 70, 0.5);
	--border-hover: rgba(82, 82, 91, 0.8);
	--text-primary: #fafafa;
	--text-secondary: #a1a1aa;
	--text-muted: #71717a;
	--text-error: #ff6b6b;
	--radius: 6px;
	--radius-sm: 4px;
}

* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

body {
	font-family:
		'Inter',
		-apple-system,
		BlinkMacSystemFont,
		'Segoe UI',
		Roboto,
		sans-serif;
	background: var(--bg-base);
	color: var(--text-primary);
	min-height: 100vh;
	padding: 24px;
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

/* Subtle gradient overlay */
body::before {
	content: '';
	position: fixed;
	inset: 0;
	background:
		radial-gradient(
			ellipse at top left,
			rgba(100, 55, 255, 0.08) 0%,
			transparent 50%
		),
		radial-gradient(
			ellipse at bottom right,
			rgba(79, 253, 122, 0.05) 0%,
			transparent 50%
		);
	pointer-events: none;
	z-index: -1;
}

ul {
	list-style-type: none;
}

.container {
	max-width: 1400px;
	margin: 0 auto;
}

.header {
	text-align: center;
	margin-bottom: 32px;
	padding-top: 40px;
}

.back-button {
	position: fixed;
	top: 24px;
	left: 24px;
	background: var(--bg-card);
	color: var(--text-secondary);
	padding: 10px 16px;
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	font-size: 13px;
	font-weight: 500;
	cursor: pointer;
	transition: all 0.2s ease;
	text-decoration: none;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	z-index: 100;
}

.back-button:hover {
	background: var(--bg-elevated);
	border-color: var(--border-hover);
	color: var(--text-primary);
}

h1 {
	font-size: 2rem;
	font-weight: 600;
	margin-bottom: 8px;
	letter-spacing: -0.025em;
	color: var(--text-primary);
}

.subtitle {
	font-size: 1rem;
	color: var(--text-secondary);
	font-weight: 400;
}

button {
	background: var(--bg-elevated);
	color: var(--text-primary);
	border: 1px solid var(--border);
	padding: 10px 16px;
	border-radius: var(--radius-sm);
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
	transition: all 0.15s ease;
	flex-grow: 1;
	font-family: inherit;
}

button:last-child {
	margin-bottom: 0;
}

button:hover:not(:disabled) {
	background: rgba(63, 63, 70, 0.8);
	border-color: var(--border-hover);
}

button:active:not(:disabled) {
	transform: scale(0.98);
}

button:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

button.primary {
	background: var(--brand-primary);
	border-color: var(--brand-primary);
	color: white;
}

button.primary:hover:not(:disabled) {
	background: #5530e6;
	border-color: #5530e6;
}

a {
	color: var(--text-secondary);
}

input[type='text'],
input[type='number'],
textarea,
select {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	background: var(--bg-base);
	color: var(--text-primary);
	font-size: 14px;
	font-family: inherit;
	transition: all 0.15s ease;
}

input[type='text']:focus,
input[type='number']:focus,
textarea:focus,
select:focus {
	outline: none;
	border-color: var(--brand-primary);
	box-shadow: 0 0 0 3px rgba(100, 55, 255, 0.15);
}

input[type='text']::placeholder,
textarea::placeholder {
	color: var(--text-muted);
}

textarea {
	resize: vertical;
	min-height: 80px;
}

input[type='range'] {
	-webkit-appearance: none;
	width: 100%;
	height: 6px;
	border-radius: 3px;
	background: var(--bg-elevated);
	border: 1px solid var(--border);
	cursor: pointer;
}

input[type='range']::-webkit-slider-thumb {
	-webkit-appearance: none;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	background: var(--text-primary);
	border: none;
	cursor: pointer;
	transition: transform 0.15s ease;
}

input[type='range']::-webkit-slider-thumb:hover {
	transform: scale(1.1);
}

input[type='range']::-moz-range-thumb {
	width: 16px;
	height: 16px;
	border-radius: 50%;
	background: var(--text-primary);
	border: none;
	cursor: pointer;
}

input[type='range']:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

#player {
	position: relative;
	min-height: 500px;
}

#status {
	background: var(--bg-elevated);
	padding: 10px 12px;
	border-radius: var(--radius-sm);
	font-size: 13px;
	text-align: center;
	border: 1px solid var(--border);
	margin-bottom: 16px;
	color: var(--text-secondary);
}

.info {
	margin-top: 16px;
	padding: 12px;
	background: var(--bg-elevated);
	border-radius: var(--radius-sm);
	border: 1px solid var(--border);
}

.info > label {
	display: block;
	font-weight: 500;
	margin-bottom: 8px;
	font-size: 13px;
	color: var(--text-secondary);
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.info > button {
	margin-top: 8px;
}

.info > select {
	width: fit-content;
}

.demo-info {
	background: var(--bg-elevated);
	padding: 12px;
	border-radius: var(--radius-sm);
	font-size: 13px;
	line-height: 1.6;
	margin-bottom: 16px;
	border: 1px solid var(--border);
	color: var(--text-secondary);
}

.demo-info strong {
	color: var(--text-primary);
}

.color-group {
	display: flex;
	gap: 8px;
	align-items: center;
}

.color-group input[type='color'] {
	width: 44px;
	height: 38px;
	padding: 2px;
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	background: var(--bg-base);
	cursor: pointer;
}

.color-group input[type='color']::-webkit-color-swatch-wrapper {
	padding: 2px;
}

.color-group input[type='color']::-webkit-color-swatch {
	border-radius: 4px;
	border: none;
}

.color-group input[type='text'] {
	flex: 1;
}

#frameDisplay {
	font-size: 12px;
	color: var(--text-muted);
	text-align: center;
	margin-top: 8px;
	font-variant-numeric: tabular-nums;
}

.about-section {
	background: var(--bg-card);
	border-radius: var(--radius);
	padding: 24px;
	border: 1px solid var(--border);
	margin-top: 24px;
}

.about-section h3 {
	font-size: 1.2rem;
	font-weight: 600;
	margin-bottom: 12px;
	color: var(--text-primary);
}

.about-section p {
	line-height: 1.7;
	color: var(--text-secondary);
	margin-bottom: 12px;
	font-size: 16px;
}

.about-section p:last-child {
	margin-bottom: 0;
}

#loading {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	color: var(--text-secondary);
	font-size: 14px;
	font-weight: 500;
	gap: 16px;
	height: 500px;
}

.loading-spinner {
	width: 32px;
	height: 32px;
	border: 2px solid var(--border);
	border-top-color: var(--brand-primary);
	border-radius: 50%;
	animation: spin 0.8s linear infinite;
}

@keyframes spin {
	0% {
		transform: rotate(0deg);
	}
	100% {
		transform: rotate(360deg);
	}
}

@media (max-width: 900px) {
	body {
		padding: 16px;
	}

	.header {
		padding-top: 48px;
	}

	h1 {
		font-size: 1.75rem;
	}

	.back-button {
		top: 16px;
		left: 16px;
	}
}

.step-controls {
	display: flex;
	gap: 8px;
	margin-top: 8px;
}

.step-controls button {
	flex: 1;
	margin-bottom: 0;
}
