:root {
	--paper: #ffffff;
	--ink: #2b2b2b;
	--muted: #707070;
	--line: #b7b7b7;
	--line-light: #dedede;
	--target: #c5d0ed;
	--target-strong: #6877bd;
	--region-pool: #fff4bd;
	--hover: #f00000;
	--success: #5d70b8;
	--control-radius: 24px;
	--header-height: 72px;
	--font: "Trebuchet MS", "Segoe UI", Arial, sans-serif;
}

* {
	box-sizing: border-box;
}

html {
	min-height: 100%;
	background: var(--paper);
	color: var(--ink);
	font-family: var(--font);
	font-size: 16px;
}

body {
	min-height: 100%;
	margin: 0;
	background: var(--paper);
}

body.game-page {
	height: 100dvh;
	overflow: hidden;
}

body.results-page {
	min-height: 100dvh;
}

html:has(body.game-page) {
	overflow: hidden;
}

button,
input {
	font: inherit;
}

button,
a {
	-webkit-tap-highlight-color: transparent;
}

button {
	color: inherit;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
	outline: 2px solid var(--hover);
	outline-offset: 3px;
}

[hidden] {
	display: none !important;
}

.app-shell {
	position: relative;
	min-height: 100dvh;
	background: var(--paper);
}

body.game-page .app-shell {
	height: 100dvh;
	min-height: 0;
	overflow: hidden;
}

.results-page .app-shell {
	display: flex;
	flex-direction: column;
	min-height: 100dvh;
}

.results-page #app-main {
	display: flex;
	min-height: 0;
	flex: 1 1 auto;
}

.site-credit {
	display: block;
	color: var(--ink);
	font-size: clamp(0.66rem, 1.05vw, 1rem);
	line-height: 1;
}

.site-credit-author {
	color: #2453a0;
	text-decoration: none;
}

.site-credit-author:hover {
	text-decoration: underline;
}

.site-header {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	height: var(--header-height);
	padding: 0 24px;
	background: var(--paper);
}

.wordmark {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: var(--ink);
	text-align: center;
	text-decoration: none;
}

.wordmark .eyebrow {
	display: none;
}

.wordmark-title {
	font-size: clamp(1.7rem, 3.25vw, 3rem);
	font-weight: 600;
	letter-spacing: -0.055em;
	line-height: 1;
}

.header-tools {
	position: absolute;
	top: 50%;
	right: clamp(12px, 2.5vw, 38px);
	display: flex;
	align-items: center;
	gap: 8px;
	transform: translateY(-50%);
}

.text-button,
.quiet-button,
.back-button,
.icon-button,
.secondary-button,
.submit-button,
.mode-option {
	border: 0;
	background: transparent;
	cursor: pointer;
}

.text-button,
.back-button,
.secondary-button {
	text-decoration: none;
}

.text-button {
	display: inline-flex;
	align-items: center;
	min-height: 40px;
	padding: 8px 12px;
	border-radius: var(--control-radius);
	color: var(--muted);
	font-size: 0.86rem;
	font-weight: 600;
}

.text-button:hover,
.text-button:active,
.back-button:hover,
.back-button:active {
	color: var(--ink);
}

.icon-button {
	display: inline-grid;
	width: 40px;
	height: 40px;
	place-items: center;
	border: 1px solid var(--line);
	border-radius: 50%;
	color: var(--ink);
}

.icon-button:hover {
	border-color: var(--ink);
}

.view {
	min-height: calc(100dvh - var(--header-height));
}

body.game-page #app-main {
	height: calc(100% - var(--header-height));
}

body.game-page:has(#game-view:not([hidden])) .site-header {
	display: none;
}

body.game-page:has(#game-view:not([hidden])) #app-main {
	height: 100%;
}

body.game-page .view {
	height: 100%;
	min-height: 0;
}

.skip-link {
	position: fixed;
	left: 12px;
	top: 12px;
	z-index: 50;
	padding: 8px 12px;
	background: var(--ink);
	color: var(--paper);
	border-radius: var(--control-radius);
	transform: translateY(-160%);
}

.skip-link:focus {
	transform: translateY(0);
}

/* Home */

.home-view {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	height: 100%;
	padding: clamp(12px, 2.4vh, 26px) clamp(12px, 4vw, 70px) 10px;
	overflow: hidden;
}

.home-map {
	position: absolute;
	inset: 0 8% 0;
	z-index: 0;
	pointer-events: none;
}

