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

body {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background-color: #0f172a;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: #f8fafc;
}

#canvas-container {
  width: 100%;
  height: 100%;
}

/* 우측 상단 컨트롤 영역 (개수 토글 + 좌표축) */
#top-right-controls {
  position: absolute;
  top: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  z-index: 10;
}

#wg-count-selector {
  background: rgba(30, 41, 59, 0.85);
  backdrop-filter: blur(8px);
  padding: 6px 12px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.selector-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #94a3b8;
}

.btn-toggle-wg {
  background: #334155;
  color: #94a3b8;
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 0.8rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-toggle-wg.active {
  background: #38bdf8;
  color: #0f172a;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.5);
}

#axis-container {
  width: 120px;
  height: 120px;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(8px);
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  pointer-events: none;
}

#ui-panel {
  position: absolute;
  top: 20px;
  left: 20px;
  background: rgba(30, 41, 59, 0.9);
  backdrop-filter: blur(10px);
  padding: 18px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
  width: 320px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
}

#ui-panel::-webkit-scrollbar {
  width: 6px;
}
#ui-panel::-webkit-scrollbar-thumb {
  background: #475569;
  border-radius: 3px;
}

h2 {
  font-size: 1.1rem;
  margin-bottom: 12px;
  color: #38bdf8;
}

.section-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #f1f5f9;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.sub-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: #38bdf8;
  margin: 10px 0 4px 0;
}

.divider {
  border: 0;
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
  margin: 12px 0;
}

.preset-group {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.preset-label {
  font-size: 0.75rem;
  color: #94a3b8;
  width: 100%;
}

.btn-preset {
  background: #334155;
  color: #f8fafc;
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-preset:hover {
  background: #38bdf8;
  color: #0f172a;
  font-weight: 600;
}

.btn-toggle {
  width: 100%;
  background: #0284c7;
  color: #fff;
  border: none;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: background 0.2s;
  margin-bottom: 8px;
}

.btn-toggle:hover {
  background: #0369a1;
}

.collapsible-content {
  display: block;
  background: rgba(15, 23, 42, 0.5);
  padding: 10px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.graph-box {
  background: #0f172a;
  border-radius: 6px;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  margin-top: 6px;
}

.control-group {
  margin-bottom: 8px;
}

.control-group label {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: #cbd5e1;
  margin-bottom: 4px;
}

.control-group span {
  font-weight: 700;
  color: #38bdf8;
}

.control-group input[type="range"] {
  width: 100%;
  height: 5px;
  background: #334155;
  border-radius: 3px;
  outline: none;
  accent-color: #38bdf8;
  cursor: pointer;
}