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

html, body {
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background-color: #000000;
  color: #ffffff;
  height: 100%;
  width: 100%;
  position: fixed;
  touch-action: none;
}

.container {
  display: flex;
  height: 100vh;
  height: 100dvh; /* Dynamic viewport height for mobile */
  width: 100vw;
  background: #000000;
  position: relative;
}

/* Sidebar */
.sidebar {
  width: 320px;
  background: linear-gradient(180deg, #18181b 0%, #000000 100%);
  border-right: 1px solid #27272a;
  display: flex;
  flex-direction: column;
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.5);
}

.sidebar-header {
  padding: 16px;
  border-bottom: 1px solid #27272a;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.back-button {
  position: absolute;
  left: 8px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #d4d4d8;
  border-radius: 6px;
  transition: all 0.1s ease;
  text-decoration: none;
}

.back-button:hover {
  color: #ffffff;
  transform: translateX(-2px);
}

.back-button:active {
  transform: translateX(-2px) scale(0.9);
}

.sidebar-header h1 {
  font-size: 24px;
  font-weight: 700;
  background: linear-gradient(135deg, #ec4899 0%, #f43f5e 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sidebar-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.controls-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.section-title {
  font-size: 14px;
  font-weight: 600;
  color: #f9a8d4;
  margin-bottom: 8px;
}

.control-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  background: rgba(24, 24, 27, 0.5);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.control-item:hover {
  background: #18181b;
}

.control-label {
  font-size: 14px;
  color: #d4d4d8;
  transition: color 0.2s ease;
}

.control-item:hover .control-label {
  color: #ffffff;
}

.control-item input[type="checkbox"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: #ec4899;
  border-radius: 4px;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid #27272a;
}

.reset-button {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, #ec4899 0%, #f43f5e 100%);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(236, 72, 153, 0.25);
}

.reset-button:hover {
  box-shadow: 0 4px 16px rgba(236, 72, 153, 0.4);
}

.reset-button:active {
  transform: translateY(0);
}

.info-box {
  background: #18181b;
  border: 1px solid #831843;
  border-radius: 4px 4px 0 0;
  padding: 16px;
}

.info-title {
  font-size: 14px;
  font-weight: 600;
  color: #f9a8d4;
  margin-bottom: 12px;
}

.info-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #d4d4d8;
  margin-bottom: 8px;
}

.info-item:last-child {
  margin-bottom: 0;
}

.info-icon {
  width: 20px;
  height: 20px;
  background: #27272a;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

#canvas-container {
  flex: 1;
  position: relative;
  background: linear-gradient(135deg, #09090b 0%, #000000 100%);
}

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

/* Scrollbar */
.sidebar-content::-webkit-scrollbar {
  width: 6px;
}

.sidebar-content::-webkit-scrollbar-track {
  background: #000000;
}

.sidebar-content::-webkit-scrollbar-thumb {
  background: #27272a;
  border-radius: 3px;
}

.sidebar-content::-webkit-scrollbar-thumb:hover {
  background: #3f3f46;
}

/* Mobile Responsive */
@media (max-width: 1024px) {
  .container {
    flex-direction: column;
  }
  
  .sidebar {
    width: 100%;
    max-height: none;
    height: auto;
    border-right: none;
    border-bottom: 1px solid #27272a;
    flex-shrink: 0;
  }
  
  .sidebar-header {
    padding: 12px 16px;
  }
  
  .sidebar-header h1 {
    font-size: 18px;
  }
  
  .sidebar-content {
    padding: 12px 16px;
    max-height: none;
    overflow-y: visible;
  }
  
  .control-item {
    padding: 10px 12px;
  }
  
  .control-label {
    font-size: 13px;
  }
  
  .sidebar-footer {
    padding: 12px 16px;
  }
  
  .reset-button {
    padding: 10px;
    font-size: 14px;
  }
  
  .info-box {
    padding: 12px 16px;
  }
  
  .info-title {
    font-size: 13px;
    margin-bottom: 8px;
  }
  
  .info-item {
    font-size: 11px;
    margin-bottom: 6px;
  }
  
  #canvas-container {
    flex: 1;
    min-height: 0;
    height: auto;
  }
}

@media (max-width: 768px) {
  .sidebar-header h1 {
    font-size: 16px;
  }
  
  .section-title {
    font-size: 13px;
  }
  
  .control-item {
    padding: 8px 10px;
  }
  
  .control-label {
    font-size: 12px;
  }
  
  .control-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
  }
  
  .info-box {
    display: none;
  }
}