/* ===== BASE ===== */
body {
  margin: 0;
  overflow: hidden;
  background: black;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}

.inline-controls {
  display: flex;
  gap: 16px;
  align-items: center;
}
canvas {
  display: block;
}
/* ===== CUSTOM SELECT ===== */
#palette, #sceneSelect {
  width: 100%;
  padding: 8px 10px;
  border-radius: 12px;
  height:40px;

  background: rgba(255,255,255,0.05);
  color: white;

  border: 1px solid rgba(255,255,255,0.1);

  font-size: 12px;

  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;

  cursor: pointer;
}
#panelFade {
  position: fixed;
  bottom: 0;
  right: 0;
  width: 290px;  /* match panel */
  height: 65px;
  background: linear-gradient(
    to bottom,
    transparent,
    rgba(0, 0, 0, 0.9)
  );
  pointer-events: none;
  z-index: 1000;
  transition: transform 0.3s;
}

/* When panel is closed, slide the fade off too */
#panel.closed ~ #panelFade {
  transform: translateX(100%);
}
/* dropdown options */
#palette option, #sceneSelect option {
  background: #1a1a24;
  color: white;
}
/* wrapper for arrow */
#palette-wrapper, #scene-wrapper {
  position: relative;
}

/* custom arrow */
#palette-wrapper::after, #scene-wrapper::after {
  content: "▾";
  position: absolute;
  right: 15px;
  top: 63%;
  transform: translateY(-50%);
  pointer-events: none;
  opacity: 0.6;
  font-size: 12px;
}

/* ===== PANEL ===== */
#panel {
  position: fixed;
  right: 0;
  top: 0;
  bottom: 0;
  width: 260px;
  z-index: 10;

  transform: translateX(0);
  transition: transform 0.3s ease-out;

  overflow-y: auto;
  overflow-x: visible;

  background: rgba(20,20,30,0.6);
  backdrop-filter: blur(7px);

  padding: 15px;
  padding-bottom: 72px;

  color: white;
  box-shadow: 0 10px 40px rgba(0,0,0,0.4);
}
canvas {
  position: fixed;
  pointer-events: none;
  top: 0;
  left: 0;
  z-index: 0;
}
#panel.closed {
  transform: translateX(100%);
}

/* ===== TOGGLE TAB ===== */
#panelToggle {
  color: white;
  position: fixed;
  top: 50%;
  transform: translate(0, -50%);
  right: 290px;

  width: 22px;
  height: 100px;

  background: rgba(20,20,30,0.6);
  box-shadow: inset 0 10px 40px rgba(0,0,0,0.1);
  border-radius: 8px 0 0 8px;

  display: flex;
  align-items: center;
  justify-content: flex-start;

  padding-left: 12px;

  cursor: pointer;
  z-index: 1000;
  opacity:.8;
  font-size:20px;

  transition:
    transform 0.3s ease-out,
    width 0.15s ease-out,
    background 0.15s ease-out;
}
.inline-controls {
  display: flex;
  gap: 16px;
  align-items: center;
}

.inline-buttons {
  display: flex;
  gap: 8px;
  align-items: center;
}

.inline-buttons button {
  flex: 1;
}
#panel.closed ~ #panelToggle {
  transform: translate(292px, -50%);
}

@media (hover: hover) and (pointer: fine) {
  #panelToggle:hover {
    width: 44px;
    background: rgba(20,20,30,0.8);
  }
}
@media (hover: none) {
  #panelToggle:hover,
  #panelToggle:focus,
  #panelToggle:focus-visible,
  #panelToggle:active {
    width: 22px;
    background: rgba(20,20,30,0.6);
  }
}
#panelToggle:focus {
  outline: none;
}

/* ===== HEADERS ===== */
.panel-header {
  display: flex;
  align-items: center;
  gap: 10px;
}
a {
  color: #fff;
}
.panel-header svg {
  width: 40px;
  height: 40px;
  opacity: 0.9;
}

.title-group h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 900;
}
.title-group h1 thin {
  
  font-weight: 100;
}

.title-group p {
  margin: 2px 0 0;
  font-size: 11px;
  opacity: 0.6;
}

/* ===== TEXT ===== */
h3 {
  margin-top: 18px;
  margin-bottom: 6px;
  font-size: 15px;
  font-weight: 900;
  opacity: 0.85;
  text-decoration: underline;
}

