/* The game on the Extras page: campus map and rooms */

.play-game { margin: 0.5rem 0 2.5rem; }

.play-screen { position: relative; max-width: 960px; }

#play-canvas {
	display: block;
	width: 100%;
	aspect-ratio: 16 / 9;
	border-radius: 10px;
	background: #3b4a3a;
	image-rendering: pixelated;
	image-rendering: crisp-edges;
	outline: none;
}

#play-canvas:focus-visible { box-shadow: 0 0 0 3px var(--accent-2); }

/* Hints at the top of the game screen */
.play-prompt {
	position: absolute;
	top: 0.7rem;
	left: 50%;
	transform: translateX(-50%);
	margin: 0;
	padding: 0.3rem 0.8rem;
	background: rgba(20, 18, 24, 0.82);
	border-radius: 999px;
	color: #f5f1e8;
	font-family: var(--sans);
	font-size: 0.85rem;
	white-space: nowrap;
	pointer-events: none;
}

/* Dialogue box at the bottom of the game screen, in the style of classic 2D games */
.play-dialogue {
	position: absolute;
	right: 3%;
	bottom: 4%;
	left: 3%;
	max-height: 72%;
	overflow-y: auto;
	padding: 0.9rem 1.1rem 0.8rem;
	background: rgba(24, 21, 30, 0.95);
	border: 3px solid #f5f1e8;
	border-radius: 6px;
	box-shadow: 0 0 0 3px #1c1a20;
	color: #f5f1e8;
	font-family: var(--sans);
	font-size: 0.95rem;
	line-height: 1.45;
}

.play-dialogue p { margin: 0 0 0.4rem; }
.dlg-kind { font-size: 0.7rem; font-weight: 650; letter-spacing: 0.1em; text-transform: uppercase; color: #ffa066; }
.dlg-kind.is-speaker { font-size: 0.9rem; letter-spacing: 0; text-transform: none; color: #9fb6e6; }  /* who is talking: λ or a host */
.play-dialogue.dlg-top { top: 4%; bottom: auto; }
.dlg-title { font-family: var(--serif); font-size: 1.2rem; font-weight: 600; }
.dlg-odds { padding-left: 0.7rem; border-left: 3px solid #ffa066; color: #e9e1d3; }
.dlg-list { margin: 0.2rem 0 0.4rem; padding-left: 1.2rem; }
.dlg-list li { margin-bottom: 0.25rem; }
.play-dialogue a { color: #9fb6e6; }
.dlg-actions { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.6rem; margin: 0.3rem 0 0 !important; }
.dlg-actions a { font-weight: 600; }
.dlg-hint { margin-left: auto; font-size: 0.8rem; color: #a39d91; }

/* Keyboard legend (computers) */
.play-keys {
	display: flex;
	flex-wrap: wrap;
	gap: 0.3rem 1.6rem;
	margin: 0.8rem 0 0;
	padding: 0;
	list-style: none;
	font-family: var(--sans);
	font-size: 0.82rem;
	color: var(--muted);
}

.play-keys kbd {
	display: inline-block;
	min-width: 1.6em;
	margin: 0 0.1em;
	padding: 0.05em 0.35em;
	background: var(--card);
	border: 1px solid var(--rule);
	border-bottom-width: 3px;
	border-radius: 5px;
	color: var(--text);
	font-family: var(--sans);
	font-size: 0.85em;
	text-align: center;
}

/* Start the game again (forgets saved progress) */
.play-restart { margin: 0.6rem 0 0; }
.play-restart button {
	padding: 0.3rem 0.8rem;
	background: none;
	border: 1px solid var(--rule);
	border-radius: 999px;
	color: var(--muted);
	font-family: var(--sans);
	font-size: 0.8rem;
	cursor: pointer;
}
.play-restart button:hover { color: var(--text); border-color: var(--muted); }

/* Game-controller buttons (touch screens only) */
.play-pad { display: none; }

@media (hover: none) and (pointer: coarse) {
	.play-keys { display: none; }
	.play-pad { display: flex; justify-content: space-between; align-items: center; margin: 0.8rem 0 0; }
	.pad-dirs { display: grid; grid-template-columns: repeat(3, 3.2rem); grid-template-rows: repeat(3, 3.2rem); }
	.pad-up { grid-area: 1 / 2; } .pad-left { grid-area: 2 / 1; } .pad-right { grid-area: 2 / 3; } .pad-down { grid-area: 3 / 2; }
	.pad-actions { display: flex; flex-direction: column; align-items: center; gap: 0.6rem; }
	.pad-btn {
		background: var(--card);
		border: 1px solid var(--rule);
		border-radius: 10px;
		color: var(--text);
		font-family: var(--sans);
		font-size: 1rem;
		touch-action: manipulation;
		user-select: none;
	}
	.pad-a { width: 4.2rem; height: 4.2rem; border-radius: 50%; background: var(--accent); border-color: var(--accent); color: var(--bg); font-weight: 700; }
	.pad-map { padding: 0.4rem 0.9rem; font-size: 0.85rem; }
}
