:root {
	--bg: #e6d3c6;
	--panel: #ecdcd0;
	--panel-deep: #d9c2b2;
	--fg: #1a1716;
	--muted: #5e514a;
	--accent: #e3262f;
	--go: #1fb954;
	--ink: #121212;
	--paper: #f5f2ec;
	--chrome-1: #f4f4f4;
	--chrome-2: #9a9a9a;
	--border: #c9b3a4;
	--danger: #b42318;
	--radius: 6px;
	--space: 1rem;
	--font: "Archivo", "Helvetica Neue", Arial, sans-serif;
	--slab: "Alfa Slab One", Georgia, serif;
	--led: "DotGothic16", "Courier New", monospace;
	--chrome: linear-gradient(180deg, var(--chrome-1), var(--chrome-2) 45%, #e2e2e2 55%, #8d8d8d);
}

* {
	box-sizing: border-box;
}

html,
body {
	margin: 0;
	height: 100%;
	background: var(--ink);
	color: var(--fg);
	font-family: var(--font);
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
	-webkit-tap-highlight-color: transparent;
	overscroll-behavior: none;
}

h1,
h2 {
	margin: 0;
}

.hint {
	margin: 0;
	color: var(--muted);
	font-size: 0.9rem;
}

.row {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	flex-wrap: wrap;
}

.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	padding: 0.55rem 1rem;
	border: 1px solid transparent;
	border-radius: var(--radius);
	background: var(--ink);
	color: var(--paper);
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}

.btn:disabled {
	opacity: 0.6;
	cursor: default;
}

.btn-secondary {
	background: transparent;
	color: var(--fg);
	border-color: var(--border);
}

.alert {
	margin: 0;
	padding: 0.7rem 0.85rem;
	border: 1px solid var(--border);
	border-left: 3px solid var(--muted);
	border-radius: var(--radius);
}

.alert-error {
	border-left-color: var(--danger);
	color: var(--danger);
}

/* ---------- Booth room ---------- */

.booth {
	position: relative;
	min-height: 100dvh;
	overflow: hidden;
	display: flex;
	justify-content: center;
	background:
		repeating-conic-gradient(#111 0 25%, #f2f0ea 0 50%) 0 100% / 56px 56px no-repeat,
		var(--bg);
	background-size: 56px 56px, auto;
	background-repeat: repeat-x, no-repeat;
	background-position: 0 100%, 0 0;
	padding: 0 calc(clamp(44px, 11vw, 150px) + 8px);
	padding-bottom: 64px;
}

.booth::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 56px;
	height: 8px;
	background: var(--chrome);
}

