/* Public ticker page: same visual language as the control dashboard's court
   cards (static/css/dashboard.css), but self-contained (the ticker is a
   separate standalone app) and theme-switched via prefers-color-scheme only,
   since nobody is around to click a light/dark toggle on a public display. */

:root {
	--bg: #f4f5f7;
	--panel: #fff;
	--fg: #1c2330;
	--muted: #667085;
	--border: #d8dde6;
	--state-free: #98a2b3;
	--state-playing: #16a34a;
}

@media (prefers-color-scheme: dark) {
	:root {
		/* stylelint-disable-next-line property-no-unknown */
		color-scheme: dark;

		--bg: #10141b;
		--panel: #1a212c;
		--fg: #e6e9ef;
		--muted: #98a2b3;
		--border: #2d3646;
		--state-free: #667085;
		--state-playing: #4ade80;
	}
}

html,
body {
	margin: 0;
	padding: 0;
	background: var(--bg);
	color: var(--fg);
	font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Droid Sans', Arial, sans-serif;
	font-size: 18px;
}
body {
	padding-bottom: 2.6em; /* room for the fixed last-update bar on small screens */
}

.main {
	max-width: 80em;
	margin: 0 auto;
	padding: 0.8em 1em 1.4em;
}

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

.topline {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: space-between;
	gap: 0.3em 1em;
	margin-bottom: 0.6em;
}
.topline h1 {
	margin: 0;
	font-size: 1.6em;
	line-height: 1.2;
}
.last_update {
	color: var(--muted);
	font-size: 0.8em;
}

.note {
	margin: 0.6em 0;
	color: var(--muted);
	font-size: 0.85em;
}

.error {
	color: #dc2626;
}

/* ------------------------------------------------------------ court cards */

.court_grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 19em), 1fr));
	gap: 0.8em;
}

.court_card {
	display: flex;
	flex-direction: column;
	gap: 0.45em;
	padding: 0.7em 0.8em;
	background: var(--panel);
	border: 1px solid var(--border);
	border-left: 6px solid var(--state-free);
	border-radius: 0.5em;
}
.court_card--playing {
	border-left-color: var(--state-playing);
}

.court_card_head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.5em;
}
.court_card_title {
	font-size: 1.1em;
	font-weight: 700;
}
.court_state {
	padding: 0.1em 0.6em;
	font-size: 0.7em;
	font-weight: 600;
	border-radius: 1em;
	color: var(--state-free);
	background: color-mix(in srgb, var(--state-free) 16%, transparent);
}
.court_state--playing {
	color: var(--state-playing);
	background: color-mix(in srgb, var(--state-playing) 16%, transparent);
}

.court_card_body {
	display: flex;
	flex-direction: column;
	gap: 0.3em;
}
.court_card_meta {
	font-size: 0.7em;
	color: var(--muted);
}
.court_card_row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.6em;
}
.dash_team {
	overflow-wrap: anywhere;
	white-space: pre-wrap;
}
.court_card_score {
	display: flex;
	flex-shrink: 0;
	gap: 0.5em;
}
.court_card_gamescore {
	display: inline-block;
	min-width: 1.3em;
	font-size: 1.3em;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	text-align: center;
}
.court_card_gamescore:empty::before {
	content: '\2013';
	color: var(--muted);
	font-weight: 400;
}
.court_card_free {
	padding: 0.6em 0;
	text-align: center;
	color: var(--muted);
	font-size: 0.85em;
}

@media (max-width: 641px) {
	.last_update {
		position: fixed;
		right: 0;
		bottom: 0;
		left: 0;
		z-index: 10;
		padding: 0.3em 0.7em;
		text-align: right;
		background: var(--panel);
		border-top: 1px solid var(--border);
	}
}
