/* The site, dartscore.org: the app's colours and fonts on plain pages.
   Every colour channel is one of the twelve steps (js/colors.js). */
:root {
	--page: #161616;
	--page-deep: #000000;
	--panel: linear-gradient(#323232, #161616);
	--line: #484848;
	--text: #fafafa;
	--text-soft: #c8c8c8;
	--text-muted: #969696;
	--green: #00c800;
	--green-soft: #48b248;
	--go-top: #328016;
	--go-bottom: #164816;
	--go-line: #00c800;
	--button-top: #808080;
	--button-bottom: #484848;
	--link: #48c8ff;
	--radius: 10px;
	--wide: 72rem;
	--font: 'Roboto Flex', sans-serif;
	--font-condensed: 'Roboto Condensed', sans-serif;
}

* {
	box-sizing: border-box;
}

html {
	scroll-behavior: smooth;
	scroll-padding-top: 5rem;
}

body {
	margin: 0;
	background: linear-gradient(var(--page), var(--page-deep)) fixed;
	background-color: var(--page-deep);
	color: var(--text);
	font-family: var(--font);
	font-size: 17px;
	line-height: 1.55;
	-webkit-text-size-adjust: 100%;
}

img {
	display: block;
	max-width: 100%;
	height: auto;
}

a {
	color: var(--link);
}

h1,
h2,
h3 {
	font-family: var(--font-condensed);
	font-weight: 600;
	line-height: 1.15;
	margin: 0 0 0.5rem;
}

p {
	margin: 0 0 0.9rem;
}

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

.button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 48px;
	padding: 0 1.4rem;
	border: 2px solid var(--line);
	border-radius: var(--radius);
	background: linear-gradient(var(--button-top), var(--button-bottom));
	color: var(--text);
	font-family: var(--font-condensed);
	font-size: 1.15rem;
	font-weight: 600;
	text-decoration: none;
	white-space: nowrap;
}

.button.go {
	border-color: var(--go-line);
	background: linear-gradient(var(--go-top), var(--go-bottom));
}

.button.small {
	min-height: 42px;
	padding: 0 1rem;
	font-size: 1.05rem;
}

.button:hover {
	filter: brightness(1.12);
}

.button:focus-visible,
.top-links a:focus-visible,
.brand:focus-visible {
	outline: 3px solid var(--link);
	outline-offset: 2px;
}

/* ---- Header and footer ---- */

.top {
	position: sticky;
	top: 0;
	z-index: 1;
	display: flex;
	align-items: center;
	gap: 1.5rem;
	max-width: var(--wide);
	margin: 0 auto;
	padding: 0.75rem 16px;
	background: var(--page);
	border-bottom: 1px solid var(--line);
}

@media (min-width: 72rem) {
	.top {
		max-width: none;
		padding-inline: calc((100% - var(--wide)) / 2 + 16px);
	}
}

.brand {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	border-radius: var(--radius);
}

/* The wordmark alone: its c is the mark, so the two never sit side by side. */
.top .wordmark {
	width: 170px;
}

.top-links {
	display: flex;
	gap: 1.25rem;
	margin-left: auto;
}

.top-links a {
	color: var(--text-soft);
	text-decoration: none;
	font-weight: 500;
}

.top-links a:hover {
	color: var(--text);
}

/* On a phone, where the links don't fit: a menu button beside Play now. */
.site-menu {
	display: none;
	position: relative;
}

.site-menu summary {
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	color: var(--text-soft);
	cursor: pointer;
	list-style: none;
}

.site-menu summary::-webkit-details-marker {
	display: none;
}

.site-menu[open] summary,
.site-menu summary:hover {
	color: var(--text);
}

.site-menu summary:focus-visible {
	outline: 3px solid var(--link);
	outline-offset: 2px;
}

.site-menu nav {
	position: absolute;
	top: calc(100% + 8px);
	right: 0;
	display: grid;
	min-width: 180px;
	padding: 6px;
	background: var(--page);
	border: 1px solid var(--line);
	border-radius: var(--radius);
}

.site-menu nav a {
	padding: 10px 12px;
	border-radius: calc(var(--radius) - 4px);
	color: var(--text-soft);
	text-decoration: none;
	font-weight: 500;
}

