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

:root {
	--bg: #ffffff;
	--surface: #f5f5f5;
	--border: #e0e0e0;
	--text: #111111;
	--muted: #888888;
	--accent: #111111;
	--radius: 6px;
	--font: system-ui, -apple-system, sans-serif;
}

body {
	font-family: var(--font);
	background: var(--bg);
	color: var(--text);
	min-height: 100vh;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 2rem 1rem;
}

main {
	width: 100%;
	max-width: 480px;
	display: flex;
	flex-direction: column;
	gap: 2rem;
}

/* Header */
header h1 {
	font-size: 1.5rem;
	font-weight: 700;
	letter-spacing: -0.02em;
}

header p {
	margin-top: 0.25rem;
	color: var(--muted);
	font-size: 0.9rem;
}

/* Form */
.form {
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

.field {
	display: flex;
	flex-direction: column;
	gap: 0.375rem;
}

label {
	font-size: 0.8rem;
	font-weight: 500;
	color: var(--muted);
}

.input-row {
	display: flex;
	gap: 0.5rem;
}

input[type="url"],
select {
	width: 100%;
	padding: 0.625rem 0.75rem;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	background: var(--bg);
	color: var(--text);
	font-family: var(--font);
	font-size: 0.9rem;
	outline: none;
	transition: border-color 0.15s;
}

input[type="url"]:focus,
select:focus {
	border-color: var(--accent);
}

input[type="url"]::placeholder {
	color: var(--muted);
}

button {
	padding: 0.625rem 1.25rem;
	background: var(--accent);
	color: #fff;
	border: none;
	border-radius: var(--radius);
	font-family: var(--font);
	font-size: 0.9rem;
	font-weight: 500;
	cursor: pointer;
	white-space: nowrap;
	transition: opacity 0.15s;
}

button:hover {
	opacity: 0.8;
}
button:active {
	opacity: 0.6;
}
button:disabled {
	opacity: 0.35;
	cursor: not-allowed;
}

.options {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0.75rem;
}

.error {
	font-size: 0.85rem;
	color: #d00;
	padding: 0.625rem 0.75rem;
	background: #fff0f0;
	border: 1px solid #ffd0d0;
	border-radius: var(--radius);
}

/* Result */
.result {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 1rem;
	animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
	from {
		opacity: 0;
		transform: translateY(6px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.result img {
	width: 200px;
	height: 200px;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	display: block;
}

.result-url {
	font-size: 0.78rem;
	color: var(--muted);
	word-break: break-all;
	text-align: center;
	max-width: 100%;
}

.btn-download {
	width: 100%;
	background: var(--bg);
	color: var(--text);
	border: 1px solid var(--border);
}

.btn-download:hover {
	background: var(--surface);
	opacity: 1;
}

/* Hidden utility */
[hidden] {
	display: none !important;
}
