/*
 * Flappy Bird Game – Plugin-Stylesheet
 * Alle Regeln sind auf ".fbg-container" gekapselt, um Konflikte mit dem
 * aktiven WordPress-Theme zu vermeiden. Es wird bewusst KEINE eigene
 * Schriftart geladen – font-family wird vom Theme geerbt.
 */

.fbg-container {
	/* --- Farbpalette (bläuliche, ruhige Töne) --- */
	--fbg-blue-900: #10305c;
	--fbg-blue-700: #1e56a8;
	--fbg-blue-600: #2f6fe0;
	--fbg-blue-500: #3b82f6;
	--fbg-blue-100: #e8f0fe;
	--fbg-blue-50: #f4f8fe;
	--fbg-sky-top: #cfe6fb;
	--fbg-sky-bottom: #eef7ff;
	--fbg-surface: #ffffff;
	--fbg-border: #dce7f5;
	--fbg-text: #1f2a3c;
	--fbg-text-muted: #5b6b82;
	--fbg-success: #1fa971;
	--fbg-danger: #e0563f;
	--fbg-radius-lg: 18px;
	--fbg-radius-md: 12px;
	--fbg-radius-sm: 8px;
	--fbg-shadow: 0 10px 30px rgba(16, 48, 92, 0.10);
	--fbg-shadow-sm: 0 2px 8px rgba(16, 48, 92, 0.08);

	box-sizing: border-box;
	max-width: 560px;
	margin: 0 auto;
	color: var(--fbg-text);
	/* Schrift bewusst NICHT gesetzt -> Theme-Typografie wird übernommen. */
}

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

/* --- Karte / Rahmen --- */
.fbg-card {
	background: var(--fbg-surface);
	border: 1px solid var(--fbg-border);
	border-radius: var(--fbg-radius-lg);
	box-shadow: var(--fbg-shadow);
	padding: 20px;
	overflow: hidden;
}

/* --- Kopfzeile --- */
.fbg-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 14px;
}

.fbg-title {
	margin: 0;
	font-size: 1.15em;
	font-weight: 700;
	letter-spacing: 0.01em;
	color: var(--fbg-blue-900);
	line-height: 1.2;
}

.fbg-icon-btn {
	appearance: none;
	background: var(--fbg-blue-50);
	border: 1px solid var(--fbg-border);
	border-radius: 999px;
	width: 40px;
	height: 40px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: background-color 0.15s ease, transform 0.1s ease;
	flex: 0 0 auto;
}

.fbg-icon-btn:hover {
	background: var(--fbg-blue-100);
}

.fbg-icon-btn:active {
	transform: scale(0.94);
}

.fbg-icon-btn:focus-visible {
	outline: 2px solid var(--fbg-blue-500);
	outline-offset: 2px;
}

.fbg-icon {
	width: 18px;
	height: 18px;
	display: block;
	background-color: var(--fbg-blue-700);
	-webkit-mask-repeat: no-repeat;
	mask-repeat: no-repeat;
	-webkit-mask-position: center;
	mask-position: center;
	-webkit-mask-size: contain;
	mask-size: contain;
}

.fbg-icon-sound-on {
	-webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M4 9v6h4l5 5V4L8 9H4z'/><path d='M16.5 8.5a5 5 0 010 7' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'/><path d='M19 6a9 9 0 010 12' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'/></svg>");
	mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M4 9v6h4l5 5V4L8 9H4z'/><path d='M16.5 8.5a5 5 0 010 7' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'/><path d='M19 6a9 9 0 010 12' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'/></svg>");
}

.fbg-icon-sound-off {
	-webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M4 9v6h4l5 5V4L8 9H4z'/><path d='M16 9l5 6M21 9l-5 6' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'/></svg>");
	mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M4 9v6h4l5 5V4L8 9H4z'/><path d='M16 9l5 6M21 9l-5 6' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'/></svg>");
	display: none;
}

.fbg-icon-btn[aria-pressed="false"] .fbg-icon-sound-on {
	display: none;
}
.fbg-icon-btn[aria-pressed="false"] .fbg-icon-sound-off {
	display: block;
}

/* --- Statistik-Leiste --- */
.fbg-stats {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 8px;
	background: var(--fbg-blue-50);
	border: 1px solid var(--fbg-border);
	border-radius: var(--fbg-radius-md);
	padding: 10px 6px;
	margin-bottom: 14px;
}

.fbg-stat {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	padding: 2px 4px;
	position: relative;
}

.fbg-stat:not(:last-child)::after {
	content: "";
	position: absolute;
	right: 0;
	top: 10%;
	bottom: 10%;
	width: 1px;
	background: var(--fbg-border);
}

.fbg-stat-label {
	font-size: 0.72em;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--fbg-text-muted);
	margin-bottom: 2px;
}

.fbg-stat-value {
	font-size: 1.15em;
	font-weight: 700;
	color: var(--fbg-blue-900);
	font-variant-numeric: tabular-nums;
}

/* --- Spielfläche --- */
.fbg-stage {
	position: relative;
	width: 100%;
	aspect-ratio: 3 / 4;
	border-radius: var(--fbg-radius-md);
	overflow: hidden;
	border: 1px solid var(--fbg-border);
	background: linear-gradient(to bottom, var(--fbg-sky-top), var(--fbg-sky-bottom));
	touch-action: manipulation;
}

