html,
body {
	margin: 0;
	padding: 0;
	width: 100%;
	height: 100%;
	background: #000;
	overflow: hidden;
}

#canvasWrap {
	position: fixed;
	left: 0;
	top: 0;
	width: 100vw;
	height: 100vh;
	display: flex;
	align-items: stretch;
	justify-content: stretch;
}

#canvasWrap canvas {
	width: 100% !important;
	height: 100% !important;
	display: block;
	object-fit: cover;
	image-rendering: pixelated;
}

/* EXPORT_PRESET_STYLE_START */

@font-face {
	font-family: "SoehneBreit";
	src: url("../assets/font/sohnebreit-buch.otf") format("opentype");
	font-weight: 500;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: "SoehneBreit";
	src: url("../assets/font/sohnebreit-dreiviertelfett.otf") format("opentype");
	font-weight: 700;
	font-style: normal;
	font-display: swap;
}

* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
	-moz-box-sizing: border-box;
	-webkit-box-sizing: border-box;
	text-decoration: none;
	-webkit-text-size-adjust: 100%;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizelegibility;
	-moz-osx-font-smoothing: grayscale;
	line-height: inherit;
	outline: 0;
	-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
	-webkit-user-select: none;
	-ms-user-select: none;
	user-select: none;
}

html {
	background: #070707;
}

html,
select {
	font-size: 14px;
	line-height: 1.6em;
	scroll-behavior: smooth;
	font-family: "SoehneBreit", sans-serif;
	font-optical-sizing: auto;
	font-weight: 500;
	font-style: normal;
	letter-spacing: 0.04em;
}

nav {
	position: fixed;
	z-index: 10;
	bottom: 0;
	left: 0;
	width: 100%;
	text-align: center;
	opacity: 0;
	transition: opacity 0.3s ease-in-out;
}

nav[data-mode="live"] select[name="cameraList"],
nav[data-mode="live"] button[name="record"] {
	display: inline-block;
}

nav[data-mode="live"] button[name="startOver"],
nav[data-mode="live"] button.collect {
	display: none;
}

nav[data-mode="loop"] select[name="cameraList"],
nav[data-mode="loop"] button[name="record"] {
	display: none;
}

nav[data-mode="loop"] button[name="startOver"],
nav[data-mode="loop"] button.collect {
	display: inline-block;
}

nav[data-mode="recording"] select[name="cameraList"],
nav[data-mode="recording"] button {
	display: none;
}

nav[data-mode="recording"] #recordingStatus {
	display: block;
}

nav[data-mode="preparing"] select[name="cameraList"],
nav[data-mode="preparing"] button[name="record"],
nav[data-mode="preparing"] button[name="startOver"],
nav[data-mode="preparing"] #recordingStatus {
	display: none;
}

nav[data-mode="preparing"] button[name="export"] {
	display: none;
}

nav[data-mode="preparing"] .status {
	display: inline-block;
}

#recordingStatus {
	display: none;
	position: relative;
	box-sizing: border-box;
	width: 220px;
	height: 41px;
	background-color: #800;
	overflow: hidden;
	line-height: 41px;
	text-align: center;
	font-weight: 700;
	border-radius: 5px;
	margin: 0 auto;
}

#recordingStatus .progressWidth {
	position: absolute;
	top: 0;
	left: 0;
	width: 0%;
	height: 100%;
	background-color: #f00;
}

#recordingStatus .progressValue {
	position: relative;
	z-index: 1;
}

select,
button {
	all: unset;
	border: none;
	cursor: pointer;
	color: #fff;
	text-decoration: underline;
	opacity: 0.5;
	text-align: center;
	font-size: 13px;
}

select:hover,
button:hover {
	opacity: 1;
}

.buttons button,
.button {
	all: unset;
	margin: 0 10px;
	background-color: #fff;
	padding: 10px 20px;
	cursor: pointer;
	border-radius: 5px;
	text-transform: uppercase;
	font-weight: 700;
	color: #000;
}

.buttons button:hover,
.button:hover {
	background-color: #f00;
}

.buttons button:active,
.button:active {
	background-color: #c00;
}

.settings select,
.settings button,
.buttons button {
	display: none;
}

.buttons {
	text-align: center;
	padding: 10px;
}

.settings {
	margin-top: 10px;
	height: 70px;
}

.status {
	display: none;
	background-color: #333;
	padding: 10px 20px;
	border-radius: 5px;
	text-transform: uppercase;
	font-weight: 700;
	color: #777;
}

