:root {
	--cream: #f6efe3;
	--ink: #2c2620;
	--soft: #6b6258;
	--rule: #c46a4a;
	--shadow: 0 10px 28px rgb(40 30 20 / 0.16);
}

* { box-sizing: border-box; }

html, body {
	margin: 0;
	height: 100%;
	overflow: hidden;
	background: #c3d0a4;
	color: var(--ink);
	font: 500 14px/1.4 Nunito, "Trebuchet MS", sans-serif;
	-webkit-font-smoothing: antialiased;
}

canvas#map {
	position: fixed;
	inset: 0;
	width: 100%;
	height: 100%;
	display: block;
	cursor: grab;
	touch-action: none;
}

canvas#map.dragging { cursor: grabbing; }
canvas#map.clickable { cursor: pointer; }
canvas#map.dragging.clickable { cursor: grabbing; }

.panel {
	position: fixed;
	z-index: 4;
	display: flex;
	align-items: flex-start;
	background: rgb(246 239 227 / 0.92);
	border: 1px solid rgb(44 38 32 / 0.08);
	box-shadow: var(--shadow);
	backdrop-filter: blur(10px);
	overflow: hidden;
	transition:
		padding 0.4s ease,
		border-radius 0.4s ease,
		min-width 0.4s ease,
		width 0.4s ease,
		height 0.4s ease,
		max-width 0.4s ease,
		background 0.4s ease;
}

.plaque {
	top: max(16px, env(safe-area-inset-top));
	left: max(16px, env(safe-area-inset-left));
	min-width: 220px;
	max-width: min(360px, calc(100vw - 32px));
	padding: 14px 48px 12px 18px;
	border-radius: 18px;
}

.credits {
	right: max(16px, env(safe-area-inset-right));
	bottom: max(16px, env(safe-area-inset-bottom));
	max-width: min(320px, calc(100vw - 32px));
	padding: 8px 44px 8px 12px;
	border-radius: 12px;
	font-size: 11px;
	line-height: 1.45;
	color: var(--soft);
	margin: 0;
}

.panel-toggle {
	position: absolute;
	top: 4px;
	right: 4px;
	z-index: 1;
	box-sizing: border-box;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	border-radius: 14px;
	background: transparent;
	color: var(--ink);
	cursor: pointer;
	display: grid;
	place-items: center;
	touch-action: manipulation;
	-webkit-tap-highlight-color: transparent;
}

.panel-toggle:focus-visible {
	outline: 2px solid var(--rule);
	outline-offset: 2px;
}

.panel-toggle .icon { display: none; line-height: 0; }
.panel-toggle .icon-close { display: block; }
.panel.collapsed .panel-toggle .icon-open { display: block; }
.panel.collapsed .panel-toggle .icon-close { display: none; }

.panel-body {
	display: grid;
	grid-template-rows: 1fr;
	opacity: 1;
	min-width: 0;
	transition:
		grid-template-rows 0.4s ease,
		opacity 0.3s ease,
		padding 0.4s ease;
}

.panel-inner { overflow: hidden; min-width: 0; }

.panel.collapsed {
	width: 44px;
	height: 44px;
	min-width: 44px;
	max-width: 44px;
	padding: 0;
	border-radius: 14px;
}

.panel.collapsed .panel-toggle {
	inset: 0;
	width: 100%;
	height: 100%;
	border-radius: inherit;
}

.panel.collapsed .panel-body {
	grid-template-rows: 0fr;
	opacity: 0;
	pointer-events: none;
	width: 0;
	overflow: hidden;
}

.credits p { margin: 0; }
.credits a {
	color: var(--ink);
	text-decoration-color: rgb(44 38 32 / 0.3);
	text-underline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
	.panel, .panel-body { transition: none; }
}

.kicker {
	margin: 0 0 2px;
	font-size: 11px;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--rule);
	font-weight: 700;
}

.star {
	display: inline-block;
	transform: scale(0.95);
	margin-right: 2px;
}

h1 {
	margin: 0;
	font-family: Fraunces, "Palatino Linotype", Palatino, serif;
	font-weight: 600;
	font-size: clamp(1.35rem, 2.4vw, 1.85rem);
	letter-spacing: -0.02em;
	line-height: 1.15;
}

