/* LopoRail Games Integration — Sim HQ styles.
 *
 * Scoped under .lg-* and driven by the theme's existing custom properties
 * (--fg, --muted, --border, --surface) with fallbacks, so the hub inherits the
 * site palette instead of hardcoding a second one.
 *
 * Inspector Milestone badges are pure CSS token classes — no image assets, per
 * the researched decision to avoid an asset-library dependency.
 */

.lg-hub {
	/* Spacing and width come from the theme's .section > .container wrapper
	 * (loporail_games_render_hub_body), so the hub matches every other page. */
}

.lg-wrap {
	/* Layout hook only — the theme's .container owns the width. */
}

/* Header ------------------------------------------------------------- */

.lg-eyebrow {
	margin: 0 0 4px;
	font-size: 0.8rem;
	letter-spacing: 0.09em;
	text-transform: uppercase;
	color: var(--muted, #5a6673);
}

.lg-hub__title {
	margin: 0 0 8px;
	font-size: clamp(1.9rem, 4vw, 2.6rem);
	line-height: 1.1;
	color: var(--fg, #0d1b2a);
}

.lg-hub__lede {
	max-width: 68ch;
	margin: 0 0 28px;
	color: var(--muted, #48545f);
	line-height: 1.6;
}

/* Layout ------------------------------------------------------------- */

.lg-grid {
	display: grid;
	grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
	gap: 24px;
	align-items: start;
}

@media (max-width: 880px) {
	.lg-grid {
		grid-template-columns: 1fr;
	}
}

.lg-panel {
	padding: 24px;
	border: 1px solid var(--border, rgba(13, 27, 42, 0.12));
	border-radius: 16px;
	background: var(--surface, #ffffff);
}

.lg-panel + .lg-panel,
.lg-panel--queue {
	margin-top: 24px;
}

.lg-panel__title {
	margin: 0 0 16px;
	font-size: 1.1rem;
	color: var(--fg, #0d1b2a);
}

.lg-subhead {
	margin: 24px 0 10px;
	font-size: 0.95rem;
	color: var(--fg, #0d1b2a);
}

/* Leaderboard -------------------------------------------------------- */

.lg-board {
	margin: 0;
	padding: 0;
	list-style: none;
	counter-reset: none;
}

.lg-board__row {
	display: grid;
	grid-template-columns: 2.2rem minmax(0, 1fr) 6rem 4.5rem;
	gap: 10px;
	align-items: baseline;
	padding: 9px 0;
	border-bottom: 1px solid var(--border, rgba(13, 27, 42, 0.08));
	font-size: 0.95rem;
}

.lg-board__row:last-child {
	border-bottom: 0;
}

.lg-board__rank {
	font-variant-numeric: tabular-nums;
	color: var(--muted, #5a6673);
}

.lg-board__name {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	color: var(--fg, #0d1b2a);
}

.lg-board__miles {
	text-align: right;
	font-variant-numeric: tabular-nums;
	font-weight: 600;
}

.lg-board__runs {
	text-align: right;
	font-size: 0.82rem;
	color: var(--muted, #5a6673);
}

/* Form --------------------------------------------------------------- */

.lg-form {
	display: grid;
	gap: 14px;
}

.lg-field {
	display: grid;
	gap: 5px;
	min-width: 0;
}

.lg-field-row {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
	gap: 12px;
}

.lg-label {
	font-size: 0.8rem;
	font-weight: 600;
	color: var(--fg, #0d1b2a);
}

.lg-form input,
.lg-form select {
	width: 100%;
	box-sizing: border-box;
	padding: 9px 11px;
	border: 1px solid var(--border, rgba(13, 27, 42, 0.18));
	border-radius: 10px;
	background: var(--surface, #fff);
	color: var(--fg, #0d1b2a);
	font: inherit;
	font-size: 0.95rem;
}

.lg-form input:focus,
.lg-form select:focus {
	outline: 2px solid #1e6fcc;
	outline-offset: 1px;
}

.lg-form input:disabled,
.lg-form select:disabled {
	opacity: 0.55;
}

.lg-submit {
	padding: 11px 20px;
	border: 0;
	border-radius: 10px;
	background: var(--fg, #0d1b2a);
	color: #fff;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}

.lg-submit:disabled {
	opacity: 0.5;
	cursor: progress;
}

.lg-hint,
.lg-quota {
	margin: 0;
	font-size: 0.82rem;
	color: var(--muted, #5a6673);
}

.lg-quota--limited {
	color: #b4232b;
	font-weight: 600;
}

.lg-result {
	min-height: 1.2em;
	font-size: 0.88rem;
}

.lg-result--good {
	color: #1a7f4b;
}

.lg-result--bad {
	color: #b4232b;
}

.lg-alert {
	margin: 0 0 12px;
	padding: 9px 12px;
	border-radius: 10px;
	font-size: 0.88rem;
}

.lg-alert--bad {
	background: rgba(180, 35, 43, 0.08);
	color: #8f1c22;
}

.lg-alert--good {
	background: rgba(26, 127, 75, 0.08);
	color: #14663c;
}

/* Steam link panel */
.lg-steam {
	margin-top: 18px;
	padding-top: 16px;
	border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.lg-steam__who {
	margin: 0 0 10px;
	font-weight: 600;
}

.lg-steam__identity {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0 0 10px;
}

.lg-steam__identity .lg-steam__who {
	margin: 0;
}

.lg-steam__avatar {
	display: block;
	flex: 0 0 auto;
	width: 48px;
	height: 48px;
	border-radius: 8px;
}

.lg-submit--ghost {
	background: transparent;
	border: 1px solid currentColor;
	color: inherit;
}

.lg-submit--danger {
	background: #b4232b;
	border-color: #b4232b;
	color: #fff;
}

/* Inspector milestone shelf */
.lg-badges__list {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
	gap: 10px;
	margin: 0 0 10px;
	padding: 0;
	list-style: none;
}

.lg-badge {
	display: flex;
	flex-direction: column;
	gap: 2px;
	padding: 10px 12px;
	border-radius: 10px;
	border: 1px solid rgba(0, 0, 0, 0.12);
}

.lg-badge--earned {
	border-color: #1a7f4b;
	background: rgba(26, 127, 75, 0.06);
}

.lg-badge--locked {
	opacity: 0.62;
}

.lg-badge__name {
	font-weight: 700;
}

.lg-badge__req,
.lg-badge__state {
	font-size: 0.8rem;
}

.lg-badges__progress {
	margin: 0;
	font-size: 0.9rem;
}

/* Anonymisation panel */
.lg-anon {
	margin-top: 18px;
	padding-top: 16px;
	border-top: 1px solid rgba(0, 0, 0, 0.08);
}

/* Model inventory */
.lg-roster {
	margin-top: 4px;
}

.lg-table {
	width: 100%;
	border-collapse: collapse;
	margin: 10px 0;
	font-size: 0.88rem;
}

.lg-table th,
.lg-table td {
	text-align: left;
	padding: 6px 8px;
	border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.lg-roster__csv {
	margin-top: 12px;
}

.lg-roster__import {
	margin-top: 10px;
}

.lg-roster__import textarea {
	width: 100%;
	margin: 8px 0;
	font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
	font-size: 0.85rem;
}

.lg-panel--badges,
.lg-panel--roster {
	grid-column: 1 / -1;
}

.lg-empty {
	margin: 0;
	padding: 18px 0;
	color: var(--muted, #5a6673);
	font-size: 0.92rem;
}

.lg-signin p {
	margin: 0 0 10px;
}

/* Tables ------------------------------------------------------------- */

.lg-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.88rem;
}

.lg-table th,
.lg-table td {
	padding: 7px 8px;
	text-align: left;
	border-bottom: 1px solid var(--border, rgba(13, 27, 42, 0.08));
}

.lg-table th {
	font-size: 0.76rem;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--muted, #5a6673);
}

.lg-num {
	text-align: right;
	font-variant-numeric: tabular-nums;
}

.lg-status {
	display: inline-block;
	padding: 2px 8px;
	border-radius: 999px;
	font-size: 0.76rem;
	font-weight: 600;
	white-space: nowrap;
}

.lg-status--pending {
	background: rgba(30, 111, 204, 0.1);
	color: #1e6fcc;
}

.lg-status--verified {
	background: rgba(26, 127, 75, 0.12);
	color: #1a7f4b;
}

.lg-status--flagged {
	background: rgba(232, 141, 26, 0.14);
	color: #a2650d;
}

.lg-status--rejected {
	background: rgba(180, 35, 43, 0.1);
	color: #8f1c22;
}

.lg-actions {
	white-space: nowrap;
}

.lg-btn {
	margin-right: 5px;
	padding: 4px 9px;
	border: 1px solid var(--border, rgba(13, 27, 42, 0.18));
	border-radius: 8px;
	background: transparent;
	color: var(--fg, #0d1b2a);
	font: inherit;
	font-size: 0.78rem;
	cursor: pointer;
}

.lg-btn:hover:not(:disabled) {
	border-color: #1e6fcc;
	color: #1e6fcc;
}

.lg-btn:disabled {
	opacity: 0.5;
	cursor: progress;
}

.lg-btn--fake:hover:not(:disabled) {
	border-color: #b4232b;
	color: #b4232b;
}

/* Paywall ------------------------------------------------------------ */

.lg-paywall {
	padding: 6px 20px 22px;
	text-align: center;
}

.lg-paywall__badge {
	width: 44px;
	height: 44px;
	margin: -22px auto 12px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--surface, #f6f8fb);
	border: 3px solid var(--surface-2, #08121c);
}

.lg-paywall__title {
	margin: 0 0 8px;
	font-size: 1.1rem;
	color: var(--fg, #0d1b2a);
}

.lg-paywall__body {
	margin: 0 auto 16px;
	max-width: 42ch;
	font-size: 0.9rem;
	line-height: 1.55;
	color: var(--muted, #3a4654);
}

.lg-paywall__cta {
	margin: 0;
	display: flex;
	gap: 10px;
	justify-content: center;
	flex-wrap: wrap;
}

/* Inspector Milestone badges — pure CSS tokens, no image assets. */

.lg-badge {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 3px 10px;
	border-radius: 999px;
	font-size: 0.76rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.lg-badge--solid {
	border: 2px solid #6b7785;
	color: #4a5563;
}

.lg-badge--glow {
	background: rgba(180, 120, 60, 0.14);
	box-shadow: 0 0 0 1px rgba(180, 120, 60, 0.4), 0 0 10px rgba(180, 120, 60, 0.25);
	color: #8a5a22;
}

.lg-badge--metallic {
	background: linear-gradient(120deg, #cfd6dd, #f2f5f8 45%, #b8c1ca);
	color: #2f3a45;
}

.lg-badge--platinum {
	background: linear-gradient(120deg, #9fb3c8, #e8eef4 45%, #8ea3b8);
	color: #1f2a35;
}

.lg-badge--locked {
	border: 1px dashed var(--border, rgba(13, 27, 42, 0.2));
	color: var(--muted, #77828d);
}

/* ------------------------------------------------------------------ */
/* Landing: explainer tabs                                             */
/* ------------------------------------------------------------------ */

.lg-panel--explainer {
	margin-bottom: 22px;
}

.lg-tabs__list {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-bottom: 14px;
	border-bottom: 1px solid var(--border, rgba(13, 27, 42, 0.12));
}

.lg-tabs__tab {
	appearance: none;
	background: transparent;
	border: 0;
	border-bottom: 2px solid transparent;
	padding: 8px 12px;
	font: inherit;
	font-weight: 600;
	color: var(--muted, #77828d);
	cursor: pointer;
}

.lg-tabs__tab:hover {
	color: inherit;
}

.lg-tabs__tab[aria-selected="true"] {
	color: inherit;
	border-bottom-color: currentColor;
}

.lg-tabs__tab:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.lg-tabs__panel[hidden] {
	display: none;
}

.lg-steps {
	margin: 0;
	padding-left: 1.1em;
	display: grid;
	gap: 8px;
}

.lg-facts {
	margin: 0 0 10px;
	padding-left: 1.1em;
	display: grid;
	gap: 6px;
}

.lg-facts__sub {
	margin: 6px 0 0;
	padding-left: 1.1em;
	display: grid;
	gap: 2px;
	font-size: 0.92rem;
}

/* ------------------------------------------------------------------ */
/* Landing: gamification bridge                                        */
/* ------------------------------------------------------------------ */

.lg-panel--gamify,
.lg-panel--guides,
.lg-panel--faq,
.lg-board-embed {
	grid-column: 1 / -1;
}

.lg-lanes {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
	gap: 10px;
	margin: 0 0 10px;
	padding: 0;
	list-style: none;
}

.lg-lane {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 8px;
	padding: 10px 12px;
	border-radius: 10px;
	background: rgba(13, 27, 42, 0.04);
}

.lg-lane__label {
	font-size: 0.85rem;
}

.lg-lane__points {
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}

.lg-board-embed {
	margin-top: 18px;
}

/* ------------------------------------------------------------------ */
/* Landing: guide cards                                                */
/* ------------------------------------------------------------------ */

.lg-guides-index__grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
	gap: 14px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.lg-guide-card {
	display: flex;
}

.lg-guide-card__link {
	display: flex;
	flex-direction: column;
	gap: 6px;
	width: 100%;
	padding: 16px;
	border: 1px solid var(--border, rgba(13, 27, 42, 0.12));
	border-radius: 12px;
	text-decoration: none;
	color: inherit;
	transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}

.lg-guide-card__link:hover,
.lg-guide-card__link:focus-visible {
	transform: translateY(-2px);
	box-shadow: 0 6px 18px rgba(13, 27, 42, 0.12);
	border-color: currentColor;
}

.lg-guide-card__link:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.lg-guide-card__name {
	font-weight: 700;
}

.lg-guide-card__segment {
	font-size: 0.9rem;
	opacity: 0.85;
}

.lg-guide-card__meta {
	margin-top: auto;
	font-size: 0.8rem;
	color: var(--muted, #77828d);
}

/* ------------------------------------------------------------------ */
/* Landing: FAQ                                                        */
/* ------------------------------------------------------------------ */

.lg-faq__item {
	border-bottom: 1px solid var(--border, rgba(13, 27, 42, 0.1));
	padding: 10px 0;
}

.lg-faq__item summary {
	cursor: pointer;
	font-weight: 600;
}

.lg-faq__item summary:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.lg-faq__item p {
	margin: 8px 0 0;
	opacity: 0.9;
}

/* ------------------------------------------------------------------ */
/* Guide page                                                          */
/* ------------------------------------------------------------------ */

.lg-guide__title {
	margin: 0 0 8px;
}

.lg-guide__lede {
	margin: 0 0 18px;
	font-size: 1.05rem;
	opacity: 0.9;
}

.lg-guide__facts {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 12px;
	margin: 0 0 22px;
}

.lg-guide__fact {
	padding: 12px 14px;
	border-radius: 10px;
	background: rgba(13, 27, 42, 0.04);
}

.lg-guide__fact dt {
	font-size: 0.78rem;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--muted, #77828d);
}

.lg-guide__fact dd {
	margin: 4px 0 0;
	font-weight: 600;
}

.lg-guide__h2 {
	margin: 26px 0 8px;
}

.lg-guide__steps,
.lg-guide__tips {
	display: grid;
	gap: 6px;
	margin: 0;
	padding-left: 1.1em;
}

.lg-guide__cta {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 26px;
}

.lg-guides-index__title {
	margin: 0 0 8px;
}

.lg-guides-index__lede {
	margin: 0 0 20px;
	font-size: 1.05rem;
	opacity: 0.9;
}

.lg-guides-index__cta {
	margin-top: 24px;
}

/* ------------------------------------------------------------------ */
/* Stats                                                               */
/* ------------------------------------------------------------------ */

.lg-panel--stats,
.lg-panel--challenges {
	grid-column: 1 / -1;
}

.lg-stats-cards {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
	gap: 10px;
	margin: 0 0 12px;
	padding: 0;
	list-style: none;
}

.lg-stat {
	display: flex;
	flex-direction: column;
	gap: 2px;
	padding: 12px 14px;
	border-radius: 10px;
	background: rgba(13, 27, 42, 0.04);
}

.lg-stat__value {
	font-size: 1.5rem;
	font-weight: 700;
	line-height: 1.1;
	font-variant-numeric: tabular-nums;
}

.lg-stat__label {
	font-size: 0.8rem;
	color: var(--muted, #77828d);
}

.lg-stat__note {
	font-size: 0.72rem;
	color: var(--muted, #77828d);
}

.lg-stats__h2 {
	margin: 24px 0 10px;
	font-size: 1.05rem;
}

.lg-stats__cols {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 18px;
}

.lg-stats__longest {
	margin-top: 18px;
}

.lg-stats__cta {
	margin-top: 24px;
}

/* CSS-only monthly bars */
.lg-bars {
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: 1fr;
	align-items: end;
	gap: 6px;
	height: 160px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.lg-bar {
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	align-items: center;
	height: 100%;
	gap: 4px;
	font-size: 0.68rem;
	color: var(--muted, #77828d);
}

.lg-bar__col {
	display: block;
	width: 100%;
	border-radius: 4px 4px 0 0;
	background: currentColor;
	opacity: 0.55;
	min-height: 2px;
	align-self: stretch;
}

.lg-bar:hover .lg-bar__col {
	opacity: 0.9;
}

.lg-bar__value {
	font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------------------------ */
/* Challenges                                                          */
/* ------------------------------------------------------------------ */

.lg-challenge-list {
	display: grid;
	gap: 12px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.lg-challenge {
	display: grid;
	gap: 4px;
	padding: 12px 14px;
	border: 1px solid var(--border, rgba(13, 27, 42, 0.12));
	border-radius: 10px;
}

.lg-challenge--met {
	border-color: #1a7f4b;
	background: rgba(26, 127, 75, 0.06);
}

.lg-challenge__label {
	font-weight: 700;
}

.lg-challenge__desc {
	font-size: 0.85rem;
	opacity: 0.85;
}

.lg-challenge__bar {
	display: block;
	height: 8px;
	border-radius: 999px;
	background: rgba(13, 27, 42, 0.1);
	overflow: hidden;
	margin-top: 4px;
}

.lg-challenge__fill {
	display: block;
	height: 100%;
	background: currentColor;
	opacity: 0.7;
	border-radius: 999px;
}

.lg-challenge--met .lg-challenge__fill {
	opacity: 1;
}

.lg-challenge__meta {
	font-size: 0.78rem;
	color: var(--muted, #77828d);
}
