:root {
  --bg: #05070a;
  --cyan: #00e5ff;
  --cyan-dim: #0a4a56;
  --amber: #ffb648;
  --panel-bg: rgba(6, 14, 18, 0.82);
  --border: rgba(0, 229, 255, 0.35);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background: var(--bg);
  color: #d8f6fb;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  overflow: hidden;
  overscroll-behavior: none;
}

#globe-container {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, #0a1420 0%, #05070a 70%);
}

#hud-top {
  position: absolute;
  top: calc(var(--safe-top) + 10px);
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  pointer-events: none;
  z-index: 10;
  text-shadow: 0 0 8px rgba(0, 229, 255, 0.6);
}

#brand {
  font-size: 13px;
  letter-spacing: 4px;
  font-weight: 600;
  color: var(--cyan);
}

#status-line {
  font-size: 10px;
  letter-spacing: 1px;
  color: #7fd8e6;
  opacity: 0.85;
}

#offline-banner {
  position: absolute;
  top: calc(var(--safe-top) + 44px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 100, 40, 0.15);
  border: 1px solid rgba(255, 140, 60, 0.5);
  color: #ffcba0;
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: 0.5px;
  display: none;
  z-index: 10;
  white-space: nowrap;
}
#offline-banner.visible { display: block; }

#hud-counts {
  position: absolute;
  top: calc(var(--safe-top) + 10px);
  right: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 10;
}

.count-chip {
  background: var(--panel-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 13px;
  min-width: 44px;
  text-align: center;
}

#hud-controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(var(--safe-bottom) + 12px);
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 10px;
  z-index: 10;
}

.hud-btn {
  background: var(--panel-bg);
  border: 1px solid var(--border);
  color: #9fe8f2;
  font-size: 11px;
  letter-spacing: 0.8px;
  padding: 10px 14px;
  border-radius: 10px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  min-height: 40px;
  touch-action: manipulation;
}

.hud-btn.active {
  color: var(--bg);
  background: var(--cyan);
  border-color: var(--cyan);
  font-weight: 600;
}

.hud-btn:active { transform: scale(0.96); }

#info-panel {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: calc(var(--safe-bottom) + 66px);
  max-width: 360px;
  margin: 0 auto;
  background: var(--panel-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  z-index: 11;
  box-shadow: 0 0 24px rgba(0, 229, 255, 0.12);
}
#info-panel.visible { display: block; }

#close-info {
  position: absolute;
  top: 8px;
  right: 10px;
  background: none;
  border: none;
  color: #7fd8e6;
  font-size: 16px;
  padding: 6px;
}

.entity-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--cyan);
  margin-bottom: 8px;
  padding-right: 20px;
}

.entity-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  padding: 3px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  color: #cdeef4;
}
.entity-row span:first-child { opacity: 0.6; }

@media (min-width: 700px) {
  #info-panel { left: auto; right: 20px; width: 320px; }
}
