*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
	background: #0d0d0d;
	overflow: hidden;
	font-family: Helvetica, Arial, sans-serif;
}

#map {
	position: fixed;
	inset: 0;
	display: block;
	cursor: grab;
}

#map:active {
	cursor: grabbing;
}

#ui {
	position: fixed;
	top: 16px;
	left: 16px;
	z-index: 10;
	display: flex;
	align-items: center;
	gap: 16px;
	color: #fff;
	font-size: 13px;
	pointer-events: none;
}

#title {
	font-weight: bold;
	font-size: 15px;
	letter-spacing: 0.05em;
}

#last-updated,
#status {
	color: #888;
	font-size: 11px;
}

/* ── Legend ─────────────────────────────────────────────────────────────── */

#legend {
	position: fixed;
	top: 52px;
	left: 16px;
	z-index: 10;
	display: flex;
	flex-direction: column;
	gap: 3px;
}

.legend-group {
	display: flex;
	align-items: center;
	gap: 4px;
	padding: 5px 8px;
	border-radius: 6px;
	background: rgba(255,255,255,0.05);
	cursor: pointer;
	transition: background 0.15s, opacity 0.15s;
	user-select: none;
}

.legend-group:hover {
	background: rgba(255,255,255,0.1);
}

.legend-group.off {
	opacity: 0.3;
}

.route-badge {
	width: 18px;
	height: 18px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 9px;
	font-weight: bold;
	font-family: Helvetica, Arial, sans-serif;
	flex-shrink: 0;
}

/* ── Info panel ─────────────────────────────────────────────────────────── */

#info {
	position: fixed;
	z-index: 30;
	background: rgba(18, 18, 18, 0.96);
	border: 1px solid #333;
	border-radius: 8px;
	padding: 11px 14px;
	color: #fff;
	font-size: 13px;
	min-width: 190px;
	max-width: 260px;
	pointer-events: none;
	backdrop-filter: blur(4px);
}

#info.hidden { display: none; }

.info-header {
	display: flex;
	align-items: center;
	gap: 9px;
	margin-bottom: 8px;
}

.info-header .badge {
	width: 22px;
	height: 22px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 11px;
	font-weight: bold;
	font-family: Helvetica, Arial, sans-serif;
	flex-shrink: 0;
}

.info-header .dir {
	font-size: 12px;
	color: #aaa;
}

.info-header.station .sname {
	font-weight: bold;
	font-size: 14px;
}

.info-id {
	font-size: 11px;
	color: #666;
}

.info-stops {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.info-stop {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	font-size: 12px;
	color: #aaa;
}

.info-stop.next {
	color: #fff;
	font-weight: 600;
}

.info-stop .eta {
	color: #888;
	white-space: nowrap;
}

.info-stop.next .eta {
	color: #fccc0a;
}
