/* Der Stadtbauer (A.22.0.0): Glas-Look wie die anderen Werkzeuge, Würfel auf dunklem Spieltisch, Baustellen als Karten
   mit Baufortschritt (das farbige Bild wächst von unten über das graue), Grafiken Stil A „Miniatur“. */

.buehne-sb { width: min(100%, 1120px); margin: 0 auto; padding: 6px 14px 26px; }

/* ---------- Start ---------- */
.sb-start { display: grid; justify-items: center; gap: 10px; max-width: 560px; margin: 0 auto; padding: 18px 16px 22px; border-radius: 30px; background: var(--flaeche); box-shadow: var(--schatten-klein); text-align: center; }
.sb-start[hidden], .sb-spiel[hidden], .sb-tafel[hidden], .sb-reiter[hidden], .sb-reiter [hidden] { display: none !important; }
.sb-start-bild { width: 150px; height: 150px; animation: sb-schweben 4s ease-in-out infinite; }
@keyframes sb-schweben { 50% { transform: translateY(-8px) rotate(-1deg); } }
.sb-start-titel { margin: 0; font-family: var(--schrift-titel); font-size: clamp(1.9rem, 7vw, 2.6rem); letter-spacing: -.02em; }
.sb-start-text { margin: 0; max-width: 34em; color: var(--tusche-weich); line-height: 1.5; }
.sb-start-bilder { display: flex; gap: 6px; }
.sb-start-bilder img { width: 88px; height: 88px; }
.sb-start-wer { margin: 0; font-weight: 650; }
.sb-start-knoepfe { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }

