* { box-sizing: border-box; }
:root {
  --bg: #0b0d10;
  --panel: #13161b;
  --text: #e9edf1;
  --muted: #9aa4b2;
  --accent: #5ac8fa;
  --ok: #2ecc71;
  --warn: #f1c40f;
  --bad: #e74c3c;
}
html, body {
  height: 100dvh;
  overflow: hidden;
}
body {
  background: radial-gradient(1200px 600px at 10% -10%, #11161f, #0a0c10 60%);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, "Fira Sans", "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji";
  margin: 0;
  overscroll-behavior: none;
  touch-action: none;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.app-header, .app-footer {
  align-items: center;
  display: flex;
  justify-content: space-between;
  padding: clamp(8px, 2vh, 16px) 20px;
}
.app-header h1 {
  font-size: 20px;
  font-weight: 600;
  margin: 0;
}
.round-info {
  color: var(--muted);
  display: flex;
  font-size: 14px;
  gap: 12px;
}
.app-main { align-items: center; display: flex; flex-direction: column; gap: 16px; padding: clamp(10px, 2vh, 20px); height: 100%; min-height: 0; overflow: hidden; }

section {
  background: var(--panel);
  border: 1px solid #1f2630;
  border-radius: 12px;
  max-width: 760px;
  padding: clamp(10px, 2vh, 16px);
  width: 100%;
}
section h2 {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 12px;
}

.swatches {
  display: grid;
  gap: clamp(12px, 2vw, 24px);
  grid-template-columns: 1fr 1fr;
  width: 90%;
  margin: 0 auto;
}
.swatch {
  display: grid;
  gap: 8px;
}
.swatch-box {
  border: 1px solid #2a3240;
  border-radius: 8px;
  aspect-ratio: 5 / 4;
  height: clamp(80px, 18vh, 220px);
  width: 100%;
  margin: 0;

}
.swatch > h2,
.swatch > .swatch-meta {
  width: 100%;
  margin: 0;
  text-align: left;
}
.swatch-meta {
  display: none;
}

.picker > h2 {
  margin: 0 auto 8px;
  width: 90%
}

.picker { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
.picker-area {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr auto;
  align-items: stretch;
  width: 90%;
  margin: 0 auto;
  height: 100%;
  flex: 1 1 auto;
  min-height: 0;
}
.sv-wrapper {
  height: 100%;
  min-height: 0;
  position: relative;
  width: 100%;
  touch-action: none;
}
#svCanvas {
  border: 1px solid #2a3240;
  border-radius: 8px;
  display: block;
  height: 100%;
  width: 100%;
  cursor: crosshair;
  touch-action: none;
}
.cursor {
  border: 2px solid white;
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(0,0,0,0.4);
  height: 14px;
  pointer-events: none;
  position: absolute;
  transform: translate(-50%, -50%);
  width: 14px;
}
.hue-control {
  display: grid;
  gap: 6px;
  margin-bottom: 0;
  max-width: 320px;
  justify-items: center;
  min-height: 0;
  height: 100%;
  grid-template-rows: auto 1fr;
  align-content: stretch;
}
.hue-control input[type="range"] {
  accent-color: var(--accent);
  appearance: none;
  -webkit-appearance: slider-vertical;
  writing-mode: bt-lr;
  width: 40px;
  height: 100%;
  align-self: stretch;
  border-radius: 8px;
  border: 1px solid #2a3240;
  background: linear-gradient(
    to top,
    hsl(0 100% 50%),
    hsl(60 100% 50%),
    hsl(120 100% 50%),
    hsl(180 100% 50%),
    hsl(240 100% 50%),
    hsl(300 100% 50%),
    hsl(360 100% 50%)
  );
}

/* WebKit (Chrome/Safari) track */
#hue::-webkit-slider-runnable-track {
  width: 100%;
  height: 100%;
  border-radius: 8px;
  border: 1px solid #2a3240;
  background: linear-gradient(
    to top,
    hsl(0 100% 50%),
    hsl(60 100% 50%),
    hsl(120 100% 50%),
    hsl(180 100% 50%),
    hsl(240 100% 50%),
    hsl(300 100% 50%),
    hsl(360 100% 50%)
  );
}

/* WebKit (Chrome/Safari) thumb */
#hue::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px; /* Dicke des Strichs */
  background: #ffffff;
  border: none;
  border-radius: 4px;
  box-shadow: none;
}

/* Firefox track/thumb */
#hue::-moz-range-track {
  width: 40px;
  height: 100%;
  border-radius: 8px;
  border: 1px solid #2a3240;
  background: linear-gradient(
    to top,
    hsl(0 100% 50%),
    hsl(60 100% 50%),
    hsl(120 100% 50%),
    hsl(180 100% 50%),
    hsl(240 100% 50%),
    hsl(300 100% 50%),
    hsl(360 100% 50%)
  );
}
#hue::-moz-range-thumb {
  width: 40px; /* entspricht Trackbreite */
  height: 8px; /* Dicke des Strichs */
  border-radius: 4px;
  background: #ffffff;
  border: none;
}
.actions {
  display: flex;
  gap: 16px;
  row-gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
  width: 90%;
  margin-left: auto;
  margin-right: auto;
}
.actions #feedback {
  margin-left: auto;
  margin-right: auto;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
button {
  background: #1b2330;
  border: 1px solid #38404f;
  border-radius: 8px;
  color: var(--text);
  cursor: pointer;
  font-weight: 600;
  padding: 10px 14px;
}
.actions button {
  padding: 14px 22px;
  font-size: 16px;
}
button[disabled] {
  cursor: not-allowed;
  opacity: 0.5;
}
button:hover:not([disabled]) {
  border-color: #364155;
}
.linklike {
  background: transparent;
  border: none;
  color: var(--accent);
  padding: 6px 8px;
}

.feedback {
  color: var(--muted);
  min-height: 24px;
}
.feedback.ok {
  color: var(--ok);
}
.feedback.mid {
  color: var(--warn);
}
.feedback.bad {
  color: var(--bad);
}
