:root {
	--fg: #10214d;
	--muted: #44557f;
	--g1: rgba(255, 255, 255, 0.06);
	--g2: rgba(255, 255, 255, 0.13);
	--g3: rgba(255, 255, 255, 0.28);
	--gline: rgba(255, 255, 255, 0.95);
	--gline2: rgba(16, 33, 77, 0.35);
	--line: rgba(16, 33, 77, 0.14);
	--ok: #1f78c8;
	--ok-bg: rgba(74, 157, 224, 0.22);
	--ok-line: rgba(31, 120, 200, 0.55);
	--bad: #b8435f;
	--bad-bg: rgba(226, 130, 155, 0.2);
	--bad-line: rgba(184, 67, 95, 0.5);
	--shade: rgba(16, 33, 77, 0.85);
	--blur: blur(4px) saturate(110%);
	--spec: inset 0 1px 0 #fff, 0 0 0 1px rgba(16, 33, 77, 0.1), 0 12px 30px -14px rgba(40, 80, 150, 0.35);
	--spec-sm: inset 0 1px 0 #fff, 0 0 0 1px rgba(16, 33, 77, 0.08), 0 3px 10px -6px rgba(40, 80, 150, 0.35);
	--r: 28px;
	--r2: 16px;
	color-scheme: light;
}
* {
	box-sizing: border-box;
}
body {
	margin: 0;
	color: var(--fg);
	background: #fff;
	font:
		17px/1.5 'Inter',
		system-ui,
		-apple-system,
		'Segoe UI',
		sans-serif;
	font-weight: 500;
}
body::before {
	content: '';
	position: fixed;
	inset: 0;
	z-index: -1;
	background: #fff url('sky.jpg') center / cover no-repeat;
}
main {
	max-width: 960px;
	margin: 0 auto;
	padding: 48px 18px 32px;
}
[hidden] {
	display: none !important;
}
button,
.mini,
.nb {
	touch-action: manipulation;
	-webkit-tap-highlight-color: transparent;
}
button,
input,
.tile {
	transition:
		background-color 0.15s,
		border-color 0.15s;
}
#body {
	touch-action: pan-y;
}
:focus-visible {
	outline: 2px solid var(--fg);
	outline-offset: 3px;
}
::selection {
	background: rgba(16, 33, 77, 0.2);
}
::placeholder {
	color: rgba(16, 33, 77, 0.45);
	font-weight: 500;
}

header {
	margin-bottom: 32px;
}
header h1 {
	margin: 0;
	font-size: 2.7rem;
	font-weight: 700;
	line-height: 1.05;
	letter-spacing: -0.02em;
}
header p {
	margin: 8px 0 0;
	font-size: 1.05rem;
	font-weight: 500;
	color: var(--muted);
}

.menu {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	grid-auto-rows: 1fr;
	gap: 14px;
}
@media (min-width: 700px) {
	.menu {
		grid-template-columns: repeat(3, 1fr);
		gap: 20px;
	}
}
.ico {
	display: grid;
	place-items: center;
	width: 52px;
	height: 52px;
	border-radius: 50%;
	color: var(--fg);
	background: var(--g3);
	border: 1px solid var(--gline);
	box-shadow: var(--spec-sm);
}
.ico svg {
	width: 26px;
	height: 26px;
	stroke-width: 2;
}
.tile {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 4px;
	min-height: 176px;
	padding: 22px 14px;
	text-align: center;
	font: inherit;
	color: var(--fg);
	background: var(--g1);
	border: 1px solid var(--gline);
	border-radius: var(--r);
	box-shadow: var(--spec);
	-webkit-backdrop-filter: var(--blur);
	backdrop-filter: var(--blur);
	cursor: pointer;
}
.tile .ico {
	width: 62px;
	height: 62px;
	margin-bottom: 10px;
}
.tile .ico svg {
	width: 30px;
	height: 30px;
}
.tile b {
	font-size: 1.2rem;
	font-weight: 700;
	line-height: 1.2;
}
.tile small {
	font-size: 0.95rem;
	line-height: 1.4;
	color: var(--muted);
}