#safeZone {
	position: absolute;
	pointer-events: none;
	height: 96%;
	top: 2%;
	left: 50%;
	transform: translateX(-50%);
	aspect-ratio: 1 / 2;
	border: 3px dotted #fff;
	z-index: 2;
	border-radius: 10px;
	text-transform: uppercase;
	padding: 5px 10px;
	color: #fff;
	font-size: 12px;
	opacity: 0;
	letter-spacing: 1px;
	transition: opacity 0.3s ease-in-out;
}

#intro-modal {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 9999;
	display: flex;
	align-items: center;
	justify-content: center;
}

#intro-modal .content {
	background-color: #000;
	padding: 40px 50px 35px;
	border-radius: 10px;
	max-width: 500px;
	text-align: center;
	color: #fff;
}

#intro-modal .content img {
	display: block;
	height: 20px;
	margin: 0 auto 20px;
	image-rendering: pixelated;
}

#intro-modal .content p {
	margin: 20px 0;
}

body.entered #safeZone {
	opacity: 0.5;
}

body.entered nav {
	opacity: 1;
}

body.entered #intro-modal {
	display: none;
}

/* ——— Camera dropdown: visible down-arrow + bolder, legible label ——— */
.cameraPicker {
	position: relative;
	display: inline-block;
	margin: 22px auto 0;
}
select[name="cameraIntroList"],
nav select[name="cameraList"] {
	all: unset;
	box-sizing: border-box;
	cursor: pointer;
	color: #fff;
	font-weight: 700;
	font-size: 14px;
	letter-spacing: 0.04em;
	text-align: left;
	padding: 9px 34px 9px 14px;
	border: 1px solid rgba(255, 255, 255, 0.35);
	border-radius: 6px;
	background-color: rgba(255, 255, 255, 0.04);
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath fill='%23ffffff' d='M0 0h12L6 8z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 12px center;
	appearance: none;
	-webkit-appearance: none;
	opacity: 1;
	text-decoration: none;
}
select[name="cameraIntroList"]:hover,
nav select[name="cameraList"]:hover {
	border-color: rgba(255, 255, 255, 0.7);
	opacity: 1;
}
select[name="cameraIntroList"] option,
nav select[name="cameraList"] option {
	color: #000;
}

/* ——— Safe-zone label: bolder + legible ——— */
#safeZone {
	font-size: 14px;
	font-weight: 700;
	text-shadow: 0 1px 6px rgba(0, 0, 0, 0.9);
}

/* ——— After recording: dim everything outside the safe zone, surface the
   looping playback bar + the prominent COLLECT button ——— */
body.has-loop #safeZone {
	opacity: 1;
	border-color: #fff;
	box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.62);
}

#playbackBar {
	display: none;
	width: 220px;
	height: 6px;
	margin: 0 auto 14px;
	background: rgba(255, 255, 255, 0.16);
	border-radius: 3px;
	overflow: hidden;
}
body.has-loop #playbackBar {
	display: block;
}
#playbackBar .fill {
	display: block;
	height: 100%;
	width: 100%;
	background: #ff2a12;
	border-radius: 3px;
	transform-origin: left center;
	animation: playback-loop var(--loop-duration, 5s) linear infinite;
}
@keyframes playback-loop {
	0% { transform: scaleX(0); }
	100% { transform: scaleX(1); }
}

/* Prominent, action-oriented COLLECT button once a loop exists */
body.has-loop nav button.collect {
	font-size: 17px;
	padding: 15px 38px;
	background-color: #ff2a12;
	color: #fff;
	box-shadow: 0 8px 34px rgba(255, 42, 18, 0.5);
	animation: collect-pulse 1.7s ease-in-out infinite;
}
body.has-loop nav button.collect:hover {
	background-color: #ff2a12;
	filter: brightness(1.1);
}
@keyframes collect-pulse {
	0%, 100% { transform: scale(1); }
	50% { transform: scale(1.05); }
}

#siteLogo {
	position: fixed;
	top: 16px;
	left: 18px;
	z-index: 20;
	display: block;
	opacity: 0.85;
	transition: opacity 0.2s ease;
}
#siteLogo:hover { opacity: 1; }
#siteLogo img {
	display: block;
	height: 20px;
	width: auto;
	image-rendering: pixelated;
}

/* EXPORT_PRESET_STYLE_END */
