/* Roger Corman presents SPLATTER: single-page rebuild (2026). Palette, type and
   backgrounds from Kris Millsap's 2019 original. */

@font-face {
	font-family: 'Bowlby One SC';
	src: url(fonts/bowlby-one-sc.woff2) format('woff2');
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}

:root {
	--blood: #960000;
	--red: #cc0000;
	--yellow: #daff00;
	--white: #fff;
	--ink: #000;
	--thick: 'Bowlby One SC', Impact, 'Arial Black', sans-serif;
	--gutter: 16px;
	color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
	margin: 0;
	min-height: 100vh;
	min-height: 100dvh;
	display: flex;
	flex-direction: column;
	background: var(--blood) url(img/bg.webp) center / cover fixed no-repeat;
	color: var(--white);
	font: 18px/1.45 system-ui, -apple-system, 'Segoe UI', Verdana, sans-serif;
	-webkit-font-smoothing: antialiased;
	overflow-x: hidden;
}
body.in-chapter { background-image: url(img/video-bg.webp); }

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
img { display: block; max-width: 100%; height: auto; }

.icon { width: 1em; height: 1em; fill: currentColor; vertical-align: -0.12em; flex: none; }

.visually-hidden {
	position: absolute !important;
	width: 1px; height: 1px;
	overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%);
	white-space: nowrap;
}

:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; }

#app {
	flex: 1 0 auto;
	width: 100%;
	display: flex;
	flex-direction: column;
	justify-content: center;
	padding: 24px var(--gutter);
}

/* ── title screen ──────────────────────────────────────────────────────── */

.title-screen {
	width: 100%;
	max-width: 1000px;
	margin: 0 auto;
	text-align: center;
}
.title-screen .logo {
	width: auto;
	max-width: 100%;
	max-height: 48vh; /* logo, tagline and Begin fit on one screen */
	margin: 0 auto;
	filter: drop-shadow(0 10px 24px rgba(0, 0, 0, .45));
	animation: rise .9s cubic-bezier(.2, .9, .3, 1.2) both;
}
.tagline {
	font-family: var(--thick);
	font-size: clamp(22px, 4.4vw, 40px);
	line-height: 1.15;
	text-transform: uppercase;
	text-shadow: 4px 4px 3px var(--ink);
	margin: 12px auto 22px;
}
@media (max-height: 700px) {
	.tagline { font-size: clamp(18px, 3.4vw, 30px); margin: 6px auto 14px; }
	.begin { font-size: 30px; }
	.credit { margin-top: 14px; }
}
.tagline > div { display: inline-block; }
.tagline .line-1 { transform: rotate(2deg); }
.tagline .line-2 { transform: rotate(-2deg); display: block; width: max-content; margin: 0 auto; }
.tagline .line-3 { transform: rotate(2deg); }
.yellow { color: var(--yellow); }

.begin {
	display: inline-flex;
	align-items: center;
	gap: .35em;
	font-family: var(--thick);
	font-size: clamp(30px, 6vw, 54px);
	text-transform: uppercase;
	color: var(--yellow);
	background: var(--ink);
	border: 3px solid var(--red);
	border-radius: 14px;
	padding: .2em .8em .25em;
	box-shadow: 0 0 0 4px rgba(0, 0, 0, .35), 0 12px 30px rgba(0, 0, 0, .5);
	animation: bounce .7s ease-in-out infinite alternate;
	transition: color .2s, border-color .2s, transform .2s;
}
.begin:hover, .begin:focus-visible {
	color: var(--white);
	border-color: var(--yellow);
	animation: vibrate .1s linear infinite;
}
.credit {
	margin: 26px auto 0;
	max-width: 32em;
	font-size: 15px;
	text-transform: uppercase;
	letter-spacing: .06em;
	opacity: .85;
	text-shadow: 1px 1px 2px var(--ink);
}
.found {
	margin: 10px 0 0;
	font-family: var(--thick);
	font-size: 16px;
	color: var(--yellow);
	text-transform: uppercase;
	text-shadow: 2px 2px 0 var(--ink);
}

