/* Terms of Service and Privacy Policy. The game's own colours (client/src/UI/styles/tokens.css):
   green board, white ink, one gold accent for the notice. Flat fills, no gradients. */

@font-face {
	font-family: "Rubik";
	src: url("/assets/fonts/Rubik.woff2") format("woff2");
	/* One regular file, declared as such (like main.css) so bold headings are synthesised. */
	font-weight: normal;
	font-style: normal;
}

:root {
	--board-900: #063a13;
	--board-800: #0b5423;
	--board-700: #10682b;
	--rail: #0c7726;
	--rail-deep: #064f18;
	--green-300: #7bef86;
	--green-500: #2ecc40;
	--ink: #ffffff;
	--ink-soft: #e4f4e7;
	--ink-dim: #c8e2cd;
	--ink-on-bright: #06240e;
	--gold: #ffc83d;
	--line: rgba(255, 255, 255, 0.14);
}

* {
	box-sizing: border-box;
}

html {
	scroll-padding-top: 88px;
	scrollbar-color: #167a33 var(--board-900);
}

body {
	margin: 0;
	background: var(--board-800);
	color: var(--ink-soft);
	font-family: "Rubik", Arial, sans-serif;
	font-size: 16.5px;
	line-height: 1.7;
	-webkit-text-size-adjust: 100%;
}

a {
	color: var(--green-300);
	text-underline-offset: 2px;
}

/* ── Top bar ───────────────────────────────────────────────────────────── */
.bar {
	position: sticky;
	top: 0;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 12px clamp(16px, 4vw, 40px);
	background: var(--rail);
	border-bottom: 4px solid var(--rail-deep);
}

.brand {
	display: flex;
}

.brand img {
	display: block;
	height: 34px;
	width: auto;
}

.barLinks {
	display: flex;
	align-items: center;
	gap: 6px;
}

.barLinks a {
	padding: 8px 14px;
	border-radius: 10px;
	color: var(--ink);
	font-weight: 700;
	text-decoration: none;
}

.barLinks a:hover,
.barLinks a[aria-current="page"] {
	background: rgba(0, 0, 0, 0.2);
}

.barLinks .play {
	margin-left: 6px;
	background: var(--green-500);
	color: var(--ink-on-bright);
	box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.3);
}

.barLinks .play:hover {
	background: var(--green-500);
	filter: brightness(1.06);
}

/* ── Layout ────────────────────────────────────────────────────────────── */
.wrap {
	display: grid;
	/* 720px keeps a line of body text near 75 characters. */
	grid-template-columns: 270px minmax(0, 720px);
	justify-content: center;
	gap: 32px;
	padding: 32px clamp(16px, 4vw, 40px) 64px;
}

.toc {
	position: sticky;
	top: 88px;
	align-self: start;
	max-height: calc(100vh - 110px);
	overflow-y: auto;
	padding: 18px 20px;
	border-radius: 16px;
	background: var(--board-900);
}

.toc summary {
	color: var(--ink);
	font-weight: 800;
	font-size: 13px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	cursor: pointer;
	list-style: none;
}

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

.toc ol {
	margin: 12px 0 0;
	padding-left: 1.4em;
	font-size: 14px;
	line-height: 1.45;
}

.toc li {
	margin: 0 0 8px;
	color: var(--ink-dim);
}

.toc li::marker {
	color: var(--green-300);
	font-weight: 700;
}

.toc a {
	color: var(--ink-soft);
	text-decoration: none;
}

.toc a:hover,
.toc a[aria-current] {
	color: var(--green-300);
}

.toc a[aria-current] {
	font-weight: 700;
}

/* Headings that carry their own numbers ("4. Limits of use…") need none from the list. */
.toc ol.plain {
	list-style: none;
	padding-left: 0;
}

.toc .n {
	color: var(--green-300);
	font-weight: 700;
}

/* ── Document ──────────────────────────────────────────────────────────── */
/* The privacy policy quotes a 56-character URL; unbroken, it widened the page on phones. */
.doc {
	overflow-wrap: anywhere;
	padding: clamp(24px, 4vw, 44px) clamp(20px, 4.5vw, 52px);
	border-radius: 20px;
	background: var(--board-700);
	box-shadow: 0 10px 28px rgba(2, 10, 5, 0.45);
}