.panel {
	padding: 30px;
	background: var(--g1);
	border: 1px solid var(--gline);
	border-radius: var(--r);
	box-shadow: var(--spec);
	-webkit-backdrop-filter: var(--blur);
	backdrop-filter: var(--blur);
}
.panel h2 {
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 0 0 16px;
	font-size: 1.6rem;
	font-weight: 700;
	line-height: 1.15;
}
.panel h2 .ico {
	width: 42px;
	height: 42px;
}
.hero {
	display: flex;
	align-items: center;
	gap: 16px;
	margin-bottom: 12px;
}
.hero h2 {
	margin: 0;
	font-size: 1.9rem;
}
.hero p {
	margin: 0;
	color: var(--muted);
}
.hero .ico {
	flex: none;
	width: 64px;
	height: 64px;
}
.hero .ico svg {
	width: 30px;
	height: 30px;
}
.srow {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	padding: 16px 0;
	border-top: 1px solid var(--line);
}
.srow b {
	font-weight: 700;
}
.srow small {
	display: block;
	font-size: 0.9rem;
	color: var(--muted);
}
.ctl {
	display: flex;
	align-items: center;
	gap: 8px;
	font-weight: 600;
	color: var(--muted);
}
.ctl input {
	width: 84px;
	text-align: center;
	font-size: 1.15rem;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}
.step {
	width: 42px;
	height: 42px;
	padding: 0;
	font: inherit;
	font-size: 1.4rem;
	font-weight: 600;
	line-height: 1;
	color: var(--fg);
	background: var(--g2);
	border: 1px solid var(--gline);
	border-radius: 50%;
	box-shadow: var(--spec-sm);
	cursor: pointer;
}
input {
	width: 100%;
	padding: 10px 16px;
	font: inherit;
	font-weight: 600;
	color: var(--fg);
	background: var(--g1);
	border: 1px solid var(--gline2);
	border-radius: var(--r2);
}
input:focus {
	background: var(--g3);
	border-color: var(--fg);
	outline: none;
}
.flow {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin: 10px 0 26px;
	padding: 14px;
	font-size: 0.92rem;
	background: var(--g1);
	border: 1px solid var(--line);
	border-radius: var(--r2);
}
.flow span {
	padding: 4px 14px;
	background: var(--g2);
	border: 1px solid var(--gline);
	border-radius: 999px;
}
.flow b {
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}
.flow i {
	font-style: normal;
	color: var(--muted);
}

.btn {
	padding: 11px 28px;
	font: inherit;
	font-weight: 600;
	color: var(--fg);
	background: var(--g2);
	border: 1px solid var(--gline);
	border-radius: 999px;
	box-shadow: var(--spec-sm);
	cursor: pointer;
}
.btn.main {
	font-weight: 700;
	background: var(--g3);
	border: 1.5px solid var(--fg);
}
.row-btns {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
}

.panel.run {
	position: relative;
	padding: 0;
	overflow: hidden;
}
.bar {
	display: flex;
	justify-content: space-between;
	align-items: center;
	flex-wrap: wrap;
	gap: 12px;
	padding: 16px 22px;
	border-bottom: 1px solid var(--line);
}
.bar .ttl {
	display: flex;
	align-items: center;
	gap: 10px;
	font-size: 1.25rem;
	font-weight: 700;
	line-height: 1.2;
}
.bar .ttl::before {
	content: '';
	width: 10px;
	height: 10px;
	background: var(--fg);
	border-radius: 50%;
}
.bar .tl {
	font-size: 0.95rem;
	color: var(--muted);
}
.bar .t {
	margin-left: 6px;
	padding: 2px 16px;
	font-size: 1.3rem;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	background: var(--g2);
	border: 1px solid var(--gline);
	border-radius: 999px;
}
.run #body {
	min-height: 380px;
	padding: 26px 18px;
	background: rgba(255, 255, 255, 0.1);
}
.big {
	position: absolute;
	inset: 0;
	display: grid;
	place-items: center;
	text-align: center;
	font-size: 1.6rem;
	font-weight: 700;
	pointer-events: none;
}

