:root {
  color-scheme: dark;
  --bg: #10140f;
  --panel: #1a2118;
  --text: #f4f1e8;
  --muted: #c9c2b2;
  --line: #3d4a38;
  --accent: #e6b325;
  --accent-text: #1a1404;
  --danger: #ffb4a8;
  --font: system-ui, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
}

[hidden] { display: none !important; }

button, input { font: inherit; }

.join {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px 16px calc(24px + env(safe-area-inset-bottom));
}

.join form {
  width: min(420px, 100%);
  display: grid;
  gap: 14px;
}

h1 {
  margin: 0;
  font-size: 2.2rem;
  letter-spacing: -0.03em;
}

.lead, .hint, .error, #status, .empty {
  margin: 0;
}

.lead { font-size: 1.15rem; }

.hint, .empty, #status, .group-code { color: var(--muted); }

.error { color: var(--danger); }

label {
  display: grid;
  gap: 6px;
  font-weight: 650;
}

input[type="text"],
input[type="password"],
input:not([type]) {
  width: 100%;
  min-height: 48px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #0d110c;
  color: var(--text);
}

button {
  min-height: 48px;
  border: 0;
  border-radius: 12px;
  background: var(--accent);
  color: var(--accent-text);
  font-weight: 750;
  cursor: pointer;
}

.fit {
  min-height: 40px;
  padding: 0 12px;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
  white-space: nowrap;
}

.app {
  height: 100dvh;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
}

#map { min-height: 0; background: #1b241c; }

.panel {
  display: grid;
  gap: 6px;
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
  background: var(--panel);
  border-top: 1px solid var(--line);
}

.panel-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.panel-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1 1 10rem;
  min-width: 0;
}

.panel-actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
}

.share {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  font-weight: 650;
}

.share input {
  width: 1.3rem;
  height: 1.3rem;
  accent-color: var(--accent);
}

#hunters {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 28dvh;
  overflow: auto;
}

.hunter {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}

.hunter.mine .name { color: var(--accent); }

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid #fff;
}

.name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
}

.meta {
  color: var(--muted);
  text-align: right;
  white-space: nowrap;
}

.group-code {
  margin: 0;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.hunter.stale .dot { background: #8d8a82 !important; }

.hunter.stale .meta { color: var(--danger); }

.pin-wrap {
  background: none;
  border: none;
}

.leaflet-marker-icon.pin-wrap { overflow: visible !important; }

.pin {
  display: flex;
  align-items: center;
  gap: 6px;
  width: max-content;
  pointer-events: none;
}

.pin-dot {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--pin);
  border: 2px solid #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
}

.pin.mine .pin-dot {
  width: 18px;
  height: 18px;
  box-shadow: 0 0 0 3px var(--pin);
}

.pin-label {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  padding: 3px 7px;
  border-radius: 8px;
  background: rgba(16, 20, 15, 0.9);
  color: var(--text);
}

.pin-label b { font-size: 13px; }

.pin.stale { --pin: #8d8a82; }

.pin-label small {
  font-size: 11px;
  color: #d9d2c3;
  font-weight: 500;
}

.pin.stale .pin-label small {
  color: var(--danger);
  font-weight: 700;
}

.leaflet-control-attribution {
  font-size: 10px;
  background: rgba(16, 20, 15, 0.75);
  color: #d9d2c3;
}
