/*
 * WP Breakout Game – Styles
 * ------------------------------------------------------------
 * CSS-Isolierung: JEDE Regel ist auf ".wbg-breakout-container"
 * gescoped, um Konflikte mit dem aktiven WordPress-Theme zu
 * vermeiden. Es wird bewusst KEINE eigene Schriftart geladen –
 * die Typografie wird 1:1 vom Theme übernommen (font-family: inherit).
 */

.wbg-breakout-container {
	/* Lokale Design-Tokens – nur innerhalb des Containers gültig. */
	--wbg-bg: #ffffff;
	--wbg-surface: #f8f9fb;
	--wbg-border: #e2e5ea;
	--wbg-text: #1f2430;
	--wbg-muted: #6b7280;
	--wbg-accent: #2f6fed;
	--wbg-accent-contrast: #ffffff;
	--wbg-danger: #e5484d;
	--wbg-success: #1a9d63;
	--wbg-radius: 10px;
	--wbg-gap: 16px;

	box-sizing: border-box;
	width: 100%;
	margin: 24px auto;
	padding: 20px;
	background: var(--wbg-bg);
	border: 1px solid var(--wbg-border);
	border-radius: var(--wbg-radius);
	color: var(--wbg-text);
	font-family: inherit;
	line-height: 1.5;
	-webkit-tap-highlight-color: transparent;
}

.wbg-breakout-container *,
.wbg-breakout-container *::before,
.wbg-breakout-container *::after {
	box-sizing: border-box;
}

/* -------------------------------------------------- */
/* HUD (Punkte / Leben / Level / Bestwert)             */
/* -------------------------------------------------- */

.wbg-breakout-container .wbg-bo-hud {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px 20px;
	padding-bottom: 14px;
	margin-bottom: 14px;
	border-bottom: 1px solid var(--wbg-border);
}

.wbg-breakout-container .wbg-bo-hud-item {
	display: flex;
	align-items: baseline;
	gap: 6px;
	font-size: 14px;
}

.wbg-breakout-container .wbg-bo-hud-label {
	color: var(--wbg-muted);
	font-size: 13px;
}

.wbg-breakout-container .wbg-bo-hud-value {
	font-weight: 600;
	font-variant-numeric: tabular-nums;
	color: var(--wbg-text);
}

.wbg-breakout-container .wbg-bo-icon-btn {
	margin-left: auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	background: var(--wbg-surface);
	border: 1px solid var(--wbg-border);
	border-radius: 8px;
	font-size: 17px;
	line-height: 1;
	cursor: pointer;
	transition: background-color 0.15s ease, border-color 0.15s ease;
}

.wbg-breakout-container .wbg-bo-icon-btn:hover {
	background: #eef1f5;
}

.wbg-breakout-container .wbg-bo-icon-btn:focus-visible {
	outline: 2px solid var(--wbg-accent);
	outline-offset: 2px;
}

/* -------------------------------------------------- */
/* Spielbühne / Canvas                                 */
/* -------------------------------------------------- */

.wbg-breakout-container .wbg-bo-stage {
	position: relative;
	width: 100%;
	height: 580px;
	aspect-ratio: auto;
	background: var(--wbg-surface);
	border: 1px solid var(--wbg-border);
	border-radius: 8px;
	overflow: hidden;
	touch-action: none;
}

.wbg-breakout-container .wbg-bo-canvas {
	display: block;
	width: 100%;
	height: 100%;
}

.wbg-breakout-container .wbg-bo-overlay {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 24px;
	text-align: center;
	background: rgba(255, 255, 255, 0.92);
	backdrop-filter: blur(2px);
	transition: opacity 0.15s ease;
}

.wbg-breakout-container .wbg-bo-overlay[hidden] {
	display: none;
}

.wbg-breakout-container .wbg-bo-overlay-title {
	margin: 0;
	font-size: 22px;
	font-weight: 700;
	color: var(--wbg-text);
}

.wbg-breakout-container .wbg-bo-overlay-text {
	margin: 0 0 6px;
	font-size: 14px;
	color: var(--wbg-muted);
	max-width: 32ch;
}

/* -------------------------------------------------- */
/* Buttons                                             */
/* -------------------------------------------------- */

.wbg-breakout-container .wbg-bo-controls {
	display: flex;
	gap: 12px;
	margin-top: 16px;
}

.wbg-breakout-container .wbg-bo-btn {
	flex: 1 1 auto;
	min-height: 44px;
	padding: 10px 18px;
	background: var(--wbg-surface);
	border: 1px solid var(--wbg-border);
	border-radius: 8px;
	color: var(--wbg-text);
	font: inherit;
	font-weight: 600;
	font-size: 14px;
	cursor: pointer;
	transition: background-color 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}

.wbg-breakout-container .wbg-bo-btn:hover:not(:disabled) {
	background: #eef1f5;
}

.wbg-breakout-container .wbg-bo-btn:focus-visible {
	outline: 2px solid var(--wbg-accent);
	outline-offset: 2px;
}

.wbg-breakout-container .wbg-bo-btn:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.wbg-breakout-container .wbg-bo-btn-primary {
	flex: 0 0 auto;
	background: var(--wbg-accent);
	border-color: var(--wbg-accent);
	color: var(--wbg-accent-contrast);
	padding: 12px 28px;
}

.wbg-breakout-container .wbg-bo-btn-primary:hover {
	background: #275ed1;
	border-color: #275ed1;
}

/* -------------------------------------------------- */
/* Hinweistext / Noscript                              */
/* -------------------------------------------------- */

.wbg-breakout-container .wbg-bo-hint {
	margin: 14px 0 0;
	font-size: 12.5px;
	color: var(--wbg-muted);
	text-align: center;
}

.wbg-breakout-container .wbg-bo-noscript {
	margin-top: 12px;
	padding: 10px 14px;
	background: #fff4f4;
	border: 1px solid #f3c8c9;
	border-radius: 8px;
	color: var(--wbg-danger);
	font-size: 13px;
	text-align: center;
}

/* -------------------------------------------------- */
/* Responsive: Tablet                                  */
/* -------------------------------------------------- */

@media (max-width: 640px) {
	.wbg-breakout-container {
		padding: 16px;
		margin: 16px auto;
	}

	.wbg-breakout-container .wbg-bo-stage {
		aspect-ratio: 2 / 3;
	}
}

/* -------------------------------------------------- */
/* Responsive: Smartphone                              */
/* -------------------------------------------------- */

@media (max-width: 400px) {
	.wbg-breakout-container {
		padding: 12px;
		border-radius: 0;
		border-left: none;
		border-right: none;
	}

	.wbg-breakout-container .wbg-bo-hud {
		gap: 8px 14px;
		font-size: 13px;
	}

	.wbg-breakout-container .wbg-bo-hud-item {
		font-size: 13px;
	}

	.wbg-breakout-container .wbg-bo-controls {
		flex-direction: column;
	}

	.wbg-breakout-container .wbg-bo-btn {
		width: 100%;
	}
}

/* Reduzierte Bewegung respektieren. */
@media (prefers-reduced-motion: reduce) {
	.wbg-breakout-container .wbg-bo-overlay {
		transition: none;
	}
}