.cimg {
	display: block;
	width: 100%;
	max-width: 72px;
	height: auto;
	margin: 0 auto;
}
.pimg {
	display: block;
	width: 100%;
	aspect-ratio: 1;
	object-fit: cover;
	background: #fff;
	border-radius: 8px;
}
.person {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	font-size: 1rem;
}
.person img {
	width: 80px;
	height: 80px;
	object-fit: cover;
	background: #fff;
	border-radius: 14px;
}
.face {
	width: 80px;
	height: 80px;
	object-fit: cover;
	background: #fff;
	border: 3px solid #fff;
	border-radius: 16px;
	outline: 1px solid rgba(16, 33, 77, 0.15);
}
.w {
	min-width: 0;
}

.viewer {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) minmax(0, 1fr);
	grid-template-areas: 'l c r' 'f f f';
	align-items: center;
	gap: 16px;
	min-height: 260px;
	user-select: none;
	-webkit-touch-callout: none;
}
.viewer img {
	pointer-events: none;
	-webkit-user-drag: none;
}
.viewer .side.l {
	grid-area: l;
}
.viewer .side.r {
	grid-area: r;
	justify-content: flex-end;
}
.viewer .foot {
	grid-area: f;
}
.viewer .all {
	grid-area: a;
}
.side {
	display: flex;
	flex-wrap: wrap;
	align-content: flex-start;
	gap: 6px;
	max-height: 280px;
	padding: 2px 4px;
	overflow-y: auto;
	scrollbar-width: thin;
	scrollbar-color: var(--muted) transparent;
}
.cur {
	grid-area: c;
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-width: 0;
	height: 280px;
	padding: 16px;
	overflow: hidden;
	text-align: center;
}
.cur .cimg {
	max-width: 150px;
	max-height: 220px;
}
.cur .pimg {
	max-width: 220px;
	max-height: 220px;
	border: 5px solid #fff;
	border-radius: 22px;
	outline: 1px solid rgba(16, 33, 77, 0.15);
}
.cur .person {
	gap: 14px;
	font-size: 1.5rem;
	font-weight: 600;
}
.cur .person img {
	width: 170px;
	height: 170px;
	border: 5px solid #fff;
	border-radius: 26px;
	outline: 1px solid rgba(16, 33, 77, 0.15);
}
.cur .person b {
	padding: 4px 26px;
	font-weight: 600;
	line-height: 1.3;
	background: var(--g3);
	border: 1px solid var(--gline);
	border-radius: 999px;
	overflow-wrap: anywhere;
}
.cur .w {
	overflow-wrap: anywhere;
}
.viewer.words .cur,
.viewer.numbers .cur {
	align-self: center;
	height: 130px;
	background: var(--g2);
	border: 1px solid var(--gline);
	border-radius: var(--r);
	box-shadow: var(--spec);
	font-weight: 700;
}
.viewer.words .cur {
	font-size: 2.4rem;
}
.viewer.numbers .cur {
	font-size: 3.6rem;
	font-variant-numeric: tabular-nums;
}

.mini {
	flex: none;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 2px;
	min-width: 0;
	padding: 3px;
	overflow: hidden;
	font: inherit;
	font-size: 0.85rem;
	font-weight: 600;
	color: var(--fg);
	background: var(--g3);
	border: 1px solid var(--gline);
	border-radius: 12px;
	cursor: pointer;
}
.mini .cimg {
	width: 44px;
}
.mini .pimg {
	width: 52px;
}
.mini b {
	font-size: 1.05rem;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}
