/* learner-bros front-end styles */
/* Color tokens */
:root {
	--lbfe-yellow: #F5C400;
	--lbfe-red:    #CC1622;
	--lbfe-black:  #1A1A1A;
	--lbfe-cream:  #FFFDF5;
	--lbfe-nav-h:  56px;
	--lbfe-gap:    1.5rem;
	--lbfe-max:    1200px;
	--lbfe-radius: 8px;

	/* light */
	--lbfe-bg:        var(--lbfe-cream);
	--lbfe-text:      var(--lbfe-black);
	--lbfe-muted:     #666;
	--lbfe-border:    #E0DDD0;
	--lbfe-nav-bg:    rgba(255,253,245,0.92);
	--lbfe-nav-text:  var(--lbfe-black);
	--lbfe-drawer-bg: var(--lbfe-cream);
	--lbfe-card-bg:   #fff;
	--lbfe-badge-bg:  var(--lbfe-red);
	--lbfe-badge-fg:  #fff;
	--lbfe-gate-bg:   rgba(255,253,245,0.88);
	--lbfe-stub-blur: rgba(255,253,245,0.5);
}

@media (prefers-color-scheme: dark) {
	:root {
		--lbfe-bg:        #18181a;
		--lbfe-text:      #f0ede0;
		--lbfe-muted:     #999;
		--lbfe-border:    #2e2e30;
		--lbfe-nav-bg:    rgba(24,24,26,0.92);
		--lbfe-nav-text:  #f0ede0;
		--lbfe-drawer-bg: #1e1e20;
		--lbfe-card-bg:   #222224;
		--lbfe-badge-bg:  var(--lbfe-yellow);
		--lbfe-badge-fg:  var(--lbfe-black);
		--lbfe-gate-bg:   rgba(24,24,26,0.88);
		--lbfe-stub-blur: rgba(24,24,26,0.5);
	}
}

:root[data-theme="light"] {
	--lbfe-bg:        var(--lbfe-cream);
	--lbfe-text:      var(--lbfe-black);
	--lbfe-muted:     #666;
	--lbfe-border:    #E0DDD0;
	--lbfe-nav-bg:    rgba(255,253,245,0.92);
	--lbfe-nav-text:  var(--lbfe-black);
	--lbfe-drawer-bg: var(--lbfe-cream);
	--lbfe-card-bg:   #fff;
	--lbfe-gate-bg:   rgba(255,253,245,0.88);
	--lbfe-stub-blur: rgba(255,253,245,0.5);
}

:root[data-theme="dark"] {
	--lbfe-bg:        #18181a;
	--lbfe-text:      #f0ede0;
	--lbfe-muted:     #999;
	--lbfe-border:    #2e2e30;
	--lbfe-nav-bg:    rgba(24,24,26,0.92);
	--lbfe-nav-text:  #f0ede0;
	--lbfe-drawer-bg: #1e1e20;
	--lbfe-card-bg:   #222224;
	--lbfe-gate-bg:   rgba(24,24,26,0.88);
	--lbfe-stub-blur: rgba(24,24,26,0.5);
}

/* Reset / base */
.lbfe-page *,
.lbfe-page *::before,
.lbfe-page *::after {
	box-sizing: border-box;
}

.lbfe-page {
	background: var(--lbfe-bg);
	color: var(--lbfe-text);
	font-family: system-ui, -apple-system, sans-serif;
	font-size: 16px;
	line-height: 1.6;
	margin: 0;
	padding: 0;
}

.lbfe-page a {
	color: inherit;
}

/* ── Fixed nav ──────────────────────────────────────────────────────────── */
.lbfe-nav {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	background: var(--lbfe-nav-bg);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
	border-bottom: 1px solid var(--lbfe-border);
	height: var(--lbfe-nav-h);
	z-index: 100;
}

.lbfe-nav-inner {
	align-items: center;
	display: flex;
	gap: 1rem;
	height: 100%;
	margin: 0 auto;
	max-width: 1200px;
	padding: 0 1rem;
}

.lbfe-nav-logo {
	display: flex;
	flex-shrink: 0;
	text-decoration: none;
}

.lbfe-nav-logo img {
	display: block;
	height: 36px;
	width: 36px;
}