.home-map svg {
	display: block;
	width: 100%;
	height: 100%;
}

.home-map path {
	fill: none;
	stroke: #a8a8a8;
	stroke-width: 1.2;
	opacity: 0.12;
	vector-effect: non-scaling-stroke;
}

.home-map path.is-region-pool {
	fill: var(--region-pool);
	stroke: #c2ad53;
	opacity: 1;
}

.home-intro,
.mode-menu,
.home-footer {
	position: relative;
	z-index: 1;
}

.home-intro {
	flex: 0 0 auto;
	max-width: 100%;
	text-align: center;
}

.home-intro .eyebrow {
	display: none;
}

.home-lede {
	margin: 0;
	color: var(--ink);
	font-size: clamp(1rem, 1.65vw, 1.35rem);
	line-height: 1.2;
}

.mode-menu {
	width: min(940px, 100%);
	margin: clamp(14px, 3vh, 30px) auto 0;
	padding: 12px 24px 15px;
	border: 1px solid #a4a4a4;
	border-radius: 40px;
	background: rgba(245, 245, 245, 0.86);
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.27), inset 0 0 12px rgba(255, 255, 255, 0.9);
}

.mode-option {
	display: grid;
	grid-template-columns: minmax(220px, 310px) minmax(0, 1fr);
	align-items: center;
	gap: 18px;
	width: 100%;
	min-height: 66px;
	padding: 7px 8px;
	border-radius: var(--control-radius);
	text-align: left;
}

.mode-number,
.mode-arrow {
	display: none;
}

.mode-copy {
	display: contents;
}

.mode-copy strong {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 48px;
	padding: 8px 14px;
	border: 1px solid #a4a4a4;
	border-radius: 28px;
	background: rgba(255, 255, 255, 0.78);
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.22), inset 0 0 8px rgba(255, 255, 255, 0.9);
	font-size: clamp(1rem, 1.6vw, 1.4rem);
	font-weight: 500;
	letter-spacing: -0.025em;
	line-height: 1.1;
}

.mode-option:hover .mode-copy strong {
	border-color: var(--ink);
	background: #ffffff;
}

.mode-copy small {
	align-self: center;
	color: #6b6b6b;
	font-size: clamp(0.78rem, 1.2vw, 1rem);
	line-height: 1.3;
}

.region-setting,
.round-setting {
	display: grid;
	grid-template-columns: 180px minmax(160px, 260px) minmax(100px, 1fr);
	align-items: center;
	gap: 14px;
	max-width: none;
	margin-inline: 20px;
}

.region-setting {
	margin-top: 10px;
	padding-top: 14px;
	border-top: 1px solid #bdbdbd;
}

.round-setting {
	margin-top: 9px;
}

#game-region {
	width: 100%;
	height: 40px;
	padding: 7px 12px;
	border: 1px solid var(--line);
	border-radius: var(--control-radius);
	background: var(--paper);
	color: var(--ink);
	cursor: pointer;
}

#game-region:focus-visible {
	border-color: var(--ink);
	outline: none;
}

.scores-link {
	display: block;
	margin: 14px 20px 0;
	padding: 14px 0 0;
	border-top: 1px solid #bdbdbd;
	color: var(--ink);
	font-size: clamp(1rem, 1.45vw, 1.22rem);
	font-weight: 600;
	text-align: center;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.scores-link:hover {
	color: var(--target-strong);
}

.setting-label,
.setting-hints {
	display: flex;
	align-items: baseline;
	gap: 10px;
}

.setting-label {
	margin: 0;
	font-size: 0.95rem;
	font-weight: 600;
	white-space: nowrap;
}

.setting-label output {
	display: inline-block;
	width: 3ch;
	flex: 0 0 3ch;
	text-align: right;
	font-size: 1.15rem;
	font-weight: 500;
}

#round-length {
	display: block;
	width: 100%;
	margin: 0;
	accent-color: var(--target-strong);
	cursor: pointer;
}

.setting-hints {
	margin: 0;
	color: var(--muted);
	font-size: 0.7rem;
	line-height: 1.3;
}

.home-footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	width: min(940px, 100%);
	margin: 10px auto 0;
	padding: 0 24px;
}

.home-footer .site-credit {
	margin-left: 0;
}

.source-note {
	margin: 0;
	color: var(--muted);
	font-size: 0.68rem;
	line-height: 1.35;
}

