/* City Challenge. Tokens come from lbfe.css; property order: position, then
   bottom/left/right/top, then alphabetical. */

.lbq-live {
	position: absolute;
	height: 1px;
	overflow: hidden;
	width: 1px;
}

.lbq-title {
	font-size: 1.35rem;
	font-weight: 700;
	line-height: 1.3;
	margin: 0 0 0.75rem;
	outline: none;
}

.lbq-prompt {
	font-size: 1.05rem;
	font-weight: 600;
	margin: 0 0 1rem;
}

.lbq-text,
.lbq-note,
.lbq-best {
	line-height: 1.5;
	margin: 0 0 1rem;
}

.lbq-note {
	color: var(--lbfe-muted);
	font-size: 0.85rem;
}

.lbq-best {
	background: var(--lbfe-card-bg);
	border: 1px solid var(--lbfe-border);
	border-left: 4px solid var(--lbfe-yellow);
	border-radius: var(--lbfe-radius);
	padding: 0.75rem 1rem;
}

.lbq-rounds {
	line-height: 1.5;
	margin: 0 0 1.25rem;
	padding-left: 1.25rem;
}

.lbq-rounds li {
	margin-bottom: 0.4rem;
}

.lbq-head {
	color: var(--lbfe-muted);
	display: flex;
	flex-wrap: wrap;
	font-size: 0.85rem;
	font-weight: 700;
	justify-content: space-between;
	letter-spacing: 0.02em;
	margin-bottom: 0.5rem;
	text-transform: uppercase;
}

.lbq-actions {
	align-items: center;
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	margin: 1.25rem 0 0.5rem;
}

.lbq-btn-plain {
	background: var(--lbfe-card-bg);
	border: 2px solid var(--lbfe-border);
	color: var(--lbfe-text);
}

.lbq .lbfe-btn[disabled] {
	cursor: default;
	opacity: 0.45;
}

.lbq-error {
	color: var(--lbfe-red);
	font-size: 0.9rem;
	font-weight: 600;
}

/* Pictures. The frame keeps its shape while the picture loads, so the buttons
   below it do not jump, and carries the retry box when it fails. */
.lbq-frame {
	position: relative;
	background: var(--lbfe-card-bg);
	border: 1px solid var(--lbfe-border);
	border-radius: var(--lbfe-radius);
	overflow: hidden;
}

.lbq-frame-wide {
	aspect-ratio: 16 / 9;
	margin-bottom: 1rem;
}

.lbq-frame img {
	display: block;
	height: 100%;
	object-fit: cover;
	width: 100%;
}

.lbq-frame.is-failed img {
	visibility: hidden;
}

.lbq-frame-retry {
	position: absolute;
	left: 0;
	right: 0;
	top: 50%;
	display: grid;
	gap: 0.5rem;
	justify-items: center;
	padding: 1rem;
	text-align: center;
	transform: translateY(-50%);
}

.lbq-grid-retry {
	position: relative;
	min-height: 0;
}

.lbq-grid-retry .lbq-frame-retry {
	position: static;
	transform: none;
}

/* Options. Round 1 names. */
.lbq-options {
	display: grid;
	gap: 0.6rem;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	margin-bottom: 1rem;
}

.lbq-option,
.lbq-letter,
.lbq-cell {
	background: var(--lbfe-card-bg);
	border: 2px solid var(--lbfe-border);
	border-radius: var(--lbfe-radius);
	color: var(--lbfe-text);
	cursor: pointer;
	font: inherit;
	font-weight: 600;
	padding: 0.8rem 1rem;
	text-align: left;
}

.lbq-option:hover,
.lbq-letter:hover,
.lbq-cell:hover,
.lbq-pin:hover {
	border-color: var(--lbfe-black);
}

.lbq-option.is-selected,
.lbq-letter.is-selected,
.lbq-cell.is-selected,
.lbq-pin.is-selected {
	background: var(--lbfe-yellow);
	border-color: var(--lbfe-black);
	box-shadow: 0 0 0 2px var(--lbfe-black);
	color: var(--lbfe-black);
}

.lbq-option:focus-visible,
.lbq-letter:focus-visible,
.lbq-cell:focus-visible,
.lbq-pin:focus-visible {
	outline: 3px solid var(--lbfe-red);
	outline-offset: 2px;
}

/* Card strip: the five collected in Round 1, and the study page. */
.lbq-strip {
	display: flex;
	gap: 0.75rem;
	margin: 0 0 1rem;
	overflow-x: auto;
	padding-bottom: 0.25rem;
	scroll-snap-type: x proximity;
}

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

.lbq-strip-study .lbq-card {
	width: 260px;
}

.lbq-card-img {
	aspect-ratio: 16 / 9;
	overflow: hidden;
}

.lbq-card-img img {
	display: block;
	height: 100%;
	object-fit: cover;
	width: 100%;
}

