/* ============================================================
   Video-Werkstatt - styles.css
   ------------------------------------------------------------
   GUI-Typ 3 (Werkzeug), Regel AGENTS.md 3.13. Eigenes PWA-Paket
   (3.10/6.1): colors.css/jupi.css liegen als Paket-Kopien daneben.

   DIE WELT: Filmschnittplatz (Regel 3.13.6b)
   Die Taetigkeit ist Filme schneiden: Material sammeln, auf eine
   Zeitleiste legen, Stuecke trennen, Texte und Uebergaenge setzen,
   am Ende exportieren. Deshalb ist die Seite ein Schnittraum:
     - Kulisse (3.13.7 Weg A): EINE gestreckte Szene, 1600 x 1000,
       cover/no-repeat/fixed. Tag: Rollregal mit Filmspulen, Tonband-
       geraet, Haengeleuchte, Schneidetisch. Nacht: eigene Szene.
     - Leiste: dunkle Geraeteschiene aus Graphit mit Messingkante.
     - Buehne: der Schnitt-Monitor (dunkles Gehaeuse, Messinglinie,
       Schrauben) - das Filmbild bleibt schwarz wie im Schnittplatz.
     - Zeitleiste: Filmstreifen mit Sprocket-Loechern (immer dunkel).
     - Material: Regal mit Kontaktabzuegen (folgt dem Theme).
     - Fenster/Meldungen: Papier (bleibt in beiden Themes hell).
   ============================================================ */

