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

* {
  box-sizing: border-box;
}

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

body {
  overflow: hidden;
  background: linear-gradient(135deg, #05070b 0%, #07111d 48%, #06130f 100%);
}

.shell {
  min-height: 100vh;
}

.stage {
  position: relative;
  min-height: 100vh;
  isolation: isolate;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

#globe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.stage:active {
  cursor: grabbing;
}

.hud {
  position: absolute;
  z-index: 2;
  border: 1px solid rgba(169, 198, 226, 0.22);
  background: rgba(9, 16, 27, 0.78);
  box-shadow: 0 18px 70px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(18px);
}

.top-left {
  top: 22px;
  left: 22px;
  max-width: min(420px, calc(100vw - 44px));
  padding: 16px 18px;
  border-radius: 8px;
}

.brand {
  font-size: clamp(24px, 4vw, 44px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0;
}

.subtle {
  margin-top: 8px;
  color: #a9b9c9;
  font-size: 13px;
  line-height: 1.35;
}

.build {
  margin-top: 10px;
  color: #7f93a6;
  font-size: 11px;
}

.controls {
  top: 22px;
  right: 22px;
  width: min(410px, calc(100vw - 44px));
  padding: 18px;
  border-radius: 8px;
  transition: transform 180ms ease, opacity 180ms ease;
}

.stage.is-panel-collapsed .controls {
  opacity: 0;
  pointer-events: none;
  transform: translateX(calc(100% + 28px));
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

label {
  display: block;
  margin-bottom: 0;
  color: #c7d7e7;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.icon-button {
  min-height: 30px;
  padding: 0 10px;
  font-size: 12px;
}

.panel-tab {
  top: 22px;
  right: 22px;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 8px;
  opacity: 0;
  pointer-events: none;
  transform: translateX(18px);
  transition: transform 180ms ease, opacity 180ms ease;
}

.stage.is-panel-collapsed .panel-tab {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

.search-row {
  display: flex;
}

input {
  width: 100%;
  min-height: 42px;
  border: 1px solid rgba(192, 213, 232, 0.34);
  border-radius: 6px;
  background: rgba(4, 8, 14, 0.72);
  color: #f3f8ff;
  padding: 0 12px;
  font: inherit;
  outline: none;
}

input:focus {
  border-color: #7cc8ff;
  box-shadow: 0 0 0 3px rgba(124, 200, 255, 0.18);
}

.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

.stat-grid div {
  min-height: 72px;
  border: 1px solid rgba(157, 188, 214, 0.2);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.045);
  padding: 12px;
}

.stat-grid span {
  display: block;
  color: #94a8ba;
  font-size: 12px;
  line-height: 1.2;
}

.stat-grid strong {
  display: block;
  margin-top: 8px;
  color: #ffffff;
  font-size: 18px;
  line-height: 1.1;
  letter-spacing: 0;
}

.speed-control {
  margin-top: 14px;
  padding: 8px 2px 0;
}

.speed-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.speed-header strong {
  color: #dff4ff;
  font-size: 12px;
  font-weight: 700;
}

.speed-slider {
  width: 100%;
  min-height: 18px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  appearance: none;
  -webkit-appearance: none;
  cursor: ew-resize;
  pointer-events: auto;
  touch-action: pan-x;
}

.speed-slider:focus {
  box-shadow: none;
}

.speed-slider::-webkit-slider-runnable-track {
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(111, 201, 255, 0.88), rgba(111, 201, 255, 0.24));
}

.speed-slider::-webkit-slider-thumb {
  width: 12px;
  height: 12px;
  margin-top: -4.5px;
  border: 1px solid rgba(196, 229, 255, 0.72);
  border-radius: 999px;
  background: #f4fbff;
  box-shadow: 0 0 0 4px rgba(111, 201, 255, 0.14);
  appearance: none;
  -webkit-appearance: none;
}

.speed-slider::-moz-range-track {
  height: 3px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(111, 201, 255, 0.88), rgba(111, 201, 255, 0.24));
}

.speed-slider::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: 1px solid rgba(196, 229, 255, 0.72);
  border-radius: 999px;
  background: #f4fbff;
  box-shadow: 0 0 0 4px rgba(111, 201, 255, 0.14);
}

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

#refreshButton {
  grid-column: 1 / -1;
}

.view-status {
  min-height: 20px;
  margin-top: 12px;
  color: #b7c7d6;
  font-size: 12px;
  line-height: 1.35;
}

button {
  min-height: 38px;
  border: 1px solid rgba(180, 211, 234, 0.36);
  border-radius: 6px;
  background: rgba(72, 146, 190, 0.22);
  color: #edf7ff;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

button:hover {
  background: rgba(72, 146, 190, 0.34);
}

.bottom-right {
  right: 22px;
  bottom: 22px;
  max-width: min(390px, calc(100vw - 44px));
  padding: 16px 18px;
  border-radius: 8px;
}

.copyright {
  position: absolute;
  right: 22px;
  bottom: 12px;
  z-index: 2;
  color: rgba(205, 222, 239, 0.72);
  font-size: 11px;
  letter-spacing: 0.02em;
  pointer-events: none;
}

#selectedName {
  font-size: 20px;
  font-weight: 800;
}

#selectedMeta {
  margin: 8px 0 0;
  color: #aebdca;
  font-size: 13px;
  line-height: 1.45;
}

@media (max-width: 820px) {
  body {
    overflow: auto;
  }

  .stage {
    min-height: 100svh;
  }

  .top-left,
  .controls,
  .bottom-right {
    left: 14px;
    right: 14px;
    width: auto;
    max-width: none;
  }

  .controls {
    top: auto;
    bottom: 14px;
  }

  .stage.is-panel-collapsed .controls {
    transform: translateY(calc(100% + 28px));
  }

  .panel-tab {
    top: auto;
    bottom: 14px;
  }

  .bottom-right {
    display: none;
  }

  .copyright {
    right: 14px;
    bottom: 10px;
  }

  .stat-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 520px) {
  .stat-grid,
  .actions {
    grid-template-columns: 1fr;
  }

  .stat-grid div {
    min-height: 58px;
  }
}
