:root {
  --bg: #0f1014;
  --panel: #171921;
  --panel2: #1d202a;
  --line: #2a2f3c;
  --text: #e6e7eb;
  --muted: #9aa1b2;
  --alive: #2bc670;
  --dead: #f05d5e;
  --accent: #4aa9ff;
  --dot: 6px;
}

* { box-sizing: border-box; }
.hidden { display: none !important; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); font-family: Segoe UI, Tahoma, sans-serif; }

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #1a1d26, #141720);
}
.topbar h1 { margin: 0; font-size: 20px; }

.stats { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.stat-pill {
  border: 1px solid var(--line);
  background: #11131a;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
}
.stat-pill.alive { border-color: #1f7a4a; }
.stat-pill.dead { border-color: #8f3335; }
button {
  background: #223149;
  color: #dce8ff;
  border: 1px solid #385277;
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
}
button:hover { filter: brightness(1.08); }

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 12px;
  padding: 12px;
}

.map-panel {
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--panel);
  display: flex;
  flex-direction: column;
}

.map-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-bottom: 1px solid var(--line);
  background: var(--panel2);
}
.search-wrap {
  position: relative;
  width: 100%;
  max-width: 420px;
}
.level-range {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}
.level-range input {
  width: 72px;
  border-radius: 8px;
  border: 1px solid #334056;
  background: #10141d;
  color: var(--text);
  padding: 7px 8px;
  -moz-appearance: textfield;
}
.level-range input::-webkit-outer-spin-button,
.level-range input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
#searchInput {
  margin-left: 0;
  width: 100%;
  border-radius: 8px;
  border: 1px solid #334056;
  background: #10141d;
  color: var(--text);
  padding: 7px 10px;
}
.search-suggestions {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 260px;
  overflow-y: auto;
  background: #0e131d;
  border: 1px solid #334056;
  border-radius: 8px;
  z-index: 50;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}
.search-suggestions.hidden {
  display: none;
}
.search-option {
  padding: 8px 10px;
  cursor: pointer;
  border-bottom: 1px solid rgba(51, 64, 86, 0.5);
}
.search-option:last-child {
  border-bottom: 0;
}
.search-option:hover {
  background: #1a2539;
}
.search-option .name {
  font-size: 13px;
}
.search-option .meta {
  font-size: 11px;
  color: var(--muted);
}

.map-viewport {
  position: relative;
  min-height: 600px;
  height: calc(100vh - 150px);
  overflow-y: auto;
  overflow-x: hidden;
  background: #0c0d11;
}

.map-inner {
  position: relative;
  transform-origin: 0 0;
  margin: 0 auto;
}
#mapImage {
  display: block;
  width: 100%;
  height: 100%;
}
.boss-layer {
  position: absolute;
  inset: 0;
}

.boss-dot {
  position: absolute;
  width: calc(var(--dot) * 2);
  height: calc(var(--dot) * 2);
  padding: 0;
  appearance: none;
  -webkit-appearance: none;
  border-radius: 999px;
  border: 0;
  background: transparent;
  transform: translate(-50%, -50%);
  cursor: pointer;
}
.boss-dot::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--dot);
  height: var(--dot);
  transform: translate(-50%, -50%);
  border-radius: 999px;
  border: 1px solid rgba(10, 10, 10, 0.9);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.boss-dot.alive::after { background: var(--alive); }
.boss-dot.dead::after { background: var(--dead); }
.boss-dot.selected { box-shadow: 0 0 0 2px #fff, 0 0 10px rgba(255, 255, 255, 0.65); }
.boss-dot.hidden-match { display: none; }

.info-panel {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  padding: 10px;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.status-line { font-size: 12px; color: var(--muted); }

.boss-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #12151d;
  padding: 10px;
}
.boss-card.hidden { display: none; }
.boss-card h2 { margin: 0 0 6px; font-size: 20px; }
.boss-state { font-size: 13px; margin-bottom: 10px; }
.boss-state.alive { color: var(--alive); }
.boss-state.dead { color: var(--dead); }
.boss-card h3 {
  margin: 10px 0 6px;
  font-size: 14px;
  color: #f5cd60;
  border-bottom: 1px solid var(--line);
  padding-bottom: 4px;
}
.facts {
  margin: 0;
  padding-left: 16px;
  line-height: 1.35;
}
.facts li { margin: 2px 0; }
.facts .hp-value { color: #ff5d5d; font-weight: 700; }
.facts .mp-value { color: #61a7ff; font-weight: 700; }
.minion-boxes {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 2px;
}
.minion-box {
  display: inline-block;
  background: #182132;
  border: 1px solid #30405c;
  color: #d9e6ff;
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 11px;
  line-height: 1.2;
  white-space: nowrap;
}
.minion-empty {
  color: var(--muted);
  font-size: 12px;
}
.grid2, .grid3 {
  display: grid;
  gap: 6px;
  font-size: 13px;
}
.grid2 { grid-template-columns: 1fr 1fr; }
.grid3 { grid-template-columns: 1fr 1fr 1fr; }
.kv {
  border: 1px solid #2b3240;
  border-radius: 8px;
  padding: 5px 7px;
  background: #10141c;
}
.kv .k { color: var(--muted); font-size: 11px; }
.kv .v { color: var(--text); font-weight: 600; margin-top: 2px; }

@media (max-width: 1120px) {
  .layout { grid-template-columns: 1fr; }
  .map-viewport { height: 62vh; }
}
