body {
  margin: 0;
  overflow: hidden;
  background: #1a1a2e;
  color: #e0e0e0;
  font-family: 'Segoe UI', system-ui, sans-serif;
}

#title {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 20px;
  font-weight: 600;
  color: #d0d0d0;
  z-index: 90;
  pointer-events: none;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

#cy {
  width: 100vw;
  height: 100vh;
  position: relative;
}

#tooltip {
  position: absolute;
  background: rgba(20, 20, 40, 0.95);
  border: 1px solid #3a3a5c;
  border-radius: 8px;
  padding: 10px 14px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 100;
  max-width: 220px;
  font-size: 13px;
}

#tooltip.visible {
  opacity: 1;
}

#lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 1);
  display: none;
  z-index: 200;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

#lightbox.open {
  display: flex;
}

.lightbox-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 24px;
  width: 100%;
  box-sizing: border-box;
}

.lightbox-header h2 {
  margin: 0;
  font-size: 24px;
  color: #f0f0f0;
}

.lightbox-header .levels {
  color: #aaa;
  font-size: 14px;
}

.lightbox-header .close-hint {
  margin-left: auto;
  font-size: 11px;
  color: #666;
}

.lightbox-header .close-btn {
  background: none;
  border: none;
  color: #888;
  font-size: 28px;
  cursor: pointer;
  line-height: 1;
}

.lightbox-header .close-btn:hover {
  color: #fff;
}

.lightbox-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  width: 100%;
  position: relative;
  cursor: grab;
}

.lightbox-body.dragging {
  cursor: grabbing;
}

.lightbox-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #aaa;
  font-size: 18px;
  display: none;
  z-index: 1;
}

.lightbox-loading.visible {
  display: block;
}

.lightbox-body img {
  max-width: 95vw;
  max-height: 88vh;
  object-fit: contain;
  transform-origin: center center;
  user-select: none;
  -webkit-user-drag: none;
}

/* Loading indicator */
#loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 24px;
  color: #aaa;
  z-index: 50;
  pointer-events: none;
}

/* Legend */
#legend {
  position: fixed;
  top: 16px;
  left: 16px;
  background: rgba(20, 20, 40, 0.85);
  border: 1px solid #3a3a5c;
  border-radius: 8px;
  padding: 12px 16px;
  z-index: 90;
  font-size: 12px;
  line-height: 1.6;
  min-width: 140px;
}

.legend-title {
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 6px;
  color: #d0d0d0;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #bbb;
}

.legend-circle {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.legend-shape {
  display: inline-block;
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  border: 2px solid #888;
  box-sizing: border-box;
}

.legend-circle-shape {
  border-radius: 50%;
}

.legend-square-shape {
  border-radius: 3px;
}

.legend-separator {
  border-top: 1px solid #3a3a5c;
  margin: 6px 0;
}

.legend-hint {
  color: #888;
  font-style: italic;
  font-size: 11px;
}

/* Responsive styles for small screens */
@media (max-width: 767px) {
  .lightbox-body img {
    max-width: 95vw;
    max-height: 85vh;
  }

  .lightbox-header h2 {
    font-size: 18px;
  }

  .lightbox-header {
    padding: 10px 16px;
  }

  #legend {
    font-size: 11px;
    padding: 8px 12px;
    top: 8px;
    left: 8px;
    min-width: 120px;
  }

  .legend-title {
    font-size: 12px;
  }
}
