body {
  margin: 0;
  overflow: hidden;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  font-size: 14px;
  background-color: #111;
}
canvas {
  display: block;
}

#left-panel {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 260px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none; /* Let clicks pass through gaps */
}

#right-panel {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 220px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.panel {
    background: rgba(10, 20, 40, 0.85);
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    border: 1px solid rgba(100, 150, 255, 0.2);
    backdrop-filter: blur(5px);
    overflow: hidden; /* For height animation */
    pointer-events: auto; /* Re-enable clicks */
    transition: all 0.3s ease;
}

.panel-header {
    padding: 12px 15px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: background 0.2s;
}

.panel-header:hover {
    background: rgba(255, 255, 255, 0.1);
}

h3 {
    margin: 0;
    font-size: 14px;
    color: #e0e0e0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    border: none;
    padding: 0;
}

.toggle-icon {
    color: #00aaff;
    font-size: 12px;
    transition: transform 0.3s ease;
}

.panel.collapsed .toggle-icon {
    transform: rotate(-90deg);
}

.panel-content {
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    /* Animation setup */
    max-height: 500px; /* Arbitrary large max-height */
    opacity: 1;
    transition: max-height 0.3s ease, opacity 0.3s ease, padding 0.3s ease;
}

.panel.collapsed .panel-content {
    max-height: 0;
    opacity: 0;
    padding: 0 15px; /* Keep horizontal padding to avoid jitter? No, padding-top/bottom 0 */
    padding-top: 0;
    padding-bottom: 0;
    overflow: hidden;
}

.panel.collapsed {
    border-bottom-color: transparent;
}

.control-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.button-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.checkbox-row {
    justify-content: flex-start;
    gap: 8px;
    margin-top: 5px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

input[type="number"], select {
    padding: 6px;
    border: 1px solid #445566;
    background: #1a2635;
    color: #fff;
    border-radius: 4px;
    width: 70px;
}

input[type="number"]:focus {
    outline: none;
    border-color: #00aaff;
}

button {
  cursor: pointer;
  padding: 10px 12px;
  border: 1px solid rgba(100, 150, 255, 0.3);
  border-radius: 4px;
  background: rgba(30, 50, 80, 0.8);
  color: #e0e0e0;
  font-weight: 500;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 5px;
  transition: all 0.2s;
}

button:hover {
  background: rgba(50, 80, 130, 0.9);
  border-color: #00aaff;
  color: #fff;
}

label {
    color: #b0b0b0;
}

.main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    text-align: center;
    pointer-events: none;
    z-index: 100;
    background: linear-gradient(to bottom, rgba(10, 20, 40, 0.6), transparent);
    padding: 15px 0 30px 0;
}

.main-header h1 {
    margin: 0;
    font-family: 'Segoe UI', system-ui, sans-serif;
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.5px;
    text-transform: uppercase;
    background: linear-gradient(135deg, #fff 0%, #00aaff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 2px 10px rgba(0, 170, 255, 0.4));
    text-shadow: none; /* Shadow handled by filter for gradient text */
}
