:root {
	--bg: #08090a;
	--panel: #121416;
	--panel-edge: #24282c;
	--text: #e8e4da;
	--muted: #8b8f93;
	--accent: #e0a03a;
	--danger: #c8302c;
	--ok: #5fae6e;
	--tape: "Special Elite", "Courier New", monospace;
	--display: "Bebas Neue", Impact, sans-serif;
}

* {
	box-sizing: border-box;
}

html,
body {
	margin: 0;
	min-height: 100%;
}

body {
	background:
		radial-gradient(ellipse at 50% -10%, #1d1a14 0%, transparent 60%),
		var(--bg);
	color: var(--text);
	font: 18px/1.6 var(--tape);
	min-height: 100vh;
}

.scanlines {
	position: fixed;
	inset: 0;
	pointer-events: none;
	background: repeating-linear-gradient(to bottom, rgb(255 255 255 / 0.025) 0 1px, transparent 1px 3px);
	z-index: 10;
}

main {
	max-width: 760px;
	margin: 0 auto;
	padding: 12vh 16px 80px;
}

h1,
h2 {
	font-family: var(--display);
	font-weight: 400;
	letter-spacing: 0.04em;
	margin: 0;
}

h1 {
	font-size: clamp(2.6rem, 8vw, 4rem);
	line-height: 1;
	margin-bottom: 28px;
}

.eyebrow {
	color: var(--accent);
	font-size: 0.8rem;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	margin: 0 0 14px;
}

/* Identify */

label {
	display: block;
	color: var(--muted);
	font-size: 0.9rem;
	margin-bottom: 8px;
}

.field {
	display: flex;
	gap: 10px;
}

input[type="text"] {
	flex: 1;
	min-width: 0;
	background: var(--panel);
	border: 1px solid var(--panel-edge);
	border-radius: 4px;
	color: var(--text);
	font: inherit;
	padding: 12px 14px;
	outline: none;
}

input[type="text"]:focus {
	border-color: var(--accent);
}

button {
	font-family: var(--display);
	font-size: 1.35rem;
	letter-spacing: 0.08em;
	border: 1px solid var(--accent);
	background: transparent;
	color: var(--accent);
	border-radius: 4px;
	padding: 8px 22px;
	cursor: pointer;
	transition: background 0.15s, color 0.15s;
}

button:hover,
button:focus-visible {
	background: var(--accent);
	color: var(--bg);
	outline: none;
}

.denied {
	color: var(--danger);
	margin: 16px 0 0;
	animation: flicker 0.4s steps(2) 2;
}

/* Briefing */

.tape {
	margin-bottom: 28px;
}

.line {
	margin: 0 0 14px;
}

.line .rest {
	visibility: hidden;
}

.line.typing > span:first-child::after {
	content: "▌";
	color: var(--accent);
	animation: blink 0.8s steps(1) infinite;
	position: absolute;
	margin-left: 1px;
}

.line.typing {
	position: relative;
}

.closing {
	color: var(--muted);
	font-size: 0.95rem;
	margin: 28px 0 24px;
}

.reveal[data-reveal]:not(.choices) {
	max-width: 620px;
}

.cards {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 16px;
}

.cards-single {
	grid-template-columns: minmax(0, 300px);
}

.card {
	background: var(--panel);
	border: 1px solid var(--panel-edge);
	border-radius: 6px;
	overflow: hidden;
	display: flex;
	flex-direction: column;
}

.card img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 2 / 3;
	object-fit: cover;
	filter: saturate(0.85) contrast(1.05);
}

.card-body {
	padding: 16px 18px 18px;
	display: flex;
	flex-direction: column;
	flex: 1;
}

.card h2 {
	font-size: 1.8rem;
	line-height: 1.05;
}

.year {
	color: var(--muted);
	font-size: 0.85rem;
	margin: 2px 0 12px;
}

.times {
	margin: 0;
	display: grid;
	gap: 6px;
}

.times div {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 12px;
	border-bottom: 1px dashed var(--panel-edge);
	padding-bottom: 6px;
}

