/* FingerSynth nach dem Design System der Motion-App (motion-library, app/DESIGN.md, Entwurf D „Pult“): mattes Schwarz
   und Anthrazit, Tiefe nur aus weichem Licht, Schrift des Systems mit Versalien für Beschriftungen, Lineale für jede Zahl,
   Rot nur für Marke und Kopflinie. Die Farben der Effekte stehen nur in ihren Farbkappen und im Monitor.
   Abweichungen fürs Web stehen in CLAUDE.md, Abschnitt Gestaltung. */

:root {
  color-scheme: dark;
  --fenster: #0B0B0B;
  --platte: #171717; --platte-oben: #1B1B1B;
  --mulde: #090909;
  --kappe: #262626; --kappe-oben: #2E2E2E;
  --linie: #232323;
  --t1: #EDEDED; --t2: #9C9C9C; --t3: #6B6B6B; --t4: #454545;
  --rot: #E5483B;
  --fehler: #F2726A;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", system-ui, sans-serif;
  --kurve: cubic-bezier(0.22, 1, 0.36, 1);
  --kopf: 64px;
  --regler-breite: 348px;
  --s-platte: inset 0 1px 0 rgba(255, 255, 255, 0.045), 0 0 0 1px rgba(0, 0, 0, 0.75), 0 24px 48px -24px rgba(0, 0, 0, 0.85);
  --s-mulde: inset 0 1px 3px rgba(0, 0, 0, 0.9), inset 0 0 0 1px rgba(0, 0, 0, 0.55), 0 1px 0 rgba(255, 255, 255, 0.045);
  --s-kappe: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 0 0 1px rgba(0, 0, 0, 0.65), 0 2px 4px rgba(0, 0, 0, 0.45);
  --s-kappe-hoch: inset 0 1px 0 rgba(255, 255, 255, 0.11), 0 0 0 1px rgba(0, 0, 0, 0.65), 0 4px 10px rgba(0, 0, 0, 0.55);
  --s-druck: inset 0 1px 3px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(0, 0, 0, 0.6);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh; min-height: 100dvh; background: var(--fenster); color: var(--t1);
  font-family: var(--sans); font-size: 13px; line-height: 18px; font-weight: 400;
  -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%;
}
h1, h2, p { margin: 0; font-weight: inherit; text-wrap: pretty; }
button { font: inherit; color: inherit; cursor: pointer; }
[hidden] { display: none !important; }
::selection { background: rgba(229, 72, 59, 0.35); }
/* Fokus nur für die Tastatur: eine feine helle Kante (Abweichung von der Motion-App, die keine Fokusringe hat) */
:focus { outline: none; }
:focus-visible { outline: 1px solid rgba(237, 237, 237, 0.4); outline-offset: 3px; }

.gravur { font-size: 10.5px; line-height: 14px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--t3); }

/* Lampe: ein kleiner Punkt, aus ist er ein Loch */
.lampe {
  flex: none; display: inline-block; width: 6px; height: 6px; border-radius: 9999px; background: #050505;
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.9), 0 1px 0 rgba(255, 255, 255, 0.06);
  transition: background-color 300ms var(--kurve);
}
.lampe.an { background: var(--t1); box-shadow: none; }