.curtain {
	position: absolute;
	top: 0;
	bottom: 56px;
	width: clamp(44px, 11vw, 150px);
	z-index: 3;
	background:
		linear-gradient(90deg, rgba(0, 0, 0, 0.55), transparent 30%, transparent 70%, rgba(0, 0, 0, 0.55)) 0 0 / 34px 100%,
		linear-gradient(180deg, #2a2a2a, #0d0d0d 70%, #000);
	box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
}

.curtain-left {
	left: 0;
	border-radius: 0 0 40% 0 / 0 0 6% 0;
	animation: open-left 1.1s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.curtain-right {
	right: 0;
	border-radius: 0 0 0 40% / 0 0 0 6%;
	animation: open-right 1.1s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

@keyframes open-left {
	from {
		transform: scaleX(4.6);
		transform-origin: left;
	}
	to {
		transform: scaleX(1);
		transform-origin: left;
	}
}

@keyframes open-right {
	from {
		transform: scaleX(4.6);
		transform-origin: right;
	}
	to {
		transform: scaleX(1);
		transform-origin: right;
	}
}

.valance {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 14px;
	z-index: 4;
	background: var(--chrome);
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

.settings-btn {
	position: absolute;
	top: 22px;
	right: 10px;
	z-index: 6;
	width: 44px;
	height: 44px;
	display: grid;
	place-items: center;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.08);
	color: rgba(255, 255, 255, 0.55);
	cursor: pointer;
}

.settings-btn:hover {
	color: #fff;
	background: rgba(255, 255, 255, 0.16);
}

/* ---------- Cabinet ---------- */

.cabinet {
	position: relative;
	z-index: 2;
	width: 100%;
	max-width: 760px;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
	padding: 26px 14px 18px;
	margin-top: 14px;
	background: linear-gradient(180deg, var(--panel), var(--panel-deep));
	border-left: 6px solid #bdbdbd;
	border-right: 6px solid #bdbdbd;
	box-shadow: inset 10px 0 18px -12px rgba(0, 0, 0, 0.35), inset -10px 0 18px -12px rgba(0, 0, 0, 0.35);
}

.sign-wrap {
	padding: 4px;
	background: var(--chrome);
	border-radius: 3px;
	box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.sign {
	padding: 4px 26px 6px;
	background: var(--ink);
	color: #fff;
	font-family: "Lobster", "Brush Script MT", cursive;
	font-weight: 400;
	font-size: clamp(2.2rem, 7vw, 3.6rem);
	letter-spacing: 0.01em;
	line-height: 1.15;
	white-space: nowrap;
	border: 2px solid #fff;
}

.poster {
	width: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px 16px;
	flex-wrap: wrap;
	padding: 8px 12px;
	background: var(--paper);
	border: 3px solid var(--ink);
	outline: 3px solid #bdbdbd;
}

.poster-words {
	display: flex;
	flex-direction: column;
	align-items: center;
	line-height: 1;
}

.poster-small {
	font-weight: 800;
	font-size: 0.8rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.poster-big {
	font-family: var(--slab);
	color: var(--accent);
	font-size: clamp(1.8rem, 5vw, 2.6rem);
	text-transform: uppercase;
	text-shadow: 2px 2px 0 var(--ink);
	letter-spacing: 0.03em;
}

.poster-film {
	padding: 4px 12px;
	background: var(--ink);
	color: #fff;
	border-radius: 4px;
	font-weight: 800;
	font-size: 0.85rem;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	outline: 2px solid #fff;
	outline-offset: -5px;
}

.poster-poses {
	width: 56px;
	height: 56px;
	display: grid;
	place-items: center;
	align-content: center;
	border-radius: 50%;
	background: var(--accent);
	color: #fff;
	border: 3px solid #fff;
	box-shadow: 0 0 0 3px #1d3c8f;
	line-height: 0.9;
}

.poster-poses b {
	font-size: 1.5rem;
}

.poster-poses small {
	font-size: 0.6rem;
	font-weight: 800;
	text-transform: uppercase;
}

/* ---------- LED countdown ---------- */

.led {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 6px 16px;
	min-width: min(320px, 100%);
	background: #140a08;
	border: 4px solid #3b3b3b;
	border-radius: 6px;
	box-shadow: inset 0 0 14px #000, 0 2px 0 #fff;
	font-family: var(--led);
	color: #ff4433;
	text-shadow: 0 0 8px rgba(255, 60, 40, 0.8);
	font-variant-numeric: tabular-nums;
}

.led-main {
	min-width: 3.2ch;
	font-size: 2.2rem;
	line-height: 1;
	text-align: center;
}

.led-side {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.led-sub {
	font-size: 0.95rem;
	color: #ffb199;
}

.pips {
	display: flex;
	gap: 6px;
}

.pip {
	width: 12px;
	height: 12px;
	border-radius: 50%;
	background: #3a1612;
}

.pip.on {
	background: #ff4433;
	box-shadow: 0 0 8px #ff4433;
}

/* ---------- Camera screen ---------- */

.screen {
	position: relative;
	width: min(100%, calc((100dvh - 410px) * 1.44));
	min-width: min(100%, 260px);
	aspect-ratio: 36 / 25;
	overflow: hidden;
	background: #0b0b0b;
	border: 8px solid var(--ink);
	outline: 4px solid #bdbdbd;
	border-radius: 4px;
	box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}

.screen video {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transform: scaleX(-1);
}

.screen video.bw {
	filter: grayscale(1) contrast(1.1);
}

.screen video.is-hidden {
	visibility: hidden;
}

.screen-count {
	position: absolute;
	inset: 0;
	display: grid;
	place-items: center;
	font-family: var(--slab);
	font-size: clamp(5rem, 22vw, 11rem);
	color: #fff;
	text-shadow: 0 4px 24px rgba(0, 0, 0, 0.6);
	animation: pop 1s ease-out;
}

@keyframes pop {
	from {
		transform: scale(1.4);
		opacity: 0;
	}
	30% {
		transform: scale(1);
		opacity: 1;
	}
}

.screen-msg {
	position: absolute;
	inset: 0;
	display: grid;
	place-items: center;
	align-content: center;
	gap: 12px;
	padding: 20px;
	text-align: center;
	color: #e9e3dc;
}

.screen-msg p {
	margin: 0;
	max-width: 32ch;
}

.screen-msg .btn {
	background: var(--paper);
	color: var(--ink);
}

.strip-view {
	position: absolute;
	inset: 0;
	display: grid;
	place-items: center;
	padding: 10px;
	background: radial-gradient(circle, #2a2522, #0b0b0b);
}

.strip-view img {
	height: 100%;
	width: auto;
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.6);
	animation: slide-down 0.8s ease-out;
}

@keyframes slide-down {
	from {
		transform: translateY(-30%);
		opacity: 0;
	}
}

.flash {
	position: absolute;
	inset: 0;
	background: #fff;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.35s ease-out;
}

.flash.on {
	opacity: 1;
	transition: none;
}

/* ---------- Arcade buttons ---------- */

.controls {
	display: flex;
	justify-content: center;
	gap: clamp(20px, 6vw, 56px);
	padding: 12px 20px;
	background: var(--ink);
	border: 3px solid #bdbdbd;
	border-radius: 10px;
}

.arcade {
	width: clamp(92px, 20vw, 128px);
	height: clamp(92px, 20vw, 128px);
	border-radius: 50%;
	border: 6px solid #cfcfcf;
	font-family: var(--font);
	font-weight: 800;
	font-size: clamp(0.71rem, 1.95vw, 0.94rem);
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: rgba(255, 255, 255, 0.55);
	cursor: pointer;
	box-shadow: 0 6px 0 #6d6d6d, inset 0 -8px 14px rgba(0, 0, 0, 0.35);
	transition: transform 0.08s, box-shadow 0.08s;
}

.arcade:disabled {
	cursor: default;
}

.arcade:not(:disabled):active {
	transform: translateY(5px);
	box-shadow: 0 1px 0 #6d6d6d, inset 0 -4px 10px rgba(0, 0, 0, 0.35);
}

.arcade-red {
	background: radial-gradient(circle at 35% 30%, #7a2a2a, #3d1414);
}

.arcade-red.is-lit {
	color: #fff;
	background: radial-gradient(circle at 35% 30%, #ff6b5e, var(--accent) 55%, #9c1018);
	box-shadow: 0 6px 0 #6d6d6d, 0 0 26px rgba(255, 50, 40, 0.75), inset 0 -8px 14px rgba(0, 0, 0, 0.25);
	animation: glow-red 1.6s ease-in-out infinite;
}

.arcade-green {
	background: radial-gradient(circle at 35% 30%, #2d5a3b, #13291b);
}

.arcade-green.is-lit {
	color: #fff;
	background: radial-gradient(circle at 35% 30%, #7cf2a0, var(--go) 55%, #0c7a34);
	box-shadow: 0 6px 0 #6d6d6d, 0 0 26px rgba(40, 230, 110, 0.8), inset 0 -8px 14px rgba(0, 0, 0, 0.25);
	animation: glow-green 1.6s ease-in-out infinite;
}

@keyframes glow-red {
	50% {
		box-shadow: 0 6px 0 #6d6d6d, 0 0 8px rgba(255, 50, 40, 0.4), inset 0 -8px 14px rgba(0, 0, 0, 0.25);
	}
}

@keyframes glow-green {
	50% {
		box-shadow: 0 6px 0 #6d6d6d, 0 0 8px rgba(40, 230, 110, 0.4), inset 0 -8px 14px rgba(0, 0, 0, 0.25);
	}
}

/* ---------- Develop pop-up ---------- */

.develop-backdrop,
.modal-backdrop {
	position: fixed;
	inset: 0;
	z-index: 10;
	display: grid;
	place-items: center;
	padding: 16px;
	background: rgba(10, 8, 8, 0.72);
}

.develop-card {
	width: min(440px, 100%);
	padding: 24px 24px 28px;
	text-align: center;
	background: var(--paper);
	border: 4px solid var(--ink);
	outline: 4px solid #bdbdbd;
	border-radius: 6px;
}

.develop-card h2 {
	font-family: var(--slab);
	font-weight: 400;
	font-size: 1.5rem;
	line-height: 1.25;
	color: var(--ink);
}

.develop-card p {
	margin: 10px 0 0;
	color: var(--muted);
}

.stopwatch {
	width: 170px;
	height: auto;
	margin-bottom: 8px;
}

.stopwatch-num {
	font-family: var(--led);
	font-variant-numeric: tabular-nums;
}

/* ---------- Print / Share / Coffee pop-up ---------- */

.output-card {
	position: relative;
	width: min(520px, 100%);
	padding-top: 28px;
}

.output-close {
	position: absolute;
	top: 6px;
	right: 6px;
}

.output-card h2 {
	padding: 0 36px;
}

.output-options {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
	gap: 12px;
	margin-top: 20px;
}

.output-opt {
	display: grid;
	justify-items: center;
	gap: 4px;
	min-height: 120px;
	padding: 16px 10px 14px;
	border: 3px solid var(--ink);
	border-radius: 12px;
	font: inherit;
	color: #fff;
	cursor: pointer;
	box-shadow: 0 5px 0 var(--ink);
	transition: transform 0.08s, box-shadow 0.08s;
}

.output-opt:not(:disabled):active {
	transform: translateY(4px);
	box-shadow: 0 1px 0 var(--ink);
}

.output-opt:disabled {
	opacity: 0.6;
	cursor: wait;
}

.output-opt .opt-name {
	font-family: var(--slab);
	font-size: 1.25rem;
	letter-spacing: 0.03em;
}

.output-opt small {
	font-size: 0.78rem;
	opacity: 0.9;
}

.opt-print {
	background: var(--go);
}

.opt-share {
	background: #2b6fd6;
}

.opt-coffee {
	background: #7a4a2b;
}

.output-note {
	margin: 16px 0 0;
	color: var(--muted);
}

/* ---------- Settings ---------- */

.modal {
	width: min(440px, 100%);
	max-height: calc(100dvh - 32px);
	overflow-y: auto;
	display: grid;
	gap: 20px;
	padding: 20px;
	background: var(--paper);
	border-radius: 10px;
	box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.modal-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.modal-head h2 {
	font-size: 1.3rem;
	font-weight: 800;
}

.icon-btn {
	width: 44px;
	height: 44px;
	display: grid;
	place-items: center;
	border: 0;
	background: transparent;
	color: var(--fg);
	border-radius: 50%;
	cursor: pointer;
}

.icon-btn:hover {
	background: rgba(0, 0, 0, 0.06);
}

.setting {
	display: grid;
	gap: 10px;
}

.setting-label {
	font-weight: 700;
}

.seg {
	display: grid;
	grid-template-columns: 1fr 1fr;
	padding: 4px;
	gap: 4px;
	background: #e4ddd3;
	border-radius: 8px;
}

.seg button {
	min-height: 44px;
	border: 0;
	border-radius: 6px;
	background: transparent;
	font: inherit;
	font-weight: 600;
	color: var(--muted);
	cursor: pointer;
}

.seg button[aria-pressed="true"] {
	background: var(--ink);
	color: #fff;
}

.tile-preview {
	width: 100%;
	aspect-ratio: 36 / 25;
	overflow: hidden;
	border: 6px solid #fff;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
	background: var(--ink);
}

.tile-preview img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.tile-default {
	height: 100%;
	display: grid;
	place-items: center;
	align-content: center;
	gap: 4px;
	color: #fff;
}

.tile-default span {
	font-family: var(--slab);
	font-size: 1.8rem;
	color: var(--accent);
}

.tile-default small {
	color: #ddd;
}

/* ---------- Printing ---------- */

.print-sheet {
	display: none;
}

@page {
	size: 4in 6in;
	margin: 0;
}

@media print {
	html,
	body {
		background: #fff;
		height: auto;
	}

	.booth {
		display: none !important;
	}

	.print-sheet {
		display: block;
	}

	.print-sheet img {
		display: block;
		width: 4in;
		height: 6in;
	}
}

@media (max-height: 640px) and (orientation: landscape) {
	.poster {
		display: none;
	}

	.screen {
		width: min(100%, calc((100dvh - 300px) * 1.44));
	}
}

@media (prefers-reduced-motion: reduce) {
	.curtain-left,
	.curtain-right,
	.arcade-red.is-lit,
	.arcade-green.is-lit,
	.screen-count,
	.strip-view img {
		animation: none;
	}
}

:where(a, button, input, select, textarea):focus-visible {
	outline: 3px solid #2f6df6;
	outline-offset: 2px;
}
