.cbw-board {
	height: 100%;
	aspect-ratio: 1 / 1;
	position: relative; /* required for absolute layers */
	border-radius: 10px;
	overflow: hidden;
	user-select: none;
	transition: 0.25s ease;

	border: 1px solid rgba(255, 255, 255, 0.08);
	box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}

.cbw-squares-layer {
	position: absolute;
	inset: 0;
	display: grid;
	grid-template-columns: repeat(8, 1fr);
}

.cbw-pieces-layer {
	position: absolute;
	inset: 0;
	pointer-events: none;
	z-index: 2;
}

.cbw-square {
	display: flex;
	align-items: center;
	cursor: pointer;
	font-size: clamp(18px, 2.5vw, 34px);
	aspect-ratio: 1 / 1;
	transition: 0.18s ease;
}

.cbw-square:hover {
	filter: brightness(1.1);
}

.cbw-light {
	background: #214da5;
}

.cbw-dark {
	background: #4f78d0;
}

.cbw-square.cbw-selected {
	outline: 3px solid rgba(124, 169, 255, 0.85);
	outline-offset: -3px;
}

.cbw-square.cbw-legal {
	box-shadow: inset 0 0 0 3px rgba(52, 211, 153, 0.55);
}

.cbw-square.cbw-last {
	box-shadow: inset 0 0 0 3px rgba(56, 189, 248, 0.55);
}

.cbw-piece {
	position: absolute;
	width: 12.5%;
	height: 12.5%;
	left: 0;
	top: 0;
	padding: 0;
	box-sizing: border-box;

	object-fit: contain;
	transform: scale(0.9);
	transform-origin: center;

	transition: left 180ms ease, top 180ms ease;
	filter: drop-shadow(0 10px 14px rgba(0, 0, 0, 0.35));
	pointer-events: none;
}

.cbw-piece-fallback {
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: clamp(18px, 2.5vw, 34px);
	line-height: 1;
}

/* disable animation for PGN jumps / reset / flip */
.cbw-no-anim .cbw-piece {
	transition: none !important;
}
