*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; overflow: hidden; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  overscroll-behavior: none;
  font-size: 14px;
  line-height: 1.4;
}

#app {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  max-width: 520px;
  margin: 0 auto;
  background: var(--bg);
  overflow: hidden;
}

#map {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: var(--bg);
}

.screen {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  overflow: hidden;
}
.screen.hidden { display: none; }

/* Заглушка поверх карты: HUD */
.hud { position: absolute; left: 0; right: 0; z-index: 20; pointer-events: none; }
.hud > * { pointer-events: auto; }
.hud__top {
  top: 0;
  height: var(--hud-h);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  background: linear-gradient(180deg, var(--bg-glass) 0%, transparent 100%);
}
.hud__bottom {
  bottom: 0;
  height: var(--hud-h);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  background: linear-gradient(0deg, var(--bg-glass) 0%, transparent 100%);
}

button {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}
button:disabled { opacity: .4; cursor: not-allowed; }

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  transition: background .15s var(--ease);
}
.icon-button:hover { background: var(--border); }

svg { display: block; }

pre { font-family: var(--mono); font-size: 12px; }

.hidden { display: none !important; }

/* Скроллбар тёмный */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }
