html,
body {
  height: 100%;
  margin: 0;
}

#map {
  position: fixed;
  inset: 0;
}

.leaflet-container {
  font: inherit;
  background: #6d8bbb;
}

:root {
  --type-exception: #d92b2b;
  --type-exception-light: #ff7b6b;
  --type-specification: #7b2ff2;
  --type-specification-light: #b08bff;
}

.type-exception { --type-color: var(--type-exception); --type-light: var(--type-exception-light); }
.type-specification { --type-color: var(--type-specification); --type-light: var(--type-specification-light); }

.hud {
  position: fixed;
  z-index: 1000;
  width: min(340px, calc(100vw - 2rem));
  margin: 1rem;
  box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.35);
}

#panel-form { top: 0; right: 0; }
#panel-feed { bottom: 0; right: 0; }

#panel-options { bottom: 0; left: 0; width: auto; }
#panel-options .form-check-input { cursor: pointer; }
#panel-options .form-check-label { cursor: pointer; }

#panel-form .card-header,
#panel-feed .card-header {
  cursor: pointer;
}

.feed-scroll {
  max-height: 34vh;
  overflow-y: auto;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #666;
  display: inline-block;
  flex: none;
}
.dot.connected { background: #3ddc84; }
.dot.connecting { background: #ffb020; animation: pulse 1s infinite; }
.dot.disconnected { background: #ff4d4d; }

@keyframes pulse { 50% { opacity: 0.3; } }

.bug-icon { background: none; border: none; }

.bug-drop {
  width: 30px;
  height: 30px;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .5));
}

.bug-drop svg { width: 100%; height: 100%; display: block; }

.bug-drop .head,
.bug-drop .body { fill: var(--type-color, #d92b2b); }
.bug-drop .body { stroke: #10141f; }
.bug-drop .legs { stroke: #10141f; }
.bug-drop .split { stroke: #10141f; opacity: .5; }
.bug-drop .spots { fill: #10141f; opacity: .55; }
.bug-drop .wing { fill: var(--type-color, #d92b2b); fill-opacity: .3; stroke: #10141f; }

.bug-drop.bug-small { width: 26px; height: 26px; }

.bug-drop.bug-fresh { animation: drop 0.45s cubic-bezier(.2, 1.4, .4, 1), glow 1.2s ease-out 3; }

@keyframes drop {
  from { transform: translateY(-300%) scale(1.6); }
  to   { transform: translateY(0) scale(1); }
}

@keyframes glow {
  0%   { filter: drop-shadow(0 0 12px #fff); }
  100% { filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .5)); }
}

.leaflet-zoom-anim .bug-drop svg { shape-rendering: geometricPrecision; }

.bug-tip.leaflet-tooltip {
  width: max-content;
  max-width: 280px;
  white-space: normal;
  text-align: left;
  border-radius: 8px;
  padding: 0.4rem 0.55rem;
}

.bug-tip .exc {
  font-weight: 600;
  word-break: break-word;
}

.bug-tip .meta {
  color: #6c757d;
  font-size: 0.72rem;
  margin-top: 0.15rem;
}

.bug-tip .msg {
  font-family: var(--bs-font-monospace);
  font-size: 0.72rem;
  color: var(--bs-code-color, #d63384);
  word-break: break-all;
  margin-top: 0.15rem;
}

.bug-tip .hint {
  font-style: italic;
  margin-top: 0.2rem;
}

.bug-tip .site {
  font-family: var(--bs-font-monospace);
  font-size: 0.72rem;
}

.type-line { margin-bottom: 0.2rem; }

.type-chip {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #fff;
  background: var(--type-color, #d92b2b);
  border-radius: 999px;
  padding: 0.1rem 0.45rem;
  vertical-align: middle;
}

#f-result.pending { color: #b8860b; }
#f-result.ok { color: #146c43; }
#f-result.ko { color: #b02a37; }

#feed .list-group-item {
  cursor: pointer;
  border-left: 3px solid var(--type-color, #d92b2b);
}
#feed .list-group-item:hover { background: #f6f2ff; }
#feed li .by { color: #6c757d; font-size: 0.78rem; }
#feed li .by .player,
.bug-tip .meta .player { font-weight: 700; }
#feed li .msg { color: var(--bs-code-color, #d63384); word-break: break-all; margin-top: .25rem; }

#bug-modal-trace {
  max-height: 40vh;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

@media (max-width: 575px) {
  .hud { width: calc(100vw - 2rem); }
  #panel-form { top: 0; right: 0; }
  #panel-feed { top: auto; bottom: 0; right: 0; }
  #panel-options { bottom: auto; top: 0; }
  .feed-scroll { max-height: 22vh; }
}