label {
  font-size: 12px;
  opacity: 0.8;
  margin-top: 10px;
  display: block;
}
.palette-box.open{
      background: rgba(255, 255, 255, 0.13);
}
/* ===== INPUTS ===== */
select, input[type="range"] {
  width: 99%;
}
input:disabled {
  pointer-events: none;
}
input[type="range"]:disabled {
  opacity: 0.25;
  filter: grayscale(0.4);
}
input[type="range"] {
  -webkit-appearance: none;
  height: 4px;
  border-radius: 2px;
  background: #2a2a3a;
  outline: none;
}
#panel.closed {
  box-shadow: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: white;
  cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: white;
  cursor: pointer;
}
.color-row {
  display: flex;
  gap: 10px;
}
/* ===== BUTTONS ===== */
button {
  margin-top: 16px;
  padding: 10px;
  border-radius: 8px;
  border: none;
  background: #0080FF;
  color: white;
  font-weight:  600;
  cursor: pointer;
}

/* ===== PALETTE ===== */
.palette-box {
  margin-top: 10px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.color-row {
  display: flex;
  gap: 10px;
}

.color-item {
  flex: 1;
}

input[type="color"] {
  width: 100%;
  height: 36px;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: none;
  cursor: pointer;
  margin-top:8px;
}
input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

input[type="color"]::-webkit-color-swatch {
  border: none;
  border-radius: 6px;
}
input[type="color"]::-moz-color-swatch {
  border: none;
  border-radius: 6px;
}

.thin{
    font-weight: 100;
}

/* ===== COLLAPSIBLE ===== */
.collapsible-header {
  display: flex;
  justify-content: space-between;
  cursor: pointer;
}

.collapsible-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
}

.collapsible.open .collapsible-content {
  max-height: 500px;
}

.chevron {
  font-size: 12px;
  opacity: 0.6;
  
}

.collapsible.open .chevron {
  transform: rotate(180deg);
}

#baseHue {
  -webkit-appearance: none;
  appearance: none;

  width: 99%;
  height: 8px;
  border-radius: 2px;

  background: linear-gradient(
    90deg,
    red 0%,
    yellow 16%,
    lime 33%,
    cyan 50%,
    blue 66%,
    magenta 83%,
    red 100%
  );
}

/* Chrome / Edge */
#baseHue::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;

  width: 14px;
  height: 14px;
  border-radius: 50%;

  background: white;
   /* 👇 soft subtle shadow */
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
  cursor: pointer;
}
#baseHue::-webkit-slider-thumb:hover {
  box-shadow: 0 2px 6px rgba(0,0,0,0.35);
}
/* Firefox */
#baseHue::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.25);
  background: white;
  cursor: pointer;
}

input#baseHue {
  background: linear-gradient(
    90deg,
    red,
    yellow,
    lime,
    cyan,
    blue,
    magenta,
    red
  );
}

/* ===== MOBILE ===== */
@media (max-width: 600px) {
  /* Panel — fixed 320px width, capped to viewport so it never overflows */
  #panel {
    width: 280px;
    max-width: 90vw;
    padding: 12px;
    padding-bottom: 40px;
  }
#panelFade {
  
  right: 0;
  width: 305px;  /* match panel */
  
}

  /* Toggle sits to the left of the panel's left edge */
  #panelToggle {
    right: 304px;
    width: 22px;
    height: 80px;
    font-size: 18px;
    padding-left: 10px;
  }
  #panel.closed ~ #panelToggle {
    transform: translate(304px, -50%);
  }

  /* Bigger headers */
  .title-group h1 {
    font-size: 24px;
  }
  .title-group p {
    font-size: 12px;
  }
  h3 {
    font-size: 15px;
    margin-top: 22px;
  }
  label {
    font-size: 12px;
    margin-top: 14px;
  }

  /* Bigger touch targets — sliders */
  input[type="range"] {
    height: 6px;
  }
  input[type="range"]::-webkit-slider-thumb {
    width: 16px;
    height: 16px;
  }
  input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
  }

  #baseHue {
    height: 12px;
  }
  #baseHue::-webkit-slider-thumb {
    width: 16px;
    height: 16px;
  }
  #baseHue::-moz-range-thumb {
    width: 16px;
    height: 16px;
  }

  /* Bigger dropdowns */
  #palette, #sceneSelect {
    height: 48px;
    font-size: 14px;
    padding: 10px 14px;
  }
  .palette-box {
    padding: 14px 14px;
    label{
      font-size: 14px;
    }
    
  }

  /* Bigger buttons */
  button {
    padding: 14px;
    font-size: 14px;
    min-height: 48px;
  }

  /* Bigger color pickers */
  input[type="color"] {
    height: 44px;
  }
}