* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #16202a; color: #eee;
  font: 14px/1.3 system-ui, -apple-system, sans-serif; user-select: none; }
canvas { display: block; touch-action: none; }
canvas.bauen { cursor: crosshair; }

#leiste, #bau, #info { position: fixed; background: rgba(18, 22, 28, .82); backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,.08); }

#leiste { top: 0; left: 0; right: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 6px 12px; }
#waren { display: flex; flex-wrap: wrap; gap: 4px 10px; cursor: pointer; padding: 2px 8px; border-radius: 6px;
  background: rgba(255,255,255,.06); margin-right: 22px; }
#waren:hover, #waren.offen { background: rgba(255,255,255,.14); }
#waren .pfeil { opacity: .7; transition: transform .15s; }
#waren.offen .pfeil { transform: rotate(180deg); }
#waren-mehr, #zufrieden-info { position: fixed; top: 46px; left: 12px; z-index: 6; padding: 10px 12px; border-radius: 10px;
  background: rgba(18, 22, 28, .95); backdrop-filter: blur(6px); border: 1px solid rgba(255,255,255,.08);
  max-width: calc(100% - 24px); max-height: calc(100vh - 70px); overflow: auto; }
#waren-mehr { column-count: 3; column-gap: 22px; width: 600px; }
#waren-mehr[hidden], #zufrieden-info[hidden] { display: none; }
#waren-mehr .ware { display: flex; align-items: center; gap: 6px; padding: 1px 0; break-inside: avoid; }
#waren-mehr .gruppe { break-inside: avoid; margin-bottom: 10px; }
#waren-mehr .ware i { font-style: normal; width: 20px; text-align: center; }
#waren-mehr .ware span { flex: 1; white-space: nowrap; }
#waren-mehr .ware b { font-variant-numeric: tabular-nums; min-width: 34px; text-align: right; }
#waren-mehr .ware.null { opacity: .45; }
#waren-mehr .hunger b { color: #ff6b6b; }
#w-zufrieden-box { cursor: pointer; }
#zufrieden-info { left: auto; right: 12px; width: 330px; display: flex; flex-direction: column; gap: 2px; }
#zufrieden-info .kopf { font-weight: 600; margin-bottom: 4px; }
#zufrieden-info .teil, #zufrieden-info .summe { display: flex; justify-content: space-between; gap: 10px; }
#zufrieden-info .teil b { font-variant-numeric: tabular-nums; }
#zufrieden-info .gut b { color: #7fd17f; }
#zufrieden-info .schlecht b { color: #ff8a7a; }
#zufrieden-info .summe { border-top: 1px solid rgba(255,255,255,.12); margin-top: 4px; padding-top: 4px; }
#zufrieden-info .summe + .summe { border-top: none; margin-top: 0; padding-top: 0; opacity: .8; }
#leiste .w b { font-variant-numeric: tabular-nums; }
#leiste .fps { opacity: .75; font-size: 12px; }
#leiste .fps b { display: inline-block; min-width: 2ch; text-align: right; }
#leiste .hunger b { color: #ff6b6b; }
.luecke { flex: 1; }

button { font: inherit; color: #eee; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12);
  border-radius: 6px; padding: 4px 10px; cursor: pointer; }
button:hover { background: rgba(255,255,255,.16); }
button.aktiv { background: #3d6b45; border-color: #6fbf7a; }

#tempo { display: flex; gap: 4px; }

#bau { bottom: 12px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center;
  gap: 6px; padding: 6px; border-radius: 10px; max-width: calc(100% - 24px); }
#reiter, #liste { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
#bau[hidden] { display: none; }
#liste { flex-wrap: nowrap; gap: 4px; justify-content: safe center; overflow-x: auto; max-width: calc(100vw - 48px); scrollbar-width: thin; }
#liste button { flex: none; }
#liste button.gruppe { margin-left: 11px; position: relative; }
#liste button.gruppe::before { content: ''; position: absolute; left: -9px; top: 15%; bottom: 15%; border-left: 1px solid rgba(255,255,255,.18); }
#reiter button { font-size: 12px; padding: 3px 8px; }
#liste button { display: flex; flex-direction: column; align-items: center; min-width: 60px; padding: 4px 5px; font-size: 12px; white-space: nowrap; }
#bau .ic { font-size: 20px; }
#bau small { opacity: .75; }
#bau button.zuteuer { opacity: .45; }

