.zogr {
	--zogr-c: #7c3aed;
	max-width: 900px;
	margin: 0 auto;
	font-family: inherit;
	text-align: center;
}
.zogr__title { margin: 0 0 .25em; }
.zogr__subtitle { margin: 0 0 1em; opacity: .8; }

.zogr__levels {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px;
	list-style: none;
	margin: 0 0 12px;
	padding: 0;
}
.zogr__levels li {
	display: flex;
	flex-direction: column;
	min-width: 72px;
	padding: 6px 12px;
	border: 2px solid color-mix(in srgb, var(--zogr-c) 30%, transparent);
	border-radius: 10px;
	line-height: 1.2;
	transition: background .25s, color .25s, transform .25s;
}
.zogr__levels li b { font-size: 1.05em; color: var(--zogr-c); }
.zogr__levels li span { font-size: .8em; opacity: .7; }
.zogr__levels li.is-done { background: var(--zogr-c); border-color: var(--zogr-c); color: #fff; transform: translateY(-2px); }
.zogr__levels li.is-done b { color: #fff; }

.zogr__stage {
	position: relative;
	overflow: hidden;
	border-radius: 16px;
	background: #fff;
	box-shadow: 0 6px 24px rgba(0, 0, 0, .08);
	cursor: pointer;
	user-select: none;
	-webkit-user-select: none;
	-webkit-tap-highlight-color: transparent;
	touch-action: manipulation;
	outline: none;
}
.zogr__stage.is-result { min-height: 330px; }
.zogr__stage:focus-visible { box-shadow: 0 0 0 3px var(--zogr-c); }
.zogr__canvas { display: block; width: 100%; height: 240px; }

.zogr__hud {
	position: absolute;
	top: 10px;
	right: 14px;
	font-weight: 700;
	font-size: 14px;
	color: #374151;
}
.zogr__score { font-size: 22px; color: var(--zogr-c); }

.zogr__toast {
	position: absolute;
	top: 32%;
	left: 50%;
	transform: translate(-50%, -50%) scale(.6);
	opacity: 0;
	padding: 8px 18px;
	border-radius: 999px;
	background: var(--zogr-c);
	color: #fff;
	font-weight: 800;
	font-size: 18px;
	pointer-events: none;
	white-space: nowrap;
}
.zogr__toast.is-on { animation: zogr-toast 1.6s ease forwards; }
@keyframes zogr-toast {
	15% { opacity: 1; transform: translate(-50%, -50%) scale(1.08); }
	25% { transform: translate(-50%, -50%) scale(1); }
	80% { opacity: 1; }
	100% { opacity: 0; transform: translate(-50%, -80%) scale(1); }
}

.zogr__overlay {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: safe center;
	gap: 6px;
	padding: 16px;
	overflow-y: auto;
	background: rgba(255, 255, 255, .88);
	backdrop-filter: blur(2px);
	color: #111827;
	cursor: default;
}
.zogr__overlay--start { cursor: pointer; }
.zogr__overlay[hidden] { display: none; }
.zogr__overlay p { margin: 0; }
.zogr__big { font-size: 24px; font-weight: 800; }
.zogr__end-text { max-width: 520px; font-size: 15px; }
.zogr__hint kbd {
	padding: 2px 8px;
	border: 1px solid #d1d5db;
	border-bottom-width: 3px;
	border-radius: 6px;
	background: #f9fafb;
	font-family: inherit;
	font-size: .9em;
}
.zogr__hint--touch { display: none; }
@media (hover: none) and (pointer: coarse) {
	.zogr__hint--desktop { display: none; }
	.zogr__hint--touch { display: block; }
}

.zogr__actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 6px; }
.zogr__btn {
	display: inline-block;
	padding: 10px 18px;
	border: 2px solid var(--zogr-c);
	border-radius: 10px;
	background: var(--zogr-c);
	color: #fff;
	font: inherit;
	font-weight: 700;
	line-height: 1.2;
	text-decoration: none;
	cursor: pointer;
	transition: filter .15s, transform .15s;
}
.zogr__btn:hover, .zogr__btn:focus-visible { filter: brightness(1.08); transform: translateY(-1px); color: #fff; }
.zogr__btn[disabled] { opacity: .6; cursor: wait; }
.zogr__btn[hidden] { display: none; }
.zogr__btn--ghost { background: transparent; color: var(--zogr-c); }
.zogr__btn--ghost:hover, .zogr__btn--ghost:focus-visible { color: var(--zogr-c); }
.zogr__btn--small { padding: 6px 12px; font-size: 14px; }

.zogr__coupon { margin-top: 6px; }
.zogr__coupon[hidden] { display: none; }
.zogr__code-row { display: flex; gap: 8px; justify-content: center; align-items: center; margin: 4px 0; }
.zogr__code {
	padding: 6px 14px;
	border: 2px dashed var(--zogr-c);
	border-radius: 8px;
	background: #fff;
	color: #111827;
	font-size: 18px;
	font-weight: 800;
	letter-spacing: 1px;
	user-select: all;
}
.zogr__coupon-info { font-size: 13px; opacity: .8; max-width: 520px; margin: 4px auto 8px !important; }
.zogr__error { color: #b91c1c; font-weight: 600; }
.zogr__error[hidden] { display: none; }

@media (max-width: 499px) {
	.zogr__stage.is-result { min-height: 380px; }
	.zogr__canvas { height: 200px; }
	.zogr__big { font-size: 20px; }
	.zogr__end-text { font-size: 14px; }
	.zogr__btn { padding: 8px 14px; font-size: 14px; }
	.zogr__code { font-size: 15px; }
	.zogr__levels li { min-width: 60px; padding: 4px 8px; }
}