/* Breadcrumb (legacy — kept for nav-crumbs if reused) */
.lbfe-nav-crumbs {
	color: var(--lbfe-muted);
	display: flex;
	flex: 1;
	font-size: 0.82rem;
	gap: 0.35rem;
	list-style: none;
	margin: 0;
	min-width: 0;
	overflow: hidden;
	padding: 0;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.lbfe-nav-crumbs li {
	align-items: center;
	display: flex;
	gap: 0.35rem;
}

.lbfe-nav-crumbs li + li::before {
	color: var(--lbfe-border);
	content: '/';
}

.lbfe-nav-crumbs a {
	color: var(--lbfe-muted);
	text-decoration: none;
}

.lbfe-nav-crumbs a:hover {
	color: var(--lbfe-text);
}

.lbfe-nav-crumbs [aria-current="page"] {
	color: var(--lbfe-text);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.lbfe-nav-right {
	align-items: center;
	display: flex;
	flex-shrink: 0;
	gap: 0.75rem;
	margin-left: auto;
}

.lbfe-nav-user {
	color: var(--lbfe-muted);
	font-size: 0.82rem;
}

.lbfe-nav-cta {
	display: none;
}

@media (min-width: 640px) {
	.lbfe-nav-cta {
		display: inline-flex;
	}
}

/* Hamburger */
.lbfe-hamburger {
	background: none;
	border: none;
	cursor: pointer;
	display: flex;
	flex-direction: column;
	gap: 4px;
	height: 32px;
	justify-content: center;
	padding: 4px 0;
	width: 28px;
}

.lbfe-hamburger span {
	background: var(--lbfe-nav-text);
	border-radius: 2px;
	display: block;
	height: 2px;
	transition: transform 0.2s, opacity 0.2s;
	width: 100%;
}

.lbfe-hamburger[aria-expanded="true"] span:nth-child(1) {
	transform: translateY(6px) rotate(45deg);
}
.lbfe-hamburger[aria-expanded="true"] span:nth-child(2) {
	opacity: 0;
}
.lbfe-hamburger[aria-expanded="true"] span:nth-child(3) {
	transform: translateY(-6px) rotate(-45deg);
}

/* ── Drawer ─────────────────────────────────────────────────────────────── */
.lbfe-drawer {
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	background: var(--lbfe-drawer-bg);
	border-left: 1px solid var(--lbfe-border);
	display: flex;
	flex-direction: column;
	transform: translateX(100%);
	transition: transform 0.25s ease;
	width: 280px;
	z-index: 200;
}

.lbfe-drawer[aria-hidden="false"] {
	transform: translateX(0);
}

.lbfe-drawer-inner {
	display: flex;
	flex: 1;
	flex-direction: column;
	gap: 1rem;
	overflow-y: auto;
	padding: 1.5rem 1.25rem;
}

.lbfe-drawer-close {
	align-self: flex-end;
	background: none;
	border: none;
	cursor: pointer;
	color: var(--lbfe-text);
	font-size: 1.6rem;
	line-height: 1;
	padding: 0;
}

.lbfe-drawer-nav {
	display: flex;
	flex-direction: column;
	font-size: 1.05rem;
	gap: 0.75rem;
}

.lbfe-drawer-nav a {
	color: var(--lbfe-muted);
	text-decoration: none;
}

.lbfe-drawer-nav a:hover {
	color: var(--lbfe-text);
}

.lbfe-drawer-current {
	color: var(--lbfe-text);
	font-weight: 600;
}

.lbfe-drawer-login {
	color: var(--lbfe-muted);
	font-size: 0.88rem;
	margin-top: 0.25rem;
	text-align: center;
	text-decoration: none;
}

.lbfe-drawer-backdrop {
	position: fixed;
	inset: 0;
	background: rgba(0,0,0,0.4);
	display: none;
	z-index: 190;
}

.lbfe-drawer-backdrop[aria-hidden="false"] {
	display: block;
}

/* ── Hero ───────────────────────────────────────────────────────────────── */
.lbfe-hero {
	margin-top: var(--lbfe-nav-h);
	width: 100%;
}

.lbfe-hero-img {
	aspect-ratio: 3 / 1;
	display: block;
	height: auto;
	max-height: 55vh;
	object-fit: cover;
	width: 100%;
}

/* ── Content container ───────────────────────────────────────────────────── */
.lbfe-content {
	margin: 0 auto;
	max-width: var(--lbfe-max);
	padding: 2rem 1rem 4rem;
}

/* Shift content down when there's no hero (subject/country pages) */
.lbfe-subject-page .lbfe-content,
.lbfe-country-page .lbfe-content {
	padding-top: calc(var(--lbfe-nav-h) + 2rem);
}

/* ── Content breadcrumb ──────────────────────────────────────────────────── */
.lbfe-breadcrumb {
	margin-bottom: 1rem;
}

.lbfe-breadcrumb-list {
	color: var(--lbfe-muted);
	display: flex;
	flex-wrap: wrap;
	font-size: 0.82rem;
	gap: 0.3rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

.lbfe-breadcrumb-list li {
	align-items: center;
	display: flex;
	gap: 0.3rem;
}

.lbfe-breadcrumb-list li + li::before {
	color: var(--lbfe-border);
	content: '/';
}

.lbfe-breadcrumb-list a {
	color: var(--lbfe-muted);
	text-decoration: none;
}

.lbfe-breadcrumb-list a:hover {
	color: var(--lbfe-text);
}

.lbfe-breadcrumb-list [aria-current="page"] {
	color: var(--lbfe-text);
}

/* ── City header ─────────────────────────────────────────────────────────── */
.lbfe-city-header {
	align-items: baseline;
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem 1rem;
	margin-bottom: 1.5rem;
}

.lbfe-city-name {
	font-size: 2rem;
	font-weight: 800;
	letter-spacing: -0.03em;
	line-height: 1.1;
	margin: 0;
}


/* ── Intro ───────────────────────────────────────────────────────────────── */
.lbfe-intro {
	color: var(--lbfe-text);
	font-size: 1.05rem;
	line-height: 1.75;
	margin-bottom: 2rem;
	max-width: 72ch;
}

.lbfe-intro p {
	margin: 0 0 1em;
}

.lbfe-intro p:last-child {
	margin-bottom: 0;
}

/* ── Facts grid ─────────────────────────────────────────────────────────── */
.lbfe-facts {
	display: grid;
	gap: 1rem;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	margin-bottom: 2rem;
}

.lbfe-fact {
	background: var(--lbfe-card-bg);
	border: 1px solid var(--lbfe-border);
	border-radius: var(--lbfe-radius);
	padding: 1rem 1.25rem;
}

.lbfe-fact-label {
	color: var(--lbfe-muted);
	font-size: 0.75rem;
	letter-spacing: 0.06em;
	margin-bottom: 0.35rem;
	text-transform: uppercase;
}

.lbfe-fact-text {
	font-size: 0.95rem;
	line-height: 1.5;
	margin: 0;
}

/* ── Section ─────────────────────────────────────────────────────────────── */
.lbfe-section {
	margin-bottom: 2.5rem;
}

.lbfe-section-title {
	border-bottom: 2px solid var(--lbfe-border);
	font-size: 1.1rem;
	font-weight: 700;
	letter-spacing: 0.02em;
	margin: 0 0 1rem;
	padding-bottom: 0.4rem;
	text-transform: uppercase;
}

/* ── City illustration ───────────────────────────────────────────────────── */
.lbfe-city-img-wrap {
	border-radius: var(--lbfe-radius);
	margin-bottom: 2rem;
	overflow: hidden;
}

.lbfe-city-img {
	aspect-ratio: 16 / 9;
	display: block;
	height: auto;
	object-fit: cover;
	width: 100%;
}

/* ── Markers map ─────────────────────────────────────────────────────────── */
.lbfe-markers-map-wrap {
	border-radius: var(--lbfe-radius);
	margin-top: 1.5rem;
	overflow: hidden;
}

.lbfe-map-img {
	display: block;
	height: auto;
	width: 100%;
}

/* ── Game separator ──────────────────────────────────────────────────────── */
.lbfe-game-separator {
	border: none;
	border-top: 2px solid var(--lbfe-border);
	margin: 3rem 0 2.5rem;
}

/* ── Carousel ────────────────────────────────────────────────────────────── */
.lbfe-carousel {
	display: flex;
	gap: 1rem;
	overflow-x: auto;
	padding-bottom: 0.5rem;
	scroll-behavior: smooth;
	scroll-snap-type: x mandatory;
	-webkit-overflow-scrolling: touch;
}

.lbfe-carousel::-webkit-scrollbar {
	height: 4px;
}

.lbfe-carousel::-webkit-scrollbar-track {
	background: var(--lbfe-border);
	border-radius: 2px;
}

.lbfe-carousel::-webkit-scrollbar-thumb {
	background: var(--lbfe-yellow);
	border-radius: 2px;
}

.lbfe-card {
	background: var(--lbfe-card-bg);
	border: 1px solid var(--lbfe-border);
	border-radius: var(--lbfe-radius);
	display: flex;
	flex-direction: column;
	flex-shrink: 0;
	overflow: hidden;
	scroll-snap-align: start;
	width: 240px;
}

@media (min-width: 480px) {
	.lbfe-card {
		width: 280px;
	}
}

.lbfe-card-img-wrap {
	aspect-ratio: 4 / 3;
	overflow: hidden;
}

.lbfe-card-img {
	display: block;
	height: 100%;
	object-fit: cover;
	transition: transform 0.3s ease;
	width: 100%;
}

.lbfe-card:hover .lbfe-card-img {
	transform: scale(1.04);
}

.lbfe-card-body {
	display: flex;
	flex: 1;
	flex-direction: column;
	gap: 0.35rem;
	padding: 0.85rem 1rem;
}

.lbfe-card-badge {
	background: var(--lbfe-badge-bg);
	border-radius: 50%;
	color: var(--lbfe-badge-fg);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 0.75rem;
	font-weight: 700;
	height: 22px;
	width: 22px;
}

.lbfe-card-name {
	font-size: 0.95rem;
	font-weight: 700;
	line-height: 1.3;
	margin: 0;
}

.lbfe-card-blurb {
	color: var(--lbfe-muted);
	font-size: 0.82rem;
	line-height: 1.5;
	margin: 0;
}

/* Carousel nav buttons */
.lbfe-carousel-nav {
	display: flex;
	gap: 0.5rem;
	justify-content: flex-end;
	margin-top: 0.75rem;
}

.lbfe-carousel-btn {
	align-items: center;
	background: var(--lbfe-card-bg);
	border: 1px solid var(--lbfe-border);
	border-radius: 50%;
	color: var(--lbfe-text);
	cursor: pointer;
	display: inline-flex;
	font-size: 1.1rem;
	height: 36px;
	justify-content: center;
	transition: background 0.15s, border-color 0.15s;
	width: 36px;
}

.lbfe-carousel-btn:hover {
	background: var(--lbfe-yellow);
	border-color: var(--lbfe-yellow);
	color: var(--lbfe-black);
}

/* ── Tabs ────────────────────────────────────────────────────────────────── */
.lbfe-tabs {
	border-bottom: 2px solid var(--lbfe-border);
	display: flex;
	gap: 0;
	margin-bottom: 1.5rem;
}

.lbfe-tab {
	background: none;
	border: none;
	border-bottom: 2px solid transparent;
	color: var(--lbfe-muted);
	cursor: pointer;
	font-size: 0.95rem;
	font-weight: 600;
	margin-bottom: -2px;
	padding: 0.6rem 1.25rem;
	transition: color 0.15s, border-color 0.15s;
}

.lbfe-tab:hover {
	color: var(--lbfe-text);
}

.lbfe-tab--active {
	border-bottom-color: var(--lbfe-red);
	color: var(--lbfe-text);
}

.lbfe-tab-panel {
	min-height: 120px;
}

.lbfe-placeholder {
	color: var(--lbfe-muted);
	font-size: 0.95rem;
}

/* ── Game gate (logged-out) ──────────────────────────────────────────────── */
.lbfe-gate {
	margin-bottom: 2.5rem;
	position: relative;
}

.lbfe-gate-stub {
	border-radius: var(--lbfe-radius);
	filter: blur(3px);
	opacity: 0.55;
	overflow: hidden;
	pointer-events: none;
	user-select: none;
}

.lbfe-stub-grid {
	display: grid;
	gap: 4px;
	grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
}

.lbfe-stub-tile {
	aspect-ratio: 1;
	background-color: var(--lbfe-border);
	background-position: center;
	background-size: cover;
	border-radius: 4px;
}

.lbfe-gate-cta {
	align-items: center;
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
	left: 0;
	padding: 2rem 1rem;
	position: absolute;
	right: 0;
	text-align: center;
	top: 50%;
	transform: translateY(-50%);
}

.lbfe-gate-text {
	font-size: 1.05rem;
	font-weight: 600;
	margin: 0;
}

.lbfe-gate-login {
	color: var(--lbfe-muted);
	font-size: 0.85rem;
	text-decoration: underline;
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.lbfe-btn {
	align-items: center;
	border-radius: 6px;
	cursor: pointer;
	display: inline-flex;
	font-size: 0.88rem;
	font-weight: 700;
	gap: 0.4rem;
	justify-content: center;
	padding: 0.5rem 1.1rem;
	text-decoration: none;
	transition: opacity 0.15s;
}

.lbfe-btn:hover {
	opacity: 0.85;
}

.lbfe-btn-cta {
	background: var(--lbfe-red);
	color: #fff;
}

.lbfe-btn-full {
	width: 100%;
}

/* ── Country / subject grid ──────────────────────────────────────────────── */
.lbfe-city-grid {
	display: grid;
	gap: 1rem;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

.lbfe-city-card {
	background: var(--lbfe-card-bg);
	border: 1px solid var(--lbfe-border);
	border-radius: var(--lbfe-radius);
	display: block;
	overflow: hidden;
	text-decoration: none;
	transition: box-shadow 0.2s;
}

.lbfe-city-card:hover {
	box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

.lbfe-city-card-img {
	aspect-ratio: 16 / 9;
	background-color: var(--lbfe-border);
	background-position: center;
	background-size: cover;
	transition: transform 0.3s;
}

.lbfe-city-card:hover .lbfe-city-card-img {
	transform: scale(1.03);
}

.lbfe-city-card-img--empty {
	background-color: var(--lbfe-border);
}

.lbfe-city-card-name {
	font-size: 0.95rem;
	font-weight: 700;
	padding: 0.6rem 0.75rem 0.25rem;
}

.lbfe-city-card-sub {
	color: var(--lbfe-muted);
	font-size: 0.78rem;
	padding: 0 0.75rem 0.6rem;
}

/* ── Footer ───────────────────────────────────────────────────────────── */

.lbfe-footer {
	background: var(--lbfe-nav-bg);
	backdrop-filter: blur(8px);
	border-top: 1px solid var(--lbfe-border);
	margin-top: 4rem;
	padding: 1.25rem 1rem;
}

.lbfe-footer-inner {
	align-items: center;
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem 2rem;
	justify-content: space-between;
	margin: 0 auto;
	max-width: 1200px;
}

.lbfe-footer-copy {
	color: var(--lbfe-muted);
	font-size: 0.82rem;
}

.lbfe-footer-links {
	display: flex;
	gap: 1.5rem;
}

.lbfe-footer-links a {
	color: var(--lbfe-muted);
	font-size: 0.82rem;
	text-decoration: none;
}

.lbfe-footer-links a:hover {
	color: var(--lbfe-text);
}

/* ── Puzzle ──────────────────────────────────────────────────────────────── */

#lbfe-puzzle-root {
	background: var(--lbfe-bg);
	height: calc(100vh - var(--lbfe-nav-h));
	overflow: hidden;
	position: sticky;
	top: var(--lbfe-nav-h);
	z-index: 50;
}

#lbfe-puzzle-root::backdrop {
	background: var(--lbfe-bg);
}

#lbfe-puzzle-root:-webkit-full-screen,
#lbfe-puzzle-root:fullscreen {
	background: var(--lbfe-bg);
	height: 100vh;
	height: 100dvh;
	top: 0;
}

/* overlays inside root use fixed so they cover root in both normal and fullscreen */
#lbfe-puzzle-root .lbfe-puz-lb,
#lbfe-puzzle-root .lbfe-puz-done {
	position: fixed;
}

.lbfe-puz-bar {
	align-items: center;
	background: var(--lbfe-nav-bg);
	backdrop-filter: blur(8px);
	border-bottom: 1px solid var(--lbfe-border);
	display: flex;
	flex-shrink: 0;
	flex-wrap: wrap;
	gap: 10px;
	padding: 10px 14px;
}

.lbfe-puz-chips {
	display: flex;
	flex: 1;
	gap: 6px;
	min-width: 0;
	overflow-x: auto;
	padding: 2px 0;
	scrollbar-width: none;
}
.lbfe-puz-chips::-webkit-scrollbar { display: none; }

.lbfe-puz-chip {
	align-items: center;
	background: transparent;
	border: 2px solid var(--lbfe-border);
	border-radius: 10px;
	color: var(--lbfe-muted);
	cursor: pointer;
	display: flex;
	flex-direction: column;
	flex-shrink: 0;
	gap: 4px;
	line-height: 1;
	min-height: 44px;
	min-width: 68px;
	padding: 10px 14px;
	transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.lbfe-puz-chip:hover:not(.lbfe-active) { border-color: var(--lbfe-text); color: var(--lbfe-text); }
.lbfe-puz-chip.lbfe-active { background: var(--lbfe-red); border-color: var(--lbfe-red); color: #fff; }
.lbfe-puz-chip:focus-visible { outline: 3px solid var(--lbfe-yellow); outline-offset: 2px; }
.lbfe-puz-chip-icon { font-size: 22px; }
.lbfe-puz-chip-name { font-size: 13px; font-weight: 700; letter-spacing: 0.02em; }

.lbfe-puz-stats { display: flex; flex-shrink: 0; gap: 20px; }
.lbfe-puz-stat  { align-items: flex-end; display: flex; flex-direction: column; gap: 1px; }
.lbfe-puz-stat-lbl { color: var(--lbfe-muted); font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.lbfe-puz-stat-val { font-family: 'Courier New', monospace; font-size: 18px; font-variant-numeric: tabular-nums; font-weight: 800; line-height: 1.1; }

.lbfe-puz-hint { align-items: center; cursor: pointer; display: flex; flex-shrink: 0; gap: 10px; min-height: 44px; }
.lbfe-puz-hint input { height: 0; opacity: 0; position: absolute; width: 0; }
.lbfe-puz-sw { background: var(--lbfe-border); border-radius: 13px; flex-shrink: 0; height: 26px; position: relative; transition: background 0.2s; width: 46px; }
.lbfe-puz-sw::after { background: #fff; border-radius: 50%; content: ''; height: 20px; left: 3px; position: absolute; top: 3px; transition: transform 0.2s; width: 20px; }
.lbfe-puz-hint input:checked + .lbfe-puz-sw { background: var(--lbfe-yellow); }
.lbfe-puz-hint input:checked + .lbfe-puz-sw::after { transform: translateX(20px); }
.lbfe-puz-hint input:focus-visible + .lbfe-puz-sw { outline: 3px solid var(--lbfe-yellow); outline-offset: 2px; }
.lbfe-puz-hint-txt { color: var(--lbfe-text); font-size: 13px; font-weight: 600; }

.lbfe-puz-new { background: transparent; border: 2px solid var(--lbfe-border); border-radius: 8px; color: var(--lbfe-muted); cursor: pointer; font-size: 13px; font-weight: 700; min-height: 44px; padding: 8px 16px; transition: border-color 0.15s, color 0.15s; }
.lbfe-puz-new:hover { border-color: var(--lbfe-red); color: var(--lbfe-red); }
.lbfe-puz-new:focus-visible { outline: 3px solid var(--lbfe-yellow); outline-offset: 2px; }

.lbfe-puz-main {
	display: flex;
	flex: 1;
	min-height: 0;
}

.lbfe-puz-board-panel {
	align-items: flex-start;
	display: flex;
	flex: 1;
	flex-direction: column;
	justify-content: flex-start;
	min-width: 0;
	padding: 12px 20px;
}

.lbfe-puz-board-wrap { align-items: flex-start; display: flex; flex-direction: column; }
.lbfe-puz-board-lbl  { color: var(--lbfe-muted); font-size: 12px; font-weight: 600; letter-spacing: 0.04em; margin-bottom: 8px; text-transform: uppercase; }

.lbfe-puz-board {
	background: transparent;
	border: 1.5px dashed var(--lbfe-border);
	border-radius: 0;
	overflow: visible;
	position: relative;
}

.lbfe-puz-ref-row { align-items: center; display: flex; gap: 10px; margin-top: 12px; }
.lbfe-puz-ref-thumb { border: 2px solid var(--lbfe-border); border-radius: 4px; cursor: zoom-in; height: 48px; transition: transform 0.15s; width: auto; }
.lbfe-puz-ref-thumb:hover { transform: scale(1.06); }
.lbfe-puz-ref-lbl { color: var(--lbfe-muted); font-size: 13px; font-weight: 600; }

.lbfe-puz-lb { align-items: center; background: rgba(0,0,0,.88); bottom: 0; cursor: zoom-out; display: flex; justify-content: center; left: 0; opacity: 0; pointer-events: none; position: fixed; right: 0; top: 0; transition: opacity 0.25s; z-index: 8000; }
.lbfe-puz-lb.lbfe-show { opacity: 1; pointer-events: auto; }
.lbfe-puz-lb img { border-radius: 4px; box-shadow: 0 20px 60px rgba(0,0,0,0.7); max-height: 88vh; max-width: 92vw; }

.lbfe-puz-tray-panel { background: var(--lbfe-nav-bg); border-left: 2px solid var(--lbfe-border); display: flex; flex-direction: column; flex-shrink: 0; overflow: hidden; padding: 14px 10px; }
.lbfe-puz-tray-lbl   { color: var(--lbfe-muted); flex-shrink: 0; font-size: 12px; font-weight: 700; letter-spacing: 0.06em; margin-bottom: 10px; text-transform: uppercase; }
.lbfe-puz-tray       { flex: 1; min-height: 0; overflow-x: hidden; overflow-y: auto; position: relative; }
.lbfe-puz-tray-sizer { position: relative; width: 100%; }

.lbfe-puz-prog      { flex-shrink: 0; margin-top: 12px; }
.lbfe-puz-prog-track { background: var(--lbfe-border); border-radius: 3px; height: 6px; overflow: hidden; }
.lbfe-puz-prog-fill  { background: var(--lbfe-red); border-radius: 3px; height: 100%; transition: width 0.25s; width: 0; }
.lbfe-puz-prog-txt   { color: var(--lbfe-muted); font-size: 12px; font-variant-numeric: tabular-nums; font-weight: 700; margin-top: 6px; }

.lbfe-puz-piece          { cursor: grab; position: absolute; touch-action: none; }
.lbfe-puz-piece canvas   { display: block; }
.lbfe-puz-piece.lbfe-dragging { cursor: grabbing; z-index: 9999; }
.lbfe-puz-piece.lbfe-locked   { cursor: default; z-index: 1; }

.lbfe-puz-sel { background: var(--lbfe-border); border-radius: 8px; display: flex; flex-shrink: 0; gap: 2px; padding: 2px; }
.lbfe-puz-sel-btn { background: transparent; border: none; border-radius: 6px; color: var(--lbfe-muted); cursor: pointer; font-size: 13px; font-weight: 700; min-height: 36px; padding: 4px 14px; transition: background 0.15s, color 0.15s; }
.lbfe-puz-sel-btn:hover:not(.lbfe-active) { color: var(--lbfe-text); }
.lbfe-puz-sel-btn.lbfe-active { background: var(--lbfe-bg); color: var(--lbfe-text); }
.lbfe-puz-sel-btn:focus-visible { outline: 3px solid var(--lbfe-yellow); outline-offset: 2px; }

.lbfe-puz-chip--locked { cursor: not-allowed; opacity: 0.45; }
.lbfe-puz-chip--locked:hover { border-color: var(--lbfe-border); color: var(--lbfe-muted); }

.lbfe-puz-done { align-items: center; background: rgba(26,26,46,0.78); bottom: 0; display: flex; justify-content: center; left: 0; opacity: 0; pointer-events: none; position: fixed; right: 0; top: 0; transition: opacity 0.35s; z-index: 5000; }
.lbfe-puz-done.lbfe-show { opacity: 1; pointer-events: auto; }
.lbfe-puz-done-card { background: var(--lbfe-bg); border-radius: 8px; box-shadow: 0 20px 60px rgba(0,0,0,0.45); max-width: 560px; padding: 34px 42px; text-align: center; transform: scale(0.88); transition: transform 0.38s cubic-bezier(0.34,1.56,0.64,1); width: 92%; }
.lbfe-puz-done.lbfe-show .lbfe-puz-done-card { transform: scale(1); }
.lbfe-puz-done-icon  { font-size: 52px; line-height: 1; margin-bottom: 14px; }
.lbfe-puz-done-title { font-size: 24px; font-weight: 900; margin-bottom: 6px; }
.lbfe-puz-done-sub   { color: var(--lbfe-muted); font-size: 14px; font-variant-numeric: tabular-nums; margin-bottom: 16px; }
.lbfe-puz-done-fact  { background: var(--lbfe-nav-bg); border-left: 3px solid var(--lbfe-red); border-radius: 0 4px 4px 0; font-size: 14px; line-height: 1.65; margin-bottom: 20px; padding: 12px 14px; text-align: left; }
.lbfe-puz-done-fact strong { color: var(--lbfe-red); display: block; font-size: 11px; font-weight: 800; letter-spacing: 0.08em; margin-bottom: 5px; text-transform: uppercase; }

.lbfe-puz-done-up { font-size: 1rem; margin-bottom: 20px; padding: 12px 28px; }
.lbfe-puz-done-up .lbfe-puz-chip-icon { font-size: 18px; vertical-align: middle; }

.lbfe-puz-done-levels { display: flex; gap: 6px; justify-content: center; margin-bottom: 16px; overflow-x: auto; padding: 2px 0; scrollbar-width: none; }
.lbfe-puz-done-levels::-webkit-scrollbar { display: none; }

.lbfe-puz-done-again { background: none; border: none; color: var(--lbfe-muted); cursor: pointer; font-size: 13px; font-weight: 600; padding: 4px 8px; text-decoration: underline; }
.lbfe-puz-done-again:hover { color: var(--lbfe-text); }
.lbfe-puz-done-again:focus-visible { outline: 3px solid var(--lbfe-yellow); outline-offset: 2px; }

.lbfe-puz-fs { padding: 8px 12px; }
.lbfe-puz-fs i { font-size: 16px; }

/* ── Image lightbox ──────────────────────────────────────────────────────── */
.lbfe-lb-overlay {
	align-items: center;
	background: rgba(10,10,12,0.94);
	bottom: 0;
	display: flex;
	flex-direction: column;
	justify-content: center;
	left: 0;
	opacity: 0;
	pointer-events: none;
	position: fixed;
	right: 0;
	top: 0;
	transition: opacity 0.22s;
	z-index: 9500;
}
.lbfe-lb-overlay.lbfe-show { opacity: 1; pointer-events: auto; }

.lbfe-lb-img-wrap {
	align-items: center;
	display: flex;
	justify-content: center;
	max-height: 84vh;
	max-width: calc(100vw - 120px);
	padding: 0;
}

.lbfe-lb-img {
	border-radius: 4px;
	box-shadow: 0 12px 48px rgba(0,0,0,0.7);
	display: block;
	max-height: 84vh;
	max-width: 100%;
	object-fit: contain;
}

.lbfe-lb-footer {
	align-items: center;
	display: flex;
	gap: 1.5rem;
	justify-content: center;
	margin-top: 14px;
	max-width: calc(100vw - 120px);
	min-height: 24px;
}
.lbfe-lb-caption { color: rgba(255,255,255,0.88); font-size: 14px; font-weight: 600; text-align: center; }
.lbfe-lb-count   { color: rgba(255,255,255,0.45); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }

.lbfe-lb-btn {
	align-items: center;
	background: rgba(255,255,255,0.10);
	border: none;
	border-radius: 50%;
	color: #fff;
	cursor: pointer;
	display: flex;
	font-size: 18px;
	height: 48px;
	justify-content: center;
	position: absolute;
	transition: background 0.15s;
	width: 48px;
}
.lbfe-lb-btn:hover      { background: rgba(255,255,255,0.22); }
.lbfe-lb-btn:focus-visible { outline: 3px solid var(--lbfe-yellow); outline-offset: 2px; }

.lbfe-lb-close { right: 16px; top: 16px; }
.lbfe-lb-prev  { left: 16px;  top: 50%; transform: translateY(-50%); }
.lbfe-lb-next  { right: 16px; top: 50%; transform: translateY(-50%); }

.lbfe-lb-copy {
	color: rgba(255,255,255,0.30);
	font-size: 11px;
	margin-top: 10px;
	text-align: center;
}
.lbfe-lb-copy a { color: rgba(255,255,255,0.45); text-decoration: underline; }
.lbfe-lb-copy a:hover { color: rgba(255,255,255,0.75); }

/* cursor hint on lightbox-enabled wrappers */
.lbfe-city-img-wrap[data-lb-src],
.lbfe-card-img-wrap[data-lb-src],
.lbfe-markers-map-wrap[data-lb-src] { cursor: zoom-in; }
