:root {
	--bg: #f2f2f7;
	--card: #ffffff;
	--fill: rgba(120, 120, 128, 0.12);
	--fill-strong: rgba(120, 120, 128, 0.2);
	--label: #000000;
	--label-2: rgba(60, 60, 67, 0.6);
	--label-3: rgba(60, 60, 67, 0.3);
	--separator: rgba(60, 60, 67, 0.18);
	--blue: #007aff;
	--blue-tint: rgba(0, 122, 255, 0.1);
	--green: #34c759;
	--green-tint: rgba(52, 199, 89, 0.12);
	--red: #ff3b30;
	--red-tint: rgba(255, 59, 48, 0.1);
	--yellow: #ff9f0a;
	--yellow-tint: rgba(255, 159, 10, 0.12);
	--seg-thumb: #ffffff;
	--shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.06);
	--glass: rgba(242, 242, 247, 0.72);
	--radius: 22px;
	--ease: cubic-bezier(0.32, 0.72, 0, 1);
}

@media (prefers-color-scheme: dark) {
	:root {
		--bg: #000000;
		--card: #1c1c1e;
		--fill: rgba(118, 118, 128, 0.24);
		--fill-strong: rgba(118, 118, 128, 0.36);
		--label: #ffffff;
		--label-2: rgba(235, 235, 245, 0.6);
		--label-3: rgba(235, 235, 245, 0.3);
		--separator: rgba(84, 84, 88, 0.6);
		--blue: #0a84ff;
		--blue-tint: rgba(10, 132, 255, 0.18);
		--green: #30d158;
		--green-tint: rgba(48, 209, 88, 0.16);
		--red: #ff453a;
		--red-tint: rgba(255, 69, 58, 0.16);
		--yellow: #ffd60a;
		--yellow-tint: rgba(255, 214, 10, 0.12);
		--seg-thumb: #636366;
		--shadow: none;
		--glass: rgba(0, 0, 0, 0.7);
	}
}

* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
	-webkit-tap-highlight-color: transparent;
}

html {
	background: var(--bg);
}

