.rs-lesson-board {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
	gap: 20px;
	align-items: start;
	width: 100%;
}

.rs-lesson-board__panel {
	min-width: 0;
	background: #f8fbff;
	border: 1px solid #e5ebff;
	border-radius: 22px;
	padding: 16px;
	box-sizing: border-box;
	width: 100%;
	overflow: hidden;
}

.rs-lesson-board__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-bottom: 14px;
}

.rs-lesson-pill {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: #eef2ff;
	color: #4338ca;
	border-radius: 999px;
	padding: 7px 12px;
	font-size: 13px;
	font-weight: 700;
	max-width: 100%;
	white-space: nowrap;
	line-height: 1.3;
}

.rs-lesson-status {
	margin-top: 14px;
	color: var(--rs-color-text-soft);
	font-size: 14px;
	line-height: 1.6;
}

.rs-real-board {
	display: grid;
	grid-template-columns: repeat(8, minmax(0, 1fr));
	width: 100%;
	max-width: 100%;
	margin: 0 auto;
	border: 8px solid #d7c5a1;
	border-radius: 16px;
	overflow: hidden;
	box-shadow: 0 16px 36px rgba(59, 51, 30, 0.16);
	background: #d7c5a1;
	aspect-ratio: 1 / 1;
	box-sizing: border-box;
}

.rs-square {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	aspect-ratio: 1 / 1;
	cursor: pointer;
	user-select: none;
	transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
	padding: 0;
	border: 0;
	min-width: 0;
	min-height: 0;
	-webkit-appearance: none;
	appearance: none;
	box-sizing: border-box;
}

.rs-square--light {
	background: #f2dfc2;
}

.rs-square--dark {
	background: #b58863;
}

.rs-square--selected {
	box-shadow: inset 0 0 0 4px rgba(79, 70, 229, 0.95);
}

.rs-square--target::after {
	content: "";
	position: absolute;
	width: 24%;
	height: 24%;
	border-radius: 999px;
	background: rgba(34, 197, 94, 0.82);
}

.rs-square--capture::after {
	content: "";
	position: absolute;
	inset: 8%;
	border-radius: 999px;
	border: 4px solid rgba(239, 68, 68, 0.9);
}

.rs-square__coord {
	position: absolute;
	font-size: 10px;
	font-weight: 700;
	opacity: 0.72;
	pointer-events: none;
	color: rgba(255,255,255,.9);
}

.rs-square--light .rs-square__coord {
	color: rgba(60,45,25,.7);
}

.rs-square__coord--file {
	right: 6px;
	bottom: 4px;
}

.rs-square__coord--rank {
	left: 6px;
	top: 4px;
}

.rs-piece {
	display: block;
	width: 76%;
	height: 76%;
	max-width: 76%;
	max-height: 76%;
	object-fit: contain;
	pointer-events: none;
	user-select: none;
	-webkit-user-drag: none;
	filter: none;
	opacity: 1;
}

.rs-lesson-board__instruction {
	background: #ffffff;
	border: 1px solid #e8ecfb;
	border-radius: 16px;
	padding: 14px;
	margin-bottom: 14px;
	box-sizing: border-box;
}

.rs-lesson-board__instruction-title {
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .04em;
	color: #6b7280;
	margin-bottom: 8px;
}

.rs-lesson-board__instruction-text {
	font-size: 15px;
	color: #1f2937;
	line-height: 1.7;
	white-space: pre-wrap;
	word-break: break-word;
}

/* ALIGNMENT CORECT CU JS */
.rs-lesson-board__instruction--help {
	background: linear-gradient(180deg, #fffefc 0%, #f7f2ff 100%);
	border: 1px solid #e9defd;
	box-shadow: 0 12px 28px rgba(80, 62, 145, 0.08);
}

.rs-lesson-board__instruction--help .rs-lesson-board__instruction-title {
	color: #5b21b6;
}

.rs-lesson-board__instruction--help .rs-lesson-board__instruction-text {
	color: #5b5875;
}

.rs-lesson-board__help-hint {
	margin: 0 0 12px;
	font-size: 14px;
	line-height: 1.65;
	color: #5b5875;
}

.rs-lesson-board__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 14px;
}

.rs-lesson-board__button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 10px 16px;
	border-radius: 999px;
	border: 1px solid #dbe4ff;
	background: #fff;
	color: #34406d;
	font-weight: 700;
	cursor: pointer;
	transition: all .2s ease;
	min-height: 44px;
}

.rs-lesson-board__button:hover {
	background: #eef2ff;
}

