/**
 * Fallblattanzeige — Tafel.
 * Alle Regeln liegen unter .fbz-board, damit nichts ins Theme ausläuft.
 */

.fbz-board {
	--fbz-cell-w: 24px;
	--fbz-cell-h: 34px;
	--fbz-font: 20px;
	--fbz-height: 70vh;
	/* Höhe der Trennfuge an der Walze. Im Theme überschreibbar. */
	--fbz-split: 0.5px;

	position: relative;
	width: 100%;
	height: var(--fbz-height);
	overflow: hidden;
	background: #0e0c0b;
	color: #f3f2f2;
	font-family: ui-sans-serif, system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	box-sizing: border-box;
}

.fbz-board *,
.fbz-board *::before,
.fbz-board *::after {
	box-sizing: border-box;
}

.fbz-board__stage {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 4px;
	width: 100%;
	height: 100%;
	padding: 2vh 1.4vw;
}

/* ---------------------------------------------------------------- */
/* Raster                                                            */
/* ---------------------------------------------------------------- */

.fbz-board__grid {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 4px;
}

.fbz-row {
	display: grid;
	grid-template-columns: repeat(var(--fbz-cols), var(--fbz-cell-w));
	gap: 2px;
	height: var(--fbz-cell-h);
	font-size: var(--fbz-font);
}

.fbz-cell {
	position: relative;
	width: 100%;
	height: 100%;
	overflow: hidden;
	background: #141211;
	perspective: 220px;
	box-shadow: inset 0 0 0 1px #100e0d;
}

.fbz-cell__half {
	position: absolute;
	left: 0;
	right: 0;
	height: 50%;
	overflow: hidden;
}

.fbz-cell__half > span {
	position: absolute;
	left: 0;
	right: 0;
	height: 200%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 600;
	line-height: 1;
	color: #f3f2f2;
	font-variant-numeric: tabular-nums;
	white-space: pre;
}

.fbz-cell__top {
	top: 0;
	background: linear-gradient(#1f1c1a, #171413);
	box-shadow: inset 0 -2px 5px rgba(0, 0, 0, 0.5);
}

.fbz-cell__top > span {
	top: 0;
}

.fbz-cell__bot {
	bottom: 0;
	background: linear-gradient(#302b28, #221f1d);
	box-shadow: inset 0 -1px 0 #0d0b0a;
}

.fbz-cell__bot > span {
	bottom: 0;
}

/* Die beiden bewegten Hälften hängen nur während des Umblätterns im Baum. */
.fbz-cell__front,
.fbz-cell__back {
	display: none;
	z-index: 3;
}

.fbz-cell.is-flipping .fbz-cell__front,
.fbz-cell.is-flipping .fbz-cell__back {
	display: block;
}

.fbz-cell__front {
	top: 0;
	background: linear-gradient(#443e3a, #312c29);
	box-shadow: inset 0 1px 0 #5c5551, 0 8px 16px rgba(0, 0, 0, 0.6);
	transform-origin: bottom center;
}

.fbz-cell__front > span {
	top: 0;
}

.fbz-cell__back {
	bottom: 0;
	background: linear-gradient(#332e2b, #241f1e);
	box-shadow: inset 0 -1px 0 #0d0b0a, 0 -8px 16px rgba(0, 0, 0, 0.55);
	transform-origin: top center;
}

.fbz-cell__back > span {
	bottom: 0;
}

/* Trennfuge und die beiden Achsstifte an den Seiten.
   Die Fuge ist bewusst nur ein halbes Pixel hoch: bei 2 px verschluckt sie den
   Mittelbalken von B, E oder H, und ein B sieht aus wie ein D. */
.fbz-cell__axis {
	position: absolute;
	left: 0;
	right: 0;
	top: calc(50% - (var(--fbz-split) / 2));
	height: var(--fbz-split);
	background: rgba(6, 5, 5, 0.9);
	z-index: 4;
}

.fbz-cell__axis::before,
.fbz-cell__axis::after {
	content: "";
	position: absolute;
	top: calc((var(--fbz-split) / 2) - 3px);
	width: 2px;
	height: 6px;
	background: #544d49;
	z-index: 5;
}

.fbz-cell__axis::before {
	left: 0;
}

.fbz-cell__axis::after {
	right: 0;
}

/* ---------------------------------------------------------------- */
/* QR-Feld                                                           */
/* ---------------------------------------------------------------- */

.fbz-board__qr {
	position: absolute;
	right: 1.4vw;
	bottom: 2vh;
	z-index: 20;
	display: flex;
	align-items: flex-end;
	gap: 12px;
}

.fbz-board__qr-text {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 4px;
	text-align: right;
	padding-bottom: 2px;
}

.fbz-board__qr-caption {
	font-size: 11px;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	color: #4d8dff;
	font-weight: 600;
}

.fbz-board__qr-hint {
	font-size: 11px;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: #7d7673;
}

.fbz-board__qr-code {
	display: block;
	background: #0d0b0a;
	padding: 8px;
	line-height: 0;
}

.fbz-board__qr-code svg {
	display: block;
	width: 96px;
	height: 96px;
}

/* ---------------------------------------------------------------- */
/* Ganzseitig — Tafel füllt das Browserfenster, Theme bleibt dahinter */
/* ---------------------------------------------------------------- */

html.fbz-fullpage,
body.fbz-fullpage {
	margin: 0 !important;
	padding: 0 !important;
	overflow: hidden !important;
	background: #0e0c0b !important;
	height: 100%;
}

.fbz-board--fullpage {
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	width: 100vw;
	height: 100vh;
	/* Auf Mobilgeräten die tatsächlich sichtbare Höhe, ohne Adressleiste. */
	height: 100dvh;
	z-index: 99990;
	/* Unter der WordPress-Werkzeugleiste, damit angemeldete Nutzer
	   die Seite noch verlassen können. */
}

.fbz-board:fullscreen {
	height: 100vh;
}

/* ---------------------------------------------------------------- */
/* Bedienung                                                         */
/* ---------------------------------------------------------------- */

.fbz-board__full {
	position: absolute;
	top: 12px;
	right: 12px;
	z-index: 21;
	appearance: none;
	border: 1px solid #3a3431;
	background: rgba(20, 18, 17, 0.8);
	color: #b8b2ae;
	font-size: 15px;
	line-height: 1;
	padding: 7px 9px;
	cursor: pointer;
	opacity: 0;
	transition: opacity 0.15s ease;
}

.fbz-board:hover .fbz-board__full,
.fbz-board__full:focus-visible {
	opacity: 1;
}

.fbz-board__full:focus-visible {
	outline: 2px solid #4d8dff;
	outline-offset: 2px;
}

/* Nur für Screenreader — die Tafel selbst ist reine Grafik. */
.fbz-board__reader {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

@media (max-width: 640px) {
	.fbz-board__qr {
		right: 8px;
		bottom: 8px;
		gap: 8px;
	}

	.fbz-board__qr-code svg {
		width: 64px;
		height: 64px;
	}

	.fbz-board__qr-text {
		display: none;
	}
}
