/* BoBo Autonomous - public campus map. Black and red theme. */
:root {
  --bg: #050506;
  --red: #ff2d3d;
  --red-dim: #7a1020;
  --text: #f5f5f7;
  --text-2: rgba(245, 245, 247, .62);
  --glass: rgba(18, 18, 20, .62);
  --glass-edge: rgba(255, 255, 255, .10);
  --radius: 18px;
  --gap: 14px;
  --panel-width: 264px;
  --topbar-height: 64px;
  --ease: cubic-bezier(.22, 1, .36, 1);
}

[hidden] { display: none !important; }

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

.glass {
  background: var(--glass);
  border: 1px solid var(--glass-edge);
  border-radius: var(--radius);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  backdrop-filter: blur(18px) saturate(140%);
  box-shadow: 0 10px 40px rgba(0, 0, 0, .45);
}

/* ---------- map stage ---------- */
.stage { position: fixed; inset: 0; }
.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
.stage canvas.adding { cursor: crosshair; }

.labels { position: absolute; inset: 0; pointer-events: none; }
.lbl {
  position: absolute; transform: translate(-50%, -50%);
  font-weight: 700; font-size: 13px; letter-spacing: .04em;
  color: var(--text); text-shadow: 0 1px 6px rgba(0, 0, 0, .9);
}
.lbl.pt { color: var(--text); font-size: 12px; background: rgba(0, 0, 0, .6); border: 1px solid var(--glass-edge); border-radius: 999px; padding: 2px 8px; }
.lbl.pt.b { color: var(--red); border-color: rgba(255, 45, 61, .5); }

/* ---------- north arrow ---------- */
.north {
  position: absolute; left: 50%; bottom: 92px; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  color: var(--text); pointer-events: none; z-index: 4;
  transition: transform .2s var(--ease);
}
.north svg { width: 22px; height: 22px; color: var(--red); }
.north span { font-size: 11px; font-weight: 700; letter-spacing: .1em; }

/* ---------- top bar ---------- */
.topbar {
  position: fixed; top: 12px; left: 12px; right: 12px; height: var(--topbar-height);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 0 16px; z-index: 6;
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--red); box-shadow: 0 0 14px var(--red); flex: none; }
.brand h1 { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: -.01em; color: var(--red); white-space: nowrap; }
.brand h1 b { color: var(--text); font-weight: 600; }
.brand p { margin: 0; color: var(--text-2); font-size: 12px; white-space: nowrap; }

.views { display: flex; gap: 4px; padding: 4px; background: rgba(255, 255, 255, .05); border-radius: 999px; border: 1px solid var(--glass-edge); }
.seg {
  appearance: none; border: 0; background: transparent; color: var(--text-2);
  font: inherit; font-size: 13px; font-weight: 600; padding: 7px 14px; border-radius: 999px; cursor: pointer; white-space: nowrap;
  transition: background .2s var(--ease), color .2s var(--ease);
}
.seg[aria-pressed="true"] { background: var(--red); color: #fff; }

/* ---------- side panels ---------- */
.panel {
  position: fixed; top: calc(var(--topbar-height) + 24px); bottom: 96px; width: var(--panel-width);
  padding: 14px 16px; overflow-y: auto; z-index: 5;
}
.panel.left { left: 12px; }
.panel.right { right: 12px; }
.panel section + section { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--glass-edge); }
.panel h2 { margin: 0 0 8px; font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--red); }

.pt { display: flex; gap: 10px; align-items: baseline; font-variant-numeric: tabular-nums; margin: 4px 0; }
.pt b { width: 18px; color: var(--text); }
.pt span { font-size: 12.5px; color: var(--text); }

dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; margin: 0; }
dt { color: var(--text-2); font-size: 12.5px; }
dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; font-size: 13px; font-weight: 500; }

.hint-text { color: var(--text-2); font-size: 12px; margin: 0 0 6px; }
.obs-list { list-style: none; padding: 0; margin: 0 0 10px; max-height: 160px; overflow-y: auto; }
.obs-list li { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12px; padding: 4px 0; font-variant-numeric: tabular-nums; }
.obs-list button { appearance: none; border: 1px solid var(--glass-edge); background: transparent; color: var(--text-2); border-radius: 8px; font: inherit; font-size: 11px; padding: 2px 8px; cursor: pointer; }
.obs-list button:hover { color: var(--red); border-color: var(--red); }
.row { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- buttons ---------- */
.btn {
  appearance: none; border: 1px solid var(--glass-edge); background: rgba(255, 255, 255, .06);
  color: var(--text); font: inherit; font-weight: 600; font-size: 13px;
  height: 38px; padding: 0 16px; border-radius: 12px; cursor: pointer;
  transition: transform .15s var(--ease), background .2s var(--ease), border-color .2s var(--ease);
}
.btn:hover { background: rgba(255, 255, 255, .12); }
.btn:active { transform: scale(.97); }
.btn-red { background: var(--red); border-color: var(--red); color: #fff; }
.btn-red:hover { background: #ff4a58; }
.btn.small { height: 30px; font-size: 12px; padding: 0 10px; border-radius: 9px; }
.btn[aria-pressed="true"] { border-color: var(--red); color: var(--red); }

/* ---------- bottom controls ---------- */
.controls {
  position: fixed; bottom: 12px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 8px; padding: 8px; z-index: 6; max-width: calc(100vw - 24px);
  flex-wrap: wrap; justify-content: center;
}
.plan-msg { color: var(--text-2); font-size: 12px; padding: 0 8px; }

.team {
  position: fixed; right: 12px; bottom: 12px; padding: 12px 16px; min-width: 200px; z-index: 5;
}
.team h2 { margin: 0 0 6px; font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--red); }
.team ul { list-style: none; margin: 0; padding: 0; }
.team li { font-size: 13px; padding: 2px 0; }
.team small { color: var(--text-2); font-size: 11px; }

.credit { position: fixed; left: 14px; bottom: 6px; font-size: 10.5px; color: var(--text-2); z-index: 4; }
.credit a { color: var(--text-2); }

/* ---------- small screens: panels become a compact strip ---------- */
@media (max-width: 960px) {
  .panel { width: 220px; }
  .brand p { display: none; }
}
@media (max-width: 760px) {
  .panel { top: auto; bottom: 150px; max-height: 40vh; width: calc(50% - 16px); }
  .panel.left { left: 8px; }
  .panel.right { right: 8px; }
  .north { bottom: 150px; }
  .team { display: none; }
  .views .seg { padding: 6px 10px; font-size: 12px; }
  .brand h1 { font-size: 15px; }
}
