/* Browser games: the hub page (play.html, linked by i18n-util.mjs renderNgHeadAssets) and the page of each
   game under /games/ (linked by games-gen.mjs, which switches this file off when the game itself starts).
   Read mode around one action: a sheet with the game's cover, what it is, and the Play button.
   Wrappers carry `pl-` classes; #playList, .pl-item[data-year], .pl-name, .pl-line keep their shape (buildPageLd reads
   them). Uses ng.css primitives (sheet, tape, buy button, kicker). */

/* ─── A game's own page: the strip above the sheets ──────────────────────── */

.pl-top {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: var(--s3) var(--s5);
	max-width: 1120px;
	margin: 0 auto;
	padding: var(--s4) var(--s5) 0;
}

.pl-brand {
	display: inline-flex;
	align-items: center;
	gap: var(--s3);
	min-height: 44px;
	color: var(--ink);
	font: 400 var(--t1)/1.5 var(--f-con);
	text-decoration: none;
	-webkit-font-smoothing: none;
}

.pl-brand img {
	display: block;
	padding: var(--s1);
	background: var(--logo-slip);
}

.pl-nav {
	display: flex;
	flex-wrap: wrap;
	gap: var(--s2) var(--s5);
	font: 400 var(--t2)/1.2 var(--f-disp);
}

.pl-nav a,
.pl-foot a,
.pl-more-all a,
.pl-next a,
.pl-hub-note a,
.pl-about a {
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 4px;
}

.pl-nav a {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
}

.pl-nav a:hover,
.pl-nav a:focus-visible,
.pl-foot a:hover,
.pl-foot a:focus-visible,
.pl-more-all a:hover,
.pl-more-all a:focus-visible,
.pl-next a:hover,
.pl-next a:focus-visible,
.pl-hub-note a:hover,
.pl-hub-note a:focus-visible,
.pl-about a:hover,
.pl-about a:focus-visible {
	text-decoration-thickness: 2px;
}

.pl-main {
	max-width: 1120px;
	margin: var(--s6) auto 0;
	padding: 0 var(--s5);
}

/* ─── The lead sheet: what the game is, the button, the cover ────────────── */

.pl-lead {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 26rem);
	gap: var(--s7);
	align-items: start;
	padding: var(--s7) var(--s7) var(--s7);
}

.pl-lead h1 {
	margin: 0;
	font: 300 var(--t6)/1.02 var(--f-disp);
	overflow-wrap: anywhere;
}

.pl-lede {
	max-width: 34rem;
	margin: var(--s5) 0 0;
	font: 400 var(--t3)/1.45 var(--f-read);
}

.pl-cta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--s3) var(--s5);
	margin: var(--s6) 0 0;
}

.pl-cta .ng-buy {
	min-height: 56px;
	padding: 0 var(--s7);
	font-size: var(--t3);
}

.pl-cta-note {
	color: var(--dim);
	font: 400 var(--t1)/1.4 var(--f-read);
}

/* a game drawn for a wide frame asks for a turned phone before the button is pressed */
.pl-turn {
	display: none;
	margin: var(--s4) 0 0;
	color: var(--dim);
	font: italic 400 var(--t1)/1.5 var(--f-read);
}

.pl-cover {
	margin: var(--s2) 0 0;
	transform: rotate(1.2deg);
}

.pl-cover img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 8 / 5;
	object-fit: cover;
	padding: var(--s2);
	background: var(--panel-2);
	box-shadow: 3px 4px 0 var(--shadow);
}

/* ─── Under the lead: the text on one sheet, the facts and the sequel beside ─ */

.pl-body {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 21rem);
	gap: var(--s6);
	align-items: start;
	margin-top: var(--s6);
}

.pl-about {
	padding: var(--s6) var(--s7) var(--s7);
}

.pl-about h2,
.pl-next h2,
.pl-more h2 {
	margin: 0 0 var(--s3);
	font: 600 var(--t3)/1.2 var(--f-disp);
}

.pl-about p {
	max-width: 38rem;
	margin: 0;
	font: 400 var(--t2)/1.7 var(--f-read);
}

.pl-about p + p {
	margin-top: var(--s4);
}

.pl-about p + h2 {
	margin-top: var(--s6);
}

.pl-side {
	display: grid;
	gap: var(--s6);
}

.pl-facts {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr);
	margin: 0;
	padding: var(--s4) var(--s5);
	transform: rotate(-.6deg);
}

.pl-facts > div {
	display: contents;
}

.pl-facts dt,
.pl-facts dd {
	margin: 0;
	padding: var(--s2) 0;
	border-bottom: 1px dashed var(--dim);
	font-size: var(--t1);
	line-height: 1.45;
}