/* Farbkappe: Farbe eines Effekts in schwarzer Fassung */
.kappe { flex: none; display: inline-block; width: 10px; height: 10px; border-radius: 9999px; background: var(--farbe); box-shadow: 0 0 0 2px #000, 0 0 0 3px rgba(255, 255, 255, 0.06); }

/* Tasten: erhabene Pillen mit Versalien */
.taste {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 32px; padding: 0 14px; border: 0; border-radius: 9999px; white-space: nowrap;
  background: linear-gradient(var(--kappe-oben), var(--kappe)); color: var(--t1); box-shadow: var(--s-kappe);
  font-size: 10.5px; line-height: 14px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  transition: transform 300ms var(--kurve), box-shadow 300ms var(--kurve), color 300ms var(--kurve), opacity 300ms var(--kurve);
}
.taste:hover:not(:disabled) { box-shadow: var(--s-kappe-hoch); }
.taste:active:not(:disabled) { transform: scale(0.98); box-shadow: var(--s-druck); }
.taste.haupt { background: linear-gradient(#F4F4F4, #DCDCDC); color: #0B0B0B; box-shadow: inset 0 1px 0 #FFFFFF, 0 0 0 1px rgba(0, 0, 0, 0.6), 0 4px 10px rgba(0, 0, 0, 0.5); }
.taste.leer { background: transparent; color: var(--t2); box-shadow: none; }
.taste.leer:hover:not(:disabled) { color: var(--t1); box-shadow: none; }
.taste.gross { height: 40px; padding: 0 18px; font-size: 11.5px; }
.taste:disabled { cursor: progress; opacity: 0.5; }

/* Segment: Wahl aus wenigen Werten in einer Mulde */
.segment { display: flex; padding: 3px; gap: 2px; border-radius: 9999px; background: var(--mulde); box-shadow: var(--s-mulde); flex: none; }
.segment button {
  height: 30px; padding: 0 14px; border: 0; border-radius: 9999px; background: transparent; color: var(--t3);
  font-size: 10.5px; line-height: 14px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  transition: background-color 300ms var(--kurve), color 300ms var(--kurve), box-shadow 300ms var(--kurve);
}
.segment button:hover { color: var(--t1); }
.segment button[aria-checked="true"] { background: linear-gradient(var(--kappe-oben), var(--kappe)); color: var(--t1); box-shadow: var(--s-kappe); }

/* Kopf: Name links, Anleitung rechts */
.kopf { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: var(--kopf); padding: 0 16px 0 24px; }
.kopf-name { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
.kopf-titel { font-size: 17px; line-height: 22px; font-weight: 600; letter-spacing: -0.01em; }
.kopf-von { color: var(--t3); text-decoration: none; font-size: 10.5px; line-height: 14px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; transition: color 300ms var(--kurve); }
.kopf-von:hover { color: var(--t1); }
.is-framed [data-solo] { display: none; }

/* Pult: Monitor links groß, darunter die Schleife, rechts die Effekte */
.pult {
  display: grid; gap: 10px; padding: 0 12px 12px;
  grid-template-columns: minmax(0, 1fr) var(--regler-breite);
  grid-template-rows: minmax(0, 1fr) auto;
  grid-template-areas: "buehne regler" "zeit regler";
  height: calc(100vh - var(--kopf)); height: calc(100dvh - var(--kopf)); min-height: 560px;
}
.platte { background: linear-gradient(var(--platte-oben), var(--platte) 240px); border-radius: 28px; box-shadow: var(--s-platte); min-height: 0; min-width: 0; }
.buehne { grid-area: buehne; padding: 10px; display: flex; }
.zeit { grid-area: zeit; }
.regler { grid-area: regler; }

/* Monitor: das Kamerabild in Schwarz und Grau, nur die Fingerspitzen tragen Farbe */
.monitor { position: relative; flex: 1; min-height: 0; border-radius: 20px; background: #000; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05); }
.monitor video, .monitor canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.monitor video { object-fit: contain; transform: scaleX(-1); filter: grayscale(1) brightness(0.62) contrast(1.08); opacity: 0; transition: opacity 500ms var(--kurve); }
.has-cam .monitor video { opacity: 1; }
.monitor-status {
  position: absolute; left: 12px; top: 12px; display: inline-flex; align-items: center; gap: 8px; height: 28px; padding: 0 12px;
  border-radius: 9999px; background: rgba(0, 0, 0, 0.6); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  font-size: 10.5px; line-height: 14px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--t2);
}
body:not(.has-cam) .monitor-status { display: none; }
.has-hand .monitor-status { color: var(--t1); }
.monitor-status[data-kind="bad"] { color: var(--fehler); }
.monitor-leer { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 12px; padding: 24px; text-align: center; }
.monitor-leer-text { max-width: 34ch; color: var(--t2); font-size: 15px; line-height: 22px; }
.monitor-leer .taste { margin-top: 8px; }
.has-cam .monitor-leer { display: none; }

/* Schleife: gewölbte Abspieltaste, Lineal über 16 s mit den acht Akkorden und roter Kopflinie, Klangquelle */
.zeit { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 18px; align-items: center; padding: 14px 16px 14px 14px; }
.spiel-kappe {
  flex: none; display: grid; place-items: center; width: 52px; height: 52px; padding: 0; border: 0; border-radius: 9999px; color: var(--t1);
  background: radial-gradient(120% 100% at 50% 0%, #3C3C3C 0%, #282828 55%, #1E1E1E 100%);
  box-shadow: 0 0 0 3px #000, 0 0 0 4px rgba(255, 255, 255, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 8px 16px rgba(0, 0, 0, 0.6);
  transition: transform 300ms var(--kurve), box-shadow 300ms var(--kurve);
}
.spiel-kappe svg { width: 18px; height: 18px; fill: currentColor; }
.spiel-zeichen { transform: translateX(1px); }
.spiel-kappe .halt-zeichen, .spiel-kappe[aria-pressed="true"] .spiel-zeichen { display: none; }
.spiel-kappe[aria-pressed="true"] .halt-zeichen { display: block; }
.spiel-kappe:hover { transform: translateY(-1px); }
.spiel-kappe:active { transform: scale(0.97); box-shadow: 0 0 0 3px #000, 0 0 0 4px rgba(255, 255, 255, 0.05), inset 0 2px 4px rgba(0, 0, 0, 0.6); }
.zeit-flaeche { position: relative; z-index: 0; height: 40px; cursor: pointer; touch-action: none; margin: 0 10px; }
.zeit-flaeche::before { content: ""; position: absolute; z-index: -1; inset: -2px -10px; border-radius: 14px; background: #000; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05), 0 0 0 1px rgba(0, 0, 0, 0.8); }
.zeit-flaeche canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.kopf-linie { position: absolute; left: 0; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--rot); pointer-events: none; will-change: transform; }
.kopf-linie::after { content: ""; position: absolute; left: -5px; bottom: -2px; border: 6px solid transparent; border-bottom: 7px solid var(--rot); border-top: 0; }
.ist-midi .zeit-flaeche { opacity: 0.35; }

/* Effekte: vier Lineale, darunter die Welle am Ausgang */
.regler { display: flex; flex-direction: column; padding: 20px 16px 16px; gap: 20px; overflow: auto; }
.regler-kopf { display: grid; gap: 6px; padding: 0 4px; }
.regler-hinweis { color: var(--t2); }
.lineale { display: grid; gap: 22px; }
.ausgang { display: grid; gap: 8px; margin-top: auto; }
.ausgang .gravur { padding: 0 4px; }
.welle { display: block; width: 100%; height: 72px; border-radius: 16px; background: var(--mulde); box-shadow: var(--s-mulde); }

/* Lineal: Name und Wert über einem Band mit Strichen, das unter der roten Marke läuft */
.lineal { display: grid; gap: 8px; min-width: 0; }
.lineal-kopf { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 0 4px; }
.lineal-name { font-size: 10.5px; line-height: 14px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--t1); margin-left: 2px; transition: color 300ms var(--kurve); }
.lineal-finger { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--t3); font-size: 12px; line-height: 16px; }
.lineal-wert { margin-left: auto; display: inline-flex; align-items: baseline; gap: 3px; font-size: 15px; line-height: 18px; font-weight: 500; font-variant-numeric: tabular-nums; color: var(--t1); transition: color 300ms var(--kurve); }
.lineal-einheit { font-size: 11px; font-weight: 500; color: var(--t3); }
.lineal.ruht .lineal-name { color: var(--t3); }
.lineal.ruht .lineal-wert { color: var(--t3); }
.lineal-band { position: relative; height: 40px; border-radius: 9999px; background: var(--mulde); box-shadow: var(--s-mulde); overflow: hidden; cursor: grab; touch-action: none; }
.lineal-band canvas {
  position: absolute; inset: 0; width: 100%; height: 100%;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 22%, #000 78%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 22%, #000 78%, transparent);
}
.lineal-marke { position: absolute; left: 50%; top: 7px; bottom: 7px; width: 2px; margin-left: -1px; border-radius: 1px; background: var(--rot); pointer-events: none; }
.lineal-marke::before { content: ""; position: absolute; left: -3px; top: -5px; border: 4px solid transparent; border-top: 5px solid var(--rot); border-bottom: 0; }
.lineal.greift .lineal-band { cursor: grabbing; }

/* Anleitung: Overlay mit einer Karte wie ein Popover der Motion-App */
.tour { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: rgba(0, 0, 0, 0.62); animation: ein 500ms var(--kurve) both; }
.tour-karte {
  width: min(460px, 100%); max-height: calc(100dvh - 32px); overflow: auto; display: grid; gap: 14px; padding: 26px 26px 22px;
  border-radius: 28px; background: #1C1C1C;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 0 0 1px rgba(0, 0, 0, 0.85), 0 28px 56px rgba(0, 0, 0, 0.65);
  animation: karte 500ms var(--kurve) both;
}
.tour-titel { font-size: 28px; line-height: 32px; font-weight: 600; letter-spacing: -0.015em; text-wrap: balance; }
.tour-text { display: grid; gap: 12px; color: var(--t2); font-size: 15px; line-height: 22px; }
.tour-text p:first-child { color: var(--t1); }
.tour-klein { font-size: 13px; line-height: 18px; color: var(--t2); }
.tour-fehler { font-size: 13px; line-height: 18px; color: var(--fehler); }
.tour-live { display: inline-flex; align-items: center; gap: 8px; justify-self: start; height: 28px; padding: 0 12px; border-radius: 9999px; background: var(--mulde); box-shadow: var(--s-mulde); font-size: 10.5px; line-height: 14px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--t2); }
.tour-tasten { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.legende { list-style: none; margin: 0; padding: 4px 0; display: grid; gap: 1px; }
.legende li { display: grid; grid-template-columns: 10px 96px minmax(0, 1fr); column-gap: 12px; align-items: center; padding: 8px 12px; border-radius: 12px; background: var(--mulde); }
.legende li:first-child { border-radius: 14px 14px 4px 4px; }
.legende li:last-child { border-radius: 4px 4px 14px 14px; }
.legende-finger { color: var(--t2); font-size: 13px; }
.legende-fx { font-size: 10.5px; line-height: 14px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--t1); }
.legende-tut { grid-column: 3; font-size: 12px; line-height: 16px; color: var(--t3); }
@keyframes ein { from { opacity: 0; } }
@keyframes karte { from { opacity: 0; transform: scale(0.98); } }

.noscript { padding: 24px; }

/* Schmal: alles untereinander, die Seite scrollt */
@media (max-width: 860px) {
  .kopf { padding: 0 8px 0 18px; height: 56px; }
  .pult {
    height: auto; min-height: 0; padding: 0 8px 8px; gap: 8px;
    grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto auto;
    grid-template-areas: "buehne" "zeit" "regler";
  }
  .platte { border-radius: 24px; }
  .buehne { padding: 8px; }
  .monitor { aspect-ratio: 4 / 3; flex: none; width: 100%; border-radius: 16px; }
  .monitor-leer { gap: 10px; }
  .monitor-leer-text { font-size: 13px; line-height: 18px; }
  .zeit { grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "spiel flaeche" "quelle quelle"; gap: 14px 16px; padding: 12px; }
  .spiel-kappe { grid-area: spiel; }
  .zeit-flaeche { grid-area: flaeche; }
  .zeit .segment { grid-area: quelle; justify-self: start; }
  .regler { overflow: visible; padding: 18px 12px 12px; }
  .lineale { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px 10px; }
  .lineal-finger { display: none; }
  .welle { height: 56px; }
}
@media (max-width: 860px) and (min-width: 560px) {
  .monitor { aspect-ratio: 16 / 10; }
}
/* Niedrige Fenster am Desktop: die Seite darf scrollen */
@media (min-width: 861px) and (max-height: 620px) {
  .pult { height: auto; }
  .buehne { min-height: 420px; }
}

@media (prefers-reduced-motion: reduce) {
  .tour-karte { animation-name: ein; }
  .spiel-kappe:hover, .spiel-kappe:active, .taste:active:not(:disabled) { transform: none; }
}
