/* ===== Chip Saboteurs - Styles (eigenes PWA-Paket, GUI 3.13 Typ 4) =====
   Die JUPI-Basis (Farben, Buttons, Footer, Dark Mode) kommt aus colors.css
   und jupi.css. Hier steht nur die Spiel-eigene Optik.

   WELT: "Silizium-Reinraum" (Stil-Pass 07.11.2026, AGENTS.md 3.13.6/3.13.7).
   Im Spiel laeuft das Kind durch eine Prozessorfabrik: Wafer-Fab, Schneiden,
   Packaging, Qualitaetskontrolle, Versand - und entlarvt dabei die Saboteure.
   Der Ort ist deshalb die Fabrik selbst: ein Reinraum mit Wandpaneelen,
   Kupfer-Leiterbahnen (Platine!), FOUP-Waferwagen und einem Pruefplatz mit
   Wafer-Mikroskop. Die Leiste ist die Reinraum-Konsole aus Stahl mit
   Kupferkante und Betriebs-LED, das Startmenue das Leitstand-Pult, die
   Buehne die dunkle Fabrikhalle, Papiere (Module, Protokolle) bleiben hell.
   Dark Mode = dieselbe Fabrik in der Nachtschicht (Kulisse gedimmt).

   Aufbau: 0 Welt/Seite - 1 Leiste - 2 Startmenue/Pult - 3 Buehne + HUD -
   4 Seitenleiste/Taskliste - 5 Task-Minispiele - 6 Meeting - 7 Fenster -
   8 Fuss - 9 Dark Mode - 10 Responsive - 11 Fokus/Bedienziele. */

/* ---------- 0. Farben der Welt + Seitenhintergrund ---------- */
:root {
  --cs-graphit-1: #2a3d4b;      /* Geraetedeckel hell */
  --cs-graphit-2: #1a2833;      /* Geraeteglas */
  --cs-graphit-3: #0d161d;      /* Geraetetiefe */
  --cs-stahl-1: #d5e2e9;        /* Edelstahl hell */
  --cs-stahl-2: #a7bac5;        /* Edelstahl */
  --cs-stahl-3: #6d828f;        /* Edelstahl tief */
  --cs-kupfer: #c0783a;         /* Leiterbahn */
  --cs-kupfer-hell: #eab27c;
  --cs-kupfer-tief: #8a5426;
  --cs-led: #8bffc0;            /* Betriebs-LED */
  --cs-led-tief: #1f9d63;
  --cs-amber: #ffc46b;
  --cs-papier: #f4f8fa;         /* Arbeitskarte/Protokoll */
  --cs-papier-2: #e3ecf1;
  --cs-papier-kante: #b7c9d3;
  --cs-tinte: #16232c;
  --cs-tinte-2: #4c6270;
  --cs-gruen: #2f8f58;
  --cs-gruen-hell: #63c98a;
  --cs-rot: #b3261e;
  --cs-rot-hell: #e05a4f;
  --cs-schatten: 0 12px 28px rgba(6, 16, 23, .38);
}