#info { top: 56px; right: 12px; display: flex; flex-direction: column; gap: 6px; padding: 10px 12px;
  border-radius: 10px; min-width: 160px; }
#info[hidden] { display: none; }
#info .wuensche { display: flex; flex-direction: column; gap: 2px; margin: 4px 0; }
#info .wuensche span { display: flex; align-items: center; gap: 6px; font-size: 13px; }
#info .wuensche i { font-style: normal; font-size: 15px; width: 20px; text-align: center; }
#info .wuensche b { margin-left: auto; padding-left: 10px; }
#info .wuensche .ja b { color: #7fd17f; }
#info .wuensche .nein { opacity: .55; }
#info .wuensche .nein i { filter: grayscale(1); }
#info .wuensche .nein b { color: #ff8a7a; }
#info .wuensche .teils b { color: #f0c060; }
#info .wuensche b { font-variant-numeric: tabular-nums; }

#speicher { position: fixed; top: 56px; right: 12px; width: 320px; max-width: calc(100% - 24px); display: flex; flex-direction: column;
  gap: 8px; padding: 10px 12px; border-radius: 10px; background: rgba(18, 22, 28, .92); backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,.08); z-index: 5; }
#speicher[hidden] { display: none; }
#speicher .kopf, #speicher .zeile { display: flex; gap: 6px; align-items: center; justify-content: space-between; }
#speicher input { flex: 1; min-width: 0; font: inherit; color: #eee; background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.15); border-radius: 6px; padding: 4px 8px; }
#stand-liste { list-style: none; margin: 0; padding: 0; max-height: 50vh; overflow: auto; display: flex; flex-direction: column; gap: 4px; }
#stand-liste li { display: flex; gap: 6px; align-items: center; padding: 4px 6px; border-radius: 6px; background: rgba(255,255,255,.05); }
#stand-liste li > span { flex: 1; display: flex; flex-direction: column; min-width: 0; }
#stand-liste li b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#stand-liste small { opacity: .6; }
#stand-liste .leer { opacity: .6; background: none; }

#meldungen { position: fixed; top: 56px; left: 50%; transform: translateX(-50%); display: flex;
  flex-direction: column; gap: 6px; align-items: center; pointer-events: none; }
#meldungen div { background: rgba(18, 22, 28, .9); padding: 6px 12px; border-radius: 8px;
  animation: weg 3.5s forwards; }
@keyframes weg { 0%, 80% { opacity: 1; } 100% { opacity: 0; } }
#info .zeile { display: flex; gap: 6px; }
#info button[disabled] { opacity: .4; cursor: default; }
#liste .drehknopf { min-width: 40px; font-size: 20px; justify-content: center; }
#info .winkel { align-self: center; min-width: 34px; text-align: center; opacity: .8; font-variant-numeric: tabular-nums; }
#info .wahl { display: flex; flex-wrap: wrap; gap: 4px; max-width: 210px; }
#info .wahl button { padding: 2px 6px; font-size: 16px; }
#info .wahl button:not(.aktiv) { opacity: .45; filter: grayscale(.8); }
#tipp { position: fixed; z-index: 7; pointer-events: none; padding: 3px 8px; border-radius: 6px; font-size: 13px;
  background: rgba(18, 22, 28, .9); border: 1px solid rgba(255,255,255,.12); white-space: nowrap; }
#tipp[hidden] { display: none; }
#w-fehlt-box, #w-stellen-box { cursor: pointer; }
#w-fehlt-box b { color: #ff8a7a; }
#w-stellen-box b { color: #f0b860; }
#leiste .w[hidden] { display: none; }
#fehlt-info { position: fixed; top: 46px; right: 12px; z-index: 6; width: 280px; max-height: calc(100vh - 70px); overflow: auto; padding: 10px 12px;
  border-radius: 10px; background: rgba(18, 22, 28, .95); backdrop-filter: blur(6px); border: 1px solid rgba(255,255,255,.08);
  display: flex; flex-direction: column; gap: 2px; }