.sky-label {
	margin: 8px 0 0;
	padding-top: 8px;
	border-top: 1px solid rgb(44 38 32 / 0.1);
	font-size: 12px;
	color: var(--soft);
}

.hint {
	position: fixed;
	left: 50%;
	bottom: max(18px, env(safe-area-inset-bottom));
	transform: translateX(-50%);
	z-index: 2;
	margin: 0;
	padding: 6px 12px;
	border-radius: 999px;
	background: rgb(246 239 227 / 0.82);
	color: var(--soft);
	font-size: 12px;
	pointer-events: none;
	box-shadow: 0 4px 16px rgb(40 30 20 / 0.1);
}


.welcome {
	position: fixed;
	inset: 0;
	z-index: 5;
	display: grid;
	place-items: center;
	background: #dce8f0;
	color: var(--soft);
	font-family: Fraunces, serif;
	font-size: 1.4rem;
	transition: opacity 0.7s ease;
}

.welcome.done {
	opacity: 0;
	pointer-events: none;
}

@media (max-width: 640px) {
	.plaque { padding: 12px 48px 12px 14px; }
	.plaque:not(.collapsed) { max-width: calc(100vw - 32px); }
	.credits:not(.collapsed) { max-width: calc(100vw - 32px); }
}

.plane-count {
	margin: 6px 0 0;
	font-size: 12px;
	color: var(--ink);
}

.plane-card {
	position: fixed;
	top: 0;
	left: 0;
	z-index: 3;
	min-width: 150px;
	padding: 10px 12px 9px;
	background: rgb(246 239 227 / 0.94);
	border: 1px solid rgb(44 38 32 / 0.08);
	border-radius: 14px;
	box-shadow: var(--shadow);
	pointer-events: none;
	backdrop-filter: blur(10px);
}

.plane-card .callsign {
	margin: 0;
	font-weight: 700;
	letter-spacing: 0.04em;
	font-size: 14px;
}

.plane-card .facts {
	margin: 4px 0 0;
	display: flex;
	flex-wrap: wrap;
	gap: 0 8px;
	font-size: 11px;
	color: var(--soft);
}

.plane-card .facts span + span::before {
	content: "·";
	margin-right: 8px;
	color: rgb(44 38 32 / 0.35);
}

.ops-label {
	margin: 6px 0 0;
	font-size: 11px;
	color: var(--soft);
	line-height: 1.35;
}

.ops-label[hidden] { display: none; }

.plane-card .card-close {
	position: absolute;
	top: 6px;
	right: 6px;
	display: grid;
	place-items: center;
	width: 24px;
	height: 24px;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: transparent;
	color: var(--soft);
	cursor: pointer;
	pointer-events: auto;
}
.plane-card .card-close:hover { background: rgb(44 38 32 / 0.08); color: var(--ink); }
.plane-card .callsign { padding-right: 22px; }

.follow-pill {
	position: fixed;
	top: max(16px, env(safe-area-inset-top));
	left: 50%;
	transform: translateX(-50%);
	z-index: 4;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	max-width: calc(100vw - 140px);
	min-height: 44px;
	padding: 0 14px 0 14px;
	border: 1px solid rgb(44 38 32 / 0.08);
	border-radius: 999px;
	background: rgb(246 239 227 / 0.92);
	box-shadow: var(--shadow);
	backdrop-filter: blur(10px);
	color: var(--ink);
	font: 600 13px/1 Nunito, "Trebuchet MS", sans-serif;
	white-space: nowrap;
	cursor: pointer;
	touch-action: manipulation;
}
.follow-pill[hidden] { display: none; }
.follow-pill strong { font-weight: 800; letter-spacing: 0.04em; }
.follow-pill svg { flex: none; color: var(--soft); }
.follow-pill:hover svg { color: var(--ink); }
.follow-pill:focus-visible { outline: 2px solid #1f4e8c; outline-offset: 2px; }
.follow-dot {
	flex: none;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #2f7d4f;
	box-shadow: 0 0 0 3px rgb(47 125 79 / 0.18);
	animation: follow-pulse 1.6s ease-in-out infinite;
}
@keyframes follow-pulse { 50% { box-shadow: 0 0 0 6px rgb(47 125 79 / 0.05); } }
@media (prefers-reduced-motion: reduce) { .follow-dot { animation: none; } }
