:root {
	--panel: #fff;
	--line: #666;
	--ink: #575e6b;
	--pick: #666;
	--red: #cf3b43;
	--blue: #2f6fc4;
	--violet: #7a4bb8;
	--gold: #a8791a;
	--mark-off: #dcdfe4;
	--verdict: transparent;
}

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

html,
body {
	height: 100%;
	margin: 0;
}

body {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	font-family: "Helvetica Neue", Arial, "Hiragino Sans", system-ui, sans-serif;
}

.frame {
	width: 100%;
	max-width: 260px;
	display: flex;
	flex-direction: column;
	gap: 22px;
}

.title {
	margin: 0 0 40px;
	font-size: 20px;
	font-weight: 500;
	letter-spacing: .24em;
	color: var(--ink);
	text-align: center;
}

.status {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0 4px;
}

.marks {
	display: flex;
	gap: 10px;
	align-items: center;
}

.goal {
	width: 11px;
	height: 11px;
	border: 1.5px solid var(--mark-off);
	transform: rotate(45deg);
	transition: background-color .4s ease, border-color .4s ease;
}

.goal.on {
	background: var(--gold);
	border-color: var(--gold);
}

.board {
	padding: 16px;
	display: grid;
	grid-template-columns: repeat(3, 36px);
	grid-auto-rows: 36px;
	justify-content: center;
	align-content: center;
	min-height: 180px;
	gap: 20px 10px;
	border-radius: 4px;
	box-shadow: 0 0 0 0 var(--verdict);
	transition: box-shadow .35s ease;
}

.board.verdict {
	box-shadow: 0 0 0 4px var(--verdict);
}

.disc {
	aspect-ratio: 1 / 1;
	width: 100%;
	padding: 0;
	border: none;
	background: transparent;
	cursor: pointer;
	display: grid;
	place-items: center;
}

.disc[hidden] {
	display: none;
}

.disc::before {
	content: "";
	width: 70%;
	aspect-ratio: 1 / 1;
	border-radius: 50%;
	border: 2px solid var(--line);
	background: transparent;
	transition: background-color .2s ease, border-color .2s ease, transform .14s ease;
}

.disc:active::before {
	transform: scale(.86);
}

.disc.r::before {
	background: var(--red);
	border-color: var(--red);
}

.disc.b::before {
	background: var(--blue);
	border-color: var(--blue);
}

.disc.k::before {
	background: var(--pick);
	border-color: var(--pick);
}

.disc:focus-visible {
	outline: none;
}

.disc:focus-visible::before {
	outline: 2px solid var(--gold);
	outline-offset: 3px;
}

.board.pulse .disc::before {
	animation: pulse .5s ease;
}

@keyframes pulse {
	0% {
		transform: scale(1);
	}

	45% {
		transform: scale(1.24);
	}

	100% {
		transform: scale(1);
	}
}

.reset {
	align-self: center;
	border: none;
	background: none;
	padding: 2px 6px;
	font-family: inherit;
	font-size: 12px;
	letter-spacing: .08em;
	color: var(--ink);
	cursor: pointer;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.reset:focus-visible {
	outline: 2px solid var(--gold);
	outline-offset: 2px;
}

.btn {
	height: 40px;
	border: 1px solid var(--line);
	border-radius: 4px;
	background: var(--panel);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
}

.btn:focus-visible {
	outline: 2px solid var(--gold);
	outline-offset: 2px;
}

.label {
	font-size: 13px;
	font-weight: 500;
	letter-spacing: .1em;
	color: var(--ink);
	transition: transform .14s ease;
}

.btn:active .label {
	transform: scale(.86);
}

.board.done .disc {
	cursor: default;
}

.board.done .disc::before {
	background: var(--gold);
	border-color: var(--gold);
}

.footer {
	position: fixed;
	left: 0;
	right: 0;
	bottom: max(16px, env(safe-area-inset-bottom));
	text-align: center;
	font-size: 11px;
	letter-spacing: .04em;
	color: var(--ink);
}

.footer a {
	color: inherit;
	text-decoration: none;
}

.footer a:hover {
	text-decoration: underline;
	text-underline-offset: 3px;
}

.footer a:focus-visible {
	outline: 2px solid var(--gold);
	outline-offset: 2px;
}

.overlay {
	position: fixed;
	inset: 0;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 20px;
	background: rgba(20, 22, 26, .28);
	z-index: 10;
}

.overlay.open {
	display: flex;
}

.modal {
	width: 100%;
	max-width: 300px;
	background: var(--panel);
	border: 1px solid var(--line);
	border-radius: 4px;
	padding: 46px 20px 60px;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 20px;
}

.modal-lead {
	margin: 0;
	font-size: 12px;
	letter-spacing: .04em;
	text-align: center;
	color: var(--ink);
	font-weight: bold;
}

.modal-title {
	margin: 0;
	font-size: 14px;
	font-weight: 700;
	letter-spacing: .04em;
	line-height: 1.7;
	text-align: center;
	white-space: pre-line;
	color: var(--gold);
}

.share {
	width: 100%;
	height: 40px;
	border: 1px solid var(--line);
	border-radius: 4px;
	background: var(--panel);
	display: flex;
	align-items: center;
	justify-content: center;
	text-decoration: none;
}

.share:focus-visible {
	outline: 2px solid var(--gold);
	outline-offset: 2px;
}

.share:active .label {
	transform: scale(.86);
}

@media (prefers-reduced-motion: reduce) {

	* {
		transition: none !important;
		animation: none !important;
	}
}
