* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #14181f;
  color: #f2f4f8;
  font: 14px/1.3 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

#map {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;   /* we handle all gestures ourselves */
  cursor: grab;
}
#map:active { cursor: grabbing; }

.card {
  position: fixed;
  top: calc(12px + env(safe-area-inset-top));
  background: rgba(20, 24, 31, 0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 10px 14px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

#me {
  left: calc(12px + env(safe-area-inset-left));
  display: flex;
  align-items: center;
  gap: 10px;
}
#me-name { font-weight: 600; }
.sub { color: #9aa3b2; font-size: 12px; }
.sub b { color: #f2f4f8; }

.swatch {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  flex: none;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.25);
}
#me .swatch { width: 26px; height: 26px; border-radius: 8px; }

#board {
  right: calc(12px + env(safe-area-inset-right));
  min-width: 160px;
}
.title {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #9aa3b2;
  margin-bottom: 6px;
}
#board-list { list-style: none; margin: 0; padding: 0; }
#board-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 0;
  font-size: 13px;
}
#board-list li.mine { font-weight: 700; }
#board-list .name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#board-list .n { color: #9aa3b2; font-variant-numeric: tabular-nums; }
#board-list .empty { color: #9aa3b2; }

#hint, #toast {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  max-width: calc(100% - 32px);
  padding: 9px 16px;
  border-radius: 999px;
  text-align: center;
  pointer-events: none;
}
#hint {
  bottom: calc(18px + env(safe-area-inset-bottom));
  background: rgba(20, 24, 31, 0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #c9cfd9;
}
#toast {
  bottom: calc(70px + env(safe-area-inset-bottom));
  background: #e5484d;
  color: #fff;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.2s;
}
#toast.show { opacity: 1; }

@media (max-width: 480px) {
  .card { padding: 8px 11px; }
  #board { min-width: 0; width: 140px; }
  #board-list li { font-size: 12px; }
}