#fehlt-info[hidden] { display: none; }
#fehlt-info .kopf { font-weight: 600; margin-bottom: 4px; }
#fehlt-info .teil { display: flex; justify-content: space-between; gap: 10px; padding: 2px 4px; border-radius: 4px; cursor: pointer; }
#fehlt-info .teil:hover { background: rgba(255,255,255,.08); }
#fehlt-info .teil span { color: #ff8a7a; }
#fehlt-info .teil.arbeit span { color: #f0b860; }
#fehlt-info small { opacity: .7; white-space: nowrap; }
#waren-mehr .ware.fehlt span, #waren-mehr .ware.fehlt b { color: #ff8a7a; }
#info .abstieg { display: block; margin-top: 4px; color: #ff8a7a; }
#w-trend-box b { font-weight: 600; }
#w-trend-box[data-t="waechst"] b { color: #7fd17f; }
#w-trend-box[data-t="schrumpft"] b { color: #ff8a7a; }
#w-trend-box[data-t="stagniert"] b { color: #c8c8c8; }
#stand-liste li.aktuell { box-shadow: inset 3px 0 0 #6fbf7a; }
#info .fehlt { color: #ff8a7a; }
#statistik { position: fixed; z-index: 8; top: 56px; left: 50%; transform: translateX(-50%); width: min(1000px, calc(100vw - 24px)); height: min(600px, calc(100vh - 150px));
  display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border-radius: 10px; background: rgba(18, 22, 28, .95); backdrop-filter: blur(6px); border: 1px solid rgba(255,255,255,.08); }
#statistik[hidden] { display: none; }
#statistik .kopf { display: flex; justify-content: space-between; align-items: center; }
#statistik .koerper { flex: 1; min-height: 0; display: flex; gap: 10px; }
#stat-liste { width: 210px; flex: none; overflow-y: auto; display: flex; flex-direction: column; gap: 1px; scrollbar-width: thin; }
#stat-liste button { display: flex; align-items: center; gap: 6px; padding: 3px 8px; border: none; border-radius: 6px; background: none; text-align: left; font-size: 13px; }
#stat-liste button:hover { background: rgba(255,255,255,.08); }
#stat-liste button.aktiv { background: #3d6b45; }
#stat-liste i { font-style: normal; width: 20px; text-align: center; }
#stat-liste span { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#stat-liste b { font-variant-numeric: tabular-nums; font-weight: 500; opacity: .85; }
#statistik .flaeche { flex: 1; min-width: 0; position: relative; border-radius: 8px; background: #f3ead6; overflow: hidden; }
#stat-bild { position: absolute; inset: 0; width: 100%; height: 100%; }
@media (max-width: 640px) { #stat-liste { width: 140px; } }
#speicher .zeile button, #stand-liste button { padding: 3px 7px; font-size: 15px; }
.ikon { width: 1.25em; height: 1.25em; vertical-align: -0.28em; }
#stat-liste button.neu { margin-top: 9px; }
#info .werte { display: grid; grid-template-columns: auto auto; gap: 3px 16px; align-items: center; font-size: 13px; margin: 2px 0 4px; }
#info .werte > span { opacity: .75; white-space: nowrap; }
#info .werte > span i { font-style: normal; display: inline-block; width: 18px; text-align: center; }
#info .werte > b { font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; }
#info .werte > b.ja { color: #7fd17f; }
#info .werte > b.teils { color: #f0c060; }
#info .werte > b.nein { color: #ff8a7a; }
#info .werte > span.nein { opacity: .5; }
#zufrieden-info .kopf { display: grid; grid-template-columns: 1fr 70px 64px; gap: 8px; font-weight: 600; }
#zufrieden-info .kopf i, #zufrieden-info .kopf b { font-style: normal; font-weight: 400; opacity: .6; text-align: right; font-size: 12px; }
#zufrieden-info .teil { display: grid; grid-template-columns: 1fr 70px 64px; gap: 8px; }
#zufrieden-info .teil i { font-style: normal; text-align: right; font-variant-numeric: tabular-nums; }
#zufrieden-info .teil b { text-align: right; font-weight: 500; font-variant-numeric: tabular-nums; }
#zufrieden-info .voll i { color: #7fd17f; }
#zufrieden-info .halb i { color: #f0c060; }
#zufrieden-info .schlecht i { color: #ff8a7a; }
#hilfe { position: fixed; z-index: 8; top: 56px; left: 50%; transform: translateX(-50%); width: min(860px, calc(100vw - 24px)); max-height: calc(100vh - 150px);
  display: flex; flex-direction: column; gap: 8px; padding: 10px 14px; border-radius: 10px; background: rgba(18, 22, 28, .96); backdrop-filter: blur(6px); border: 1px solid rgba(255,255,255,.08); }