/* ---------- 1. Farben und Grundmasse -------------------------- */
:root {
  /* Tageslicht-Konsole: warmes Aluminium, Messing, Tinte */
  --vw-tinte: #1d262d;
  --vw-tinte2: #5a6873;
  --vw-konsole: #e9e5db;
  --vw-konsole2: #ded9cc;
  --vw-kante: #c6bfae;
  --vw-flaeche: #f7f4ec;
  --vw-flaeche2: #efeae0;
  --vw-rand: #c6bfae;
  --vw-rand2: #dcd6c8;
  --vw-zeile: #64727d;
  --vw-messing: #b5852f;
  --vw-messing-hell: #d9b565;
  --vw-messing-dunkel: #7d5a17;
  --vw-messing-schatten: rgba(125, 90, 23, 0.18);
  --vw-schirm: #0b1014;
  --vw-schirm2: #141c22;
  --vw-film: #22201b;
  --vw-film2: #2c2922;
  --vw-film-licht: #4a4436;
  --vw-papier: #fbf7ea;
  --vw-papier-tinte: #1e272e;
  --vw-video: #2f7d4f;
  --vw-bild: #9a6d20;
  --vw-audio: #3562a8;
  --vw-text: #7b4fa0;
  --vw-ebene: #00838f;
  --vw-mark: #FFD835;
  --vw-rot: #c0392b;
  --vw-gruen: #2e7d32;
  --vw-schiene: linear-gradient(180deg, #2f3a43 0%, #232c34 55%, #1a2228 100%);
}

html[data-theme="dark"] {
  /* Nachtschicht: Graphit, Messing, LED-Warmweiss */
  --vw-tinte: #e8eef3;
  --vw-tinte2: #a3b2bd;
  --vw-konsole: #1b232b;
  --vw-konsole2: #161d24;
  --vw-kante: #38454f;
  --vw-flaeche: #232d36;
  --vw-flaeche2: #1d262e;
  --vw-rand: #38454f;
  --vw-rand2: #2c363f;
  --vw-zeile: #9aabb7;
  --vw-messing: #d9ab55;
  --vw-messing-hell: #f0cd84;
  --vw-messing-dunkel: #8a6325;
  --vw-messing-schatten: rgba(0, 0, 0, 0.35);
  --vw-schirm: #070b0e;
  --vw-schirm2: #10171d;
  --vw-film: #191713;
  --vw-film2: #23201b;
  --vw-film-licht: #514a3a;
  --vw-papier: #f4ecd8;
  --vw-papier-tinte: #1b232a;
  --vw-video: #3a9364;
  --vw-bild: #b07f2e;
  --vw-audio: #4478c9;
  --vw-text: #9567c2;
  --vw-ebene: #17a5b0;
  --vw-mark: #FFD835;
  --vw-rot: #e05a4a;
  --vw-gruen: #58a65c;
  --vw-schiene: linear-gradient(180deg, #1c242b 0%, #141b21 55%, #0d1318 100%);
}

* { box-sizing: border-box; }

/* Der Filmstreifen-Nutzen: Sprocket-Loecher als CSS-Band. Wird von
   Zeitleiste und Befehlsleiste geteilt (kein Bild, keine Kachel). */
.vw_sprocket {
  background-image: repeating-linear-gradient(90deg,
    rgba(244, 236, 216, 0.42) 0 7px, transparent 7px 19px);
}

/* ---------- 2. Seite und Kulisse ------------------------------ */
body.jupi.vw_body {
  /* EINE gestreckte Szene, nie gekachelt (3.13.7 Weg A) */
  background: #434b53 url("kulisse.svg") center top / cover no-repeat fixed;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}
html[data-theme="dark"] body.jupi.vw_body {
  background: #0d1318 url("kulisse-nacht.svg") center top / cover no-repeat fixed;
  color: var(--vw-tinte);
}
body.vw_body .jupi_container {
  /* `flex: 1 1 auto` + `min-height: 0`: der Container DARF schrumpfen.
     Mit `1 0 auto` nahm er seine Inhaltshoehe an und schob den Fuss
     unter den Fensterrand (gemessen bei 1280x900: Panel endete bei
     902 px, Fuss bei 948 px). */
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: transparent;
}
body.vw_body .jupi_main {
  flex: 1 1 auto;
  width: 100%;
  max-width: 104rem;
  margin: 0 auto;
  padding: 0.55rem 0.9rem 0.6rem;
  background: transparent;
  min-height: 0;
}
body.vw_body .jupi_footer {
  flex: 0 0 auto;
  margin-top: auto;
  background: transparent;
  border: none;
  padding: 0.35rem 1rem 0.7rem;
}

/* Arbeitsfenster-Modus (ab 900 x 560, dieselben Massse wie game.js):
   Die Seite passt in das Fenster - Kopf ganz oben, Fuss ganz unten
   (3.13.2a), die Werkstatt fuellt den Platz dazwischen. */
@media (min-width: 900px) and (min-height: 560px) {
  html:has(body.vw_body) { height: 100%; overflow: hidden; }
  body.vw_body { height: 100dvh; overflow: hidden; }
  body.vw_body .jupi_main { display: flex; min-height: 0; }
  body.vw_body .vw_panel { flex: 1 1 auto; min-height: 0; }
}

/* ---------- 3. App-Leiste: Drei-Zonen-Kopfzeile (3.13.2) ------ */
/* Links „← Alle Spiele", mittig Paket-Logo + Name, rechts Sprachwahl
   und Dark-Mode-Pill 74x40. Kein Schullogo, kein jupi-Wortlogo. */
.vw_kopf {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: .3rem .6rem;
  padding: .34rem .7rem;
  background: linear-gradient(112deg, #232c34 0%, #2e3943 55%, #1a2229 100%);
  color: #f6eeda;
  border-bottom: 3px solid var(--vw-messing);
  box-shadow: 0 3px 16px rgba(0, 0, 0, .38);
}
html[data-theme="dark"] .vw_kopf {
  background: linear-gradient(112deg, #0f161b 0%, #1b242b 55%, #0b1014 100%);
  border-bottom-color: #b5852f;
}
/* Sprocket-Kante unter der Leiste (Filmstreifen-Anklang) */
.vw_kopf::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -3px;
  height: 3px;
  background-image: repeating-linear-gradient(90deg,
    rgba(246, 238, 218, 0.55) 0 6px, transparent 6px 18px);
  opacity: .35;
  pointer-events: none;
}

a.vw_zurueck {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: .3rem .85rem;
  border-radius: 999px;
  background: #f6eeda;
  color: #1d262d;
  border: 1px solid var(--vw-messing);
  text-decoration: none;
  font-size: .85rem;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .3);
}
a.vw_zurueck:hover { background: #fff8e7; }
html[data-theme="dark"] a.vw_zurueck { background: #f0e4c8; color: #172027; }
html[data-theme="dark"] a.vw_zurueck:hover { background: #fff6e2; }

.vw_marke {
  justify-self: center;
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  min-width: 0;
  padding: .12rem .7rem .12rem .22rem;
  border-radius: 999px;
  background: rgba(7, 12, 16, .34);
  border: 1px solid rgba(217, 181, 101, .4);
}
.vw_marke_logo {
  height: 1.9rem;
  width: 1.9rem;
  display: block;
  border-radius: .4rem;
  box-shadow: 0 0 0 1px #c9a24a;
}
.vw_marke_name {
  margin: 0;
  font-size: 1.03rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: .005em;
  color: #f6eeda;
  white-space: nowrap;
}
.vw_kopf_ende {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  min-width: 0;
}
/* Dark-Mode-Pill 74x40 (GUI 3.13.2) */
.vw_kopf_ende .jupi_theme_switch { width: 74px; height: 40px; min-width: 74px; padding: 0; }
.vw_kopf_ende .jupi_sprachen_select {
  color: #f6eeda;
  background: rgba(255, 255, 255, .10);
  border-color: rgba(246, 238, 218, .38);
}

/* ---------- 4. Fokus-Ringe: Messing, in beiden Themes --------- */
body.vw_body :focus-visible {
  outline: 3px solid var(--vw-messing-hell);
  outline-offset: 2px;
}

/* ---------- 5. Werkbank: Panel, Befehlsleiste, Werkzeugspalte -- */
.vw_panel {
  --vw-zeile-tl: 232px;   /* Zeitleisten-Gesamthoehe (Reserve) */
  --vw-spur: 40px;        /* Spurhoehe Video/Ton */
  --vw-ebene-h: 30px;     /* Text- und Bild-Ebene */
  --vw-ruler: 24px;       /* Zeitlineal */
  --vw-filmrand: 10px;    /* Sprocket-Band der Zeitleiste */

  position: relative;     /* Bezug fuer die Ablage-Karte */
  display: flex;
  flex-direction: column;
  gap: .5rem;
  padding: .55rem;
  border: 1px solid var(--vw-kante);
  border-top: 4px solid var(--vw-messing);
  border-radius: 1rem;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .35), rgba(255, 255, 255, 0) 120px),
    linear-gradient(180deg, var(--vw-konsole), var(--vw-konsole2));
  color: var(--vw-tinte);
  box-shadow: 0 10px 34px rgba(0, 0, 0, .28);
}
html[data-theme="dark"] .vw_panel {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .04), rgba(255, 255, 255, 0) 140px),
    linear-gradient(180deg, var(--vw-konsole), var(--vw-konsole2));
  border-color: var(--vw-kante);
  box-shadow: 0 12px 40px rgba(0, 0, 0, .55);
}

/* Die Befehlsleiste direkt unter dem Kopf (Typ 3: Datei, Projekt,
   Export, Aktionen). Sie ist die Oberseite des Schnittplatzes und
   traegt auch die Optionen (Zoom, Film-Format, Erweiterter Modus),
   damit die Arbeitsflaeche hoch bleibt. */
.vw_befehl {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .35rem;
  padding: .3rem .4rem;
  border-radius: .55rem;
  background: var(--vw-schiene);
  border: 1px solid #0e151a;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12);
}
.vw_befehl_gruppe {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  flex-wrap: wrap;
  min-width: 0;
}
.vw_befehl_ende {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: .3rem;
}
/* Auf der dunklen Schiene: helle Pillen mit Messingrand */
.vw_befehl .vw_werk {
  background: linear-gradient(180deg, #f7f2e4, #e6dfcd);
  border-color: var(--vw-messing);
  color: #1d262d;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .35);
}
.vw_befehl .vw_werk:hover {
  background: #fffaf0;
  border-color: var(--vw-messing-hell);
  color: #141b21;
}
.vw_befehl .vw_werk_voll {
  background: linear-gradient(180deg, #d9ab55, #b5852f);
  border-color: #7d5a17;
  color: #1b1409;
}
.vw_befehl .vw_werk_voll:hover {
  background: linear-gradient(180deg, #f0cd84, #c99a46);
  color: #1b1409;
}
.vw_befehl .vw_werk_icon {
  background: rgba(246, 238, 218, .14);
  border-color: rgba(246, 238, 218, .5);
  color: #f6eeda;
}
.vw_befehl .vw_werk_icon:hover { background: rgba(246, 238, 218, .28); }

/* Werkbank: Werkzeuge links, Arbeitsflaeche rechts (Typ 3, 3.13.3) */
.vw_werkbank {
  display: grid;
  grid-template-columns: 8.4rem minmax(0, 1fr);
  gap: .5rem;
  align-items: stretch;
  min-height: 0;
}
.vw_arbeitsbereich {
  display: flex;
  flex-direction: column;
  gap: .45rem;
  min-width: 0;
  min-height: 0;
}

/* Werkzeugpalette: vertikale Spalte am linken Rand */
.vw_werkzeug {
  display: flex;
  flex-direction: column;
  gap: .3rem;
  padding: .35rem;
  border-radius: .7rem;
  background: var(--vw-schiene);
  border: 1px solid #0e151a;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1);
  overflow-y: auto;
  min-height: 0;
  scrollbar-width: thin;
}
.vw_werk {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  min-height: 2.5rem;      /* Bedienziel 40 px (GUI 3.13.5) */
  padding: .25rem .7rem;
  border: 1px solid var(--vw-rand);
  border-radius: .5rem;
  background: var(--vw-flaeche);
  color: inherit;
  font: inherit;
  font-size: .88rem;
  cursor: pointer;
  white-space: nowrap;
}
.vw_werkzeug .vw_werk {
  justify-content: flex-start;
  width: 100%;
  padding: .2rem .5rem;
  background: linear-gradient(180deg, #f7f2e4, #e6dfcd);
  border-color: var(--vw-messing);
  color: #1d262d;
  font-size: .82rem;
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .28);
}
.vw_werkzeug .vw_werk:hover {
  background: #fffaf0;
  border-color: var(--vw-messing-hell);
}
.vw_werkzeug .vw_werk_teiler {
  width: 100%;
  height: 1px;
  margin: .1rem 0;
  background: rgba(246, 238, 218, .28);
}
.vw_werk:active { transform: translateY(1px); }
.vw_werk[disabled] { opacity: .45; cursor: default; transform: none; }

/* Angeschaltete Schalter (erweiterter Modus, Drittel-Raster): gefuellt */
.vw_werk_aktiv {
  background: var(--vw-messing) !important;
  border-color: var(--vw-messing-dunkel) !important;
  color: #1b1409 !important;
}
.vw_werk_aktiv:hover { filter: brightness(1.06); }

/* Versteck des ERWEITERTEN Modus: alles, was nur dort hingehoert,
   traegt vw_nur_erweitert und verschwindet ohne <html class="vw_erweitert">.
   Bewusst per KLASSE statt [hidden] - die hidden-Waechter bleiben frei. */
html:not(.vw_erweitert) .vw_nur_erweitert { display: none !important; }

.vw_werk_icon {
  width: 2.5rem;           /* 40x40-Bedienziel (GUI 3.13.5) */
  padding: 0;
  justify-content: center;
}
.vw_werk_klein { min-height: 2.5rem; padding: .1rem .6rem; font-size: .85rem; }
.vw_werk_voll {
  background: var(--vw-gruen);
  border-color: var(--vw-gruen);
  color: #fff;
  font-weight: 700;
}
.vw_werk_rot:hover {
  background: #fdecea;
  border-color: var(--vw-rot);
  color: var(--vw-rot);
}
html[data-theme="dark"] .vw_werk_rot:hover { background: #3a2320; }
.vw_werk_teiler {
  width: 1px;
  height: 1.6rem;
  background: var(--vw-rand);
  margin: 0 .15rem;
}
.vw_werk_nachrechts {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  flex-wrap: wrap;
}

/* Optionenleiste: steht bei Typ 3 in der Befehlszeile oben. Sie ist
   bewusst nur eine Gruppe (kein eigener Kasten) - der Materialkontrast
   der Schiene traegt sie mit. */
.vw_optionen {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .25rem .4rem;
}
.vw_optionen_titel {
  font-size: .66rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--vw-messing-hell);
  padding-right: .1rem;
}
.vw_optionen .vw_werk_label { color: #f2e8d2; }
/* Die Auswahl sitzt auf hellem Papier: dunkle Schrift, sonst waere der
   Text auf der Messing-Schiene hell-auf-hell (im Hell-Thema gemessen). */
.vw_optionen .vw_format_wahl { color: #1d262d; background: #f7f4ec; }
.vw_werk_label {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .84rem;
  padding: 0 .25rem;
  min-height: 2.5rem;
}
.vw_werk_label input[type="range"] { width: 6.5rem; accent-color: var(--vw-messing); }
.vw_format_wahl {
  max-width: 9.5rem;
  min-height: 2.5rem;      /* Bedienziel 40 px (GUI 3.13.5) */
  font: inherit;
  font-size: .8rem;
  padding: .18rem .3rem;
  border: 1px solid var(--vw-rand);
  border-radius: .4rem;
  background: var(--vw-flaeche);
  color: inherit;
}
.vw_optionen .vw_werk {
  background: var(--vw-flaeche);
  border-color: var(--vw-rand);
  color: var(--vw-tinte);
}
.vw_optionen .vw_werk:hover { border-color: var(--vw-messing); }
.vw_optionen .vw_werk_aktiv { color: #1b1409 !important; }

.vw_versteckt {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* ---------- 6. Ablage-Flaeche (Dateien aus dem Explorer) ------ */
/* FIXED, nicht absolute: die Werkstatt ist hoeher als der Bildschirm.
   [hidden]-Ausnahme ist Pflicht (display:flex schlaegt hidden). */
.vw_dropzone {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 16, 20, 0.84);
  pointer-events: none;
}
.vw_dropzone[hidden] { display: none; }
.vw_dropzone_karte {
  max-width: 30rem;
  padding: 1.1rem 1.4rem;
  border-radius: .7rem;
  background: var(--vw-papier);
  color: var(--vw-papier-tinte);
  border-top: 6px solid var(--vw-messing);
  text-align: center;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .45);
}
.vw_dropzone_titel { margin: 0 0 .4rem; font-size: 1.05rem; font-weight: 800; }
.vw_dropzone_text { margin: 0; font-size: .85rem; line-height: 1.5; }

/* ---------- 7. Buehne: Schnitt-Monitor + Materialregal -------- */
.vw_buehne {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 15rem;
  gap: .5rem;
  align-items: stretch;
  min-height: 0;
}
.vw_vorschau {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: 0;
  border: 9px solid #2b353e;
  border-radius: .8rem;
  background: var(--vw-schirm);
  box-shadow:
    inset 0 0 0 1px var(--vw-messing),
    0 8px 22px rgba(0, 0, 0, .4);
  overflow: hidden;
}
html[data-theme="dark"] .vw_vorschau {
  border-color: #131b21;
  box-shadow:
    inset 0 0 0 1px #a67c33,
    0 10px 28px rgba(0, 0, 0, .6);
}
/* Schrauben im Gehaeuse (Deko, keine Bedienung) */
.vw_vorschau::before,
.vw_vorschau::after {
  content: "";
  position: absolute;
  top: 3px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #a79562, #4d4025);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .45);
  z-index: 2;
  pointer-events: none;
}
.vw_vorschau::before { left: 4px; }
.vw_vorschau::after { right: 4px; }

#vw_canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  background: #000;
  touch-action: none;
}
/* Hochformat/Quadrat: eigene Form + helle Haarlinie, damit das Bild
   nicht als "kleines Bild in schwarzer Leere" gelesen wird. */
#vw_canvas.vw_canvas_eng {
  width: auto;
  height: auto;
  aspect-ratio: auto;
  max-width: 100%;
  max-height: 62vh;
  margin: 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 2px;
}

/* Live-Bild der Kamera waehrend der Aufnahme */
.vw_live {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
  z-index: 3;
}

/* Start-Overlay in der Vorschau */
.vw_overlay {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(4, 8, 11, 0.72);
  overflow-y: auto;
}
.vw_overlay[hidden] { display: none; }
.vw_overlay_karte {
  max-width: 32rem;
  padding: 1rem 1.2rem;
  border-radius: .7rem;
  background: var(--vw-papier);
  color: var(--vw-papier-tinte);
  border-top: 6px solid var(--vw-messing);
  text-align: center;
  box-shadow: 0 14px 40px rgba(0, 0, 0, .45);
}
.vw_overlay_titel { margin: 0 0 .3rem; font-size: 1.05rem; font-weight: 800; }
.vw_overlay_text { margin: 0 0 .7rem; font-size: .88rem; opacity: .9; }
.vw_overlay_knoepfe { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; }
.vw_overlay_hinweis { margin: .7rem 0 0; font-size: .75rem; opacity: .75; }
/* Im Arbeitsfenster ist der Monitor klein (die Zeitleiste braucht Platz) -
   die Startkarte schrumpft mit und laesst den Hinweis weg. Sonst ragte
   sie unten aus dem Bild (gemessen bei 1280x800). */
.vw_panel[style*="--vw-fenster"] .vw_overlay { padding: .35rem; align-items: flex-start; }
.vw_panel[style*="--vw-fenster"] .vw_overlay_karte {
  padding: .5rem .8rem;
  border-top-width: 4px;
  max-width: 34rem;
}
.vw_panel[style*="--vw-fenster"] .vw_overlay_titel { font-size: .92rem; margin-bottom: .2rem; }
.vw_panel[style*="--vw-fenster"] .vw_overlay_text { font-size: .78rem; margin-bottom: .4rem; }
.vw_panel[style*="--vw-fenster"] .vw_overlay_hinweis { display: none; }
.vw_panel[style*="--vw-fenster"] .vw_overlay_knoepfe .jupi_btn {
  min-height: 2.5rem;
  padding: .2rem .7rem;
  font-size: .8rem;
}
.vw_overlay .jupi_btn {
  background: linear-gradient(180deg, #d9ab55, #b5852f);
  color: #1b1409;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .3);
  font-weight: 700;
}
.vw_overlay .jupi_btn:hover { background: #f0cd84; transform: none; }
.vw_overlay .jupi_btn_alt {
  background: #e8e1cf;
  color: #2a3339;
  border: 1px solid #b9ae94;
}
.vw_overlay .jupi_btn_alt:hover { background: #f7f0dd; }

/* Aufnahme-Leiste */
.vw_aufnahme {
  position: absolute;
  top: .5rem;
  left: .5rem;
  right: .5rem;
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .3rem .6rem;
  border-radius: .5rem;
  background: rgba(14, 18, 22, 0.9);
  border: 1px solid rgba(217, 181, 101, .55);
  color: #fff;
  font-size: .85rem;
  z-index: 5;
}
.vw_aufnahme[hidden] { display: none; }
.vw_aufnahme .jupi_btn { min-height: 2.5rem; padding: .15rem .7rem; font-size: .82rem; }
.vw_aufnahme_zeit { margin-left: auto; font-variant-numeric: tabular-nums; }
.vw_aufnahme_punkt {
  width: .7rem;
  height: .7rem;
  border-radius: 50%;
  background: var(--vw-rot);
  animation: vw_blinken 1s steps(2, start) infinite;
}
@keyframes vw_blinken { to { opacity: .25; } }

/* Transport unter der Vorschau (Bedienpult des Monitors) */
.vw_transport {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .35rem .5rem;
  background: linear-gradient(to top, rgba(3, 6, 8, .92), rgba(3, 6, 8, .18));
  border-top: 1px solid rgba(217, 181, 101, .35);
  color: #fff;
}
.vw_transport .vw_werk {
  background: rgba(246, 238, 218, .12);
  border-color: rgba(246, 238, 218, .45);
  color: #f6eeda;
  min-height: 2.5rem;
}
.vw_transport .vw_werk:hover { background: rgba(246, 238, 218, .28); }
.vw_zeit {
  font-size: .78rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: #f3e7cc;
}
.vw_scrub {
  flex: 1;
  min-width: 3rem;
  accent-color: var(--vw-messing);
}

/* Materialregal rechts (Kontaktabzuege) */
.vw_pool {
  display: flex;
  flex-direction: column;
  gap: .45rem;
  min-width: 0;
  min-height: 0;
  padding: .5rem;
  border: 1px solid var(--vw-rand);
  border-top: 3px solid var(--vw-messing);
  border-radius: .7rem;
  background: linear-gradient(180deg, var(--vw-flaeche), var(--vw-flaeche2));
}
.vw_pool_kopf {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .4rem;
  font-size: .85rem;
}
.vw_pool_zahl {
  min-width: 1.6rem;
  padding: 0 .45rem;
  border-radius: 999px;
  background: var(--vw-schiene);
  color: #f6eeda;
  font-size: .75rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.vw_pool_liste {
  display: flex;
  flex-direction: column;
  gap: .4rem;
  max-height: 21rem;
  overflow-y: auto;
  min-height: 0;
}
.vw_pool_leer { margin: .2rem 0; font-size: .8rem; color: var(--vw-zeile); }
.vw_pool_item {
  display: grid;
  /* Vorschau links, daneben Name/Laenge; die zwei 40-px-Knoepfe stehen
     DARUNTER rechtsbuendig. In einer Zeile blieben dem Dateinamen bei
     15 rem nur ~70 px ("berg…") - gemessen bei 1280 px. */
  grid-template-columns: 58px minmax(0, 1fr);
  grid-template-areas:
    "bild text"
    "bild knoepfe";
  column-gap: .45rem;
  row-gap: .15rem;
  align-items: center;
  width: 100%;
  padding: .3rem;
  border: 1px solid var(--vw-rand2);
  border-radius: .45rem;
  background: var(--vw-flaeche);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.vw_pool_item:hover { border-color: var(--vw-messing); }
.vw_pool_item:focus-visible { outline: 2px solid var(--vw-messing); outline-offset: 1px; }
.vw_pool_item[aria-pressed="true"] {
  border-color: var(--vw-messing);
  box-shadow: inset 3px 0 0 var(--vw-messing);
}
.vw_pool_item[draggable="true"] { cursor: grab; }
.vw_pool_item.vw_pool_item_zieht { opacity: .5; cursor: grabbing; }
.vw_pool_bild {
  grid-area: bild;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 40px;
  overflow: hidden;
  border-radius: .25rem;
  background: #141414;
  font-size: 1.1rem;
}
.vw_pool_bild img,
.vw_pool_bild video { width: 100%; height: 100%; object-fit: cover; display: block; }
.vw_pool_text { grid-area: text; min-width: 0; }
.vw_pool_name {
  font-size: .78rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.vw_pool_dauer { font-size: .7rem; color: var(--vw-zeile); }
.vw_pool_knoepfe {
  grid-area: knoepfe;
  display: flex;
  gap: .15rem;
  justify-content: flex-end;
}
.vw_pool_bt {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;       /* 40x40-Bedienziel (GUI 3.13.5) */
  min-height: 2.5rem;
  padding: .2rem;
  border: none;
  border-radius: .35rem;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: .95rem;
  cursor: pointer;
}
.vw_pool_bt:hover { background: var(--vw-flaeche2); }
.vw_pool_bt_rot:hover { background: #fdecea; color: var(--vw-rot); }
.vw_pool_fuss { margin: 0; font-size: .7rem; color: var(--vw-zeile); }
.vw_pool_ziel {
  padding: .6rem;
  border: 2px dashed var(--vw-messing);
  border-radius: .5rem;
  color: var(--vw-messing-dunkel);
  text-align: center;
  font-size: .8rem;
}
html[data-theme="dark"] .vw_pool_ziel { color: var(--vw-messing-hell); }

/* ---------- 8. Arbeitsfenster (Panel sticky, feste Hoehe) ------ */
/* Im Arbeitsfenster passt die Werkstatt ohne Scrollen in den Bildschirm:
   Zeile 1 Befehlsleiste (mit den Optionen), Zeile 2 Werkbank (Werkzeuge
   links, Arbeitsflaeche rechts). Die Hoehe kommt seit dem GUI-Umbau aus
   dem App-Rahmen (Kopf oben, Fuss unten, Panel fuellt den Rest) - die
   Variable `--vw-fenster` von game.js ist nur noch der SCHALTER fuer die
   Arbeitsfenster-Regeln, keine Hoehenquelle. Ohne die Variable (zu klein
   oder kein JS) bleibt die fliessende Form. */
.vw_panel[style*="--vw-fenster"] {
  height: auto;
  min-height: 0;
  overflow: hidden;
  /* Im Arbeitsfenster wird der Filmstreifen kompakter: 34-px-Spuren
     reichen fuer Kacheln mit Beschriftung, die Buehne gewinnt die
     Hoehe. (Gemessen bei 1280x800: 40-px-Spuren liessen dem Monitor
     nur 163 px und die Startkarte ragte heraus.) */
  --vw-spur: 34px;
  --vw-ebene-h: 26px;
  --vw-ruler: 22px;
  --vw-filmrand: 9px;
}
.vw_panel[style*="--vw-fenster"] > .vw_befehl { flex: 0 0 auto; }
.vw_panel[style*="--vw-fenster"] > .vw_werkbank { flex: 1 1 auto; min-height: 0; }
.vw_panel[style*="--vw-fenster"] .vw_arbeitsbereich { min-height: 0; }
.vw_panel[style*="--vw-fenster"] .vw_optionen { flex: 0 0 auto; }
.vw_panel[style*="--vw-fenster"] .vw_buehne {
  flex: 1 1 auto;
  min-height: 8rem;      /* nie kleiner als ein brauchbares Filmfenster */
  grid-template-columns: minmax(0, 1fr) 14rem;
}
.vw_panel[style*="--vw-fenster"] .vw_pool { height: 100%; min-height: 0; }
.vw_panel[style*="--vw-fenster"] .vw_pool_liste {
  max-height: none;
  flex: 1 1 auto;
  min-height: 0;
}
.vw_panel[style*="--vw-fenster"] .vw_pool_fuss { flex: 0 0 auto; margin: 0; }
.vw_panel[style*="--vw-fenster"] .vw_tl_kopfzeile,
.vw_panel[style*="--vw-fenster"] .vw_timeline { flex: 0 0 auto; }
.vw_panel[style*="--vw-fenster"] .vw_inspektor {
  flex: 0 1 auto;
  min-height: 0;
  max-height: 14rem;
  overflow-y: auto;
}
.vw_panel[style*="--vw-fenster"] .vw_hinweis { flex: 0 0 auto; }

/* Im Arbeitsfenster entscheidet die HOEHE ueber die Leinwandgroesse.
   `position:absolute` + `inset:0` bindet die Leinwand an die schon
   fertige Kastenflaeche (max-height allein reichte nicht, weil die
   Grid-Hoehe zur Aufloesungszeit unbekannt war). */
.vw_panel[style*="--vw-fenster"] .vw_vorschau { position: relative; }
.vw_panel[style*="--vw-fenster"] #vw_canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  object-fit: contain;
  aspect-ratio: auto;
}
/* Hochformat behaelt seine Haarlinie auch im Arbeitsfenster. */
.vw_panel[style*="--vw-fenster"] #vw_canvas.vw_canvas_eng {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  margin: 0 auto;
  border: 1px solid rgba(255, 255, 255, .6);
  border-radius: 2px;
  inset: auto;
  position: relative;
}

/* ---------- 9. Zeitleiste: der Filmstreifen -------------------- */
.vw_tl_kopfzeile {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .84rem;
}
.vw_tl_kopfzeile strong {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .72rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--vw-messing-dunkel);
}
html[data-theme="dark"] .vw_tl_kopfzeile strong { color: var(--vw-messing-hell); }
.vw_tl_hinweis { font-size: .76rem; color: var(--vw-zeile); }
.vw_tl_hinweis_kurz { display: none; }
.vw_spacer { flex: 1; }

.vw_timeline {
  position: relative;
  display: flex;
  border: 1px solid #0c1116;
  border-radius: .55rem;
  background: var(--vw-film);
  box-shadow: inset 0 0 0 1px rgba(246, 238, 218, .12), 0 3px 10px rgba(0, 0, 0, .35);
  overflow: hidden;
  padding: var(--vw-filmrand) 0;
}
/* Sprocket-Loecher oben und unten - der Filmstreifen */
.vw_timeline::before,
.vw_timeline::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: var(--vw-filmrand);
  background-color: #14120e;
  background-image: repeating-linear-gradient(90deg,
    rgba(246, 238, 218, .62) 0 8px, transparent 8px 22px);
  pointer-events: none;
  z-index: 3;
}
.vw_timeline::before { top: 0; }
.vw_timeline::after { bottom: 0; }

.vw_spurnamen {
  flex: 0 0 auto;
  min-width: 4.6rem;
  display: flex;
  flex-direction: column;
  background: #1b1914;
  border-right: 1px solid rgba(246, 238, 218, .18);
  color: #e9dfc6;
}
.vw_ruler_platz {
  display: flex;
  align-items: center;
  height: var(--vw-ruler, 24px);
  padding-left: .45rem;
  font-size: .66rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #a89a7d;
  border-bottom: 1px solid rgba(246, 238, 218, .15);
}
.vw_spurname {
  display: flex;
  align-items: center;
  height: var(--vw-spur, 40px);
  padding-left: .4rem;
  font-size: .7rem;
  font-weight: 700;
  white-space: nowrap;
  border-bottom: 1px solid rgba(246, 238, 218, .1);
}
.vw_spurname_text { height: var(--vw-ebene-h, 30px); border-bottom: none; }
.vw_spurname_bild {
  height: var(--vw-ebene-h, 30px);
  border-top: 2px solid var(--vw-ebene);
  border-bottom: none;
}
.vw_scroller {
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
}
.vw_bahn { position: relative; min-width: 100%; }
.vw_ruler {
  position: relative;
  height: var(--vw-ruler, 24px);
  background: #1b1914;
  border-bottom: 1px solid rgba(246, 238, 218, .16);
}
.vw_ruler_tick {
  position: absolute;
  top: 0;
  height: 100%;
  border-left: 1px solid rgba(246, 238, 218, .28);
  padding-left: .2rem;
  font-size: .62rem;
  line-height: 1.5rem;
  color: #b6a98c;
  white-space: nowrap;
}
.vw_ruler_tick_lang { border-left-color: var(--vw-messing-hell); color: #eadfc6; }

.vw_spur {
  position: relative;
  height: var(--vw-spur, 40px);
  border-bottom: 1px solid rgba(246, 238, 218, .08);
  background: rgba(246, 238, 218, .035);
}
.vw_spur[data-ebene="audio"] { background: rgba(68, 120, 201, .1); }
.vw_spur_text {
  height: var(--vw-ebene-h, 30px);
  background: rgba(149, 103, 194, .14);
  border-bottom: none;
}
.vw_spur_bild {
  height: var(--vw-ebene-h, 30px);
  background: rgba(23, 165, 176, .14);
  border-top: 2px solid var(--vw-ebene);
  border-bottom: none;
}
.vw_spur_ablage {
  background: rgba(217, 181, 101, .28);
  box-shadow: inset 0 0 0 2px var(--vw-messing-hell);
}
.vw_spur_abgelehnt {
  background: rgba(224, 90, 74, .24);
  box-shadow: inset 0 0 0 2px var(--vw-rot);
}
.vw_dropmarker {
  position: absolute;
  top: var(--vw-ruler, 24px);
  bottom: 0;
  width: 3px;
  margin-left: -1px;
  background: var(--vw-messing-hell);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .6);
  z-index: 6;
  pointer-events: none;
}
.vw_dropmarker[hidden] { display: none; }
.vw_track { position: relative; height: 100%; }
.vw_track_leer {
  position: absolute;
  left: .5rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: .68rem;
  color: #9b8f78;
  opacity: .8;
  pointer-events: none;
}

/* Clips: Karten auf dem Filmstreifen */
.vw_clip {
  position: absolute;
  top: 4px;
  bottom: 4px;
  display: flex;
  align-items: center;
  gap: .3rem;
  min-width: 6px;
  padding: 0 8px;
  border: 2px solid transparent;
  border-radius: .35rem;
  color: #fff;
  font-size: .7rem;
  overflow: hidden;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .4);
}
.vw_clip:active { cursor: grabbing; }
.vw_clip_video { background: linear-gradient(180deg, #3a8f60, var(--vw-video)); }
.vw_clip_bild { background: linear-gradient(180deg, #b8862f, var(--vw-bild)); }
.vw_clip_audio { background: linear-gradient(180deg, #4478c9, var(--vw-audio)); }
.vw_clip_text { background: linear-gradient(180deg, #9567c2, var(--vw-text)); }
.vw_clip_ebene { background: linear-gradient(180deg, #26a6b0, var(--vw-ebene)); }
.vw_clip_gewaehlt {
  border-color: var(--vw-mark);
  box-shadow: 0 0 0 2px rgba(255, 216, 53, .5);
  z-index: 3;
}
.vw_clip_name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: none;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .5);
}
.vw_clip_chips {
  position: absolute;
  top: 2px;
  right: 14px;     /* Platz fuer den Trim-Rand */
  display: flex;
  gap: 3px;
  pointer-events: none;
}
.vw_clip_chip {
  padding: 0 5px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .46);
  color: #fff;
  font-size: .58rem;
  line-height: 1.5;
  white-space: nowrap;
  text-shadow: none;
}
.vw_clip_rand {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 14px;
  cursor: ew-resize;
  background: rgba(255, 255, 255, .16);
}
.vw_clip_rand::after {
  content: "";
  position: absolute;
  top: 25%;
  bottom: 25%;
  left: 6px;
  width: 2px;
  border-radius: 2px;
  background: rgba(255, 255, 255, .85);
}
.vw_clip_rand_links { left: 0; border-right: 1px solid rgba(255, 255, 255, .35); }
.vw_clip_rand_rechts { right: 0; border-left: 1px solid rgba(255, 255, 255, .35); }
.vw_clip_rand:hover { background: rgba(255, 255, 255, .34); }

/* Uebergangs-Marker an einer Kante */
.vw_ueb_marker {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 20px;
  margin-left: -10px;
  padding: 0;
  border: none;
  border-left: 1px dashed var(--vw-messing-hell);
  border-right: 1px dashed var(--vw-messing-hell);
  background: rgba(217, 181, 101, .22);
  color: #ffe9b8;
  font-size: .66rem;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
}
.vw_ueb_marker:hover { background: rgba(217, 181, 101, .45); }
.vw_ueb_marker_gewaehlt { background: rgba(217, 181, 101, .7); color: #1b1409; }

/* Zeiger (rotes Ableseband) */
.vw_playhead {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  margin-left: -1px;
  background: #e2493b;
  box-shadow: 0 0 6px rgba(226, 73, 59, .6);
  z-index: 5;
  pointer-events: none;
}
.vw_playhead::before {
  content: "";
  position: absolute;
  top: 0;
  left: -5px;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 8px solid #e2493b;
}

/* ---------- 10. Inspektor: Bedienpult ------------------------- */
.vw_inspektor {
  display: flex;
  gap: .6rem;
  min-height: 4.5rem;
  padding: .5rem;
  border: 1px solid var(--vw-rand);
  border-top: 3px solid var(--vw-messing);
  border-radius: .6rem;
  background: linear-gradient(180deg, var(--vw-flaeche), var(--vw-flaeche2));
}
.vw_ins_leer { font-size: .85rem; color: var(--vw-tinte2); }
.vw_ins_leer p { margin: 0 0 .35rem; }
.vw_ins_tipp { font-size: .78rem; }
.vw_ins_tipp kbd {
  padding: 0 .3rem;
  border: 1px solid var(--vw-rand);
  border-bottom-width: 2px;
  border-radius: .25rem;
  background: var(--vw-flaeche2);
  font-size: .74rem;
}
.vw_ins_spalten { display: flex; flex-wrap: wrap; gap: .9rem; flex: 1; min-width: 0; }
.vw_ins_block { flex: 1 1 14rem; min-width: 12rem; }
/* FALLE: "hidden" verliert gegen jede display-Regel - ohne diese zwei
   Zeilen stehen alle Inspektor-Spalten gleichzeitig da. */
.vw_ins_spalten[hidden] { display: none; }
.vw_ins_block[hidden] { display: none; }
.vw_ins_kopf {
  display: flex;
  align-items: center;
  gap: .4rem;
  margin: 0 0 .35rem;
  padding-bottom: .2rem;
  border-bottom: 1px solid var(--vw-rand2);
  font-size: .9rem;
}
.vw_ins_chip {
  padding: .05rem .5rem;
  border-radius: 999px;
  background: var(--vw-schiene);
  color: #f6eeda;
  font-size: .7rem;
}
.vw_ins_chip_text { background: var(--vw-text); }
.vw_ins_chip_bild { background: var(--vw-ebene); color: #05282a; }
.vw_ins_zeit { margin: 0 0 .4rem; font-size: .77rem; color: var(--vw-zeile); }
.vw_ins_zeile {
  display: flex;
  align-items: center;
  gap: .45rem;
  margin: .3rem 0;
  font-size: .82rem;
}
.vw_ins_zeile > span:first-child { flex: 0 0 6.2rem; }
.vw_ins_zeile input[type="range"] { flex: 1; min-width: 4rem; accent-color: var(--vw-messing); }
.vw_ins_zeile output {
  flex: 0 0 3.4rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-size: .77rem;
}
.vw_ins_zeile select,
.vw_ins_zeile input[type="color"] {
  flex: 1;
  min-height: 2.5rem;      /* Bedienziel 40 px (GUI 3.13.5) */
  padding: 0 .3rem;
  border: 1px solid var(--vw-rand);
  border-radius: .35rem;
  background: var(--vw-flaeche);
  color: inherit;
  font: inherit;
  font-size: .82rem;
}
.vw_ins_zeile input[type="color"] { flex: 0 0 3.2rem; padding: .1rem; }
.vw_ins_check {
  display: flex;
  align-items: center;
  gap: .4rem;
  margin: .35rem 0;
  font-size: .83rem;
  min-height: 2.5rem;
}
.vw_ins_check input { width: 1.05rem; height: 1.05rem; accent-color: var(--vw-messing); }
.vw_ins_balken { display: block; margin-bottom: .35rem; font-size: .8rem; }
.vw_ins_balken span { display: block; margin-bottom: .2rem; }
.vw_ins_balken textarea {
  width: 100%;
  padding: .35rem .5rem;
  border: 1px solid var(--vw-rand);
  border-radius: .4rem;
  background: var(--vw-flaeche);
  color: inherit;
  font: inherit;
  font-size: .9rem;
  resize: vertical;
}
.vw_ins_knoepfe { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .3rem; }
.vw_ins_fuss { margin: .4rem 0 0; font-size: .74rem; color: var(--vw-zeile); }

/* ---------- 11. Meldung --------------------------------------- */
.vw_hinweis {
  min-height: 1.2rem;
  margin: 0;
  font-size: .84rem;
  color: var(--vw-messing-dunkel);
}
html[data-theme="dark"] .vw_hinweis { color: var(--vw-messing-hell); }
.vw_hinweis_fehler { color: var(--vw-rot); }
html[data-theme="dark"] .vw_hinweis_fehler { color: #ff8a7a; }

/* ---------- 12. Fenster: Papier auf dem Schnittplatz ----------- */
.vw_modal_grund {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(4, 8, 11, .66);
}
.vw_modal_grund[hidden] { display: none; }
.vw_modal {
  width: 100%;
  max-width: 32rem;
  max-height: 86vh;
  overflow: auto;
  padding: 1rem 1.2rem;
  border-top: 6px solid var(--vw-messing);
  border-radius: .6rem;
  background: var(--vw-papier);
  color: var(--vw-papier-tinte);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .5);
  scrollbar-color: var(--vw-messing) transparent;
}
.vw_modal h3 { margin: 0 0 .5rem; font-size: 1.05rem; }
.vw_modal h4 { color: #4b3a18; }
.vw_modal p { margin: .35rem 0; font-size: .87rem; }
.vw_modal a { color: #7d5a17; }
/* Text-/Schrift-Studio braucht mehr Platz. WICHTIG: die Klasse haengt am
   OVERLAY (#vw_modal = .vw_modal_grund), nicht am Dialog - sonst verengt
   sich nur die Abdunklung. */
.vw_modal_grund.vw_modal_studio > .vw_modal { max-width: 36rem; }
.vw_modal_knoepfe {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  justify-content: flex-end;
  margin-top: .9rem;
  position: sticky;
  bottom: -.1rem;
  padding-top: .5rem;
  background: linear-gradient(to top, var(--vw-papier) 70%, rgba(251, 247, 234, 0));
}
.vw_modal .jupi_btn {
  background: linear-gradient(180deg, #d9ab55, #b5852f);
  color: #1b1409;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .25);
}
.vw_modal .jupi_btn:hover { background: #f0cd84; transform: none; }
.vw_modal .jupi_btn_alt { background: #e8e1cf; color: #2a3339; border: 1px solid #b9ae94; }
.vw_modal .jupi_btn_alt:hover { background: #f7f0dd; }
.vw_modal .vw_werk {
  background: #f3ecda;
  border-color: #bfae8c;
  color: #2a3339;
}
.vw_modal .vw_werk:hover { background: #fff7e6; border-color: var(--vw-messing); }
.vw_modal .vw_werk_rot { color: #8e2f22; }
.vw_modal .vw_werk_rot:hover { background: #fdecea; }
/* Eingaben im Fenster bleiben auf Papier hell - auch nachts. */
.vw_modal input[type="text"],
.vw_modal input[type="number"],
.vw_modal select,
.vw_modal textarea {
  background: #fffdf6;
  color: #1e272e;
  border-color: #c9c2b2;
}
.vw_modal input[type="range"] { accent-color: var(--vw-messing); }
.vw_modal_liste { list-style: none; margin: .5rem 0 0; padding: 0; }
.vw_modal_liste li {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .4rem .3rem;
  border-bottom: 1px solid #e2dbc9;
  font-size: .87rem;
}
.vw_modal_liste li:last-child { border-bottom: none; }
.vw_modal_liste .vw_pool_name { flex: 1; }
.vw_modal_name {
  width: 100%;
  margin: .3rem 0 0;
  padding: .5rem .7rem;
  border: 1px solid #c9c2b2;
  border-radius: .45rem;
  background: #fffdf6;
  color: #1e272e;
  font-size: 1rem;
}

/* ❓-Hilfe-Fenster: Merkblatt (max 40rem) */
.vw_modal_grund.vw_modal_hilfe > .vw_modal { max-width: 40rem; }
.vw_modal_hilfe h4 { margin: .9rem 0 .25rem; font-size: .95rem; }
.vw_modal_hilfe ul { margin: .2rem 0; padding-left: 1.2rem; }
.vw_modal_hilfe li { margin: .3rem 0; font-size: .85rem; line-height: 1.45; }
.vw_lernsatz {
  padding: .5rem .7rem;
  border-left: 5px solid var(--vw-messing);
  border-radius: .35rem;
  background: #f3ecd8;
  font-size: .86rem;
}
.vw_hilfe_impressum { font-size: .8rem; color: #5c6670; }

/* ---------- 13. Ton-Studio (Musik & Effekte aus dem Geraet) ---- */
.vw_tonstudio_gruppe {
  margin: .7rem 0 .1rem;
  font-size: .78rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #6d5a33;
}
.vw_tonstudio_zeile {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .45rem .3rem;
  border-bottom: 1px solid #e2dbc9;
  font-size: .87rem;
}
.vw_tonstudio_zeile:last-child { border-bottom: none; }
.vw_tonstudio_info { flex: 1; min-width: 0; display: block; }
.vw_tonstudio_info strong { display: block; }
.vw_tonstudio_meta { display: block; font-size: .75rem; color: #6b7681; }
.vw_tonstudio_zeile .vw_werk,
.vw_tonstudio_zeile .vw_tonstudio_play,
.vw_tonstudio_zeile .vw_tonstudio_rein { flex: 0 0 auto; white-space: nowrap; }
.vw_tonstudio_zeile button:disabled { opacity: .55; cursor: wait; }

/* ---------- 14. Text-Studio (Schrift-Fenster mit Vorschau) ---- */
.vw_studio_vorschau {
  display: block;
  width: 100%;
  height: auto;
  margin: .2rem 0 .6rem;
  border-radius: .4rem;
  background: #46566a;   /* Mittel-Grund: Rahmen/Kasten sichtbar */
}
.vw_studio_zeile {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin: .4rem 0;
  font-size: .85rem;
}
.vw_studio_label { flex: 0 0 5.6rem; }
.vw_studio_zeile select,
.vw_studio_zeile input[type="color"],
.vw_studio_text {
  padding: .3rem .45rem;
  border: 1px solid #c9c2b2;
  border-radius: .35rem;
  background: #fffdf6;
  color: #1e272e;
  font-size: .85rem;
}
.vw_studio_zeile select { flex: 1; min-width: 0; min-height: 2.5rem; }
.vw_studio_zeile input[type="color"] {
  flex: 0 0 2.8rem;
  min-height: 2.5rem;
  padding: .1rem;
}
.vw_studio_text { width: 100%; resize: vertical; }
.vw_studio_regler { display: flex; flex: 1; align-items: center; gap: .5rem; }
.vw_studio_regler input[type="range"] {
  flex: 1;
  min-width: 4rem;
  accent-color: var(--vw-messing);
}
.vw_studio_checks { display: flex; flex: 1; align-items: center; gap: .7rem; flex-wrap: wrap; }
.vw_studio_check { display: inline-flex; align-items: center; gap: .3rem; }
.vw_studio_check input { accent-color: var(--vw-messing); }
.vw_studio_hinweis { margin: .5rem 0 0; font-size: .77rem; opacity: .8; }

/* ---------- 15. Bildwahl, Fortschritt, Gefahr-Knopf ------------- */
.vw_bildwahl { min-width: 18rem; }
.vw_bildwahl_hinweis { margin: 0 0 .6rem; font-size: .82rem; color: #6b7681; }
.vw_bildwahl_raster {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr));
  gap: .5rem;
  max-height: 17rem;
  overflow-y: auto;
}
.vw_bildwahl_knopf {
  display: flex;
  flex-direction: column;
  gap: .25rem;
  min-width: 0;
  padding: .3rem;
  border: 1px solid #c9c2b2;
  border-radius: .45rem;
  background: #fffdf6;
  color: #1e272e;
  font: inherit;
  font-size: .75rem;
  text-align: left;
  cursor: pointer;
}
.vw_bildwahl_knopf:hover { border-color: var(--vw-messing); }
.vw_bildwahl_knopf:focus-visible { outline: 2px solid var(--vw-messing); outline-offset: 1px; }
.vw_bildwahl_bild {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: .3rem;
  background: #141414;
  overflow: hidden;
}
.vw_bildwahl_name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vw_studio_hinweis { font-size: .76rem; color: #64727d; }

.vw_balken {
  height: .9rem;
  margin: .6rem 0 .3rem;
  border: 1px solid #bfae8c;
  border-radius: 999px;
  background: #efe7d4;
  overflow: hidden;
}
.vw_balken_fuellung {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #b5852f, #e9c473);
  transition: width .25s linear;
}
.vw_export_zahl { font-size: .8rem; color: #64727d; font-variant-numeric: tabular-nums; }
.vw_btn_rot { background: #a63a2c; color: #fff; }
.vw_btn_rot:hover { background: #8e2f22; filter: none; }

/* ---------- 16. Fuss (3.13.2): Schul-Bezug, Kontrast ----------- */
/* Der Fuss liegt auf der Kulisse (Regal/Tisch) - helle Schrift auf hellem
   Holz war im Hell-Thema kaum lesbar (Sichtfoto 1280x800). Darum ein
   schmaler dunkler Streifen mit Messingkante, in BEIDEN Themes. */
body.vw_body .jupi_footer {
  padding: .3rem 1rem .45rem;
}
.vw_fuss_text {
  margin: 0 auto;
  max-width: 60rem;
  padding: .3rem .8rem;
  border-radius: 999px;
  background: rgba(12, 18, 22, .82);
  border: 1px solid rgba(217, 181, 101, .45);
  text-align: center;
  font-size: .78rem;
  color: #f2e8d2;
  line-height: 1.6;
}
.vw_fuss_text a { color: #f0cd84; font-weight: 700; text-decoration: none; }
.vw_fuss_text a:hover { text-decoration: underline; }
html[data-theme="dark"] .vw_fuss_text { color: #dbe4ea; }
html[data-theme="dark"] .vw_fuss_text a { color: #e9c473; }

/* ---------- 17. Mittlere Fenster: Befehlsleiste bleibt EINZEILIG ---- */
/* Bei 1024 px brachen die Projektbefehle plus Optionen in zwei Zeilen
   (gemessen: 97 px statt 52 px) - das kostete den Monitor den halben
   Platz. Wie am Handy scrollt die Leiste darum seitlich. */
@media (max-width: 1180px) and (min-width: 761px) {
  .vw_befehl {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
  }
  .vw_befehl > * { flex: 0 0 auto; }
  .vw_befehl .vw_werk { font-size: .8rem; padding: .2rem .55rem; }
  /* Der Hauptknopf (Film speichern) und die beiden Werkzeuge stehen VORN
     in der scrollbaren Zeile - sonst lagen sie hinter dem Scrollrand
     (gemessen bei 1024 px). Projektbefehle folgen dahinter. */
  .vw_befehl_ende { margin-left: 0; margin-right: .2rem; order: -1; }
  .vw_befehl .vw_werk_teiler:first-of-type { order: -1; }
}

/* Flache Fenster (Schullaptops 1024x768): der Filmstreifen wird noch
   einmal kompakter, damit der Monitor benutzbar bleibt. */
@media (max-height: 820px) and (min-width: 900px) {
  .vw_panel[style*="--vw-fenster"] {
    --vw-spur: 30px;
    --vw-ebene-h: 24px;
    --vw-ruler: 20px;
    --vw-filmrand: 8px;
  }
  .vw_panel[style*="--vw-fenster"] .vw_inspektor { max-height: 11rem; }
  .vw_tl_kopfzeile { font-size: .8rem; }
  body.vw_body .jupi_main { padding-top: .35rem; }
}

/* ---------- 18. Finger/Stift: breitere Kuerz-Raender ----------- */
@media (pointer: coarse) {
  .vw_clip_rand { width: 24px; }
  .vw_clip_rand::after { left: 11px; }
  .vw_clip { padding: 0 14px; }
}

/* ---------- 19. Kleine Geraete -------------------------------- */
@media (max-width: 980px) {
  .vw_buehne { grid-template-columns: minmax(0, 1fr); }
  .vw_pool_liste {
    flex-direction: row;
    flex-wrap: wrap;
    max-height: none;
  }
  .vw_pool_item { width: auto; min-width: 13rem; flex: 1 1 13rem; }
  .vw_pool_fuss { display: none; }
  .vw_panel[style*="--vw-fenster"] .vw_buehne {
    grid-template-columns: minmax(0, 1fr);
    overflow-y: auto;
  }
}

@media (max-width: 760px) {
  /* Werkbank einspaltig: Werkzeuge als waagerechte Leiste unter der
     Befehlsleiste (am Handy ist eine schmale Spalte nicht bedienbar). */
  .vw_werkbank { grid-template-columns: minmax(0, 1fr); }
  .vw_werkzeug {
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    padding: .3rem;
    scrollbar-width: thin;
  }
  .vw_werkzeug .vw_werk {
    flex: 0 0 auto;
    width: auto;
    min-height: 2.5rem;
    font-size: .78rem;
  }
  .vw_werkzeug .vw_werk_teiler {
    width: 1px;
    height: 1.6rem;
    margin: 0 .15rem;
    flex: 0 0 auto;
  }
  .vw_marke { grid-column: 1 / -1; grid-row: 1; }
  .vw_kopf {
    grid-template-columns: minmax(0, auto) minmax(0, 1fr);
    padding: .3rem .55rem .4rem;
    gap: .25rem .4rem;
  }
  a.vw_zurueck { grid-row: 2; grid-column: 1; padding: .25rem .6rem; }
  .vw_kopf_ende { grid-row: 2; grid-column: 2; min-width: 0; }
  /* Die Sprachwahl steht sonst ueber der Zurueck-Pille (gemessen bei
     390 px: Auswahl 272 px breit). Sie schrumpft mit, das Kuerzel bleibt. */
  .vw_kopf_ende .jupi_sprachen_select { max-width: 9rem; min-width: 0; }
  .vw_marke_name { font-size: .95rem; }
  .vw_marke_logo { height: 1.5rem; width: 1.5rem; }
  /* Befehlsleiste am Handy: EINE scrollbare Zeile, die wichtigsten
     Knoepfe vorn (Film speichern, Ton, Hilfe). */
  .vw_befehl {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    padding: .3rem;
    scrollbar-width: thin;
  }
  .vw_befehl > * { flex: 0 0 auto; }
  .vw_befehl_ende { margin-left: 0; order: -1; }
  .vw_befehl .vw_werk { font-size: .78rem; padding: .2rem .5rem; }
  .vw_befehl .vw_werk_icon { width: 2.5rem; }
  .vw_optionen { flex-wrap: nowrap; }
  .vw_optionen .vw_werk_label input[type="range"] { width: 3.5rem; }
  .vw_optionen .vw_format_wahl { max-width: 7rem; }
  .vw_werk_label input[type="range"] { width: 4.5rem; }
  .vw_tl_hinweis { font-size: .7rem; }
  .vw_tl_hinweis_lang { display: none; }
  .vw_tl_hinweis_kurz { display: inline; }
  .vw_ins_zeile > span:first-child { flex: 0 0 5.2rem; }
  .vw_spurnamen { min-width: 3.6rem; }
  .vw_spurname { font-size: .62rem; padding-left: .25rem; }
  .vw_ins_block { flex: 1 1 100%; min-width: 0; }
  /* Startkarte oben halten - die Spielleiste liegt unten ueber der Flaeche. */
  .vw_vorschau { min-height: 15.5rem; }
  .vw_overlay { align-items: flex-start; padding: .5rem .5rem 3.2rem; overflow-y: auto; }
  .vw_overlay_karte { padding: .7rem .8rem; }
  .vw_overlay_titel { font-size: .95rem; }
  .vw_overlay_text { font-size: .8rem; margin-bottom: .5rem; }
  .vw_overlay_hinweis { display: none; }
  .vw_overlay_knoepfe .jupi_btn { min-height: 2.5rem; padding: .2rem .6rem; font-size: .82rem; }
}

@media (max-width: 560px) {
  body.vw_body .jupi_main { padding: .35rem .35rem 1rem; }
  .vw_panel { padding: .4rem; border-radius: .7rem; }
  .vw_marke { padding-right: .55rem; }
  .vw_marke_name { font-size: .9rem; }
  .vw_befehl .vw_werk span { font-size: .76rem; }
  .vw_befehl .vw_werk_voll span { white-space: normal; text-align: center; }
  .vw_timeline { padding: 8px 0; }
  .vw_spurname { font-size: .6rem; }
  .vw_spurnamen { min-width: 3.2rem; }
  .vw_spur { height: 44px; }
  .vw_inspektor { padding: .35rem; }
  .vw_fuss_text { font-size: .72rem; }
}

/* ---------- 20. Ruhige Bewegung ------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .vw_aufnahme_punkt { animation: none; }
  .vw_balken_fuellung { transition: none; }
  .vw_werk:active { transform: none; }
}
