:root {
  --accent: cyan;
}

body {
  background: radial-gradient(circle at center, #020202 40%, #000);
  margin: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  overflow: hidden;
  color: white;
  /* Use Orbitron for a technical aesthetic; fall back to system sans */
  font-family: 'Orbitron', 'Segoe UI', system-ui, sans-serif;
}

.title {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  color: #9ff;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-shadow: 0 2px 12px rgba(0,255,255,0.06);
  z-index: 30;
}

canvas {
  border: 2px solid #0ff2;
  background-color: #000;
  box-shadow: 0 0 30px #0ff5;
  border-radius: 16px;
}

.controls {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  /* wider control panel to match larger canvas */
  width: 380px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: rgba(0, 0, 0, 0.7);
  padding: 12px 14px;
  border-radius: 0 12px 12px 0;
  box-shadow: 2px 0 18px rgba(0,255,255,0.04);
  backdrop-filter: blur(6px);
  transition: width 220ms ease, transform 220ms ease;
}

.controls .row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  width: 100%;
}

.hidden { display: none !important; }

/* Simple toggle button for damping */
.toggle {
  appearance: none;
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
  border: 1px solid rgba(255,255,255,0.04);
  color: #caffff;
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s ease, transform 0.08s ease;
}
.toggle.on {
  background: linear-gradient(180deg, rgba(0,255,255,0.12), rgba(0,255,255,0.04));
  border-color: rgba(0,255,255,0.24);
  color: #001;
}
.toggle.off {
  opacity: 0.7;
}

.controls label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #caffff;
  font-size: 13px;
}

/* Toggle button at top of the control bar */
#controlsToggle {
  background: linear-gradient(180deg, rgba(0,255,255,0.12), rgba(0,255,255,0.04));
  color: #eaffff;
  border: 1px solid rgba(0,255,255,0.12);
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  align-self: flex-start;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
#controlsToggle:hover { transform: translateX(2px); box-shadow: 0 6px 18px rgba(0,255,255,0.06); }

/* collapsed state: narrow bar showing only toggle */
.controls.collapsed {
  width: 56px;
  padding: 10px 6px;
}

/* When collapsed: hide all inner blocks except the toggle button */
.controls.collapsed .featureboxes,
.controls.collapsed .row,
.controls.collapsed .section,
.controls.collapsed .content,
.controls.collapsed label,
.controls.collapsed .presets,
.controls.collapsed .control-item {
  display: none !important;
}
.controls.collapsed #controlsToggle {
  align-self: center;
  display: inline-block;
}

/* content area spacing inside the panel */
.controls .content {
  overflow: auto;
  padding-right: 6px;
}

/* top quick section boxes removed */

.section {
  transition: max-height 220ms ease, opacity 200ms ease;
  overflow: hidden;
}

.section[hidden] {
  max-height: 0 !important;
  opacity: 0;
  padding: 0 !important;
  margin: 0 !important;
}


.featureboxes {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px 8px;
  align-items: stretch;
}

.featurebox {
  width: 44px;
  height: 36px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.04);
  color: #caffff;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 13px;
  align-self: center;
}

/* popup inserted under a featurebox when clicked */
.feature-popup {
  margin: 6px auto 12px auto;
  padding: 8px;
  background: rgba(10, 20, 22, 0.7);
  border: 1px solid rgba(0,255,255,0.06);
  border-radius: 8px;
  width: 240px;
  box-shadow: 0 6px 18px rgba(0,255,255,0.03);
}

.featurebox { width: 92%; text-align: left; padding-left: 8px; }
.featurebox.active { font-weight: 700; }

.featurebox.active, .featurebox[aria-pressed="true"] {
  background: linear-gradient(180deg, rgba(0,255,255,0.12), rgba(0,255,255,0.04));
  color: #001;
  border-color: rgba(0,255,255,0.18);
}

.control-item { display: inline-block; }
.control-item[hidden] { display: none !important; }

button {
  background: #0ff3;
  border: 1px solid #0ff8;
  color: white;
  border-radius: 8px;
  padding: 6px 12px;
  cursor: pointer;
  font-weight: 600;
  transition: 0.2s;
  text-shadow: 0 0 6px #0ff;
}
button:hover {
  background: #0ff8;
  transform: scale(1.05);
}

input[type="range"] {
  vertical-align: middle;
  accent-color: var(--accent);
}

input[type="color"] {
  width: 36px;
  height: 26px;
  padding: 0;
  border: none;
  background: transparent;
}

/* Improved select styling for presets & trail mode */
.controls select {
  -webkit-appearance: none;
  appearance: none;
  background-color: rgba(255,255,255,0.02);
  color: #dffcff;
  border: 1px solid rgba(0,255,255,0.12);
  padding: 6px 36px 6px 10px;
  border-radius: 8px;
  height: 34px;
  font-size: 13px;
  box-shadow: 0 2px 8px rgba(0,255,255,0.04), inset 0 -1px 0 rgba(255,255,255,0.02);
  background-image: linear-gradient(45deg, transparent 50%, rgba(0,255,255,0.9) 50%), linear-gradient(135deg, rgba(0,255,255,0.9) 50%, transparent 50%);
  background-position: calc(100% - 16px) calc(50% - 3px), calc(100% - 10px) calc(50% - 3px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  transition: box-shadow 0.12s ease, border-color 0.12s ease, transform 0.08s ease;
}

.controls select:hover {
  border-color: rgba(0,255,255,0.28);
  transform: translateY(-1px);
}

.controls select:focus {
  outline: none;
  box-shadow: 0 0 14px rgba(0,255,255,0.22);
  border-color: #00f0e0;
}

/* Make the select container align nicely in the presets row */
.controls .presets {
  align-items: center;
  gap: 8px;
}

.info {
  position: absolute;
  bottom: 20px;
  left: 20px;
  color: #0ff;
  font-size: 14px;
  font-weight: 500;
  background: rgba(0, 0, 0, 0.4);
  padding: 6px 12px;
  border-radius: 8px;
  text-shadow: 0 0 10px #0ff;
}
