/* Traditional Xiangqi board — intersection SVG + piece overlay */

.lvtg2-board-screen {
	max-width: 1100px;
	animation: lvtg2-fade-in 0.25s ease;
}

.lvtg2-board-header {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 0.75rem 1rem;
	margin-bottom: 0.85rem;
	flex-wrap: nowrap;
}

.lvtg2-board-header__main {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0.35rem 0.55rem;
	min-width: 0;
	flex: 1 1 auto;
}

.lvtg2-board-turn {
	flex: 1 1 100%;
	font-weight: 700;
	color: var(--lvtg2-accent, #9a3412);
}

/* Desktop: board dominant + slim sidebar */
.lvtg2-board-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(180px, 220px);
	grid-template-areas:
		"board meta"
		"board meta"
		"board meta";
	gap: 0.65rem 1rem;
	align-items: start;
}

.lvtg2-board-side--top,
.lvtg2-board-side--bottom {
	display: none;
}

.lvtg2-board-wrap { grid-area: board; position: relative; }
.lvtg2-board-meta { grid-area: meta; }

.lvtg2-meta-seats--desktop {
	display: grid;
	gap: 0.45rem;
	margin-bottom: 0.65rem;
}

.lvtg2-meta-heading {
	margin: 0.5rem 0 0.25rem;
	font-size: 0.78rem;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--lvtg2-muted, #7a7166);
}

.lvtg2-seat {
	display: flex;
	align-items: center;
	gap: 0.45rem;
	font-weight: 600;
	flex-wrap: wrap;
}

