/*
 * BRO Lobby auf der Under-Construction-Seite.
 *
 * SCHICHTUNG: Die UC-Seite bleibt vollstaendig sichtbar und bedienbar — BRO
 * und die Tafel liegen darueber. Die Spiele selbst liegen mit 2147480000
 * noch eine Stufe hoeher, damit sie beim Oeffnen alles verdecken.
 *
 * Farben aus dem TradeButtons-Dark-UI: #0a0e17 / #111827 / #00ffdc.
 */

.tblobby {
	position: fixed;
	right: 22px;
	bottom: 18px;
	z-index: 2147479000;
	display: flex;
	align-items: flex-end;
	gap: 12px;
	pointer-events: none;
}

.tblobby[hidden] { display: none !important; }

/* --- Die Figur ------------------------------------------------------- */

.tblobby__bro {
	pointer-events: auto;
	border: 0;
	padding: 0;
	background: none;
	cursor: pointer;
	line-height: 0;
	filter: drop-shadow(0 12px 22px rgba(0, 0, 0, .55));
	transition: transform .25s ease;
	animation: tblobbyAtmen 4.5s ease-in-out infinite;
}

.tblobby__bro img {
	width: auto;
	height: 150px;
	display: block;
}

.tblobby__bro:hover { transform: translateY(-4px) scale(1.03); }
.tblobby__bro:focus-visible { outline: 2px solid #00ffdc; outline-offset: 6px; border-radius: 12px; }

@keyframes tblobbyAtmen {
	0%, 100% { transform: translateY(0); }
	50%      { transform: translateY(-6px); }
}

/* --- Sprechblase ----------------------------------------------------- */

.tblobby__blase {
	pointer-events: auto;
	position: relative;
	width: min(340px, calc(100vw - 40px));
	padding: 16px 18px 14px;
	border: 1px solid rgba(0, 255, 220, .28);
	border-radius: 16px;
	background: rgba(10, 14, 23, .97);
	color: #ecfbff;
	font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
	box-shadow: 0 20px 50px rgba(0, 0, 0, .55);

	opacity: 0;
	transform: translateY(10px) scale(.97);
	transition: opacity .2s ease, transform .22s ease;
	visibility: hidden;
}

.tblobby__blase.is-offen {
	opacity: 1;
	transform: none;
	visibility: visible;
}

/* Der Zipfel zeigt auf BRO. */
.tblobby__blase::after {
	content: "";
	position: absolute;
	right: -8px;
	bottom: 28px;
	width: 14px;
	height: 14px;
	background: rgba(10, 14, 23, .97);
	border-right: 1px solid rgba(0, 255, 220, .28);
	border-bottom: 1px solid rgba(0, 255, 220, .28);
	transform: rotate(-45deg);
}

.tblobby__titel { margin: 0 22px 6px 0; font-size: 16px; line-height: 1.3; }
.tblobby__text  { margin: 0 0 12px; font-size: 13.5px; line-height: 1.55; color: #b9d3d8; }

.tblobby__zu {
	position: absolute;
	top: 8px; right: 10px;
	width: 26px; height: 26px;
	border: 0; border-radius: 8px;
	background: none;
	color: #7e94a2;
	font-size: 18px; line-height: 1;
	cursor: pointer;
}
.tblobby__zu:hover { color: #ecfbff; background: rgba(255, 255, 255, .07); }

.tblobby__knoepfe { display: flex; flex-wrap: wrap; gap: 7px; }

.tblobby-knopf {
	padding: 9px 13px;
	border: 1px solid rgba(255, 255, 255, .12);
	border-radius: 10px;
	background: #111827;
	color: #dff5f4;
	font: 600 12.5px/1 inherit;
	cursor: pointer;
}
.tblobby-knopf:hover { border-color: rgba(0, 255, 220, .45); }

.tblobby-knopf--primaer {
	background: #00ffdc;
	border-color: #00ffdc;
	color: #00211b;
}
.tblobby-knopf--primaer:hover { filter: brightness(1.08); }

/* --- Tafel: Rangliste + Newsletter ----------------------------------- */

.tblobby-tafel {
	position: fixed;
	inset: 0;
	z-index: 2147479500;
	display: grid;
	place-items: center;
	padding: 20px;
	background: rgba(3, 6, 11, .82);
	backdrop-filter: blur(4px);
}

.tblobby-tafel[hidden] { display: none !important; }

.tblobby-tafel__inhalt {
	position: relative;
	width: min(520px, 100%);
	max-height: 86vh;
	overflow-y: auto;
	padding: 22px;
	border: 1px solid rgba(0, 255, 220, .22);
	border-radius: 18px;
	background: #0a0e17;
	color: #ecfbff;
	font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

.tblobby-tafel__inhalt h2 { margin: 0 30px 14px 0; font-size: 18px; letter-spacing: .04em; }
.tblobby-tafel__inhalt h3 { margin: 0 0 6px; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: #00ffdc; }

.tblobby-liste { display: flex; flex-direction: column; gap: 4px; }

.tblobby-zeile {
	display: flex; align-items: center; gap: 10px;
	padding: 9px 12px;
	border: 1px solid rgba(255, 255, 255, .06);
	border-radius: 10px;
	background: rgba(17, 24, 39, .6);
	font-size: 13px;
}
.tblobby-zeile__rang  { min-width: 42px; color: #7e94a2; font-variant-numeric: tabular-nums; }
.tblobby-zeile__name  { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tblobby-zeile__score { color: #00ffdc; font-variant-numeric: tabular-nums; }

/* Die eigene Zeile — sonst sucht man sich in einer Liste aus 25 Namen dumm. */
.tblobby-zeile.is-ich {
	border-radius: 8px;
	background: rgba(0, 255, 220, .1);
	box-shadow: inset 0 0 0 1px rgba(0, 255, 220, .3);
}

/* --- Newsletter-Tor -------------------------------------------------- */

.tblobby-nl {
	margin-top: 20px;
	padding-top: 18px;
	border-top: 1px solid rgba(255, 255, 255, .08);
}

.tblobby-nl__text { margin: 0 0 12px; font-size: 12.5px; line-height: 1.55; color: #8fa6b4; }

.tblobby-nl__zeile { display: flex; gap: 8px; flex-wrap: wrap; }

.tblobby-nl__zeile + .tblobby-nl__zeile { margin-top: 8px; }

/* Das Ergebnis, um das es geht — hervorgehoben, damit klar ist, wofuer die
   E-Mail-Adresse ueberhaupt gegeben wird. */
.tblobby-nl__ergebnis {
	margin: 0 0 12px;
	padding: 9px 12px;
	border: 1px solid rgba(0, 255, 220, .28);
	border-radius: 10px;
	background: rgba(0, 255, 220, .07);
	color: #9df3e6;
	font-size: 13px;
	font-weight: 600;
}

.tblobby-nl__zeile input[type="email"],
.tblobby-nl__zeile input[type="text"] {
	flex: 1 1 220px;
	min-width: 0;
	padding: 10px 12px;
	border: 1px solid rgba(255, 255, 255, .14);
	border-radius: 10px;
	background: #111827;
	color: #ecfbff;
	font: inherit;
	font-size: 13px;
}
.tblobby-nl__zeile input[type="email"]:focus,
.tblobby-nl__zeile input[type="text"]:focus {
	outline: none;
	border-color: rgba(0, 255, 220, .55);
}

/* Honeypot — fuer Menschen unsichtbar, fuer Bots ausfuellbar. Bewusst NICHT
   `display:none`: manche Bots ueberspringen verborgene Felder. */
.tblobby-nl__falle {
	position: absolute;
	left: -9999px;
	width: 1px; height: 1px;
	overflow: hidden;
}

.tblobby-nl__status { min-height: 17px; margin: 10px 0 0; font-size: 12.5px; color: #32e58f; }
.tblobby-nl__status.is-fehler { color: #ff7a84; }
.tblobby-nl__klein { margin: 8px 0 0; font-size: 11px; color: #6f8593; }

.screen-reader-text {
	position: absolute; width: 1px; height: 1px;
	overflow: hidden; clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}

/* --- Klein und Touch -------------------------------------------------- */

@media (max-width: 620px) {
	.tblobby { right: 12px; bottom: 12px; gap: 8px; flex-direction: column; align-items: flex-end; }
	.tblobby__bro img { height: 108px; }
	.tblobby__blase::after { display: none; }
}

@media (prefers-reduced-motion: reduce) {
	.tblobby__bro { animation: none; }
	.tblobby__blase { transition: none; }
}

/* --- Einwilligung und Spielhinweis ------------------------------------
 *
 * Beide liegen ueber allem — auch ueber den Spielen —, weil sie beantwortet
 * sein muessen, bevor gespielt oder gespeichert wird.
 */

.tblobby-consent,
.tblobby-spielhinweis {
	position: fixed;
	inset: 0;
	z-index: 2147481000;
	display: grid;
	place-items: center;
	padding: 20px;
	background: rgba(3, 6, 11, .88);
	backdrop-filter: blur(5px);
}

.tblobby-consent[hidden],
.tblobby-spielhinweis[hidden] { display: none !important; }

.tblobby-consent__inhalt {
	width: min(520px, 100%);
	max-height: 86vh;
	overflow-y: auto;
	padding: 24px;
	border: 1px solid rgba(0, 255, 220, .28);
	border-radius: 18px;
	background: #0a0e17;
	color: #ecfbff;
	font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
	box-shadow: 0 24px 60px rgba(0, 0, 0, .6);
}

.tblobby-consent__inhalt h2 { margin: 0 0 12px; font-size: 19px; }
.tblobby-consent__inhalt p  { margin: 0 0 12px; font-size: 13.5px; line-height: 1.6; color: #b9d3d8; }
.tblobby-consent__klein     { font-size: 12.5px !important; color: #8fa6b4 !important; }

.tblobby-consent__knoepfe { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }

.tblobby-consent__links { margin-top: 14px !important; font-size: 12px !important; }
.tblobby-consent__links a { color: #00ffdc; text-decoration: none; }
.tblobby-consent__links a:hover { text-decoration: underline; }

.tblobby-hinweisliste {
	margin: 0 0 4px;
	padding-left: 20px;
	font-size: 13.5px;
	line-height: 1.65;
	color: #b9d3d8;
}
.tblobby-hinweisliste li { margin-bottom: 9px; }
.tblobby-hinweisliste strong { color: #ecfbff; }
.tblobby-hinweisliste a { color: #00ffdc; }

@media (prefers-reduced-motion: reduce) {
	.tblobby-consent, .tblobby-spielhinweis { backdrop-filter: none; }
}

/* --- Rechtsleiste: Pflichtangaben und Widerruf ------------------------ */

.tblobby-rechtsleiste {
	position: fixed;
	left: 0; right: 0; bottom: 0;
	z-index: 2147478000;
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
	padding: 7px 14px;
	background: rgba(3, 6, 11, .88);
	border-top: 1px solid rgba(255, 255, 255, .07);
	font: 11.5px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, sans-serif;
	color: #8fa6b4;
}

.tblobby-rechtsleiste a,
.tblobby-rechtsleiste button {
	color: #9fe9df;
	background: none;
	border: 0;
	padding: 0;
	font: inherit;
	text-decoration: none;
	cursor: pointer;
}
.tblobby-rechtsleiste a:hover,
.tblobby-rechtsleiste button:hover { color: #00ffdc; text-decoration: underline; }

/* Der Bot darf nicht auf der Leiste sitzen. */
.tblobby { bottom: 46px; }
@media (max-width: 620px) { .tblobby { bottom: 52px; } }

/* --- Beweglicher BRO --------------------------------------------------- */

/* Die Wurzel wird von lobby-bewegung.js per `transform` verschoben. Der
   eigene Atem-Rhythmus muss dafuer vom Knopf auf das Bild wandern — sonst
   ueberschreiben sich die beiden Transformationen gegenseitig. */
.tblobby { will-change: transform; }

.tblobby__bro { animation: none; cursor: grab; touch-action: none; }
.tblobby.is-zieht .tblobby__bro { cursor: grabbing; }

.tblobby__bro img {
	animation: tblobbyAtmen 4.5s ease-in-out infinite;
	transform-origin: 50% 100%;
	/* Die Laufbilder haben leicht unterschiedliche Hoehen — unten verankern,
	   damit die Fuesse beim Bildwechsel nicht springen. */
	object-fit: contain;
	object-position: bottom;
}

/* Beim Ziehen und Laufen kein Atmen — das wirkt sonst wie Schluckauf. */
.tblobby.is-zieht .tblobby__bro img { animation: none; }

@media (prefers-reduced-motion: reduce) {
	.tblobby__bro img { animation: none; }
}