/* ── chapter screen ────────────────────────────────────────────────────── */

.chapter-screen {
	width: 100%;
	max-width: 1100px;
	margin: 0 auto;
}
.chapter-head {
	display: flex;
	align-items: center;
	gap: 20px;
	margin-bottom: 18px;
}
.chapter-head .home { flex: 0 0 auto; width: clamp(110px, 20vw, 220px); }
.chapter-head .home:hover img, .chapter-head .home:focus-visible img { animation: shake .4s infinite; }
.chapter-head h2 {
	margin: 0;
	font-family: var(--thick);
	font-weight: 400;
	font-size: clamp(20px, 4vw, 44px);
	line-height: 1.05;
	text-transform: uppercase;
	color: var(--yellow);
	text-shadow: 3px 3px 0 var(--ink);
}
.chapter-head h2:focus { outline: none; }
.chapter-head .ep { display: block; font-size: .62em; color: var(--white); }

.frame {
	position: relative;
	border: 3px solid var(--ink);
	border-radius: 8px;
	overflow: hidden;
	background: #1a0000;
	box-shadow: 0 0 0 2px var(--red), 0 18px 40px rgba(0, 0, 0, .6);
}
.video { position: relative; aspect-ratio: 16 / 9; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.bodycount {
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 6px 14px;
	margin: 14px 0 0;
	padding: 0;
	font-family: var(--thick);
	font-size: 15px;
	text-transform: uppercase;
}
.bodycount:empty { display: none; }
.bodycount li { display: inline-flex; align-items: center; gap: 5px; }
.bodycount .dead { color: #ff8a8a; text-decoration: line-through; text-decoration-thickness: 3px; text-decoration-color: var(--red); }
.bodycount .dead .icon { color: var(--red); }
.bodycount .alive { color: var(--white); opacity: .7; }

.controls {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	margin: 14px 0 0;
	padding: 10px 18px;
	background: rgba(0, 0, 0, .45);
	border: 1px solid var(--red);
	border-radius: 10px;
	font-family: var(--thick);
	text-transform: uppercase;
}
.controls .back { opacity: .6; display: inline-flex; align-items: center; gap: .35em; }
.controls .back:hover, .controls .back:focus-visible { opacity: 1; color: var(--yellow); animation: twitch .1s infinite; }
.controls .decide { display: inline-flex; align-items: center; gap: .4em; color: var(--yellow); text-transform: uppercase; font-family: var(--thick); text-align: right; }
.controls .decide:hover, .controls .decide:focus-visible { color: var(--white); animation: twitch .1s infinite; }
.controls .decide[aria-expanded="true"] { color: var(--white); }

.panel {
	margin: 12px 0 0;
	padding: 20px;
	background: rgba(0, 0, 0, .78);
	border: 1px solid var(--yellow);
	border-radius: 14px;
	text-align: center;
}
.panel.reveal { animation: slam .45s cubic-bezier(.2, .9, .3, 1.3) both; }
.prompt, .end-title {
	margin: 0 0 14px;
	font-family: var(--thick);
	font-size: clamp(24px, 4vw, 36px);
	text-transform: uppercase;
	color: var(--yellow);
	text-shadow: 3px 3px 0 var(--ink);
}
.options { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; }
.option {
	display: inline-flex;
	align-items: center;
	gap: .45em;
	min-width: 170px;
	justify-content: center;
	padding: 12px 22px;
	font-family: var(--thick);
	font-size: clamp(22px, 3.4vw, 30px);
	text-transform: uppercase;
	background: var(--blood);
	border: 2px solid var(--red);
	border-radius: 10px;
	box-shadow: 0 6px 0 #4a0000;
	transition: transform .12s, box-shadow .12s, background .2s;
}
.option .icon { color: var(--yellow); }
.option:hover, .option:focus-visible {
	background: var(--red);
	transform: translateY(-2px) rotate(-1.5deg);
	box-shadow: 0 8px 0 #4a0000;
}
.option:active { transform: translateY(3px); box-shadow: 0 2px 0 #4a0000; }

.end-count { margin: 0 0 16px; }
.end-count b { color: var(--yellow); }
.endings {
	list-style: none;
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
	gap: 10px;
	margin: 0 0 18px;
	padding: 0;
	font-size: 14px;
	text-transform: uppercase;
}
.endings li { border: 1px dashed rgba(255, 255, 255, .3); border-radius: 8px; }
.endings a, .endings span { display: block; padding: 10px 8px; }
.endings a { border-radius: 8px; background: rgba(150, 0, 0, .55); }
.endings a:hover, .endings a:focus-visible { background: var(--red); }
.endings .current a { outline: 2px solid var(--yellow); }
.endings span { opacity: .45; letter-spacing: .3em; }
.end-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.end-actions a, .end-actions button {
	display: inline-flex;
	align-items: center;
	gap: .4em;
	padding: 10px 18px;
	font-family: var(--thick);
	text-transform: uppercase;
	border: 2px solid var(--yellow);
	border-radius: 10px;
	color: var(--yellow);
}
.end-actions a:hover, .end-actions button:hover,
.end-actions a:focus-visible, .end-actions button:focus-visible { background: var(--yellow); color: var(--ink); }

/* ── footer, toast ─────────────────────────────────────────────────────── */

.colophon {
	flex: none;
	padding: 24px var(--gutter) 30px;
	text-align: center;
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: .05em;
	opacity: .55;
}
.colophon .rating { display: inline-block; border: 1px solid; padding: 2px 12px; margin-bottom: 10px; font-weight: 700; }
.colophon .presented { margin-top: 6px; }
.colophon a { text-decoration: underline; }

.toast {
	position: fixed;
	left: 50%;
	bottom: 24px;
	transform: translateX(-50%);
	max-width: calc(100% - 2 * var(--gutter));
	padding: 10px 18px;
	background: var(--ink);
	border: 1px solid var(--yellow);
	border-radius: 10px;
	font-size: 15px;
	word-break: break-all;
	z-index: 10;
}

.noscript { text-align: center; }
.noscript a { color: var(--yellow); text-decoration: underline; }

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

@keyframes rise   { from { opacity: 0; transform: scale(.85) rotate(-3deg); } to { opacity: 1; transform: none; } }
@keyframes bounce { from { transform: translateY(0); } to { transform: translateY(8px); } }
@keyframes slam   { 0% { opacity: 0; transform: scale(1.12) rotate(-1deg); } 100% { opacity: 1; transform: none; } }
@keyframes vibrate { 0%, 100% { transform: translateX(3px); } 50% { transform: translateX(-3px); } }
@keyframes twitch  { 0%, 100% { transform: translateX(1px); } 50% { transform: translateX(-1px); } }
@keyframes shake {
	0%   { transform: translate(1px, 1px) rotate(0); }
	20%  { transform: translate(-3px, 0) rotate(1deg); }
	40%  { transform: translate(1px, -1px) rotate(1deg); }
	60%  { transform: translate(-3px, 1px) rotate(0); }
	80%  { transform: translate(-1px, -1px) rotate(1deg); }
	100% { transform: translate(1px, -2px) rotate(-1deg); }
}

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

/* ── small screens ─────────────────────────────────────────────────────── */

@media (max-width: 640px) {
	body { font-size: 16px; background-attachment: scroll; }
	#app { padding-top: 16px; }
	.chapter-head { gap: 12px; }
	.controls { padding: 10px 12px; font-size: 15px; }
	.panel { padding: 16px 12px; }
	.option { min-width: 0; flex: 1 1 40%; padding: 12px 10px; }
	.tagline { font-size: 5.2vw; }
}