body {
	min-height: 100vh;
	min-height: 100dvh;
	background: var(--bg);
	color: var(--label);
	font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", "Inter", "Segoe UI", Arial, sans-serif;
	font-size: 17px;
	line-height: 1.4;
	letter-spacing: -0.01em;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

button {
	font: inherit;
	color: inherit;
	border: 0;
	background: none;
	cursor: pointer;
}

svg {
	fill: none;
	stroke: currentColor;
	stroke-width: 1.8;
	stroke-linecap: round;
	stroke-linejoin: round;
}

/* ---------- Screens ---------- */

.screen {
	display: none;
	width: 100%;
	max-width: 640px;
	margin: 0 auto;
	padding: max(24px, env(safe-area-inset-top)) 16px max(32px, env(safe-area-inset-bottom));
}

.screen.active {
	display: block;
	animation: screen-in 0.5s var(--ease);
}

@keyframes screen-in {
	from {
		opacity: 0;
		transform: translateY(12px) scale(0.99);
	}
}

/* ---------- Hero ---------- */

.hero {
	text-align: center;
	padding: 28px 8px 24px;
}

.app-icon {
	width: 72px;
	height: 72px;
	margin: 0 auto 18px;
	border-radius: 18px;
	background: linear-gradient(160deg, #5ac8fa, #007aff 55%, #5856d6);
	display: grid;
	place-items: center;
	box-shadow: 0 10px 30px rgba(0, 122, 255, 0.35);
}

.app-icon svg {
	width: 40px;
	height: 40px;
	stroke: #fff;
	stroke-width: 2.4;
}

h1 {
	font-size: 34px;
	font-weight: 700;
	letter-spacing: -0.025em;
	line-height: 1.15;
}

.subtitle {
	color: var(--label-2);
	font-size: 17px;
	margin-top: 6px;
}

/* ---------- Grouped lists ---------- */

.group {
	margin-bottom: 26px;
}

.group-label {
	font-size: 13px;
	font-weight: 400;
	text-transform: uppercase;
	letter-spacing: 0.02em;
	color: var(--label-2);
	padding: 0 16px 7px;
}

.group-footer {
	font-size: 13px;
	color: var(--label-2);
	padding: 7px 16px 0;
}

.group-footer.center {
	text-align: center;
	margin-bottom: 26px;
}

.card {
	background: var(--card);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	overflow: hidden;
}

.divider {
	height: 0.5px;
	background: var(--separator);
	margin-left: 16px;
}

textarea {
	display: block;
	width: 100%;
	border: 0;
	outline: 0;
	resize: vertical;
	min-height: 150px;
	max-height: 50vh;
	padding: 16px;
	font: inherit;
	color: var(--label);
	background: transparent;
}

textarea::placeholder {
	color: var(--label-3);
}

.dropzone {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 14px 16px;
	color: var(--blue);
	cursor: pointer;
	transition: background 0.2s;
	outline: 0;
}

.dropzone span {
	color: var(--label-2);
	font-size: 15px;
}

.dropzone strong {
	color: var(--blue);
	font-weight: 500;
}

.dropzone svg {
	width: 26px;
	height: 26px;
	flex: none;
}

.dropzone:hover,
.dropzone:focus-visible,
.dropzone.dragging {
	background: var(--blue-tint);
}

.thumbs {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
	padding: 0 16px;
}

.thumbs:not(:empty) {
	padding: 4px 16px 16px;
}

.thumb {
	position: relative;
	width: 76px;
	height: 76px;
	border-radius: 14px;
	overflow: hidden;
	background: var(--fill);
	animation: pop 0.35s var(--ease);
}

.thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.thumb button {
	position: absolute;
	top: 5px;
	right: 5px;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.55);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	display: grid;
	place-items: center;
}

.thumb button svg {
	width: 12px;
	height: 12px;
	stroke: #fff;
	stroke-width: 2.6;
}

@keyframes pop {
	from {
		opacity: 0;
		transform: scale(0.8);
	}
}

.list .row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	min-height: 54px;
	padding: 9px 12px 9px 16px;
	position: relative;
}

.list .row + .row::before {
	content: "";
	position: absolute;
	top: 0;
	left: 16px;
	right: 0;
	height: 0.5px;
	background: var(--separator);
}

.row-label {
	white-space: nowrap;
}

/* ---------- Segmented control ---------- */

.segmented {
	position: relative;
	display: flex;
	background: var(--fill);
	border-radius: 9px;
	padding: 2px;
	flex: 0 1 300px;
	min-width: 0;
}

.segmented .thumb-bg {
	position: absolute;
	top: 2px;
	bottom: 2px;
	left: 0;
	border-radius: 7px;
	background: var(--seg-thumb);
	box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12), 0 3px 1px rgba(0, 0, 0, 0.04);
	transition: transform 0.35s var(--ease), width 0.35s var(--ease);
}

.segmented button {
	position: relative;
	z-index: 1;
	flex: 1 1 0;
	min-width: 0;
	padding: 6px 6px;
	font-size: 13px;
	font-weight: 500;
	border-radius: 7px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	transition: font-weight 0.2s;
}

.segmented button.selected {
	font-weight: 600;
}

/* ---------- Buttons ---------- */

.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	height: 44px;
	padding: 0 20px;
	border-radius: 999px;
	font-weight: 600;
	font-size: 16px;
	transition: transform 0.15s var(--ease), opacity 0.2s, background 0.2s;
	user-select: none;
}

.btn:active:not(:disabled) {
	transform: scale(0.96);
}

.btn:disabled {
	opacity: 0.4;
	cursor: default;
}

.btn.large {
	width: 100%;
	height: 52px;
	font-size: 17px;
	border-radius: 14px;
}

