* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #111;
  overflow: hidden;
}

#topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: rgba(20, 20, 25, 0.92);
  backdrop-filter: blur(8px);
  color: #fff;
  gap: 10px;
}

#nameBox {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
}

#nameBox span {
  font-size: 13px;
  color: #aaa;
  white-space: nowrap;
}

#nameInput {
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #444;
  background: #1e1e24;
  color: #fff;
  font-size: 15px;
}

#nameSave {
  padding: 8px 14px;
  border-radius: 8px;
  border: none;
  background: #4f8cff;
  color: #fff;
  font-weight: 600;
  font-size: 14px;
}

#nameSave:active { background: #3a72e0; }

#statusBox {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #aaa;
  white-space: nowrap;
}

#statusDot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
}
#statusDot.online { background: #37d67a; box-shadow: 0 0 6px #37d67a; }
#statusDot.offline { background: #ff5c5c; }

#map {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 1;
}

/* --- markers --- */
.user-marker {
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: translateY(0);
}

.user-marker .label {
  background: rgba(20,20,25,0.92);
  color: #fff;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  margin-bottom: 4px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
  border: 1px solid rgba(255,255,255,0.15);
}

.user-marker.me .label {
  background: #4f8cff;
  border-color: #4f8cff;
}

.user-marker .dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ff5c5c;
  border: 3px solid #fff;
  box-shadow: 0 0 0 3px rgba(255,92,92,0.35);
}

.user-marker.me .dot {
  background: #4f8cff;
  box-shadow: 0 0 0 3px rgba(79,140,255,0.35);
}

.user-marker.stale .dot {
  background: #888;
  box-shadow: 0 0 0 3px rgba(136,136,136,0.3);
}

#toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(20,20,25,0.95);
  color: #fff;
  padding: 10px 18px;
  border-radius: 20px;
  font-size: 13px;
  z-index: 2000;
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
  max-width: 80%;
  text-align: center;
}
#toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.leaflet-control-attribution {
  font-size: 9px !important;
}