.lbq-card figcaption {
	display: grid;
	font-size: 0.85rem;
	gap: 0.25rem;
	line-height: 1.4;
	padding: 0.6rem 0.75rem;
}

.lbq-reveal-card {
	display: grid;
	gap: 1rem;
	margin-bottom: 1rem;
}

.lbq-reveal-card .lbq-card {
	max-width: 420px;
	width: 100%;
}

.lbq-verdict.is-right {
	color: #1f7a3a;
}

.lbq-verdict.is-wrong {
	color: var(--lbfe-red);
}

/* Round 2: card beside the map, letters under the map. */
.lbq-place {
	display: grid;
	gap: 1rem;
	grid-template-columns: 260px 1fr;
	margin-bottom: 1rem;
}

.lbq-place-card .lbq-card {
	width: 100%;
}

.lbq-map {
	position: relative;
	aspect-ratio: 16 / 10;
	background: var(--lbfe-card-bg);
	border: 1px solid var(--lbfe-border);
	border-radius: var(--lbfe-radius);
	min-height: 320px;
	overflow: hidden;
}

.lbq-map.is-failed {
	display: grid;
	place-items: center;
}

.lbq-letters {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-top: 0.75rem;
}

.lbq-letter {
	min-width: 3rem;
	padding: 0.6rem 0.9rem;
	text-align: center;
}

.lbq-pin {
	background: var(--lbfe-cream);
	border: 2px solid var(--lbfe-black);
	border-radius: 50%;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
	color: var(--lbfe-black);
	cursor: pointer;
	font: inherit;
	font-size: 1rem;
	font-weight: 700;
	height: 2.4rem;
	line-height: 1;
	padding: 0;
	width: 2.4rem;
}

/* Round 3: four equal cards, letters in the corner. */
.lbq-grid {
	display: grid;
	gap: 0.75rem;
	grid-template-columns: 1fr 1fr;
	margin-bottom: 1rem;
}

.lbq-cell {
	position: relative;
	padding: 0;
}

.lbq-cell .lbq-frame {
	border: 0;
	border-radius: 0;
}

.lbq-cell .lbq-frame img {
	aspect-ratio: 16 / 9;
}

.lbq-cell-key {
	position: absolute;
	left: 0.5rem;
	top: 0.5rem;
	background: var(--lbfe-black);
	border-radius: 4px;
	color: var(--lbfe-cream);
	font-size: 0.85rem;
	font-weight: 700;
	padding: 0.15rem 0.5rem;
}

/* Results. */
.lbq-score {
	font-size: 1.6rem;
	margin: 0 0 0.75rem;
}

.lbq-score strong {
	color: var(--lbfe-red);
	font-size: 2.4rem;
}

.lbq-stats {
	line-height: 1.6;
	margin: 0 0 1rem;
	padding-left: 1.25rem;
}

.lbq-discovered {
	margin-bottom: 1rem;
}

.lbq-discovered h4 {
	font-size: 1rem;
	margin: 0 0 0.4rem;
}

.lbq-discovered ul {
	margin: 0;
	padding-left: 1.25rem;
}

.lbq-review {
	line-height: 1.5;
	list-style: none;
	margin: 1rem 0 0;
	padding-left: 0;
}

.lbq-review li {
	border-bottom: 1px solid var(--lbfe-border);
	display: grid;
	gap: 0.75rem;
	grid-template-columns: 3rem 1fr auto;
	padding: 0.4rem 0;
}

.lbq-review li.is-right .lbq-review-yours {
	color: #1f7a3a;
}

.lbq-review li.is-wrong .lbq-review-yours {
	color: var(--lbfe-red);
}

.lbq-review-q {
	color: var(--lbfe-muted);
	font-weight: 700;
}

/* Admin panel on the city editor. */
.lbq-admin-state {
	border-radius: 4px;
	font-size: 12px;
	font-weight: 600;
	padding: 3px 8px;
}

.lbq-admin-state.is-ready {
	background: #d7f5dd;
	color: #1f7a3a;
}

.lbq-admin-state.is-off {
	background: #fde2e4;
	color: #a11220;
}

.lbq-admin-reasons {
	color: #a11220;
	margin: 0 0 12px 18px;
}

.lbq-admin-visitors {
	display: grid;
	gap: 6px;
}

@media (max-width: 720px) {
	.lbq-place {
		grid-template-columns: 1fr;
	}

	.lbq-place-card .lbq-card {
		max-width: 320px;
	}

	.lbq-review li {
		grid-template-columns: 3rem 1fr;
	}

	.lbq-review-yours {
		grid-column: 2;
	}
}

@media (prefers-reduced-motion: reduce) {
	.lbq-option,
	.lbq-letter,
	.lbq-cell,
	.lbq-pin,
	.lbfe-btn {
		transition: none;
	}
}
