/* Page root */
html,
body {
	margin: 0;
	padding: 0;
	width: 100%;
	height: 100%;
	height: 100vh;
	height: 100dvh;
	overflow: hidden;
	background: #000;
}

/* Unity root container */
#unity-container {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	height: 100vh;
	height: 100dvh;
	overflow: hidden;
}

#unity-container.unity-desktop {
	display: flex;
	justify-content: center;
	align-items: center;
}

#unity-container.unity-mobile {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	height: 100vh;
	height: 100dvh;
	overflow: hidden;
}

/* Unity canvas */
#unity-canvas {
	display: block;
	width: auto;
	height: auto;
	max-width: 100vw;
	max-height: 100dvh;
	background: var(--unity-background-color);
}

.unity-mobile #unity-canvas {
	width: 100%;
	height: 100%;
	max-width: none;
	max-height: none;
}

/* Loading UI */
#unity-loading-bar {
	position: absolute;
	top: 50%;
	left: 50%;
	display: none;
	text-align: center;
	transform: translate(-50%, -50%);
}

#unity-logo {
	width: 154px;
	height: 130px;
	margin: 0 auto;
	background-image: var(--unity-logo-image);
	background-repeat: no-repeat;
	background-position: center;
	background-size: contain;
}

#unity-progress-bar-empty {
	width: 141px;
	height: 18px;
	margin: 0 auto;
	background-image: var(--unity-progress-empty-image);
	background-repeat: no-repeat;
	background-position: center;
}

#unity-progress-bar-full {
	width: 0%;
	height: 18px;
	background-image: var(--unity-progress-full-image);
	background-repeat: no-repeat;
	background-position: center;
}

#load-message {
	padding: 10px;
	text-align: center;
}

/* Runtime warnings */
#unity-warning {
	position: absolute;
	top: 5%;
	left: 50%;
	display: none;
	padding: 10px;
	background: white;
	transform: translate(-50%);
}

/* WebGL debug diagnostics */
#webgl-debug-diagnostics {
	position: fixed;
	right: 12px;
	bottom: 12px;
	z-index: 1000;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 8px;
	font-family: monospace;
}

#webgl-debug-toggle,
#webgl-debug-clear {
	border: 0;
	border-radius: 999px;
	padding: 8px 12px;
	background: rgba(0, 0, 0, 0.75);
	color: #fff;
	cursor: pointer;
}

#webgl-debug-panel {
	width: min(360px, calc(100vw - 24px));
	max-height: min(45vh, 320px);
	overflow: hidden;
	border-radius: 12px;
	background: rgba(0, 0, 0, 0.88);
	color: #fff;
	box-shadow: 0 12px 24px rgba(0, 0, 0, 0.28);
}

#webgl-debug-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 10px 12px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

#webgl-debug-logs {
	overflow: auto;
	max-height: calc(min(45vh, 320px) - 50px);
	padding: 8px 12px 12px;
}

.webgl-debug-log {
	padding: 6px 0;
	border-bottom: 1px solid rgba(255, 255, 255, 0.08);
	white-space: pre-wrap;
	word-break: break-word;
	font-size: 12px;
	line-height: 1.4;
}

.webgl-debug-log:last-child {
	border-bottom: 0;
}

.webgl-debug-log-warning {
	color: #ffe082;
}

.webgl-debug-log-error {
	color: #ff8a80;
}