/* ---------- Leiste und Mitspieler ---------- */
.sb-leiste { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; margin-bottom: 10px; }
.sb-leiste > span { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; background: var(--flaeche); box-shadow: var(--schatten-klein); font-weight: 700; font-size: .92rem; }
.sb-uhr img { width: 26px; height: 26px; margin: -4px 0; }
.sb-uhr.knapp { background: #fef3c7; color: #92400e; }
/* A.22.13.0 Stellengesuche und Polier */
.sb-gesuche img { width: 24px; height: 24px; margin: -4px 0; }
.sb-gesuche[hidden] { display: none !important; }
.sb-gesuche.bereit { background: #dcfce7; color: #166534; box-shadow: 0 0 0 2px #22c55e, var(--schatten-klein); }
#polierKnopf img { width: 28px; height: 28px; margin: -6px 2px -6px -6px; }
#polierKnopf.an { outline: 3px solid #c6f135; outline-offset: 2px; }
.sb-gegner { display: flex; gap: 10px; margin: 0 0 8px; padding: 2px 2px 8px; list-style: none; overflow-x: auto; scrollbar-width: thin; }
.sb-g { flex: 1 0 210px; max-width: 320px; padding: 8px 10px; border-radius: 18px; background: var(--flaeche); box-shadow: var(--schatten-klein); border: 2px solid transparent; transition: border-color .2s; }
.sb-g.dran { border-color: rgba(67, 56, 202, .45); }
.sb-g.waehlt { border-color: #16a34a; box-shadow: 0 0 0 4px rgba(22, 163, 74, .15), var(--schatten-klein); }
.sb-g-kopf { display: flex; align-items: center; gap: 8px; }
.sb-g-bild { width: 40px; height: 40px; border-radius: 50%; background: #eef2ff; object-fit: cover; flex: none; }
.sb-g-bild.ohne { display: grid; place-items: center; font-weight: 800; color: #4338ca; }
.sb-g-name { display: grid; min-width: 0; }
.sb-g-name strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-g-name small { color: var(--tusche-weich); font-size: .78rem; }
.sb-g-bau { display: flex; gap: 4px; margin-top: 6px; }
.sb-g-mini { position: relative; flex: 1 1 0; min-width: 0; aspect-ratio: 1; border-radius: 10px; background: #f1f0fb; border-bottom: 3px solid var(--stufe, #cbd5e1); overflow: hidden; }
.sb-g-mini.bronze { --stufe: #b45309; } .sb-g-mini.silber { --stufe: #64748b; } .sb-g-mini.gold { --stufe: #ca8a04; }
.sb-g-mini img { position: absolute; inset: 6%; width: 88%; height: 88%; object-fit: contain; }
.sb-ticker { min-height: 1.4em; margin: 0 auto 10px; max-width: 46em; text-align: center; font-weight: 600; color: var(--tusche-weich); font-size: .95rem; }

/* Baufortschritt: graues Bild, darüber das farbige von unten bis --fort */
.grau { filter: grayscale(1) brightness(1.08); opacity: .38; }
.farbe { clip-path: inset(calc((1 - var(--fort, 0)) * 100%) 0 0 0); transition: clip-path .6s ease; }

/* ---------- Wer fängt an? (A.22.14.0) ---------- */
.sb-auswurf { display: grid; gap: 6px; margin: 0 auto 10px; max-width: 46em; padding: 10px 12px; border-radius: 20px; background: var(--flaeche); box-shadow: 0 0 0 3px #c6f135, var(--schatten-klein); }
.sb-auswurf[hidden] { display: none; }
.sb-auswurf-titel { text-align: center; font-size: 1rem; }
.sb-auswurf-liste { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; margin: 0; padding: 0; list-style: none; }
.sb-auswurf-liste li { display: flex; align-items: center; gap: 6px; padding: 3px 10px 3px 3px; border-radius: 999px; background: #f4f3fb; }
.sb-auswurf-liste li.start { background: #ecfccb; box-shadow: 0 0 0 2px #65a30d; }
.sb-auswurf-bild { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; outline: 2px solid var(--farbe); }
.sb-auswurf-bild.ohne { display: grid; place-items: center; background: #eef2ff; color: #4338ca; font-weight: 800; font-size: .8rem; }
.sb-auswurf-name { font-weight: 700; font-size: .9rem; }
.sb-auswurf-wuerfe { display: flex; gap: 4px; }
.sb-auswurf-w { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; background: linear-gradient(160deg, #fff, #e8e6f7); box-shadow: inset 0 -3px 0 rgba(30, 27, 75, .14), 0 3px 6px rgba(0, 0, 0, .2); font-family: var(--schrift-titel); font-weight: 800; color: #1e1b4b; animation: sb-auswurf .7s ease-out both; }
.sb-auswurf-w + .sb-auswurf-w { opacity: .9; }
@keyframes sb-auswurf { 0% { transform: rotate(-200deg) scale(.4); opacity: 0; } 70% { transform: rotate(15deg) scale(1.1); opacity: 1; } 100% { transform: none; } }
.sb-auswurf-marke { color: #3f6212; font-weight: 800; font-size: .76rem; }

/* ---------- Würfeltisch ---------- */
.sb-tisch { display: grid; gap: 10px; padding: 12px; border-radius: 24px; background: radial-gradient(circle at 30% 20%, #3b3591, #241f5c 70%); box-shadow: inset 0 2px 14px rgba(0, 0, 0, .35), var(--schatten-klein); }
.sb-tisch[hidden] { display: none; }
.sb-wuerfel-reihe { display: flex; align-items: center; gap: 10px; }
.sb-steuer[hidden] { display: none; }
/* A.22.17.0: bei Spielende bleiben nur die Reiter (am Handy: Endstadt ansehen), in der Schlussphase dazu die Anweisung */
.sb-steuer.vorbei > :not(.sb-reiter), .sb-steuer.schluss > :not(.sb-reiter):not(.sb-anweisung) { display: none; }
.sb-reihe-titel { flex: none; width: 5.8em; color: #c7d2fe; font-weight: 700; font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; }
.sb-wuerfel { display: flex; flex-wrap: wrap; gap: 10px; }
.sb-w { position: relative; display: grid; place-items: center; width: 60px; height: 60px; padding: 0; border: 0; border-radius: 16px; background: linear-gradient(160deg, #fff, #e8e6f7); box-shadow: inset 0 -5px 0 rgba(30, 27, 75, .14), 0 8px 16px rgba(0, 0, 0, .3); font: inherit; cursor: pointer; transition: transform .12s, opacity .2s; }
.sb-w b { font-family: var(--schrift-titel); font-size: 2rem; font-weight: 800; color: #1e1b4b; }
.sb-w img { width: 46px; height: 46px; object-fit: contain; }
.sb-w:disabled { cursor: default; }
.sb-w:not(:disabled):hover { transform: translateY(-2px); }
.sb-w:focus-visible { outline: 3px solid #c6f135; outline-offset: 2px; }
.sb-w.gewaehlt { outline: 4px solid #c6f135; outline-offset: 3px; transform: translateY(-3px); }
.sb-w.weg { opacity: .22; filter: grayscale(.7); }
.sb-w.leer { background: rgba(255, 255, 255, .08); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .14); cursor: default; }
.sb-w.rollt { animation: sb-rollen .3s ease-in-out infinite; }
@keyframes sb-rollen { 25% { transform: rotate(-12deg) translateY(-6px); } 75% { transform: rotate(10deg) translateY(-3px); } }
.sb-w.karte { background: linear-gradient(160deg, #f5f3ff, #ddd6fe); }
#nehmenKnopf img { width: 28px; height: 28px; margin: -4px 4px -4px -4px; }
/* viele Baumeister ⇒ bis zu 7 Würfel je Reihe: kleiner, damit sie am Handy in eine Zeile passen */
.sb-tisch[data-anzahl="6"] .sb-w, .sb-tisch[data-anzahl="7"] .sb-w { width: 50px; height: 50px; }
/* A.22.10.0 Arbeiter-Würfel: Figur, unten rechts der Baustoff */
.sb-w.arbeiter { background: linear-gradient(160deg, #fff7ed, #fde7c8); }
.sb-w .sb-w-figur { width: 88%; height: 88%; object-fit: contain; }
.sb-w .sb-w-stoff { position: absolute; right: -4px; bottom: -4px; width: 40%; height: 40%; padding: 2px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, .3); }
.sb-bedarf-arbeiter { width: 24px; height: 24px; flex: none; opacity: .28; filter: grayscale(1); }
.sb-bedarf li.wartet, .sb-bedarf li.voll.wartet { background: #fef3c7; box-shadow: inset 0 0 0 1.5px #f59e0b; }
.sb-bedarf li.wartet .sb-bedarf-arbeiter { opacity: .75; filter: none; animation: sb-wartet 1.4s ease-in-out infinite; }
@keyframes sb-wartet { 50% { transform: translateY(-2px); } }
.sb-bedarf li.ab .sb-bedarf-arbeiter { opacity: 1; filter: none; }
.sb-bedarf li.hier { box-shadow: 0 0 0 2px #16a34a; }
.sb-w-mod { position: absolute; top: -8px; right: -8px; padding: 1px 6px; border-radius: 999px; background: #c6f135; color: #1a2e05; font-weight: 800; font-size: .72rem; }

.sb-anweisung { min-height: 1.5em; margin: 12px auto 6px; max-width: 40em; text-align: center; font-weight: 700; font-size: 1.05rem; text-wrap: balance; }
/* A.22.20.0: „Nichts passt“ deutlich — Band, blasse Würfel, Passen-Knopf als Hauptknopf (app.js nichtsPasst) */
.sb-anweisung.nichts { width: fit-content; padding: 3px 16px; border-radius: 999px; background: #fef3c7; color: #92400e; box-shadow: 0 0 0 2px #f59e0b; animation: sb-nichts .5s ease-out; }
@keyframes sb-nichts { 0% { transform: scale(.9); opacity: 0; } 60% { transform: scale(1.04); opacity: 1; } 100% { transform: none; } }
body.sb-nichts .sb-tisch .sb-w:not(.weg) { opacity: .4; filter: grayscale(.8); }
@media (prefers-reduced-motion: reduce) { .sb-anweisung.nichts { animation: none; } }
.sb-mods { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; margin: 0 auto 6px; max-width: 46em; }
.sb-mods[hidden] { display: none; }
.sb-mods p { width: 100%; margin: 0; text-align: center; font-weight: 650; }
.sb-mod { padding: 4px 10px; border-radius: 999px; background: #ede9fe; color: #4c1d95; font-weight: 700; font-size: .88rem; }
.sb-stoffwahl { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.sb-stoffknopf { display: grid; justify-items: center; gap: 2px; width: 74px; padding: 6px 4px; border: 0; border-radius: 14px; background: #fff; box-shadow: var(--schatten-klein); font: inherit; font-weight: 650; font-size: .8rem; cursor: pointer; }
.sb-stoffknopf img { width: 44px; height: 44px; }
.sb-aktionen { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-bottom: 8px; }
.sb-aktionen [hidden] { display: none; }
.knopf.klein { min-height: 36px; padding: 0 12px; font-size: .88rem; }

/* ---------- Baustellen ---------- */
.sb-titel { margin: 16px 0 8px; font-size: 1.1rem; }
.sb-baustellen { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 860px) { .sb-baustellen { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.sb-bau { position: relative; display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 10px; border: 0; border-top: 6px solid var(--stufe, #cbd5e1); border-radius: 20px; background: #fff; box-shadow: 0 8px 22px rgba(40, 30, 90, .1); font: inherit; color: inherit; text-align: left; }
.sb-bau.bronze { --stufe: #b45309; } .sb-bau.silber { --stufe: #64748b; } .sb-bau.gold { --stufe: #ca8a04; }
.sb-bau.ziel { cursor: pointer; box-shadow: 0 0 0 3px #16a34a, 0 0 0 9px rgba(22, 163, 74, .18), 0 10px 24px rgba(22, 163, 74, .2); animation: sb-ziel 1.4s ease-in-out infinite; }
@keyframes sb-ziel { 50% { box-shadow: 0 0 0 3px #16a34a, 0 0 0 13px rgba(22, 163, 74, .08), 0 10px 24px rgba(22, 163, 74, .2); } }
.sb-bau.ziel:focus-visible { outline: 3px solid #4338ca; outline-offset: 3px; }
.sb-bau-kopf { display: flex; justify-content: space-between; align-items: flex-start; gap: 6px; }
.sb-bau-titel { display: grid; min-width: 0; }
.sb-stufe { font-size: .68rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--stufe); }
.sb-bau-name { font-size: .98rem; line-height: 1.2; }
.sb-pkt { flex: none; display: grid; place-items: center; min-width: 34px; height: 34px; padding: 0 6px; border-radius: 50%; background: #1e1b4b; color: #fde68a; font-weight: 800; }
.sb-bau-bild { position: relative; width: 100%; max-width: 170px; aspect-ratio: 1; margin: 0 auto; }
.sb-bau-bild img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.sb-bedarf { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.sb-bedarf li { display: flex; align-items: center; gap: 6px; padding: 3px 6px; border-radius: 10px; background: #f4f3fb; }
.sb-bedarf li.voll { background: #dcfce7; }
.sb-bedarf img { width: 26px; height: 26px; flex: none; }
.sb-bedarf-name { flex: 1; min-width: 0; font-weight: 650; font-size: .82rem; overflow: hidden; text-overflow: ellipsis; }
.sb-plaetze { display: flex; gap: 3px; }
.sb-plaetze i { width: 14px; height: 14px; border-radius: 4px; border: 2px solid #c7c3e6; background: #fff; }
.sb-plaetze i.da { background: #16a34a; border-color: #15803d; }
.sb-bau.leer { justify-content: center; align-items: center; text-align: center; border-top-color: #cbd5e1; background: rgba(255, 255, 255, .7); }
.sb-bau-leerbild { width: 70%; max-width: 140px; opacity: .9; }
.sb-bau-frage { margin: 0; color: var(--tusche-weich); font-weight: 600; font-size: .88rem; }
.sb-stapel-wahl { display: grid; gap: 6px; width: 100%; }
.sb-stapel { justify-content: space-between; min-height: 40px; padding: 0 12px; color: #fff; font-weight: 800; }
.sb-stapel small { font-weight: 600; opacity: .9; }
.sb-stapel.bronze { background: #b45309; } .sb-stapel.silber { background: #475569; } .sb-stapel.gold { background: #a16207; }

/* ---------- Grundriss und Stadt (A.22.2.0) ---------- */
.sb-bau-rechts { display: grid; justify-items: end; gap: 4px; flex: none; }
.sb-form { --zf: 7px; display: grid; grid-template-columns: repeat(var(--w), var(--zf)); grid-auto-rows: var(--zf); gap: 1px; }
.sb-form i { border-radius: 2px; }
.sb-form i.an { background: var(--stufe, #64748b); }
.sb-form.bronze { --stufe: #b45309; } .sb-form.silber { --stufe: #64748b; } .sb-form.gold { --stufe: #ca8a04; }
.sb-form.gross { --zf: 16px; gap: 2px; padding: 6px; border-radius: 10px; background: #f4f3fb; }
.sb-form.gross i { border-radius: 4px; }
/* A.22.9.0: EINE Stadtkarte für alle — Wiese (Hintergrund), Straßen, Fluss, Bäume; Viertel als Grundstücke */
.sb-stadt-kopf { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sb-stadt-kopf .sb-titel { margin: 0; }
#lupe { display: none; }
.sb-stadt { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.sb-karte-rahmen { overflow-x: auto; padding: 14px 4px 6px; border-radius: 22px; background: #fff; box-shadow: 0 10px 26px rgba(40, 30, 90, .12); }
.sb-karte { --kd: 3px; position: relative; width: min(100%, calc(var(--w) * 54px)); aspect-ratio: var(--w) / var(--h); margin: 0 auto; border-radius: 14px; background-repeat: repeat; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08); }
/* „Größer“ (.nah) gilt nur, wo es den Knopf gibt (≤ 600 px, siehe unten) — A.22.17.0: sonst blieb die Karte nach dem
   Drehen groß ohne Knopf */
.sb-karte-grund { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(var(--w), 1fr); grid-template-rows: repeat(var(--h), 1fr); border-radius: 14px; overflow: hidden; }
.sb-k { position: relative; }
.sb-k-bild { position: absolute; inset: -12% -8% 4%; width: 116%; height: 108%; object-fit: contain; filter: drop-shadow(0 3px 2px rgba(0, 0, 0, .3)); pointer-events: none; }
.sb-k.wasser { background-size: 400% 400%; }
.sb-k.wasser .sb-k-bild { inset: -6%; width: 112%; height: 112%; }
.sb-k.weg { background: #5d6472; }
.sb-k.weg.waag { box-shadow: inset 0 2px 0 #a8afbd, inset 0 -2px 0 #a8afbd; }
.sb-k.weg.senk { box-shadow: inset 2px 0 0 #a8afbd, inset -2px 0 0 #a8afbd; }
.sb-k.weg.waag::after, .sb-k.weg.senk::after { content: ''; position: absolute; background: rgba(255, 255, 255, .85); border-radius: 2px; }
.sb-k.weg.waag::after { left: 22%; right: 22%; top: calc(50% - 1px); height: 2px; }
.sb-k.weg.senk::after { top: 22%; bottom: 22%; left: calc(50% - 1px); width: 2px; }
.sb-zelle { --kante: rgba(255, 255, 255, .9); position: relative; padding: 0; border: 0 solid var(--kante); background-size: 400% 400%; font: inherit; box-shadow: inset 0 0 0 .5px rgba(255, 255, 255, .45); }
.v-markt { --ton: #b45309; } .v-altstadt { --ton: #7c2d12; } .v-hafen { --ton: #0369a1; } .v-neustadt { --ton: #15803d; } .v-zentrum { --ton: #4338ca; }
.sb-zelle.voll { --kante: #f59e0b; }
.sb-zelle:disabled { cursor: default; }
.sb-zelle.bebaut::after { content: ''; position: absolute; inset: 0; background: var(--farbe); opacity: .38; }
.sb-zelle.tippbar { cursor: pointer; }
.sb-zelle.tippbar::after { content: ''; position: absolute; inset: 2px; border: 2px solid #bbf7d0; border-radius: 4px; background: rgba(34, 197, 94, .3); animation: sb-tipp 1.6s ease-in-out infinite; }
@keyframes sb-tipp { 50% { background: rgba(34, 197, 94, .5); } }
.sb-zelle.vorschau::after { content: ''; position: absolute; inset: 0; background: rgba(22, 163, 74, .7); animation: none; border: 0; }
.sb-zelle:focus-visible { outline: 3px solid #4338ca; outline-offset: -3px; z-index: 1; }
.sb-haeuser, .sb-schilder { position: absolute; inset: 0; pointer-events: none; }
.sb-haus { position: absolute; object-fit: contain; transform: translateY(-10%) scale(1.12); filter: drop-shadow(0 5px 4px rgba(0, 0, 0, .38)); }
.sb-haus.geist { opacity: .75; filter: drop-shadow(0 0 6px rgba(255, 255, 255, .9)); animation: sb-geist 1.2s ease-in-out infinite; }
@keyframes sb-geist { 50% { opacity: .5; } }
.sb-fahne { position: absolute; display: grid; place-items: center; width: clamp(13px, 2.4vw, 18px); height: clamp(13px, 2.4vw, 18px); margin: 2px; border: 2px solid #fff; border-radius: 50%; background: var(--farbe); color: #fff; font-size: clamp(.5rem, 1.3vw, .64rem); font-weight: 800; line-height: 1; box-shadow: 0 1px 3px rgba(0, 0, 0, .4); }
.sb-schild { position: absolute; display: flex; align-items: center; gap: 3px; padding: 1px 6px 1px 2px; border-radius: 999px; background: rgba(255, 255, 255, .94); color: var(--tusche); font-size: clamp(.55rem, 1.5vw, .74rem); white-space: nowrap; transform: translateY(-62%); box-shadow: 0 2px 6px rgba(0, 0, 0, .25); }
.sb-schild img { width: clamp(14px, 2.6vw, 22px); height: clamp(14px, 2.6vw, 22px); }
.sb-schild small { color: #15803d; font-weight: 800; font-size: .9em; }
.sb-schild.voll { background: linear-gradient(135deg, #fde68a, #f59e0b); }
.sb-schild.voll small { color: #7c2d12; }
/* darunter: wie weit jedes Viertel ist, wer darin baut */
.sb-viertel-liste { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); gap: 6px; margin: 0; padding: 0; list-style: none; }
.sb-vl { display: flex; align-items: center; gap: 6px; padding: 5px 8px; border-radius: 14px; background: #fff; box-shadow: 0 4px 12px rgba(40, 30, 90, .08); }
.sb-vl.voll { background: linear-gradient(160deg, #fffbeb, #fef3c7); box-shadow: 0 0 0 2px #f59e0b; }
.sb-vl.passt { box-shadow: 0 0 0 2px rgba(22, 163, 74, .6); }
.sb-vl.fuellt { box-shadow: 0 0 0 2px #f59e0b; } /* A.22.19.0: dein Gebäude macht dieses Viertel voll */
.sb-vl.fuellt .sb-vl-text small { color: #b45309; font-weight: 700; }
.sb-vl-wappen { width: 30px; height: 30px; flex: none; }
.sb-vl-text { display: grid; flex: 1; min-width: 0; }
.sb-vl-text strong { color: var(--ton, var(--tusche)); font-size: .88rem; }
.sb-vl-text small { color: var(--tusche-weich); font-size: .7rem; }
.sb-vl-wer { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 3px; max-width: 50%; }
.sb-vl-wer i { display: grid; place-items: center; min-width: 20px; height: 20px; padding: 0 4px; border-radius: 999px; background: var(--farbe); color: #fff; font-style: normal; font-weight: 800; font-size: .7rem; }
.sb-rand { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 8px 10px; border-radius: 14px; background: #fff; }
.sb-rand small { color: var(--tusche-weich); font-size: .74rem; }
.sb-rand-reihe { display: flex; flex-wrap: wrap; gap: 4px; width: 100%; }
.sb-rand-reihe img { width: 46px; height: 46px; border-bottom: 3px solid var(--farbe); }
/* Farbe der Baumeister auch in der Mitspieler-Leiste, beim eigenen Stand und in der Rangliste */
.sb-g .sb-g-bild { outline: 3px solid var(--farbe, transparent); outline-offset: 1px; border-radius: 50%; }
#meinStand::before { content: ''; display: inline-block; width: .7em; height: .7em; margin-right: 5px; border-radius: 50%; background: var(--farbe, transparent); vertical-align: -.05em; }
.sb-rang li { border-left: 4px solid var(--farbe, transparent); }

/* ---------- Karten unter den Würfeln (A.22.4.0) ---------- */
.sb-kartenleiste { display: flex; align-items: center; gap: 8px; margin: 2px 0 6px; overflow-x: auto; scrollbar-width: none; }
.sb-kartenleiste[hidden] { display: none; }
.sb-kl-titel { flex: none; font-weight: 700; font-size: .82rem; color: var(--tusche-weich); }
.sb-kl-reihe { display: flex; gap: 6px; padding: 3px; }
.sb-kchip { display: flex; align-items: center; gap: 6px; flex: none; padding: 4px 10px 4px 4px; border: 0; border-radius: 14px; background: #fff; box-shadow: 0 0 0 2px #c4b5fd, 0 4px 10px rgba(67, 56, 202, .15); font: inherit; text-align: left; cursor: pointer; }
.sb-kchip img { width: 36px; height: 36px; }
.sb-kchip span { display: grid; line-height: 1.15; }
.sb-kchip b { font-size: .84rem; }
.sb-kchip small { font-size: .7rem; color: var(--tusche-weich); }
.sb-kchip.aktiv { background: #ecfccb; box-shadow: 0 0 0 3px #84cc16, 0 4px 10px rgba(101, 163, 13, .25); }
.sb-kchip:focus-visible { outline: 3px solid #4338ca; outline-offset: 2px; }
.sb-kartenhilfe { margin: -2px 0 8px; color: var(--tusche-weich); font-size: .9rem; }
.sb-kartenhilfe:empty { display: none; }

/* ---------- Reiter (nur Handy) ---------- */
.sb-reiter { display: none; }
@media (max-width: 860px) {
  .sb-reiter { display: flex; gap: 4px; margin: 6px 0 4px; padding: 4px; border-radius: 999px; background: rgba(255, 255, 255, .85); box-shadow: var(--schatten-klein); }
  .sb-reiter button { position: relative; flex: 1; min-height: 40px; border: 0; border-radius: 999px; background: none; font: inherit; font-weight: 700; font-size: .92rem; color: var(--tusche-weich); cursor: pointer; }
  .sb-reiter button[aria-selected="true"] { background: #4338ca; color: #fff; box-shadow: 0 4px 12px rgba(67, 56, 202, .3); }
  .sb-reiter b { display: inline-grid; place-items: center; min-width: 20px; height: 20px; margin-left: 5px; padding: 0 5px; border-radius: 999px; background: #c6f135; color: #1a2e05; font-size: .72rem; vertical-align: 1px; }
  .sb-reiter b[hidden] { display: none; }
  .sb-tafel:not(.an) { display: none; }
  .sb-tafel .sb-titel { margin-top: 8px; }
}
.sb-setzen { display: grid; gap: 8px; margin-bottom: 10px; padding: 12px; border-radius: 20px; background: #fff; box-shadow: 0 0 0 3px #c6f135, 0 10px 26px rgba(40, 30, 90, .14); }
.sb-setzen[hidden] { display: none; }
.sb-setzen-kopf { display: flex; align-items: center; gap: 10px; }
.sb-setzen-kopf img { width: 64px; height: 64px; flex: none; }
.sb-setzen-kopf div { display: grid; flex: 1; min-width: 0; }
.sb-setzen-kopf span { color: var(--tusche-weich); font-size: .9rem; }
.sb-setzen-knoepfe { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Karten ---------- */
.sb-hand { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.sb-leer { margin: 0; color: var(--tusche-weich); }
.sb-karte { display: grid; gap: 6px; padding: 10px; border-radius: 18px; background: #fff; box-shadow: 0 8px 20px rgba(40, 30, 90, .1); }
.sb-karte.benutzt { box-shadow: 0 0 0 3px #c6f135, 0 8px 20px rgba(40, 30, 90, .1); }
.sb-karte.verdeckt { place-items: center; background: linear-gradient(160deg, #4338ca, #312e81); }
.sb-karte-ruecken { width: 64px; height: 64px; }
.sb-karte-oben { display: flex; gap: 8px; align-items: center; }
.sb-karte-oben img { width: 52px; height: 52px; flex: none; }
.sb-karte-oben div { display: grid; }
.sb-karte-oben small { color: var(--tusche-weich); font-size: .78rem; line-height: 1.3; }
.sb-karte-unten { display: flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 10px; background: #f4f3fb; font-weight: 650; font-size: .88rem; }
.sb-karte-unten img { width: 28px; height: 28px; }
.sb-oder { color: var(--tusche-weich); font-weight: 600; font-size: .78rem; }
.sb-karte-knoepfe { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- Protokoll, Ende, Regeln ---------- */
.sb-protokoll { margin-top: 18px; padding: 8px 14px; border-radius: 18px; background: var(--flaeche); box-shadow: var(--schatten-klein); }
.sb-protokoll summary { cursor: pointer; font-weight: 700; }
.sb-protokoll ol { margin: 8px 0 4px; padding-left: 1.4em; display: grid; gap: 4px; font-size: .9rem; color: var(--tusche-weich); }
#endeBox { margin-bottom: 12px; }
.sb-ende { display: grid; justify-items: center; gap: 10px; padding: 16px; border-radius: 26px; background: var(--flaeche); box-shadow: var(--schatten-klein); text-align: center; }
.sb-ende-pokal { width: 120px; height: 120px; animation: sb-schweben 3s ease-in-out infinite; }
.sb-ende h2 { margin: 0; font-family: var(--schrift-titel); font-size: 2rem; }
.sb-rang { display: grid; gap: 8px; width: min(100%, 520px); margin: 0; padding: 0; list-style: none; counter-reset: rang; }
.sb-rang li { display: grid; gap: 2px; padding: 8px 12px 8px 44px; border-radius: 16px; background: #fff; text-align: left; position: relative; counter-increment: rang; }
.sb-rang li::before { content: counter(rang); position: absolute; left: 12px; top: 10px; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: #1e1b4b; color: #fde68a; font-weight: 800; font-size: .85rem; }
.sb-rang li.ich { box-shadow: inset 0 0 0 2px #4338ca; }
.sb-rang span { color: var(--tusche-weich); font-size: .88rem; }
.sb-rang-bau { display: flex; flex-wrap: wrap; gap: 2px; }
.sb-rang-bau img { width: 34px; height: 34px; }
.sb-ende-gleich { margin: 0; max-width: 30em; color: var(--tusche-weich); font-weight: 650; } /* A.22.17.0 Unentschieden */
.sb-regeln p, .sb-regeln li { line-height: 1.5; }
.sb-regeln ol, .sb-regeln ul { padding-left: 1.3em; display: grid; gap: 4px; }

/* ---------- Handy ---------- */
/* Würfel und Anweisung bleiben beim Scrollen oben stehen — die Baustellen darunter sind dann gleich zu sehen */
@media (max-width: 860px) {
  .sb-steuer { position: sticky; top: 0; z-index: 5; margin: 0 -10px; padding: 6px 10px 2px; background: linear-gradient(rgba(246, 244, 255, .97) 85%, rgba(246, 244, 255, 0)); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
  .sb-anweisung { margin: 8px auto 4px; font-size: .98rem; }
  .sb-aktionen { margin-bottom: 4px; }
  .sb-aktionen .knopf { min-height: 40px; }
}
.sb-setzt .sb-steuer { position: static; }
@media (max-width: 600px) {
  #lupe { display: inline-flex; }
  .sb-stadt.nah .sb-karte { width: calc(var(--w) * 46px); }
  .sb-karte-rahmen { padding: 12px 2px 4px; border-radius: 16px; }
  .sb-karte { --kd: 2px; }
  .sb-viertel-liste { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; }
  .sb-vl-wer i { min-width: 17px; height: 17px; font-size: .62rem; }
  .sb-vl { padding: 4px 6px; gap: 4px; }
  .sb-vl-wappen { width: 24px; height: 24px; }
  .sb-vl-text strong { font-size: .8rem; }
  .sb-vl-text small { font-size: .64rem; }
  /* Mitspieler kompakter */
  .sb-g { flex: 0 0 172px; padding: 6px 8px; border-radius: 14px; }
  .sb-g-bild { width: 32px; height: 32px; }
  .sb-g-name strong { font-size: .9rem; }
  .sb-g-name small { font-size: .7rem; }
  .sb-g-bau { gap: 3px; margin-top: 4px; }
  .sb-leiste { margin-bottom: 6px; }
  .sb-leiste > span { padding: 4px 10px; font-size: .85rem; }
  .sb-ticker { margin-bottom: 6px; font-size: .85rem; }
  .sb-hand { grid-template-columns: 1fr; }
  .sb-bau-bild { max-width: 86px; }
  .sb-bedarf li { padding: 2px 5px; }
  .sb-titel { margin: 10px 0 6px; font-size: 1rem; }
  .buehne-sb { padding: 4px 10px 20px; }
  .sb-reihe-titel { width: auto; writing-mode: vertical-rl; transform: rotate(180deg); font-size: .7rem; }
  .sb-w { width: 52px; height: 52px; border-radius: 14px; }
  .sb-w b { font-size: 1.7rem; }
  .sb-w img { width: 40px; height: 40px; }
  .sb-wuerfel { gap: 8px; }
  .sb-bau { padding: 8px; }
  .sb-bau-name { font-size: .88rem; }
  .sb-pkt { min-width: 30px; height: 30px; font-size: .9rem; }
  .sb-plaetze i { width: 11px; height: 11px; border-width: 1.5px; }
  .sb-bedarf img { width: 22px; height: 22px; }
  /* A.22.10.1: mit dem Arbeiter am Zeilenende wird es eng — Kästchen und Figur kleiner, nichts ragt heraus */
  .sb-bedarf li { gap: 4px; min-width: 0; }
  .sb-bedarf .sb-bedarf-arbeiter { width: 18px; height: 18px; }
  .sb-plaetze { gap: 2px; flex-wrap: wrap; justify-content: flex-end; min-width: 0; }
  .sb-plaetze i { width: 9px; height: 9px; }
  .sb-g { flex-basis: 190px; }
  .sb-tisch[data-anzahl="5"] .sb-w { width: 46px; height: 46px; }
  .sb-tisch[data-anzahl="6"] .sb-w, .sb-tisch[data-anzahl="7"] .sb-w { width: 40px; height: 40px; border-radius: 11px; }
  .sb-tisch[data-anzahl="6"] .sb-w b, .sb-tisch[data-anzahl="7"] .sb-w b { font-size: 1.35rem; }
  .sb-tisch[data-anzahl="6"] .sb-w img, .sb-tisch[data-anzahl="7"] .sb-w img { width: 31px; height: 31px; }
  .sb-tisch[data-anzahl="6"] .sb-wuerfel, .sb-tisch[data-anzahl="7"] .sb-wuerfel { gap: 5px; }
}
/* A.22.12.0 (SEIN „Das Spiel ist auf dem Handy unnötig kompliziert, da ich ständig scrollen muss“): Baustellen als kleine
   Kacheln, drei nebeneinander — alle sechs passen zusammen mit dem Würfeltisch auf einen Bildschirm. Mitspieler schmaler,
   Würfel kleiner; in der Ansicht „Stadt“ macht der Würfeltisch Platz für die Karte. */
@media (max-width: 860px) {
  body[data-ansicht="stadt"] .sb-tisch, body[data-ansicht="hand"] .sb-tisch { display: none; }
}
@media (max-width: 600px) {
  .sb-tafel[data-ansicht="bau"] > .sb-titel { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .sb-baustellen { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-top: 4px; }
  .sb-bau { display: grid; grid-template-columns: 34px minmax(0, 1fr); grid-template-areas: "bild kopf" "bedarf bedarf"; align-content: start; gap: 4px 5px; padding: 6px 5px 5px; border-top-width: 4px; border-radius: 12px; box-shadow: 0 4px 12px rgba(40, 30, 90, .1); }
  .sb-bau-kopf { grid-area: kopf; }
  .sb-bau-bild { grid-area: bild; width: 34px; max-width: none; }
  .sb-bedarf { grid-area: bedarf; gap: 2px; }
  .sb-stufe { display: none; }
  /* A.22.15.0 (SEIN „Die Bauform sollte hier dringend zu sehen sein“): der Grundriss klein rechts neben dem Namen, unter
     der Punktzahl — die Kachel wird dadurch nicht höher */
  .sb-bau-kopf { gap: 3px; }
  .sb-bau-rechts { padding-top: 14px; }
  .sb-bau-rechts .sb-form { --zf: 5px; }
  .sb-bau-name { display: -webkit-box; overflow: hidden; font-size: .7rem; line-height: 1.12; -webkit-line-clamp: 3; -webkit-box-orient: vertical; -webkit-hyphens: auto; hyphens: auto; overflow-wrap: anywhere; }
  .sb-pkt { position: absolute; top: -8px; right: -4px; min-width: 21px; height: 21px; padding: 0 4px; font-size: .68rem; }
  .sb-bedarf li { gap: 3px; padding: 1px 3px; border-radius: 6px; }
  .sb-bedarf-name { display: none; }
  .sb-bedarf img { width: 16px; height: 16px; }
  .sb-bedarf .sb-bedarf-arbeiter { width: 15px; height: 15px; margin-left: auto; }
  .sb-plaetze { flex: 1; flex-wrap: nowrap; justify-content: flex-start; gap: 1.5px; }
  .sb-plaetze i { width: 7px; height: 9px; border-width: 1px; border-radius: 2px; }
  .sb-bau.ziel { box-shadow: 0 0 0 3px #16a34a, 0 0 0 6px rgba(22, 163, 74, .2); animation: none; }
  .sb-bau.leer { display: flex; flex-direction: column; gap: 3px; padding: 5px; }
  .sb-bau-leerbild { width: 40px; }
  .sb-bau.leer .sb-bau-name { font-size: .66rem; padding: 0; }
  .sb-bau-frage { font-size: .66rem; }
  .sb-stapel-wahl { gap: 3px; }
  .sb-stapel { min-height: 28px; padding: 0 5px; border-radius: 8px; font-size: .7rem; }
  .sb-stapel small { font-size: .6rem; }
  /* Mitspieler: eine schmale Zeile, ohne Mini-Baustellen */
  .sb-gegner { gap: 6px; margin-bottom: 4px; padding-bottom: 4px; }
  .sb-g { flex: 0 0 auto; max-width: 48%; padding: 4px 8px 4px 4px; border-radius: 999px; }
  .sb-g-bau { display: none; }
  .sb-g-bild { width: 28px; height: 28px; }
  .sb-g-name strong { font-size: .8rem; line-height: 1.1; }
  .sb-g-name small { font-size: .66rem; line-height: 1.1; }
  /* Würfeltisch dichter: Menge und Baustoff in zwei Zeilen, der eine Arbeiter-Würfel rechts daneben */
  .sb-tisch { grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 6px 10px; padding: 8px; border-radius: 18px; }
  .sb-tisch .sb-reihe-titel { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .sb-tisch .sb-wuerfel-reihe:nth-child(3) { grid-column: 2; grid-row: 1 / span 2; padding-left: 10px; border-left: 2px dashed rgba(199, 210, 254, .35); }
  .sb-w { width: 46px; height: 46px; border-radius: 12px; }
  .sb-w b { font-size: 1.5rem; }
  .sb-w img { width: 36px; height: 36px; }
  .sb-wuerfel { gap: 6px; }
  .sb-anweisung { margin: 6px auto 2px; font-size: .92rem; }
  .sb-ticker { margin-bottom: 4px; font-size: .8rem; }
  .sb-reiter { margin: 4px 0 2px; }
  .sb-reiter button { min-height: 36px; }
  /* A.22.17.0: 2–3 Arbeiter-Würfel (ab drei bzw. fünf Baumeistern) rechts neben Menge und Baustoff — zwei übereinander,
     drei als 2 + 1; bei vielen Würfeln alles etwas kleiner, damit nichts seitlich herausragt und der Tisch nicht höher wird */
  .sb-tisch[data-arbeiter="2"] #arbeiterWuerfel, .sb-tisch[data-arbeiter="3"] #arbeiterWuerfel { display: grid; gap: 6px; }
  .sb-tisch[data-arbeiter="3"] #arbeiterWuerfel { grid-template-columns: repeat(2, auto); gap: 4px; }
  .sb-tisch[data-arbeiter="3"] .sb-wuerfel-reihe:nth-child(3) { padding-left: 8px; }
  .sb-tisch[data-arbeiter="3"] #arbeiterWuerfel .sb-w { width: 38px; height: 38px; border-radius: 10px; }
  .sb-tisch[data-anzahl="5"][data-arbeiter="3"] :is(#mengeWuerfel, #stoffWuerfel) .sb-w { width: 44px; height: 44px; }
  .sb-tisch[data-anzahl="6"][data-arbeiter="3"] :is(#mengeWuerfel, #stoffWuerfel) .sb-w { width: 36px; height: 36px; border-radius: 10px; }
  .sb-tisch[data-anzahl="6"][data-arbeiter="3"] :is(#mengeWuerfel, #stoffWuerfel) { gap: 4px; }
  .sb-tisch[data-anzahl="6"][data-arbeiter="3"] #arbeiterWuerfel .sb-w { width: 36px; height: 36px; }
  .sb-tisch[data-anzahl="6"] :is(#mengeWuerfel, #stoffWuerfel) .sb-w img { width: 28px; height: 28px; }
  .sb-tisch[data-anzahl="6"] .sb-w b { font-size: 1.25rem; }
  /* Figur und Baustoff-Plakette der Arbeiter wachsen mit dem Würfel (die festen Bildgrößen oben gelten ihnen nicht) */
  .sb-tisch #arbeiterWuerfel .sb-w .sb-w-figur { width: 88%; height: 88%; }
  .sb-tisch #arbeiterWuerfel .sb-w .sb-w-stoff { width: 40%; height: 40%; }
  /* A.22.17.0 „Wer fängt an?“: die Anzeige nennt alle Baumeister mit ihren Würfen — Mitspielerzeile und Ticker machen
     solange Platz, der Kasten wird dichter (vorher 932 px Seitenhöhe bei 844) */
  .sb-wer-faengt .sb-gegner, .sb-wer-faengt .sb-ticker { display: none; }
  .sb-auswurf { gap: 4px; margin-bottom: 6px; padding: 6px 8px; border-radius: 16px; }
  .sb-auswurf-titel { font-size: .9rem; }
  .sb-auswurf-liste { gap: 4px 8px; }
  .sb-auswurf-liste li { gap: 4px; padding: 2px 8px 2px 2px; }
  .sb-auswurf-bild { width: 22px; height: 22px; }
  .sb-auswurf-name { font-size: .8rem; }
  .sb-auswurf-w { width: 22px; height: 22px; border-radius: 6px; font-size: .85rem; }
  .sb-auswurf-marke { font-size: .68rem; }
}
@media (max-width: 370px) {
  /* A.22.17.0: schmale Handys (360 px) — bei fünf und sechs Baumeistern noch eine Stufe kleiner */
  .sb-tisch[data-anzahl="5"][data-arbeiter="3"] :is(#mengeWuerfel, #stoffWuerfel) .sb-w { width: 40px; height: 40px; }
  .sb-tisch[data-anzahl="5"][data-arbeiter="3"] :is(#mengeWuerfel, #stoffWuerfel) { gap: 5px; }
  .sb-tisch[data-anzahl="5"][data-arbeiter="3"] #arbeiterWuerfel .sb-w { width: 34px; height: 34px; }
  .sb-tisch[data-anzahl="6"][data-arbeiter="3"] :is(#mengeWuerfel, #stoffWuerfel) .sb-w, .sb-tisch[data-anzahl="6"][data-arbeiter="3"] #arbeiterWuerfel .sb-w { width: 32px; height: 32px; border-radius: 9px; }
  .sb-tisch[data-anzahl="6"] :is(#mengeWuerfel, #stoffWuerfel) .sb-w img { width: 25px; height: 25px; }
  .sb-tisch[data-anzahl="6"] .sb-w b { font-size: 1.1rem; }
}
@media (prefers-reduced-motion: reduce) {
  .sb-start-bild, .sb-ende-pokal, .sb-bau.ziel, .sb-w.rollt, .sb-bedarf-arbeiter, .sb-auswurf-w { animation: none !important; }
  .farbe { transition: none; }
}

/* ---------- Startseite: KI-Baumeister (A.22.6.0) ---------- */
.sb-start-wahl { display: grid; gap: 12px; width: 100%; text-align: left; }
.sb-start-wahl[hidden], .sb-start-block[hidden], #startStaerke[hidden] { display: none; }
.sb-start-block h3 { margin: 0 0 6px; font-size: 1rem; }
.sb-start-block .segmente { flex-wrap: wrap; margin-bottom: 6px; }
.sb-start-block .segmente button:disabled { opacity: .35; cursor: default; }
.sb-menschen { display: grid; gap: 6px; margin: 0 0 6px; padding: 0; list-style: none; }
.sb-menschen li { display: flex; gap: 6px; align-items: center; }
.sb-menschen input { flex: 1; min-width: 0; }

/* ---------- Auflösung mit Punkte zählen (A.22.17.0, js/aufloesung.js) ----------
   Eine Ebene über der Seite: links die Punktetafel, rechts Gebäude bzw. Stadtkarte (am Handy Tafel oben, zweispaltig,
   darunter Karte — ohne Scrollen). Die Karte passt sich der freien Höhe an (Container-Höhe cqh). */
html.sb-aufl-an { overflow: hidden; }
.sb-aufl { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; background: rgba(30, 27, 75, .5); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); animation: sb-aufl-blende .35s ease-out both; }
@keyframes sb-aufl-blende { from { opacity: 0; } }
.sb-aufl-panel { display: grid; grid-template-columns: minmax(300px, 420px) minmax(0, 1fr); grid-template-rows: auto auto minmax(0, 1fr); grid-template-areas: "kopf kopf" "tafel titel" "tafel buehne"; gap: 12px 20px; width: min(1180px, 100%); height: min(860px, 100%); padding: 16px 20px 20px; border-radius: 30px; background: linear-gradient(170deg, #fbfaff, #eeeafc); box-shadow: var(--schatten-gross); overflow: hidden; }
.sb-aufl-kopf { grid-area: kopf; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sb-aufl-kopf h2 { margin: 0; font-family: var(--schrift-titel); font-size: 1.6rem; letter-spacing: -.02em; }
.sb-aufl-knopf { min-height: 40px; }
/* Punktetafel */
.sb-aufl-tafel { grid-area: tafel; align-self: start; display: grid; gap: 10px; margin: 0; padding: 4px 2px 0; list-style: none; }
.sb-aufl-zeile { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding: 8px 14px 8px 10px; border-radius: 18px; background: #fff; box-shadow: inset 5px 0 0 var(--farbe), 0 4px 14px rgba(40, 30, 90, .08); transition: box-shadow .25s; }
.sb-aufl-zeile.dran { box-shadow: inset 5px 0 0 var(--farbe), 0 0 0 3px var(--farbe), 0 8px 20px rgba(40, 30, 90, .16); }
.sb-aufl-zeile.sieger { background: linear-gradient(160deg, #fffbeb, #fde68a); box-shadow: inset 5px 0 0 var(--farbe), 0 0 0 3px #f59e0b, 0 10px 24px rgba(245, 158, 11, .3); }
.sb-aufl-tafel.fertig .sb-aufl-zeile::before { content: attr(data-platz); position: absolute; left: -6px; top: -7px; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: #1e1b4b; color: #fde68a; font-weight: 800; font-size: .75rem; }
.sb-aufl-bild { width: 42px; height: 42px; flex: none; border-radius: 50%; outline: 3px solid var(--farbe); outline-offset: 1px; background: #f4f3fb; object-fit: cover; }
.sb-aufl-bild.ohne { display: grid; place-items: center; background: var(--farbe); color: #fff; font-weight: 800; }
.sb-aufl-mitte { display: grid; min-width: 0; }
.sb-aufl-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 1.02rem; }
.sb-aufl-teile { display: flex; flex-wrap: wrap; gap: 0 5px; color: var(--tusche-weich); font-size: .76rem; }
.sb-aufl-teile span { white-space: nowrap; }
.sb-aufl-teile span + span::before { content: '·'; margin-right: 5px; color: var(--tusche-weich); font-weight: 400; }
.sb-aufl-teile i { font-style: normal; }
.sb-aufl-teile .bonus { color: #b45309; font-weight: 700; }
.sb-aufl-teile .abzug { color: #be123c; font-weight: 700; }
.sb-aufl-zahl { min-width: 2em; text-align: right; font-family: var(--schrift-titel); font-size: 2rem; font-weight: 800; line-height: 1; color: #1e1b4b; font-variant-numeric: tabular-nums; }
.sb-aufl-zahl.hoch { animation: sb-aufl-hoch .35s ease-out; }
.sb-aufl-zahl.runter { animation: sb-aufl-runter .4s ease-out; }
@keyframes sb-aufl-hoch { 40% { transform: scale(1.2); color: var(--farbe); } }
@keyframes sb-aufl-runter { 40% { transform: scale(.9); color: #be123c; } }
.sb-aufl-krone { width: 34px; height: 34px; }
.sb-aufl-krone[hidden] { display: none; }
.sb-aufl-chip { position: absolute; right: 10px; top: -10px; padding: 1px 8px; border-radius: 999px; font-weight: 800; font-size: .8rem; white-space: nowrap; opacity: 0; transform: scale(.6); transition: opacity .2s, transform .3s cubic-bezier(.3, 1.5, .5, 1); pointer-events: none; }
.sb-aufl-chip.zeigt { opacity: 1; transform: none; }
.sb-aufl-chip.bonus, .sb-aufl-flug.bonus { background: linear-gradient(135deg, #fde68a, #f59e0b); color: #7c2d12; }
.sb-aufl-chip.abzug, .sb-aufl-flug.abzug { background: #ffe4e6; color: #be123c; box-shadow: 0 0 0 1px #fda4af; }
.sb-aufl-flug { position: fixed; z-index: 2; padding: 4px 12px; border-radius: 999px; font-weight: 800; font-size: 1.05rem; white-space: nowrap; pointer-events: none; transform: translate(-50%, -50%); box-shadow: 0 6px 16px rgba(0, 0, 0, .25); }
/* Schild über der Bühne: wessen Gebäude, welches Viertel, wer gewinnt */
.sb-aufl-titel { grid-area: titel; display: flex; align-items: center; min-width: 0; min-height: 58px; }
.sb-aufl-wer, .sb-aufl-viertel, .sb-aufl-sieg { display: flex; align-items: center; gap: 10px; max-width: 100%; padding: 6px 18px 6px 6px; border-radius: 999px; background: #fff; box-shadow: 0 4px 14px rgba(40, 30, 90, .1); animation: sb-aufl-auf .35s ease-out both; }
.sb-aufl-wer > span, .sb-aufl-viertel > span, .sb-aufl-sieg > span { display: grid; min-width: 0; }
.sb-aufl-wer b, .sb-aufl-viertel b { font-size: 1.15rem; }
.sb-aufl-wer small, .sb-aufl-viertel small, .sb-aufl-sieg small { color: var(--tusche-weich); font-size: .84rem; }
.sb-aufl-wer { box-shadow: 0 0 0 3px var(--farbe), 0 4px 14px rgba(40, 30, 90, .1); }
.sb-aufl-viertel img { width: 46px; height: 46px; flex: none; }
.sb-aufl-viertel.bonus { background: linear-gradient(135deg, #fef3c7, #fde68a); box-shadow: 0 0 0 2px #f59e0b, 0 6px 16px rgba(245, 158, 11, .25); }
.sb-aufl-viertel.bonus b { color: #7c2d12; }
.sb-aufl-viertel.abzug { background: #fff1f2; box-shadow: 0 0 0 2px #fda4af, 0 4px 14px rgba(40, 30, 90, .1); }
.sb-aufl-viertel.abzug b { color: #9f1239; }
.sb-aufl-sieg { padding-right: 24px; background: linear-gradient(135deg, #fffbeb, #fde68a); box-shadow: 0 0 0 3px #f59e0b, 0 10px 24px rgba(245, 158, 11, .3); }
.sb-aufl-sieg b { font-family: var(--schrift-titel); font-size: 1.6rem; letter-spacing: -.01em; }
.sb-aufl-pokal { width: 64px; height: 64px; flex: none; margin: -12px 0 -8px; animation: sb-schweben 3s ease-in-out infinite; }
@keyframes sb-aufl-auf { from { opacity: 0; transform: translateY(8px) scale(.96); } }
/* Bühne: Gebäude als Kacheln oder die Stadtkarte */
.sb-aufl-buehne { grid-area: buehne; min-height: 0; overflow: auto; container-type: size; }
.sb-aufl-bauten { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; align-content: start; padding: 4px; }
.sb-aufl-bau { --stufe: #b45309; position: relative; display: grid; justify-items: center; align-content: start; gap: 2px; padding: 8px 6px; border-radius: 18px; background: #fff; box-shadow: inset 0 -4px 0 var(--farbe), 0 6px 16px rgba(40, 30, 90, .1); text-align: center; animation: sb-aufl-bau .45s cubic-bezier(.3, 1.4, .5, 1) both; }
.sb-aufl-bau.silber { --stufe: #64748b; } .sb-aufl-bau.gold { --stufe: #ca8a04; background: linear-gradient(170deg, #fff, #fef9c3); }
.sb-aufl-bau img { width: 84px; height: 84px; object-fit: contain; filter: drop-shadow(0 4px 3px rgba(0, 0, 0, .25)); }
.sb-aufl-bau-name { font-weight: 700; font-size: .85rem; line-height: 1.15; -webkit-hyphens: auto; hyphens: auto; overflow-wrap: anywhere; }
.sb-aufl-bau-pkt { font-family: var(--schrift-titel); font-size: 1.2rem; color: var(--stufe); }
.sb-aufl-rand { position: absolute; top: 6px; left: 6px; padding: 0 6px; border-radius: 999px; background: #e0e7ff; color: #3730a3; font-size: .66rem; font-weight: 700; }
@keyframes sb-aufl-bau { from { opacity: 0; transform: translateY(14px) scale(.7); } }
.sb-aufl-karte { display: grid; align-content: start; height: 100%; }
.sb-aufl-karte .sb-viertel-liste, .sb-aufl-karte .sb-rand { display: none; }
.sb-aufl-karte .sb-karte-rahmen { overflow: visible; }
.sb-aufl-karte .sb-karte { width: min(100%, calc((100cqh - 34px) * var(--w) / var(--h)), calc(var(--w) * 54px)); }
.sb-aufl .sb-karte :is(.sb-zelle, .sb-k, .sb-haus, .sb-fahne, .sb-schild) { transition: filter .35s, opacity .35s, transform .35s; }
.sb-aufl .sb-karte.dimmen :is(.sb-zelle, .sb-k, .sb-haus):not(.hell) { filter: grayscale(.85) brightness(.55); }
.sb-aufl .sb-karte.dimmen :is(.sb-fahne, .sb-schild):not(.hell) { opacity: .25; }
.sb-aufl .sb-karte.dimmen .sb-schild.hell { z-index: 1; transform: translateY(-62%) scale(1.3); }
/* ohne Bewegung (prefers-reduced-motion, Prüfstand): nur Durchblenden */
.sb-aufl.ruhig :is(.sb-aufl-bau, .sb-aufl-wer, .sb-aufl-viertel, .sb-aufl-sieg) { animation-name: sb-aufl-blende; }
.sb-aufl.ruhig :is(.sb-aufl-zahl, .sb-aufl-pokal) { animation: none; }
.sb-aufl.ruhig .sb-aufl-chip { transform: none; }
.sb-aufl.ruhig .sb-karte .sb-schild.hell { transform: translateY(-62%); }
@media (max-width: 600px) {
  .sb-aufl { padding: 0; }
  .sb-aufl-panel { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto auto minmax(0, 1fr); grid-template-areas: "kopf" "tafel" "titel" "buehne"; gap: 8px; width: 100%; height: 100%; padding: max(10px, env(safe-area-inset-top)) 10px max(10px, env(safe-area-inset-bottom)); border-radius: 0; }
  .sb-aufl-kopf h2 { font-size: 1.3rem; }
  .sb-aufl-tafel { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 6px; padding-top: 6px; }
  .sb-aufl-zeile { gap: 6px; padding: 5px 8px 5px 6px; border-radius: 14px; }
  .sb-aufl-bild { width: 28px; height: 28px; outline-width: 2px; }
  .sb-aufl-name { font-size: .86rem; }
  .sb-aufl-teile { font-size: .68rem; gap: 0 3px; }
  .sb-aufl-teile span + span::before { margin-right: 3px; }
  .sb-aufl-teile i { display: none; }
  .sb-aufl-zahl { min-width: 1.5em; font-size: 1.4rem; }
  .sb-aufl-krone { width: 22px; height: 22px; margin: 0 -4px; }
  .sb-aufl-chip { right: 4px; top: -9px; padding: 0 6px; font-size: .72rem; }
  .sb-aufl-tafel.fertig .sb-aufl-zeile::before { left: -4px; top: -6px; width: 18px; height: 18px; font-size: .66rem; }
  .sb-aufl-titel { min-height: 46px; }
  .sb-aufl-wer, .sb-aufl-viertel, .sb-aufl-sieg { gap: 8px; padding: 4px 14px 4px 4px; }
  .sb-aufl-wer b, .sb-aufl-viertel b { font-size: .98rem; }
  .sb-aufl-wer small, .sb-aufl-viertel small, .sb-aufl-sieg small { font-size: .74rem; }
  .sb-aufl-viertel img { width: 36px; height: 36px; }
  .sb-aufl-sieg b { font-size: 1.25rem; }
  .sb-aufl-pokal { width: 46px; height: 46px; margin: -6px 0; }
  .sb-aufl-bauten { grid-template-columns: repeat(auto-fill, minmax(82px, 1fr)); gap: 6px; padding: 2px; }
  .sb-aufl-bau { padding: 6px 4px; border-radius: 14px; }
  .sb-aufl-bau img { width: 54px; height: 54px; }
  .sb-aufl-bau-name { font-size: .72rem; }
  .sb-aufl-bau-pkt { font-size: 1rem; }
  .sb-aufl-rand { top: 3px; left: 3px; font-size: .58rem; padding: 0 4px; }
}

/* ---------- Die Festtafel (A.22.28.0, SEINE Bildproben 23.10.: Boden Parkett, Belegung Silbertablett) ----------
   EIN Parkett für den ganzen Saal (Gänge gleich Boden), die Tische als EIN Stück (SVG .ft-tafel aus anzeige.js),
   jedes Gericht auf einem Silbertablett mit dem Rand seines Kochs — die Tönung je Feld machte das Tischtuch fleckig */
.sb-k.weg, .sb-k.weg.senk, .sb-k.weg.waag, .sb-k.weg.kreuz { background: transparent; box-shadow: none; }
.sb-k.weg::after { display: none; }
.sb-zelle { border: 0; }
.sb-zelle.bebaut::after { display: none; }
.ft-tafel { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.ft-stuehle { position: absolute; inset: 0; pointer-events: none; }
.ft-stuhl { position: absolute; object-fit: contain; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .35)); }
.sb-aufl .sb-karte .ft-tablett { transition: filter .35s, opacity .35s; }
.sb-aufl .sb-karte.dimmen :is(.ft-tisch, .ft-tablett):not(.hell), .sb-aufl .sb-karte.dimmen .ft-stuhl { filter: grayscale(.85) brightness(.55); }

/* ---------- Saft (A.22.24.0; gemeinsame Effekte in ../css/saft.css) ---------- */
.sb-gesuche b small { font-size: .72em; font-weight: 700; opacity: .6; }
.saft-zettel { width: 100%; height: 100%; object-fit: contain; }

/* ---------- Joker (A.22.25.0): die 6 füllt um bis zu 6 auf; A.22.25.1: nur auf den gold umrandeten Joker-Würfeln ---------- */
.sb-w.jokerwuerfel { box-shadow: inset 0 -4px 0 rgba(30, 27, 75, .12), 0 0 0 2px #f59e0b; }
.sb-w.joker { position: relative; background: linear-gradient(145deg, #fef3c7, #fbbf24); box-shadow: inset 0 -4px 0 #d97706, 0 0 0 2px #f59e0b; }
.sb-w.joker b { color: #92400e; line-height: 1; transform: translateY(-3px); }
.sb-w-joker { position: absolute; left: 0; right: 0; bottom: 3px; font-size: .56rem; font-weight: 900; letter-spacing: .02em; color: #92400e; text-align: center; line-height: 1; pointer-events: none; }

/* A.22.30.0: am Handy blieb die Spielansicht nicht immer ein Bildschirm (blick-stadtbauer 850 > 844: zweizeilige
   Tickerzeile + eine Baustelle mit FÜNF Materialien) — Tickerzeile einzeilig wie im Chocolatier, fünf Zeilen enger */
@media (max-width: 600px) { .sb-ticker { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } }
@media (max-width: 860px) {
  .sb-bedarf:has(> li:nth-child(5)) { gap: 1px; }
  .sb-bedarf:has(> li:nth-child(5)) li { padding-top: 0; padding-bottom: 0; }
}

/* A.22.32.0: Neu würfeln — am Handy passen „Passen“ und „Neu würfeln“ nebeneinander (Spielansicht ≤ 844) */
#nochmalKnopf img { width: 24px; height: 24px; margin: -4px 0; }
@media (max-width: 600px) {
  .sb-aktionen:has(#nochmalKnopf:not([hidden])) .knopf { padding-inline: 12px; font-size: .9rem; }
}

/* ==================== Dunkelmodus „Graphit“ (A.23.3.0, Grundlage in css/basis.css) ====================
   Gleicher Block in allen fünf Bauspielen (Stadtbauer, Probierfassung, Küche, Brauerei, Chocolatier) — jede Datei
   bleibt eigenständig, Ergänzungen eines Spiels stehen darunter. Würfel, Bilder und die Stadtkarte bleiben, wie sie
   sind; Tafeln, Kacheln und Listen werden dunkelgrau, getönte Markierungen dunkel getönt. */
[data-thema="dunkel"] .sb-bau, [data-thema="dunkel"] .sb-karte, [data-thema="dunkel"] .sb-rand, [data-thema="dunkel"] .sb-vl, [data-thema="dunkel"] .sb-kchip, [data-thema="dunkel"] .sb-setzen, [data-thema="dunkel"] .sb-rang li, [data-thema="dunkel"] .sb-stoffknopf,
[data-thema="dunkel"] .sb-aufl-zeile, [data-thema="dunkel"] .sb-aufl-wer, [data-thema="dunkel"] .sb-aufl-viertel, [data-thema="dunkel"] .sb-aufl-bau { background: var(--g-flaeche); box-shadow: inset 0 0 0 1px var(--g-kante), 0 8px 22px rgba(0, 0, 0, .35); }
[data-thema="dunkel"] .sb-bau.leer { background: var(--g-feld); }
[data-thema="dunkel"] .sb-setzen { box-shadow: 0 0 0 3px #c6f135, 0 8px 22px rgba(0, 0, 0, .35); }
[data-thema="dunkel"] .sb-karte-rahmen { background: var(--g-fest); box-shadow: inset 0 0 0 1px var(--g-kante); }
[data-thema="dunkel"] .sb-bedarf li, [data-thema="dunkel"] .sb-g-mini, [data-thema="dunkel"] .sb-auswurf-liste li, [data-thema="dunkel"] .sb-form.gross, [data-thema="dunkel"] .sb-karte-unten { background: var(--g-flaeche-hoch); }
[data-thema="dunkel"] .sb-g-bild, [data-thema="dunkel"] .sb-auswurf-bild.ohne, [data-thema="dunkel"] .sb-aufl-bild { background: #2d2a3d; }
[data-thema="dunkel"] .sb-g-bild.ohne, [data-thema="dunkel"] .sb-auswurf-bild.ohne { color: #c7d2fe; }
[data-thema="dunkel"] .sb-plaetze i { background: #191919; border-color: #4a4560; }
[data-thema="dunkel"] .sb-plaetze i.da { background: #16a34a; border-color: #15803d; }
[data-thema="dunkel"] .sb-bedarf li.voll { background: #153321; }
[data-thema="dunkel"] .sb-bedarf li.wartet, [data-thema="dunkel"] .sb-bedarf li.voll.wartet { background: #3a2c0c; }
[data-thema="dunkel"] .sb-uhr.knapp, [data-thema="dunkel"] .sb-anweisung.nichts { background: #3a2c0c; color: #fcd34d; }
[data-thema="dunkel"] .sb-gesuche.bereit { background: #153321; color: #86efac; }
[data-thema="dunkel"] .sb-auswurf-liste li.start, [data-thema="dunkel"] .sb-kchip.aktiv { background: #26330d; }
[data-thema="dunkel"] .sb-auswurf-marke, [data-thema="dunkel"] .sb-schild small { color: #a3e635; }
[data-thema="dunkel"] .sb-mod, [data-thema="dunkel"] .sb-aufl-rand { background: #2d2640; color: #c4b5fd; }
[data-thema="dunkel"] .sb-vl.voll, [data-thema="dunkel"] .sb-aufl-viertel.bonus, [data-thema="dunkel"] .sb-aufl-sieg, [data-thema="dunkel"] .sb-aufl-zeile.sieger { background: linear-gradient(160deg, #3a2c0c, #4a360a); }
[data-thema="dunkel"] .sb-aufl-bau.gold { background: linear-gradient(170deg, #232323, #3a330f); }
[data-thema="dunkel"] .sb-aufl-viertel.abzug { background: #3a1820; }
[data-thema="dunkel"] .sb-aufl-chip.abzug, [data-thema="dunkel"] .sb-aufl-flug.abzug { background: #3a1820; color: #fda4af; }
[data-thema="dunkel"] .sb-aufl-panel { background: linear-gradient(170deg, #1f1f1f, #191919); }
[data-thema="dunkel"] .sb-aufl-zahl { color: var(--tusche); }
[data-thema="dunkel"] .sb-schild { --tusche: #1e1b3a; }
[data-thema="dunkel"] .sb-k.weg.waag::after, [data-thema="dunkel"] .sb-k.weg.senk::after { background: rgba(255, 255, 255, .6); }
[data-thema="dunkel"] .sb-g.dran { border-color: rgba(165, 180, 252, .55); }
@media (max-width: 860px) {
  [data-thema="dunkel"] .sb-reiter { background: var(--g-flaeche); }
  [data-thema="dunkel"] .sb-reiter button[aria-selected="true"] { background: #4f46e5; }
  [data-thema="dunkel"] .sb-steuer { background: linear-gradient(rgba(18, 18, 18, .97) 85%, rgba(18, 18, 18, 0)); }
}
/* graue Vorschau des noch nicht Gebauten: auf Dunkel heller, sonst verschwindet sie */
[data-thema="dunkel"] .grau { opacity: .55; }
[data-thema="dunkel"] .sb-bedarf-arbeiter { opacity: .45; }