body.jupi.cs_body {
  /* EINE gestreckte Szene (3.13.7 Weg A): Reinraum, kein Kachelmuster */
  background-color: #c3d1da;
  background-image: url("kulisse.svg");
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center top;
  background-attachment: fixed;
  color: var(--cs-tinte);
  /* Die Plattform setzt overflow-x:hidden - das macht den Body zum
     Scroll-Container und die sticky Leiste scrollt mit weg (Lehre aus
     maschinenbau/AGENTS.md). */
  overflow-x: visible;
  /* Kopf oben, Fuss unten (3.13.2a) */
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
body.jupi.cs_body .chip-main {
  flex: 1 0 auto;
  width: 100%;
  max-width: 1500px;
  margin: 0 auto;
  padding: .8rem 1rem .9rem;
}

/* ---------- 1. Leiste: Reinraum-Konsole (3.13.2) ----------
   Drei Zonen: links zurueck, MITTIG Logo + Name, rechts Sprache + Dark Mode.
   Material: gebuersteter Edelstahl mit Kupferkante und Betriebs-LED-Band. */
.chip-leiste {
  position: sticky;
  top: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: .4rem .8rem;
  min-height: 58px;
  padding: .42rem 1rem .5rem;
  color: var(--cs-tinte);
  background-color: #c9d7de;
  background-image:
    repeating-linear-gradient(90deg, rgba(255,255,255,.34) 0 1px, rgba(255,255,255,0) 1px 3px),
    linear-gradient(180deg, #f0f6f9 0%, #d3e0e7 42%, #adbfc8 100%);
  border-bottom: 3px solid var(--cs-kupfer);
  box-shadow: 0 6px 22px rgba(8, 20, 28, .30), inset 0 1px 0 #fff;
}
/* Betriebs-LED-Band direkt ueber der Kupferkante */
.chip-leiste::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 3px;
  pointer-events: none;
  background: repeating-linear-gradient(90deg,
    rgba(139,255,192,.85) 0 4px, rgba(139,255,192,0) 4px 44px);
  opacity: .7;
}
.chip-zurueck {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  min-height: 40px;
  padding: .3rem .8rem;
  border-radius: .5rem;
  border: 1px solid #0c171e;
  background: linear-gradient(180deg, #34495a 0%, #1d2c37 55%, #131d25 100%);
  color: #eaf3f7;
  text-decoration: none;
  font-weight: 800;
  font-size: .92rem;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.22), 0 2px 6px rgba(8,18,24,.35);
}
.chip-zurueck:hover {
  background: linear-gradient(180deg, #45606f 0%, #283d4b 55%, #1a2831 100%);
  color: #fff;
  transform: translateY(-1px);
}
.chip-titel {
  justify-self: center;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  min-width: 0;
  margin: 0;
  font-size: 1.24rem;
  font-weight: 900;
  letter-spacing: .01em;
  color: #16232c;
  text-shadow: 0 1px 0 rgba(255,255,255,.7);
}
.chip-titel-logo {
  width: 30px; height: 30px;
  border-radius: 7px;
  background: #0d161d;
  box-shadow: 0 0 0 2px var(--cs-kupfer), 0 2px 6px rgba(8,18,24,.45);
}
.chip-titel-wort { white-space: nowrap; }
.chip-ende { justify-self: end; display: inline-flex; align-items: center; gap: .5rem; min-width: 0; }
.chip-vermerk {
  font-size: .7rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: .15rem .45rem;
  border-radius: .3rem;
  background: linear-gradient(180deg, #ffd98a, #e0a23a);
  color: #3a2606;
  border: 1px solid #8a5c14;
  white-space: nowrap;
}
.chip-werkzeuge { display: flex; align-items: center; gap: .5rem; min-width: 0; }
/* Sprachwahl + Theme-Pille auf Stahl: dunkle Geraetepille mit heller Schrift */
.chip-leiste .jupi_sprachen_wahl { min-width: 0; }
.chip-leiste .jupi_sprachen_icon { color: #1c2b35; }
.chip-leiste .jupi_sprachen_select {
  min-height: 40px;
  padding: .35rem .75rem;
  font-size: .85rem;
  color: #eaf3f7;
  background: linear-gradient(180deg, #34495a, #16222b);
  border: 1px solid #0b1319;
  border-radius: .5rem;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.2);
}
.chip-leiste .jupi_sprachen_select:hover { background: linear-gradient(180deg, #44606f, #1d2c36); }
.chip-leiste .jupi_sprachen_select:focus-visible { outline: 3px solid var(--cs-kupfer); outline-offset: 2px; }
/* Dark-Mode-Pille 74x40 (3.13.2): auf Stahl mit Kupferrand */
.chip-leiste .jupi_theme_switch {
  width: 74px; height: 40px; min-width: 74px; padding: 0;
  background: linear-gradient(180deg, #324757, #16222b);
  border: 1px solid #0b1319;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.2);
}
.chip-leiste .jupi_theme_switch:hover { background: linear-gradient(180deg, #405d6e, #1d2c36); }
.chip-leiste .jupi_theme_switch .jts_icon { font-size: .84rem; }
.chip-leiste .jupi_theme_switch .jts_sun { left: .5rem; }
.chip-leiste .jupi_theme_switch .jts_moon { right: .5rem; }
.chip-leiste .jupi_theme_switch .jts_thumb {
  width: 2rem; top: .25rem; bottom: .25rem; left: .25rem;
  background: linear-gradient(180deg, #f7fbfd, #c4d3db);
  box-shadow: 0 1px 4px rgba(0,0,0,.45);
}
html[data-theme="dark"] .chip-leiste .jupi_theme_switch .jts_thumb {
  left: calc(100% - 2rem - .25rem);
}

/* ---------- 2. Startmenue = Leitstand-Pult ----------
   GUI 3.13: keine zweite Titelzeile - Name + Logo stehen nur in der Leiste.
   Der Lernsatz bleibt als schlanke Zeile (Typ-4-Pflicht) und wird hier zum
   Hinweisschild auf dem Pult. */
.chip-startmenue {
  position: relative;
  padding: 1.1rem 1.1rem 1.1rem;
  border-radius: 1rem;
  border: 1px solid rgba(234, 178, 124, .38);
  background-color: #1a2833;
  background-image:
    repeating-linear-gradient(0deg, rgba(255,255,255,.022) 0 1px, rgba(255,255,255,0) 1px 4px),
    radial-gradient(120% 62% at 50% -14%, rgba(139,255,192,.12), rgba(139,255,192,0) 62%),
    linear-gradient(180deg, #263845 0%, #18242d 52%, #101a22 100%);
  box-shadow: 0 20px 46px rgba(5, 13, 19, .5), inset 0 1px 0 rgba(255,255,255,.10);
  color: #e7f0f4;
  --chip-textur: rgba(255,255,255,.03);
  --chip-schein: rgba(139,255,192,.10);
}
/* Vier Eck-Schrauben (reines CSS, keine Grafik, kein Text) */
.chip-startmenue::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 1rem;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 15px 15px, #c9a063 0 3.2px, rgba(0,0,0,0) 3.6px),
    radial-gradient(circle at calc(100% - 15px) 15px, #c9a063 0 3.2px, rgba(0,0,0,0) 3.6px),
    radial-gradient(circle at 15px calc(100% - 15px), #c9a063 0 3.2px, rgba(0,0,0,0) 3.6px),
    radial-gradient(circle at calc(100% - 15px) calc(100% - 15px), #c9a063 0 3.2px, rgba(0,0,0,0) 3.6px);
}
.chip-startmenue > * { position: relative; z-index: 1; }
/* Kupferkante oben - der Pult-Abschluss */
.chip-startmenue::before {
  content: "";
  position: absolute;
  left: 1.25rem; right: 1.25rem; top: 0;
  height: 5px;
  border-radius: 0 0 5px 5px;
  background: linear-gradient(90deg, var(--cs-kupfer-tief), var(--cs-kupfer-hell) 42%, var(--cs-kupfer) 70%, rgba(192,120,58,0));
}
/* Lernsatz = Hinweisschild am Pult */
.chip-lernsatz {
  background: linear-gradient(90deg, rgba(255, 196, 107, .18), rgba(255, 196, 107, .03));
  border-left: 4px solid var(--cs-amber);
  border-radius: .5rem;
  padding: .5rem .85rem;
  line-height: 1.45;
  font-size: .93rem;
  margin: .55rem 0 .6rem;
  color: #edf5f8;
}
.chip-lernsatz b { color: var(--cs-amber); }
.chip-lernsatz-zusatz { background: transparent; border-left-color: rgba(255,255,255,.25); }
/* Schnell-Zeile: Konsolentasten (Ton, Hilfe, Ueber) */
.chip-mknoepfe {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  justify-content: center;
  margin: .1rem 0 .7rem;
}
.chip-mknopf {
  position: relative;
  min-height: 44px;
  min-width: 40px;
  border: 1px solid rgba(234, 178, 124, .48);
  background: linear-gradient(180deg, rgba(255,255,255,.13) 0%, rgba(255,255,255,.04) 46%, rgba(0,0,0,.22) 100%);
  color: #eaf3f7;
  border-radius: .55rem;
  padding: .5rem 1.1rem .5rem 1.6rem;
  font-size: .93rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.22), 0 3px 8px rgba(0,0,0,.32);
  transition: transform .1s, box-shadow .12s, border-color .12s, background .12s;
}
/* Betriebs-LED am Tastenrand */
.chip-mknopf::before {
  content: "";
  position: absolute;
  left: .6rem; top: 50%;
  width: .5rem; height: .5rem;
  margin-top: -.25rem;
  border-radius: 50%;
  background: var(--cs-led);
  box-shadow: 0 0 6px rgba(139,255,192,.8);
  opacity: .85;
}
.chip-mknopf:hover {
  border-color: var(--cs-kupfer-hell);
  background: linear-gradient(180deg, rgba(255,255,255,.2) 0%, rgba(255,255,255,.07) 46%, rgba(0,0,0,.18) 100%);
  transform: translateY(-1px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.28), 0 6px 16px rgba(0,0,0,.4);
}
.chip-mknopf:active { transform: translateY(0); }
.chip-mknopf:focus-visible { outline: 3px solid var(--cs-kupfer-hell); outline-offset: 2px; }

/* Vorzeile ueber den Modulen (keine zweite Titelzeile!) */
.chip-eyebrow {
  margin: 0 0 .55rem;
  text-align: center;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: #9fb8c4;
}
/* Aufbau des Pults: OBEN das Solo-Panel ueber die volle Breite (der
   Klasseneinstieg mit allen Einstellungen in einer Zeile), DARUNTER die
   beiden Netz-Karten je zur Haelfte. Vorher standen drei gleich schmale
   Karten nebeneinander - dabei blieb in den beiden Netz-Karten die halbe
   Flaeche leer, weil sie viel weniger Felder haben. */
.chip-lobby-grid {
  display: grid;
  /* Standard = eine Spalte (Handy). Ab 48 rem stehen die zwei Netz-Karten
     nebeneinander, das Solo-Panel bleibt oben ueber die volle Breite. */
  grid-template-columns: minmax(0, 1fr);
  gap: .8rem;
  align-items: stretch;
}
.chip-lobby-grid > .chip-card-solo { grid-column: 1 / -1; }
@media (min-width: 48rem) {
  .chip-lobby-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* Ab 62 rem stehen Lernsatz und Pflichtknoepfe in EINER Zeile (Pult-Kopf):
   links das Hinweisschild, rechts die drei Konsolentasten. Das spart die
   zweite Zeile und haelt das Pult flach. */
@media (min-width: 62rem) {
  .chip-startmenue {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: .9rem;
    align-items: center;
  }
  .chip-lernsatz { grid-column: 1; grid-row: 1; margin: 0; }
  .chip-mknoepfe { grid-column: 2; grid-row: 1; margin: 0; flex-wrap: nowrap; }
  .chip-eyebrow { grid-column: 1 / -1; grid-row: 2; margin: .7rem 0 .5rem; }
  .chip-lobby-grid { grid-column: 1 / -1; grid-row: 3; }
  .chip-linie { grid-column: 1 / -1; grid-row: 4; }
}
/* Bei knapper Fensterhoehe (Schul-Laptops, 1280x800) faellt die dekorative
   Fertigungslinie weg - das Pult soll ohne Scrollen passen. Steht NACH der
   Grundregel, sonst gewinnt wieder display:flex (Quelltext-Reihenfolge!). */

/* Modul = Arbeitskarte aus heller Pappe/Alu auf dem dunklen Pult */
.chip-card {
  position: relative;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--cs-papier-kante);
  border-radius: .8rem;
  padding: 1rem .95rem .9rem;
  background: linear-gradient(180deg, #ffffff 0%, #f1f7fa 58%, #e4eef3 100%);
  box-shadow: inset 0 1px 0 #fff, 0 8px 20px rgba(4, 12, 18, .3);
  color: var(--cs-tinte);
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
/* Kupfer-Kopfband der Arbeitskarte */
.chip-card::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 5px;
  border-radius: .8rem .8rem 0 0;
  background: linear-gradient(90deg, var(--cs-kupfer-tief) 0%, var(--cs-kupfer-hell) 46%, var(--cs-kupfer) 100%);
  opacity: .9;
}
.chip-card:hover {
  border-color: var(--cs-kupfer);
  box-shadow: inset 0 1px 0 #fff, 0 14px 30px rgba(4, 12, 18, .38);
}
/* Die Solo-Karte ist der Klasseneinstieg und deshalb hervorgehoben */
.chip-card-solo {
  border-color: var(--cs-kupfer-hell);
  box-shadow: inset 0 1px 0 #fff, 0 0 0 2px rgba(192,120,58,.5), 0 14px 30px rgba(4,12,18,.38);
}
/* Modul-Nummer als eingepraegtes Blechschild in der Ecke (01/02/03).
   Rein dekorativ: steht als aria-hidden-Span im Markup, damit sie nicht
   vorgelesen wird - die Reihenfolge erklaert schon die Kartenfolge. */
.chip-card-nr {
  position: absolute;
  top: .55rem; right: .7rem;
  font-size: .68rem;
  font-weight: 900;
  letter-spacing: .14em;
  color: #7b93a1;
  padding: .12rem .38rem;
  border-radius: .25rem;
  border: 1px solid rgba(20, 42, 55, .16);
  background: rgba(255, 255, 255, .55);
  box-shadow: inset 0 1px 0 #fff;
}
.chip-card-solo .chip-card-nr {
  color: #17512f;
  border-color: rgba(23, 81, 47, .3);
  background: rgba(139, 255, 192, .28);
}
/* Zwei Einstellungs-Spalten: Auswahlfelder stehen nebeneinander, damit die
   Solo-Karte nicht doppelt so hoch wird wie die beiden anderen. Die
   Schalter-Pills laufen darunter ueber die volle Breite. */
.chip-card-raster {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr));
  gap: .65rem .7rem;
  align-items: start;
}
.chip-card-raster .chip-schalter { grid-column: 1 / -1; }
/* Die Schalter-Pills stellen sich in die Feldzeile, sobald das Solo-Panel
   die volle Breite hat: drei Felder, daneben die beiden Schalter
   untereinander. So bleibt die Karte flach (rund 100 px statt 266 px). */
@media (min-width: 62rem) {
  .chip-card-solo .chip-card-raster { grid-template-columns: repeat(3, minmax(0, 1fr)) 1.25fr; }
  .chip-card-solo .chip-card-raster .chip-schalter {
    grid-column: 4;
    grid-row: 1;
    flex-direction: column;
    flex-wrap: nowrap;
    gap: .3rem;
    margin-top: 1.3rem;
  }
  .chip-card-solo .chip-card-raster .chip-schalter label { justify-content: flex-start; }
}
/* In der Rasterspalte steht die Bezeichnung UEBER dem Feld - nebeneinander
   (Label links, Feld rechts) waere bei 10,5 rem gequetscht. */
.chip-card-raster .chip-reihe {
  flex-direction: column;
  align-items: stretch;
  gap: .15rem;
  margin: 0;
}
.chip-card-raster .chip-reihe select {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}
.chip-card h2 {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin: 0 0 .45rem;
  font-size: 1.06rem;
  font-weight: 900;
  letter-spacing: -.01em;
  color: #142a37;
}
/* LED-Segment vor der Ueberschrift (Emoji steht im i18n-Text) */
.chip-card h2::before {
  content: "";
  flex: 0 0 auto;
  width: .55rem; height: 1.2rem;
  border-radius: 2px;
  background: linear-gradient(180deg, #9fd6e6, #5d8496 60%, #3d5c6c);
  box-shadow: 0 0 0 1px rgba(20,42,55,.35);
}
.chip-card-solo h2::before {
  background: linear-gradient(180deg, var(--cs-led), var(--cs-led-tief));
  box-shadow: 0 0 0 1px rgba(20,42,55,.35), 0 0 10px rgba(139,255,192,.6);
}
.chip-card-text {
  margin: 0 0 .8rem;
  font-size: .86rem;
  line-height: 1.5;
  color: var(--cs-tinte-2);
  padding-bottom: .65rem;
  border-bottom: 1px dashed rgba(22, 35, 44, .22);
}
/* Einstellungs-Reihe: Bezeichnung links (gravliert), Feld rechts */
.chip-reihe {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .6rem;
  margin: .45rem 0;
  font-size: .86rem;
  cursor: pointer;
}
.chip-reihe-label {
  font-weight: 800;
  font-size: .7rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #5b7a89;
}
.chip-reihe select {
  min-height: 40px;
  padding: .3rem .5rem;
  border-radius: .4rem;
  flex: 0 1 auto;
  min-width: 7.5rem;
  max-width: 55%;
  color: var(--cs-tinte);
  background: #fff;
  border: 1px solid var(--cs-papier-kante);
  box-shadow: inset 0 1px 3px rgba(16, 34, 46, .12);
  font-size: .9rem;
}
.chip-reihe select:focus-visible { outline: 3px solid var(--cs-kupfer); outline-offset: 1px; }
/* Beschriftung ueber dem Feld (mehrzeilige Eingaben) */
.chip-block-label { display: block; margin: .5rem 0; font-size: .84rem; color: var(--cs-tinte); }
.chip-block-label > span {
  display: block;
  margin-bottom: .25rem;
  font-weight: 800;
  font-size: .7rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #5b7a89;
}
/* Kontrollkaestchen als Schalterplatte mit LED */
.chip-schalter { display: flex; flex-wrap: wrap; gap: .4rem; margin: .55rem 0; }
.chip-schalter label {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  min-height: 40px;
  padding: .3rem .75rem .3rem .5rem;
  border: 1px solid var(--cs-papier-kante);
  border-radius: .4rem;
  background: linear-gradient(180deg, #fbfdfe, #eef5f8);
  font-size: .82rem;
  color: var(--cs-tinte);
  cursor: pointer;
  box-shadow: inset 0 1px 0 #fff;
}
.chip-schalter label:hover { border-color: var(--cs-kupfer); }
.chip-schalter input {
  width: 18px; height: 18px;
  accent-color: var(--cs-gruen);
}
.chip-card input[type="text"], .chip-card input:not([type]), #solo-name, #host-name, #gast-name {
  padding: .35rem .45rem;
  border-radius: .4rem;
  font-size: .92rem;
  color: var(--cs-tinte);
  background: #fff;
  border: 1px solid var(--cs-papier-kante);
}
.chip-card textarea {
  width: 100%;
  font-size: .72rem;
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  border-radius: .4rem;
  border: 1px solid var(--cs-papier-kante);
  padding: .45rem .5rem;
  color: var(--cs-tinte);
  background: #fff;
  resize: vertical;
}
.chip-card textarea:focus-visible,
.chip-card select:focus-visible { outline: 3px solid var(--cs-kupfer); outline-offset: 1px; }
/* Bedienziele (GUI 3.13.5.3): Selects im Lobby-Formular auf 40 px */
.chip-card select { min-height: 40px; }
/* Spielernamen-Select (vorgegebene Namen, Datenschutz) */
.chip-name { min-width: 9rem; }
/* Startknopf: Konsolentaste, volle Breite, immer am Kartenfuss */
.chip-go {
  width: 100%;
  min-height: 48px;
  margin-top: auto;
  font-weight: 900;
  letter-spacing: .01em;
  border-radius: .45rem !important;
  color: #fff !important;
  border: 1px solid #14512f !important;
  background: linear-gradient(180deg, #6fd096 0%, #2f8f58 54%, #1f6b41 100%) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.45), 0 5px 14px rgba(10, 46, 28, .38) !important;
  text-shadow: 0 1px 2px rgba(6, 30, 18, .5);
}
.chip-go:hover {
  background: linear-gradient(180deg, #86e0aa 0%, #35a165 54%, #237a4a 100%) !important;
  transform: translateY(-1px);
}
.chip-go:active { transform: translateY(0); }
.chip-schritte { margin: .5rem 0; padding-left: 1.2rem; font-size: .85rem; color: var(--cs-tinte-2); }
.chip-card h3 {
  margin: .85rem 0 .3rem;
  font-size: .9rem;
  color: #142a37;
  text-transform: uppercase;
  letter-spacing: .05em;
}
#qr-raus {
  display: block;
  margin: .45rem 0;
  background: #fff;
  padding: .3rem;
  border-radius: .35rem;
  border: 1px solid var(--cs-papier-kante);
}
/* Sekundaere Knoepfe in den Karten: Stahltaste, volle Breite (die
   Schaltflaechen im Host-Bereich standen sonst als schmaler Balken mit
   abgeschnittenem Text da) */
.chip-card .jupi_btn_alt {
  width: 100%;
  color: #16232c;
  background: linear-gradient(180deg, #eaf2f6 0%, #c6d6df 52%, #a3b7c2 100%);
  border: 1px solid #7d929e;
  box-shadow: inset 0 1px 0 #fff, 0 2px 6px rgba(10,24,32,.22);
  font-weight: 800;
}
.chip-card .jupi_btn_alt:hover { background: linear-gradient(180deg, #f6fafc 0%, #d3e1e8 52%, #b0c3cd 100%); }
/* Im Dunkeln setzt die Plattform .jupi_btn_alt auf #424242 - auf der HELLEN
   Arbeitskarte waere das dunkelgrau auf dunkler Schrift (1,4:1). Die Karte
   gewinnt nur mit gleicher Spezifitaet, deshalb steht die Regel hier mit
   html[data-theme] davor. */
html[data-theme="dark"] .chip-card .jupi_btn_alt {
  color: #16232c;
  background: linear-gradient(180deg, #e6eef3 0%, #c2d3dd 52%, #9fb3be 100%);
  border-color: #748893;
}
html[data-theme="dark"] .chip-card .jupi_btn_alt:hover {
  background: linear-gradient(180deg, #f2f7fa 0%, #d0dfe7 52%, #adc0ca 100%);
}

/* Dekorative Fertigungslinie am Pult-Fuss: fuenf Stationen, dazwischen
   Foerderband. Reines CSS, kein Text, aria-hidden im Markup. Sie nimmt am
   Handy weniger Platz ein und verschwindet unter 420 px ganz (dort ist das
   Pult ohnehin schon voll). */
.chip-linie {
  display: flex;
  align-items: center;
  gap: .35rem;
  margin: 1.05rem .1rem 0;
  padding: .55rem .6rem;
  border-radius: .55rem;
  background: linear-gradient(180deg, rgba(0,0,0,.34), rgba(0,0,0,.12));
  border: 1px solid rgba(234, 178, 124, .22);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
}
/* Jede Station: ein Blechkasten mit Leuchtkante */
.chip-linie span {
  flex: 1 1 0;
  height: 14px;
  border-radius: 3px;
  border: 1px solid rgba(234, 178, 124, .45);
  background:
    linear-gradient(180deg, rgba(139,255,192,.55) 0 2px, rgba(139,255,192,0) 2px),
    linear-gradient(180deg, #2b3f4d 0%, #16242e 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12);
}
/* Das Band zwischen den Stationen: duenne Kupferbahn mit Laufmarken */
.chip-linie span + span {
  position: relative;
  margin-left: .55rem;
}
.chip-linie span + span::before {
  content: "";
  position: absolute;
  right: 100%;
  top: 50%;
  width: .55rem;
  height: 3px;
  margin-top: -1.5px;
  background: repeating-linear-gradient(90deg,
    var(--cs-kupfer) 0 3px, rgba(192,120,58,.25) 3px 5px);
}
/* Eigenstaendiges Element waere hier ein Leerzeichen-Span - die Linie besteht
   deshalb nur aus Stationen, die Abstaende macht gap. */
/* Bei knapper Fensterhoehe (Schul-Laptops 1280x800, 1024x768) faellt die
   dekorative Fertigungslinie weg, damit das Pult ohne Scrollen passt. Diese
   Regel steht bewusst NACH der Grundregel - sonst gewinnt wieder display:flex. */
@media (max-height: 1000px) {
  .chip-linie { display: none; }
}
/* Zusaetzlich wird das Pult bei niedrigen Fenstern kompakter (Polster,
   Abstaende, Textgroesse). Gemessen: 1024x768 braucht rund 170 px weniger. */
@media (max-height: 860px) {
  .chip-startmenue { padding: .75rem .85rem .8rem; }
  .chip-lernsatz { padding: .38rem .7rem; font-size: .88rem; margin: .4rem 0 .45rem; }
  .chip-mknoepfe { margin: 0 0 .5rem; gap: .4rem; }
  .chip-mknopf { min-height: 40px; padding: .35rem .9rem .35rem 1.45rem; font-size: .87rem; }
  .chip-eyebrow { margin: 0 0 .4rem; font-size: .66rem; }
  .chip-lobby-grid { gap: .6rem; }
  .chip-card { padding: .75rem .8rem .7rem; }
  .chip-card h2 { font-size: 1rem; margin-bottom: .3rem; }
  .chip-card-text { font-size: .82rem; margin-bottom: .55rem; padding-bottom: .45rem; }
  .chip-go { min-height: 44px; }
  .chip-card-raster { gap: .45rem .6rem; }
}
/* Handy: Zeilen stapeln, Knoepfe volle Breite */
@media (max-width: 640px) {
  .chip-reihe { flex-direction: column; align-items: stretch; gap: .25rem; }
  .chip-reihe select { max-width: 100%; width: 100%; }
  .chip-schalter label { flex: 1 1 100%; }
  .chip-mknoepfe .chip-mknopf { flex: 1 1 100%; }
}

/* ---------- 3. Buehne: dunkle Fabrikhalle + HUD ----------
   Muster Neumark 1400 / Stadt im Wandel: waehrend des Spiels ist die Seite
   eine Vollbild-Buehne. Body traegt "chip-aktiv" (game.js). */
body.chip-aktiv {
  height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
body.chip-aktiv .chip-main {
  flex: 1 1 auto;
  min-height: 0;
  max-width: none;
  width: 100%;
  /* WICHTIG: "margin: 0 auto" waere im Flex-Column ein Querachs-Auto-Margin
     und schrumpfte das Main auf 0 Breite. */
  margin: 0;
  padding: 0;
  position: relative;
}
.chip-buehne {
  position: relative;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  background-color: #0b1319;
  background-image:
    radial-gradient(120% 90% at 50% 0%, #1b2c37 0%, #0a1116 68%),
    repeating-linear-gradient(0deg, rgba(255,255,255,.02) 0 1px, rgba(255,255,255,0) 1px 5px);
  border-top: 1px solid rgba(234, 178, 124, .35);
}
body.chip-aktiv .chip-buehne { position: absolute; inset: 0; height: auto; }
body.chip-aktiv .chip-leiste { position: static; flex: 0 0 auto; }
body.chip-aktiv .chip-footer { display: none; }
body.chip-aktiv .chip-startmenue { display: none; }
/* Panel der Spielseite */
.chip-panel { background: var(--cs-papier); border-radius: .8rem; padding: 1rem; box-shadow: var(--cs-schatten); }
.chip-hilfe-liste { margin: .2rem 0 .6rem; padding-left: 1.2rem; text-align: left; }
.chip-hilfe-liste li { margin: .45rem 0; line-height: 1.55; font-size: .92rem; }

/* Infoleiste (Muster nm_topbar): schwebende Konsole ueber der Buehne */
.chip-infoleiste {
  position: absolute;
  top: .55rem; left: .55rem; right: .55rem;
  z-index: 8;
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
  padding: .42rem .6rem;
  border-radius: .7rem;
  border: 1px solid rgba(234, 178, 124, .42);
  border-top: 2px solid var(--cs-kupfer);
  background-color: rgba(16, 26, 34, .92);
  background-image: linear-gradient(180deg, rgba(45, 66, 80, .55), rgba(10, 18, 24, .9));
  box-shadow: 0 10px 26px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255,255,255,.10);
  color: #e6f1f5;
  font-size: .88rem;
}
.chip-infoleiste-werkzeuge { margin-left: auto; display: flex; gap: .4rem; }
.chip-rolle {
  font-weight: 900;
  padding: .26rem .7rem;
  border-radius: .35rem;
  background: linear-gradient(180deg, #cfdbe2, #9fb3be);
  color: #16232c;
  white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.6);
}
.chip-rolle.gut {
  background: linear-gradient(180deg, #9fe9bd, #2f8f58);
  color: #06281a;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.5), 0 0 12px rgba(139,255,192,.35);
}
.chip-rolle.boese {
  background: linear-gradient(180deg, #f0a19a, #b3261e);
  color: #2b0705;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.45), 0 0 12px rgba(224,90,79,.4);
}
/* Ortsanzeige: in welchem Raum stehe ich? */
.chip-ort {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .24rem .65rem;
  border-radius: .35rem;
  /* Deckend, nicht halbtransparent: halbtransparente Flaechen vermasseln
     jede Kontrastmessung (Lehre aus maschinenbau/AGENTS.md). */
  background: #14382b;
  border: 1px solid rgba(139, 255, 192, .45);
  color: #dcf7e8;
  font-weight: 700;
  white-space: nowrap;
}
/* Crew-Punkte */
.chip-crew { display: inline-flex; align-items: center; gap: .22rem; }
.chip-crew i {
  display: inline-block;
  width: .72rem; height: .72rem;
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,.6);
  box-shadow: 0 0 5px rgba(0,0,0,.5);
}
.chip-crew i.tot { opacity: .26; filter: grayscale(1); }
.chip-crew i.zelle { opacity: .5; }
/* Produktionsbalken = LED-Band im Kupferrahmen */
.chip-balken {
  flex: 0 1 220px;
  height: .8rem;
  min-width: 90px;
  border-radius: .22rem;
  background: #07121a;
  border: 1px solid rgba(234, 178, 124, .4);
  overflow: hidden;
  box-shadow: inset 0 2px 5px rgba(0,0,0,.7);
}
#chip-taskbalken {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #2f8f58, #8bffc0);
  box-shadow: 0 0 10px rgba(139,255,192,.55);
  transition: width .4s;
}
#chip-tasktext { font-weight: 800; font-size: .86rem; white-space: nowrap; color: #dcecf3; }
/* Sabotage-Warnung als schwebendes Schild */
.chip-warn {
  position: absolute;
  top: 4.4rem; left: 50%;
  transform: translateX(-50%);
  z-index: 7;
  background: linear-gradient(180deg, #3a1414, #240b0b);
  border: 2px solid var(--cs-rot-hell);
  border-radius: .5rem;
  padding: .45rem .9rem;
  font-size: .95rem;
  font-weight: 800;
  color: #ffd9d4;
  box-shadow: 0 10px 24px rgba(0,0,0,.5), 0 0 18px rgba(224,90,79,.3);
}
.chip-warn[hidden] { display: none; }

/* Spielfeld: fuellt die Buehne, Canvas liegt darunter */
.chip-canvasbox { position: absolute; inset: 0; overflow: hidden; }
#chip-canvas {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  display: block;
  cursor: pointer;
  touch-action: manipulation;
}
/* Taskliste oben links (auf-/zuklappbar) */
.chip-taskpanel { position: absolute; top: 4.3rem; left: .55rem; max-width: 44%; z-index: 5; }
.chip-tasktoggle {
  min-height: 40px;
  background: linear-gradient(180deg, #2b3f4d, #14212a);
  color: #eaf3f7;
  border: 1px solid rgba(234, 178, 124, .5);
  border-radius: .42rem;
  padding: .3rem .8rem;
  font-size: .82rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.16), 0 4px 12px rgba(0,0,0,.4);
}
.chip-tasktoggle:hover { background: linear-gradient(180deg, #3a5464, #1a2a34); }
.chip-taskliste {
  margin-top: .35rem;
  background: rgba(12, 21, 28, .92);
  border: 1px solid rgba(234, 178, 124, .32);
  border-radius: .42rem;
  padding: .4rem .55rem;
  font-size: .8rem;
  color: #e6f1f5;
  box-shadow: 0 8px 20px rgba(0,0,0,.45);
}
.tasklisten-eintrag { padding: .1rem 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tasklisten-eintrag.fertig { color: #8bffc0; text-decoration: line-through; }

/* Minikarte der Fabrik (Muster nm_minikarte) */
.chip-mini {
  position: absolute;
  left: .55rem; bottom: .55rem;
  z-index: 6;
  padding: .26rem;
  border-radius: .5rem;
  line-height: 0;
  background: rgba(12, 21, 28, .92);
  border: 1px solid rgba(234, 178, 124, .42);
  box-shadow: 0 8px 22px rgba(0, 0, 0, .5), inset 0 0 0 1px rgba(255,255,255,.05);
}
.chip-mini canvas { display: block; width: 200px; height: 140px; border-radius: .3rem; }

/* Aktionsleiste: Konsole unten ueber dem Spielfeld */
.chip-aktionsleiste {
  position: absolute;
  left: 50%; bottom: .55rem;
  transform: translateX(-50%);
  z-index: 7;
  display: flex;
  align-items: center;
  gap: .35rem;
  padding: .38rem .55rem;
  border-radius: .6rem;
  border: 1px solid rgba(234, 178, 124, .42);
  border-top: 2px solid var(--cs-kupfer);
  background-color: rgba(14, 24, 32, .93);
  background-image: linear-gradient(180deg, rgba(44, 64, 78, .5), rgba(9, 16, 22, .92));
  box-shadow: 0 10px 26px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.10);
  max-width: calc(100% - 1.1rem);
  flex-wrap: wrap;
  justify-content: center;
}
.chip-aktion-gruppe { display: flex; align-items: center; gap: .35rem; }
.chip-aktion-gruppe + .chip-aktion-gruppe {
  border-left: 1px solid rgba(234, 178, 124, .28);
  padding-left: .45rem;
}
.chip-aktionsleiste button[hidden] { display: none; }
/* Knoepfe auf der dunklen Konsole: Stahltasten statt greller Plattformfarbe */
.chip-aktionsleiste .jupi_btn,
.chip-aktionsleiste .jupi_btn_alt {
  color: #eaf3f7;
  border-color: rgba(255,255,255,.28);
  background: linear-gradient(180deg, rgba(255,255,255,.14), rgba(0,0,0,.24));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.2);
  font-weight: 800;
}
.chip-aktionsleiste .jupi_btn {
  background: linear-gradient(180deg, #6fd096 0%, #2f8f58 54%, #1f6b41 100%);
  border-color: #1f6b41;
  color: #fff;
}
.chip-aktionsleiste .jupi_btn.alarm,
.chip-aktionsleiste .jupi_btn.alarm:hover {
  background: linear-gradient(180deg, #f0837a 0%, #b3261e 56%, #7d150f 100%);
  border-color: #7d150f;
}
.chip-aktionsleiste .jupi_btn:hover,
.chip-aktionsleiste .jupi_btn_alt:hover { filter: brightness(1.16); }
/* Bedienziele (GUI 3.13.5.3): Spielknoepfe mindestens 40 px hoch */
.chip-infoleiste button, .chip-aktionsleiste button, .chip-dialog button,
#chip-lobby button { min-height: 40px; }

/* Anprobe */
.chip-look-zeile { display: flex; gap: .8rem; flex-wrap: wrap; justify-content: center; margin: .6rem 0; }
.chip-look-zeile label { font-size: .9rem; font-weight: 700; color: inherit; }
.chip-look-zeile select { min-height: 40px; padding: .3rem .5rem; border-radius: .4rem; }
#look-preview {
  background: #101a22;
  border-radius: .55rem;
  margin: .4rem auto;
  display: block;
  box-shadow: inset 0 0 0 1px rgba(234,178,124,.4), 0 4px 12px rgba(0,0,0,.3);
}
.jupi_btn.alarm { background: linear-gradient(180deg, #f0837a, #b3261e); }
.jupi_btn.alarm:hover { background: linear-gradient(180deg, #f79b93, #c9332a); }
.chip-logs { list-style: none; padding: 0; margin: .3rem 0; font-size: .88rem; }
.chip-logs li { padding: .25rem .4rem; border-bottom: 1px solid rgba(22,35,44,.14); color: var(--cs-tinte); }
.chip-logs li.fertig { color: #1f6b41; }

/* Lobby-Bar: Hinweisschild ueber der Buehne (Countdown, Spielerliste) */
.chip-lobbybar {
  position: absolute;
  top: 4.3rem; left: 50%;
  transform: translateX(-50%);
  z-index: 7;
  width: min(560px, calc(100% - 1.1rem));
  background: linear-gradient(180deg, #fff6e2, #f0e2c4);
  border: 2px solid var(--cs-kupfer);
  border-radius: .55rem;
  padding: .6rem .85rem;
  color: #2a1d08;
  box-shadow: 0 12px 28px rgba(0,0,0,.5);
}
.chip-lobbybar[hidden] { display: none; }
.chip-lobby-zeile { display: flex; gap: .8rem; align-items: center; flex-wrap: wrap; margin: .25rem 0; }
.chip-lobby-zeile label { font-size: .88rem; font-weight: 700; }
.chip-lobby-zeile select { min-height: 40px; padding: .25rem .5rem; border-radius: .4rem; }
#lobby-spielerliste { display: flex; flex-wrap: wrap; gap: .2rem 1rem; margin: .3rem 0 0; }
.chip-lobbybar .task-hinweis { color: #4a3a1c; }
.chip-lobbybar li { color: #2a1d08; border-bottom-color: rgba(42,29,8,.18); }
/* Countdown gross uebers Bild */
.chip-countdown {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 6rem;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 0 26px rgba(139,255,192,.55), 0 3px 6px #000;
  pointer-events: none;
  z-index: 6;
  font-variant-numeric: tabular-nums;
}
.chip-countdown[hidden] { display: none; }

/* Toast */
.chip-toast {
  position: fixed;
  left: 50%; bottom: 1.2rem;
  transform: translateX(-50%) translateY(20px);
  background: linear-gradient(180deg, #2b3f4d, #101b23);
  color: #eaf3f7;
  padding: .6rem 1.1rem;
  border-radius: .45rem;
  border: 1px solid rgba(234,178,124,.5);
  box-shadow: 0 10px 26px rgba(0,0,0,.5);
  opacity: 0;
  transition: all .25s;
  z-index: 60;
  max-width: 90vw;
  font-size: .92rem;
}
.chip-toast.an { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 4. Seitenleiste rechts: Spieler + meine Tasks ---------- */
.chip-seite {
  position: absolute;
  top: 4.3rem; right: .55rem; bottom: .55rem;
  z-index: 7;
  width: 252px;
  max-width: 46vw;
  overflow: auto;
  padding: .75rem .85rem;
  border-radius: .6rem;
  border: 1px solid rgba(234, 178, 124, .42);
  border-top: 2px solid var(--cs-kupfer);
  background-color: rgba(13, 22, 29, .94);
  background-image: linear-gradient(180deg, rgba(42, 61, 75, .45), rgba(9, 16, 22, .94));
  box-shadow: 0 10px 26px rgba(0,0,0,.55);
  color: #e6f1f5;
}
.chip-seite[hidden] { display: none; }
.chip-seite h3 {
  margin: .2rem 0 .45rem;
  font-size: .72rem;
  color: #a9c3cf;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.chip-spielerliste { list-style: none; padding: 0; margin: .2rem 0 .9rem; font-size: .86rem; }
.chip-spielerliste li {
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: .25rem .1rem;
  border-bottom: 1px solid rgba(255,255,255,.09);
}
.chip-spielerliste li.tot { opacity: .45; }
.chip-spielerliste li.zelle { color: #ffb4ad; }
.chip-spielerliste li .chip-ich { margin-left: auto; font-size: .72rem; opacity: .85; }
/* Die Seitenleiste ist in BEIDEN Themen dunkel - Texte fest auf Hell. */
.chip-seite .chip-logs li { color: #e6f1f5; border-bottom-color: rgba(255,255,255,.12); }
.chip-seite .chip-logs li.fertig { color: #8bffc0; }
.chip-seite .task-hinweis { color: #a9c3cf; }
.chip-knopfbox { display: flex; flex-direction: column; gap: .4rem; margin-top: .6rem; }

/* ---------- 5. Task-Minispiele (Papiere auf der Konsole) ---------- */
.chip-modal {
  position: fixed;
  inset: 0;
  background: rgba(5, 11, 16, .68);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 1rem;
}
.chip-modal[hidden] { display: none; }
.chip-dialog {
  position: relative;
  background: linear-gradient(180deg, #ffffff 0%, #f2f8fb 62%, #e6eff4 100%);
  color: var(--cs-tinte);
  border-radius: .7rem;
  border: 1px solid var(--cs-papier-kante);
  border-top: 6px solid var(--cs-kupfer);
  padding: 1.2rem;
  max-width: 560px;
  width: 100%;
  max-height: 88vh;
  overflow: auto;
  text-align: center;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .55), inset 0 1px 0 #fff;
}
.chip-dialog.gross { max-width: 660px; }
.chip-dialog h2 {
  margin: .1rem 0 .6rem;
  font-size: 1.2rem;
  font-weight: 900;
  color: #142a37;
}
.chip-dialog .jupi_btn {
  margin-top: .5rem;
  color: #fff;
  border: 1px solid #1f6b41;
  background: linear-gradient(180deg, #6fd096 0%, #2f8f58 54%, #1f6b41 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.4), 0 4px 12px rgba(10,46,28,.3);
  font-weight: 800;
}
.chip-dialog .jupi_btn_alt {
  color: #16232c;
  background: linear-gradient(180deg, #eaf2f6 0%, #c6d6df 52%, #a3b7c2 100%);
  border: 1px solid #7d929e;
  box-shadow: inset 0 1px 0 #fff;
  font-weight: 800;
}
.task-box { margin: .8rem 0; }
/* Kontrast: keine hellgrauen Texte auf Weiss */
.task-kurz { color: #33474f; font-size: .92rem; }
.task-hinweis { color: #4a5f6a; font-size: .82rem; }
.chip-logs li { color: var(--cs-tinte); }
.task-ok { font-size: 1.2rem; font-weight: 900; color: #1f6b41; }
.task-btn { margin: .2rem; }
.task-btn:disabled { opacity: .45; }

/* Task: Chips */
.task-chips { display: grid; grid-template-columns: repeat(4, 1fr); gap: .4rem; margin: .6rem 0; }
.task-chip {
  font-size: 1.8rem;
  padding: .4rem;
  border-radius: .45rem;
  border: 2px solid #9fbccd;
  background: linear-gradient(180deg, #f2f9fc, #dceaf1);
  color: #1d3a48;
  cursor: pointer;
}
.task-chip.gut { background: #cdeedd; border-color: #2f8f58; color: #14512f; }
.task-chip.falsch { background: #ffd9d4; border-color: var(--cs-rot-hell); }

/* Task: Widerstaende */
.task-boxen { display: flex; gap: .5rem; justify-content: center; margin: .6rem 0; }
.task-kiste {
  min-height: 40px;
  padding: .5rem .8rem;
  border-radius: .45rem;
  border: 2px dashed #7f99a6;
  background: #fff;
  cursor: pointer;
  font-size: 1rem;
  color: var(--cs-tinte);
}
.task-kiste.falsch { border-color: var(--cs-rot-hell); background: #ffeeea; }
.task-ringe i {
  display: inline-block;
  width: 1rem; height: 1rem;
  border-radius: 50%;
  margin: 0 .1rem;
  border: 1px solid rgba(0,0,0,.3);
}
.task-wider { display: flex; gap: .4rem; flex-wrap: wrap; justify-content: center; margin: .6rem 0; }
.task-wst {
  min-height: 40px;
  min-width: 40px;
  padding: .4rem .6rem;
  border-radius: .45rem;
  border: 2px solid #8fa3ae;
  background: linear-gradient(180deg, #45595f, #2b3c44);
  cursor: pointer;
}
.task-wst.aktiv { border-color: var(--cs-amber); box-shadow: 0 0 0 2px var(--cs-amber); }

/* Task: Band / PC */
.task-band { display: flex; gap: .4rem; flex-wrap: wrap; justify-content: center; margin: .6rem 0; }

/* Task: Kabel */
.task-wires { display: flex; justify-content: space-around; margin: .6rem 0; }
.task-draht-col { display: flex; flex-direction: column; gap: .4rem; }
.task-draht {
  min-height: 40px;
  font-size: 1.2rem;
  padding: .3rem .8rem;
  border-radius: .4rem;
  border: 2px solid #8fa3ae;
  background: #fff;
  color: var(--cs-tinte);
  cursor: pointer;
}
.task-draht.aktiv { border-color: var(--cs-amber); box-shadow: 0 0 0 2px var(--cs-amber); }
.task-draht.gut { background: #cdeedd; border-color: #2f8f58; }
.task-draht.falsch { border-color: var(--cs-rot-hell); }

/* ---------- 6. Meeting: Spieler-Karten im Raster ---------- */
#meet-box { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: .45rem; margin: .8rem 0; }
.meet-zeile {
  display: flex;
  align-items: center;
  gap: .45rem;
  padding: .5rem .6rem;
  border-radius: .45rem;
  border: 1px solid var(--cs-papier-kante);
  background: #fff;
  font-size: .92rem;
  text-align: left;
}
.meet-zeile.tot { opacity: .5; }
.meet-zeile .meet-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meet-zeile button { margin-left: auto; flex: 0 0 auto; }
/* Wahl-Knopf auf der Karte: Stahltaste mit Kupferring */
.meet-zeile button {
  border-radius: .4rem;
  padding: .25rem .8rem;
  font-weight: 800;
  border: 1px solid #7d929e;
  background: linear-gradient(180deg, #eaf2f6, #c6d6df);
  color: #142a37;
}
.meet-zeile button:hover {
  background: linear-gradient(180deg, #86e0aa, #2f8f58);
  color: #fff;
  border-color: #1f6b41;
}
#meet-box > button, #meet-box > p { grid-column: 1 / -1; }
#meet-box > button { justify-self: center; }
.punkt {
  display: inline-block;
  width: .8rem; height: .8rem;
  border-radius: 50%;
  border: 1px solid rgba(0,0,0,.4);
  margin-right: .3rem;
  flex: 0 0 auto;
}

/* ---------- 7. Fenster-Innenleben (Hilfe, Ueber, Rolle, Ende) ---------- */
.chip-dialog .chip-lernsatz {
  background: linear-gradient(90deg, rgba(192,120,58,.14), rgba(192,120,58,.02));
  border-left: 4px solid var(--cs-kupfer);
  color: var(--cs-tinte);
  text-align: left;
}
.chip-dialog .chip-lernsatz b { color: #8a5426; }
.chip-dialog .chip-lernsatz-zusatz { background: transparent; border-left-color: var(--cs-papier-kante); }
.chip-dialog .chip-logs li { color: var(--cs-tinte); }

/* ---------- 8. Fuss: Konsolen-Abschluss ---------- */
.chip-footer {
  flex: 0 0 auto;
  margin: 0;
  padding: .85rem 1rem .95rem;
  width: 100%;
  border-top: 3px solid var(--cs-kupfer);
  background-color: #16232c;
  background-image: linear-gradient(180deg, #263845 0%, #111b22 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
}
.chip-footer .jupi_footer_text { color: #c6d8e2; }
.chip-footer .jupi_footer_text a { color: var(--cs-kupfer-hell); font-weight: 700; }
.chip-footer .jupi_footer_text a:hover { color: #ffd9a0; }

/* ---------- 9. Dark Mode: dieselbe Fabrik in der Nachtschicht ----------
   WICHTIG: alle vier Hintergrundwerte wiederholen, sonst loescht die
   Plattform-Kurzform html[data-theme="dark"] body.jupi { background: ... }
   cover/no-repeat/fixed. */
html[data-theme="dark"] body.jupi.cs_body {
  background-color: #070d12;
  background-image:
    radial-gradient(58% 42% at 16% 6%, rgba(255, 196, 122, .10), rgba(255, 196, 122, 0) 62%),
    radial-gradient(46% 34% at 84% 12%, rgba(139, 255, 192, .08), rgba(139, 255, 192, 0) 60%),
    linear-gradient(rgba(5, 10, 15, .78), rgba(5, 10, 15, .90)),
    url("kulisse.svg");
  background-size: cover, cover, cover, cover;
  background-repeat: no-repeat, no-repeat, no-repeat, no-repeat;
  background-position: center top, center top, center top, center top;
  background-attachment: fixed, fixed, fixed, fixed;
  color: #dbe8ef;
}
/* Leiste: Nachtschicht-Konsole (dunkler Stahl, Kupferkante bleibt) */
html[data-theme="dark"] .chip-leiste {
  color: #dbe8ef;
  background-color: #18242d;
  background-image:
    repeating-linear-gradient(90deg, rgba(255,255,255,.05) 0 1px, rgba(255,255,255,0) 1px 3px),
    linear-gradient(180deg, #2a3b47 0%, #1a2731 46%, #0f171d 100%);
  border-bottom-color: var(--cs-kupfer);
  box-shadow: 0 6px 22px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(255,255,255,.10);
}
html[data-theme="dark"] .chip-titel { color: #f0f7fa; text-shadow: 0 1px 0 rgba(0,0,0,.6); }
html[data-theme="dark"] .chip-leiste .jupi_sprachen_icon { color: #dbe8ef; }
html[data-theme="dark"] .chip-zurueck { color: #eaf3f7; }
html[data-theme="dark"] .chip-vermerk { background: linear-gradient(180deg, #ffdf9a, #d9a33c); color: #2f1f05; }
/* Startmenue im Dunkeln: Pult bleibt Pult, nur das Licht wird waermer */
html[data-theme="dark"] .chip-startmenue {
  background-image:
    repeating-linear-gradient(0deg, rgba(255,255,255,.018) 0 1px, rgba(255,255,255,0) 1px 4px),
    radial-gradient(120% 62% at 50% -14%, rgba(139,255,192,.10), rgba(139,255,192,0) 62%),
    linear-gradient(180deg, #1d2c37 0%, #131d25 52%, #0b1319 100%);
  border-color: rgba(234, 178, 124, .30);
  box-shadow: 0 20px 46px rgba(0, 0, 0, .65), inset 0 1px 0 rgba(255,255,255,.07);
}
html[data-theme="dark"] .chip-lernsatz { color: #e7f0f4; }
html[data-theme="dark"] .chip-lernsatz b { color: var(--cs-amber); }
html[data-theme="dark"] .chip-eyebrow { color: #8aa6b4; }
/* Arbeitskarten bleiben Papiere - nur eine Spur gedaempft, damit sie nicht blenden */
html[data-theme="dark"] .chip-card {
  background: linear-gradient(180deg, #eef4f7 0%, #dde8ee 60%, #cfdde5 100%);
  border-color: #7f939f;
  color: #16232c;
}
html[data-theme="dark"] .chip-card h2 { color: #142a37; }
html[data-theme="dark"] .chip-card-text { color: #3d5462; border-bottom-color: rgba(22,35,44,.24); }
html[data-theme="dark"] .chip-reihe-label,
html[data-theme="dark"] .chip-block-label > span { color: #4d6f80; }
html[data-theme="dark"] .chip-schalter label {
  background: linear-gradient(180deg, #f7fbfd, #e3edf2);
  border-color: #9fb3be;
  color: #16232c;
}
/* Die Formularfelder der hellen Karten bleiben hell (Lesbarkeit) */
html[data-theme="dark"] .chip-card input,
html[data-theme="dark"] .chip-card textarea,
html[data-theme="dark"] .chip-card select,
html[data-theme="dark"] #solo-name,
html[data-theme="dark"] #host-name,
html[data-theme="dark"] #gast-name {
  background: #fff;
  color: #16232c;
  border-color: #9fb3be;
}
html[data-theme="dark"] .chip-card .jupi_btn_alt { color: #16232c; }
html[data-theme="dark"] .chip-card h3 { color: #142a37; }
html[data-theme="dark"] .chip-schritte { color: #3d5462; }
/* Fenster im Dunkeln: dunkles Geraeteglas mit Kupferkante */
html[data-theme="dark"] .chip-dialog {
  background: linear-gradient(180deg, #1b2a35 0%, #14202a 60%, #0d161d 100%);
  color: #e2edf3;
  border-color: rgba(234,178,124,.4);
  border-top-color: var(--cs-kupfer);
  box-shadow: 0 24px 60px rgba(0,0,0,.7), inset 0 1px 0 rgba(255,255,255,.08);
}
html[data-theme="dark"] .chip-dialog h2 { color: #f0d9b6; }
html[data-theme="dark"] .task-kurz { color: #c3d4dd; }
html[data-theme="dark"] .task-hinweis { color: #a9c3cf; }
html[data-theme="dark"] .task-ok { color: #8bffc0; }
html[data-theme="dark"] .chip-dialog .jupi_btn_alt { color: #16232c; }
html[data-theme="dark"] .chip-logs li { color: #e2edf3; border-bottom-color: #33474f; }
html[data-theme="dark"] .chip-logs li.fertig { color: #8bffc0; }
html[data-theme="dark"] .task-chip { background: linear-gradient(180deg, #25323b, #16222b); border-color: #4a6470; color: #dbe8ef; }
html[data-theme="dark"] .task-chip.gut { background: #1f6b41; border-color: #63c98a; color: #d8f4e6; }
html[data-theme="dark"] .task-chip.falsch { background: #5c1a1a; border-color: var(--cs-rot-hell); }
html[data-theme="dark"] .task-kiste { background: #1b2832; color: #e2edf3; border-color: #6d828f; }
html[data-theme="dark"] .task-kiste.falsch { background: #5c1a1a; border-color: var(--cs-rot-hell); }
html[data-theme="dark"] .task-wst { background: #25323b; border-color: #4a6470; }
html[data-theme="dark"] .task-draht { background: #1b2832; color: #e2edf3; border-color: #4a6470; }
html[data-theme="dark"] .task-draht.gut { background: #1f6b41; border-color: #63c98a; }
html[data-theme="dark"] .task-draht.falsch { border-color: var(--cs-rot-hell); }
html[data-theme="dark"] .meet-zeile { border-color: #3a4f5c; background: #1b2832; color: #e2edf3; }
html[data-theme="dark"] .meet-zeile button {
  background: linear-gradient(180deg, #33474f, #1c2a33);
  color: #dbe8ef;
  border-color: #4a6470;
}
html[data-theme="dark"] .meet-zeile button:hover {
  background: linear-gradient(180deg, #63c98a, #2f8f58);
  color: #06281a;
  border-color: #63c98a;
}
html[data-theme="dark"] .chip-dialog .chip-lernsatz { color: #e2edf3; }
html[data-theme="dark"] .chip-dialog .chip-lernsatz b { color: var(--cs-kupfer-hell); }
html[data-theme="dark"] .chip-dialog .chip-lernsatz-zusatz { border-left-color: #3a4f5c; }
html[data-theme="dark"] .chip-look-zeile label { color: #e2edf3; }
html[data-theme="dark"] .chip-dialog input,
html[data-theme="dark"] .chip-dialog textarea,
html[data-theme="dark"] .chip-dialog select {
  background: #101a22;
  color: #e2edf3;
  border-color: #3a4f5c;
}
html[data-theme="dark"] .chip-countdown { color: #fff; }
html[data-theme="dark"] .chip-infoleiste { background-color: rgba(8, 14, 19, .94); }
html[data-theme="dark"] .chip-rolle { background: linear-gradient(180deg, #3d5462, #24333d); color: #dfeaf0; }
html[data-theme="dark"] .chip-rolle.gut { background: linear-gradient(180deg, #2f8f58, #14512f); color: #d8f4e6; }
html[data-theme="dark"] .chip-rolle.boese { background: linear-gradient(180deg, #b3261e, #6d120c); color: #ffd9d4; }
html[data-theme="dark"] .chip-warn { background: linear-gradient(180deg, #3a1414, #1e0909); }
html[data-theme="dark"] .chip-lobbybar { background: linear-gradient(180deg, #2a2118, #1d1710); border-color: var(--cs-kupfer); color: #efe3cd; }
html[data-theme="dark"] .chip-lobby-zeile label { color: #efe3cd; }
html[data-theme="dark"] .chip-lobbybar .task-hinweis { color: #cdb894; }
html[data-theme="dark"] .chip-lobbybar li { color: #efe3cd; border-bottom-color: rgba(239,227,205,.18); }
html[data-theme="dark"] .chip-hilfe-liste { color: #e2edf3; }
html[data-theme="dark"] .chip-panel { background: #16222b; }

/* ---------- 10. Responsive ---------- */
@media (max-width: 40rem) {
  /* Leiste zweizeilig (Muster Animations-Werkstatt): Marke oben zentriert,
     Zurueck + Werkzeuge darunter - sonst laeuft die Zeile ueber 390 px. */
  .chip-leiste { grid-template-columns: 1fr 1fr; gap: .3rem .5rem; padding: .35rem .55rem .45rem; }
  .chip-titel { grid-column: 1 / -1; grid-row: 1; font-size: 1rem; }
  .chip-titel-logo { width: 24px; height: 24px; }
  .chip-zurueck { grid-row: 2; grid-column: 1; padding: .3rem .55rem; font-size: .78rem; white-space: nowrap; }
  .chip-ende { grid-row: 2; grid-column: 2; }
  .chip-vermerk { display: none; }
  .chip-leiste .jupi_sprachen_select { max-width: 8.5rem; font-size: .76rem; padding: .3rem .45rem; }
  .chip-leiste .jupi_sprachen_icon { display: none; }
  .task-chips { grid-template-columns: repeat(3, 1fr); }
  /* Buehne auf dem Handy: EINE Zeile Infoleiste */
  .chip-infoleiste { gap: .3rem; padding: .3rem .4rem; font-size: .82rem; flex-wrap: nowrap; }
  .chip-infoleiste .chip-crew { display: none; }
  .chip-infoleiste #chip-tasktext { display: none; }
  .chip-rolle { font-size: .78rem; padding: .2rem .5rem; }
  .chip-ort { font-size: .78rem; padding: .15rem .5rem; }
  .chip-balken { flex: 1 1 40px; min-width: 28px; }
  .chip-infoleiste button { font-size: .8rem; padding: .3rem .5rem; white-space: nowrap; }
  .chip-taskpanel { top: 3.7rem; max-width: 58%; }
  .chip-mini canvas { width: 118px; height: 83px; }
  /* Aktionsleiste sitzt ueber der Minikarte, sonst verdeckt eines das andere */
  .chip-aktionsleiste { bottom: 6.2rem; padding: .3rem .4rem; gap: .25rem; }
  .chip-aktion-gruppe + .chip-aktion-gruppe { padding-left: .3rem; }
  .chip-aktionsleiste button { font-size: .8rem; padding: .3rem .55rem; }
  .chip-lobbybar { top: 3.7rem; }
  .chip-warn { top: 3.7rem; font-size: .85rem; }
  .chip-seite { top: 3.7rem; max-width: 62vw; }
  .chip-startmenue { padding: 1.1rem .8rem 1.1rem; }
  /* Vorzeile darf am Handy nicht in zwei Zeilen umbrechen (sie stand sonst
     als "SOCIAL-DEDUCTION IN DER CHIP-" / "FABRIK" da). */
  .chip-eyebrow {
    font-size: .64rem;
    letter-spacing: .08em;
    padding: 0 .1rem;
  }
  .chip-startmenue::before { left: .8rem; right: .8rem; }
  .chip-startmenue::after {
    background-image:
      radial-gradient(circle at 11px 11px, #c9a063 0 2.6px, rgba(0,0,0,0) 3px),
      radial-gradient(circle at calc(100% - 11px) 11px, #c9a063 0 2.6px, rgba(0,0,0,0) 3px),
      radial-gradient(circle at 11px calc(100% - 11px), #c9a063 0 2.6px, rgba(0,0,0,0) 3px),
      radial-gradient(circle at calc(100% - 11px) calc(100% - 11px), #c9a063 0 2.6px, rgba(0,0,0,0) 3px);
  }
}

/* ---------- 11. Fokus + Mindestziele ---------- */
.chip-leiste a:focus-visible,
.chip-leiste button:focus-visible,
.chip-mknopf:focus-visible,
.chip-go:focus-visible,
.chip-tasktoggle:focus-visible,
.chip-aktionsleiste button:focus-visible,
.chip-dialog button:focus-visible {
  outline: 3px solid var(--cs-kupfer-hell);
  outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  .chip-card, .chip-mknopf, .chip-go, .chip-zurueck { transition: none !important; }
  .chip-mknopf:hover, .chip-go:hover, .chip-card:hover, .chip-zurueck:hover { transform: none; }
}