.btn.primary {
	background: var(--blue);
	color: #fff;
}

.btn.gray {
	background: var(--fill);
	color: var(--blue);
}

.btn.tinted {
	background: var(--yellow-tint);
	color: var(--yellow);
}

.btn.tinted.used {
	background: var(--fill);
	color: var(--label-2);
}

.btn svg {
	width: 19px;
	height: 19px;
	stroke-width: 2;
}

.icon-btn {
	width: 34px;
	height: 34px;
	border-radius: 50%;
	background: var(--fill);
	display: grid;
	place-items: center;
	color: var(--label-2);
	flex: none;
	transition: transform 0.15s var(--ease);
}

.icon-btn:active {
	transform: scale(0.92);
}

.icon-btn svg {
	width: 16px;
	height: 16px;
	stroke-width: 2.4;
}

.error {
	color: var(--red);
	font-size: 15px;
	text-align: center;
	min-height: 0;
	margin-bottom: 12px;
}

.error:empty {
	display: none;
}

/* ---------- Loading ---------- */

#screen-loading.active,
#screen-boot.active {
	display: grid;
	place-items: center;
	min-height: 100vh;
	min-height: 100dvh;
}

.loading {
	text-align: center;
}

.loading h2 {
	font-size: 22px;
	font-weight: 600;
	margin-top: 26px;
	letter-spacing: -0.02em;
	transition: opacity 0.3s;
}

.spinner {
	position: relative;
	width: 44px;
	height: 44px;
	margin: 0 auto;
}

.spinner i {
	position: absolute;
	left: 50%;
	top: 0;
	width: 4px;
	height: 12px;
	margin-left: -2px;
	border-radius: 2px;
	background: var(--label-2);
	transform-origin: 2px 22px;
	animation: fade 1s linear infinite;
}

.spinner i:nth-child(1) { transform: rotate(0deg); animation-delay: -0.917s; }
.spinner i:nth-child(2) { transform: rotate(30deg); animation-delay: -0.833s; }
.spinner i:nth-child(3) { transform: rotate(60deg); animation-delay: -0.75s; }
.spinner i:nth-child(4) { transform: rotate(90deg); animation-delay: -0.667s; }
.spinner i:nth-child(5) { transform: rotate(120deg); animation-delay: -0.583s; }
.spinner i:nth-child(6) { transform: rotate(150deg); animation-delay: -0.5s; }
.spinner i:nth-child(7) { transform: rotate(180deg); animation-delay: -0.417s; }
.spinner i:nth-child(8) { transform: rotate(210deg); animation-delay: -0.333s; }
.spinner i:nth-child(9) { transform: rotate(240deg); animation-delay: -0.25s; }
.spinner i:nth-child(10) { transform: rotate(270deg); animation-delay: -0.167s; }
.spinner i:nth-child(11) { transform: rotate(300deg); animation-delay: -0.083s; }
.spinner i:nth-child(12) { transform: rotate(330deg); animation-delay: 0s; }

@keyframes fade {
	from { opacity: 1; }
	to { opacity: 0.15; }
}

/* ---------- Quiz ---------- */

#screen-quiz.active {
	display: flex;
	flex-direction: column;
	min-height: 100vh;
	min-height: 100dvh;
	padding-top: 0;
}

.topbar {
	position: sticky;
	top: 0;
	z-index: 5;
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 0 -16px;
	padding: max(12px, env(safe-area-inset-top)) 16px 12px;
	background: var(--glass);
	backdrop-filter: saturate(180%) blur(20px);
	-webkit-backdrop-filter: saturate(180%) blur(20px);
}

.topbar-center {
	flex: 1;
	min-width: 0;
	text-align: center;
	display: flex;
	flex-direction: column;
}

