html, body {
  display: flex;
  margin: 0;
  color: #e5e7eb;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  /* background: linear-gradient(135deg, #1e1e1e, #3a3a3a); */
  background: transparent;
}

#app {
  display: flex;
  height: 100%;
  width: 100%;
  overflow: hidden;
}

/* Buttons */
.openImageBtn {
  width: 100%;
  display: flex;
  align-items: center;
  padding: 8px 14px;
  border: 1px solid #3b4252;
  background: linear-gradient(145deg, #1f2937, #111827);
  color: #e5e7eb;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s ease-in-out;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

/* Style the file input button */
input[type="file"] {
  font-size: 13px;
  color: #e5e7eb;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 6px 12px;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
}

/* Style the clickable "Choose File" button (WebKit browsers) */
input[type="file"]::-webkit-file-upload-button {
  background: linear-gradient(145deg, #1f2937, #111827);
  color: #e5e7eb;
  border-radius: 8px;
  border: 1px solid #3b4252;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
}

/* Hover effect */
input[type="file"]::-webkit-file-upload-button:hover {
  background: linear-gradient(145deg, #2b3545, #191f2c);
  border-color: #4c566a;
}

/* Firefox-specific */
input[type="file"]::file-selector-button {
  background: linear-gradient(145deg, #1f2937, #111827);
  color: #e5e7eb;
  border: 1px solid #3b4252;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  margin-inline-end: 1rem;
}

input[type="file"]::file-selector-button:hover {
  background: linear-gradient(145deg, #2b3545, #191f2c);
  border-color: #4c566a;
  border-radius: 8px;
}

.btn:hover {
  background: linear-gradient(145deg, #2b3545, #191f2c);
  border-color: #4c566a;
  transform: translateY(-1px);
}


/* Dropdown Menus (Select) */
select {
  width: 100%;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  color: #e5e7eb;
  border: 1px solid #334155;
  background: #1e293b;
  outline: none;
  transition: all 0.2s ease-in-out;
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg fill='white' height='14' viewBox='0 0 20 20' width='14' xmlns='http://www.w3.org/2000/svg'><path d='M5.516 7.548a.625.625 0 0 1 .884-.884L10 10.264l3.6-3.6a.625.625 0 1 1 .884.884l-4.042 4.041a.625.625 0 0 1-.884 0L5.516 7.548z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 14px;
}

#app {
  display: flex;
  height: 100vh;   /* lock full screen */
  width: 100vw;
  overflow: hidden;
}


#ui {
  display: flex;
  flex-direction: column;  /* stack panels vertically */
  justify-content: flex-start; /* align from the very top */
  width: 340px;
  flex-shrink: 0;
  height: 100%;      /* 🔥 force full height */
  overflow-y: auto;  /* scroll only inside controls */
  border: 1px solid #1f2937;
  background: #181c23;
  padding: 16px;     /* space inside instead of top margin */
  transition: transform 0.3s ease;
}

/* remove top margins that push content down */
#ui .panel:first-child {
  margin-top: 0;
}

#ui.hidden {
  transform: translateX(340px); /* move it out of view */
  pointer-events: none;
}


canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.panel {
  display: flex;
  flex-direction: column;
  align-items: baseline;
  background: #00000011;
  border: 1px solid rgb(31, 41, 55);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 14px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .25) inset;
}

.panel h3 {
  margin: 0 0 10px;
  font-size: 14px;
  letter-spacing: .02em;
  color: #a5b4fc;
}

.rowSingle {
  display: flex;
  width: 100%;
  gap: 8px;
  margin: 6px 0;
}

.row {
  display: grid;
  grid-template-columns: 120px 1fr 70px; /* Label, slider, number */
  align-items: center;
  gap: 8px;
  margin: 6px 0;
  justify-items: center;
}

.row input[type="range"] {
  width: 100%;
}

.row input[type="number"] {
  width: 70px;
  padding: 3px;
  border-radius: 6px;
  border: 1px solid #334155;
  background: #1e293b;
  color: #e5e7eb;
}

.muted {
  color: #94a3b8;
  font-size: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid #334155;
  background: #111827;
  color: #e5e7eb;
  cursor: pointer;
  font-size: 13px;
}

.btn:active {
  transform: translateY(1px);
}

a.small {
  color: #93c5fd;
  text-decoration: none;
  font-size: 12px;
}

.credit {
  font-size: 11px;
  color: #64748b;
  margin-top: 6px;
}

/* Toggle button */
.toggle-btn {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 1000;
  background: #1e293b;
  color: #e5e7eb;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.2s;
}

.toggle-btn:hover {
  background: #334155;
}

#app {
  display: flex;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

#viewport {
  background: #fff;
  transition: width 0.3s ease; /* optional: smooth resize */
  background-color: transparent;
  width: 100%;
}