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

body {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: #0a0a0c;
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  display: flex;
}

/* Split screen layout */
.left-panel {
  position: relative;
  width: 0%;
  height: 100vh;
  background: #0a0a0c;
  overflow: hidden;
  transition: width 0.3s ease;
}

.left-panel.active {
  width: 50%;
}

.right-panel {
  position: relative;
  width: 100%;
  height: 100vh;
  background: #0a0a0c;
  overflow: hidden;
  transition: width 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.right-panel.split {
  width: 50%;
}

#glCanvas {
  display: block;
  max-width: 100%;
  max-height: 100%;
  cursor: grab;
}

#glCanvas:active {
  cursor: grabbing;
}

.controls {
  position: absolute;
  top: 0px;
  left: 0px;
  bottom: 0px;
  background: rgba(8, 8, 12, 0.8);
  /* border: 1px solid white; */
  padding: 12px;
  /* border-radius: 2px; */
  color: #ffffff;
  min-width: 200px;
  max-height: 100dvh;
  z-index: 100;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
}

.controls.collapsed {
  padding: 8px;
  min-width: auto;
  width: 36px;
  bottom: auto;
}

.controls-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  cursor: pointer;
  user-select: none;
  flex-shrink: 0;
}

.controls.collapsed .controls-header {
  margin-bottom: 0;
}

.toggle-btn {
  background: transparent;
  border: 1px solid white;
  /* border-radius: 2px; */
  padding: 4px 6px;
  cursor: pointer;
  font-size: 12px;
  /* color: rgba(80, 200, 255, 0.8); */
  color: white;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
}

.toggle-btn:hover {
  background: rgba(80, 200, 255, 0.2);
  border-color: rgba(80, 200, 255, 0.8);
  color: #fff;
}

.toggle-btn::before {
  content: '▲';
  font-size: 8px;
}

.controls.collapsed .toggle-btn::before {
  content: '▼';
}

.controls h3 {
  transition: opacity 0.3s ease;
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: rgba(255, 219, 37, 1.0);
}

.controls.collapsed h3 {
  opacity: 0;
  position: absolute;
  pointer-events: none;
}

.controls-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  transition: max-height 0.3s ease, opacity 0.3s ease;
  opacity: 1;
  scrollbar-width: thin;
  scrollbar-color: rgba(80, 200, 255, 0.3) transparent;
}

.controls-content::-webkit-scrollbar {
  width: 4px;
}

.controls-content::-webkit-scrollbar-track {
  background: transparent;
}

.controls-content::-webkit-scrollbar-thumb {
  background: rgba(80, 200, 255, 0.3);
  border-radius: 2px;
}

.controls.collapsed .controls-content {
  max-height: 0;
  opacity: 0;
}

.section-label {
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: rgba(255, 219, 37, 1.0);
  margin-top: 12px;
  margin-bottom: 6px;
  padding-bottom: 3px;
  border-bottom: 1px solid white;
}

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

.control-group label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 3px;
  font-size: 9px;
  color: white;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.control-group .value {
  /* color: rgba(80, 200, 255, 0.9); */
  color: rgba(255, 229, 80, 0.9);
  font-weight: 600;
  font-size: 9px;
  font-family: 'SF Mono', 'Fira Code', monospace;
}

.control-group input[type="range"] {
  width: 100%;
  height: 3px;
  border-radius: 0;
  background: rgb(162, 162, 162);
  outline: none;
  -webkit-appearance: none;
}

.control-group input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 0;
  background: #fff4bb;
  cursor: pointer;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.7);
  transition: all 0.15s ease;
}

.control-group input[type="range"]::-webkit-slider-thumb:hover {
  background: #fff4bb;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.7);
}

.control-group input[type="range"]::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 0;
  background: #fff4bb;
  cursor: pointer;
  border: none;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.7);
}

.aspect-ratio-select {
  width: 100%;
  padding: 5px 8px;
  background: rgba(8, 8, 12, 0.9);
  border: 1px solid rgba(0, 0, 255, 0.8);
  border-radius: 2px;
  color: rgba(200, 220, 240, 0.9);
  font-size: 9px;
  font-weight: 500;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  outline: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  font-family: 'SF Mono', 'Fira Code', monospace;
}

.aspect-ratio-select:hover {
  border-color: rgba(80, 200, 255, 0.6);
  background: rgba(80, 200, 255, 0.1);
}

.aspect-ratio-select option {
  background: #0a0a0c;
  color: #e0e8f0;
}

.checkbox-label {
  display: flex !important;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.checkbox-input {
  width: 14px;
  height: 14px;
  cursor: pointer;
  accent-color: rgba(0, 0, 255, 0.9);
  border: 1px solid rgba(0, 0, 255, 0.8);
}

.randomize-btn {
  width: 100%;
  padding: 8px;
  background: transparent;
  border: 1px solid rgba(0, 0, 255, 0.9);
  border-radius: 2px;
  color: rgba(210, 211, 255, 0.9);
  font-weight: 600;
  font-size: 9px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-family: 'SF Mono', 'Fira Code', monospace;
  margin-top: 6px;
}

.randomize-btn:hover {
  background: rgba(80, 200, 255, 0.15);
  border-color: rgba(80, 200, 255, 0.8);
  color: #fff;
  box-shadow: 0 0 15px rgba(80, 200, 255, 0.2);
}

.randomize-btn:active {
  transform: scale(0.98);
}

.hand-tracking-btn {
  width: 100%;
  padding: 8px;
  background: rgba(0, 0, 255, 0.1);
  border: 2px solid rgba(0, 0, 255, 0.9);
  border-radius: 2px;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 600;
  font-size: 9px;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 7px;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-family: 'SF Mono', 'Fira Code', monospace;
}

.hand-tracking-btn:hover {
  background: rgba(80, 200, 255, 0.2);
  border-color: rgba(80, 200, 255, 0.8);
  color: #fff;
}

.hand-tracking-btn:active {
  transform: scale(0.98);
}

.hand-tracking-btn.active {
  background: rgba(0, 0, 255, 0.2);
  color: #fff;
  box-shadow: 0 0 15px rgba(80, 200, 255, 0.3);
}

.fps-indicator {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(80, 200, 255, 0.15);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: white;
  flex-shrink: 0;
}

.fps-value {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-weight: 600;
  color: white;
}

/* Hand tracking canvas styles - left panel only */
#webcam-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  z-index: 1;
}

#hand-tracking-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}

#webcam-video {
  display: none;
}