:root {
  --bg: #1f2428; --ink: #f4efe6; --muted: #b8b2a7; --panel: rgb(28 32 36 / .86);
  --line: rgb(255 255 255 / .12); --accent: #f2b544; --accent-ink: #231a06;
  --shadow: 0 8px 24px rgb(0 0 0 / .35);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--ink);
  font: 14px/1.4 Geist, system-ui, sans-serif; -webkit-tap-highlight-color: transparent; }
canvas#map { position: fixed; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: grab; display: block; }
canvas#map.drag { cursor: grabbing; }
canvas#labels { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; }

/* tilt-shift: blurred bands at the top and bottom of the screen */
#tilt { position: fixed; inset: 0; pointer-events: none; }
#tilt .band { position: absolute; left: 0; right: 0; height: 38%; backdrop-filter: blur(var(--tilt, 3px)); -webkit-backdrop-filter: blur(var(--tilt, 3px)); }
#tilt .top { top: 0; mask-image: linear-gradient(#000 0%, #000 25%, transparent 100%); -webkit-mask-image: linear-gradient(#000 0%, #000 25%, transparent 100%); }
#tilt .bottom { bottom: 0; mask-image: linear-gradient(transparent 0%, #000 75%, #000 100%); -webkit-mask-image: linear-gradient(transparent 0%, #000 75%, #000 100%); }
#tilt[hidden] { display: none; }

.logo { position: fixed; top: 14px; left: 16px; display: flex; flex-direction: column; align-items: flex-start;
  padding: 8px 14px 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: var(--shadow); backdrop-filter: blur(8px); user-select: none; }
.logo .tiny { font: 700 12px/1 "Pixelify Sans", monospace; letter-spacing: .4em; color: var(--accent); }
.logo .name { font: 700 34px/1 "Pixelify Sans", monospace; color: var(--ink); text-shadow: 2px 2px 0 #000; }

.search { position: fixed; top: 14px; left: 50%; transform: translateX(-50%); width: min(420px, calc(100vw - 32px));
  display: flex; align-items: center; gap: 8px; padding: 0 14px; height: 44px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); backdrop-filter: blur(8px); }
.search svg { width: 18px; height: 18px; fill: none; stroke: var(--muted); stroke-width: 2; flex: none; }
.search input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; color: var(--ink); font: inherit; font-size: 15px; }
.search input::placeholder { color: var(--muted); }
#results { position: absolute; top: 48px; left: 0; right: 0; margin: 0; padding: 6px; list-style: none;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); backdrop-filter: blur(8px); }
#results li { padding: 8px 10px; border-radius: 8px; cursor: pointer; }
#results li small { color: var(--muted); margin-left: 6px; }
#results li:hover, #results li[aria-selected="true"] { background: rgb(255 255 255 / .08); }

.rail { position: fixed; right: 14px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 4px;
  padding: 6px; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; box-shadow: var(--shadow); backdrop-filter: blur(8px); }
.rail button { width: 38px; height: 38px; border: 0; border-radius: 50%; background: none; color: var(--ink);
  font: 600 18px/1 Geist, system-ui, sans-serif; cursor: pointer; }
.rail button:hover { background: rgb(255 255 255 / .1); }
.rail button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.rail hr { width: 60%; border: 0; border-top: 1px solid var(--line); margin: 4px auto; }

.mini { position: fixed; left: 16px; bottom: 16px; padding: 6px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; box-shadow: var(--shadow); cursor: crosshair; }
.mini canvas { display: block; border-radius: 6px; image-rendering: auto; touch-action: none; }

.panel { position: fixed; right: 70px; top: 50%; transform: translateY(-50%); width: min(340px, calc(100vw - 100px));
  padding: 18px 20px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow); backdrop-filter: blur(10px); }
.panel h2 { margin: 0 0 8px; font: 700 22px/1 "Pixelify Sans", monospace; }
.panel p { margin: 8px 0; color: var(--muted); }
.panel a { color: var(--accent); }
.panel .close { position: absolute; top: 8px; right: 10px; background: none; border: 0; color: var(--muted); font-size: 22px; cursor: pointer; }
.panel .credit { font-size: 12px; }

.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); padding: 8px 14px; border-radius: 999px;
  background: var(--accent); color: var(--accent-ink); font-weight: 600; box-shadow: var(--shadow); }
.credit-badge { position: fixed; right: 12px; bottom: 10px; font-size: 11px; color: var(--ink); padding: 3px 8px;
  border-radius: 6px; background: rgb(0 0 0 / .45); pointer-events: none; }
[hidden] { display: none !important; }

@media (max-width: 900px) and (min-width: 641px) {
  .search { left: auto; right: 16px; transform: none; width: calc(100vw - 230px); }
}
@media (max-width: 640px) {
  .logo { top: 70px; padding: 6px 10px 8px; }
  .logo .name { font-size: 24px; }
  .mini { display: none; }
  .rail { top: auto; bottom: 16px; transform: none; }
  .panel { right: 16px; left: 16px; width: auto; }
}

#compass { transition: transform .35s ease; display: block; margin: auto; }
#compassBtn { cursor: default; }
canvas#map.turned { animation: turned .35s ease; }
@keyframes turned { from { opacity: .35; } to { opacity: 1; } }