.kicker {
	margin: 0;
	color: var(--green-300);
	font-size: 13px;
	font-weight: 800;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

h1 {
	margin: 6px 0 12px;
	color: var(--ink);
	font-size: clamp(26px, 4vw, 36px);
	line-height: 1.15;
	font-weight: 800;
}

.date {
	display: inline-block;
	margin: 0 0 20px;
	padding: 4px 12px;
	border-radius: 999px;
	background: var(--board-900);
	color: var(--ink-dim);
	font-size: 14px;
	font-weight: 600;
}

h2 {
	margin: 40px 0 14px;
	padding-top: 24px;
	border-top: 1px solid var(--line);
	color: var(--ink);
	font-size: 22px;
	line-height: 1.3;
	font-weight: 800;
}

h2 a {
	color: inherit;
	text-decoration: none;
}

h2 a:hover {
	color: var(--green-300);
}

/* The privacy policy's headings are written in capitals: set them as labels, not shouts. */
.legal--privacy h2 {
	font-size: 16px;
	letter-spacing: 0.05em;
}

h3 {
	margin: 22px 0 10px;
	color: var(--ink);
	font-size: 17px;
	font-weight: 700;
}

p {
	margin: 0 0 14px;
}

hr {
	margin: 28px 0;
	border: 0;
	border-top: 1px solid var(--line);
}

/* The all-capitals acceptance notice at the top of the Terms. */
.callout {
	margin: 8px 0 20px;
	padding: 14px 18px;
	border-left: 4px solid var(--gold);
	border-radius: 10px;
	background: var(--board-900);
	color: var(--ink);
	font-size: 14.5px;
	line-height: 1.6;
}

/* Numbered clauses: the number in its own gutter, so a clause can be found by eye. */
.clause {
	display: grid;
	grid-template-columns: 3.4em minmax(0, 1fr);
	gap: 10px;
}

.clause.d2 {
	grid-template-columns: 4.2em minmax(0, 1fr);
	margin-left: 1.2em;
}

.clause .num {
	color: var(--green-300);
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}

ul {
	margin: 0 0 16px;
	padding-left: 1.3em;
}

li {
	margin: 0 0 6px;
}

ul li::marker {
	color: var(--green-300);
}

.docFoot {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 12px;
	margin-top: 40px;
	padding-top: 20px;
	border-top: 1px solid var(--line);
	color: var(--ink-dim);
	font-size: 14px;
}

/* ── Narrow screens: contents fold above the document ─────────────────── */
@media (max-width: 900px) {
	.wrap {
		grid-template-columns: minmax(0, 1fr);
		gap: 16px;
		padding-top: 16px;
	}

	.toc {
		position: static;
		max-height: none;
	}

	.toc summary::after {
		content: " +";
		color: var(--green-300);
	}

	.toc details[open] summary::after {
		content: " \2212";
	}

	/* Phones: logo and the way back on top, the two documents as tabs underneath. The bar
	   scrolls away with the page; pinned, two rows of it held an eighth of the screen. */
	.bar {
		position: static;
		flex-wrap: wrap;
		gap: 8px;
		padding: 10px 14px 10px;
	}

	.barLinks {
		display: contents;
	}

	.barLinks .play {
		margin-left: auto;
	}

	/* Half the row each, so both always start the second row together. */
	.barLinks .doclink {
		order: 3;
		flex: 1 1 calc(50% - 4px);
		padding: 6px 10px;
		text-align: center;
		background: transparent;
		box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
	}

	.barLinks .doclink[aria-current="page"] {
		background: var(--board-900);
		color: var(--green-300);
		box-shadow: none;
	}

	.brand img {
		height: 30px;
	}

	html {
		scroll-padding-top: 12px;
	}

	body {
		font-size: 16px;
	}

	/* A narrow hanging gutter keeps each number beside its text. */
	.clause,
	.clause.d2 {
		grid-template-columns: 3.1em minmax(0, 1fr);
		gap: 6px;
		margin-left: 0;
	}

	.clause.d2 {
		grid-template-columns: 3.9em minmax(0, 1fr);
	}

	.clause .num {
		font-size: 0.92em;
	}
}

@media print {
	body {
		background: #fff;
		color: #000;
	}

	.bar,
	.toc {
		display: none;
	}

	.wrap {
		display: block;
		padding: 0;
	}

	.doc {
		box-shadow: none;
		background: #fff;
		padding: 0;
	}

	h1,
	h2,
	h3,
	.callout,
	.clause .num,
	.kicker,
	.date {
		color: #000;
		background: none;
	}
}