.source-note a {
	color: var(--ink);
	font-weight: 600;
}

.home-footer .text-button {
	min-height: 32px;
	padding-inline: 0;
	white-space: nowrap;
}

/* About */

.about-view {
	position: relative;
	display: grid;
	place-items: center;
	height: 100%;
	padding: clamp(18px, 4vh, 50px) 18px;
	overflow: hidden;
}

.about-map {
	position: absolute;
	inset: 2% 8%;
	opacity: 0.12;
	pointer-events: none;
}

.about-map svg {
	display: block;
	width: 100%;
	height: 100%;
}

.about-map path {
	fill: none;
	stroke: #8f8f8f;
	stroke-width: 1.2;
	vector-effect: non-scaling-stroke;
}

.about-card {
	position: relative;
	width: min(620px, 100%);
	padding: 20px clamp(24px, 4vw, 42px) 28px;
	border: 1px solid #9d9d9d;
	border-radius: 34px;
	background: rgba(250, 250, 250, 0.9);
	box-shadow: 0 2px 9px rgba(0, 0, 0, 0.25), inset 0 0 12px rgba(255, 255, 255, 0.85);
}

.about-close {
	position: absolute;
	top: 14px;
	right: 14px;
	font-size: 1.4rem;
	line-height: 1;
}

.about-card h2 {
	margin: 0 0 16px;
	font-size: clamp(1.7rem, 3vw, 2.55rem);
	font-weight: 600;
	letter-spacing: -0.05em;
	line-height: 1;
}

.about-card p:not(.eyebrow) {
	max-width: 58ch;
	margin: 0 0 12px;
	color: #555555;
	font-size: 0.95rem;
	line-height: 1.5;
}

.about-card .about-sources {
	margin: 18px 0 0;
	color: var(--muted);
	font-size: 0.72rem;
	line-height: 1.4;
}

.about-sources a {
	color: var(--muted);
	text-underline-offset: 2px;
}

.about-sources a:hover {
	color: var(--ink);
}

/* Game */

.game-view {
	height: 100%;
	padding: 0 clamp(10px, 2.5vw, 38px) 28px;
	overflow: hidden;
}

.game-toolbar {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
	align-items: center;
	gap: 16px;
	height: 56px;
	min-height: 0;
	border-bottom: 1px solid var(--line-light);
}

.toolbar-leading,
.toolbar-actions,
.panel-actions {
	display: flex;
	align-items: center;
	gap: 10px;
}

.game-wordmark {
	white-space: nowrap;
}

.game-wordmark .wordmark-title {
	font-size: clamp(1.25rem, 2.4vw, 2rem);
}

.toolbar-leading {
	min-width: 0;
	align-items: center;
	justify-self: start;
}

.toolbar-actions {
	align-items: center;
	justify-self: end;
}

.back-button {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 40px;
	padding: 8px 0;
	border-radius: var(--control-radius);
	color: var(--muted);
	font-size: 0.84rem;
	font-weight: 600;
	white-space: nowrap;
}

.toolbar-divider {
	width: 1px;
	height: 24px;
	background: var(--line-light);
}

.game-toolbar h2 {
	overflow: hidden;
	margin: 0;
	font-size: clamp(1rem, 1.8vw, 1.35rem);
	font-weight: 600;
	letter-spacing: -0.04em;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.game-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
	gap: clamp(18px, 3vw, 46px);
	height: calc(100% - 56px - 20px);
	min-height: 0;
	padding-top: 10px;
	overflow: hidden;
}

.game-credit {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-top: 3px;
	margin-inline: 0;
}

.game-credit .text-button {
	min-height: 32px;
	padding-block: 4px;
}

.map-column {
	display: flex;
	flex-direction: column;
	min-width: 0;
	min-height: 0;
	overflow: hidden;
}

.map-frame {
	position: relative;
	min-width: 0;
	background: var(--paper);
}

.game-map-frame {
	flex: 1 1 auto;
	min-height: 0;
	height: auto;
	overflow: hidden;
}

.map-frame > svg {
	display: block;
	width: 100%;
	height: 100%;
	min-width: 0;
	min-height: 0;
	max-width: 100%;
	max-height: 100%;
}

.map-region {
	fill: var(--paper);
	stroke: #898989;
	stroke-width: 1.45;
	vector-effect: non-scaling-stroke;
	transition: fill 90ms ease, stroke 90ms ease;
}

.map-region.is-region-pool {
	fill: var(--region-pool);
}