.quiz-title {
	font-weight: 600;
	font-size: 16px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.counter {
	font-size: 13px;
	color: var(--label-2);
	font-variant-numeric: tabular-nums;
}

.badge {
	font-size: 12px;
	font-weight: 600;
	text-transform: capitalize;
	padding: 4px 10px;
	border-radius: 999px;
	background: var(--blue-tint);
	color: var(--blue);
	flex: none;
}

.badge.easy { background: var(--green-tint); color: var(--green); }
.badge.hard { background: var(--red-tint); color: var(--red); }

.progress {
	height: 4px;
	border-radius: 2px;
	background: var(--fill);
	overflow: hidden;
	margin: 4px 0 20px;
}

.progress-fill {
	height: 100%;
	width: 0;
	background: var(--blue);
	border-radius: 2px;
	transition: width 0.5s var(--ease);
}

.question-wrap {
	flex: 1;
}

.question-card {
	padding: 24px 20px 20px;
}

.question-card.enter {
	animation: card-in 0.45s var(--ease);
}

.question-card.enter-back {
	animation: card-in-back 0.45s var(--ease);
}

@keyframes card-in {
	from { opacity: 0; transform: translateX(28px); }
}

@keyframes card-in-back {
	from { opacity: 0; transform: translateX(-28px); }
}

.eyebrow {
	font-size: 13px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--blue);
}

.question {
	font-size: 22px;
	font-weight: 600;
	letter-spacing: -0.02em;
	line-height: 1.3;
	margin: 8px 0 22px;
}