.rs-lesson-board__button--help {
	width: 100%;
	background: linear-gradient(135deg, #7c3aed 0%, #4f46e5 100%);
	border-color: transparent;
	color: #ffffff;
	box-shadow: 0 12px 24px rgba(79, 70, 229, 0.22);
}

.rs-lesson-board__button--help:hover {
	background: linear-gradient(135deg, #6d28d9 0%, #4338ca 100%);
	color: #ffffff;
}

/* HELP MODAL */
.rs-help-modal__dialog {
	width: min(92vw, 640px);
}

.rs-help-modal__message {
	font-size: 17px;
	line-height: 1.85;
	color: #2f2a52;
	white-space: pre-wrap;
}

/* MODAL SYSTEM */
.rs-reward-modal {
	position: fixed;
	inset: 0;
	z-index: 9999;
	display: none;
}

.rs-reward-modal.is-open {
	display: block;
}

.rs-reward-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(15, 23, 42, 0.6);
	backdrop-filter: blur(4px);
}

.rs-reward-modal__dialog {
	position: relative;
	z-index: 2;
	width: min(92vw, 760px);
	max-height: 88vh;
	overflow: auto;
	margin: 6vh auto 0;
	background: linear-gradient(180deg, #fffefc 0%, #f9f5ff 100%);
	border: 1px solid #efe3ff;
	border-radius: 28px;
	padding: 28px;
	box-shadow: 0 28px 70px rgba(49, 31, 98, 0.28);
}

.rs-reward-modal__close {
	position: absolute;
	top: 14px;
	right: 14px;
	width: 42px;
	height: 42px;
	border: 0;
	border-radius: 999px;
	background: #f3edff;
	color: #4c1d95;
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
}

.rs-reward-modal__header {
	margin-bottom: 18px;
	padding-right: 42px;
}

.rs-reward-modal__eyebrow {
	font-size: 12px;
	font-weight: 800;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: #7c3aed;
	margin-bottom: 8px;
}

.rs-reward-modal__list {
	display: grid;
	gap: 14px;
}

.rs-reward-unlock-card {
	display: grid;
	grid-template-columns: 72px minmax(0, 1fr);
	gap: 14px;
	padding: 16px;
	border-radius: 22px;
	border: 1px solid #e9defd;
	background: #ffffff;
}

.rs-reward-unlock-card--trophy {
	border-color: #f2d489;
	background: linear-gradient(180deg, #fff8ea 0%, #fff3d7 100%);
}

.rs-reward-unlock-card--badge {
	border-color: #e8ddff;
	background: linear-gradient(180deg, #fbf8ff 0%, #f6f1ff 100%);
}

.rs-reward-unlock-card__icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 72px;
	height: 72px;
	border-radius: 20px;
	background: rgba(255,255,255,0.7);
	font-size: 36px;
}

.rs-reward-unlock-card__image {
	display: block;
	width: 52px;
	height: 52px;
	object-fit: contain;
}

.rs-reward-unlock-card__emoji {
	line-height: 1;
}

.rs-reward-unlock-card__type {
	font-size: 12px;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: .05em;
	color: #7c3aed;
	margin-bottom: 6px;
}

.rs-reward-unlock-card__title {
	font-size: 20px;
	font-weight: 800;
	color: #241b4b;
	margin-bottom: 6px;
}

.rs-reward-unlock-card__description {
	font-size: 14px;
	line-height: 1.65;
	color: #5b5875;
}

.rs-reward-unlock-card__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 10px;
}

.rs-reward-unlock-pill {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 6px 10px;
	border-radius: 999px;
	background: #efeaff;
	color: #4f46e5;
	font-size: 12px;
	font-weight: 700;
}

.rs-reward-unlock-pill--rarity {
	background: #fff5de;
	color: #9a6700;
}

.rs-reward-modal__actions {
	display: flex;
	justify-content: center;
	margin-top: 22px;
}

body.rs-reward-modal-open {
	overflow: hidden;
}

@media (max-width: 1080px) {
	.rs-lesson-board {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 768px) {
	#rs-lesson-board-wrap {
		width: 100%;
		max-width: 100%;
		overflow: hidden;
	}

	.rs-lesson-board {
		grid-template-columns: 1fr;
		gap: 14px;
		width: 100%;
	}

	.rs-lesson-board__panel {
		padding: 12px;
		border-radius: 18px;
		width: 100%;
		max-width: 100%;
	}

	.rs-lesson-board__meta {
		display: grid;
		grid-template-columns: 1fr;
		gap: 8px;
	}

	.rs-lesson-pill {
		width: 100%;
		justify-content: center;
		text-align: center;
		white-space: normal;
		font-size: 12px;
		padding: 8px 10px;
	}

	.rs-real-board {
		width: 100%;
		max-width: 100%;
		border-width: 6px;
		border-radius: 14px;
	}

	.rs-piece {
		width: 82%;
		height: 82%;
		max-width: 82%;
		max-height: 82%;
	}

	.rs-square__coord {
		font-size: 8px;
	}

	.rs-lesson-board__instruction {
		padding: 12px;
	}

	.rs-lesson-board__instruction-text {
		font-size: 14px;
	}

	.rs-help-modal__message {
		font-size: 16px;
	}

	.rs-reward-modal__dialog {
		width: min(94vw, 760px);
		padding: 20px;
		margin-top: 4vh;
		border-radius: 22px;
	}

	.rs-reward-unlock-card {
		grid-template-columns: 1fr;
	}

	.rs-reward-unlock-card__icon {
		width: 64px;
		height: 64px;
	}
}

@media (max-width: 480px) {
	.rs-lesson-board__panel {
		padding: 10px;
		border-radius: 16px;
	}

	.rs-real-board {
		border-width: 5px;
		border-radius: 12px;
	}

	.rs-piece {
		width: 86%;
		height: 86%;
		max-width: 86%;
		max-height: 86%;
	}

	.rs-square__coord {
		font-size: 7px;
	}

	.rs-lesson-pill {
		font-size: 11px;
		padding: 7px 8px;
	}

	.rs-lesson-board__instruction-title {
		font-size: 11px;
	}

	.rs-lesson-board__instruction-text {
		font-size: 13px;
		line-height: 1.6;
	}

	.rs-help-modal__message {
		font-size: 15px;
	}

	.rs-reward-modal__dialog {
		padding: 16px;
	}

	.rs-reward-unlock-card__title {
		font-size: 18px;
	}
}
/* v1.3.3 — Threatened pieces and checkmate animation */
.rs-square--threatened::before {
	content: "";
	position: absolute;
	inset: 8%;
	border-radius: 999px;
	border: 4px solid rgba(239, 68, 68, 0.9);
	box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.16), 0 0 18px rgba(239, 68, 68, 0.35);
	pointer-events: none;
	z-index: 2;
}

.rs-square--threatened .rs-piece {
	filter: drop-shadow(0 0 10px rgba(239, 68, 68, 0.65));
}

.rs-mate-burst {
	position: absolute;
	left: 50%;
	top: -14%;
	transform: translate(-50%, -50%) scale(0.92);
	z-index: 5;
	padding: 8px 14px;
	border-radius: 999px;
	background: linear-gradient(135deg, #fff7ed 0%, #f97316 48%, #7c2d12 100%);
	border: 3px solid rgba(255, 255, 255, 0.92);
	box-shadow: 0 10px 28px rgba(124, 45, 18, 0.45), 0 0 0 7px rgba(249, 115, 22, 0.18);
	color: #fff;
	font-weight: 1000;
	font-size: clamp(13px, 2.4vw, 22px);
	letter-spacing: .09em;
	text-shadow: 0 2px 4px rgba(0,0,0,.26);
	pointer-events: none;
	animation: rsMateBurst 1.25s ease-in-out 2;
}

@keyframes rsMateBurst {
	0% { transform: translate(-50%, -50%) scale(.55) rotate(-7deg); opacity: 0; }
	22% { transform: translate(-50%, -70%) scale(1.18) rotate(4deg); opacity: 1; }
	55% { transform: translate(-50%, -62%) scale(1) rotate(-2deg); opacity: 1; }
	100% { transform: translate(-50%, -50%) scale(.96) rotate(0deg); opacity: .92; }
}


/* v1.3.4.1 — Threatened-piece markers disabled after UX/pedagogy review.
   Capture markers after selecting a piece remain unchanged. */
.rs-square--threatened::before {
	display: none !important;
	content: none !important;
	border: 0 !important;
	box-shadow: none !important;
}
.rs-square--threatened .rs-piece {
	filter: none !important;
}

/* v1.3.8 — Lesson audio card */
.rs-lesson-audio-card {
	background: linear-gradient(135deg, rgba(255,255,255,.96), rgba(247,238,255,.92));
	border: 1px solid rgba(116, 58, 213, .16);
	box-shadow: 0 18px 42px rgba(79, 70, 229, .10);
}
.rs-lesson-audio-card__content {
	display: grid;
	grid-template-columns: minmax(0, 1.45fr) minmax(260px, .75fr);
	gap: 18px;
	align-items: center;
}
.rs-lesson-audio-card__controls {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
	justify-content: flex-end;
	align-items: center;
}
.rs-lesson-audio-card__controls .rs-btn {
	white-space: nowrap;
}
#rs-lesson-main-action {
	position: relative;
	top: -12px;
}
@media (max-width: 760px) {
	.rs-lesson-audio-card__content {
		grid-template-columns: 1fr;
	}
	.rs-lesson-audio-card__controls {
		justify-content: flex-start;
	}
	.rs-lesson-audio-card__controls .rs-btn {
		width: 100%;
		justify-content: center;
	}
}
