/* =====================================================================
   bau.css – Die Bauecke (train-bau.js)
   ---------------------------------------------------------------------
   Eine eigene Datei, weil die Bauecke viele eigene Teile hat. Sie folgt
   den Regeln von styles.css: grosse Ziele für Kinderfinger (mindestens
   44 px), keine Endlos-Animationen an SVG-Teilen (sie machten auf dem
   Xiaomi Pad aus jedem Teil eine Ebene), und alles Bewegte läuft über
   transform und opacity.
   ===================================================================== */

/* --- Einbau in die Bühne (train-home.js, Ansicht "bau") --- */
.train-stage[data-view="bau"] .train-band { opacity: 0; pointer-events: none; }
.train-stage[data-view="bau"] .stage-layer { z-index: 4; }
.train-stage[data-view="bau"] .scene { visibility: hidden; }
.train-stage[data-view="bau"] .scene-bird { animation-play-state: paused; }
.train-stage[data-view="bau"] .train-band * { animation: none; }
/* Der Lautsprecher spricht in der Bauecke, neben dem Zurück-Knopf. */
body[data-page="train"] .train-stage[data-view="bau"] ~ .help-voice {
  display: flex;
  left: calc(var(--safe-left) + 86px);
}

/* --- Der Bauplatz auf dem Startbild --- */
.bauplatz-knopf {
  position: absolute;
  z-index: 3;
  width: clamp(80px, 16vw, 210px);
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  filter: drop-shadow(0 6px 10px rgba(36, 48, 71, 0.22));
  transform-origin: 50% 80%;
  transition: opacity 0.4s ease, transform 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.bauplatz-knopf[hidden] { display: none; }
.bauplatz-knopf[data-placed="0"] { opacity: 0; pointer-events: none; }
.bauplatz-knopf:active { transform: scale(0.95); }
.bauplatz-knopf:focus-visible { outline: 3px solid #6c5ce7; outline-offset: 4px; border-radius: 12px; }
.bauplatz-knopf svg { display: block; width: 100%; height: auto; }
.train-stage[data-entering] .bauplatz-knopf { opacity: 0; pointer-events: none; }
.train-stage[data-bau-ein] .bauplatz-knopf { transform: scale(1.3); opacity: 0; transition: transform 0.42s ease-in, opacity 0.42s ease-in; }

/* --- Die Bauecke --- */
.bauecke {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: auto;
  background: linear-gradient(180deg, #a8dcf5 0%, #d7f0fb 62%, #e9f7ff 100%);
  font-family: "Baloo 2", Nunito, system-ui, sans-serif;
  color: #243047;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  animation: bau-ein 0.4s ease backwards;
}
@keyframes bau-ein {
  from { opacity: 0; }
  to { opacity: 1; }
}
.bauecke.is-nacht { background: linear-gradient(180deg, #141d44 0%, #27336a 62%, #34417c 100%); }
.bauecke button { font-family: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.bauecke button:focus-visible { outline: 3px solid #243047; outline-offset: 3px; }

.bau-himmel { position: absolute; inset: 0; pointer-events: none; }
.bau-sonne {
  position: absolute;
  right: 26%;
  top: 9%;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: radial-gradient(circle, #ffe08a 0 55%, #ffd166 56%);
  box-shadow: 0 0 46px rgba(255, 209, 102, 0.65);
}
.bau-mond {
  display: none;
  position: absolute;
  right: 26%;
  top: 9%;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  box-shadow: inset -16px -6px 0 0 #fff6c2;
}
.bau-wolke {
  position: absolute;
  height: 34px;
  border-radius: 999px;
  background: #ffffff;
  opacity: 0.85;
}
.bau-wolke::before, .bau-wolke::after { content: ""; position: absolute; background: #ffffff; border-radius: 50%; }
.bau-wolke::before { width: 46px; height: 46px; left: 18px; top: -22px; }
.bau-wolke::after { width: 34px; height: 34px; left: 54px; top: -14px; }
.bau-wolke.w1 { width: 120px; left: 12%; top: 16%; }
.bau-wolke.w2 { width: 96px; left: 64%; top: 26%; opacity: 0.7; }
.is-nacht .bau-sonne, .is-nacht .bau-wolke { display: none; }
.is-nacht .bau-mond { display: block; }
.is-nacht .bau-himmel {
  background-image:
    radial-gradient(2px 2px at 12% 18%, #fff 50%, transparent 51%),
    radial-gradient(2px 2px at 34% 9%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 58% 21%, #fff 50%, transparent 51%),
    radial-gradient(2px 2px at 82% 12%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 91% 33%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 6% 38%, #fff 50%, transparent 51%);
}

/* Strasse, Gleis und Wiese über die ganze Breite, hinter dem Haus: keine
   eigene Ebene (kein 3D-Transform, kein will-change), damit nur gemalt wird,
   was zu sehen ist. train-bau.js (zeigeWelt) verschiebt ihn mit dem Haus. */
.bau-gelaende {
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  transform-origin: 0 0;
}
.bau-gelaende-band {
  position: absolute;
  left: -20000px;
  width: 40000px;
  height: 20000px;
  touch-action: none;
}

/* Alle vier Häuser auf einen Blick: ein Bild so gross wie der Bildschirm. */
.bau-dorf { position: absolute; inset: 0; }
.bau-dorf[hidden] { display: none; }
.bau-dorf svg { display: block; }
.bau-dorf-haus { cursor: pointer; }

/* Die Welt mit dem Haus: eine Ebene, die als Ganzes verschoben wird. */
.bau-welt {
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: 0 0;
  will-change: transform;
  touch-action: none;
}
.bau-welt svg { display: block; overflow: visible; }
.bau-raum, .bau-tier, .bau-tafelknopf, .bau-naechster, .bau-schild, .bau-ordnenpfeil { cursor: pointer; }
/* Unsichtbar, aber antippbar (train-bau.js, setzeTier): fill transparent zählt
   als gemalt. */
.bau-tier-treffer { fill: transparent; }
.bau-naechster .bau-plus circle { fill: #9aa5b1; }
.bau-naechster.is-bereit .bau-plus circle { fill: #3fbf74; }
.bau-naechster.is-bereit > rect { stroke: #3fbf74; opacity: 0.6; }

/* Nacht: Fenster dunkel, Laternen an. */
.is-nacht .bau-fensterglas { fill: #2b3a67; }
.is-nacht .bau-laternenlicht { fill: #fff3a0; }
.bau-laternenlicht { fill: #e2e8f0; }

/* Kurzes Anstupsen: Hier schauen! (einmal, keine Schleife). Teile der
   Hausansicht (SVG) wippen über die Bildschleife, siehe stupse(). */
.is-stups { animation: bau-stups 0.8s ease; }
@keyframes bau-stups {
  0%, 100% { transform: scale(1); }
  30% { transform: scale(1.16); }
  60% { transform: scale(0.96); }
}

/* --- Oben: die vier Häuser --- */
.bau-umschalter {
  position: absolute;
  top: calc(var(--safe-top, 0px) + 14px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  display: flex;
  gap: 8px;
  padding: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  box-shadow: 0 6px 16px rgba(36, 48, 71, 0.16);
}
.bau-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 50px;
  padding: 0 14px 0 8px;
  border-radius: 999px;
  border: 3px solid transparent;
  background: #ffffff;
  color: #243047;
  font-weight: 800;
  font-size: 1rem;
  white-space: nowrap;
}
.bau-tab.is-aktiv { background: #3fbf74; color: #ffffff; border-color: #ffffff; box-shadow: 0 4px 10px rgba(47, 158, 92, 0.35); }
/* Im Wohnhaus zieht gerade jemand ein: ein Punkt am Umschalter. */
.bau-tab { position: relative; }
.bau-tab.hat-neues::after {
  content: "";
  position: absolute;
  top: -3px;
  right: -3px;
  width: 16px;
  height: 16px;
  border: 3px solid #ffffff;
  border-radius: 50%;
  background: #ff7a59;
  animation: bau-puls 1.4s ease-in-out 3;
}
@keyframes bau-puls {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.3); }
}
.bau-tab-zeichen { width: 30px; height: 30px; flex: 0 0 auto; }
.bau-tab-sterne { font-size: 0.82rem; color: #b7791f; }
.bau-tab.is-aktiv .bau-tab-sterne { color: #fff6c2; }

/* Die Nachbarhäuser am Rand – ein Tipp, und man ist drüben. */
/* Unten links: das Haus gross oder ganz auf einem Bildschirm. */
.bau-ansichtknopf {
  position: absolute;
  bottom: calc(var(--safe-bottom, 0px) + 14px);
  left: calc(var(--safe-left, 0px) + 14px);
  z-index: 5;
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  padding: 0;
  border: 3px solid #ffffff;
  border-radius: 20px;
  background: #ffffff;
  box-shadow: 0 6px 16px rgba(36, 48, 71, 0.22);
}
.bau-ansichtknopf svg { width: 40px; height: 40px; }
.bau-ansichtknopf.is-weit { background: #e8f8ee; border-color: #3fbf74; }
.bau-ansichtknopf:active { transform: scale(0.94); }

/* Was über das Gleis fährt: eine eigene, nur verschobene Ebene über dem Haus. */
.bau-zugebene {
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: 0 0;
  will-change: transform;
  pointer-events: none;
}
.bau-zugebene svg { display: block; overflow: visible; }
.bau-zugebene.is-antippbar svg { pointer-events: auto; }

/* --- Rechts: Ziegel, Rätsel, Tag und Nacht, Fassade --- */
.bau-hud {
  position: absolute;
  top: calc(var(--safe-top, 0px) + 84px);
  right: calc(var(--safe-right, 0px) + 14px);
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.bau-ziegel {
  display: flex;
  align-items: center;
  gap: 2px;
  min-height: 56px;
  padding: 2px 14px 2px 6px;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 6px 14px rgba(36, 48, 71, 0.18);
  font-size: 1.8rem;
  font-weight: 800;
  color: #8a5734;
  cursor: pointer;
}
.bau-ziegel.is-leer { color: #a0aec0; }
.bau-ziegel-bild { width: 54px; height: 48px; }
.bau-raetsel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  min-width: 96px;
  padding: 8px 12px 6px;
  border: 3px solid #ffffff;
  border-radius: 22px;
  background: linear-gradient(180deg, #4cd28a, #2ea866);
  color: #ffffff;
  font-weight: 800;
  font-size: 1.1rem;
  box-shadow: 0 8px 18px rgba(47, 158, 92, 0.4);
}
.bau-raetsel:active { transform: scale(0.95); }
.bau-raetsel-bild { width: 40px; height: 40px; }
.bau-rund {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 3px solid #ffffff;
  border-radius: 50%;
  background: #ffffff;
  color: #243047;
  box-shadow: 0 6px 14px rgba(36, 48, 71, 0.18);
}
.bau-rund svg { width: 28px; height: 28px; }
.bau-rund:disabled { opacity: 0.4; }
.bau-rund.is-an { background: #fff6c2; }
.bau-ordnenknopf.is-an { background: #3fbf74; color: #ffffff; }
.bau-stiftknopf svg { width: 30px; height: 30px; }
/* Stockwerke umstellen: nur die Pfeile zählen. */
.bauecke.ist-ordnen .bau-raetsel,
.bau-ordnenpfeil:focus-visible { outline: none; }
.bau-ordnenpfeil:focus-visible circle { stroke: #243047; }
.bau-rund:active { transform: scale(0.93); }

/* --- Links: alle Bewohner – im Haus und beim Einrichten --- */
.bau-bewohnerknopf {
  position: absolute;
  top: calc(var(--safe-top, 0px) + 84px);
  left: calc(var(--safe-left, 0px) + 14px);
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  width: 92px;
  padding: 8px 2px 6px;
  border: 3px solid #ffffff;
  border-radius: 22px;
  background: linear-gradient(180deg, #ffae45, #f07f2c);
  color: #ffffff;
  font-weight: 800;
  font-size: 0.95rem;
  line-height: 1.1;
  box-shadow: 0 8px 18px rgba(214, 112, 30, 0.38);
}
.bau-bewohnerknopf:active { transform: scale(0.95); }
.bau-bewohnerknopf-bild { width: 36px; height: 36px; }
.bau-bewohnerknopf-zahl {
  position: absolute;
  top: -9px;
  right: -9px;
  min-width: 28px;
  height: 28px;
  padding: 0 5px;
  display: grid;
  place-items: center;
  border: 2px solid #f07f2c;
  border-radius: 999px;
  background: #ffffff;
  color: #c75f12;
  font-size: 0.95rem;
  box-shadow: 0 3px 8px rgba(36, 48, 71, 0.2);
}
.bauecke.ist-ordnen .bau-bewohnerknopf { visibility: hidden; }

/* --- Darunter: alle Sterne des Dorfs und die Sternenleiter --- */
.bau-leiterknopf {
  position: absolute;
  top: calc(var(--safe-top, 0px) + 172px);
  left: calc(var(--safe-left, 0px) + 14px);
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 92px;
  padding: 7px 8px 6px;
  border: 3px solid #ffffff;
  border-radius: 22px;
  background: linear-gradient(180deg, #ffe27a, #ffb703);
  color: #5c3700;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 8px 18px rgba(176, 112, 0, 0.38);
}
.bau-leiterknopf:active { transform: scale(0.95); }
.bau-leiterknopf-zahl { display: flex; align-items: center; gap: 3px; font-size: 1.45rem; }
.bau-leiterknopf-zahl .bau-stern { width: 24px; height: 24px; }
.bau-leiterknopf-balken {
  display: block;
  width: 100%;
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  box-shadow: inset 0 1px 2px rgba(92, 55, 0, 0.25);
}
.bau-leiterknopf-balken i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #ff9f1c, #e85d04); }
.bau-leiterknopf-text { font-size: 0.74rem; color: #7a4d00; }
.bau-leiterknopf.is-fertig { background: linear-gradient(180deg, #fff3b0, #ffc93c); }
.bauecke.ist-ordnen .bau-leiterknopf { visibility: hidden; }

/* Die Sternenleiter: die Stufen, die höchste oben. */
.bau-leiter .bau-uebersicht-karte { width: min(660px, 96vw); }
.bau-leiter-liste { display: flex; flex-direction: column; gap: 8px; margin: 12px 0 0; padding: 0; list-style: none; }
.bau-leiter-stufe {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 7px 14px 7px 8px;
  border: 3px solid #e2e8f0;
  border-radius: 20px;
  background: #f7f9fc;
}
.bau-leiter-stufe.is-erreicht { border-color: #f5b400; background: linear-gradient(135deg, #fff8d6, #ffe08a); }
.bau-leiter-stufe.is-naechste { border-color: #3fbf74; background: #ffffff; box-shadow: 0 6px 16px rgba(47, 158, 92, 0.25); }
.bau-leiter-stufe.is-spaeter { opacity: 0.62; }
.bau-leiter-stufe.is-spaeter .bau-leiter-bild { filter: grayscale(0.85); }
.bau-leiter-marke {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #34508f;
  color: #ffd166;
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1;
}
.bau-leiter-marke .bau-stern { width: 18px; height: 18px; }
.bau-leiter-bild { display: grid; flex: 0 0 auto; place-items: center; width: 84px; height: 62px; }
.bau-leiter-bild svg { width: 100%; height: 100%; }
.bau-leiter-text { display: flex; flex: 1 1 auto; flex-direction: column; gap: 2px; min-width: 0; }
.bau-leiter-text b { font-size: 1.15rem; }
.bau-leiter-text span { color: #4a5568; font-weight: 700; font-size: 0.92rem; }
.bau-leiter-haken {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #3fbf74;
  color: #ffffff;
  font-size: 1.3rem;
  font-weight: 800;
}
.bau-leiter-fehlt {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 3px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #e8f8ee;
  color: #1d7a45;
  font-weight: 800;
  white-space: nowrap;
}
.bau-leiter-fehlt b { font-size: 1.15rem; }
.bau-leiter-schloss { flex: 0 0 auto; font-size: 1.4rem; }

/* Der Glücksstern steckt in diesem Haus: Am Umschalter funkelt ein Stern. */
.bau-tab.hat-stern::before {
  content: "";
  position: absolute;
  top: -15px;
  left: -10px;
  width: 30px;
  height: 30px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2.1L14.76 9.1L22.27 9.56L16.47 14.35L18.35 21.64L12 17.6L5.65 21.64L7.53 14.35L1.73 9.56L9.24 9.1Z' fill='%23ffc23a' stroke='%23b97f00' stroke-width='1.7' stroke-linejoin='round'/%3E%3Ccircle cx='10' cy='12.4' r='0.9' fill='%235b3a00'/%3E%3Ccircle cx='14' cy='12.4' r='0.9' fill='%235b3a00'/%3E%3C/svg%3E") center / contain no-repeat;
  filter: drop-shadow(0 2px 4px rgba(176, 112, 0, 0.55));
  animation: bau-puls 1.2s ease-in-out infinite;
}
.bau-gluecksstern { cursor: pointer; }
.bau-blitz { cursor: pointer; }

/* --- Das Zimmer --- */
.bauecke.ist-zimmer .bau-umschalter,
.bauecke.ist-zimmer .bau-hud,
.bauecke.ist-zimmer .bau-ansichtknopf { display: none; }
.bau-zimmeransicht {
  position: absolute;
  inset: 0;
  z-index: 4;
  background: rgba(24, 34, 58, 0.32);
}
.bau-zimmeransicht[hidden] { display: none; }
.bau-zimmerbuehne { position: absolute; inset: 0; touch-action: none; }
.bau-zimmer-svg {
  position: absolute;
  display: block;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.28);
}
/* Alle, die hier wohnen, haben alle Sterne: Das Zimmer glänzt golden. */
.bau-zimmer-svg.is-strahlt {
  box-shadow: 0 0 0 6px #ffc93c, 0 0 0 10px #e09b00, 0 0 36px 12px rgba(255, 201, 60, 0.85), 0 12px 34px rgba(0, 0, 0, 0.28);
}
.bau-ding { cursor: grab; }
.bau-kopfzeile {
  position: absolute;
  top: calc(var(--safe-top, 0px) + 14px);
  left: calc(var(--safe-left, 0px) + 172px);
  right: calc(var(--safe-right, 0px) + 206px);
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: none;
}
.bau-kopfzeile > * { pointer-events: auto; }
.bau-zimmerkopf, .bau-werkzeug { display: flex; align-items: center; gap: 8px; }
.bau-zimmername, .bau-zimmertier {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 52px;
  padding: 0 14px;
  border: 3px solid #ffffff;
  border-radius: 999px;
  background: #ffffff;
  color: #243047;
  font-weight: 800;
  font-size: 1.15rem;
  box-shadow: 0 6px 14px rgba(36, 48, 71, 0.18);
  white-space: nowrap;
}
.bau-lautsprecher { width: 22px; height: 22px; color: #6c5ce7; }
.bau-zimmertier { padding: 0 12px 0 2px; }
.bau-zimmertier-bild { width: 44px; height: 48px; }
/* Der Traumjob: golden umrandet, mit der goldenen Aktentasche. */
.bau-zimmertier.is-traum { border-color: #ffc93c; background: #fff8dc; }
.bau-zimmertier-name { font-size: 1rem; }
.bau-zimmertier.is-mehr { padding: 0 14px; color: #4a5568; }
/* Alle Sterne: golden, mit Pokal. */
.bau-zimmertier.is-alle { border-color: #ffb703; background: linear-gradient(180deg, #fff6c9, #ffd766); }
.bau-zimmertier-pokal { font-size: 1.3rem; line-height: 1; }
.bau-traumzeichen { width: 30px; height: 28px; flex: 0 0 auto; }
.bau-traumzeichen-klein { display: inline-flex; vertical-align: -5px; }
.bau-traumzeichen-klein svg { width: 26px; height: 24px; }
.bau-traummarke { cursor: pointer; }
.bau-laune, .bau-weh { font-size: 1.4rem; }
.bau-sternzahl { display: none; align-items: center; gap: 3px; font-size: 1rem; }

/* Sterne: gelb fürs Zimmer, grün fürs Haus, blau für die anderen Häuser.
   Geholt: gefüllt und kräftig umrandet. Noch offen: hohl und gestrichelt –
   so ist auf einen Blick klar, was schon geschafft ist. */
.bau-sternreihe { display: inline-flex; align-items: center; gap: 1px; }
.bau-stern {
  display: inline-block;
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  background: center / contain no-repeat;
}
.bau-stern.is-gelb { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2.1L14.76 9.1L22.27 9.56L16.47 14.35L18.35 21.64L12 17.6L5.65 21.64L7.53 14.35L1.73 9.56L9.24 9.1Z' fill='%23fffdf4' stroke='%23e2b448' stroke-width='1.6' stroke-linejoin='round' stroke-dasharray='2.6 1.7'/%3E%3C/svg%3E"); }
.bau-stern.is-gruen { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2.1L14.76 9.1L22.27 9.56L16.47 14.35L18.35 21.64L12 17.6L5.65 21.64L7.53 14.35L1.73 9.56L9.24 9.1Z' fill='%23f6fcf8' stroke='%2378c991' stroke-width='1.6' stroke-linejoin='round' stroke-dasharray='2.6 1.7'/%3E%3C/svg%3E"); }
.bau-stern.is-blau { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2.1L14.76 9.1L22.27 9.56L16.47 14.35L18.35 21.64L12 17.6L5.65 21.64L7.53 14.35L1.73 9.56L9.24 9.1Z' fill='%23f5f8ff' stroke='%2388a9e8' stroke-width='1.6' stroke-linejoin='round' stroke-dasharray='2.6 1.7'/%3E%3C/svg%3E"); }
.bau-stern.is-gelb.is-voll { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2.1L14.76 9.1L22.27 9.56L16.47 14.35L18.35 21.64L12 17.6L5.65 21.64L7.53 14.35L1.73 9.56L9.24 9.1Z' fill='%23ffc23a' stroke='%23b97f00' stroke-width='1.7' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.bau-stern.is-gruen.is-voll { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2.1L14.76 9.1L22.27 9.56L16.47 14.35L18.35 21.64L12 17.6L5.65 21.64L7.53 14.35L1.73 9.56L9.24 9.1Z' fill='%233fc068' stroke='%231d8445' stroke-width='1.7' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.bau-stern.is-blau.is-voll { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2.1L14.76 9.1L22.27 9.56L16.47 14.35L18.35 21.64L12 17.6L5.65 21.64L7.53 14.35L1.73 9.56L9.24 9.1Z' fill='%234f8ef7' stroke='%232457bf' stroke-width='1.7' stroke-linejoin='round'/%3E%3C/svg%3E"); }

/* --- Die Schublade --- */
.bau-schublade {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 6;
  height: 178px;
  display: flex;
  flex-direction: column;
  padding-bottom: var(--safe-bottom, 0px);
  border-top: 4px solid #e8c48f;
  border-radius: 24px 24px 0 0;
  background: #fff6e8;
  box-shadow: 0 -8px 22px rgba(36, 48, 71, 0.18);
}
.bau-reiter {
  display: flex;
  gap: 6px;
  padding: 8px 12px 4px;
  overflow-x: auto;
  scrollbar-width: none;
  flex: 0 0 auto;
}
.bau-reiter::-webkit-scrollbar, .bau-inhalt::-webkit-scrollbar, .bau-farbreihe::-webkit-scrollbar, .bau-musterreihe::-webkit-scrollbar { display: none; }
.bau-reiter-knopf {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  min-width: 54px;
  height: 46px;
  padding: 0 8px;
  border: 2px solid #f0dcc0;
  border-radius: 14px;
  background: #ffffff;
}
.bau-reiter-knopf svg { width: 30px; height: 30px; }
.bau-reiter-emoji { font-size: 1.5rem; line-height: 1; }
.bau-reiter-knopf.is-aktiv { background: #ffd166; border-color: #e8b94f; }
.bau-inhalt {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 12px 10px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  touch-action: pan-x;
}
.bau-ding-knopf {
  position: relative;
  flex: 0 0 auto;
  width: 104px;
  height: 104px;
  padding: 6px;
  border: 3px solid #f0e2cc;
  border-radius: 18px;
  background: #ffffff;
  touch-action: pan-x;
}
.bau-ding-knopf svg { width: 100%; height: 100%; pointer-events: none; }
.bau-ding-knopf:active { transform: scale(0.95); }
.bau-ding-knopf.is-gewuenscht { border-color: #ffc93c; box-shadow: 0 0 0 3px rgba(255, 201, 60, 0.35); }
.bau-wunschmarke {
  position: absolute;
  top: -8px;
  right: -6px;
  color: #ffb703;
  font-size: 1.5rem;
  line-height: 1;
  text-shadow: 0 1px 0 #ffffff, 0 0 4px #ffffff;
}
.bau-inhalt.is-farben {
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 8px;
  overflow-x: hidden;
  overflow-y: auto;
  touch-action: pan-y;
}
.bau-farbreihe, .bau-musterreihe {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 3px;
  flex: 0 0 auto;
  touch-action: pan-x;
}
.bau-farbe {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 3px solid #ffffff;
  border-radius: 50%;
  background: var(--farbe, #cccccc);
  box-shadow: 0 0 0 2px #d9e2ec;
}
.bau-farbe.is-aktiv { box-shadow: 0 0 0 4px #243047; }
.bau-farbe.is-grund { background: conic-gradient(var(--farbe) 0 75%, #ffffff 75%); }
.bau-muster {
  flex: 0 0 auto;
  width: 58px;
  height: 58px;
  padding: 0;
  overflow: hidden;
  border: 3px solid #ffffff;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 0 0 2px #d9e2ec;
}
.bau-muster svg { width: 100%; height: 100%; display: block; }
.bau-muster.is-aktiv { box-shadow: 0 0 0 4px #243047; }

/* --- Das Menü am gewählten Ding --- */
.bau-bearbeiten {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 8;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: min(96vw, 520px);
  padding: 8px;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 10px 26px rgba(36, 48, 71, 0.26);
}
.bau-bearbeiten[hidden] { display: none; }
.bau-bearbeiten-farben { display: flex; flex-wrap: wrap; gap: 5px; }
.bau-bearbeiten .bau-farbe { width: 34px; height: 34px; border-width: 2px; }
.bau-bearbeiten-zeile { display: flex; gap: 6px; }
.bau-aktion {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  padding: 0;
  border: none;
  border-radius: 14px;
  background: #eef2f7;
  color: #243047;
}
.bau-aktion svg { width: 26px; height: 26px; }
.bau-aktion.is-weg { background: #ffe4ea; color: #c53030; }
.bau-aktion:active { transform: scale(0.92); }

.bau-muell {
  position: absolute;
  right: calc(var(--safe-right, 0px) + 18px);
  bottom: 196px;
  z-index: 7;
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  border: 4px solid #ffffff;
  border-radius: 50%;
  background: #ef5350;
  box-shadow: 0 8px 18px rgba(197, 48, 48, 0.4);
  transition: transform 0.15s ease;
  pointer-events: none;
}
.bau-muell[hidden] { display: none; }
.bau-muell svg { width: 38px; height: 38px; }
.bau-muell.is-ueber { transform: scale(1.22); background: #c53030; }

/* Was gezogen wird und was fliegt: eine Ebene ohne Fläche. */
.bau-flug { position: fixed; left: 0; top: 0; width: 0; height: 0; z-index: 60; pointer-events: none; }
.bau-geist { position: absolute; left: 0; top: 0; pointer-events: none; filter: drop-shadow(0 10px 10px rgba(0, 0, 0, 0.25)); }
.bau-geist svg { width: 100%; height: 100%; display: block; overflow: visible; }
.bau-geist.is-draussen { opacity: 0.55; }
.bau-flieger { position: absolute; left: 0; top: 0; width: 56px; height: 48px; }
.bau-flieger svg { width: 100%; height: 100%; }

/* --- Die Tier-Tafel --- */
.bau-tafel, .bau-uebersicht {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  /* Oben Platz für Zurück, Lautsprecher und die festen Knöpfe. */
  padding: calc(var(--safe-top, 0px) + 76px) 14px 14px;
  background: rgba(24, 34, 58, 0.5);
}
.bau-tafel[hidden], .bau-uebersicht[hidden] { display: none; }
.bau-tafel-karte, .bau-uebersicht-karte {
  position: relative;
  width: min(760px, 96vw);
  max-height: calc(100% - 8px);
  overflow-y: auto;
  padding: 16px 18px 18px;
  border-radius: 26px;
  background: #fffdf8;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.3);
  animation: bau-karte-ein 0.25s ease backwards;
}
@keyframes bau-karte-ein {
  from { opacity: 0; transform: translateY(14px) scale(0.98); }
  to { opacity: 1; transform: none; }
}
.bau-tafel-zu, .bau-uebersicht-zu {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 50%;
  background: #eef2f7;
  color: #243047;
}
.bau-tafel-zu svg, .bau-uebersicht-zu svg { width: 24px; height: 24px; }
.bau-tafel-kopf { display: flex; align-items: center; gap: 14px; padding-right: 50px; }
.bau-tafel-tier { width: 86px; height: 108px; flex: 0 0 auto; }
.bau-tafel-wer h2 { margin: 0; font-size: 1.9rem; line-height: 1.1; }
.bau-tafel-wer p { margin: 2px 0; color: #4a5568; font-weight: 600; }
.bau-tafel-laune { font-size: 1.1rem; color: #243047 !important; }
/* Die Sterne eines Tiers, gross: geholte gefüllt, offene hohl. Hat es alle,
   wird die Kachel golden, mit Pokal – das soll ins Auge stechen. */
.bau-sternkachel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  margin-top: 12px;
  padding: 10px 14px;
  border: 3px solid #f3dfa8;
  border-radius: 20px;
  background: #fffaf0;
}
.bau-sternkachel-sterne { display: flex; flex-wrap: wrap; gap: 4px; }
.bau-stern.bau-stern-gross { width: 44px; height: 44px; }
.bau-sternkachel-text { display: flex; flex-direction: column; line-height: 1.15; }
.bau-sternkachel-text b { color: #243047; font-size: 1.5rem; }
.bau-sternkachel-text span { color: #4a5568; font-weight: 700; }
.bau-sternkachel.is-alle {
  border-color: #ffb703;
  background: linear-gradient(135deg, #fff7cf 0%, #ffd766 55%, #ffc23a 100%);
  box-shadow: 0 0 0 4px rgba(255, 183, 3, 0.28), 0 10px 22px rgba(214, 140, 0, 0.3);
}
.bau-sternkachel.is-alle .bau-sternkachel-text b { color: #6b4100; font-size: 1.75rem; }
.bau-sternkachel.is-alle .bau-sternkachel-text span { color: #6b4100; }
.bau-sternkachel.is-alle .bau-stern-gross { filter: drop-shadow(0 2px 3px rgba(150, 90, 0, 0.35)); }
.bau-sternkachel-pokal { margin-left: auto; font-size: 2.7rem; line-height: 1; animation: bau-pokal 1.4s ease-in-out 3; }
@keyframes bau-pokal {
  0%, 100% { transform: rotate(0) scale(1); }
  50% { transform: rotate(-8deg) scale(1.15); }
}
/* Ganz unten: das Buch der Figur (klein) und das Ausziehen. */
.bau-tafel-fuss { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 12px; }
.bau-tafel-fuss .bau-hinaus { margin: 0 0 0 auto; }
.bau-tafel-leiste { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 56px 10px 0; }
.bau-tafel-wechsel {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 52px;
  padding: 0 14px 0 4px;
  border: 3px solid #e2e8f0;
  border-radius: 999px;
  background: #ffffff;
  color: #243047;
  font-weight: 800;
  font-size: 1rem;
}
.bau-tafel-wechsel svg { width: 40px; height: 44px; }
.bau-tafel-wechsel.is-aktiv { border-color: #3fbf74; background: #f0fff4; }
.bau-tafel-wo {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-top: 10px;
  padding: 8px 8px 8px 12px;
  border-radius: 16px;
  background: #fff3d6;
}
.bau-tafel-wo.is-daheim { background: #eaf6ff; }
.bau-tafel-wo p { flex: 1 1 220px; margin: 0; font-weight: 700; }
.bau-hingehen { flex: 0 0 auto; }
.bau-tafel-arbeit { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; padding: 10px 12px; border-radius: 16px; background: #f4f0ff; }
.bau-traum { display: flex; align-items: center; gap: 10px; }
.bau-traum p, .bau-arbeit { flex: 1 1 auto; margin: 0; font-weight: 700; color: #243047; }
.bau-traum.is-erfuellt { margin: -4px -6px; padding: 6px 8px; border: 2px solid #ffc93c; border-radius: 12px; background: #fff8dc; }
.bau-traum.is-erfuellt p { color: #8a5a00; }
.bau-tafel-wechsel.is-traum { border-color: #ffc93c; }
.bau-lies { cursor: default; }
.bauecke.kann-lesen .bau-lies,
.bauecke.kann-lesen .bau-tafel p,
.bauecke.kann-lesen .bau-uebersicht p,
.bauecke.kann-lesen .bau-uebersicht h3,
.bauecke.kann-lesen .bau-wahl-text { cursor: pointer; }
.bau-lies.is-liest, .bau-tafel p.is-liest, .bau-uebersicht .is-liest, .bau-wahl .is-liest { border-radius: 8px; background: #fff6c2; box-shadow: 0 0 0 4px #fff6c2; }
.bau-wunschliste {
  list-style: none;
  margin: 12px 0 6px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.bau-wunsch {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px;
  border: 2px solid #f0e2cc;
  border-radius: 16px;
  background: #ffffff;
}
.bau-wunsch.is-gruen { border-color: #c6f0d2; }
.bau-wunsch.is-blau { border-color: #cfe0fb; }
.bau-wunsch.is-erfuellt { background: #f1fbf4; }
.bau-wunsch-text {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 48px;
  padding: 0 4px;
  border: none;
  background: none;
  text-align: left;
  font-weight: 700;
  font-size: 1rem;
  color: #243047;
}
.bau-wunsch-text span { overflow: hidden; text-overflow: ellipsis; }
.bau-wunsch-text em { flex: 0 0 auto; padding: 0 6px; border-radius: 8px; background: #ffd166; font-style: normal; font-size: 0.8rem; }
.bau-wunsch-text .bau-stern { width: 22px; height: 22px; flex: 0 0 auto; }
.bau-wunsch-bild { width: 40px; height: 40px; flex: 0 0 auto; }
.bau-zeig {
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  border: none;
  border-radius: 13px;
  background: #3fbf74;
  color: #ffffff;
  font-weight: 800;
  font-size: 1.4rem;
}
.bau-haken { flex: 0 0 auto; padding: 0 10px; color: #2f9e5c; font-weight: 800; font-size: 1.5rem; }
.bau-legende { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 4px 2px; color: #4a5568; font-size: 0.9rem; font-weight: 600; }
.bau-hinaus {
  margin-top: 12px;
  padding: 8px 16px;
  border: 2px dashed #cbd5e0;
  border-radius: 999px;
  background: none;
  color: #718096;
  font-weight: 700;
}
.bau-frage-auszug {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 10px;
  border: 2px solid #f6c56b;
  border-radius: 16px;
  background: #fff7e6;
}
.bau-frage-auszug p { flex: 1 1 100%; margin: 0; font-weight: 700; }
.bau-knopf-klein {
  height: 46px;
  padding: 0 18px;
  border: none;
  border-radius: 999px;
  background: #3fbf74;
  color: #ffffff;
  font-weight: 800;
  font-size: 1rem;
}
.bau-knopf-klein.is-ja { background: #ef5350; }

/* --- Alle Bewohner: je Wohnung die Tiere, mit Sternen, Traumjob, Wünschen --- */
.bau-uebersicht-karte { width: min(1000px, 96vw); }
.bau-uebersicht-kopf { padding-right: 56px; }
.bau-uebersicht-kopf h2 { margin: 0; font-size: 1.8rem; line-height: 1.1; }
.bau-uebersicht-kopf p { margin: 4px 0 0; color: #4a5568; font-weight: 700; }
.bau-uebersicht-hin { margin-top: 12px; }
.bau-uebersicht-wohnung { margin-top: 14px; }
.bau-uebersicht-stock { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-size: 1.15rem; }
.bau-stockmarke {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #34508f;
  color: #ffd166;
  font-size: 0.95rem;
  font-weight: 800;
}
.bau-uebersicht-liste { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 10px; }
.bau-bewohner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
  padding: 8px 10px 8px 6px;
  border: 3px solid #e2e8f0;
  border-radius: 20px;
  background: #ffffff;
  color: #243047;
  font: inherit;
  text-align: left;
  box-shadow: 0 4px 10px rgba(36, 48, 71, 0.08);
}
.bau-bewohner:active { transform: scale(0.98); }
.bau-bewohner.is-traum { border-color: #ffc93c; background: #fffbea; }
.bau-bewohner-bild { position: relative; flex: 0 0 auto; width: 66px; height: 80px; }
.bau-bewohner-bild svg { display: block; width: 66px; height: 80px; }
.bau-bewohner-buch {
  position: absolute;
  left: -4px;
  bottom: -4px;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 2px 6px rgba(36, 48, 71, 0.22);
  font-size: 0.9rem;
}
.bau-bewohner-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.bau-bewohner-name { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 1.25rem; line-height: 1.1; }
.bau-bewohner-name b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bau-bewohner-laune { font-size: 1.1rem; }
.bau-bewohner-art { color: #718096; font-weight: 700; font-size: 0.9rem; line-height: 1; }
.bau-bewohner-sterne { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; color: #4a5568; font-weight: 800; font-size: 0.95rem; }
.bau-bewohner-sterne .bau-stern { width: 17px; height: 17px; }
.bau-bewohner-traum { display: flex; align-items: center; gap: 4px; min-width: 0; color: #5b3fb3; font-weight: 700; font-size: 0.95rem; }
.bau-bewohner-traum > span:not(.bau-traumzeichen-klein) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bau-bewohner-traum small { color: #718096; font-size: 0.85rem; font-weight: 700; }
.bau-bewohner-traum.is-erfuellt { color: #8a5a00; }
.bau-bewohner-traum .bau-traumzeichen-klein svg { width: 22px; height: 20px; }
.bau-bewohner-haken { flex: 0 0 auto; color: #2f9e5c; font-weight: 800; }
.bau-bewohner-wuensche { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 3px; }
.bau-bewohner-wunsch {
  position: relative;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 2px solid #ffcf5c;
  border-radius: 11px;
  background: #ffffff;
}
.bau-bewohner-wunsch.is-gruen { border-color: #7ad99a; }
.bau-bewohner-wunsch.is-blau { border-color: #8fb6f5; }
.bau-bewohner-wunsch svg { width: 30px; height: 30px; }
/* Erfüllt: blass, mit einem grünen Haken. */
.bau-bewohner-wunsch.is-erfuellt { border-style: dashed; background: #f4faf6; }
.bau-bewohner-wunsch.is-erfuellt svg { opacity: 0.38; }
.bau-bewohner-wunsch.is-erfuellt::after,
.bau-legende-haken {
  content: "✓";
  display: inline-grid;
  place-items: center;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #2f9e5c;
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}
.bau-bewohner-wunsch.is-erfuellt::after { position: absolute; right: -6px; bottom: -6px; }
/* Alle Sterne: die ganze Karte golden, mit Pokal. */
.bau-bewohner.is-alle {
  border-color: #ffb703;
  background: linear-gradient(180deg, #fffcef 0%, #ffefb8 100%);
  box-shadow: 0 0 0 3px rgba(255, 183, 3, 0.3), 0 6px 14px rgba(214, 140, 0, 0.2);
}
.bau-bewohner-alle {
  padding: 1px 9px;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffd766, #ffb703);
  color: #5c3700;
  font-size: 0.85rem;
  white-space: nowrap;
}

/* --- Alle Sterne geholt: ein goldenes Band, ein paar Sekunden --- */
.bau-sternband, .bau-leiterband {
  position: absolute;
  top: calc(var(--safe-top, 0px) + 84px);
  left: 50%;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: calc(100% - 24px);
  padding: 8px 18px 8px 10px;
  border: 4px solid #ffffff;
  border-radius: 26px;
  background: linear-gradient(135deg, #fff3b0 0%, #ffd766 50%, #ffb703 100%);
  box-shadow: 0 14px 34px rgba(150, 90, 0, 0.4);
  color: #5c3700;
  pointer-events: none;
  transform: translateX(-50%);
  animation: bau-band-ein 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.bau-sternband.is-weg, .bau-leiterband.is-weg { opacity: 0; transform: translate(-50%, -16px); }
@keyframes bau-band-ein {
  from { opacity: 0; transform: translate(-50%, -24px) scale(0.85); }
  to { opacity: 1; transform: translateX(-50%); }
}
.bau-sternband-tier { flex: 0 0 auto; width: 64px; height: 76px; }
.bau-sternband-bild { flex: 0 0 auto; width: 84px; height: 70px; }
.bau-sternband-bild svg { width: 100%; height: 100%; }
.bau-sternband-text { display: flex; flex-direction: column; line-height: 1.1; }
.bau-sternband-text b { font-size: 1.9rem; }
.bau-sternband-text span { font-weight: 800; font-size: 1.05rem; }
.bau-sternband-sterne { display: flex; gap: 2px; }
/* Weisse Sterne: auf dem Gold gut zu sehen. */
.bau-stern.bau-stern-weiss { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2.1L14.76 9.1L22.27 9.56L16.47 14.35L18.35 21.64L12 17.6L5.65 21.64L7.53 14.35L1.73 9.56L9.24 9.1Z' fill='%23ffffff' stroke='%23a86b00' stroke-width='1.7' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.bau-sternband .bau-stern { animation: bau-stern-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) backwards; }
@keyframes bau-stern-pop {
  from { opacity: 0; transform: scale(0.2) rotate(-40deg); }
  to { opacity: 1; transform: none; }
}

/* --- Wählen: das erste Haus, die Zimmerart, die Farben --- */
.bau-wahl {
  position: absolute;
  inset: 0;
  z-index: 25;
  display: grid;
  place-items: center;
  padding: calc(var(--safe-top, 0px) + 76px) 12px 12px;
  background: rgba(24, 34, 58, 0.5);
}
.bau-wahl-karte {
  width: min(900px, 96vw);
  max-height: calc(100% - 8px);
  overflow-y: auto;
  padding: 14px 16px 16px;
  border-radius: 26px;
  background: #fffdf8;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.3);
  animation: bau-karte-ein 0.25s ease backwards;
}
.bau-wahl-kopf h2 { margin: 2px 4px 10px; font-size: 1.5rem; }
.bau-wahl-raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(116px, 1fr)); gap: 10px; }
.is-hauswahl .bau-wahl-raster { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.bau-wahl-feld {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 6px;
  border: 3px solid #f0e2cc;
  border-radius: 18px;
  background: #ffffff;
  color: #243047;
  font-weight: 800;
  font-size: 0.98rem;
  line-height: 1.15;
  text-align: center;
}
/* Hier hätte ein Tier den Traumjob (golden) oder es wünscht es sich (in der
   Farbe des Sterns). Die Wahl selbst bleibt grün. */
.bau-wahl-feld.hat-traum { border-color: #f5b400; background: #fffaeb; }
.bau-wahl-feld.hat-wunsch.is-blau { border-color: #7fa9ee; background: #f4f8ff; }
.bau-wahl-feld.hat-wunsch.is-gruen { border-color: #78c991; background: #f3fbf5; }
.bau-wahl-feld.is-aktiv { border-color: #3fbf74; background: #f0fff4; box-shadow: 0 0 0 4px rgba(63, 191, 116, 0.25); }
.bau-wahl-bild { width: 70px; height: 70px; }
.is-hauswahl .bau-wahl-bild { width: 100%; height: 150px; }
.is-hauswahl .bau-wahl-feld { font-size: 1.2rem; }
.bau-schon { position: absolute; top: 4px; right: 8px; color: #2f9e5c; font-style: normal; font-weight: 800; }
/* Oben links: Hier hätte ein Tier den Traumjob (golden) oder es wünscht sich
   das Zimmer (Stern in der Farbe des Wunsches). */
.bau-wahl-marken { position: absolute; top: 3px; left: 5px; display: flex; gap: 3px; pointer-events: none; }
.bau-wahl-marke {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  padding: 1px 5px 1px 3px;
  border-radius: 999px;
  background: #fff8e1;
  box-shadow: 0 1px 3px rgba(36, 48, 71, 0.18);
  font-size: 0.85rem;
  font-weight: 800;
  color: #8a5734;
}
.bau-wahl-marke.is-wunsch { background: #eef6ff; color: #2b6cb0; }
.bau-wahl-marke .bau-traumzeichen-klein svg { width: 22px; height: 20px; }
.bau-wahl-marke .bau-stern { width: 18px; height: 18px; }
.bau-wahl-text { min-height: 2.6em; margin: 10px 4px; color: #2d3748; font-size: 1.05rem; font-weight: 600; }
.bau-wahl-unten { display: flex; justify-content: space-between; gap: 10px; }
/* Viele Zimmer (Handy): Die Knöpfe bleiben unten sichtbar, die Karten rollen. */
.is-raumwahl .bau-wahl-unten, .is-artwahl .bau-wahl-unten {
  position: sticky;
  bottom: -16px;
  margin: 0 -16px -16px;
  padding: 2px 16px 12px;
  background: #fffdf8;
  box-shadow: 0 -10px 12px -8px rgba(36, 48, 71, 0.12);
}
.bau-ok {
  height: 56px;
  margin-top: 6px;
  padding: 0 24px;
  border: 3px solid #ffffff;
  border-radius: 999px;
  background: #3fbf74;
  color: #ffffff;
  font-weight: 800;
  font-size: 1.2rem;
  box-shadow: 0 8px 16px rgba(47, 158, 92, 0.35);
}
.is-hauswahl .bau-ok, .is-fassade .bau-ok { display: block; margin: 14px auto 0; }
.bau-ok:disabled { opacity: 0.45; box-shadow: none; }
.bau-abbrechen { height: 56px; margin-top: 6px; padding: 0 18px; border: none; border-radius: 999px; background: #edf2f7; color: #4a5568; font-weight: 800; }
.bau-fassade-zeile h3 { margin: 6px 4px; font-size: 1.15rem; }
.bau-fassade-zeile .bau-farbreihe { flex-wrap: wrap; }

/* --- Ein anderes Gerät ist schon eine Fassung weiter (bau-stand.js, FORMAT) --- */
.bau-neuer {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(460px, calc(100% - 32px));
  padding: 20px 22px 22px;
  border-radius: 26px;
  background: #fffdf8;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.25);
  text-align: center;
}
.bau-neuer p { margin: 0 0 14px; font-size: 1.35rem; font-weight: 800; line-height: 1.25; }
.bau-neuer-knopf {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 56px;
  padding: 0 24px;
  border: 3px solid #ffffff;
  border-radius: 999px;
  background: #3fbf74;
  color: #ffffff;
  font: inherit;
  font-weight: 800;
  font-size: 1.2rem;
  box-shadow: 0 8px 16px rgba(47, 158, 92, 0.35);
}
.bau-neuer-knopf svg { width: 26px; height: 26px; }

/* --- Handy im Querformat: alles etwas kleiner --- */
@media (max-height: 520px) {
  .bau-tab { height: 44px; padding: 0 8px 0 6px; }
  .bau-tab-name { display: none; }
  .bau-tab-zeichen { width: 26px; height: 26px; }
  .bau-hud { top: calc(var(--safe-top, 0px) + 66px); gap: 6px; }
  .bau-ziegel { min-height: 44px; font-size: 1.4rem; padding: 0 10px 0 2px; }
  .bau-ziegel-bild { width: 40px; height: 36px; }
  .bau-raetsel { min-width: 72px; padding: 4px 8px; font-size: 0.95rem; }
  .bau-raetsel-bild { width: 28px; height: 28px; }
  .bau-rund { width: 44px; height: 44px; }
  .bau-rund svg { width: 24px; height: 24px; }
  .bau-ansichtknopf { width: 52px; height: 52px; border-radius: 16px; bottom: calc(var(--safe-bottom, 0px) + 10px); }
  .bau-ansichtknopf svg { width: 32px; height: 32px; }
  .bau-kopfzeile { top: calc(var(--safe-top, 0px) + 10px); left: calc(var(--safe-left, 0px) + 168px); right: calc(var(--safe-right, 0px) + 202px); gap: 6px; }
  .bau-zimmerkopf, .bau-werkzeug { gap: 5px; }
  .bau-zimmername, .bau-zimmertier { height: 44px; font-size: 1rem; padding: 0 10px; }
  .bau-zimmername span { max-width: 7.5em; overflow: hidden; text-overflow: ellipsis; }
  .bau-zimmertier .bau-stern { width: 16px; height: 16px; }
  .bau-zimmertier-bild { width: 34px; height: 38px; }
  .bau-werkzeug .bau-rund { width: 44px; height: 44px; }
  .bau-tafel, .bau-uebersicht, .bau-wahl { padding-top: calc(var(--safe-top, 0px) + 62px); }
  .bau-bearbeiten { padding: 6px; gap: 4px; max-width: min(96vw, 300px); }
  .bau-bearbeiten .bau-farbe { width: 30px; height: 30px; }
  .bau-aktion { width: 42px; height: 42px; }
  .bau-schublade { height: 104px; border-radius: 18px 18px 0 0; }
  .bau-reiter { padding: 4px 8px 2px; }
  .bau-reiter-knopf { min-width: 44px; height: 38px; }
  .bau-reiter-knopf svg { width: 24px; height: 24px; }
  .bau-reiter-emoji { font-size: 1.2rem; }
  .bau-inhalt { gap: 6px; padding: 2px 8px 6px; }
  .bau-ding-knopf { width: 56px; height: 56px; padding: 3px; border-radius: 12px; }
  .bau-farbe { width: 36px; height: 36px; }
  .bau-muster { width: 44px; height: 44px; }
  /* Farben und Muster in einer einzigen Zeile: Für zwei ist zu wenig Platz. */
  .bau-inhalt.is-farben { flex-direction: row; align-items: center; justify-content: flex-start; overflow-x: auto; overflow-y: hidden; touch-action: pan-x; }
  .bau-inhalt.is-farben > .bau-farbreihe,
  .bau-inhalt.is-farben > .bau-musterreihe { display: contents; }
  .bau-muell { bottom: 114px; width: 60px; height: 60px; }
  .bau-wunschliste { grid-template-columns: minmax(0, 1fr); }
  .bau-tafel-kopf { gap: 8px; }
  .bau-tafel-tier { width: 60px; height: 76px; }
  .bau-tafel-wer h2 { font-size: 1.4rem; }
  .bau-sternkachel { margin-top: 8px; padding: 6px 10px; gap: 4px 10px; border-radius: 16px; }
  .bau-stern.bau-stern-gross { width: 32px; height: 32px; }
  .bau-sternkachel-text b { font-size: 1.2rem; }
  .bau-sternkachel.is-alle .bau-sternkachel-text b { font-size: 1.3rem; }
  .bau-sternkachel-pokal { font-size: 2rem; }
  .bau-sternband, .bau-leiterband { top: calc(var(--safe-top, 0px) + 66px); gap: 8px; padding: 4px 12px 4px 6px; border-width: 3px; }
  .bau-sternband-tier { width: 44px; height: 52px; }
  .bau-sternband-text b { font-size: 1.35rem; }
  .bau-sternband-text span { font-size: 0.9rem; }
  .bau-sternband .bau-stern-gross { width: 26px; height: 26px; }
  .is-hauswahl .bau-wahl-bild { height: 96px; }
  .bau-bewohnerknopf { top: calc(var(--safe-top, 0px) + 80px); width: 78px; padding: 5px 2px 4px; border-radius: 18px; font-size: 0.8rem; }
  .bau-bewohnerknopf-bild { width: 26px; height: 26px; }
  .bau-bewohnerknopf-zahl { top: -7px; right: -7px; min-width: 24px; height: 24px; font-size: 0.85rem; }
  .bau-leiterknopf { top: calc(var(--safe-top, 0px) + 142px); width: 78px; padding: 4px 6px 4px; gap: 3px; border-radius: 18px; }
  .bau-leiterknopf-zahl { font-size: 1.15rem; }
  .bau-leiterknopf-zahl .bau-stern { width: 19px; height: 19px; }
  .bau-leiterknopf-balken { height: 7px; }
  .bau-leiterknopf-text { font-size: 0.66rem; }
  .bau-leiter-stufe { gap: 8px; padding: 4px 10px 4px 5px; border-radius: 16px; }
  .bau-leiter-marke { width: 42px; height: 42px; font-size: 0.92rem; }
  .bau-leiter-bild { width: 62px; height: 46px; }
  .bau-leiter-text b { font-size: 1rem; }
  .bau-leiter-text span { font-size: 0.8rem; line-height: 1.2; }
  .bau-sternband-bild { width: 58px; height: 48px; }
  .bau-uebersicht-kopf h2 { font-size: 1.35rem; }
  .bau-uebersicht-kopf p { margin-top: 2px; font-size: 0.85rem; line-height: 1.25; }
  .bau-uebersicht-wohnung { margin-top: 10px; }
  .bau-uebersicht-stock { font-size: 1rem; margin-bottom: 6px; }
  .bau-uebersicht-liste { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 8px; }
  .bau-bewohner { gap: 6px; padding: 5px 8px 6px 4px; border-radius: 16px; }
  .bau-bewohner-bild, .bau-bewohner-bild svg { width: 50px; height: 62px; }
  .bau-bewohner-text { gap: 2px; }
  .bau-bewohner-name { font-size: 1.05rem; }
  /* Die Art zeigt schon das Bild – auf dem Handy zählt jede Zeile. */
  .bau-bewohner-art { display: none; }
  .bau-bewohner-sterne, .bau-bewohner-traum { font-size: 0.88rem; }
  .bau-bewohner-sterne .bau-stern { width: 15px; height: 15px; }
  .bau-bewohner-wunsch { width: 31px; height: 31px; border-radius: 9px; }
  .bau-bewohner-wunsch svg { width: 25px; height: 25px; }
}

@media (max-width: 900px) and (min-height: 521px) {
  .bau-tab-name { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .bauecke, .bau-tafel-karte, .bau-uebersicht-karte, .bau-wahl-karte { animation: none; }
  .is-stups, .bau-sternkachel-pokal, .bau-sternband, .bau-leiterband, .bau-sternband .bau-stern, .bau-tab.hat-stern::before { animation: none; }
}

/* --- KiddyDome: Hinweis in der Zimmerwahl, Knopf zum Dazubauen --- */
.bau-wahl-unten { flex-wrap: wrap; }
.bau-wahl-hinweis {
  flex: 1 1 100%;
  margin: 6px 2px 0;
  padding: 8px 12px;
  border-radius: 14px;
  background: #eef8ff;
  color: #1f4f7a;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
}
.bau-wahl-hinweis[hidden] { display: none; }
.bau-wahl-hinweis.is-warnung { background: #fff4d6; color: #7a4b00; border: 2px solid #ffc93c; }
.bau-dazu {
  height: 56px;
  margin-top: 6px;
  padding: 0 24px;
  border: 3px solid #ffffff;
  border-radius: 999px;
  background: #e8763a;
  color: #ffffff;
  font-weight: 800;
  font-size: 1.2rem;
  box-shadow: 0 8px 16px rgba(232, 118, 58, 0.35);
}
.bau-ok[hidden], .bau-dazu[hidden] { display: none; }
.bauecke.kann-lesen .bau-wahl-hinweis { cursor: pointer; }

/* --- Eine Figur aus den Büchern: ihr Buch, klein, unten auf der Tafel --- */
.bau-tafel-buch {
  flex: 1 1 300px;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 6px 10px 6px 6px;
  border: 1px solid #eadfc8;
  border-radius: 14px;
  background: #fbf7ee;
}
.bau-tafel-buch img {
  flex: 0 0 auto;
  width: 56px;
  height: 36px;
  object-fit: cover;
  border-radius: 6px;
  box-shadow: 0 2px 5px rgba(36, 48, 71, 0.18);
}
.bau-tafel-buch p { margin: 0; color: #5f5340; font-size: 0.85rem; line-height: 1.25; }
.bau-tafel-buch b { display: block; color: #8a5734; }
.bauecke.kann-lesen .bau-tafel-buch { cursor: pointer; }

/* Die Verläufe der Tiere: unsichtbar, aber im Dokument (nicht display:none,
   sonst zeichnet nicht jeder Browser die Verläufe). */
.bau-tierdefs { position: absolute; width: 0; height: 0; overflow: hidden; pointer-events: none; }

/* =========================================================================
   Seit Oktober 2026: Stufen, Lage, Traumjob-Stern, Spital, Hotel, Album,
   Ruhmeshalle, Neustart, Tragen, Spiele
   ========================================================================= */

/* Sterne: lila für die Lage der Wohnung, golden für den Traumjob, rosa für
   ein Baby. */
.bau-stern.is-lila { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2.1L14.76 9.1L22.27 9.56L16.47 14.35L18.35 21.64L12 17.6L5.65 21.64L7.53 14.35L1.73 9.56L9.24 9.1Z' fill='%23fbf7ff' stroke='%23b48ae6' stroke-width='1.6' stroke-linejoin='round' stroke-dasharray='2.6 1.7'/%3E%3C/svg%3E"); }
.bau-stern.is-lila.is-voll { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2.1L14.76 9.1L22.27 9.56L16.47 14.35L18.35 21.64L12 17.6L5.65 21.64L7.53 14.35L1.73 9.56L9.24 9.1Z' fill='%23a46be0' stroke='%236b36b5' stroke-width='1.7' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.bau-stern.is-gold { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2.1L14.76 9.1L22.27 9.56L16.47 14.35L18.35 21.64L12 17.6L5.65 21.64L7.53 14.35L1.73 9.56L9.24 9.1Z' fill='%23fffaf0' stroke='%23e0a92a' stroke-width='1.6' stroke-linejoin='round' stroke-dasharray='2.6 1.7'/%3E%3C/svg%3E"); }
.bau-stern.is-gold.is-voll { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' y1='0' x2='0' y2='1'%3E%3Cstop offset='0' stop-color='%23fff3b0'/%3E%3Cstop offset='0.55' stop-color='%23ffc928'/%3E%3Cstop offset='1' stop-color='%23e08a00'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath d='M12 2.1L14.76 9.1L22.27 9.56L16.47 14.35L18.35 21.64L12 17.6L5.65 21.64L7.53 14.35L1.73 9.56L9.24 9.1Z' fill='url(%23g)' stroke='%239c5f00' stroke-width='1.7' stroke-linejoin='round'/%3E%3Cpath d='M9.4 9.8l1.4-.2.6-1.6' fill='none' stroke='%23ffffff' stroke-width='1.3' stroke-linecap='round'/%3E%3C/svg%3E"); }
.bau-stern.is-rosa { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2.1L14.76 9.1L22.27 9.56L16.47 14.35L18.35 21.64L12 17.6L5.65 21.64L7.53 14.35L1.73 9.56L9.24 9.1Z' fill='%23fff6fa' stroke='%23f09cc0' stroke-width='1.6' stroke-linejoin='round' stroke-dasharray='2.6 1.7'/%3E%3C/svg%3E"); }
.bau-stern.is-rosa.is-voll { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2.1L14.76 9.1L22.27 9.56L16.47 14.35L18.35 21.64L12 17.6L5.65 21.64L7.53 14.35L1.73 9.56L9.24 9.1Z' fill='%23ff8fbb' stroke='%23cc4b82' stroke-width='1.7' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.bau-wunsch.is-lila { border-color: #e3d2fa; }
.bau-wunsch.is-rosa { border-color: #fbd3e4; }
.bau-bewohner-wunsch.is-lila { border-color: #b48ae6; }
.bau-bewohner-wunsch.is-rosa { border-color: #f09cc0; }

/* Die Medaillen der drei Stufen (bau-schmuck.js). */
.bau-medaille { display: inline-block; flex: 0 0 auto; vertical-align: middle; }
.bau-medaille-ersatz { display: inline-grid; place-items: center; width: 1.3em; height: 1.3em; border-radius: 50%; color: #ffffff; font-size: 0.8em; }
.bau-medaille-ersatz.is-bronze { background: #c87f45; }
.bau-medaille-ersatz.is-silber { background: #a9b4c2; }
.bau-medaille-ersatz.is-gold { background: #f2b705; }
.bau-stufe { display: inline-flex; align-items: center; margin-right: 2px; }
.bau-sternzahl .bau-stufe { margin-right: 1px; }
.bau-sternkachel-stufen { display: flex; gap: 6px; flex: 0 0 100%; }
.bau-sternkachel-stufe {
  display: flex; align-items: center; gap: 3px;
  padding: 2px 10px 2px 4px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.6); color: #8a94a6; font-weight: 800;
  opacity: 0.55; filter: grayscale(0.8);
}
.bau-sternkachel-stufe small { font-size: 0.85rem; }
.bau-sternkachel-stufe.is-geschafft { opacity: 1; filter: none; color: #6b4100; }
.bau-sternkachel-stufe.is-jetzt { opacity: 1; filter: none; color: #243047; background: #ffffff; box-shadow: 0 0 0 2px #ffc23a; }
.bau-tafel-fertig { margin: 12px 2px 0; padding: 10px 14px; border-radius: 16px; background: #fff7cf; color: #6b4100; font-weight: 800; }

/* Das Wehwehchen und das Baby auf der Tafel. */
.bau-tafel-weh {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px;
  margin-top: 10px; padding: 10px 12px; border-radius: 16px;
  background: #fff0f0; border: 2px solid #ffc9c9;
}
.bau-tafel-weh p { flex: 1 1 260px; margin: 0; font-weight: 700; color: #7a2b2b; }
.bau-insspital { background: #e5484d; }
.bau-tafel-baby { margin-top: 12px; padding: 10px 12px; border-radius: 18px; background: #fff3f8; border: 2px solid #fbd3e4; }
.bau-tafel-baby-kopf { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.bau-tafel-baby-kopf svg { width: 44px; height: 50px; flex: 0 0 auto; }
.bau-tafel-baby-kopf b { display: block; font-size: 1.2rem; color: #9c2f62; }
.bau-tafel-baby-kopf small { display: block; color: #8a4a68; font-weight: 700; font-size: 0.85rem; }

/* Feriengäste. */
.bau-gaststerne { display: inline-flex; gap: 1px; vertical-align: middle; }
.bau-gaststerne .bau-stern { width: 20px; height: 20px; }
.bau-sternband .bau-gaststerne .bau-stern { width: 24px; height: 24px; }
.bau-hotelruf { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 10px 2px 0; color: #4a5568; font-weight: 700; }
.bau-gastmarke { font-size: 1.4rem; }
.bau-tafel-karte.is-gast { background: linear-gradient(180deg, #faf6ff 0, #fffdf8 160px); }
.bau-zimmertier.is-gast { border-color: #c9b6f2; }

/* Im Zimmerkopf: wie viele Plätze das Zimmer hat. */
.bau-platz {
  display: inline-flex; align-items: center; gap: 4px; height: 52px; padding: 0 12px 0 8px;
  border: 3px solid #ffffff; border-radius: 999px; background: #eef7ff; color: #2457bf;
  font-weight: 800; font-size: 1.05rem; box-shadow: 0 4px 10px rgba(36, 48, 71, 0.15);
}
.bau-platz svg { width: 26px; height: 26px; color: #2457bf; }
.bau-platz.is-voll { background: #fff2e0; color: #b45309; }
.bau-platz.is-voll svg { color: #b45309; }

/* Der Spiel-Knopf im Zimmer – mit Punkt, solange es noch nicht geschafft ist. */
.bau-spielknopf { position: relative; color: #6b36b5; }
.bau-spielknopf.is-neu::after {
  content: ""; position: absolute; top: -2px; right: -2px; width: 14px; height: 14px;
  border: 2px solid #ffffff; border-radius: 50%; background: #ff5d8f;
}

/* Bänder: eine Stufe, ein Bonus-Stern, ein Baby, ein Gast. */
.bau-sternband.is-stufe { background: linear-gradient(180deg, #ffffff, #fff1c9); }
.bau-sternband.is-bonus { background: linear-gradient(180deg, #ffffff, #ffe9a8); }
.bau-sternband.is-baby { background: linear-gradient(180deg, #ffffff, #ffe0ee); border-color: #ff8fbb; }
.bau-sternband.is-gast { background: linear-gradient(180deg, #ffffff, #efe6ff); border-color: #b48ae6; }
.bau-sternband-emoji { font-size: 2.6rem; line-height: 1; }
.bau-sternband-heli { flex: 0 0 auto; }
.bau-sternband .bau-pokal { flex: 0 0 auto; }

/* Der Helikopter und der Storch fliegen auf einer Ebene wie die Züge. */
.bau-heli { cursor: pointer; }

/* Tragen: der Bewohner hängt am Finger, das Ziel-Zimmer leuchtet. */
.bau-trage {
  position: absolute; left: 0; top: 0; z-index: 30; width: 70px; height: 84px;
  pointer-events: none; filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.3));
}
.bau-trage svg { width: 100%; height: 100%; }
.bau-raum.is-trageziel { filter: brightness(1.12) drop-shadow(0 0 10px rgba(255, 209, 102, 0.95)); }
.bau-ruhmhalle { cursor: pointer; }

/* --- Links unter der Sternenleiter: Sammelalbum und Ruhmeshalle --- */
.bau-seite {
  position: absolute;
  top: calc(var(--safe-top, 0px) + 262px);
  left: calc(var(--safe-left, 0px) + 14px);
  z-index: 6;
  display: flex;
  gap: 4px;
  width: 92px;
}
.bau-seitenknopf {
  flex: 1 1 0;
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  min-width: 0; height: 58px; padding: 5px 0 3px;
  border: 3px solid #ffffff; border-radius: 16px;
  color: #ffffff; font-weight: 800; font-size: 0.7rem; line-height: 1;
}
.bau-seitenknopf svg { width: 28px; height: 28px; }
.bau-albumknopf { background: linear-gradient(180deg, #8fb6f5, #4f8ef7); box-shadow: 0 6px 14px rgba(36, 87, 191, 0.32); }
.bau-ruhmknopf { background: linear-gradient(180deg, #c9a2f5, #8f5fd8); box-shadow: 0 6px 14px rgba(107, 54, 181, 0.32); }
.bau-seitenknopf:active { transform: scale(0.94); }
.bauecke.ist-zimmer .bau-seite,
.bauecke.ist-ordnen .bau-seite { display: none; }

/* --- Das Sammelalbum --- */
.bau-album-karte { width: min(1000px, 96vw); }
.bau-album-reiter { display: flex; gap: 6px; overflow-x: auto; margin: 10px 0 6px; padding-bottom: 4px; }
.bau-album-tab {
  flex: 0 0 auto; display: flex; align-items: center; gap: 6px; height: 46px; padding: 0 14px;
  border: 2px solid #e2e8f0; border-radius: 999px; background: #ffffff; color: #243047; font-weight: 800; font-size: 1rem;
}
.bau-album-tab.is-aktiv { background: #4f8ef7; border-color: #4f8ef7; color: #ffffff; }
.bau-album-gruppe { margin-top: 12px; }
.bau-album-gruppe h3 { margin: 0 0 8px; font-size: 1.1rem; }
.bau-album-raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.bau-album-feld {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px;
  min-height: 96px; padding: 6px 4px; border: 2px dashed #d5dbe5; border-radius: 16px; background: #f5f7fa; color: #8a94a6;
  font-weight: 800; font-size: 0.82rem;
}
.bau-album-feld.is-hat { border-style: solid; border-color: #ffd166; background: #fffaf0; color: #243047; }
.bau-album-feld.is-selten.is-hat { border-color: #b48ae6; background: #faf6ff; }
.bau-album-feld.is-klein { min-height: 70px; }
.bau-album-bild { position: relative; display: grid; place-items: center; height: 62px; }
.bau-album-feld.is-klein .bau-album-bild { height: 40px; }
.bau-album-bild svg { width: 54px; height: 62px; }
.bau-album-feld.is-klein .bau-album-bild svg { width: 40px; height: 40px; }
.bau-album-frage { position: absolute; inset: 0; display: grid; place-items: center; color: #6b7a90; font-size: 1.8rem; }
.bau-album-name { text-align: center; line-height: 1.1; }
.is-grau { filter: grayscale(1) brightness(1.25) opacity(0.45); }
.bau-album-raster { grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); }
.bau-album-raster .bau-album-feld.is-klein { min-width: 0; }
.bau-album-satz { margin: 8px 2px; color: #4a5568; font-weight: 700; }
.bau-album-balken { position: relative; height: 26px; margin: 10px 0; overflow: hidden; border-radius: 999px; background: #eef2f7; }
.bau-album-balken span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #ffd166, #ff9f1c); }
.bau-album-balken b { position: absolute; inset: 0; display: grid; place-items: center; color: #243047; }

/* --- Die Ruhmeshalle --- */
.bau-ruhm-karte { width: min(820px, 96vw); background: linear-gradient(180deg, #f7f2ff 0, #fffdf8 220px); }
.bau-ruhm-kopf { display: flex; align-items: center; gap: 12px; }
.bau-ruhm-halle { width: 84px; height: 80px; flex: 0 0 auto; }
.bau-ruhm-jetzt { margin-top: 12px; padding: 12px 14px; border-radius: 20px; background: #ffffff; border: 3px solid #e3d2fa; }
.bau-ruhm-jetzt h3 { margin: 0 0 6px; }
.bau-ruhm-zeile, .bau-ruhm-eintrag { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.bau-ruhm-text { display: flex; flex-direction: column; flex: 1 1 200px; line-height: 1.2; }
.bau-ruhm-text b { font-size: 1.2rem; color: #243047; }
.bau-ruhm-text span { color: #4a5568; font-weight: 700; }
.bau-ruhm-keinpokal { filter: grayscale(1); opacity: 0.35; }
.bau-ruhm-pokale { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.bau-ruhm-pokalstufe {
  display: flex; align-items: center; gap: 6px; padding: 4px 12px 4px 6px;
  border: 2px solid #e2e8f0; border-radius: 16px; background: #f8fafc; color: #4a5568; text-align: left;
  filter: grayscale(0.9); opacity: 0.7;
}
.bau-ruhm-pokalstufe span { display: flex; flex-direction: column; line-height: 1.1; }
.bau-ruhm-pokalstufe.is-erreicht { filter: none; opacity: 1; border-color: #ffd166; background: #fffaf0; color: #243047; }
.bau-neustartknopf { margin-top: 4px; }
.bau-ruhm-liste { margin-top: 14px; }
.bau-ruhm-liste h3 { margin: 0 0 8px; }
.bau-ruhm-eintrag { margin-bottom: 8px; padding: 8px 12px; border-radius: 18px; background: #ffffff; border: 2px solid #f3dfa8; }
.bau-ruhm-pokal { min-width: 40px; }
.bau-ruhm-dorf { height: 70px; max-width: 100%; }
.bau-pokal-ersatz { font-size: 2rem; }

/* --- Ein neues Dorf gründen --- */
.bau-neustart-liste { display: flex; flex-direction: column; gap: 6px; margin: 4px 0 10px; padding: 0 0 0 22px; color: #243047; font-weight: 600; line-height: 1.3; }
.bau-neustart-liste li::marker { color: #8f5fd8; }
.bau-neustart-pokal { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 6px 0 10px; font-size: 1.3rem; color: #6b4100; }
.bau-ok.is-neustart { background: #8f5fd8; }
.bau-wahl-bild.is-figur { display: grid; place-items: center; }
.bau-wahl-bild.is-figur svg { width: 90px; height: 100px; }
.is-neustart .bau-wahl-karte { max-width: min(720px, 96vw); }

@media (max-height: 520px) {
  .bau-seite { top: calc(var(--safe-top, 0px) + 214px); width: 78px; }
  .bau-seitenknopf { height: 46px; border-radius: 14px; font-size: 0.6rem; }
  .bau-seitenknopf svg { width: 22px; height: 22px; }
  .bau-platz { height: 44px; font-size: 0.95rem; padding: 0 8px 0 6px; }
  .bau-platz svg { width: 20px; height: 20px; }
  .bau-sternkachel-stufe small { display: none; }
  .bau-album-raster { grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 6px; }
  .bau-album-feld { min-height: 78px; font-size: 0.72rem; }
  .bau-album-bild { height: 48px; }
  .bau-album-bild svg { width: 42px; height: 48px; }
  .bau-album-tab { height: 40px; padding: 0 10px; font-size: 0.9rem; }
  .bau-ruhm-halle { width: 56px; height: 54px; }
  .bau-ruhm-dorf { height: 50px; }
  .bau-neustart-liste { gap: 3px; font-size: 0.88rem; }
}
@media (prefers-reduced-motion: reduce) {
  .bau-spielknopf.is-neu::after { animation: none; }
}

/* Der Zimmerkopf wird knapper, wenn er nicht zwischen die festen Knöpfe
   passt (train-bau.js, passeKopfzeile): Stufe um Stufe, bis alles Platz hat.
   Nichts schrumpft von selbst – sonst liefe der Inhalt übereinander. */
.bau-kopfzeile .bau-zimmerkopf, .bau-kopfzeile .bau-werkzeug,
.bau-zimmername, .bau-zimmertier, .bau-platz { flex: 0 0 auto; }
/* 1: die Sterne in zwei Reihen */
.bau-kopfzeile.is-eng1 .bau-zimmertier .bau-sternreihe { display: inline-grid; grid-template-columns: repeat(3, auto); gap: 1px; }
.bau-kopfzeile.is-eng1 .bau-zimmertier .bau-stern { width: 15px; height: 15px; }
/* 2: ohne Laune */
.bau-kopfzeile.is-eng2 .bau-zimmertier .bau-laune { display: none; }
/* 3: der Name nur als Lautsprecher */
.bau-kopfzeile.is-eng3 .bau-zimmername { width: 52px; padding: 0; justify-content: center; }
.bau-kopfzeile.is-eng3 .bau-zimmername span { display: none; }
/* 4: alles etwas kleiner */
.bau-kopfzeile.is-eng4 { gap: 6px; }
.bau-kopfzeile.is-eng4 .bau-zimmerkopf, .bau-kopfzeile.is-eng4 .bau-werkzeug { gap: 5px; }
.bau-kopfzeile.is-eng4 .bau-zimmername, .bau-kopfzeile.is-eng4 .bau-zimmertier, .bau-kopfzeile.is-eng4 .bau-platz { height: 44px; }
.bau-kopfzeile.is-eng4 .bau-zimmername { width: 44px; }
.bau-kopfzeile.is-eng4 .bau-zimmertier { gap: 5px; padding: 0 8px 0 2px; }
.bau-kopfzeile.is-eng4 .bau-zimmertier-bild { width: 34px; height: 38px; }
.bau-kopfzeile.is-eng4 .bau-traumzeichen { width: 24px; height: 22px; }
.bau-kopfzeile.is-eng4 .bau-laune, .bau-kopfzeile.is-eng4 .bau-weh, .bau-kopfzeile.is-eng4 .bau-zimmertier-pokal { font-size: 1.1rem; }
.bau-kopfzeile.is-eng4 .bau-werkzeug .bau-rund { width: 44px; height: 44px; }
/* 5: statt der Sterne die Medaille der Stufe; wer hier arbeitet, nur als
   Bild (den Traumjob zeigt der goldene Rand) */
.bau-kopfzeile.is-eng5 .bau-zimmertier .bau-sternreihe, .bau-kopfzeile.is-eng5 .bau-zimmertier-name,
.bau-kopfzeile.is-eng5 .bau-sternzahl-zahl, .bau-kopfzeile.is-eng5 .bau-weh, .bau-kopfzeile.is-eng5 .bau-zimmertier-pokal,
.bau-kopfzeile.is-eng5 .bau-zimmertier.is-arbeit .bau-traumzeichen, .bau-kopfzeile.is-eng5 .bau-zimmertier.is-arbeit .bau-stern { display: none; }
.bau-kopfzeile.is-eng5 .bau-zimmertier .bau-sternzahl { display: inline-flex; }
.bau-kopfzeile.is-eng5 .bau-zimmertier { padding: 0 6px 0 2px; }
/* 6: nur zwei Leute, die anderen als «+3» */
.bau-zimmertier.is-mehr-eng { display: none; }
.bau-kopfzeile.is-eng6 .bau-zimmertier.is-weit, .bau-kopfzeile.is-eng6 .bau-zimmertier.is-mehr-weit { display: none; }
.bau-kopfzeile.is-eng6 .bau-zimmertier.is-mehr-eng { display: flex; }
/* 7: ohne den Namen des Zimmers (er kommt auch beim Hineingehen) */
.bau-kopfzeile.is-eng7 .bau-zimmername { display: none; }
/* 8: Reicht es immer noch nicht, rutschen die Knöpfe in eine zweite Zeile –
   lieber zwei Zeilen als ein verdeckter Knopf. */
.bau-kopfzeile.is-eng8, .bau-kopfzeile.is-eng8 .bau-zimmerkopf { flex-wrap: wrap; row-gap: 6px; }
.bau-kopfzeile.is-eng8 .bau-zimmerkopf { flex: 0 1 auto; min-width: 0; }
