:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #07131a;
  color: #f3f8fb;
}

* { box-sizing: border-box; }
html, body, #app { width: 100%; height: 100%; margin: 0; overflow: hidden; }
body { background: #07131a; }
button, input { font: inherit; }
button { color: inherit; }

#app { position: relative; touch-action: none; }
#map { display: block; width: 100%; height: 100%; cursor: grab; background: #07131a; }
#map.dragging { cursor: grabbing; }

.hud {
  position: absolute;
  z-index: 3;
  border: 1px solid rgba(173, 221, 237, 0.22);
  background: rgba(5, 18, 25, 0.88);
  backdrop-filter: blur(12px);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.35);
}

.topbar {
  top: 16px;
  left: 16px;
  right: 16px;
  min-height: 68px;
  padding: 12px 16px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.eyebrow { font-size: 11px; letter-spacing: .18em; color: #86c9da; }
h1, h2 { margin: 0; font-weight: 650; }
h1 { font-size: 23px; }
h2 { font-size: 16px; }
.status-group { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.status, .counter {
  display: inline-flex;
  align-items: center;
  min-height: 29px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 13px;
  border: 1px solid rgba(173, 221, 237, 0.22);
}
.status::before { content: ""; width: 8px; height: 8px; margin-right: 7px; border-radius: 50%; background: #f2bd5e; }
.status-live::before { background: #5ee29c; box-shadow: 0 0 10px rgba(94, 226, 156, .7); }
.status-error::before { background: #ff6f78; }
.counter { background: rgba(70, 183, 213, .12); }
.counter-bases { background: rgba(244, 196, 94, .12); }

.controls {
  left: 16px;
  bottom: 24px;
  padding: 8px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}
.controls button {
  min-width: 42px;
  min-height: 40px;
  border: 1px solid rgba(173, 221, 237, 0.22);
  border-radius: 9px;
  background: rgba(20, 51, 63, .78);
  cursor: pointer;
}
.controls button:hover { background: rgba(34, 79, 94, .9); }
.toggle { display: inline-flex; align-items: center; gap: 7px; padding: 0 7px; font-size: 13px; white-space: nowrap; }

.player-panel {
  top: 100px;
  right: 16px;
  bottom: 24px;
  width: min(330px, calc(100vw - 32px));
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.panel-heading { padding: 14px; display: flex; align-items: baseline; justify-content: space-between; border-bottom: 1px solid rgba(173, 221, 237, 0.16); }
.panel-heading span { font-size: 12px; color: #9db7c0; }
.player-list { overflow: auto; padding: 8px; }
.player-card {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 11px;
  padding: 10px;
  margin: 0 0 7px;
  color: inherit;
  text-align: left;
  background: rgba(255, 255, 255, .035);
  cursor: pointer;
}
.player-card:hover { border-color: rgba(114, 210, 233, .4); background: rgba(114, 210, 233, .08); }
.player-line { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.player-name { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-level { font-size: 12px; color: #b4d9e3; white-space: nowrap; }
.health-label { display: flex; justify-content: space-between; margin: 7px 0 4px; font-size: 11px; color: #b9ced4; }
.health-track { height: 7px; overflow: hidden; border-radius: 999px; background: rgba(255, 255, 255, .12); }
.health-fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, #45d48c, #9de267); }
.health-unknown { font-size: 12px; color: #e2bd70; margin-top: 7px; }
.empty { padding: 22px 12px; text-align: center; color: #9db7c0; }
.warning { margin: 8px 8px 0; padding: 9px 10px; border: 1px solid rgba(242, 189, 94, .35); border-radius: 9px; background: rgba(242, 189, 94, .1); color: #f4d89d; font-size: 12px; }

.attribution { position: absolute; z-index: 2; left: 17px; bottom: 4px; font-size: 10px; color: rgba(220, 235, 240, .62); text-shadow: 0 1px 2px #000; }
.map-error { position: absolute; z-index: 5; inset: 50% auto auto 50%; transform: translate(-50%, -50%); max-width: 440px; padding: 16px 18px; border-radius: 12px; background: #38181c; border: 1px solid #9c454d; }

@media (max-width: 720px) {
  .topbar { top: 8px; left: 8px; right: 8px; min-height: 60px; }
  .eyebrow { display: none; }
  h1 { font-size: 19px; }
  .status { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .counter-bases { display: none; }
  .player-panel { top: auto; right: 8px; left: 8px; bottom: 116px; width: auto; max-height: 28vh; }
  .controls { left: 8px; bottom: 8px; right: 8px; justify-content: center; }
  .attribution { display: none; }
}
