/* zweiklang live: Farben und Schrift von zweiklang.lcsrt.ch, ohne Kostüm.
   Das Licht kommt aus den Linien, die Oberfläche bleibt ruhig. */

:root {
  --bg: #07070d;
  --fg: #eef0ff;
  --muted: rgba(238, 240, 255, 0.56);
  --line: rgba(238, 240, 255, 0.12);
  --accent: #b388ff;
  --ease: cubic-bezier(0.23, 1, 0.32, 1);
  --display-font: 'Kapra', 'Bricolage Grotesque', 'Geist', sans-serif;
  --body-font: 'Geist', ui-sans-serif, system-ui, sans-serif;
}

* { box-sizing: border-box; -webkit-font-smoothing: antialiased; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--fg);
  font: 15px/1.45 var(--body-font);
}

button, label, input { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
::selection { background: var(--accent); color: var(--bg); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

#bild { position: fixed; inset: 0; width: 100%; height: 100%; display: block; background: var(--bg); touch-action: none; cursor: grab; }
#bild:active { cursor: grabbing; }

/* Kopfzeile: Menüknopf links, Wortmarke in der Mitte */
.kopf {
  position: fixed;
  inset: 0 0 auto;
  z-index: 4;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 20px 28px;
  pointer-events: none;
}
.kopf > * { pointer-events: auto; transition: opacity 280ms var(--ease); }
body.still .kopf > * { opacity: 0; }
body.still { cursor: none; }

.rund {
  position: relative;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--bg);
}
.rund span {
  position: absolute;
  left: 14px;
  right: 14px;
  height: 1.5px;
  background: var(--fg);
  transition: transform 240ms var(--ease), top 240ms var(--ease);
}
.rund span:first-child { top: 17px; }
.rund span:last-child { top: 25px; }
.rund[aria-expanded="true"] span:first-child { top: 21px; transform: rotate(45deg); }
.rund[aria-expanded="true"] span:last-child { top: 21px; transform: rotate(-45deg); }

.wortmarke {
  font-family: var(--display-font);
  font-weight: 800;
  font-size: 24px;
  letter-spacing: -.02em;
  color: var(--fg);
  text-decoration: none;
  line-height: 1;
}

/* Startfenster */
.start {
  position: fixed;
  inset: 0;
  z-index: 3;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 16px;
  padding: 24px;
  text-align: center;
  background: rgba(7, 7, 13, 0.7);
  transition: opacity 400ms var(--ease);
}
.start.weg { opacity: 0; pointer-events: none; }
.start h1 {
  margin: 0 0 4px;
  font-family: var(--display-font);
  font-weight: 800;
  font-size: clamp(44px, 8vw, 120px);
  line-height: .9;
  letter-spacing: -.04em;
  text-wrap: balance;
}
.start p { margin: 0; text-wrap: pretty; max-width: 34em; }
.start .hinweis { font-size: 17px; }
.start .leise { font-size: 13px; color: var(--muted); }
.start .fehler { color: var(--accent); }

.knoepfe { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 8px 0 4px; }

.btn {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 12px 22px;
  border: 1px solid rgba(238, 240, 255, 0.28);
  border-radius: 999px;
  background: var(--bg);
  color: var(--fg);
  cursor: pointer;
  transition: border-color 160ms var(--ease), transform 120ms var(--ease);
}
.btn:active, .knopf:active { transform: scale(0.97); }

/* Regler */
.pult {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 3;
  width: 340px;
  padding-top: 84px;
  display: flex;
  flex-direction: column;
  background: rgba(7, 7, 13, 0.92);
  transition: transform 280ms var(--ease), visibility 0s;
}
.pult[hidden] {
  display: flex;
  visibility: hidden;
  transform: translateX(-100%);
  transition: transform 280ms var(--ease), visibility 0s 280ms;
}
.pult-inhalt {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 28px 28px;
  scrollbar-width: thin;
  scrollbar-color: rgba(238, 240, 255, 0.16) transparent;
}

.pult section { padding: 20px 0 8px; border-top: 1px solid var(--line); }
.pult h2 { margin: 0 0 14px; font-size: 13px; font-weight: 500; color: var(--muted); }

.pegel { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; padding-bottom: 20px; }
.pegel div { display: flex; flex-direction: column; gap: 8px; }
.pegel span { font-size: 12px; color: var(--muted); }
.pegel i { display: block; height: 1px; background: var(--line); position: relative; }
.pegel i::after {
  content: '';
  position: absolute;
  inset: -0.5px auto -0.5px 0;
  width: var(--v, 0%);
  background: var(--fg);
}

.status { margin: 0 0 12px; font-size: 13px; color: var(--muted); min-height: 1.45em; overflow-wrap: anywhere; }

.knopf {
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13px;
  margin-bottom: 14px;
  transition: border-color 160ms var(--ease), transform 120ms var(--ease);
}
.zeile { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }

.regler { display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 0 8px; margin-bottom: 12px; }
.regler label { font-size: 14px; }
.regler output { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.regler input { grid-column: 1 / -1; }
.regler.aus { opacity: 0.35; }

input[type=range] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 20px;
  margin: 0;
  background: none;
  cursor: pointer;
  --wert: 0%;
}
input[type=range]::-webkit-slider-runnable-track {
  height: 1px;
  background: linear-gradient(to right, var(--fg) var(--wert), var(--line) var(--wert));
}
input[type=range]::-moz-range-track { height: 1px; background: var(--line); }
input[type=range]::-moz-range-progress { height: 1px; background: var(--fg); }
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 11px;
  height: 11px;
  margin-top: -5px;
  border-radius: 50%;
  background: var(--fg);
}
input[type=range]::-moz-range-thumb { width: 11px; height: 11px; border: 0; border-radius: 50%; background: var(--fg); }
input[type=range]:disabled { cursor: default; }

.eigene { display: flex; gap: 20px; margin-bottom: 16px; }
.farbe { display: flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; }
.farbe input {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  cursor: pointer;
  box-shadow: 0 0 0 1px var(--line);
}
.farbe input::-webkit-color-swatch-wrapper { padding: 0; }
.farbe input::-webkit-color-swatch { border: 0; border-radius: 50%; }
.farbe input::-moz-color-swatch { border: 0; border-radius: 50%; }

.schalter { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-size: 13px; color: var(--muted); cursor: pointer; }
.schalter[hidden] { display: none; }
.schalter input { accent-color: var(--fg); }

.tasten { margin: 0; padding-top: 20px; border-top: 1px solid var(--line); font-size: 12px; line-height: 1.7; color: var(--muted); }


@media (hover: hover) and (pointer: fine) {
  .rund:hover, .btn:hover, .knopf:hover { border-color: rgba(238, 240, 255, 0.6); }
}

@media (max-width: 640px) {
  .kopf { padding: 16px; }
  .wortmarke { font-size: 22px; }
  .knoepfe { flex-direction: column; width: min(100%, 280px); }
  .btn { justify-content: center; }
  .pult {
    top: auto;
    right: 0;
    width: auto;
    max-height: 62vh;
    padding-top: 8px;
    border-radius: 24px 24px 0 0;
  }
  .pult[hidden] { transform: translateY(100%); }
  .pult-inhalt { padding: 16px 20px calc(20px + env(safe-area-inset-bottom)); }
}

@media (prefers-reduced-motion: reduce) {
  .pult, .pult[hidden], .start, .rund span { transition: none; }
}
