body {
  font-family: sans-serif;
  background: #111;
  color: #eee;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 20px;
  gap: 20px;
}

canvas {
  border: 1px solid #444;
  width: 600px;         /* fast bredde */
  height: auto;         /* højde følger proportionerne */
  background: black;
  display: block;
  margin: 0 auto;       /* centrer canvas */
}

.controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 15px;
  background: #1e1e1e;
  border-radius: 10px;
  min-width: 320px;
}

.side-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 15px;
  background: #1e1e1e;
  border-radius: 10px;
  min-width: 280px;
  max-width: 280px;  /* før 240px → nu bredere */
  box-sizing: border-box;
}

details {
  background: #2a2a2a;
  padding: 10px;
  border-radius: 8px;
  transition: background 0.3s;
}

details summary {
  cursor: pointer;
  font-weight: bold;
}

details.active {
  background: #335533;
}

details.active > summary {
  background: transparent;
  color: inherit;
}

label {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 6px;
}

label span {
  min-width: 140px;
  text-align: left;
}

input[type="range"], select {
  flex: 1;
}

label.button, 
button {
  display: inline-block;
  background: #444;
  color: #eee;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  margin-top: 8px;
  text-align: center;
}

label.button:hover,
button:hover {
  background: #666;
}

/* Demo dropdown fast bredde */
.demo-details {
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;      /* sikrer at intet stikker ud */
}

.demo-details > summary {
  display: list-item;   /* så pilen vises */
  width: 100%;
  cursor: pointer;
  font-weight: bold;
}

.demo-grid {
  display: grid;
  grid-template-columns: repeat(3, calc((100% - 16px) / 3));
  /* 3 kolonner: (100% - 2 gaps á 8px) / 3 */
  gap: 8px;
  margin-top: 10px;
  width: 100%;
  box-sizing: border-box;
}

.demo-thumb {
  width: 100%;           /* udfylder sin kolonne */
  aspect-ratio: 1 / 1;   /* kvadratisk */
  object-fit: cover;
  cursor: pointer;
  border: 2px solid #444;
  border-radius: 6px;
  display: block;
}

.demo-thumb:hover {
  border-color: #888;
}

.demo-thumb.active {
  border-color: #4caf50;
  box-shadow: 0 0 6px #4caf50;
}

.demo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr); /* 3 kolonner */
  gap: 6px;
  margin-bottom: 6px;

  max-height: 300px;   /* svarer til ca. 3 rækker billeder */
  overflow-y: auto;    /* tilføj scroll når der er for mange */
  padding-right: 4px;  /* plads til scrollbar */
}

/* gør scrollbaren pænere */
.demo-grid::-webkit-scrollbar {
  width: 6px;
}
.demo-grid::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 3px;
}
.demo-grid::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* Modal - Flere billeder */
#moreImagesModal {
  display: none;                /* skjult som standard */
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.7);
  align-items: center;
  justify-content: center;
  z-index: 999;
}

#moreImagesModal .modal-content {
  background: #1e1e1e;
  padding: 20px;
  border-radius: 10px;
  max-width: 80%;
  max-height: 80%;
  overflow: auto;
  color: #eee;
}