:root {
  --green: #3b5323; --green-l: #a9cf8a; --orange: #ff7a1a; --bg: #16181a; --panel: #1f2224;
  --line: #34383b; --text: #e8e8e6; --muted: #9aa09a; --red: #e53935;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); }
.hidden { display: none !important; }
.muted { color: var(--muted); } .small { font-size: 12px; }
.error { color: #ff8a80; min-height: 1em; }
button, select, input, textarea {
  font: inherit; color: var(--text); background: #2a2e31; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px;
}
button { cursor: pointer; } button:hover { border-color: var(--green-l); }
button.primary { background: var(--green-l); color: #14210a; border-color: var(--green-l); font-weight: 600; }
button.danger { border-color: var(--red); color: #ff8a80; }
button.active { background: var(--green); border-color: var(--green-l); }
input, textarea, select { width: 100%; }
label { display: block; margin: 8px 0; font-size: 13px; color: var(--muted); }
label input, label textarea { margin-top: 4px; }
label.check { display: flex; gap: 8px; align-items: center; color: var(--text); }
label.check input { width: auto; margin: 0; }
.row { display: flex; gap: 8px; align-items: center; } .row.end { justify-content: flex-end; }
.row input { flex: 1; }
h3 { margin: 16px 0 8px; font-size: 14px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }

/* login */
.overlay { position: fixed; inset: 0; display: grid; place-items: center; background: radial-gradient(circle at 30% 20%, #2b3a22, var(--bg)); z-index: 10; }
.card { width: min(440px, 92vw); background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 24px; }
.card h1 { margin: 0 0 4px; }
#my-teams button { display: block; width: 100%; text-align: left; margin: 4px 0; }

/* layout */
#app { display: flex; height: 100%; }
#side { width: 340px; min-width: 300px; background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; }
#side header { padding: 14px 16px; border-bottom: 1px solid var(--line); }
.status { display: flex; gap: 8px; align-items: center; font-size: 16px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--red); display: inline-block; }
.dot.on { background: #43a047; }
.tabs { display: flex; border-bottom: 1px solid var(--line); }
.tabs button { flex: 1; border: 0; border-radius: 0; background: none; padding: 10px 4px; }
.tabs button.active { border-bottom: 2px solid var(--green-l); }
.tab { padding: 4px 16px 16px; overflow-y: auto; flex: 1; }
.badge { background: var(--red); color: #fff; border-radius: 10px; padding: 0 6px; font-size: 11px; }
.list { list-style: none; padding: 0; margin: 0; }
.list li { display: flex; gap: 8px; align-items: center; padding: 8px 4px; border-bottom: 1px solid var(--line); cursor: pointer; }
.list li:hover { background: #262a2d; }
.list li .grow { flex: 1; }
.swatch { width: 12px; height: 12px; border-radius: 50%; flex: none; }
#btn-newhunt { width: 100%; margin-top: 16px; }

/* chat */
.tab.chat { display: flex; flex-direction: column; padding-bottom: 8px; }
#messages { list-style: none; padding: 8px 0; margin: 0; flex: 1; overflow-y: auto; }
#messages li { margin: 6px 0; padding: 8px 10px; border-radius: 10px; background: #2a2e31; max-width: 92%; }
#messages li.mine { margin-left: auto; background: #2b4317; }
#messages li.system { background: #3a2f26; }
#messages .who { font-size: 12px; font-weight: 600; } #messages .time { font-size: 11px; color: var(--muted); }
#messages li[data-lat] { cursor: pointer; }

main { flex: 1; position: relative; }
#map { position: absolute; inset: 0; }
#toolbar { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); display: flex; gap: 6px; background: rgba(22,24,26,.9); padding: 6px; border-radius: 12px; }
#toolpanel { position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%); background: rgba(31,34,36,.96); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; min-width: 360px; }
#toolpanel .big { font-size: 20px; font-weight: 700; }
#toast { position: absolute; bottom: 24px; right: 24px; background: #eee; color: #111; padding: 10px 14px; border-radius: 8px; max-width: 360px; }
.colors { display: flex; gap: 6px; margin: 6px 0; }
.colors span { width: 24px; height: 24px; border-radius: 50%; cursor: pointer; border: 2px solid #555; }
.colors span.sel { border: 3px solid var(--green-l); }

/* map symbols (HTML markers) */
.hunter { display: flex; flex-direction: column; align-items: center; cursor: pointer; }
.hunter .ball { width: 32px; height: 32px; border-radius: 50%; border: 3px solid #fff; color: #fff; font-weight: 700; font-size: 13px; display: grid; place-items: center; box-shadow: 0 1px 4px rgba(0,0,0,.5); }
.hunter .name { margin-top: 2px; background: rgba(0,0,0,.75); color: #fff; font-size: 12px; font-weight: 600; padding: 1px 7px; border-radius: 10px; white-space: nowrap; }
.hunter.stale .ball { background: #888 !important; }
.pin { width: 34px; height: 42px; cursor: grab; filter: drop-shadow(0 1px 2px rgba(0,0,0,.5)); }
.pin .head { width: 34px; height: 34px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); border: 2px solid #fff; display: grid; place-items: center; }
.pin .head span { transform: rotate(45deg); font-size: 17px; background: #fff; border-radius: 50%; width: 24px; height: 24px; display: grid; place-items: center; }
.ping { width: 56px; height: 56px; border-radius: 50%; background: rgba(255,87,34,.35); display: grid; place-items: center; animation: pulse 1.6s infinite; }
.ping span { width: 28px; height: 28px; border-radius: 50%; background: #ff5722; border: 2px solid #fff; display: grid; place-items: center; font-size: 14px; }
@keyframes pulse { 50% { transform: scale(1.15); } }
.ground-label { background: rgba(27,27,27,.88); color: #fff; border: 2px solid; border-radius: 14px; padding: 2px 10px; font-weight: 700; font-size: 13px; cursor: pointer; white-space: nowrap; }
.maplibregl-popup-content { background: var(--panel); color: var(--text); border-radius: 10px; min-width: 220px; }
.maplibregl-popup-tip { border-top-color: var(--panel) !important; border-bottom-color: var(--panel) !important; }
.maplibregl-popup-content img { width: 100%; border-radius: 8px; margin-top: 6px; cursor: zoom-in; }
.maplibregl-popup-content .row { margin-top: 8px; }
.maplibregl-popup-close-button { color: var(--text); font-size: 18px; }

dialog { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 14px; width: min(480px, 94vw); }
dialog::backdrop { background: rgba(0,0,0,.5); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button { padding: 6px 10px; border-radius: 16px; }
.chips button.sel { background: var(--green); border-color: var(--green-l); }

.upper { text-transform: uppercase; }
.list li .x { background: none; border: 0; color: var(--muted); padding: 2px 6px; }
.list li .x:hover { color: #ff8a80; }
#owner-tools button { width: 100%; }
a { color: var(--green-l); }
