/*
 * Built In Bed Lotto
 * Mobile-first. The board must be readable on a ~380px phone screen, so under
 * 640px the table becomes stacked cards rather than a horizontal scroll.
 * No web fonts, no external assets.
 */

.bib-lotto {
	--bib-ink: #1c1c1c;
	--bib-muted: #5f6672;
	--bib-line: #e2e5ea;
	--bib-accent: #1f5c9e;
	--bib-accent-soft: #eef4fb;
	--bib-warn: #b45309;
	--bib-warn-soft: #fdf3e3;
	--bib-num: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

	color: var(--bib-ink);
	line-height: 1.45;
	max-width: 100%;
}

.bib-lotto * {
	box-sizing: border-box;
}

/* ---------- header ---------- */

.bib-lotto-header {
	margin-bottom: 1.25rem;
}

.bib-lotto-title {
	margin: 0 0 0.25rem;
	font-size: 1.5rem;
	line-height: 1.2;
}

.bib-lotto-asof,
.bib-lotto-counts {
	margin: 0;
	font-size: 0.875rem;
	color: var(--bib-muted);
}

.bib-lotto-asof.bib-lotto-stale {
	display: inline-block;
	color: var(--bib-warn);
	background: var(--bib-warn-soft);
	border-left: 3px solid var(--bib-warn);
	padding: 0.35rem 0.6rem;
	border-radius: 0 3px 3px 0;
}

/* ---------- best picks ---------- */

.bib-lotto-picks {
	border: 1px solid var(--bib-accent);
	border-left-width: 4px;
	background: var(--bib-accent-soft);
	border-radius: 4px;
	padding: 0.9rem 1rem;
	margin: 0 0 1.5rem;
}

.bib-lotto-picks-title {
	margin: 0 0 0.6rem;
	font-size: 1.05rem;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	color: var(--bib-accent);
}

.bib-lotto-picks-list {
	margin: 0 0 0.75rem;
	padding-left: 1.2rem;
}

.bib-lotto-pick {
	margin-bottom: 0.7rem;
}

.bib-lotto-pick:last-child {
	margin-bottom: 0;
}

.bib-lotto-pick-name {
	font-weight: 700;
}

.bib-lotto-pick-price {
	font-family: var(--bib-num);
	color: var(--bib-muted);
}

.bib-lotto-pick-stats,
.bib-lotto-pick-reason {
	display: block;
	font-size: 0.875rem;
}

.bib-lotto-pick-stats {
	font-family: var(--bib-num);
}

.bib-lotto-pick-reason {
	color: var(--bib-muted);
}

.bib-lotto-picks-honest,
.bib-lotto-picks-none {
	margin: 0;
	font-size: 0.875rem;
	color: var(--bib-muted);
}

.bib-lotto-picks-honest {
	border-top: 1px solid rgba(31, 92, 158, 0.2);
	padding-top: 0.6rem;
}

/* ---------- table ---------- */

.bib-lotto-table-section {
	margin-bottom: 1.25rem;
}

.bib-lotto-section-title {
	margin: 0 0 0.6rem;
	font-size: 1.05rem;
}

.bib-lotto-table-wrap {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

.bib-lotto-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.9rem;
}

.bib-lotto-table th,
.bib-lotto-table td {
	padding: 0.45rem 0.55rem;
	border-bottom: 1px solid var(--bib-line);
	text-align: left;
	vertical-align: baseline;
}

.bib-lotto-table thead th {
	font-size: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--bib-muted);
	border-bottom: 2px solid var(--bib-line);
	white-space: nowrap;
}