.map-region.is-prompt {
	fill: var(--hover);
	stroke: #555555;
	stroke-width: 1.25;
}

.map-region.is-answered,
.map-region.is-correct,
.map-region.is-study-selected {
	fill: var(--target);
	stroke: var(--target-strong);
}

.map-region.is-skipped {
	fill: #e4e4e4;
	stroke: #a8a8a8;
}

.map-region.is-answered {
	pointer-events: none;
}

.map-region.is-wrong {
	fill: var(--hover);
	stroke: #555555;
}

.map-region:hover {
	fill: var(--hover);
	stroke: #555555;
	filter: drop-shadow(1px 1px 1px rgba(0, 0, 0, 0.28));
	cursor: pointer;
}

.map-region.is-answered:hover {
	fill: var(--target);
	stroke: var(--target-strong);
	filter: none;
	cursor: default;
}

.map-region.is-answered.is-skipped:hover {
	fill: #e4e4e4;
	stroke: #a8a8a8;
}

.game-map-frame.is-piece-mode .map-region:hover {
	cursor: none;
}

.game-map-frame.is-piece-mode {
	touch-action: none;
}

.map-region:focus {
  outline: none;
}

.map-region:focus-visible {
  outline: none;
  stroke: var(--hover);
  stroke-width: 2.5;
}

.cursor-piece {
	fill: var(--target-strong);
	stroke: #555555;
	stroke-width: 1.4;
	vector-effect: non-scaling-stroke;
	opacity: 0.95;
	pointer-events: none;
	filter: drop-shadow(1px 2px 1px rgba(0, 0, 0, 0.34));
}

.game-panel {
	min-width: 0;
	min-height: 0;
	height: 100%;
	padding: 10px 0 0;
	overflow-y: auto;
	scrollbar-width: none;
}

.game-panel::-webkit-scrollbar {
	display: none;
}

.stats-row {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 12px;
	padding-bottom: 13px;
	border-bottom: 1px solid var(--line-light);
}

