:root {
	--page-bg: #212738;
	--panel-bg: rgba(31, 42, 66, 0.94);
	--panel-border: rgba(148, 163, 184, 0.12);
	--text-primary: #f9fafb;
	--text-secondary: #9ca3af;
	--preview-border: rgba(148, 163, 184, 0.2);
	--button-bg: rgba(15, 23, 42, 0.9);
	--button-border: rgba(148, 163, 184, 0.26);
	--button-active: #6366f1;
	--shadow-strong: 0 45px 120px -45px rgba(15, 23, 42, 0.8);
	--radius-xl: 28px;
	--radius-md: 16px;
	--radius-sm: 12px;
	--font-body: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

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

*,
*::before,
*::after {
	box-sizing: border-box;
}

body {
	margin: 0;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 3rem 1.5rem 2rem;
	background: var(--page-bg);
	color: var(--text-primary);
	font-family: var(--font-body);
	position: relative;
	overflow: hidden;
}

.ambient {
	position: absolute;
	inset: 10% -30% auto -30%;
	min-height: 480px;
	background: radial-gradient(ellipse at top, rgba(99, 102, 241, 0.55), transparent 60%),
		radial-gradient(ellipse at bottom left, rgba(14, 116, 144, 0.35), transparent 60%);
	filter: blur(80px);
	opacity: 0.6;
	pointer-events: none;
}

.page {
	width: 100%;
	max-width: 980px;
	position: relative;
	z-index: 1;
}

.panel {
	background: var(--panel-bg);
	border: 1px solid var(--panel-border);
	border-radius: var(--radius-xl);
	padding: 2.75rem clamp(1.5rem, 4vw, 3rem);
	box-shadow: var(--shadow-strong);
	backdrop-filter: blur(18px);
}

.panel__header .brand {
	display: flex;
	align-items: center;
	gap: 1.75rem;
	margin-bottom: clamp(1.75rem, 3vw, 2.5rem);
}

.brand__icon {
	position: relative;
	width: 56px;
	height: 56px;
	display: grid;
	place-items: center;
	border-radius: 18px;
	background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(236, 72, 153, 0.2));
	border: 1px solid rgba(99, 102, 241, 0.35);
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.brand__icon::before {
	content: '';
	width: 0;
	height: 0;
	border-left: 14px solid transparent;
	border-right: 14px solid transparent;
	border-bottom: 24px solid #ffffff;
	transform: translateY(-4px) scale(1.05);
	filter: drop-shadow(0 12px 22px rgba(59, 130, 246, 0.35));
}

.brand__copy h1 {
	margin: 0;
	font-size: clamp(1.6rem, 3vw, 2rem);
	font-weight: 600;
	letter-spacing: -0.03em;
}

.brand__copy p {
	margin: 0.35rem 0 0;
	color: var(--text-secondary);
	font-size: clamp(0.9rem, 2vw, 1rem);
}

.panel__body {
	display: flex;
	flex-direction: column;
	gap: 2rem;
}

.preview {
	min-height: 220px;
	border-radius: var(--radius-xl);
	border: 1px solid var(--preview-border);
	background: linear-gradient(135deg, #7986cb, #1a237e);
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04),
		0 28px 60px -32px rgba(59, 130, 246, 0.4);
	position: relative;
	overflow: hidden;
}

.preview::after {
	content: '';
	position: absolute;
	inset: 0;
	background: linear-gradient(120deg, rgba(15, 23, 42, 0.2), transparent 40%, rgba(236, 72, 153, 0.12));
	pointer-events: none;
}

.controls {
	display: flex;
	gap: clamp(1.5rem, 4vw, 2.75rem);
	flex-wrap: wrap;
}

.control-group {
	flex: 1 1 260px;
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

.control-group h2 {
	margin: 0;
	font-size: 0.95rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	font-weight: 600;
	color: var(--text-secondary);
}

.colors {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
	gap: 1rem;
}

.colors label {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 1rem;
	padding: 0.85rem 1rem;
	border-radius: var(--radius-md);
	border: 1px solid var(--preview-border);
	background: rgba(15, 23, 42, 0.6);
	color: var(--text-secondary);
	font-size: 0.9rem;
	font-weight: 500;
}

.colors input[type='color'] {
	appearance: none;
	width: 52px;
	height: 52px;
	border-radius: 12px;
	border: 1px solid rgba(148, 163, 184, 0.28);
	background: none;
	padding: 0;
	cursor: pointer;
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.colors input[type='color']::-webkit-color-swatch-wrapper {
	padding: 0;
	border-radius: inherit;
}

.colors input[type='color']::-webkit-color-swatch {
	border: none;
	border-radius: inherit;
}

.buttons {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 0.85rem;
}

.direction-button {
	height: 56px;
	border-radius: var(--radius-md);
	border: 1px solid var(--button-border);
	background: var(--button-bg);
	color: var(--text-secondary);
	display: grid;
	place-items: center;
	cursor: pointer;
	transition: border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.direction-button:hover {
	border-color: rgba(148, 163, 184, 0.45);
	color: #cbd5f5;
	box-shadow: 0 14px 24px -18px rgba(99, 102, 241, 0.45);
}

.direction-button.active {
	border-color: rgba(99, 102, 241, 0.65);
	color: #ffffff;
	box-shadow: 0 18px 38px -22px rgba(99, 102, 241, 0.62);
	background: linear-gradient(135deg, rgba(99, 102, 241, 0.3), rgba(236, 72, 153, 0.18));
}

.rotate-icon i {
	transform: rotate(45deg);
}

.btn {
	border: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-weight: 600;
	cursor: pointer;
	border-radius: var(--radius-md);
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-generate {
	width: 100%;
	padding: 1rem 1.25rem;
	font-size: 1rem;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: #0b0d12;
	background: linear-gradient(135deg, #38bdf8, #6366f1 55%, #ec4899);
	box-shadow: 0 18px 32px -18px rgba(56, 189, 248, 0.7);
}

.btn-generate:hover {
	transform: translateY(-1px);
	box-shadow: 0 20px 36px -18px rgba(99, 102, 241, 0.75);
}

.btn-generate:active {
	transform: translateY(0);
	box-shadow: 0 14px 24px -18px rgba(99, 102, 241, 0.6);
}

.output {
	display: flex;
	align-items: center;
	gap: 1rem;
	flex-wrap: wrap;
	background: rgba(15, 23, 42, 0.55);
	border-radius: var(--radius-md);
	border: 1px solid var(--preview-border);
	padding: 1rem;
}

textarea.code {
	flex: 1 1 280px;
	min-height: 80px;
	border: none;
	outline: none;
	color: var(--text-primary);
	background: rgba(17, 24, 39, 0.6);
	font-family: 'Fira Code', 'Courier New', monospace;
	font-size: 0.95rem;
	padding: 0.85rem 1rem;
	border-radius: 12px;
	resize: none;
}

.copy {
	padding: 0.85rem 1.35rem;
	border-radius: 12px;
	border: 1px solid rgba(148, 163, 184, 0.25);
	background: rgba(17, 24, 39, 0.72);
	color: var(--text-primary);
	font-weight: 600;
	cursor: pointer;
	transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.copy:hover {
	border-color: rgba(99, 102, 241, 0.6);
	transform: translateY(-1px);
	box-shadow: 0 18px 34px -20px rgba(56, 189, 248, 0.45);
}

.copy:active {
	transform: translateY(0);
	box-shadow: none;
}

.site-footer {
	margin-top: 2.5rem;
	color: var(--text-secondary);
	font-size: 0.9rem;
	position: relative;
	z-index: 1;
	text-align: center;
}

.site-footer a {
	color: #f9fafb;
	text-decoration: none;
	font-weight: 600;
	border-bottom: 1px solid transparent;
	transition: border-color 0.2s ease, color 0.2s ease;
}

.site-footer a:hover {
	color: #38bdf8;
	border-color: rgba(56, 189, 248, 0.6);
}

@media (max-width: 860px) {
	body {
		padding: 2.5rem 1.25rem 2rem;
	}

	.panel {
		padding: 2.25rem 1.75rem;
	}

	.buttons {
		grid-template-columns: repeat(4, minmax(0, 56px));
	}
}

@media (max-width: 640px) {
	.panel {
		padding: 1.85rem 1.5rem;
	}

	.buttons {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}

	.direction-button {
		height: 52px;
	}
}
