/* Bedburger Schachverein – kleines Brett und Partie-Vorschau. Paket zu style.css, geladen von inc/css-pakete.php
   (gebraucht von „Meine Partien“, „Partie einreichen“ und allem, was den Speichern-Dialog nutzt). */

/* ==========================================================================
   Kleines Brett mit der Endstellung (Farben wie das gewählte Brett)
   ========================================================================== */

.bsv-minibrett {
	--light: #e9eae2;
	--dark: #6b9ad4;
	display: grid;
	grid-template-columns: repeat(8, minmax(0, 1fr));
	grid-template-rows: repeat(8, minmax(0, 1fr));
	flex: none;
	width: 7rem;
	aspect-ratio: 1;
	border: 3px solid var(--bsv-black);
	border-radius: 5px;
	background: conic-gradient(var(--dark) 25%, var(--light) 0 50%, var(--dark) 0 75%, var(--light) 0) 0 0 / 25% 25%;
	box-shadow: 0 8px 18px -10px rgba(5, 14, 17, 0.55);
}

:root[data-brett="holz"] .bsv-minibrett {
	--light: #f0d9b5;
	--dark: #b58863;
}

:root[data-brett="gruen"] .bsv-minibrett {
	--light: #ebecd0;
	--dark: #739552;
}

:root[data-brett="kontrast"] .bsv-minibrett {
	--light: #ffffff;
	--dark: #7a7a7a;
}

.bsv-minibrett__f {
	display: block;
	background-position: center;
	background-repeat: no-repeat;
	background-size: 100% 100%;
}

.bsv-minibrett.is-leer {
	background: var(--bsv-paper);
}

/* ==========================================================================
   Vorschau einer geladenen Partie (Lichess-Link), assets/js/src/lichess-laden.js
   ========================================================================== */

.bsv-partievorschau {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr);
	gap: 0.85rem 1rem;
	align-items: start;
}

.bsv-partievorschau > .bsv-minibrett {
	width: 6.25rem;
}

.bsv-partievorschau__text {
	display: grid;
	gap: 0.2rem;
	min-width: 0;
}

.bsv-partievorschau .bsv-partievorschau__titel,
.bsv-partievorschau .bsv-partievorschau__spieler,
.bsv-partievorschau .bsv-partievorschau__event,
.bsv-partievorschau .bsv-partievorschau__meta,
.bsv-partievorschau .bsv-partievorschau__eroeffnung,
.bsv-partievorschau .bsv-partievorschau__notation {
	margin: 0;
}

.bsv-partievorschau .bsv-partievorschau__titel {
	display: flex;
	align-items: center;
	gap: 0.35rem;
	margin-bottom: 0.2rem;
	color: #1d7a3b;
	font-size: 0.8125rem;
	font-weight: 800;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.bsv-partievorschau__spieler {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.15rem 0.45rem;
	font-weight: 700;
	line-height: 1.3;
}

.bsv-partievorschau__farbe {
	flex: none;
	width: 0.8rem;
	height: 0.8rem;
	border: 1.5px solid var(--bsv-black);
	border-radius: 2px;
	background: var(--bsv-white);
}

.bsv-partievorschau__farbe.is-b {
	background: var(--bsv-black);
}

.bsv-partievorschau__name {
	min-width: 0;
	overflow-wrap: anywhere;
}

.bsv-partievorschau__elo {
	color: var(--bsv-muted);
	font-size: 0.875rem;
	font-weight: 500;
}

.bsv-partievorschau__event {
	font-weight: 700;
	overflow-wrap: anywhere;
}

.bsv-partievorschau .bsv-partievorschau__meta {
	margin-top: 0.25rem;
	color: var(--bsv-muted);
	font-size: 0.875rem;
	line-height: 1.5;
}

.bsv-partievorschau__erg {
	display: inline-block;
	margin-right: 0.45rem;
	padding: 0 0.45rem;
	border: 1px solid var(--bsv-black);
	border-radius: 999px;
	color: var(--bsv-ink);
	font-weight: 800;
	font-variant-numeric: tabular-nums;
}

.bsv-partievorschau__eroeffnung {
	color: var(--bsv-muted);
	font-size: 0.8125rem;
	font-style: italic;
	overflow-wrap: anywhere;
}

.bsv-partievorschau__notation {
	grid-column: 1 / -1;
	max-height: calc(5 * 1.75em + 1.2rem); /* fünf Zeilen, die sechste schaut nicht halb heraus */
	padding: 0.6rem 0.8rem;
	overflow-y: auto;
	border: 1px solid var(--bsv-line);
	border-radius: 6px;
	background: var(--bsv-white);
	font-size: 0.9375rem;
	line-height: 1.75;
	overscroll-behavior: contain;
}

.bsv-partievorschau__notation:focus-visible {
	outline: 2px solid var(--bsv-blue);
	outline-offset: 2px;
}

.bsv-partievorschau__zug {
	white-space: nowrap;
}

.bsv-partievorschau__zug b {
	color: var(--bsv-muted);
	font-weight: 700;
}

.bsv-partievorschau__zug.is-ende {
	font-weight: 800;
}

@media (max-width: 39.99em) {
	.bsv-partievorschau {
		gap: 0.7rem 0.8rem;
	}

	.bsv-partievorschau > .bsv-minibrett {
		width: 5rem;
		border-width: 2px;
	}
}