.local-play-marker {
	margin: 10px 0 0;
	color: var(--target-strong);
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.stat {
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
}

.stat span,
.study-list-label,
.score-section-heading {
	color: var(--muted);
	font-size: 0.63rem;
	font-weight: 600;
	letter-spacing: 0.11em;
	text-transform: uppercase;
}

.stat strong {
	overflow: hidden;
	font-size: 1rem;
	font-weight: 600;
	letter-spacing: -0.03em;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.question-block {
	padding: clamp(24px, 4vh, 42px) 0 24px;
}

.eyebrow {
	margin: 0;
	color: var(--muted);
	font-size: 0.66rem;
	font-weight: 600;
	letter-spacing: 0.13em;
	line-height: 1.3;
}

.question-text {
	margin: 10px 0 0;
	color: var(--muted);
	font-size: 0.98rem;
	line-height: 1.35;
}

.question-name {
	min-height: 1.15em;
	margin: 10px 0 0;
	color: var(--ink);
	font-size: clamp(1.45rem, 2.7vw, 2.15rem);
	font-weight: 600;
	letter-spacing: -0.05em;
	line-height: 1.05;
}

.piece-preview {
	display: none;
	width: 104px;
	height: 72px;
	margin-top: 16px;
	overflow: visible;
}

.piece-preview path {
	fill: var(--hover);
	stroke: #555555;
	stroke-width: 1.4;
	vector-effect: non-scaling-stroke;
}

.answer-form,
.score-form {
	display: flex;
	flex-direction: column;
	gap: 7px;
}

.answer-form label,
.score-form label {
	color: var(--muted);
	font-size: 0.72rem;
	font-weight: 600;
}

.answer-line {
	display: flex;
	align-items: stretch;
	border: 1px solid var(--ink);
	border-radius: var(--control-radius);
	background: var(--paper);
	overflow: hidden;
}

.answer-line input {
	min-width: 0;
	flex: 1;
	height: 44px;
	padding: 8px 11px;
	border: 0;
	border-radius: 0;
	background: transparent;
	color: var(--ink);
}

.answer-line input:focus {
	outline: 0;
}

.answer-line input::placeholder {
	color: #a0a0a0;
}

.submit-button {
	min-height: 44px;
	padding: 7px 12px;
	border-left: 1px solid var(--ink);
	border-radius: 0 var(--control-radius) var(--control-radius) 0;
	background: var(--ink);
	color: var(--paper);
	font-size: 0.76rem;
	font-weight: 600;
	white-space: nowrap;
}

.score-form .submit-button {
	min-width: 72px;
	padding-left: 14px;
	padding-right: 18px;
}

.score-form .optional-label {
	font-weight: 400;
}

.score-form .email-hint {
	margin-top: -2px;
}

.score-form .score-submit-button {
	align-self: flex-start;
	border: 1px solid var(--ink);
	border-radius: var(--control-radius);
	cursor: pointer;
}

.score-form .score-submit-button:hover {
	background: #4a4a4a;
}

.field-hint {
	min-height: 1.2em;
	margin: 0;
	color: var(--muted);
	font-size: 0.67rem;
	line-height: 1.3;
}

.feedback {
	margin-top: 12px;
	padding: 9px 10px;
	border: 1px solid var(--line);
	border-radius: 16px;
	font-size: 0.76rem;
	line-height: 1.35;
}

.feedback.success {
	border-color: var(--success);
	background: #eef0fb;
}

.feedback.error {
	border-color: var(--hover);
	background: #fff0f0;
}

.feedback.info {
	background: #f4f4f4;
}

.panel-actions {
	flex-wrap: wrap;
	margin-top: 24px;
}

.secondary-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 40px;
	padding: 8px 13px;
	border: 1px solid var(--line);
	border-radius: var(--control-radius);
	background: var(--paper);
	font-size: 0.76rem;
	font-weight: 600;
}

.secondary-button:hover {
	border-color: var(--ink);
	background: #f4f4f4;
}

.quiet-button {
	align-self: flex-start;
	min-height: 36px;
	margin-top: 12px;
	padding: 8px 0;
	border-radius: var(--control-radius);
	color: var(--muted);
	font-size: 0.7rem;
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.quiet-button:hover {
	color: var(--hover);
}

.finish-panel {
	padding-top: 18px;
}

.finish-panel h3,
.study-heading h3 {
	margin: 10px 0 8px;
	font-size: clamp(1.5rem, 2.8vw, 2.15rem);
	font-weight: 600;
	letter-spacing: -0.06em;
	line-height: 1;
}

.finish-panel > p,
.study-heading p:last-child {
	margin: 0;
	color: var(--muted);
	font-size: 0.78rem;
	line-height: 1.4;
}

.finish-result {
	display: flex;
	align-items: baseline;
	gap: 11px;
	margin: 22px 0 8px;
}

.finish-result strong {
	color: var(--target-strong);
	font-size: 2rem;
	font-weight: 600;
	letter-spacing: -0.07em;
}

.finish-result span {
	color: var(--muted);
	font-size: 0.9rem;
	font-weight: 600;
}

.finish-panel .score-form {
	margin-top: 22px;
}

.confetti {
	position: fixed;
	inset: 0;
	z-index: 100;
	overflow: hidden;
	pointer-events: none;
}

.confetti-piece {
	position: absolute;
	top: 50%;
	left: 50%;
	width: var(--confetti-size);
	height: 6px;
	border-radius: 2px;
	background: var(--confetti-color);
	opacity: 0;
	animation: confetti-burst var(--confetti-duration) var(--confetti-delay) linear forwards;
}

.confetti-piece:nth-child(3n) {
	height: var(--confetti-size);
	border-radius: 50%;
}

.confetti-piece:nth-child(4n) {
	width: 5px;
	height: 13px;
}

@keyframes confetti-burst {
	0% {
		opacity: 0;
		transform: translate3d(-50%, -50%, 0) scale(0.2) rotate(0deg);
		animation-timing-function: cubic-bezier(0.08, 0.7, 0.2, 1);
	}

	3% {
		opacity: 1;
	}

	42% {
		opacity: 1;
		transform: translate3d(calc(-50% + var(--confetti-mid-x)), calc(-50% + var(--confetti-mid-y)), 0) scale(1) rotate(var(--confetti-spin));
		animation-timing-function: cubic-bezier(0.3, 0.02, 0.75, 0.38);
	}

	68% {
		opacity: 0.95;
		transform: translate3d(calc(-50% + var(--confetti-burst-x)), calc(-50% + var(--confetti-burst-y)), 0) scale(0.95) rotate(var(--confetti-final-spin));
		animation-timing-function: ease-in;
	}

	100% {
		opacity: 0;
		transform: translate3d(calc(-50% + var(--confetti-fall-x)), calc(-50% + var(--confetti-fall-y)), 0) scale(0.72) rotate(var(--confetti-fall-spin));
	}
}

.study-heading {
	padding: 18px 0 20px;
	border-bottom: 1px solid var(--line-light);
}

.study-list-label {
	display: flex;
	justify-content: space-between;
	margin: 13px 0 7px;
}

.study-filter {
	display: flex;
	flex-direction: column;
	gap: 5px;
	margin-bottom: 8px;
	color: var(--muted);
	font-size: 0.68rem;
	font-weight: 600;
}

.study-filter input {
	width: 100%;
	height: 36px;
	padding: 7px 10px;
	border: 1px solid var(--line);
	border-radius: var(--control-radius);
	background: var(--paper);
	color: var(--ink);
	font-size: 0.78rem;
}

.study-filter input:focus {
	border-color: var(--ink);
	outline: none;
}

.study-list {
	max-height: 420px;
	overflow-y: scroll;
	border-top: 1px solid var(--line);
	scrollbar-width: thin;
}

.study-list::-webkit-scrollbar {
	width: 10px;
}

.study-list::-webkit-scrollbar-thumb {
	background: var(--line);
}

.study-list::-webkit-scrollbar-track {
	background: var(--paper);
}

.study-list button {
	display: block;
	width: 100%;
	margin-inline: 0;
	padding: 7px 10px;
	border: 0;
	border-bottom: 1px solid var(--line-light);
	border-radius: 0;
	background: transparent;
	color: var(--ink);
	font-size: 0.78rem;
	text-align: left;
	cursor: pointer;
}

.study-list button:hover,
.study-list button.is-selected {
	background: var(--target);
}

.study-restart {
	margin-top: 13px;
}

/* Results */

.results-page .scores-view {
	min-height: 0;
	flex: 1 1 auto;
	padding: clamp(18px, 4vh, 46px) clamp(14px, 3vw, 42px) 44px;
}

.results-page .site-credit {
	margin: 0 0 10px;
	padding-inline: clamp(14px, 3vw, 42px);
}

.results-home {
	position: absolute;
	left: clamp(10px, 2.5vw, 38px);
	top: 50%;
	transform: translateY(-50%);
}

.scores-heading {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	min-height: 56px;
	border-bottom: 1px solid var(--line-light);
}

.scores-heading > div {
	display: flex;
	align-items: center;
	min-width: 0;
	gap: 10px;
}

.scores-heading .eyebrow {
	display: none;
}

.scores-heading h1,
.scores-heading h2 {
	overflow: hidden;
	max-width: none;
	margin: 0;
	font-size: clamp(1rem, 1.8vw, 1.35rem);
	font-weight: 600;
	letter-spacing: -0.04em;
	line-height: 1;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.scores-heading .back-button {
	margin: 0;
}

.scores-note {
	min-height: 20px;
	margin: 13px 0 20px;
	color: var(--muted);
	font-size: 0.73rem;
}

.scores-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 25px;
}

.score-section {
	min-width: 0;
	border-top: 1px solid var(--ink);
}

.score-section-heading {
	display: flex;
	align-items: center;
	gap: 11px;
	padding: 12px 0 9px;
}

.score-section-heading h2,
.score-section-heading h3 {
	flex: 1;
	margin: 0;
	color: var(--ink);
	font-size: 1rem;
	font-weight: 600;
	letter-spacing: -0.035em;
}

.score-section-toggle {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	padding: 0;
	border: 0;
	background: transparent;
	box-shadow: none;
	color: inherit;
	font: inherit;
	letter-spacing: inherit;
	line-height: inherit;
	text-align: left;
	cursor: pointer;
	appearance: none;
	-webkit-appearance: none;
}

.score-section-toggle:focus-visible {
	outline: 2px solid var(--target-strong);
	outline-offset: 3px;
}

.score-section-chevron {
	display: none;
	width: 9px;
	height: 9px;
	margin-left: 10px;
	border-right: 1.5px solid currentColor;
	border-bottom: 1.5px solid currentColor;
	color: var(--muted);
	transform: rotate(45deg);
	transition: transform 150ms ease;
}

.score-section-toggle[aria-expanded="false"] .score-section-chevron {
	transform: rotate(225deg);
}

.score-index {
	color: var(--target-strong);
	font-size: 0.7rem;
}

.table-wrap {
	overflow-x: auto;
	border: 1px solid var(--line);
}

.scores-more {
	display: inline-flex;
	margin-top: 8px;
	padding: 3px 0;
	border: 0;
	background: transparent;
	color: var(--target-strong);
	font-size: 0.72rem;
	line-height: 1.2;
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
	cursor: pointer;
}

.scores-more:hover {
	color: var(--ink);
}

.scores-more:disabled {
	color: var(--muted);
	cursor: wait;
	text-decoration: none;
}

table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.7rem;
}

th,
td {
	padding: 7px 6px;
	border-bottom: 1px solid var(--line);
	text-align: left;
	vertical-align: top;
}

th {
	background: #f1f1f1;
	color: var(--muted);
	font-size: 0.61rem;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

td:first-child,
th:first-child {
	width: 28px;
	text-align: center;
}

td:nth-child(3),
td:nth-child(4),
td:nth-child(5),
th:nth-child(3),
th:nth-child(4),
th:nth-child(5) {
	white-space: nowrap;
}

tbody tr:nth-child(-n + 3) td {
	color: var(--target-strong);
	font-weight: 600;
}

tbody tr:last-child td {
	border-bottom: 0;
}

.scores-source {
	margin-top: 26px;
}

/* Responsive */

@media (pointer: coarse) {
	.mode-option,
	.secondary-button,
	.text-button,
	.back-button,
	.quiet-button,
	.scores-more {
		min-height: 44px;
	}
}

@media (pointer: fine) {
	.game-map-frame.is-piece-mode {
		cursor: none;
	}
}

@media (max-width: 900px) {
	:root {
		--header-height: 60px;
	}

	.mode-menu {
		width: min(760px, 100%);
	}

	.game-layout {
		grid-template-columns: 1fr;
		grid-template-rows: minmax(160px, 1fr) minmax(0, 42%);
		gap: 8px;
	}

	.game-panel {
		max-height: none;
		padding-top: 0;
	}

	.piece-preview {
		display: none;
	}

	.scores-grid {
		grid-template-columns: 1fr;
		gap: 22px;
	}
}

@media (min-width: 901px) and (max-height: 680px) {
	.home-view {
		padding-top: 10px;
	}

	.mode-option {
		min-height: 62px;
	}

	.scores-link {
		margin-top: 10px;
		padding-top: 10px;
	}

	.home-footer {
		margin-top: 2px;
	}

	.finish-panel {
		padding-top: 8px;
	}

	.finish-panel h3 {
		margin-top: 6px;
		margin-bottom: 6px;
	}

	.finish-result {
		margin-top: 12px;
		margin-bottom: 6px;
	}

	.finish-panel .score-form,
	.finish-panel .panel-actions {
		margin-top: 12px;
	}
}

@media (max-width: 600px) {
	.site-header {
		padding: 0 10px;
	}

	.wordmark-title {
		font-size: 1.15rem;
	}

	.header-tools {
		right: 8px;
	}

	.header-tools .text-button {
		display: none;
	}

	.header-tools .text-button {
		padding-inline: 7px;
		font-size: 0.72rem;
	}

	.header-tools .icon-button {
		width: 36px;
		height: 36px;
	}

	.home-view {
		padding: 16px 9px 8px;
	}

	.home-map {
		inset: 8% -12% 5%;
		opacity: 0.08;
	}

	.home-intro h1 {
		font-size: clamp(1.65rem, 8vw, 2.2rem);
	}

	.home-lede {
		margin-top: 5px;
		font-size: 0.96rem;
	}

	.mode-menu {
		margin-top: 12px;
		padding: 8px 11px 11px;
		border-radius: 28px;
	}

	.home-footer {
		width: min(760px, 100%);
		margin-top: 8px;
		padding: 0 11px;
	}

	.mode-option {
		grid-template-columns: 1fr;
		gap: 3px;
		min-height: 0;
		padding: 4px 0 6px;
		text-align: center;
	}

	.mode-copy strong {
		min-height: 38px;
		font-size: 1.02rem;
	}

	.mode-copy small {
		text-align: center;
		font-size: 0.68rem;
		line-height: 1.2;
	}

	.region-setting,
	.round-setting {
		grid-template-columns: 1fr auto;
		gap: 7px 10px;
		margin-inline: 5px;
	}

	.region-setting {
		margin-top: 7px;
		padding-top: 10px;
	}

	.round-setting {
		margin-top: 8px;
	}

	.region-setting #game-region {
		grid-column: 1 / -1;
		grid-row: 2;
	}

	.region-setting .setting-hints {
		grid-row: 3;
	}

	.scores-link {
		margin: 10px 5px 0;
		padding: 10px 0 0;
		font-size: 0.98rem;
	}

	.setting-label {
		font-size: 0.78rem;
	}

	.setting-label output {
		font-size: 1rem;
	}

	.round-setting #round-length {
		grid-column: 1 / -1;
		grid-row: 2;
	}

	.setting-hints {
		grid-column: 1 / -1;
		grid-row: 3;
		font-size: 0.63rem;
	}

	.source-note {
		font-size: 0.61rem;
	}

	.game-view {
		padding-inline: 8px;
	}

	.game-toolbar {
		height: 48px;
	}

	.game-wordmark .wordmark-title {
		font-size: 1.15rem;
	}

	.game-toolbar h2 {
		font-size: 0.92rem;
	}

	.toolbar-divider {
		display: none;
	}

	.toolbar-leading h2 {
		display: none;
	}

	.toolbar-actions .text-button {
		display: inline-flex;
		min-height: 32px;
		padding-inline: 4px;
		font-size: 0.68rem;
	}

	.game-layout {
		gap: 6px;
		height: calc(100% - 48px - 20px);
		padding-top: 6px;
		/* The map is width-limited on phones; don't give its row the rest of
		   the viewport or the panel gets pushed far below the map. */
		grid-template-rows: clamp(190px, calc(67vw - 10.72px), 300px) minmax(0, 1fr);
	}

	.game-panel {
		max-height: none;
	}

	.stats-row {
		gap: 8px;
		padding-bottom: 8px;
	}

	.stat span {
		font-size: 0.58rem;
	}

	.stat strong {
		font-size: 0.86rem;
	}

	.question-block {
		padding: 13px 0 10px;
	}

	.game-view.is-piece-mode .question-block {
		display: grid;
		grid-template-columns: minmax(0, 1fr) 112px;
		column-gap: 10px;
		align-items: center;
	}

	.game-view.is-piece-mode #question-kicker,
	.game-view.is-piece-mode .question-text,
	.game-view.is-piece-mode .question-name {
		grid-column: 1;
	}

	.game-view.is-piece-mode .piece-preview:not([hidden]) {
		display: block;
		grid-column: 2;
		grid-row: 1 / span 3;
		width: 112px;
		height: 88px;
		margin-top: 0;
		align-self: center;
	}

	.question-text {
		margin-top: 6px;
		font-size: 0.82rem;
	}

	.question-name {
		margin-top: 6px;
		font-size: 1.45rem;
	}

	.answer-form label,
	.score-form label {
		font-size: 0.65rem;
	}

	.answer-line input,
	.submit-button {
		height: 40px;
		min-height: 40px;
	}

	.field-hint {
		font-size: 0.61rem;
	}

	.panel-actions {
		gap: 6px;
		margin-top: 12px;
	}

	.secondary-button {
		min-height: 36px;
		padding: 7px 10px;
		font-size: 0.68rem;
	}

	.quiet-button {
		min-height: 30px;
		margin-top: 3px;
		padding-block: 5px;
	}

	.study-list {
		max-height: 170px;
	}

	.results-page .scores-view {
		padding-inline: 10px;
	}

	.results-page .site-credit {
		padding-inline: 10px;
	}

	.scores-heading {
	gap: 8px;
	}

	.scores-heading .back-button {
		margin: 0;
	}

	.scores-heading h1,
	.scores-heading h2 {
		font-size: 0.94rem;
	}

	.score-section-chevron {
		display: inline-block;
	}

	.results-page table {
		table-layout: fixed;
	}

	.results-page th:first-child,
	.results-page td:first-child {
		width: 28px;
	}

	.results-page th:nth-child(2),
	.results-page td:nth-child(2) {
		width: 36%;
		max-width: 0;
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
	}

	.results-page th:nth-child(3),
	.results-page td:nth-child(3) {
		width: 21%;
	}

	.results-page th:nth-child(4),
	.results-page td:nth-child(4) {
		width: 12%;
	}

	.results-page th:nth-child(5),
	.results-page td:nth-child(5) {
		width: 22%;
	}
}

@media (prefers-reduced-motion: reduce) {
	.confetti {
		display: none !important;
	}

	*,
	*::before,
	*::after {
		transition-duration: 0.01ms !important;
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
	}
}
