* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  overflow: hidden;
}

body {
  min-height: 100vh;
  height: 100vh;
  background: var(--bg-color);
  display: flex;
  flex-direction: column;
}

:root {
  --bg-color: #0a0a0f;
  --sun-color: #f5e6a3;
  --planet-color: #5ab8a8;
  --planet-inner-color: #2d5a7b;
  --planet-venus-color: #e6d5a8;
  --planet-outer-color: #c1440e;
  --planet-jupiter-color: #c9a86c;
  --planet-saturn-color: #d4a574;
  --planet-uranus-color: #7ec8c8;
  --planet-neptune-color: #4a6fa5;
  --planet-pluto-color: #8b7355;
  --moon-io-color: #e8c547;
  --moon-europa-color: #e8e8e0;
  --moon-ganymede-color: #a0a0a0;
  --moon-callisto-color: #5a5a5a;
  --moon-color: #c9c9c9;
  --ui-color: rgba(255, 255, 255, 0.7);
  --ui-hover: rgba(255, 255, 255, 0.95);
  --ui-track: rgba(255, 255, 255, 0.2);
  --star-color: #ffffff;
  --moon-crescent: #fcfbf7;
  /* Link-panel crescent fill gradient (updated with bg slider in main.js) */
  --crescent-moon-a: #fcfbf7;
  --crescent-moon-b: #dcd8ce;
  --crescent-moon-c: #a39e94;
  --thumb-size: 14px;
}

.app-container {
  position: relative;
  flex: 1;
  min-height: 0;
  width: 100%;
}

.canvas-area {
  position: relative;
  width: 100%;
  height: 100%;
}

.link-panel-container {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}

.link-panel-container > * {
  pointer-events: auto;
}

.link-panel {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0;
}

.link-row {
  position: relative;
  display: flex;
  align-items: center;
  z-index: 0;
}

.link-crescent {
  display: none;
  position: absolute;
  left: 100%;
  margin-left: 0.55rem;
  top: 50%;
  transform: translateY(-50%);
  width: calc(22rem * 0.7);
  height: auto;
  min-height: 0;
  pointer-events: none;
  z-index: 0;
}

.link-row:has(.link-list.visible) .link-crescent {
  display: block;
}

.link-crescent-svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
  shape-rendering: geometricPrecision;
}

.link-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  position: absolute;
  left: 100%;
  margin-left: 4.5rem;
  top: 50%;
  min-width: 14rem;
  z-index: 1;
  transform: translateY(-50%) translateX(-6px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  max-height: 0;
  overflow: hidden;
  min-height: 0;
  transition:
    opacity 0.18s ease-out,
    transform 0.2s ease-out,
    max-height 0.24s ease-out,
    visibility 0s linear 0.2s;
}

.link-list.visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  max-height: 50rem;
  transform: translateY(-50%) translateX(0);
  transition:
    opacity 0.18s ease-out,
    transform 0.2s ease-out,
    max-height 0.24s ease-out,
    visibility 0s;
}

@media (prefers-reduced-motion: reduce) {
  .link-list,
  .link-list.visible {
    transition: none;
  }
}

.link-item {
  font-family: 'Poppins', system-ui, sans-serif;
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--ui-color);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 21ch;
}

.link-item:hover {
  color: var(--ui-hover);
}

.link-item:focus-visible {
  outline: 2px solid var(--ui-hover);
  outline-offset: 3px;
  border-radius: 2px;
}

.link-category {
  position: relative;
  z-index: 2;
  font-family: 'Poppins', system-ui, sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ui-color);
  background: transparent;
  border: none;
  padding: 0.5rem 0;
  text-align: left;
  cursor: pointer;
}

.link-category:hover,
.link-category.active {
  color: var(--ui-hover);
  font-size: 0.945rem;
}

.link-category.active {
  font-weight: 600;
}

.link-category:focus-visible {
  outline: 2px solid var(--ui-hover);
  outline-offset: 3px;
  border-radius: 3px;
}

#canvas {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--bg-color);
}

.slider-float {
  position: absolute;
  top: 50%;
  right: 1rem;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  pointer-events: none;
}

.slider-float > * {
  pointer-events: auto;
}

.icon-btn {
  width: var(--thumb-size);
  height: var(--thumb-size);
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 50%;
  color: var(--ui-color);
  cursor: pointer;
}

.icon-btn:hover {
  color: var(--ui-hover);
}

.icon-btn:focus-visible {
  outline: 2px solid var(--ui-hover);
  outline-offset: 3px;
  border-radius: 50%;
}

.vertical-slider:focus-visible {
  outline: 2px solid var(--ui-hover);
  outline-offset: 4px;
  border-radius: 4px;
}

.slider-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.slider-cell label {
  font-family: system-ui, sans-serif;
  font-size: 0.65rem;
  color: var(--ui-color);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.slider-wrap {
  height: 66px;
  width: var(--thumb-size);
  display: flex;
  align-items: center;
  justify-content: center;
}

.vertical-slider {
  width: 66px;
  height: var(--thumb-size);
  -webkit-appearance: none;
  appearance: none;
  background: var(--ui-track);
  border-radius: calc(var(--thumb-size) / 2);
  transform: rotate(-90deg);
  transform-origin: center center;
}

.vertical-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: var(--thumb-size);
  height: var(--thumb-size);
  background: var(--ui-color);
  border-radius: 50%;
  cursor: pointer;
}

.vertical-slider::-moz-range-thumb {
  width: var(--thumb-size);
  height: var(--thumb-size);
  background: var(--ui-color);
  border: none;
  border-radius: 50%;
  cursor: pointer;
}

