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

body {
  font-family: sans-serif;
  overflow: hidden;
  height: 100vh;
  background: #111;
  color: #eee;
}

.app {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

/* ── 탭 바 ── */
.tab-bar {
  display: flex;
  gap: 2px;
  padding: 6px 10px 0;
  background: #1a1a1a;
  border-bottom: 1px solid #333;
  flex-shrink: 0;
}

.tab {
  padding: 6px 18px;
  background: #2a2a2a;
  border: 1px solid #444;
  border-bottom: none;
  border-radius: 4px 4px 0 0;
  color: #aaa;
  cursor: pointer;
  font-family: sans-serif;
  font-size: 13px;
  transition: background 0.15s, color 0.15s;
}

.tab:hover { background: #383838; color: #ddd; }

.tab.active {
  background: #111;
  color: #fff;
  border-color: #555;
}

/* ── 사이트 링크 ── */
.site-link {
  margin-left: auto;
  align-self: center;
  padding: 4px 10px;
  font-size: 12px;
  color: #888;
  text-decoration: none;
  white-space: nowrap;
}

.site-link:hover { color: #ccc; }

/* ── 캔버스 영역 ── */
.canvas-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
}

#main-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* ── 밀도 슬라이더 ── */
.density-control {
  position: absolute;
  bottom: 16px;
  left: 16px;
  background: rgba(0,0,0,0.65);
  border: 1px solid #444;
  border-radius: 8px;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 160px;
}

.density-control label {
  font-size: 12px;
  color: #bbb;
  display: flex;
  gap: 4px;
  align-items: center;
}

#density-val {
  font-family: monospace;
  color: #fff;
  min-width: 20px;
  text-align: center;
}

#density-slider {
  width: 100%;
  accent-color: #7af;
  cursor: pointer;
}

/* ── HSL 피커 패널 ── */
.picker-panel {
  position: absolute;
  bottom: 16px;
  right: 16px;
  background: rgba(20,20,20,0.92);
  border: 1px solid #444;
  border-radius: 10px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  width: 184px;
}

#hue-wheel,
#sl-box {
  border-radius: 4px;
  cursor: crosshair;
  display: block;
  max-width: 100%;
}

#hue-wheel { width: 160px; height: 160px; }
#sl-box { width: 160px; height: 100px; }

.color-info {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.color-info span {
  font-family: monospace;
  font-size: 15px;
  color: #ccc;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#color-preview {
  width: 100%;
  height: 20px;
  border-radius: 4px;
  border: 1px solid #555;
  background: hsl(0, 100%, 50%);
}

/* ── 힌트 ── */
.canvas-hint {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  font-family: monospace;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.3);
  pointer-events: none;
  white-space: nowrap;
  letter-spacing: 0.5px;
}

/* ── 툴팁 ── */
#tooltip {
  position: fixed;
  pointer-events: none;
  background: rgba(0,0,0,0.8);
  border: 1px solid #555;
  border-radius: 5px;
  padding: 5px 9px;
  font-size: 11px;
  font-family: monospace;
  color: #fff;
  display: none;
  z-index: 100;
  white-space: nowrap;
}