.bib-lotto-table .bib-num {
	text-align: right;
	font-family: var(--bib-num);
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.bib-lotto-game {
	font-weight: 600;
}

.bib-lotto-strong {
	font-weight: 700;
}

.bib-lotto-row-pick {
	background: var(--bib-accent-soft);
}

/* The accent bar rides the first cell: box-shadow on a <tr> is unreliable
   under border-collapse. */
.bib-lotto-row-pick .bib-lotto-game {
	box-shadow: inset 3px 0 0 var(--bib-accent);
}

.bib-lotto-pick-tag {
	display: inline-block;
	font-size: 0.65rem;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	font-weight: 700;
	color: var(--bib-accent);
	border: 1px solid currentColor;
	border-radius: 2px;
	padding: 0 0.25rem;
	vertical-align: middle;
	white-space: nowrap;
}

.bib-lotto-flag {
	color: var(--bib-warn);
	font-weight: 700;
	cursor: help;
}

.bib-lotto-footnote {
	margin: 0.6rem 0 0;
	font-size: 0.8rem;
	color: var(--bib-muted);
}

/* ---------- history ---------- */

.bib-lotto-history {
	margin-top: 1.75rem;
	padding-top: 1rem;
	border-top: 1px solid var(--bib-line);
}

.bib-lotto-subtitle {
	margin: 1rem 0 0.5rem;
	font-size: 0.95rem;
}

.bib-lotto-trends,
.bib-lotto-claims {
	list-style: none;
	margin: 0;
	padding: 0;
}

.bib-lotto-trend,
.bib-lotto-claim {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem;
	padding: 0.45rem 0;
	border-bottom: 1px solid var(--bib-line);
	font-size: 0.875rem;
}

.bib-lotto-trend-name,
.bib-lotto-claim-name {
	font-weight: 600;
	min-width: 9rem;
}

.bib-lotto-spark {
	color: var(--bib-accent);
	flex: none;
}

.bib-lotto-trend-values,
.bib-lotto-claim-detail {
	font-family: var(--bib-num);
	font-variant-numeric: tabular-nums;
}

.bib-lotto-trend-label {
	color: var(--bib-muted);
}

.bib-lotto-trend-up {
	color: #15803d;
}

.bib-lotto-trend-down {
	color: var(--bib-warn);
}

.bib-lotto-trend-count {
	color: var(--bib-muted);
	font-size: 0.8rem;
}

.bib-lotto-claim-date {
	font-family: var(--bib-num);
	color: var(--bib-muted);
	min-width: 6rem;
}

.bib-lotto-empty {
	margin: 0.25rem 0;
	color: var(--bib-muted);
	font-size: 0.9rem;
}

.bib-lotto-empty-note {
	margin: 0.25rem 0;
	color: var(--bib-muted);
	font-size: 0.8rem;
}

/* ---------- phone layout ----------
 * Below 640px the table restacks into one card per game. Game, price, sold,
 * shift and big carry the meaning, so they lead; the rest follow in a grid.
 * Nothing is hidden and nothing scrolls sideways.
 */

@media (max-width: 640px) {
	.bib-lotto-table,
	.bib-lotto-table tbody,
	.bib-lotto-table tr,
	.bib-lotto-table th,
	.bib-lotto-table td {
		display: block;
		width: 100%;
	}

	.bib-lotto-table thead {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip: rect(0 0 0 0);
		clip-path: inset(50%);
		white-space: nowrap;
	}

	.bib-lotto-row {
		border: 1px solid var(--bib-line);
		border-radius: 4px;
		padding: 0.6rem 0.7rem;
		margin-bottom: 0.7rem;
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 0.15rem 0.7rem;
	}

	.bib-lotto-row-pick {
		border-color: var(--bib-accent);
		box-shadow: inset 3px 0 0 var(--bib-accent);
	}

	.bib-lotto-table .bib-lotto-game {
		grid-column: 1 / -1;
		font-size: 1rem;
		border-bottom: 1px solid var(--bib-line);
		padding: 0 0 0.35rem;
		margin-bottom: 0.25rem;
		box-shadow: none; /* the card border carries the accent on phones */
	}

	.bib-lotto-table td {
		border-bottom: 0;
		padding: 0.12rem 0;
		display: flex;
		justify-content: space-between;
		align-items: baseline;
		gap: 0.5rem;
		text-align: right;
	}

	.bib-lotto-table td::before {
		content: attr(data-label);
		font-family: inherit;
		font-size: 0.7rem;
		text-transform: uppercase;
		letter-spacing: 0.03em;
		color: var(--bib-muted);
		text-align: left;
	}

	.bib-lotto-trend-name,
	.bib-lotto-claim-name {
		min-width: 0;
		flex-basis: 100%;
	}

	.bib-lotto-claim-date {
		min-width: 0;
	}
}