#hilfe[hidden] { display: none; }
#hilfe .kopf { display: flex; justify-content: space-between; align-items: center; }
#hilfe-inhalt { overflow-y: auto; padding: 4px 16px 12px; font-size: 13px; line-height: 1.45; scrollbar-width: thin; background: #f3ead6; color: #3a2e20; border-radius: 8px; }
#hilfe-inhalt h3 { margin: 14px 0 6px; font-size: 14px; color: #6a4520; }
#hilfe-inhalt p { margin: 4px 0; opacity: .9; }
#hilfe-inhalt .klein { font-size: 12px; opacity: .65; }
#hilfe-inhalt table { border-collapse: collapse; width: 100%; }
#hilfe-inhalt th { text-align: left; font-weight: 600; color: #7a6446; padding: 2px 8px 2px 0; border-bottom: 1px solid rgba(90,64,36,.35); }
#hilfe-inhalt td { padding: 3px 10px 3px 0; border-bottom: 1px solid rgba(90,64,36,.12); vertical-align: top; }
#hilfe-inhalt .version { margin: 8px 0 2px; font-size: 12px; opacity: .6; }
#hilfe-inhalt .mix { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; }
#hilfe-inhalt .mix label { display: flex; align-items: center; gap: 4px; white-space: nowrap; }
#hilfe-inhalt .mix input { width: 52px; padding: 2px 4px; font: inherit; border: 1px solid rgba(90,64,36,.35); border-radius: 4px; background: #fffaf0; color: #3a2e20; }
#hilfe-inhalt .mix .mix-summe.fehlt { color: #b0301f; }
#hilfe-inhalt .mix { margin: 2px 0 8px; }
#hilfe-inhalt details.thema { border-bottom: 1px solid rgba(90,64,36,.2); }
#hilfe-inhalt details.thema > summary { cursor: pointer; list-style: none; padding: 9px 0 8px; font-weight: 600; font-size: 14px; color: #6a4520; display: flex; align-items: center; gap: 8px; }
#hilfe-inhalt details.thema > summary::-webkit-details-marker { display: none; }
#hilfe-inhalt details.thema > summary::before { content: '▸'; display: inline-block; width: 10px; transition: transform .15s; color: #9a7a52; }
#hilfe-inhalt details.thema[open] > summary::before { transform: rotate(90deg); }
#hilfe-inhalt details.thema > summary:hover { color: #8a5a28; }
#hilfe-inhalt .thema-inhalt { padding: 0 0 12px 18px; }
#hilfe-inhalt .mix button { padding: 1px 8px; border: 1px solid rgba(90,64,36,.35); border-radius: 4px; background: #fffaf0; color: #3a2e20; cursor: pointer; }
#hilfe-inhalt td.fehlt { color: #b0301f; font-weight: 600; }
#hilfe-inhalt td.ok { color: #2f6b3a; }
#stat-plan { position: absolute; inset: 0; overflow-y: auto; padding: 6px 16px 12px; color: #3a2e20; font-size: 13px; line-height: 1.4; scrollbar-width: thin; }
#stat-plan[hidden] { display: none; }
#stat-plan h3 { margin: 10px 0 4px; font-size: 14px; color: #6a4520; }
#stat-plan .klein { margin: 0 0 6px; font-size: 12px; opacity: .7; }
#stat-plan table { border-collapse: collapse; width: 100%; }
#stat-plan th { text-align: left; font-weight: 600; color: #7a6446; padding: 2px 8px 2px 0; border-bottom: 1px solid rgba(90,64,36,.35); }
#stat-plan td { padding: 3px 10px 3px 0; border-bottom: 1px solid rgba(90,64,36,.12); vertical-align: top; }
#stat-plan td.fehlt { color: #b0301f; font-weight: 600; }
#stat-plan td.ok { color: #2f6b3a; }
#info .werte > span.stufe { grid-column: 1 / -1; opacity: 1; margin-top: 5px; font-size: 12px; font-weight: 600; color: #e8d9b0; border-bottom: 1px solid rgba(255,255,255,.1); padding-bottom: 1px; }
#info .werte > b.stufe { display: none; }
#stat-zeitraum { display: flex; gap: 3px; margin-right: 10px; }
#stat-zeitraum button { padding: 2px 8px; font-size: 12px; }
#statistik .kopf { gap: 6px; }