.mini .w {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.mini .person {
	width: 100%;
	min-width: 0;
	gap: 2px;
	font-size: 0.62rem;
}
.mini .person img {
	width: 46px;
	height: 46px;
	border-radius: 8px;
}
.mini .person b {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	-webkit-box-orient: vertical;
	width: 100%;
	overflow: hidden;
	overflow-wrap: anywhere;
	text-align: center;
	line-height: 1.15;
	font-size: inherit;
	font-weight: 600;
}
.viewer.numbers .mini {
	width: 58px;
	min-height: 46px;
	padding: 5px 8px;
}
.viewer.words .mini {
	width: 112px;
	min-height: 46px;
	padding: 5px 8px;
}
.viewer.names .mini,
.viewer.intl .mini {
	width: 74px;
}
.mini.on,
.viewer .all .mini.on {
	background: #fff;
	outline: 2px solid var(--fg);
}

.count {
	margin-top: 6px;
	text-align: center;
	font-size: 1.05rem;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
	color: var(--muted);
}
.nav {
	display: flex;
	justify-content: center;
	gap: 12px;
	margin-top: 14px;
}
.nb {
	display: grid;
	place-items: center;
	width: 70px;
	height: 50px;
	color: var(--fg);
	background: var(--g3);
	border: 1px solid var(--gline);
	border-radius: 999px;
	box-shadow: var(--spec-sm);
	cursor: pointer;
}
.nb svg {
	width: 22px;
	height: 22px;
	stroke-width: 2.4;
}
.all {
	display: none;
}

.slots {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
	gap: 12px;
	margin-bottom: 24px;
}
.palette {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
	gap: 10px;
}
.slot,
.pal {
	position: relative;
	display: grid;
	place-items: center;
	font: inherit;
	font-size: 1.4rem;
	border-radius: 14px;
	cursor: pointer;
}
.slot {
	min-height: 56px;
	padding: 4px;
	color: var(--fg);
	background: var(--g2);
	border: 2px dashed var(--gline2);
}
.slot.act {
	background: #fff;
	border-style: solid;
	border-color: var(--fg);
}
.slot small {
	position: absolute;
	top: 3px;
	left: 6px;
	z-index: 1;
	padding: 1px 7px;
	font-size: 0.68rem;
	font-weight: 700;
	line-height: 1.3;
	color: #fff;
	background: var(--shade);
	border-radius: 999px;
}
.pal {
	min-height: 48px;
	padding: 4px;
	color: var(--fg);
	background: var(--g3);
	border: 1px solid var(--gline2);
}
.pal.used {
	opacity: 0.3;
}
.slots.cards .slot,
.palette.cards .pal,
.rgrid.cards .rp {
	aspect-ratio: 167 / 243;
	min-height: 0;
}
.slots.images .slot,
.palette.images .pal,
.rgrid.images .rp {
	aspect-ratio: 1;
	min-height: 0;
}
.slots .slot img,
.palette .pal img,
.rgrid .rp img {
	position: absolute;
	inset: 4px;
	width: calc(100% - 8px);
	height: calc(100% - 8px);
	max-width: none;
	max-height: none;
	margin: 0;
	object-fit: contain;
}
.slots.images .slot img,
.palette.images .pal img,
.rgrid.images .rp img {
	object-fit: cover;
	border-radius: 10px;
}

.rrow {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 9px 0;
	border-bottom: 1px solid var(--line);
}
.rrow .pr {
	min-width: 84px;
	text-align: center;
	font-weight: 700;
	color: var(--muted);
}
.rrow .inp {
	display: flex;
	flex: 1;
	gap: 10px;
}
.rrow .inp input {
	flex: 1 1 110px;
	min-width: 0;
}
#body input {
	padding: 11px 14px;
	text-align: center;
	background: var(--g3);
	border: 2px solid var(--gline2);
	border-radius: var(--r2);
}
#body input:focus {
	background: #fff;
	border-color: var(--fg);
}