.pl-facts dt {
	padding-right: var(--s4);
	color: var(--dim);
	font-family: var(--f-disp);
	font-weight: 500;
}

.pl-facts > div:last-child dt,
.pl-facts > div:last-child dd {
	border-bottom: 0;
}

.pl-next {
	padding: var(--s5);
	border-left: 4px double var(--accent);
}

.pl-next p {
	margin: 0;
	font: 400 var(--t1)/1.6 var(--f-read);
}

.pl-next ul {
	margin: var(--s3) 0 0;
	padding: 0;
	list-style: none;
}

.pl-next li {
	font: 500 var(--t2)/1.35 var(--f-disp);
}

.pl-next li + li {
	margin-top: var(--s3);
}

.pl-next li a {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
}

.pl-next .pl-store {
	margin-left: var(--s3);
	color: var(--dim);
	font: 400 var(--t1)/1.35 var(--f-read);
}

/* ─── The other games: small prints in a row ─────────────────────────────── */

.pl-more {
	margin-top: var(--s7);
	padding: var(--s6) var(--s7) var(--s6);
}

.pl-more-list {
	display: grid;
	grid-template-columns: repeat(5, minmax(0, 1fr));
	gap: var(--s5);
	margin: var(--s5) 0 0;
	padding: 0;
	list-style: none;
}

.pl-more-list a {
	display: block;
	color: var(--ink);
	text-decoration: none;
}

.pl-more-list img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 8 / 5;
	object-fit: cover;
	padding: var(--s1);
	background: var(--panel);
	box-shadow: 2px 3px 0 var(--shadow);
}

.pl-more-list b {
	display: block;
	margin-top: var(--s2);
	font: 500 var(--t1)/1.25 var(--f-disp);
}

.pl-more-list a:hover b,
.pl-more-list a:focus-visible b {
	text-decoration: underline;
	text-decoration-thickness: 2px;
	text-underline-offset: 4px;
}

.pl-more-list span {
	display: block;
	color: var(--dim);
	font: 400 var(--t1)/1.5 var(--f-con);
	font-size: .75rem;
	font-variant-numeric: tabular-nums;
	-webkit-font-smoothing: none;
}

.pl-more-all {
	margin: var(--s5) 0 0;
	font: 400 var(--t2)/1.4 var(--f-disp);
}

.pl-more-all a {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
}

.pl-foot {
	max-width: 1120px;
	margin: var(--s7) auto 0;
	padding: 0 var(--s5) var(--s7);
	color: var(--dim);
	font: 400 var(--t1)/1.6 var(--f-read);
}

.pl-foot ul {
	display: flex;
	flex-wrap: wrap;
	gap: var(--s2) var(--s5);
	margin: 0;
	padding: 0;
	list-style: none;
}

.pl-foot a {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	color: var(--ink);
}

/* ─── The hub (play.html): one sheet, the games as a timeline by year ────── */

main.pl-hub {
	max-width: 1040px;
	padding: var(--s7) var(--s8) var(--s7);
}

#playheader h1 {
	max-width: 44rem;
	margin: 0;
	font: 300 var(--t6)/1.02 var(--f-disp);
}

.pl-intro {
	max-width: 38rem;
	margin: var(--s5) 0 0;
	font: 400 var(--t2)/1.7 var(--f-read);
}

#playList,
.pl-yr-games {
	margin: 0;
	padding: 0;
	list-style: none;
}

#playList {
	margin-top: var(--s7);
}

/* a year: its number in the console face down the left edge, its games to the right */
.pl-yr {
	display: grid;
	grid-template-columns: 7.5rem minmax(0, 1fr);
	gap: var(--s6);
	align-items: start;
	padding: var(--s7) 0 var(--s6);
	border-top: 1px dashed var(--dim);
}

.pl-yr-h {
	margin: 0;
	color: var(--accent);
	font: 400 var(--t3)/1.4 var(--f-con);
	font-variant-numeric: tabular-nums;
	-webkit-font-smoothing: none;
}

.pl-yr-games {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: var(--s7) var(--s6);
}

.pl-item {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: var(--s5);
	align-content: start;
}

/* a year with one game: the cover beside the text, across the whole row */
.pl-item:only-child {
	grid-column: 1 / -1;
	grid-template-columns: minmax(0, 20rem) minmax(0, 1fr);
	gap: var(--s6);
}

/* the cover is a photo taped to the sheet */
.pl-shot {
	--t: -1deg;
	position: relative;
	display: block;
	transform: rotate(var(--t));
	transition: transform 120ms cubic-bezier(.2, .7, .2, 1);
}

