:root {
	--bg-1: #05060a;
	--bg-2: #0c1018;
	--panel: rgba(12, 18, 28, 0.72);
	--panel-border: rgba(180, 220, 255, 0.12);
	--text: #edf6ff;
	--muted: #9fb1c7;
	--accent: #c9f5ff;
	--accent-2: #79d7ff;
	--danger: #ff6d7a;
	--good: #8fffd0;
	--shadow: 0 20px 70px rgba(0, 0, 0, 0.45);
}

* {
	box-sizing: border-box;
}

html,
body {
	margin: 0;
	width: 100%;
	height: 100%;
	overflow: hidden;
	font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
		"Segoe UI", sans-serif;
	color: var(--text);
	background: radial-gradient(
			circle at 50% 22%,
			rgba(85, 110, 160, 0.16),
			transparent 28%
		),
		radial-gradient(circle at 50% 40%, rgba(120, 200, 255, 0.06), transparent 34%),
		linear-gradient(180deg, var(--bg-2), var(--bg-1));
	letter-spacing: 0.02em;
}

body::before {
	content: "";
	position: fixed;
	inset: 0;
	pointer-events: none;
	background-image: radial-gradient(
		rgba(255, 255, 255, 0.035) 0.7px,
		transparent 0.7px
	);
	background-size: 6px 6px;
	opacity: 0.26;
	mix-blend-mode: soft-light;
}

canvas {
	position: fixed;
	inset: 0;
	width: 100%;
	height: 100%;
	display: block;
}

.ui {
	position: fixed;
	inset: 0;
	pointer-events: none;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	padding: 18px;
}

.topbar {
	display: flex;
	justify-content: flex-end;
	align-items: start;
}

.title-card,
.stats-card,
.word-card,
.start-card {
	background: var(--panel);
	border: 1px solid var(--panel-border);
	box-shadow: var(--shadow);
	backdrop-filter: blur(18px);
	-webkit-backdrop-filter: blur(18px);
	border-radius: 24px;
}

.title-card {
	max-width: 420px;
	padding: 16px 18px 15px;
}

.eyebrow {
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: 0.22em;
	color: var(--accent-2);
	margin-bottom: 8px;
	opacity: 0.9;
}

h1 {
	margin: 0;
	font-size: clamp(20px, 2vw, 30px);
	line-height: 1;
	font-weight: 800;
	letter-spacing: -0.03em;
}

.subtitle {
	margin-top: 9px;
	color: var(--muted);
	font-size: 13px;
	line-height: 1.45;
	max-width: 34ch;
}

.stats-card {
	min-width: 380px;
	padding: 14px 16px;
	display: grid;
	gap: 12px;
}

.stats-row {
	display: grid;
	grid-template-columns: repeat(4, minmax(72px, 1fr));
	gap: 10px;
}

.stat {
	border-radius: 16px;
	padding: 10px 12px;
	background: rgba(255, 255, 255, 0.03);
	border: 1px solid rgba(255, 255, 255, 0.05);
}

.stat-label {
	color: var(--muted);
	font-size: 10px;
	text-transform: uppercase;
	letter-spacing: 0.18em;
	margin-bottom: 5px;
}

.stat-value {
	font-size: 20px;
	font-weight: 800;
	letter-spacing: -0.03em;
}

.timer-wrap {
	width: 100%;
	margin-top: 14px;
}

.timer-bar {
	width: 100%;
	height: 12px;
	overflow: hidden;
	border-radius: 999px;
	background: rgba(255, 120, 130, 0.18);
	border: 1px solid rgba(255, 150, 160, 0.18);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.timer-fill {
	height: 100%;
	width: 100%;
	transform-origin: left center;
	background: linear-gradient(
		90deg,
		rgba(255, 170, 175, 0.98),
		rgba(255, 170, 175, 0.98)
	);
	box-shadow: 0 0 14px rgba(255, 160, 165, 0.2),
		inset 0 0 8px rgba(255, 255, 255, 0.08);
	border-radius: inherit;
}

.bottom {
	display: flex;
	justify-content: center;
	align-items: flex-end;
	padding-bottom: 8px;
}

.word-card {
	width: min(760px, 100%);
	padding: 20px 24px 18px;
	text-align: center;
}

.status-line {
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: 0.22em;
	color: var(--accent-2);
	margin-bottom: 10px;
	min-height: 1em;
}

.word {
	font-size: clamp(30px, 6vw, 70px);
	line-height: 1;
	font-weight: 900;
	letter-spacing: 0.1em;
	user-select: none;
	min-height: 1.1em;
	text-transform: uppercase;
}

.word .done {
	color: var(--good);
	text-shadow: 0 0 16px rgba(143, 255, 208, 0.26);
}

.word .current {
	color: white;
	text-shadow: 0 0 26px rgba(201, 245, 255, 0.45),
		0 0 6px rgba(255, 255, 255, 0.35);
}

.word .todo {
	color: rgba(237, 246, 255, 0.24);
}

.helper {
	margin-top: 12px;
	color: var(--muted);
	font-size: 13px;
}

.start-overlay {
	position: fixed;
	inset: 0;
	display: grid;
	place-items: center;
	pointer-events: none;
	padding: 20px;
	transition: opacity 260ms ease;
}

.start-overlay.hidden {
	opacity: 0;
}

.start-card {
	width: min(520px, 100%);
	text-align: center;
	padding: 24px 24px 22px;
}

.start-title {
	font-size: clamp(26px, 4vw, 44px);
	line-height: 1;
	font-weight: 900;
	letter-spacing: -0.04em;
	margin: 0 0 10px;
}

.start-copy {
	color: var(--muted);
	font-size: 15px;
	line-height: 1.55;
	max-width: 35ch;
	margin: 0 auto;
}

.start-tip {
	margin-top: 16px;
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: 0.22em;
	color: var(--accent-2);
}

.flash {
	position: fixed;
	inset: 0;
	pointer-events: none;
	background: radial-gradient(
		circle at 50% 50%,
		rgba(255, 255, 255, 0.12),
		transparent 35%
	);
	opacity: 0;
	transition: opacity 100ms linear;
	mix-blend-mode: screen;
}

.flash.show {
	opacity: 1;
}

@media (max-width: 760px) {
	.ui {
		padding: 12px;
	}

	.topbar {
		grid-template-columns: 1fr;
	}

	.title-card,
	.stats-card {
		max-width: 100%;
	}

	.stats-row {
		grid-template-columns: repeat(2, 1fr);
	}

	.word-card {
		padding: 18px 16px 16px;
	}

	.helper {
		font-size: 12px;
	}
}