.fbg-canvas {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	display: block;
	cursor: pointer;
}

/* --- Overlays (Start / Pause / Ende) --- */
.fbg-overlay {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	background: linear-gradient(180deg, rgba(16, 48, 92, 0.55), rgba(16, 48, 92, 0.72));
	backdrop-filter: blur(2px);
	text-align: center;
	transition: opacity 0.18s ease;
}

.fbg-overlay-light {
	background: rgba(244, 248, 254, 0.92);
	backdrop-filter: blur(3px);
}

.fbg-overlay.is-hidden {
	display: none;
}

.fbg-overlay-inner {
	background: var(--fbg-surface);
	border: 1px solid var(--fbg-border);
	border-radius: var(--fbg-radius-lg);
	box-shadow: var(--fbg-shadow);
	padding: 24px 20px;
	width: 100%;
	max-width: 320px;
}

.fbg-overlay-title {
	margin: 0 0 6px;
	font-size: 1.2em;
	font-weight: 700;
	color: var(--fbg-blue-900);
}

.fbg-overlay-text {
	margin: 0 0 16px;
	font-size: 0.92em;
	color: var(--fbg-text-muted);
	line-height: 1.4;
}

.fbg-hint {
	margin: 14px 0 0;
	font-size: 0.8em;
	color: var(--fbg-text-muted);
}

/* --- Schwierigkeitsgrad-Auswahl --- */
.fbg-difficulty {
	display: flex;
	gap: 8px;
	justify-content: center;
	margin-bottom: 18px;
	flex-wrap: wrap;
}

.fbg-chip {
	appearance: none;
	background: var(--fbg-blue-50);
	border: 1px solid var(--fbg-border);
	color: var(--fbg-blue-700);
	font-size: 0.85em;
	font-weight: 600;
	padding: 8px 14px;
	border-radius: 999px;
	cursor: pointer;
	transition: all 0.15s ease;
}

.fbg-chip:hover {
	background: var(--fbg-blue-100);
}

.fbg-chip.is-active {
	background: var(--fbg-blue-600);
	border-color: var(--fbg-blue-600);
	color: #ffffff;
}

.fbg-chip:focus-visible {
	outline: 2px solid var(--fbg-blue-500);
	outline-offset: 2px;
}

/* --- Buttons --- */
.fbg-btn {
	appearance: none;
	border-radius: var(--fbg-radius-sm);
	border: 1px solid var(--fbg-border);
	background: var(--fbg-surface);
	color: var(--fbg-blue-700);
	font-size: 0.92em;
	font-weight: 600;
	padding: 10px 18px;
	cursor: pointer;
	transition: transform 0.08s ease, background-color 0.15s ease, box-shadow 0.15s ease;
	line-height: 1.2;
}

.fbg-btn:hover {
	background: var(--fbg-blue-50);
}

.fbg-btn:active {
	transform: scale(0.97);
}

.fbg-btn:focus-visible {
	outline: 2px solid var(--fbg-blue-500);
	outline-offset: 2px;
}

.fbg-btn:disabled {
	opacity: 0.45;
	cursor: not-allowed;
}

.fbg-btn-primary {
	background: var(--fbg-blue-600);
	border-color: var(--fbg-blue-600);
	color: #ffffff;
	box-shadow: var(--fbg-shadow-sm);
}

.fbg-btn-primary:hover {
	background: var(--fbg-blue-700);
}

.fbg-btn-large {
	width: 100%;
	padding: 12px 18px;
	font-size: 1em;
}

.fbg-btn-ghost {
	background: transparent;
}

/* --- Steuerleiste --- */
.fbg-controls {
	display: flex;
	gap: 10px;
	margin-top: 14px;
}

.fbg-controls .fbg-btn {
	flex: 1 1 0;
}

/* --- Game-Over-Popup --- */
.fbg-popup-emoji {
	font-size: 2.2em;
	margin: 0 0 6px;
	line-height: 1;
}

.fbg-popup-stats {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 18px;
	background: var(--fbg-blue-50);
	border: 1px solid var(--fbg-border);
	border-radius: var(--fbg-radius-md);
	padding: 12px 10px;
	margin-bottom: 18px;
}

.fbg-popup-stat {
	display: flex;
	flex-direction: column;
	align-items: center;
}

.fbg-popup-divider {
	width: 1px;
	align-self: stretch;
	background: var(--fbg-border);
}

/* --- Responsive Anpassungen --- */
@media (max-width: 480px) {
	.fbg-card {
		padding: 14px;
		border-radius: var(--fbg-radius-md);
	}

	.fbg-title {
		font-size: 1.05em;
	}

	.fbg-stat-value {
		font-size: 1em;
	}

	.fbg-stage {
		aspect-ratio: 2 / 3;
	}

	.fbg-controls {
		flex-direction: row;
	}

	.fbg-btn {
		padding: 10px 12px;
		font-size: 0.88em;
	}
}

@media (min-width: 900px) {
	.fbg-container {
		max-width: 620px;
	}
}

/* Reduzierte Bewegung respektieren */
@media (prefers-reduced-motion: reduce) {
	.fbg-container * {
		transition: none !important;
	}
}
