body {
  margin: 0;
  background: #ffffff;
  color: #ffffff;
  font-family: Arial, Helvetica, sans-serif;
  overflow: hidden;
}

#ui {
  position:fixed;
  top: 10px;
  left: 10px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(8px);
  z-index: 10;
  max-width: 320px;
  font-size: 14px;
}

/* NEU: versteckt das ganze Einstellungsmenü, wenn diese Klasse gesetzt ist */
#ui.hidden {
  display: none;
}

/* NEU: kleiner, immer sichtbarer Knopf zum Ein-/Ausklappen des Menüs.
   Liegt rechts oben, damit er nie vom Einstellungsmenü überdeckt wird. */
#toggleUIBtn {
  position: fixed;
  top: 10px;
  right: 10px;
  z-index: 11;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: #ff0000;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
}

#ui h1 {
  font-weight: 800;
  line-height: 90%;
    color: #000000;
  font-size: 50px;
  margin: 0 0 8px 0;
}

.control {
  font-family: Helvetica, sans-serif;
  font-weight: 600;
  color: #000000;
  margin-top: 10px;
  margin-bottom: 8px;
}

.control label {
        color: #000000;
  display: block;
  margin-bottom: 2px;
}

.control input[type="range"] {
  background-color: #000000;
     color: #000000;

  width: 100%;
}

/* NEU: einfaches Textfeld, gleicher Stil wie der Rest */
.control input[type="text"] {
  width: 100%;
  box-sizing: border-box;
  padding: 4px 6px;
}

.modes {
    color: #000000;

  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.modes button {
  font-family: Helvetica, sans-serif;

  border: none;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 12px;
  margin-top: 5px;
  cursor: pointer;
  background:#000000;
;
  color: #fff;
}

.modes button.active {
  background: #ffffff;
  color: #000;
  font-weight: 600;
}

#squareColour, #textColour {
  width: 60px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
stroke: none;
}

#circleColour {
  width:60px;
  padding:0;
  border:none;
  background: transparent;
  cursor: pointer;
  stroke:none;
}

#downloadBtn{
  font-family: Helvetica, sans-serif;

    width: 100%;
    padding: 6px 10px;
    margin-top: 10px;
    border-radius: 4px;
    margin-top: 10px;
    border: none;
    cursor: pointer;
    background: #ffffff;
    color: #000;
font-weight: 600;
}

/* NEU: Knopf zum Auf- und Zuklappen der Historie */
#toggleHistoryBtn {
  font-family: Helvetica, sans-serif;

    width: 100%;
    padding: 6px 10px;
    margin-top: 10px;
    border: none;
    cursor: pointer;
    background: #000000;
    color: #fff;
    font-weight: 600;
}

#gridToggle{
  margin-top:10px;
  margin-bottom:10px;
}

/* NEU: Historie-Box. Standardmäßig versteckt (display: none),
   wird per Knopf-Klick mit der Klasse "open" sichtbar gemacht.
   z-index ist HÖHER als #ui (z-index: 10), damit die Historie nicht
   hinter dem Einstellungsmenü verschwindet, wenn sich beide Boxen
   auf dem Bildschirm überlappen. */
/* NEU: Historie-Box. Standardmäßig versteckt (display: none),
   wird per Knopf-Klick mit der Klasse "open" sichtbar gemacht.
   GEÄNDERT: liegt jetzt rechts statt links, damit sie sich auch bei
   vielen Einträgen NIE mit dem #ui-Menü (das links liegt) überlappen
   kann — vorher wuchs sie nach oben und verdeckte irgendwann das Menü. */
#historyBox {
  display: none;
  position: fixed;
  bottom: 10px;
  right: 10px;
  max-width: 320px;
  max-height: 50vh;
  overflow-y: auto;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(8px);
  padding: 10px 14px;
  font-size: 12px;
  color: #000000;
  z-index: 12;
}

#historyBox.open {
  display: block;
}

#historyBox h2 {
  margin: 0 0 6px 0;
  font-size: 16px;
}

#historyList {
  margin: 0;
  padding-left: 16px;
}

/* NEU: kleines Vorschaubild in der Historie-Liste */
#historyList img {
  width: 50px;
  height: 30px;
  object-fit: cover;
  vertical-align: middle;
  border: 1px solid #003cff55;
  border-radius: 4px;
}

#historyList li {
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}

#historyList a {
  color: #ff0000;
  font-weight: 600;
  text-decoration: none;
}

/* NEU: Status-Box (Editor/Warteposition), liegt zentriert oben,
   immer sichtbar — auch für Viewer, deren Menü gesperrt ist */
#statusBox {
  position: fixed;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 13;
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
  text-align: center;
}

#statusAnzeige {
  margin: 0;
}

#fertigBtn {
  margin-top: 6px;
  width: 100%;
  padding: 6px 10px;
  border: none;
  border-radius: 4px;
  background: #ffffff;
  color: #000;
  font-weight: 600;
  cursor: pointer;
}