.pl-item:nth-child(even) .pl-shot {
	--t: .8deg;
}

.pl-yr:nth-child(even) .pl-item:first-child .pl-shot {
	--t: .5deg;
}

.pl-shot:hover,
.pl-shot:focus-visible {
	transform: rotate(var(--t)) translateY(-3px);
}

.pl-shot img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 8 / 5;
	object-fit: cover;
	padding: var(--s2);
	background: var(--panel-2);
	box-shadow: 3px 4px 0 var(--shadow);
}

.pl-name {
	margin: 0;
	font: 500 var(--t4)/1.15 var(--f-disp);
}

.pl-name a {
	text-decoration: none;
}

.pl-name a:hover,
.pl-name a:focus-visible {
	text-decoration: underline;
	text-decoration-thickness: 2px;
	text-underline-offset: 4px;
}

.pl-line {
	max-width: 36rem;
	margin: var(--s3) 0 0;
	font: 400 var(--t2)/1.65 var(--f-read);
}

.pl-go {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--s3) var(--s5);
	margin: var(--s4) 0 0;
}

.pl-hub-note {
	max-width: 38rem;
	margin: var(--s6) 0 0;
	padding-top: var(--s5);
	border-top: 1px dashed var(--dim);
	color: var(--dim);
	font: italic 400 var(--t1)/1.65 var(--f-read);
}

/* ─── Tablet ─────────────────────────────────────────────────────────────── */

@media (max-width: 1000px) {
	.pl-lead {
		grid-template-columns: minmax(0, 1fr) minmax(0, 18rem);
		gap: var(--s6);
		padding: var(--s6);
	}

	.pl-lead h1,
	#playheader h1 {
		font-size: var(--t5);
	}

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

	.pl-side {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		align-items: start;
	}

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

	main.pl-hub {
		padding: var(--s6);
	}

	.pl-yr {
		grid-template-columns: 5.5rem minmax(0, 1fr);
		gap: var(--s5);
	}

	.pl-yr-h {
		font-size: var(--t2);
	}

	.pl-yr-games {
		gap: var(--s6) var(--s5);
	}

	.pl-item:only-child {
		grid-template-columns: minmax(0, 14rem) minmax(0, 1fr);
		gap: var(--s5);
	}
}

/* ─── Phone (390): one column, the button before the cover ───────────────── */

@media (max-width: 760px) {
	.pl-top {
		padding: var(--s3) var(--s4) 0;
	}

	.pl-main {
		margin-top: var(--s5);
		padding: 0 var(--s4);
	}

	.pl-lead {
		grid-template-columns: minmax(0, 1fr);
		gap: var(--s5);
		padding: var(--s6) var(--s4) var(--s5);
	}

	.pl-lead h1,
	#playheader h1 {
		font-size: var(--t4);
		line-height: 1.1;
	}

	.pl-lede {
		margin-top: var(--s4);
		font-size: var(--t2);
		line-height: 1.6;
	}

	.pl-cta {
		margin-top: var(--s5);
	}

	.pl-cover {
		margin: 0 var(--s3) 0 0;
	}

	.pl-about {
		padding: var(--s5) var(--s4) var(--s6);
	}

	.pl-about p {
		font-size: var(--t1);
	}

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

	.pl-more {
		margin-top: var(--s6);
		padding: var(--s5) var(--s4);
	}

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

	.pl-foot {
		padding: 0 var(--s4) var(--s6);
	}

	main.pl-hub {
		padding: var(--s6) var(--s4) var(--s5);
	}

	#playList {
		margin-top: var(--s5);
	}

	.pl-yr {
		grid-template-columns: minmax(0, 1fr);
		gap: var(--s5);
		padding: var(--s6) 0 var(--s5);
	}

	.pl-yr-games,
	.pl-item:only-child {
		grid-template-columns: minmax(0, 1fr);
	}

	.pl-item,
	.pl-item:only-child {
		gap: var(--s4);
	}

	.pl-shot {
		margin-right: var(--s5);
	}

	.pl-item:nth-child(even) .pl-shot {
		margin-right: 0;
		margin-left: var(--s5);
	}

	.pl-name {
		font-size: var(--t3);
	}

	.pl-line {
		font-size: var(--t1);
	}
}

@media (orientation: portrait) and (max-width: 900px) {
	.pl-turn {
		display: block;
	}
}

/* ─── Reduced motion ─────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
	.pl-shot {
		transition: none;
	}

	.pl-shot:hover,
	.pl-shot:focus-visible {
		transform: rotate(var(--t));
	}
}
