:root {
  --bg: #e8d9b0; --panel: #f7edd0; --panel2: #efe0b4; --line: #6b4a2b; --text: #3a2a1a; --muted: #7a6548; --field: #fffaf0;
  --accent: #e0a526; --accent-dark: #a8760e; --ok: #3f7d2a; --bad: #b3362a; --blue: #3f6fb5; --title: #007623;
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; color: var(--text); font: 16px/1.45 ui-monospace, "Cascadia Mono", Menlo, Consolas, monospace; background: var(--bg); }
canvas, img { image-rendering: pixelated; image-rendering: crisp-edges; }
h1, h2, h3 { margin: 0 0 .5rem; letter-spacing: .02em; }
h1 { font-size: 1.4rem; display: flex; align-items: center; gap: .6rem; color: var(--title); text-shadow: 1px 1px 0 rgba(255,255,255,.6); }
h2 { font-size: 1.15rem; display: flex; align-items: center; gap: .6rem; }
h3 { font-size: 1rem; color: var(--title); }
.logo { width: 36px; height: 36px; }
.top { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; padding: .6rem 16px; background: var(--panel); border-bottom: 4px solid var(--line); }
.who { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.center { max-width: 460px; margin: 1.5rem auto; padding: 0 16px; }
.center.wide { max-width: 760px; }
.lead { color: var(--muted); }
.muted { color: var(--muted); } .small { font-size: .82rem; }
.card { background: var(--panel); border: 4px solid var(--line); box-shadow: inset 0 0 0 2px var(--panel2); padding: 14px; border-radius: 2px; margin-bottom: 14px; }
.form { display: grid; gap: .75rem; }
label { display: grid; gap: .25rem; font-size: .9rem; color: var(--muted); }
input { font: inherit; color: var(--text); background: var(--field); border: 3px solid var(--line); padding: .55rem .6rem; min-width: 0; }
fieldset.salutation { border: 3px solid var(--line); padding: .4rem .7rem .55rem; display: flex; gap: 1.2rem; flex-wrap: wrap; }
fieldset.salutation.hidden { display: none; }
fieldset.salutation legend { font-size: .9rem; color: var(--muted); padding: 0 .3rem; }
label.inline { display: inline-flex; align-items: center; gap: .35rem; color: var(--text); cursor: pointer; }
input:focus-visible, button:focus-visible { outline: 3px solid var(--accent); outline-offset: 1px; }
.tabs { display: flex; gap: 6px; }
.tab { flex: 1; font: inherit; color: var(--muted); background: var(--field); border: 3px solid var(--line); padding: .5rem; cursor: pointer; }
.tab.active { color: #2a1d08; background: var(--accent); }
.btn { font: inherit; font-weight: 700; color: var(--text); background: var(--panel2); border: 3px solid var(--line); box-shadow: inset 0 -4px 0 rgba(0,0,0,.18); padding: .55rem .9rem; cursor: pointer; }
.btn.primary { color: #2a1d08; background: var(--accent); }
.btn.small { padding: .3rem .6rem; font-size: .85rem; }
.btn:hover:not([disabled]) { filter: brightness(1.1); }
.btn[disabled] { opacity: .55; cursor: not-allowed; box-shadow: none; }
.hidden { display: none; }
.banner { color: var(--text); padding: .5rem .7rem; border: 3px solid var(--line); margin: .25rem 0; }
.banner.error { background: #f3c2b6; } .banner.ok { background: #cfe6b0; }
.badge { font-size: .72rem; font-weight: 700; padding: .1rem .45rem; color: #2a1d08; background: var(--accent); border: 2px solid var(--line); text-transform: uppercase; }
.tempo-speed .badge { background: var(--bad); } .tempo-normal .badge { background: var(--blue); color: #fff; }
.world .join { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.world .join input { flex: 1 1 160px; }
.world .msg { flex-basis: 100%; }
.game { max-width: 1200px; margin: 0 auto; padding: 12px 16px 40px; }
.resbar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.res { display: flex; align-items: center; gap: 8px; background: var(--panel); border: 3px solid var(--line); padding: 4px 10px 4px 6px; min-width: 150px; min-height: 66px; box-sizing: border-box; font-variant-numeric: tabular-nums; }
.icon { width: 32px; height: 32px; flex: none; } .icon.big { width: 64px; height: 64px; }
.cap { color: var(--muted); font-size: .8rem; }
.rate { font-size: .72rem; color: var(--ok); } .rate.neg { color: var(--bad); }
.res .rate:not(.neg) { color: var(--muted); }
.res b { font-size: 1.05rem; }
.cols { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 14px; align-items: start; }
@media (max-width: 860px) { .cols { grid-template-columns: 1fr; } }
.scenewrap { position: relative; border: 4px solid var(--line); background: #5a9442; line-height: 0; }
.scene-tag { position: absolute; transform: translate(-50%, 15%); line-height: 1.2; font-size: .72rem; font-weight: 700; white-space: nowrap; pointer-events: none; padding: 1px 6px; border: 2px solid var(--line); }
.scene-tag { background: var(--panel); color: var(--text); z-index: 2; }
.need { list-style: none; margin: 6px 0 0; padding: 4px 8px; border-left: 4px solid #b83c2e; background: #fbe3dc; color: #7d2420; font-size: .85rem; display: grid; gap: 2px; }
.scene { width: 100%; height: auto; display: block; cursor: pointer; }
.info { min-height: 3em; margin: 8px 0 14px; color: var(--muted); }
dl { display: grid; grid-template-columns: auto 1fr; gap: .2rem .8rem; margin: 0 0 .5rem; }
dt { color: var(--muted); } dd { margin: 0; }
.hint { background: #f6e2a4; border: 3px solid var(--line); padding: .45rem .6rem; }
.job { display: flex; align-items: center; gap: 12px; padding: 6px 0; }
.timer { font-size: 1.3rem; color: var(--accent-dark); }
.blist { display: grid; gap: 10px; }
.bcard { display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; align-items: start; padding: 8px; background: var(--panel2); border: 3px solid var(--line); }
.bcard.locked { opacity: .6; }
@media (max-width: 520px) { .bcard { grid-template-columns: 48px 1fr; } .bcard .btn { grid-column: 1 / -1; } }
.costs { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 4px; }
.cost { display: inline-flex; align-items: center; gap: 4px; } .cost .icon { width: 16px; height: 16px; }
.cost.lack { color: var(--bad); font-weight: 700; }
.boot { padding: 2rem; text-align: center; color: var(--muted); }
@media (prefers-reduced-motion: no-preference) { .btn { transition: filter .1s; } }

/* Dorfmarkt */
.mlist { display: grid; gap: 6px; margin-top: 8px; }
.mrow { display: grid; grid-template-columns: 32px 1fr auto auto; gap: 8px; align-items: center; }
.amount { width: 6em; padding: 4px; background: var(--panel2); color: inherit; border: 3px solid var(--line); font: inherit; }

/* Hinweisfenster */
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.65); display: grid; place-items: center; z-index: 50; padding: 1rem; }
.modal { max-width: 28rem; background: var(--panel); border: 4px solid var(--line); padding: 1rem 1.2rem; }
.modal-actions { margin-top: 1rem; text-align: right; }

/* Lager-Anzeige, Gebäudeauswahl, Kategorien */
.pools { display: grid; gap: 4px; min-width: 190px; padding: 4px 8px; background: var(--panel); border: 3px solid var(--line); }
.pool-label { font-size: .85rem; }
.bar { height: 10px; background: var(--field); border: 2px solid var(--line); }
.bar .fill { height: 100%; background: var(--ok); }
.pool.full .fill { background: var(--bad); }
.ahead { display: flex; align-items: center; gap: 12px; margin-bottom: .5rem; }
.ahead h3 { margin: 0; }
.group { margin: 8px 0; border: 3px solid var(--line); background: var(--panel2); }
.group > summary { cursor: pointer; padding: .45rem .6rem; font-weight: 700; color: var(--title); }
.group .blist { padding: 8px; }
.tempo-speed .badge { color: #fff; }

/* Rathaus-Reiter, Berater, anklickbare Leisten */
.tabs { display: flex; gap: 4px; margin: 6px 0 10px; flex-wrap: wrap; }
.tabs .tab { font: inherit; padding: 4px 10px; border: 3px solid var(--line); background: var(--panel); cursor: pointer; }
.tabs .tab.active { background: #f2c53f; }
.tabs .tab.locked { opacity: .55; }
.faq .group p { margin: 6px 0; }
.res.clickable { cursor: pointer; }
.warn { background: #fbe3dc; border: 3px solid #b83c2e; padding: 6px 10px; margin: 6px 0; color: #7d2420; }
.factors { list-style: none; margin: 6px 0; padding: 0; display: grid; gap: 2px; font-size: .9rem; }
.factors li.neg { color: #b83c2e; }
.notice.trade { display: grid; gap: 4px; cursor: default; margin-bottom: 6px; } .notice.trade .btn { justify-self: start; }
.legal { max-width: 720px; line-height: 1.5; } .legal h2 { font-size: 1.05rem; margin-top: 1.4rem; }
.legal-links { text-align: center; font-size: .8rem; padding: 12px 16px 24px; color: var(--muted); } .legal-links a { color: inherit; }
.btn.danger { background: #fbe3dc; border-color: #b83c2e; color: #7d2420; }
.group.demolish { margin-top: 12px; }
.tip { position: fixed; z-index: 60; max-width: 320px; background: var(--panel); color: var(--text); border: 3px solid var(--line); box-shadow: 0 4px 0 rgba(0,0,0,.18); padding: 8px 10px; font-size: .82rem; line-height: 1.4; display: grid; gap: 4px; pointer-events: none; }
.tip.hidden { display: none; }
.tip-rows { display: grid; grid-template-columns: 1fr auto; gap: 1px 12px; font-variant-numeric: tabular-nums; }
.tip .pos { color: var(--ok); } .tip .neg { color: var(--bad); }
.tip-sum { border-top: 2px solid var(--line); padding-top: 3px; font-weight: 700; text-align: right; }
/* Ressourcenleiste eingeklappt: nur Symbol und Zahl; Pfeil am Ende klappt auf */
.res-toggle { font: inherit; font-size: 1rem; line-height: 1; color: var(--text); background: var(--panel2); border: 3px solid var(--line); cursor: pointer; padding: 0 10px; min-height: 44px; }
.resbar.compact { display: flex; flex-wrap: wrap; gap: 4px; align-items: stretch; }
.resbar.compact .res { min-width: 0; min-height: 0; padding: 3px 8px 3px 4px; gap: 5px; border-width: 2px; }
.resbar.compact .res .icon { width: 20px; height: 20px; }
.resbar.compact .res b { font-size: .9rem; }
.resbar.compact .rate, .resbar.compact .pools { display: none; }
.resbar.compact .res.alert b { color: var(--bad); }
.resbar.compact .skyclock { width: 48px; height: 26px; }
.resbar.compact .res-toggle { min-height: 0; margin-left: auto; border-width: 2px; }
.resbar:not(.compact) .res-toggle { align-self: start; }
/* Rye (Erbe des alten Gaschok): nur für den Schriftzug und erzählende Überschriften, nie für Zahlen oder Bedienelemente.
   Selbst ausgeliefert (kein Google-Fonts-Aufruf, keine IP-Adressen an Dritte); Lizenz: apps/web/FONT-LICENSE-Rye.txt */
@font-face { font-family: 'Rye'; src: url('/rye.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
.top h1, .modal > h3, .quest .qhead > b { font-family: 'Rye', Georgia, serif; font-weight: 400; color: var(--title); letter-spacing: .02em; }
.modal > h3 { font-size: 1.3rem; }
.quest .qhead > b { font-size: 1.05rem; }

/* Kopfzeile im Spiel: schmal; Tempo und „Welten“ gleich groß */
.top { padding: .35rem 12px; gap: .5rem; border-bottom-width: 3px; }
.top h1 { font-size: 1.35rem; margin: 0; gap: .45rem; }
.logo { width: 60px; height: 33px; image-rendering: pixelated; }
.who { gap: .45rem; }
.who-name { font-size: .8rem; color: var(--muted); }
.hdr-btn { box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; min-width: 72px; height: 30px; padding: 0 10px;
  font: inherit; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--text); background: var(--panel2);
  border: 2px solid var(--line); box-shadow: inset 0 -3px 0 rgba(0,0,0,.18); cursor: pointer; }
.hdr-btn.tempo { color: #2a1d08; background: var(--accent); cursor: help; }
.hdr-btn.tempo-speed { color: #fff; background: var(--bad); } .hdr-btn.tempo-normal { color: #fff; background: var(--blue); }
@media (max-width: 520px) { .top { flex-wrap: nowrap; } .top h1 { font-size: 1rem; } .logo { width: 48px; height: 26px; } .who-name { max-width: 7rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .hdr-btn { min-width: 60px; padding: 0 6px; } }
.only-narrow { display: none; }
@media (max-width: 860px) { .only-narrow { display: inline-block; margin-left: auto; align-self: start; } }
/* Handy: Leiste kompakt, drei Kacheln je Zeile, Uhr und Lager über die volle Breite */
@media (max-width: 520px) {
  .resbar { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
  .res { min-width: 0; min-height: 46px; padding: 3px 4px; gap: 4px; border-width: 2px; }
  .res .icon { width: 20px; height: 20px; }
  .res b { font-size: .88rem; }
  .rate { font-size: .64rem; line-height: 1.2; }
  .res.clock, .pools { grid-column: 1 / -1; min-width: 0; }
  .res.clock { min-height: 0; }
  .skyclock { width: 72px; height: 39px; }
  .pools { padding: 3px 6px; gap: 2px; font-size: .78rem; }
  .game { padding: 8px 8px 32px; }
  .tip { max-width: calc(100vw - 16px); }
}
.boost { margin-top: 10px; padding: 8px 10px; border: 3px solid var(--line); background: var(--panel2); display: grid; gap: 4px; justify-items: start; }
.boost.on { border-color: var(--title); }
.boost p { margin: 0; }
.intro-steps { padding-left: 1.3rem; display: grid; gap: 6px; margin: 4px 0 8px; }
.modal { max-height: calc(100vh - 2rem); overflow-y: auto; }
.skyclock { width: 96px; height: 52px; image-rendering: pixelated; flex: none; }
.res.clock { gap: 10px; }
.supply { margin: 0 0 .4rem; } .supply dd.neg b { color: #b83c2e; }

/* Bürgeranfragen und Logbuch */
.notice-box { margin: 6px 0; }
.notice { display: block; width: 100%; text-align: left; padding: 8px 12px; background: var(--panel2); border: 3px solid var(--accent, #c9a227); color: inherit; font: inherit; cursor: pointer; }
.notice:hover { filter: brightness(1.1); }
.quest { padding: 10px; margin: 8px 0; background: var(--panel2); border: 3px solid var(--line); }
.quest p { margin: 8px 0; line-height: 1.5; }
.qhead { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.qrow { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; margin: 6px 0; }
.qbtns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.qopts { display: grid; gap: 8px; margin-top: 8px; }
.qopt { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 6px 8px; border: 2px solid var(--line); }
.qopt b { flex: 1 1 100%; }
.chips { display: inline-flex; flex-wrap: wrap; gap: 4px 10px; }
.log { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.log li { padding: 6px 8px; border-left: 4px solid var(--line); line-height: 1.4; }
.log { margin-bottom: 14px; }

/* Konto und Verwaltung (0042) */
.linkbtn { background: none; border: 0; padding: .2rem 0; font: inherit; font-size: .88rem; color: var(--title, #007623); text-decoration: underline; cursor: pointer; justify-self: start; }
.linkbtn.hidden { display: none; }
.danger-zone summary { cursor: pointer; font-weight: 700; color: #7d2420; }
.danger-zone[open] summary { margin-bottom: .6rem; }
.table-wrap { overflow-x: auto; margin: .4rem 0 .8rem; }
table.admin { width: 100%; border-collapse: collapse; font-size: .88rem; }
table.admin th { text-align: left; font-size: .75rem; text-transform: uppercase; color: var(--muted); border-bottom: 2px solid var(--line); padding: .3rem .4rem; }
table.admin td { border-bottom: 1px solid var(--panel2); padding: .4rem; vertical-align: top; }
table.admin td .btn { margin: 0 .3rem .3rem 0; }
table.admin td.num { text-align: right; white-space: nowrap; }
table.admin tr.muted td { color: var(--muted); }
table.admin tr.neg td { background: #fbe3dc; }
.admin-form { max-width: 420px; margin-top: .6rem; }
select { font: inherit; color: var(--text); background: var(--field); border: 3px solid var(--line); padding: .45rem .5rem; }

/* Warteschlange beim Baumeister (0043) */
.queue { border: 3px solid var(--line); background: var(--panel2); padding: .5rem .7rem; margin: .4rem 0 .8rem; }
.qlist { list-style: none; margin: .4rem 0; padding: 0; display: grid; gap: .35rem; }
.qrow { display: grid; grid-template-columns: auto 1fr auto; gap: .5rem; align-items: center; }
.qrow .qbtns .btn { min-width: 2rem; padding-left: .3rem; padding-right: .3rem; }
.small.neg, p.neg, div.neg { color: #b83c2e; }
