:root {
  --cd-black:#000;
  --cd-white:#fff;
  --cd-gray:#e5e5e5;
  --cd-accent:#333;
}
* { box-sizing: border-box; }
body {
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  text-align: center;
  margin: 20px;
  background-color: var(--cd-black);
  color: var(--cd-white);
}
header {
  width: 100%;
  margin: 0 auto;
}

.headerlogo {
  width: 100px;
  height: auto;
  margin: 25px 0;
  display: inline-block;
}

h1 { margin: 0 0 12px; font-size: 22px; }

/* Palette in 2 Zeilen */
#palette {
  margin: 25px 0;
  display: grid;
  grid-template-columns: repeat(6, 40px);
  grid-auto-rows: 40px;
  gap: 6px;
  justify-content: center;
}
.color {
  width: 40px;
  height: 40px;
  border: 1px solid #ccc;
  border-radius: 50%;
  cursor: pointer;
  position: relative;
  transition: transform .08s ease;
  outline: none;
}
.color.is-active {
  box-shadow:
    0 0 0 2px rgba(0,0,0,.9) inset,
    0 0 0 2px rgba(255,255,255,.85);
  transform: scale(1.06);
}
.color:focus-visible {
  outline: 2px dashed #333;
  outline-offset: 2px;
}

#grid {
  display: grid; grid-template-columns: repeat(5, 46px);
  gap: 0; justify-content: center;
  margin: 0 auto;
}
.pixel {
  width: 46px;
  height: 46px;
  background: #000;
  border: 1px solid #353535;
  cursor: pointer;
  border-radius: 5px;
}

/* Buttons */
.btn {
  appearance: none;
  border: none;
  background: var(--cd-white);
  color: var(--cd-black);
  padding: 12px 18px;
  font-weight: 400;
  border-radius: 5px;
  cursor: pointer;
  margin-top: 25px;
  box-shadow: 3px 3px 1px #7d7d7dbf;
  transition: all .3s ease, transform 0.1s ease, box-shadow 0.1s ease;
  font-size: 1.1em;
  line-height: 1.1em;
}
.btn:hover {
  background-color: var(--cd-gray);
}
.btn:active {
  transform: translate(3px,3px);
  box-shadow: 0px 0px 0px #7d7d7dbf;
}
.btn:disabled {
  cursor: not-allowed;
  transform: translate(3px,3px);
  box-shadow: 0px 0px 0px #7d7d7dbf;
  background-color: var(--cd-gray);
}

.controls {
  margin: 12px 0 8px;
  display: flex;
  justify-content: center;
  gap: 8px;
 flex-wrap: wrap;
}
.btn-sm {
  padding: 0;
  font-weight: 600;
  width: 40px;
  height: 40px;
}
.btn-sm .icon {
  width: 20px;
  height: 20px;
  vertical-align: -4px;
  pointer-events: none;
}

#msg {
  min-height: 22px;
  margin-top: 10px;
  font-size: 14px;
}
#msg.ok  { color: #5cb85c; }
#msg.err { color: #d9534f; }