.score {
	margin-bottom: 14px;
	font-size: 3.2rem;
	font-weight: 700;
	line-height: 1;
	font-variant-numeric: tabular-nums;
}
.rgrid {
	display: flex;
	flex-wrap: wrap;
	gap: 14px 18px;
}
.rc {
	position: relative;
	display: flex;
	gap: 6px;
	padding-top: 18px;
}
.rc > i {
	position: absolute;
	top: 0;
	left: 2px;
	font-size: 0.78rem;
	font-style: normal;
	font-weight: 600;
	color: var(--muted);
}
.rp {
	position: relative;
	display: grid;
	place-items: center;
	align-content: center;
	width: 76px;
	min-height: 76px;
	padding: 4px;
	border: 2px solid var(--gline);
	border-radius: 14px;
}
.rp.ok {
	background: var(--ok-bg);
	border-color: var(--ok-line);
}
.rp.bad {
	background: var(--bad-bg);
	border-color: var(--bad-line);
}
.rp .empty {
	font-size: 1.5rem;
	font-weight: 700;
	color: var(--bad);
}
.res {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 8px;
	padding: 10px 16px;
	background: var(--g1);
	border: 1px solid var(--gline);
	border-radius: var(--r2);
}
.res .pr {
	min-width: 84px;
	text-align: center;
	font-weight: 600;
}
.res.ok {
	background: var(--ok-bg);
	border-color: var(--ok-line);
}
.res.bad {
	background: var(--bad-bg);
	border-color: var(--bad-line);
}
.res.ok .v {
	color: var(--ok);
	font-weight: 700;
}
.res.bad .v {
	color: var(--bad);
	font-weight: 700;
}
.res .v small {
	display: block;
	font-weight: 500;
	color: var(--muted);
}

@media (hover: hover) {
	.tile:hover {
		background: var(--g2);
		border-color: var(--gline2);
	}
	.btn:hover,
	.step:hover,
	.nb:hover {
		background: rgba(255, 255, 255, 0.55);
	}
	input:hover {
		background: var(--g2);
	}
	.mini:hover:not(.on),
	.pal:not(.used):hover {
		border-color: var(--fg);
	}
	.slot:hover:not(.act) {
		background: var(--g2);
	}
}
.tile:active {
	background: var(--g3);
}
.btn:active,
.step:active,
.nb:active {
	background: rgba(255, 255, 255, 0.75);
}
@media (prefers-reduced-motion: reduce) {
	* {
		transition: none !important;
	}
}
@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
	.tile,
	.panel {
		background: rgba(255, 255, 255, 0.82);
	}
}

@media (max-width: 699px) {
	:root {
		--r: 24px;
		--blur: blur(4px) saturate(110%);
	}
	main {
		padding: 28px 12px 24px;
	}
	header h1 {
		font-size: 2.2rem;
	}
	.tile {
		min-height: 156px;
	}
	.panel {
		padding: 18px;
	}
	.panel.run {
		padding: 0;
	}
	.srow {
		flex-direction: column;
		align-items: flex-start;
		gap: 8px;
	}
	.bar {
		padding: 12px 14px;
		gap: 8px;
	}
	.run #body {
		min-height: 300px;
		padding: 18px 10px;
	}
	.viewer {
		grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
		grid-template-areas: 'c c' 'f f' 'a a';
		gap: 12px;
	}
	.viewer .side {
		display: none;
	}
	.cur {
		height: 250px;
		padding: 12px;
	}
	.cur .person {
		font-size: 1.3rem;
		gap: 10px;
	}
	.cur .person img {
		width: 130px;
		height: 130px;
	}
	.cur .cimg {
		max-width: 130px;
		max-height: 195px;
	}
	.cur .pimg {
		max-width: 190px;
		max-height: 190px;
	}
	.viewer.numbers .cur {
		height: 110px;
		font-size: 3.2rem;
	}
	.viewer.words .cur {
		height: 110px;
		font-size: 2rem;
	}
	.all {
		display: grid;
		grid-template-columns: repeat(auto-fill, minmax(56px, 1fr));
		gap: 8px;
		position: relative;
		max-height: 230px;
		padding: 10px;
		overflow-y: auto;
		background: var(--g1);
		border: 1px solid var(--gline);
		border-radius: var(--r2);
	}
	.all.words {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
	.all.names,
	.all.intl {
		grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
	}
	.all.cards {
		grid-template-columns: repeat(auto-fill, minmax(52px, 1fr));
	}
	.all.numbers {
		grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
	}
	.viewer .all .mini {
		width: 100%;
		min-height: 40px;
		padding: 5px 3px;
	}
	.rrow {
		gap: 8px;
	}
	.rrow .pr {
		min-width: 52px;
	}
	.face {
		width: 52px;
		height: 52px;
	}
	.rrow .inp {
		flex-wrap: wrap;
	}
}