img.ico { height: 1.2em; width: auto; vertical-align: -0.25em; }

/* Einwohnerliste (✅ Steph 19.10.2026) */
#personen { position: fixed; z-index: 8; top: 56px; left: 50%; transform: translateX(-50%); width: min(1180px, calc(100vw - 24px)); max-height: calc(100vh - 150px);
  display: flex; flex-direction: column; gap: 8px; padding: 10px 14px; border-radius: 10px; background: rgba(18, 22, 28, .96); backdrop-filter: blur(6px); border: 1px solid rgba(255,255,255,.08); }
#personen[hidden] { display: none; }
#personen .kopf { display: flex; justify-content: space-between; align-items: center; }
#personen-zahl { font-weight: 400; opacity: .6; }
#personen-inhalt { overflow: auto; border-radius: 8px; background: #f3ead6; color: #3a2e20; font-size: 12.5px; scrollbar-width: thin; }
#personen-inhalt table { border-collapse: collapse; width: 100%; }
#personen-inhalt th { position: sticky; top: 0; background: #e6d9bd; text-align: left; font-weight: 600; color: #6a5236; padding: 5px 10px; border-bottom: 1px solid rgba(90,64,36,.35); cursor: pointer; white-space: nowrap; user-select: none; }
#personen-inhalt th:hover, #personen-inhalt th.aktiv { color: #3a2e20; background: #dccda9; }
#personen-inhalt td { padding: 3px 10px; border-bottom: 1px solid rgba(90,64,36,.12); white-space: nowrap; }
#personen-inhalt td.zahl { text-align: right; font-variant-numeric: tabular-nums; }
#personen-inhalt tr:hover td { background: rgba(255,255,255,.45); }
#personen-inhalt a { color: #3a2e20; cursor: pointer; text-decoration: none; }
#personen-inhalt a:hover { text-decoration: underline; }

#personen-knopf { cursor: pointer; }
#personen-knopf.aktiv { background: rgba(255,255,255,.14); border-radius: 6px; }
#stat-liste .gruppe { padding: 8px 8px 3px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; opacity: .55; }
#stat-liste .gruppe:first-child { padding-top: 2px; }
#einstellungen { position: fixed; z-index: 8; top: 56px; left: 50%; transform: translateX(-50%); width: min(460px, calc(100vw - 24px));
  display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border-radius: 10px; background: rgba(18, 22, 28, .95); backdrop-filter: blur(6px); border: 1px solid rgba(255,255,255,.08); }
#einstellungen[hidden] { display: none; }
#einstellungen .kopf { display: flex; justify-content: space-between; align-items: center; }
#einstellungen-inhalt { border-radius: 8px; background: #f3ead6; color: #3a2e20; font-size: 13px; padding: 8px 10px; }
#einstellungen-inhalt h3 { margin: 0 0 6px; font-size: 14px; }
#einstellungen-inhalt table { border-collapse: collapse; width: 100%; }
#einstellungen-inhalt th { text-align: left; font-weight: 600; color: #6a5236; padding: 3px 6px; border-bottom: 1px solid rgba(90,64,36,.35); }
#einstellungen-inhalt td { padding: 3px 6px; border-bottom: 1px solid rgba(90,64,36,.12); }
#einstellungen-inhalt .zahl { text-align: right; font-variant-numeric: tabular-nums; }
#einstellungen-inhalt input { width: 52px; text-align: right; font: inherit; padding: 1px 4px; border: 1px solid rgba(90,64,36,.4); border-radius: 4px; background: #fffaf0; color: #3a2e20; }
#einstellungen-inhalt input:disabled { opacity: .5; }
#einstellungen-inhalt p { margin: 8px 0 0; }
#w-taler-box { cursor: pointer; }
#info .aemter { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
#info .aemter button { font-size: 12px; white-space: nowrap; }
.svg-ikon { width: 1.15em; height: 1.15em; vertical-align: -0.22em; }