.times dt {
	color: var(--muted);
	font-size: 0.9rem;
}

.times dd {
	margin: 0;
	font-family: var(--display);
	font-size: 1.5rem;
	letter-spacing: 0.04em;
}

.source {
	margin-top: auto;
	padding-top: 12px;
	color: var(--muted);
	font-size: 0.75rem;
	text-decoration: none;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.source:hover {
	color: var(--accent);
}

.total {
	margin-top: 16px;
	border-color: var(--accent);
	background: linear-gradient(135deg, #1b1710, var(--panel) 55%);
}

.total .times {
	grid-template-columns: repeat(3, 1fr);
	gap: 16px;
}

.total .times div {
	flex-direction: column;
	gap: 0;
	border-bottom: 0;
}

.total .times dd {
	font-size: 2.4rem;
	color: var(--accent);
}

.choices {
	max-width: 620px;
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
}

.choices-single {
	grid-template-columns: 1fr;
}

.choices button {
	font-size: 1.7rem;
	padding: 12px;
}

.accept {
	border-color: var(--ok);
	color: var(--ok);
}

.accept:hover,
.accept:focus-visible {
	background: var(--ok);
	color: var(--bg);
}

.decline {
	border-color: var(--danger);
	color: var(--danger);
}

.decline:hover,
.decline:focus-visible {
	background: var(--danger);
	color: var(--text);
}

.skip-hint {
	display: none;
}

/* Playback: with JS, lines and blocks start hidden and app.js reveals them. */

.js [data-briefing] [data-line],
.js [data-briefing] [data-reveal] {
	opacity: 0;
	pointer-events: none;
}

.js [data-briefing] .shown {
	opacity: 1;
	pointer-events: auto;
	transition: opacity 0.6s ease, transform 0.6s ease;
}

.js [data-briefing] [data-reveal]:not(.shown) {
	transform: translateY(12px);
}

.js [data-briefing]:not(.done) .skip-hint {
	display: block;
	position: fixed;
	bottom: 16px;
	right: 16px;
	margin: 0;
	color: var(--muted);
	font-size: 0.75rem;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

/* Outcome */

.countdown {
	color: var(--accent);
}

.destruct.destroyed h1,
.destruct.destroyed .line,
.destruct.destroyed .eyebrow {
	animation: burn 1.4s ease-in forwards;
}

body::after {
	content: "";
	position: fixed;
	inset: 0;
	background: #000;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.6s ease-in;
	z-index: 20;
}

body.closing::after {
	opacity: 1;
}

.burned {
	display: none;
}

body.closed .burned {
	display: grid;
	place-items: center;
	position: fixed;
	inset: 0;
	z-index: 30;
	color: #3a3d40;
	font-size: 0.85rem;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	text-align: center;
	padding: 16px;
}

.music-toggle {
	position: fixed;
	top: 14px;
	right: 16px;
	z-index: 15;
	font-size: 1rem;
	padding: 4px 12px;
	border-color: var(--panel-edge);
	color: var(--muted);
	background: rgb(8 9 10 / 0.7);
}

@keyframes blink {
	50% {
		opacity: 0;
	}
}

@keyframes flicker {
	50% {
		opacity: 0.3;
	}
}

@keyframes burn {
	30% {
		color: var(--accent);
		text-shadow: 0 0 12px var(--danger);
	}
	100% {
		opacity: 0;
		filter: blur(6px);
		transform: translateY(-8px);
	}
}

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

	main {
		padding-top: 8vh;
	}

	.cards {
		gap: 10px;
	}

	.card-body {
		padding: 12px;
	}

	.card h2 {
		font-size: 1.4rem;
	}

	.times dd {
		font-size: 1.2rem;
	}

	.times div {
		flex-direction: column;
		gap: 0;
	}

	.total .times dd {
		font-size: 1.7rem;
	}

	.total .times {
		gap: 8px;
	}
}

@media (prefers-reduced-motion: reduce) {
	* {
		animation: none !important;
		transition: none !important;
	}
}