.options {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.option {
	display: flex;
	align-items: center;
	gap: 14px;
	width: 100%;
	text-align: left;
	padding: 14px 16px;
	border-radius: 16px;
	background: var(--fill);
	box-shadow: inset 0 0 0 2px transparent;
	transition: background 0.2s, box-shadow 0.2s, transform 0.15s var(--ease);
	font-size: 17px;
}

.option:hover {
	background: var(--fill-strong);
}

.option:active {
	transform: scale(0.985);
}

.option.selected {
	background: var(--blue-tint);
	box-shadow: inset 0 0 0 2px var(--blue);
}

.option .key {
	flex: none;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	display: grid;
	place-items: center;
	font-size: 14px;
	font-weight: 600;
	color: var(--label-2);
	background: var(--card);
	transition: background 0.2s, color 0.2s;
}

.option.selected .key {
	background: var(--blue);
	color: #fff;
}

.hint-box {
	display: flex;
	gap: 10px;
	align-items: flex-start;
	margin-top: 16px;
	padding: 14px 16px;
	border-radius: 16px;
	background: var(--yellow-tint);
	animation: pop 0.35s var(--ease);
}

.hint-box[hidden] {
	display: none;
}

.hint-box svg {
	width: 20px;
	height: 20px;
	flex: none;
	color: var(--yellow);
	margin-top: 1px;
}

.hint-box p {
	font-size: 15px;
}

.quiz-footer {
	position: sticky;
	bottom: 0;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	margin: 20px -16px calc(-1 * max(32px, env(safe-area-inset-bottom)));
	padding: 12px 16px max(16px, env(safe-area-inset-bottom));
	background: var(--glass);
	backdrop-filter: saturate(180%) blur(20px);
	-webkit-backdrop-filter: saturate(180%) blur(20px);
}

.nav-btns {
	display: flex;
	gap: 10px;
}

.nav-btns .btn {
	min-width: 92px;
}

/* ---------- Results ---------- */

.results-hero {
	padding-top: 20px;
}

.ring {
	position: relative;
	width: 148px;
	height: 148px;
	margin: 0 auto 20px;
}

.ring svg {
	width: 100%;
	height: 100%;
	transform: rotate(-90deg);
}

.ring circle {
	fill: none;
	stroke-width: 12;
}

.ring-track {
	stroke: var(--fill);
}

.ring-fill {
	stroke: var(--green);
	stroke-dasharray: 326.73;
	stroke-dashoffset: 326.73;
	transition: stroke-dashoffset 1.2s var(--ease), stroke 0.3s;
}

.ring-label {
	position: absolute;
	inset: 0;
	display: grid;
	place-content: center;
	grid-auto-flow: column;
	align-items: baseline;
	font-size: 40px;
	font-weight: 700;
	letter-spacing: -0.03em;
	font-variant-numeric: tabular-nums;
}

.ring-label small {
	font-size: 20px;
	color: var(--label-2);
	font-weight: 600;
}

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

.stat {
	background: var(--card);
	box-shadow: var(--shadow);
	border-radius: 18px;
	padding: 14px 8px;
	text-align: center;
	display: flex;
	flex-direction: column;
}

.stat span {
	font-size: 26px;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}

.stat small {
	font-size: 13px;
	color: var(--label-2);
}

.stat:nth-child(1) span { color: var(--green); }
.stat:nth-child(2) span { color: var(--red); }
.stat:nth-child(3) span { color: var(--yellow); }

.review-item {
	background: var(--card);
	box-shadow: var(--shadow);
	border-radius: var(--radius);
	padding: 18px 18px 16px;
	margin-bottom: 12px;
	animation: screen-in 0.5s var(--ease) both;
}

.review-head {
	display: flex;
	gap: 12px;
	align-items: flex-start;
}

.status-icon {
	flex: none;
	width: 26px;
	height: 26px;
	border-radius: 50%;
	display: grid;
	place-items: center;
	margin-top: 1px;
}

.status-icon svg {
	width: 14px;
	height: 14px;
	stroke: #fff;
	stroke-width: 3;
}

.status-icon.right { background: var(--green); }
.status-icon.wrong { background: var(--red); }
.status-icon.skipped { background: var(--label-3); }

.review-q {
	font-weight: 600;
	font-size: 17px;
	line-height: 1.35;
}

.review-meta {
	display: flex;
	gap: 6px;
	margin-top: 6px;
	flex-wrap: wrap;
}

.chip {
	font-size: 12px;
	font-weight: 600;
	padding: 3px 8px;
	border-radius: 999px;
	background: var(--fill);
	color: var(--label-2);
}

.chip.hint {
	background: var(--yellow-tint);
	color: var(--yellow);
}

.answers {
	margin: 14px 0 0 38px;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.answer {
	font-size: 15px;
	padding: 10px 12px;
	border-radius: 12px;
	display: flex;
	gap: 8px;
}

.answer b {
	flex: none;
	font-weight: 600;
}

.answer.correct {
	background: var(--green-tint);
}

.answer.correct b {
	color: var(--green);
}

.answer.yours {
	background: var(--red-tint);
}

.answer.yours b {
	color: var(--red);
}

.why {
	margin: 12px 0 0 38px;
	font-size: 15px;
	color: var(--label-2);
}

.why strong {
	color: var(--label);
	font-weight: 600;
}

.result-actions {
	display: flex;
	gap: 10px;
	margin-top: 8px;
}

/* ---------- Alert ---------- */

.alert-backdrop {
	position: fixed;
	inset: 0;
	z-index: 50;
	background: rgba(0, 0, 0, 0.35);
	display: grid;
	place-items: center;
	padding: 24px;
	animation: backdrop-in 0.2s ease;
}

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

@keyframes backdrop-in {
	from { opacity: 0; }
}

.alert {
	width: 270px;
	border-radius: 14px;
	overflow: hidden;
	background: rgba(242, 242, 247, 0.85);
	backdrop-filter: blur(30px) saturate(180%);
	-webkit-backdrop-filter: blur(30px) saturate(180%);
	text-align: center;
	animation: alert-in 0.3s var(--ease);
}

@media (prefers-color-scheme: dark) {
	.alert {
		background: rgba(37, 37, 37, 0.85);
	}
}

@keyframes alert-in {
	from { opacity: 0; transform: scale(1.12); }
}

.alert-body {
	padding: 19px 16px;
}

.alert h3 {
	font-size: 17px;
	font-weight: 600;
}

.alert p {
	font-size: 13px;
	margin-top: 4px;
}

.alert-actions {
	display: flex;
	border-top: 0.5px solid var(--separator);
}

.alert-actions button {
	flex: 1;
	height: 44px;
	color: var(--blue);
	font-size: 17px;
}

.alert-actions button + button {
	border-left: 0.5px solid var(--separator);
}

.alert-actions button:active {
	background: var(--fill);
}

.alert-actions .bold {
	font-weight: 600;
}

.alert-actions .destructive {
	color: var(--red);
}

/* ---------- Login ---------- */

#screen-login .hero {
	padding-top: 56px;
}

.fields {
	margin-bottom: 18px;
}

.field {
	cursor: text;
}

.field .row-label {
	width: 96px;
	flex: none;
}

.field input {
	flex: 1;
	min-width: 0;
	border: 0;
	outline: 0;
	background: transparent;
	font: inherit;
	color: var(--label);
	padding: 6px 0;
}

.field input::placeholder {
	color: var(--label-3);
}

/* ---------- Account pill ---------- */

.create-bar {
	display: flex;
	justify-content: flex-end;
	margin-bottom: -8px;
}

.account-pill {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 4px 14px 4px 4px;
	border-radius: 999px;
	background: var(--card);
	box-shadow: var(--shadow);
	text-align: left;
	transition: transform 0.15s var(--ease);
}

.account-pill:active {
	transform: scale(0.97);
}

.avatar {
	width: 32px;
	height: 32px;
	border-radius: 50%;
	display: grid;
	place-items: center;
	background: linear-gradient(160deg, #a2a2ad, #6e6e78);
	color: #fff;
	font-weight: 600;
	font-size: 15px;
	text-transform: uppercase;
}

.account-text {
	display: flex;
	flex-direction: column;
	line-height: 1.15;
}

.account-text span {
	font-size: 14px;
	font-weight: 600;
}

.account-text small {
	font-size: 12px;
	color: var(--label-2);
}

.account-text small.out {
	color: var(--red);
}

/* ---------- Glass appearance ---------- */

.backdrop {
	display: none;
}

html[data-ui="glass"] {
	--bg: #e8ecf7;
	--card: rgba(255, 255, 255, 0.42);
	--fill: rgba(255, 255, 255, 0.38);
	--fill-strong: rgba(255, 255, 255, 0.58);
	--glass: rgba(255, 255, 255, 0.45);
	--seg-thumb: rgba(255, 255, 255, 0.85);
	--separator: rgba(60, 60, 67, 0.14);
	--glass-border: rgba(255, 255, 255, 0.65);
	--glass-highlight: rgba(255, 255, 255, 0.8);
	--shadow: 0 10px 40px rgba(40, 50, 120, 0.12);
}

@media (prefers-color-scheme: dark) {
	html[data-ui="glass"] {
		--bg: #06070c;
		--card: rgba(44, 44, 52, 0.38);
		--fill: rgba(255, 255, 255, 0.08);
		--fill-strong: rgba(255, 255, 255, 0.14);
		--glass: rgba(16, 16, 22, 0.62);
		--seg-thumb: rgba(255, 255, 255, 0.24);
		--separator: rgba(255, 255, 255, 0.1);
		--glass-border: rgba(255, 255, 255, 0.14);
		--glass-highlight: rgba(255, 255, 255, 0.22);
		--shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
	}
}

html[data-ui="glass"] body {
	background: transparent;
}

html[data-ui="glass"] .backdrop {
	display: block;
	position: fixed;
	inset: 0;
	z-index: -1;
	overflow: hidden;
	background: var(--bg);
}

.backdrop span {
	position: absolute;
	width: 60vmax;
	height: 60vmax;
	border-radius: 50%;
	filter: blur(70px);
	opacity: 0.75;
	animation: drift 26s ease-in-out infinite alternate;
}

.backdrop span:nth-child(1) { background: #5ac8fa; top: -20vmax; left: -15vmax; }
.backdrop span:nth-child(2) { background: #af52de; top: -10vmax; right: -25vmax; animation-delay: -6s; animation-duration: 30s; }
.backdrop span:nth-child(3) { background: #ff9f0a; bottom: -30vmax; left: -10vmax; animation-delay: -12s; opacity: 0.55; }
.backdrop span:nth-child(4) { background: #ff2d55; bottom: -25vmax; right: -20vmax; animation-delay: -18s; animation-duration: 34s; opacity: 0.5; }

@media (prefers-color-scheme: dark) {
	.backdrop span {
		opacity: 0.45;
	}
}

@keyframes drift {
	0% { transform: translate(0, 0) scale(1); }
	50% { transform: translate(8vmax, 6vmax) scale(1.12); }
	100% { transform: translate(-6vmax, 10vmax) scale(0.95); }
}

/* Frosted surfaces with a light rim and top specular highlight */
html[data-ui="glass"] :is(.card, .stat, .review-item, .account-pill, .icon-btn, .btn.gray, .btn.tinted, .badge) {
	backdrop-filter: blur(28px) saturate(180%);
	-webkit-backdrop-filter: blur(28px) saturate(180%);
	border: 1px solid var(--glass-border);
	box-shadow: var(--shadow), inset 0 1px 0 var(--glass-highlight);
}

html[data-ui="glass"] :is(.topbar, .quiz-footer) {
	border-bottom: 1px solid var(--glass-border);
	backdrop-filter: saturate(180%) blur(32px);
	-webkit-backdrop-filter: saturate(180%) blur(32px);
}

html[data-ui="glass"] .quiz-footer {
	border-bottom: 0;
	border-top: 1px solid var(--glass-border);
}

html[data-ui="glass"] .btn.primary {
	background: linear-gradient(180deg, rgba(74, 163, 255, 0.95), rgba(0, 113, 255, 0.92));
	box-shadow: 0 10px 28px rgba(0, 122, 255, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.5);
	border: 1px solid rgba(255, 255, 255, 0.25);
}

html[data-ui="glass"] .option {
	border: 1px solid var(--glass-border);
	box-shadow: inset 0 1px 0 var(--glass-highlight);
}

html[data-ui="glass"] .option.selected {
	background: rgba(0, 122, 255, 0.2);
	box-shadow: inset 0 0 0 2px var(--blue), inset 0 1px 0 var(--glass-highlight);
}

html[data-ui="glass"] .segmented {
	border: 1px solid var(--glass-border);
}

html[data-ui="glass"] .alert {
	background: rgba(255, 255, 255, 0.55);
	border: 1px solid var(--glass-border);
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2), inset 0 1px 0 var(--glass-highlight);
}

@media (prefers-color-scheme: dark) {
	html[data-ui="glass"] .alert {
		background: rgba(40, 40, 46, 0.5);
	}
}

html[data-ui="glass"] :is(.hint-box, .answer) {
	border: 1px solid var(--glass-border);
}

html[data-ui="glass"] .divider,
html[data-ui="glass"] .list .row + .row::before {
	background: var(--separator);
}

/* ---------- Small screens ---------- */

@media (max-width: 480px) {
	h1 {
		font-size: 30px;
	}

	.list .row:not(.field) {
		flex-direction: column;
		align-items: stretch;
		gap: 8px;
		padding: 12px 16px;
	}

	.segmented {
		flex-basis: auto;
	}

	.question {
		font-size: 20px;
	}

	.nav-btns .btn {
		min-width: 78px;
		padding: 0 16px;
	}
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		transition-duration: 0.01ms !important;
	}
}
