@font-face {
	font-family: "Fahkwang";
	font-style: normal;
	font-weight: 400;
	font-display: swap;
	src: url("./brand/fonts/fahkwang-400-latin.woff2") format("woff2");
}

@font-face {
	font-family: "Fahkwang";
	font-style: normal;
	font-weight: 600;
	font-display: swap;
	src: url("./brand/fonts/fahkwang-600-latin.woff2") format("woff2");
}

:root {
	--bg: #f4f1ea;
	--card: #ffffff;
	--text: #1c2e2b;
	--muted: #5c6b68;
	--line: rgba(28, 46, 43, 0.12);
	--accent: #822229;
	--accent-press: #6b1c22;
	--hero: #1c2e2b;
	--radius: 10px;
	--shadow: 0 16px 36px rgba(28, 46, 43, 0.12);
}

* {
	box-sizing: border-box;
}

html,
body {
	margin: 0;
	min-height: 100%;
	background: var(--bg);
	color: var(--text);
	font-family: Arial, Helvetica, sans-serif;
	-webkit-font-smoothing: antialiased;
}

body {
	padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

.hidden {
	display: none !important;
}

.screen {
	min-height: 100vh;
	padding: 32px 24px 48px;
	max-width: 980px;
	margin: 0 auto;
}

.logo {
	display: block;
	height: auto;
}

.logo-hero {
	width: min(220px, 58vw);
	margin: 0 auto 28px;
}

.logo-bar {
	width: 88px;
	flex: 0 0 auto;
}

.home {
	max-width: none;
	position: relative;
	display: flex;
	flex-direction: column;
	justify-content: center;
	color: #fff;
	background: var(--hero) url("./brand/hero.jpg") center / cover no-repeat;
}

.home::before {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, rgba(28, 46, 43, 0.28) 0%, rgba(28, 46, 43, 0.55) 100%);
	pointer-events: none;
}

.home .hero,
.home .actions {
	position: relative;
	z-index: 1;
}

.hero {
	margin: 8vh auto 40px;
	max-width: 640px;
	text-align: center;
}

.eyebrow {
	margin: 0 0 12px;
	color: var(--accent);
	letter-spacing: 0.14em;
	text-transform: uppercase;
	font-size: 12px;
	font-weight: 700;
}

.home .eyebrow {
	color: #f4f1ea;
}

h1,
h2 {
	font-family: "Fahkwang", "Times New Roman", serif;
	font-weight: 400;
}

h1 {
	margin: 0 0 16px;
	font-size: clamp(32px, 6vw, 52px);
	line-height: 1.12;
}

h2 {
	margin: 0;
	font-size: 26px;
}

.lede,
.hint,
.label,
.quality-inner {
	color: var(--muted);
}

.home .lede {
	color: rgba(255, 255, 255, 0.88);
}

.lede {
	margin: 0 auto;
	max-width: 460px;
	font-size: 18px;
	line-height: 1.45;
}

.actions {
	display: flex;
	flex-direction: column;
	gap: 12px;
	max-width: 360px;
	margin: 0 auto;
	width: 100%;
}

.btn {
	appearance: none;
	border: 0;
	border-radius: var(--radius);
	padding: 16px 22px;
	font: inherit;
	font-size: 17px;
	font-weight: 700;
	cursor: pointer;
}

.btn.primary {
	background: var(--accent);
	color: #fff;
}

.btn.primary:active {
	background: var(--accent-press);
}

.btn.secondary {
	background: var(--card);
	color: var(--text);
	box-shadow: inset 0 0 0 1px var(--line);
}

.home .btn.secondary {
	background: rgba(255, 255, 255, 0.92);
}

.btn.danger {
	background: var(--accent);
	color: #fff;
	padding: 10px 16px;
	font-size: 15px;
}

.btn.small {
	padding: 10px 16px;
	font-size: 15px;
}

.btn.text {
	background: transparent;
	color: var(--accent);
}

.bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 16px;
}

.bar > div {
	flex: 1;
}

#camera-block {
	margin: 0 0 16px;
	max-width: none;
	padding: 16px;
	background: var(--card);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
}

.stage {
	background: #000;
	border-radius: var(--radius);
	overflow: hidden;
	min-height: 42vh;
	box-shadow: var(--shadow);
}

.stage iframe,
.watch iframe {
	display: block;
	width: 100%;
	height: 56vh;
	border: 0;
	background: #000;
}

.panel {
	margin-top: 20px;
	padding: 24px;
	background: var(--card);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	display: grid;
	gap: 20px;
	justify-items: center;
}

.pin-block {
	text-align: center;
}

.pin {
	margin: 4px 0 12px;
	font-family: "Fahkwang", "Times New Roman", serif;
	font-size: 42px;
	letter-spacing: 0.28em;
	font-weight: 400;
}

.qr {
	width: 180px;
	height: 180px;
}

.qr img,
.qr canvas,
.qr table {
	max-width: 100%;
	height: auto;
}

.quality {
	display: flex;
	flex-direction: column;
	gap: 8px;
	width: 100%;
	max-width: 320px;
	font-size: 14px;
	color: var(--muted);
}

#btn-camera {
	width: 100%;
	margin-top: 4px;
}

select,
input {
	width: 100%;
	border: 0;
	border-radius: 8px;
	background: #eeeae2;
	padding: 14px 16px;
	font: inherit;
	font-size: 17px;
	color: var(--text);
}

.join {
	max-width: 360px;
	margin: 0 auto;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

#join-pin {
	text-align: center;
	letter-spacing: 0.4em;
	font-size: 28px;
}

.watch {
	max-width: none;
	padding: 0;
	min-height: 100vh;
	background: #000;
	position: relative;
}

.watch iframe {
	height: 100vh;
}

.watch-bar {
	position: absolute;
	left: 50%;
	top: 16px;
	transform: translateX(-50%);
	max-width: min(520px, calc(100% - 32px));
	color: #fff;
	background: rgba(28, 46, 43, 0.78);
	padding: 12px 18px;
	border-radius: 8px;
	font-size: 15px;
	line-height: 1.35;
	text-align: center;
	z-index: 2;
}

.watch-bar.warn {
	background: rgba(130, 34, 41, 0.88);
}

.watch-bar.lost {
	background: rgba(130, 34, 41, 0.94);
}

@media (min-width: 900px) {
	#screen-hall {
		display: grid;
		grid-template-columns: 1fr 280px;
		grid-template-rows: auto auto 1fr;
		column-gap: 24px;
		max-width: 1200px;
	}

	#screen-hall.hidden {
		display: none !important;
	}

	#screen-hall .bar {
		grid-column: 1 / -1;
	}

	#camera-block {
		grid-column: 2;
		grid-row: 2;
		margin-bottom: 0;
	}

	#screen-hall .stage {
		grid-column: 1;
		grid-row: 2 / 4;
	}

	#screen-hall .stage iframe {
		height: calc(100vh - 160px);
	}

	#screen-hall .panel {
		grid-column: 2;
		grid-row: 3;
		margin-top: 16px;
		align-content: start;
	}
}