.site-menu nav a:hover,
.site-menu nav a[aria-current="page"] {
	color: var(--text);
	background: var(--page-deep);
}

.bottom {
	display: grid;
	gap: 0.75rem;
	max-width: var(--wide);
	margin: 0 auto;
	padding: 2rem 16px 3rem;
	border-top: 1px solid var(--line);
	color: var(--text-muted);
	font-size: 0.95rem;
}

.bottom nav {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem 1.25rem;
}

.bottom .wordmark {
	width: 120px;
}

.bottom p {
	margin: 0;
}

/* ---- Sections ---- */

main > section {
	max-width: var(--wide);
	margin: 0 auto;
	padding: 3.5rem 16px;
}

.section-title {
	font-size: 2rem;
	margin-bottom: 1.5rem;
}

.shot {
	border: 2px solid var(--line);
	border-radius: 14px;
	background: var(--page-deep);
}

/* A phone's corners, as round as a phone's against its size, however small it's shown. */
.shot.phone {
	border-radius: 7% / 3.25%;
}

/* The first screen: what it is, and the way in. */
.hero {
	display: grid;
	grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
	gap: 3rem;
	align-items: center;
	padding-top: 4rem;
}

.hero h1 {
	font-size: clamp(2.4rem, 5vw, 3.6rem);
	letter-spacing: -0.01em;
	margin-bottom: 1rem;
}

.lead {
	color: var(--text-soft);
	font-size: 1.2rem;
}

.actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	margin: 1.75rem 0 0.75rem;
}

.small-print {
	color: var(--text-muted);
	font-size: 0.95rem;
}

.hero-shots {
	position: relative;
	padding-right: 9%;
	padding-bottom: 6%;
}

.hero-shots .phone {
	position: absolute;
	right: 0;
	bottom: 0;
	width: 22%;
	box-shadow: 0 0 0 6px var(--page-deep);
}

/* Four promises in a row. */
.promises {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 1rem;
}

.promises > div {
	padding: 1.25rem;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	background: var(--panel);
}

.promises h2 {
	font-size: 1.3rem;
	color: var(--green);
}

.promises p {
	margin: 0;
	color: var(--text-soft);
}

/* The games, in the New game screen's three groups. */
.game-groups {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 1rem;
}

.game-group {
	padding: 1.5rem;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	background: var(--panel);
}

.game-group h3 {
	font-size: 1.6rem;
}

.game-group > p {
	color: var(--text-soft);
}

.game-group ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

.game-group li {
	padding: 0.55rem 0;
	border-top: 1px solid var(--line);
	font-weight: 500;
}

.game-group li span {
	display: block;
	color: var(--text-muted);
	font-size: 0.92rem;
	font-weight: 400;
}

/* Pictures beside their words, taking turns. */
.feature {
	display: grid;
	grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
	gap: 3rem;
	align-items: center;
}

.feature + .feature {
	margin-top: 4rem;
}

.feature:nth-child(even) > .shot {
	order: 2;
}

/* A phone's picture takes less room beside its words. */
.feature.narrow {
	grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
}

.feature.narrow .phone {
	max-width: 280px;
	justify-self: center;
}

.feature h2 {
	font-size: 2rem;
	margin-bottom: 1rem;
}

.feature p {
	color: var(--text-soft);
	font-size: 1.1rem;
}