.lvtg2-seat__avatar {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	object-fit: cover;
	border: 1px solid var(--lvtg2-border, #e4d9c8);
	background: #efe6d8;
	flex-shrink: 0;
}

.lvtg2-seat__avatar--sm {
	width: 28px;
	height: 28px;
}

.lvtg2-seat__avatar[hidden],
.lvtg2-seat__initial[hidden] {
	display: none !important;
}

.lvtg2-seat__initial {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	border: 1px solid var(--lvtg2-border, #e4d9c8);
	background: #efe6d8;
	color: var(--lvtg2-accent, #9a3412);
	font-size: 0.95rem;
	font-weight: 700;
	flex-shrink: 0;
	line-height: 1;
}

.lvtg2-seat__initial--sm {
	width: 28px;
	height: 28px;
	font-size: 0.75rem;
}

.lvtg2-seat__label {
	font-size: 0.8rem;
	color: var(--lvtg2-muted, #7a7166);
	font-weight: 500;
}

.lvtg2-seat__dot {
	width: 0.7rem;
	height: 0.7rem;
	border-radius: 50%;
	display: inline-block;
	flex-shrink: 0;
}

.lvtg2-seat__dot--red { background: #b91c1c; }
.lvtg2-seat__dot--black { background: #1c1917; }

.lvtg2-online {
	font-size: 0.78rem;
	font-weight: 500;
	margin-left: 0.15rem;
}

.lvtg2-online--on::before,
.lvtg2-conn--on::before,
.lvtg2-online--off::before,
.lvtg2-conn--off::before {
	content: "";
	display: inline-block;
	width: 0.55rem;
	height: 0.55rem;
	margin-right: 0.3rem;
	border-radius: 50%;
	vertical-align: middle;
}

.lvtg2-online--on::before,
.lvtg2-conn--on::before { background: #16a34a; }

.lvtg2-online--off::before,
.lvtg2-conn--off::before { background: #a8a29e; }

.lvtg2-online--on,
.lvtg2-conn--on { color: #166534; }

.lvtg2-online--off,
.lvtg2-conn--off { color: #78716c; }

.lvtg2-conn {
	margin: 0.25rem 0 0.5rem;
	font-size: 0.85rem;
}

.lvtg2-draw-status,
.lvtg2-handicap-status,
.lvtg2-rematch-status {
	margin: 0 0 0.5rem;
	padding: 0.45rem 0.6rem;
	border-radius: 8px;
	background: #fff7ed;
	border: 1px solid #fdba74;
	font-size: 0.85rem;
	font-weight: 600;
}

.lvtg2-handicap-status {
	background: #eff6ff;
	border-color: #93c5fd;
	color: #1e3a8a;
}

.lvtg2-rematch-status {
	background: #ecfdf5;
	border-color: #6ee7b7;
	color: #065f46;
}

.lvtg2-turn-setup {
	margin: 1rem 0;
	padding: 0.85rem 0.9rem;
	border: 1px solid var(--lvtg2-border, #e4d9c8);
	border-radius: 12px;
	background: #fffdf8;
	display: grid;
	gap: 0.55rem;
}

.lvtg2-turn-setup--board {
	margin: 0 0 0.75rem;
}

.lvtg2-turn-setup__field {
	margin: 0;
}

.lvtg2-turn-setup__select {
	width: 100%;
	max-width: 12rem;
	padding: 0.5rem 0.65rem;
	border: 1px solid var(--lvtg2-border, #e4d9c8);
	border-radius: 8px;
	background: #fff;
	font: inherit;
}

.lvtg2-turn-clock {
	display: inline-flex;
	align-items: baseline;
	justify-content: flex-end;
	gap: 0.4rem;
	margin-left: auto;
	flex: 0 0 auto;
	padding: 0.4rem 0.75rem;
	border-radius: 999px;
	background: #fff7ed;
	border: 1px solid #fdba74;
	color: #9a3412;
	font-size: 0.95rem;
	line-height: 1.2;
	white-space: nowrap;
}

.lvtg2-turn-clock[hidden] {
	display: none !important;
}

.lvtg2-turn-clock.is-urgent {
	background: #fef2f2;
	border-color: #fca5a5;
	color: #b91c1c;
	animation: lvtg2-turn-blink 0.7s ease-in-out infinite;
}

.lvtg2-turn-clock__label {
	font-size: 0.78rem;
	font-weight: 600;
	opacity: 0.85;
}

.lvtg2-turn-clock__value {
	font-size: 1.15rem;
	font-weight: 800;
	font-variant-numeric: tabular-nums;
	letter-spacing: 0.04em;
	min-width: 2.75rem;
	text-align: right;
}

@keyframes lvtg2-turn-blink {
	0%,
	100% {
		opacity: 1;
		transform: scale(1);
		box-shadow: 0 0 0 0 rgba(185, 28, 28, 0.2);
	}
	50% {
		opacity: 0.45;
		transform: scale(1.04);
		box-shadow: 0 0 0 4px rgba(185, 28, 28, 0.12);
	}
}

.lvtg2-role-line {
	margin: 0;
	font-size: 0.92rem;
	font-weight: 600;
}

/* —— Board shell —— */
.lvtg2-board-wrap {
	width: 100%;
	max-width: min(100%, 600px);
	margin: 0 auto;
}

.lvtg2-board {
	position: relative;
	width: min(96vw, 600px);
	max-width: 100%;
	aspect-ratio: 9 / 10;
	margin: 0 auto;
	touch-action: none;
	user-select: none;
	-webkit-user-select: none;
}

.lvtg2-board__svg {
	display: block;
	width: 100%;
	height: 100%;
	border-radius: 10px;
	pointer-events: none;
	box-shadow:
		0 1px 0 rgba(255, 255, 255, 0.35) inset,
		0 10px 28px rgba(60, 40, 10, 0.18);
}

.lvtg2-board-bg {
	fill: url(#lvtg2-wood);
	stroke: #6b4f2a;
	stroke-width: 3;
}

.lvtg2-board-frame {
	stroke: #5a3f22;
	stroke-width: 2.4;
}

.lvtg2-board-river {
	fill: url(#lvtg2-river-grad);
	opacity: 0.92;
}

.lvtg2-board-line {
	stroke: #4a3420;
	stroke-width: 1.65;
	stroke-linecap: square;
	fill: none;
}

.lvtg2-board-line--palace {
	stroke-width: 1.5;
}

.lvtg2-board-line--mark {
	stroke-width: 1.4;
	stroke: #4a3420;
}

.lvtg2-board-river-text text {
	fill: rgba(70, 45, 20, 0.55);
	font-size: 34px;
	font-family: "STKaiti", "KaiTi", "Kaiti SC", "Noto Serif SC", "Songti SC", "SimSun", serif;
	font-weight: 600;
	letter-spacing: 0.28em;
	pointer-events: none;
}

.lvtg2-board__points {
	position: absolute;
	inset: 0;
	z-index: 2;
	pointer-events: auto;
}

/* Intersection hit targets — centered on SVG coords */
.lvtg2-point {
	appearance: none;
	position: absolute;
	width: 12.5%;
	height: 11%;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	transform: translate(-50%, -50%);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 1;
	-webkit-tap-highlight-color: transparent;
	touch-action: manipulation;
}

.lvtg2-point:focus-visible {
	outline: 2px solid rgba(154, 52, 18, 0.55);
	outline-offset: 2px;
	border-radius: 50%;
}

.lvtg2-point--last::after {
	content: "";
	position: absolute;
	inset: 18%;
	border-radius: 50%;
	border: 2px solid rgba(154, 52, 18, 0.45);
	pointer-events: none;
	z-index: 0;
}

.lvtg2-point--selected::after {
	content: "";
	position: absolute;
	inset: 12%;
	border-radius: 50%;
	box-shadow: 0 0 0 2px rgba(154, 52, 18, 0.7), 0 0 12px rgba(154, 52, 18, 0.35);
	pointer-events: none;
	z-index: 0;
}

.lvtg2-point--check::before {
	content: "";
	position: absolute;
	inset: 8%;
	border-radius: 50%;
	box-shadow: 0 0 0 2px rgba(185, 28, 28, 0.75), 0 0 14px rgba(185, 28, 28, 0.45);
	animation: lvtg2-check-pulse 1.1s ease-in-out infinite;
	pointer-events: none;
	z-index: 0;
}

.lvtg2-target-dot {
	width: 18%;
	aspect-ratio: 1;
	border-radius: 50%;
	background: rgba(154, 52, 18, 0.5);
	pointer-events: none;
	z-index: 1;
	animation: lvtg2-pop 0.16s ease;
}

.lvtg2-point--target-cap::before {
	content: "";
	position: absolute;
	inset: 14%;
	border-radius: 50%;
	border: 2.5px solid rgba(154, 52, 18, 0.65);
	pointer-events: none;
	z-index: 0;
}

/* —— Pieces —— */
.lvtg2-piece-spin {
	position: relative;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 78%;
	aspect-ratio: 1;
	pointer-events: none;
}

.lvtg2-piece {
	position: relative;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	border-radius: 50%;
	font-family: "STKaiti", "KaiTi", "Kaiti SC", "Noto Serif SC", "SimSun", serif;
	font-size: clamp(0.7rem, 3.6vw, 1.35rem);
	font-weight: 700;
	line-height: 1;
	box-shadow:
		0 1px 2px rgba(0, 0, 0, 0.22),
		0 3px 6px rgba(0, 0, 0, 0.12);
	transition: transform 0.06s ease, box-shadow 0.06s ease;
	pointer-events: none;
}

.lvtg2-piece--red {
	color: #a31212;
	background:
		radial-gradient(circle at 35% 30%, #fffaf0 0%, #f3e0c0 55%, #e6cfa8 100%);
	border: 2px solid #a31212;
	box-shadow:
		inset 0 0 0 1.5px rgba(163, 18, 18, 0.35),
		0 1px 2px rgba(0, 0, 0, 0.2),
		0 3px 7px rgba(0, 0, 0, 0.12);
}

.lvtg2-piece--black {
	color: #1a1714;
	background:
		radial-gradient(circle at 35% 30%, #fffdf8 0%, #efe6d6 55%, #e0d4c0 100%);
	border: 2px solid #2a2520;
	box-shadow:
		inset 0 0 0 1.5px rgba(30, 25, 20, 0.35),
		0 1px 2px rgba(0, 0, 0, 0.2),
		0 3px 7px rgba(0, 0, 0, 0.12);
}

.lvtg2-piece--avatar {
	padding: 0;
	overflow: hidden;
	font-size: 0;
	background: #efe6d8;
}

.lvtg2-piece--avatar img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	border-radius: 50%;
}

.lvtg2-piece--avatar-initial {
	font-family: "STKaiti", "KaiTi", "Kaiti SC", "Noto Serif SC", "SimSun", serif;
	font-size: clamp(0.75rem, 3.8vw, 1.4rem);
	font-weight: 700;
}

.lvtg2-avatar-king-opt {
	display: flex;
	align-items: center;
	gap: 0.45rem;
	margin: 0.35rem 0 0.15rem;
	font-size: 0.84rem;
	font-weight: 600;
	color: var(--lvtg2-ink, #1f1a14);
	cursor: pointer;
	user-select: none;
}

.lvtg2-avatar-king-opt[hidden] {
	display: none !important;
}

.lvtg2-avatar-king-opt input {
	width: 1rem;
	height: 1rem;
	accent-color: var(--lvtg2-accent, #9a3412);
	flex-shrink: 0;
	cursor: pointer;
}

.lvtg2-point--selected .lvtg2-piece {
	transform: scale(1.04);
	box-shadow:
		inset 0 0 0 1.5px rgba(154, 52, 18, 0.35),
		0 0 0 2px rgba(154, 52, 18, 0.35),
		0 4px 10px rgba(0, 0, 0, 0.18);
}

.lvtg2-piece--check {
	animation: lvtg2-check-piece 1.1s ease-in-out infinite;
}

.lvtg2-point--moved .lvtg2-piece {
	animation: lvtg2-move-in 0.14s ease;
}

.lvtg2-point--capture .lvtg2-piece {
	animation: lvtg2-capture 0.16s ease;
}
	position: absolute;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
	z-index: 5;
	padding: 0.8rem 1.15rem;
	border-radius: 10px;
	background: rgba(28, 25, 23, 0.9);
	color: #fff7ed;
	font-weight: 700;
	text-align: center;
	pointer-events: none;
	animation: lvtg2-banner 0.35s ease;
}

.lvtg2-banner--check { background: rgba(154, 52, 18, 0.92); }
.lvtg2-banner--end { background: rgba(22, 101, 52, 0.92); }

.lvtg2-move-list {
	max-height: 240px;
	overflow: auto;
	margin: 0.35rem 0 1rem;
	padding-left: 1.2rem;
	font-size: 0.88rem;
	color: var(--lvtg2-muted, #7a7166);
}

.lvtg2-actions--game {
	display: grid;
	gap: 0.5rem;
}

@keyframes lvtg2-move-in {
	from { transform: scale(0.86); opacity: 0.55; }
	to { transform: scale(1); opacity: 1; }
}

@keyframes lvtg2-capture {
	0% { transform: scale(1); }
	40% { transform: scale(1.12); }
	100% { transform: scale(1); }
}

@keyframes lvtg2-banner {
	from { opacity: 0; transform: translate(-50%, -42%) scale(0.96); }
	to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

@keyframes lvtg2-pop {
	from { opacity: 0; transform: scale(0.7); }
	to { opacity: 1; transform: scale(1); }
}

@keyframes lvtg2-check-pulse {
	0%, 100% { opacity: 0.55; }
	50% { opacity: 1; }
}

@keyframes lvtg2-check-piece {
	0%, 100% { filter: drop-shadow(0 0 0 rgba(185, 28, 28, 0)); }
	50% { filter: drop-shadow(0 0 6px rgba(185, 28, 28, 0.65)); }
}

/* Black POV: rotate board 180°, keep characters upright via counter-rotate on spin wrapper */
.lvtg2-board--flip {
	transform: rotate(180deg);
}

.lvtg2-board--flip .lvtg2-piece-spin,
.lvtg2-board--flip .lvtg2-target-dot {
	transform: rotate(180deg);
}

.lvtg2-board--flip .lvtg2-board-river-text {
	transform: rotate(180deg);
	transform-box: fill-box;
	transform-origin: center;
}
