html, body {
	margin: 0;
	height: 100%;
	overflow: hidden;
	background: #111;
	color: #eee;
	font: 15px/1.4 system-ui, -apple-system, "Segoe UI", sans-serif;
}

#labo-app,
#labo-livre {
	position: fixed;
	inset: 0;
	width: 100%;
	height: 100%;
	height: 100dvh;
	border: 0;
}

/* ── Chargement ── */
#labo-chargement {
	position: fixed;
	inset: 0;
	z-index: 15;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
	background: #111;
	transition: opacity .4s;
}
#labo-chargement.fini { opacity: 0; pointer-events: none; }
.labo-roue {
	width: 22px;
	height: 22px;
	border: 3px solid rgba(255, 255, 255, .2);
	border-top-color: #fff;
	border-radius: 50%;
	animation: labo-tourne .9s linear infinite;
}
@keyframes labo-tourne { to { transform: rotate(360deg); } }

/* ── Livre (par-dessus le jeu, le jeu reste chargé dessous) ── */
#labo-livre {
	z-index: 10;
	background: #111;
}
#labo-livre[hidden] { display: none; }

/* ── Bouton ☰ ── */
#labo-menu {
	position: fixed;
	z-index: 20;
	--marge: 10px;
}
.labo-pos-tl #labo-menu { top: max(var(--marge), env(safe-area-inset-top)); left: max(var(--marge), env(safe-area-inset-left)); }
.labo-pos-tr #labo-menu { top: max(var(--marge), env(safe-area-inset-top)); right: max(var(--marge), env(safe-area-inset-right)); }
.labo-pos-bl #labo-menu { bottom: max(var(--marge), env(safe-area-inset-bottom)); left: max(var(--marge), env(safe-area-inset-left)); }
.labo-pos-br #labo-menu { bottom: max(var(--marge), env(safe-area-inset-bottom)); right: max(var(--marge), env(safe-area-inset-right)); }

#labo-menu-bouton {
	width: 38px;
	height: 38px;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 4px;
	padding: 0;
	background: rgba(0, 0, 0, .5);
	border: 1px solid rgba(255, 255, 255, .25);
	border-radius: 50%;
	cursor: pointer;
	opacity: .55;
	transition: opacity .2s;
}
#labo-menu-bouton:hover,
#labo-menu-bouton:focus-visible,
#labo-menu-bouton[aria-expanded="true"] { opacity: 1; }
#labo-menu-bouton span {
	display: block;
	width: 16px;
	height: 2px;
	background: #fff;
	border-radius: 1px;
}

#labo-menu-panneau {
	position: absolute;
	min-width: 190px;
	display: flex;
	flex-direction: column;
	padding: 6px;
	background: rgba(24, 24, 24, .96);
	border: 1px solid #3a3a3a;
	border-radius: 10px;
	box-shadow: 0 8px 24px rgba(0, 0, 0, .5);
}
#labo-menu-panneau[hidden] { display: none; }
.labo-pos-tl #labo-menu-panneau { top: 46px; left: 0; }
.labo-pos-tr #labo-menu-panneau { top: 46px; right: 0; }
.labo-pos-bl #labo-menu-panneau { bottom: 46px; left: 0; }
.labo-pos-br #labo-menu-panneau { bottom: 46px; right: 0; }

#labo-menu-panneau a,
#labo-menu-panneau button {
	display: block;
	width: 100%;
	box-sizing: border-box;
	padding: 9px 12px;
	font: inherit;
	text-align: left;
	color: #eee;
	text-decoration: none;
	background: none;
	border: 0;
	border-radius: 6px;
	cursor: pointer;
}
#labo-menu-panneau a:hover,
#labo-menu-panneau button:hover { background: #2e2e2e; }
#labo-menu-panneau [hidden] { display: none; }

/* ── App non configurée ── */
.labo-message {
	height: 100%;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	padding: 0 16px;
}
.labo-message a { color: #9cf; }