.more-list {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 2rem 1.5rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.more-list h3 {
	font-size: 1.25rem;
	padding-left: 0.75rem;
	border-left: 3px solid var(--green-soft);
}

.more-list p {
	margin: 0;
	color: var(--text-soft);
}

.install > div {
	max-width: 44rem;
	padding: 2rem;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	background: var(--panel);
}

.install h2 {
	font-size: 2rem;
	margin-bottom: 1rem;
}

.install p,
.install li {
	color: var(--text-soft);
}

.install ul {
	margin: 0 0 1.75rem;
	padding-left: 1.2rem;
}

.install li {
	margin-bottom: 0.5rem;
}

.install strong {
	color: var(--text);
}

/* ---- The other pages: a game's rules, the checkout chart, About, the changelog ---- */

.top-links a[aria-current="page"] {
	color: var(--text);
}

.game-group h2 {
	font-size: 1.6rem;
}

.games-more {
	margin: 1.25rem 0 0;
	color: var(--text-muted);
}

.game-group li a {
	color: var(--text);
	text-decoration: none;
}

.game-group li a:hover {
	color: var(--link);
}

/* Words to read: a column of them. */
main > .page {
	max-width: 46rem;
	margin: 0 auto;
	padding: 2.5rem 16px 3.5rem;
}

main > .page.wide {
	max-width: 56rem;
}

.page h1 {
	font-size: clamp(2.2rem, 5vw, 3rem);
	margin-bottom: 1rem;
}

.page > section {
	margin-top: 2.5rem;
}

.page h2 {
	font-size: 1.6rem;
}

.page p,
.page li {
	color: var(--text-soft);
}

.page strong {
	color: var(--text);
}

.page ul {
	margin: 0 0 0.9rem;
	padding-left: 1.2rem;
}

.page li {
	margin-bottom: 0.4rem;
}

.crumbs {
	margin-bottom: 0.5rem;
	color: var(--text-muted);
	font-size: 0.95rem;
}

.targets {
	padding: 0.75rem 1rem;
	border-left: 3px solid var(--green-soft);
	color: var(--text);
	font-weight: 500;
}

/* The way in again, at the end of a page. */
.play-again {
	margin-top: 3rem;
	padding: 1.5rem;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	background: var(--panel);
}

.play-again p {
	color: var(--text);
}

.game-links {
	margin-top: 2.5rem;
}

.game-links ul {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem 1.5rem;
	padding: 0;
	list-style: none;
}

.jump {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem 1.5rem;
}

.when {
	margin-left: 0.5rem;
	color: var(--text-muted);
	font-family: var(--font);
	font-size: 1rem;
	font-weight: 400;
}

/* The checkout chart. */
.checkouts {
	width: 100%;
	border-collapse: collapse;
	font-variant-numeric: tabular-nums;
}

.checkouts th,
.checkouts td {
	padding: 0.45rem 0.75rem;
	border-bottom: 1px solid var(--line);
	text-align: left;
	vertical-align: top;
}

.checkouts thead th {
	position: sticky;
	top: 4.1rem;
	background: var(--page);
	color: var(--text-muted);
	font-weight: 500;
}

.checkouts tbody th {
	width: 4.5rem;
	color: var(--green);
	font-family: var(--font-condensed);
	font-size: 1.15rem;
}

.checkouts td:nth-child(2) {
	color: var(--text);
	font-weight: 600;
	white-space: nowrap;
}

.checkouts td:nth-child(3) {
	color: var(--text-muted);
}

.checkouts .none th,
.checkouts .none td {
	color: var(--text-muted);
	font-weight: 400;
}

/* ---- Tablet and phone ---- */

@media (max-width: 960px) {
	.hero,
	.feature,
	.feature.narrow {
		grid-template-columns: minmax(0, 1fr);
		gap: 2rem;
	}

	.feature:nth-child(even) > .shot {
		order: 0;
	}

	.promises,
	.more-list {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.game-groups {
		grid-template-columns: minmax(0, 1fr);
	}

	.feature.narrow .phone {
		max-width: 240px;
	}
}

@media (max-width: 600px) {
	body {
		font-size: 16px;
	}

	.top {
		gap: 0.75rem;
	}

	.top-links {
		display: none;
	}

	.site-menu {
		display: block;
	}

	.top .button {
		margin-left: auto;
	}

	.top .wordmark {
		width: 140px;
	}

	main > section {
		padding-block: 2.5rem;
	}

	.hero {
		padding-top: 2rem;
	}

	.lead {
		font-size: 1.1rem;
	}

	.actions .button {
		flex: 1;
	}

	.promises,
	.more-list {
		grid-template-columns: minmax(0, 1fr);
	}

	.install > div {
		padding: 1.25rem;
	}

	.checkouts th,
	.checkouts td {
		padding-inline: 0.4rem;
	}

	.checkouts thead th {
		top: 3.6rem;
	}

	.section-title,
	.feature h2,
	.install h2 {
		font-size: 1.7rem;
	}
}
