/* ============ Anderwelt — Stylesheet ============ */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@500;700;900&family=EB+Garamond:ital,wght@0,400;0,600;1,400&display=swap');

:root {
  --bg: #0b0b1a;
  --bg2: #11112400;
  --panel: #161629;
  --panel2: #1e1e38;
  --panel3: #262647;
  --border: #32325a;
  --gold: #e8c66a;
  --gold2: #b8923f;
  --text: #e6e0d2;
  --muted: #8f8aa8;
  --accent: #7d5cff;
  --bad: #e25b5b;
  --good: #5bd08a;
  --title-font: 'Cinzel', 'Palatino', serif;
  --body-font: 'EB Garamond', Georgia, serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0; min-height: 100vh;
  background: radial-gradient(ellipse at 50% -20%, #1d1438 0%, var(--bg) 55%, #070710 100%);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--body-font);
  font-size: 17px;
}

.title-font { font-family: var(--title-font); }
.muted { color: var(--muted); }
.small { font-size: 0.85em; }
code { background: var(--panel2); padding: 2px 6px; border-radius: 4px; font-size: 0.85em; }
em { color: var(--muted); }
h3 { font-family: var(--title-font); color: var(--gold); font-size: 1.0em; letter-spacing: 0.06em; margin: 14px 0 8px; }

/* ---------- Partikel ---------- */
#particles { position: fixed; inset: 0; pointer-events: none; z-index: 1; overflow: hidden; }
.particle {
  position: absolute; bottom: -10px; border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 6px 1px rgba(232, 198, 106, 0.7);
  animation: float-up linear infinite;
}
@keyframes float-up {
  from { transform: translateY(0) translateX(0); }
  50% { transform: translateY(-55vh) translateX(30px); }
  to { transform: translateY(-110vh) translateX(-20px); }
}

/* ---------- Screens ---------- */
#app { position: relative; z-index: 2; min-height: 100vh; }
.screen { display: none; min-height: 100vh; }
.screen.active { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; }
#screen-game.active { display: block; }

/* ---------- Titel ---------- */
.title-card { text-align: center; margin: auto; padding: 40px 20px; }
.title-moons { position: relative; height: 90px; margin-bottom: -20px; }
.moon { position: absolute; left: 50%; border-radius: 50%; }
.moon.m1 {
  width: 70px; height: 70px; margin-left: -60px; top: 0;
  background: radial-gradient(circle at 35% 35%, #fff6d8, var(--gold) 60%, var(--gold2));
  box-shadow: 0 0 50px 8px rgba(232, 198, 106, 0.45);
  animation: moonpulse 6s ease-in-out infinite;
}
.moon.m2 {
  width: 30px; height: 30px; margin-left: 35px; top: 28px;
  background: radial-gradient(circle at 35% 35%, #e8defc, #9a7fd5 65%, #5e4a8f);
  box-shadow: 0 0 30px 4px rgba(154, 127, 213, 0.5);
  animation: moonpulse 6s ease-in-out 3s infinite;
}
@keyframes moonpulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.07); } }

.game-title {
  font-family: var(--title-font); font-weight: 900;
  font-size: clamp(3.2em, 9vw, 5.5em); margin: 10px 0 0;
  background: linear-gradient(180deg, #fff3cf 5%, var(--gold) 45%, var(--gold2) 75%, #7a5a20);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  letter-spacing: 0.08em;
  filter: drop-shadow(0 0 24px rgba(232, 198, 106, 0.35));
}
.tagline { color: var(--muted); font-style: italic; font-size: 1.15em; margin: 6px 0 36px; }
.title-menu { display: flex; flex-direction: column; gap: 14px; max-width: 460px; margin: 0 auto; }

/* ---------- Buttons & Inputs ---------- */
.btn {
  font-family: var(--title-font); font-size: 0.95em; letter-spacing: 0.04em;
  background: var(--panel2); color: var(--text);
  border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 18px; cursor: pointer;
  transition: all 0.18s ease;
}
.btn:hover:not(:disabled) { border-color: var(--gold2); box-shadow: 0 0 14px rgba(232, 198, 106, 0.25); transform: translateY(-1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-gold {
  background: linear-gradient(180deg, #f4dc94, var(--gold) 45%, var(--gold2));
  color: #2a1f08; border-color: var(--gold2); font-weight: 700;
}
.btn-gold:hover:not(:disabled) { box-shadow: 0 0 22px rgba(232, 198, 106, 0.5); }
.btn-big { font-size: 1.1em; padding: 14px 26px; }
.btn-sm { font-size: 0.78em; padding: 5px 10px; border-radius: 7px; }
.btn-block { width: 100%; margin-top: 12px; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover:not(:disabled) { color: var(--text); box-shadow: none; }
.btn-buy { border-color: var(--good); color: var(--good); }
.btn-sell { border-color: var(--bad); color: #f0a0a0; }

.inp, .sel, .qty {
  font-family: var(--body-font); font-size: 1em;
  background: var(--bg); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px; padding: 9px 12px;
}
.inp:focus, .sel:focus, .qty:focus { outline: none; border-color: var(--gold2); }
.qty { width: 70px; text-align: center; }
.qty.wide { width: 140px; }
.code-inp { text-transform: uppercase; letter-spacing: 0.3em; font-size: 1.3em; text-align: center; width: 100%; margin: 8px 0 16px; }

/* ---------- Setup ---------- */
.setup-card {
  background: linear-gradient(180deg, var(--panel), var(--panel2));
  border: 1px solid var(--border); border-radius: 18px;
  padding: 34px 38px; margin: auto; max-width: 620px; width: calc(100% - 32px);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.55);
  display: flex; flex-direction: column; gap: 14px;
}
.setup-card h1 { color: var(--gold); font-size: 1.8em; margin: 0 0 8px; text-align: center; }
.setup-row { display: flex; gap: 10px; align-items: center; border-left: 4px solid var(--pc, var(--border)); padding-left: 12px; border-radius: 4px; }
.setup-row .inp { flex: 1; }
.avatar-btn {
  font-size: 1.7em; width: 56px; height: 56px;
  background: var(--bg); border: 1px solid var(--border); border-radius: 12px; cursor: pointer;
  transition: all 0.15s;
}
.avatar-btn:hover { border-color: var(--gold2); transform: scale(1.08); }
.setup-opts { display: flex; gap: 18px; align-items: center; color: var(--muted); }
.help-card { max-width: 760px; }
.help-text p { line-height: 1.55; margin: 0.5em 0; }
.help-text b { color: var(--gold); }

.room-code {
  font-family: var(--title-font); font-size: 3em; font-weight: 900; text-align: center;
  letter-spacing: 0.35em; color: var(--gold); text-indent: 0.35em;
  background: var(--bg); border: 1px dashed var(--gold2); border-radius: 12px; padding: 14px;
  text-shadow: 0 0 18px rgba(232, 198, 106, 0.5);
}
.lobby-list { display: flex; flex-direction: column; gap: 8px; }
.lobby-row { background: var(--bg); border-left: 4px solid var(--pc, var(--border)); border-radius: 8px; padding: 10px 14px; font-size: 1.1em; }

/* ---------- Übergabe ---------- */
.handover-card {
  margin: auto; text-align: center; padding: 40px;
  background: linear-gradient(180deg, var(--panel), var(--panel2));
  border: 1px solid var(--border); border-top: 4px solid var(--pc, var(--gold));
  border-radius: 20px; max-width: 560px; width: calc(100% - 32px);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.55);
  animation: rise-in 0.4s ease;
}
@keyframes rise-in { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
.ho-round { color: var(--muted); font-family: var(--title-font); letter-spacing: 0.1em; }
.ho-event { background: var(--bg); border: 1px solid var(--border); border-radius: 12px; padding: 14px 18px; margin: 16px 0; line-height: 1.45; }
.ho-event b { color: var(--gold); }
.ho-event span { color: var(--muted); }
.ho-avatar { font-size: 4.5em; margin: 10px 0; filter: drop-shadow(0 0 18px var(--pc, var(--gold))); }
.handover-card h2 { font-family: var(--title-font); color: var(--text); margin: 0 0 24px; }

/* ---------- HUD & Spielfeld ---------- */
#hud {
  display: flex; align-items: center; gap: 18px;
  padding: 10px 20px; flex-wrap: wrap;
  background: rgba(11, 11, 26, 0.85); backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
}
#hud-left { display: flex; align-items: center; gap: 14px; }
.hud-logo {
  font-weight: 900; font-size: 1.25em;
  background: linear-gradient(180deg, #fff3cf, var(--gold) 60%, var(--gold2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
#hud-round { color: var(--muted); } #hud-round b { color: var(--text); }
#hud-event {
  flex: 1; min-width: 240px; font-size: 0.95em;
  background: var(--panel); border: 1px solid var(--border); border-radius: 10px;
  padding: 6px 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#hud-event b { color: var(--gold); } #hud-event .ev-text { color: var(--muted); }
.ev-icon { margin-right: 6px; }
#hud-city { font-family: var(--title-font); color: var(--gold); letter-spacing: 0.05em; }

#game-grid {
  display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(320px, 1fr);
  gap: 18px; padding: 18px 20px; max-width: 1400px; margin: 0 auto;
}
@media (max-width: 980px) { #game-grid { grid-template-columns: 1fr; } }

#city-art { border-radius: 16px; overflow: hidden; border: 1px solid var(--border); box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5); line-height: 0; }
.cityscape { width: 100%; height: auto; display: block; }
.twinkle { animation: twinkle 3s ease-in-out infinite; }
@keyframes twinkle { 0%, 100% { opacity: 0.15; } 50% { opacity: 0.9; } }
.flicker { animation: flicker 4s ease-in-out infinite; }
@keyframes flicker { 0%, 100% { opacity: 0.9; } 45% { opacity: 0.4; } 60% { opacity: 0.85; } 80% { opacity: 0.3; } }
#city-desc { color: var(--muted); font-style: italic; padding: 10px 4px 2px; }

#locations { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-top: 12px; }
.loc-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  background: linear-gradient(180deg, var(--panel2), var(--panel));
  border: 1px solid var(--border); border-radius: 14px;
  padding: 14px 16px; cursor: pointer; color: var(--text);
  font-family: var(--body-font); text-align: left;
  transition: all 0.18s ease;
}
.loc-card:hover:not(:disabled) { border-color: var(--gold2); transform: translateY(-3px); box-shadow: 0 8px 24px rgba(232, 198, 106, 0.18); }
.loc-card:disabled { opacity: 0.55; cursor: default; }
.loc-icon { font-size: 1.8em; }
.loc-name { font-family: var(--title-font); color: var(--gold); font-size: 1.02em; letter-spacing: 0.03em; }
.loc-sub { color: var(--muted); font-size: 0.82em; }

/* ---------- Spieler-Panel ---------- */
#player-panel {
  background: linear-gradient(180deg, var(--panel2), var(--panel));
  border: 1px solid var(--border); border-radius: 16px; padding: 16px 18px;
}
.pp-head { display: flex; gap: 12px; align-items: center; border-bottom: 1px solid var(--border); padding-bottom: 12px; margin-bottom: 12px; }
.pp-avatar { font-size: 2.6em; filter: drop-shadow(0 0 10px var(--pc, var(--gold))); }
.pp-name { font-family: var(--title-font); font-size: 1.2em; color: var(--text); }
.pp-watch { color: var(--muted); font-size: 0.75em; }
.pp-rank { color: var(--gold); font-style: italic; }
.pp-stats { display: flex; flex-direction: column; gap: 7px; }
.pp-stat { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.pp-stat.big { margin: 10px 0; }
.pp-stat .lbl { color: var(--muted); }
.pp-stat .val { font-weight: 600; display: flex; align-items: center; gap: 8px; }
.pp-stat .val.gold { color: var(--gold); font-size: 1.1em; }
.pp-stat .val.bad { color: var(--bad); }
.pp-stat .val.ap { color: var(--accent); letter-spacing: 0.2em; font-size: 1.1em; }
.bar { display: inline-block; width: 90px; height: 9px; background: var(--bg); border-radius: 5px; overflow: hidden; border: 1px solid var(--border); }
.bar.wide { width: 200px; }
.bar-fill { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--gold)); border-radius: 5px; transition: width 0.4s ease; }
.waiting { text-align: center; color: var(--muted); font-style: italic; padding: 12px 4px 2px; animation: pulse-soft 2s ease-in-out infinite; }
@keyframes pulse-soft { 0%, 100% { opacity: 0.7; } 50% { opacity: 1; } }

#others { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.other-card {
  display: flex; align-items: center; gap: 10px;
  background: var(--panel); border: 1px solid var(--border); border-left: 4px solid var(--pc, var(--border));
  border-radius: 10px; padding: 8px 12px;
}
.other-card.dead { opacity: 0.45; }
.oc-avatar { font-size: 1.5em; }
.oc-info { flex: 1; min-width: 0; }
.oc-name { font-weight: 600; }
.oc-sub { color: var(--muted); font-size: 0.8em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.oc-gold { color: var(--gold); font-weight: 600; white-space: nowrap; }

/* ---------- Log ---------- */
#log-wrap { margin-top: 14px; }
#log {
  background: var(--bg); border: 1px solid var(--border); border-radius: 12px;
  height: 220px; overflow-y: auto; padding: 10px 12px; font-size: 0.88em;
}
.log-line { padding: 3px 0; line-height: 1.4; color: var(--muted); animation: rise-in 0.3s ease; }
.log-line:last-child { color: var(--text); }
.log-r { color: var(--border); font-size: 0.8em; margin-right: 7px; font-family: var(--title-font); }
.log-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 7px; vertical-align: middle; }
.log-good, .log-line.log-good { color: var(--good); }
.log-bad, .log-line.log-bad { color: #f0a0a0; }
.log-line.log-round { color: var(--gold); font-family: var(--title-font); letter-spacing: 0.04em; margin-top: 4px; }

/* ---------- Modals ---------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(5, 5, 14, 0.72); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 18px;
  animation: fade-in 0.2s ease;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: linear-gradient(180deg, var(--panel2), var(--panel));
  border: 1px solid var(--gold2); border-radius: 18px;
  width: min(880px, 100%); max-height: 88vh; display: flex; flex-direction: column;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.7), 0 0 40px rgba(232, 198, 106, 0.12);
  animation: rise-in 0.25s ease;
}
.modal-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 22px; border-bottom: 1px solid var(--border);
}
.modal-head h2 { font-family: var(--title-font); color: var(--gold); font-size: 1.25em; margin: 0; letter-spacing: 0.04em; }
.modal-x { background: none; border: none; color: var(--muted); font-size: 1.3em; cursor: pointer; }
.modal-x:hover { color: var(--text); }
.modal-body { padding: 18px 22px; overflow-y: auto; }
.flavor { color: var(--muted); font-style: italic; margin-top: 0; }

/* Markt */
.markt-top { display: flex; gap: 22px; flex-wrap: wrap; margin-bottom: 12px; color: var(--muted); }
.markt-top b { color: var(--gold); }
.spy-on { color: var(--accent); }
.markt-table { width: 100%; border-collapse: collapse; }
.markt-table th { text-align: left; color: var(--muted); font-family: var(--title-font); font-size: 0.8em; font-weight: 500; letter-spacing: 0.06em; padding: 6px 8px; border-bottom: 1px solid var(--border); }
.markt-table td { padding: 9px 8px; border-bottom: 1px solid rgba(50, 50, 90, 0.4); vertical-align: middle; }
.g-name { display: flex; align-items: center; gap: 10px; }
.g-icon { font-size: 1.5em; }
.g-desc { color: var(--muted); font-size: 0.78em; font-style: italic; }
.g-price { color: var(--gold); font-weight: 600; white-space: nowrap; }
.g-own { text-align: center; }
.g-trade { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.tr { font-weight: 900; margin-left: 4px; }
.tr.up { color: var(--good); } .tr.down { color: var(--bad); } .tr.flat { color: var(--muted); }

/* Reisen */
.city-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; }
.city-card {
  background: var(--bg); border: 1px solid var(--border); border-top: 3px solid var(--ca, var(--border));
  border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 8px;
}
.city-card.here { opacity: 0.75; border-style: dashed; }
.cc-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.cc-head b { font-family: var(--title-font); color: var(--ca, var(--gold)); font-size: 1.1em; }
.cc-fee, .cc-here { color: var(--muted); font-size: 0.85em; white-space: nowrap; }
.city-card p { margin: 0; color: var(--muted); font-size: 0.9em; font-style: italic; }
.cc-tip { font-size: 0.82em; }
.cc-tip.good { color: var(--good); } .cc-tip.dear { color: var(--gold); }

/* Taverne / Gilde / Lager */
.hire-target-row { margin-bottom: 14px; }
.hire-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.hire-card { background: var(--bg); border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.hire-card p { margin: 0; color: var(--muted); font-size: 0.9em; }
.hire-head { display: flex; align-items: center; gap: 10px; }
.hire-head b { font-family: var(--title-font); color: var(--text); }
.hire-icon { font-size: 1.6em; }
.hire-cost { margin-left: auto; color: var(--gold); font-weight: 600; }

.donate-grid { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 14px; }
.donate-card {
  flex: 1; min-width: 140px; display: flex; flex-direction: column; gap: 4px; align-items: center;
  background: var(--bg); border: 1px solid var(--border); border-radius: 14px;
  padding: 18px; cursor: pointer; color: var(--text); font-family: var(--body-font); font-size: 1em;
  transition: all 0.18s;
}
.donate-card:hover { border-color: var(--gold2); transform: translateY(-2px); }
.don-gold { color: var(--gold); font-weight: 700; font-size: 1.2em; }
.don-gain { color: var(--accent); }
.don-ap { color: var(--muted); font-size: 0.8em; }

.gilde-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 700px) { .gilde-cols { grid-template-columns: 1fr; } }
.gilde-actions { display: flex; flex-direction: column; gap: 14px; }
.rank-ladder { display: flex; flex-direction: column-reverse; gap: 4px; }
.rank-row {
  display: flex; align-items: baseline; gap: 10px;
  padding: 6px 10px; border-radius: 8px; font-size: 0.88em; color: var(--muted);
}
.rank-row.now { background: var(--panel3); border: 1px solid var(--gold2); color: var(--text); }
.rank-row.now .rank-name { color: var(--gold); }
.rank-row.done { opacity: 0.55; }
.rank-no { font-family: var(--title-font); color: var(--border); width: 1.4em; }
.rank-row.now .rank-no { color: var(--gold); }
.rank-name { font-weight: 600; flex: 1; }
.rank-req { font-size: 0.85em; white-space: nowrap; }
.rank-inc { color: var(--good); font-size: 0.85em; white-space: nowrap; }

.bank-row { display: flex; gap: 10px; align-items: center; margin: 14px 0; }
.loan-row { display: flex; justify-content: space-between; align-items: center; background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 9px 14px; margin-bottom: 8px; }
.inv-row { display: flex; gap: 12px; align-items: baseline; padding: 6px 4px; border-bottom: 1px solid rgba(50, 50, 90, 0.4); }
.inv-row b { margin-left: auto; }
.inv-val { color: var(--muted); font-size: 0.85em; white-space: nowrap; }

/* ---------- Ende ---------- */
.end-card {
  margin: auto; max-width: 640px; width: calc(100% - 32px); padding: 36px 40px;
  background: linear-gradient(180deg, var(--panel), var(--panel2));
  border: 1px solid var(--gold2); border-radius: 20px; text-align: center;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.7), 0 0 60px rgba(232, 198, 106, 0.15);
}
.end-card h1 { color: var(--gold); margin-top: 0; }
.end-row {
  display: flex; align-items: center; gap: 14px; text-align: left;
  background: var(--bg); border: 1px solid var(--border); border-left: 4px solid var(--pc, var(--border));
  border-radius: 12px; padding: 12px 18px; margin: 10px 0;
}
.end-row.winner {
  border-color: var(--gold); box-shadow: 0 0 24px rgba(232, 198, 106, 0.3);
  background: linear-gradient(90deg, rgba(232, 198, 106, 0.12), var(--bg));
}
.end-pos { font-family: var(--title-font); font-size: 1.4em; width: 1.6em; color: var(--muted); }
.end-row.winner .end-pos { color: var(--gold); }
.end-avatar { font-size: 2em; }
.end-info { flex: 1; } .end-info b { font-family: var(--title-font); font-size: 1.05em; }
.end-sub { color: var(--muted); font-size: 0.8em; }
.end-score { color: var(--gold); font-weight: 700; text-align: right; }
.end-card .btn-big { margin-top: 18px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 36px; transform: translateX(-50%) translateY(20px);
  background: var(--panel3); color: var(--text);
  border: 1px solid var(--bad); border-radius: 12px;
  padding: 12px 22px; z-index: 200; opacity: 0;
  transition: all 0.35s ease; font-size: 1.02em;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6); pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.ok { border-color: var(--good); }
.toast.note { border-color: var(--gold2); color: var(--text); }

/* ---------- Gold-Puls in der Kopfzeile ---------- */
#banner-gold { display: inline-block; border-radius: 4px; }
#banner-gold.gold-up { animation: gold-up 0.8s ease; }
#banner-gold.gold-down { animation: gold-down 0.8s ease; }
@keyframes gold-up {
  0% { transform: scale(1); }
  30% { transform: scale(1.12); text-shadow: 0 0 14px rgba(47, 90, 42, 0.9); color: #2f5a2a; }
  100% { transform: scale(1); }
}
@keyframes gold-down {
  0% { transform: scale(1); }
  30% { transform: scale(1.08); text-shadow: 0 0 14px rgba(138, 31, 16, 0.9); color: #8a1f10; }
  100% { transform: scale(1); }
}

/* ---------- Landkarte ---------- */
.map-svg { width: 100%; height: auto; display: block; }
.map-label {
  fill: var(--text); font-family: var(--title-font); font-size: 13px;
  letter-spacing: 0.05em; paint-order: stroke; stroke: #0b0b1a; stroke-width: 3px;
}
.map-label.gold { fill: var(--gold); font-size: 11px; }
.map-title { fill: var(--gold2); font-family: var(--title-font); font-size: 15px; letter-spacing: 0.3em; opacity: 0.8; }
.map-city { cursor: pointer; }
.map-city:hover circle { filter: drop-shadow(0 0 8px rgba(232, 198, 106, 0.8)); }
.map-city:hover .map-label { fill: var(--gold); }
.map-token { filter: drop-shadow(0 0 4px rgba(0, 0, 0, 0.9)); }
.here-ring { animation: ring-pulse 2.4s ease-in-out infinite; transform-origin: center; }
@keyframes ring-pulse { 0%, 100% { opacity: 0.9; } 50% { opacity: 0.3; } }

/* ---------- Stadt-Dialog ---------- */
.city-banner { border-radius: 12px; overflow: hidden; border: 1px solid var(--border); line-height: 0; margin-bottom: 12px; }
.city-banner .cityscape { height: 130px; object-fit: cover; }
.city-facts { display: flex; flex-direction: column; gap: 4px; color: var(--muted); font-size: 0.9em; margin-bottom: 14px; }
.city-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.prod-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.prod-row .sel { max-width: 100%; }

/* ---------- Ämter ---------- */
.bew-banner {
  background: rgba(232, 198, 106, 0.08); border: 1px solid var(--gold2); border-radius: 10px;
  padding: 10px 14px; margin-bottom: 12px;
}
.office-list { display: flex; flex-direction: column; gap: 10px; }
.office-row {
  display: grid; grid-template-columns: 1.6fr 1fr auto; gap: 12px; align-items: center;
  background: var(--bg); border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px;
}
@media (max-width: 760px) { .office-row { grid-template-columns: 1fr; } }
.office-row.vacant { border-color: var(--gold2); box-shadow: 0 0 14px rgba(232, 198, 106, 0.12); }
.office-row.mine { border-left: 4px solid var(--gold); }
.of-name { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.of-income { color: var(--good); font-size: 0.82em; }
.of-vacant {
  color: #2a1f08; background: var(--gold); border-radius: 6px; padding: 1px 8px;
  font-size: 0.75em; font-family: var(--title-font); letter-spacing: 0.03em;
  animation: pulse-soft 2s ease-in-out infinite;
}
.of-mine { color: var(--gold); font-size: 0.78em; font-family: var(--title-font); }
.of-sub { color: var(--muted); font-size: 0.78em; margin-top: 2px; line-height: 1.4; }
.holder-chip {
  border-left: 3px solid var(--pc, var(--gold)); padding-left: 7px; font-weight: 600;
}
.holder-npc { color: var(--muted); font-style: italic; }
.of-gunst { color: var(--muted); font-size: 0.78em; display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.bar.sm { width: 60px; height: 7px; }
.of-actions { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.bribe-box { display: flex; gap: 6px; align-items: center; }
.bribe-box .qty { width: 84px; }
.of-applied { color: var(--good); font-family: var(--title-font); font-size: 0.85em; }

/* ---------- Familie & Gesundheit ---------- */
.bar-fill.ok { background: linear-gradient(90deg, #3a9a64, var(--good)); }
.bar-fill.warn { background: linear-gradient(90deg, #b8923f, var(--gold)); }
.bar-fill.crit { background: linear-gradient(90deg, #8a2f2f, var(--bad)); }
.pp-gen { color: var(--muted); font-size: 0.7em; font-family: var(--body-font); }

/* ============ Fugger-Stil: Pergament & Fraktur ============ */
@import url('https://fonts.googleapis.com/css2?family=UnifrakturMaguntia&display=swap');

.fraktur { font-family: 'UnifrakturMaguntia', var(--title-font), serif; }

/* ---------- Pergament-Banner (Kopfzeile) ---------- */
#hud { flex-direction: column; gap: 8px; padding: 8px 14px 10px; }
#banner {
  width: 100%; max-width: 1360px; margin: 0 auto;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(138, 106, 58, 0.18), transparent 60%),
    radial-gradient(ellipse at 85% 100%, rgba(138, 106, 58, 0.22), transparent 55%),
    linear-gradient(178deg, #efe1ba, #e2d0a2 55%, #d2bb88);
  border: 2px solid #5a4226; border-radius: 4px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.6), inset 0 0 26px rgba(90, 66, 38, 0.25);
  padding: 6px 18px 7px;
  color: #2a1a08;
  font-family: 'UnifrakturMaguntia', var(--title-font), serif;
}
.banner-row1 { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; font-size: 1.35em; }
.banner-deco { font-size: 0.75em; opacity: 0.6; letter-spacing: 0.2em; }
.banner-row2 { text-align: center; font-size: 1.05em; margin-top: -2px; }
#hud-event { width: 100%; max-width: 1360px; margin: 0 auto; }

/* ---------- Pergamentkarte ---------- */
.map-svg { width: 100%; height: auto; display: block; }
#city-art { box-shadow: 0 14px 44px rgba(0, 0, 0, 0.55); border-radius: 10px; overflow: hidden; line-height: 0; border: 1px solid #3a2a18; }
.map-label {
  fill: #3a2a18; font-family: 'UnifrakturMaguntia', serif; font-size: 16px;
  paint-order: stroke; stroke: #e8d9b0; stroke-width: 3px;
}
.map-label.small { font-size: 12px; }
.map-mark-label {
  fill: #6b5232; font-family: 'UnifrakturMaguntia', serif; font-size: 27px;
  letter-spacing: 0.3em; opacity: 0.5;
}
.map-lake-label { fill: #3f5a70; font-family: 'UnifrakturMaguntia', serif; font-size: 14px; font-style: italic; opacity: 0.85; }
.map-cartouche { fill: #3a2a18; font-family: 'UnifrakturMaguntia', serif; font-size: 23px; }
.map-cartouche-sub { fill: #6b5232; font-family: var(--body-font); font-style: italic; font-size: 10px; }
.map-compass-n { fill: #6b5232; font-family: 'UnifrakturMaguntia', serif; font-size: 14px; }
.map-city { cursor: pointer; }
.map-city:hover .map-label { fill: #8a1f10; }
.map-city:hover { filter: drop-shadow(0 0 6px rgba(201, 162, 39, 0.9)); }
.map-token { filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5)); }
.here-ring { animation: ring-pulse 2.4s ease-in-out infinite; }

/* ---------- Auftragsbuch ---------- */
.auftragsbuch {
  background: linear-gradient(178deg, #efe1ba, #ddca96);
  border: 2px solid #5a4226; border-radius: 6px;
  box-shadow: inset 0 0 30px rgba(90, 66, 38, 0.25);
  color: #2a1a08; padding: 12px 16px; margin: 12px 0;
}
.ab-head { text-align: center; font-size: 1.25em; margin-bottom: 8px; }
.ab-row {
  display: flex; align-items: center; gap: 10px;
  border-bottom: 1px dotted #8a6a3a; padding: 5px 2px; font-size: 1.05em;
}
.ab-status { font-size: 1.1em; color: #5a4226; width: 1.2em; text-align: center; }
.ab-text { flex: 1; font-size: 1.15em; }
.ab-cost { color: #6b4a22; font-size: 0.85em; white-space: nowrap; }
.ab-row .btn-ghost { color: #8a3a2a; }
.ab-prognose { text-align: center; padding: 7px 0 3px; font-size: 1.1em; border-bottom: 1px dotted #8a6a3a; }
.ab-editor {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  padding-top: 10px; font-family: var(--body-font); font-size: 0.9em;
}
.ab-editor .sel.sm, .ab-editor .qty {
  background: #f5ecd2; color: #2a1a08; border-color: #8a6a3a; padding: 6px 8px; font-size: 0.95em;
}
.ab-editor label { display: flex; gap: 5px; align-items: center; }
.auftragsbuch .muted { color: #6b5232; }

/* ---------- Ämterbaum ---------- */
.amt-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.amt-tree {
  background:
    radial-gradient(ellipse at 80% 10%, rgba(138, 106, 58, 0.2), transparent 55%),
    linear-gradient(178deg, #efe1ba, #ddca96);
  border: 2px solid #5a4226; border-radius: 8px;
  box-shadow: inset 0 0 34px rgba(90, 66, 38, 0.28);
  padding: 16px 12px; color: #2a1a08;
}
.amt-row { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; }
.amt-arrow {
  text-align: center; color: #6b5232; font-family: var(--title-font);
  font-size: 0.72em; letter-spacing: 0.18em; padding: 6px 0;
}
.amt-node {
  width: 168px; text-align: center; padding: 10px 8px 8px;
  background: rgba(245, 236, 210, 0.6); border: 1.5px solid #8a6a3a; border-radius: 8px;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
}
.amt-node.vacant { border-color: #8a1f10; box-shadow: 0 0 10px rgba(138, 31, 16, 0.35); }
.amt-node.mine { border-width: 2.5px; border-color: #b8923f; background: rgba(232, 198, 106, 0.35); }
.amt-medal {
  width: 52px; height: 52px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #f5ecd2, #d2bb88);
  border: 2px solid #5a4226; font-size: 1.7em;
  display: flex; align-items: center; justify-content: center;
}
.amt-office { font-family: var(--title-font); font-size: 0.78em; font-weight: 700; color: #5a4226; letter-spacing: 0.02em; }
.amt-holder { font-family: 'UnifrakturMaguntia', serif; font-size: 1.02em; line-height: 1.15; }
.amt-vacant {
  background: #8a1f10; color: #f5ecd2; border-radius: 5px; padding: 1px 7px;
  font-size: 0.68em; font-family: var(--title-font); letter-spacing: 0.04em;
  animation: pulse-soft 2s ease-in-out infinite;
}
.amt-gunst { width: 86%; display: flex; align-items: center; gap: 6px; }
.amt-gunst .gunst-bar { flex: 1; }
.gunst-bar {
  display: block; height: 8px; background: #c9b68c; border: 1px solid #5a4226; border-radius: 2px; overflow: hidden;
}
.gunst-bar span { display: block; height: 100%; background: linear-gradient(90deg, #6b4a22, #2a1a08); transition: width 0.5s ease; }
.gunst-num { font-family: var(--title-font); font-size: 0.72em; font-weight: 700; color: #5a4226; min-width: 1.6em; text-align: right; }

/* Das Volk im Ämterbaum */
.amt-node.volk-node { border-color: #2f5a2a; background: rgba(214, 228, 196, 0.55); }
.amt-node.volk-node .amt-medal { background: radial-gradient(circle at 35% 30%, #e8f0d8, #b8cc98); }

/* ---------- Wahlkampf ---------- */
.wahlkampf {
  background:
    radial-gradient(ellipse at 85% 0%, rgba(163, 61, 45, 0.10), transparent 55%),
    linear-gradient(178deg, #efe1ba, #ddca96);
  border: 2px solid #8a1f10; border-radius: 8px;
  box-shadow: inset 0 0 30px rgba(90, 66, 38, 0.25), 0 0 16px rgba(138, 31, 16, 0.25);
  color: #2a1a08; padding: 12px 16px; margin-bottom: 14px;
}
.wk-head { text-align: center; font-size: 1.35em; color: #8a1f10; }
.wk-hint { color: #6b5232; font-size: 0.88em; font-style: italic; text-align: center; margin: 4px 0 10px; }
.wk-box {
  background: rgba(245, 236, 210, 0.65); border: 1.5px solid #8a6a3a; border-radius: 8px;
  padding: 10px 12px; margin-bottom: 10px;
}
.wk-box:last-child { margin-bottom: 0; }
.wk-title { font-size: 1.15em; text-align: center; margin-bottom: 6px; }
.wk-apply { display: flex; gap: 10px; align-items: center; justify-content: center; flex-wrap: wrap; margin-bottom: 8px; }
.wk-apply .of-applied { color: #2f5a2a; font-family: var(--title-font); }
.wk-electors { display: flex; flex-direction: column; gap: 6px; }
.wk-chip {
  display: flex; gap: 10px; align-items: center;
  background: rgba(255, 250, 235, 0.7); border: 1px solid #8a6a3a; border-radius: 8px;
  padding: 6px 10px;
}
.wk-chip.player { border-style: dashed; }
.wk-portrait {
  width: 36px; height: 36px; border-radius: 50%; font-size: 1.25em; flex: none;
  background: radial-gradient(circle at 35% 30%, #f5ecd2, #d2bb88);
  border: 1.5px solid #5a4226; display: flex; align-items: center; justify-content: center;
}
.wk-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.wk-info b { font-family: 'UnifrakturMaguntia', serif; font-size: 1.05em; }
.wk-sub { color: #6b5232; font-size: 0.78em; }
.wk-gunst { display: flex; align-items: center; gap: 6px; font-size: 0.8em; font-weight: 700; color: #5a4226; max-width: 220px; }
.wk-gunst .gunst-bar { flex: 1; min-width: 80px; }
.wk-chip .bribe-box .qty.xs { width: 70px; padding: 4px 6px; font-size: 0.85em; background: #f5ecd2; color: #2a1a08; border-color: #8a6a3a; }
.amt-ctrl { display: flex; gap: 5px; align-items: center; justify-content: center; flex-wrap: wrap; min-height: 26px; }
.amt-ctrl .qty.xs { width: 64px; padding: 4px 6px; font-size: 0.85em; background: #f5ecd2; color: #2a1a08; border-color: #8a6a3a; }
.amt-ctrl .btn-sm { padding: 4px 8px; }
.amt-ctrl .of-applied { color: #2f5a2a; font-family: var(--title-font); font-size: 0.8em; }

/* ---------- Handbuch ---------- */
.help-card { max-width: 960px; }
.help-layout { display: grid; grid-template-columns: 240px 1fr; gap: 18px; min-height: 380px; }
@media (max-width: 760px) { .help-layout { grid-template-columns: 1fr; } }
.help-nav { display: flex; flex-direction: column; gap: 4px; }
.help-nav-btn {
  text-align: left; background: var(--bg); color: var(--muted);
  border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px;
  font-family: var(--body-font); font-size: 0.92em; cursor: pointer; transition: all 0.15s;
}
.help-nav-btn:hover { color: var(--text); border-color: var(--gold2); }
.help-nav-btn.active { background: var(--panel3); color: var(--gold); border-color: var(--gold2); }
.help-content h2 { font-family: var(--title-font); color: var(--gold); font-size: 1.2em; margin: 0 0 10px; }
.help-content { background: var(--bg); border: 1px solid var(--border); border-radius: 12px; padding: 16px 20px; overflow-y: auto; max-height: 56vh; }

/* ---------- Jahres-Chronik & Wahl-Zeremonien ---------- */
.chronik-card {
  margin: 24px auto; max-width: 860px; width: calc(100% - 32px);
  background:
    radial-gradient(ellipse at 15% 0%, rgba(138, 106, 58, 0.18), transparent 60%),
    radial-gradient(ellipse at 90% 100%, rgba(138, 106, 58, 0.22), transparent 55%),
    linear-gradient(178deg, #efe1ba, #e2d0a2 55%, #d2bb88);
  border: 3px solid #5a4226; border-radius: 8px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.65), inset 0 0 40px rgba(90, 66, 38, 0.25);
  color: #2a1a08; padding: 26px 34px 30px;
  animation: rise-in 0.4s ease;
  display: flex; flex-direction: column; gap: 6px;
}
.ch-head { text-align: center; font-size: 2em; }
.ch-jahr { text-align: center; font-size: 1.2em; color: #6b4a22; margin-bottom: 8px; }
.ch-sec {
  font-family: var(--title-font); color: #5a4226; font-size: 0.95em;
  letter-spacing: 0.06em; border-bottom: 1px solid #8a6a3a; padding-bottom: 3px; margin: 14px 0 6px;
}
.ch-list { display: flex; flex-direction: column; gap: 3px; }
.ch-line { font-size: 0.98em; line-height: 1.45; }
.ch-line.ch-good { color: #2f5a2a; }
.ch-line.ch-bad { color: #8a1f10; }
.ch-line.ch-round { color: #5a4226; font-weight: 700; }
.ch-line.ch-story { font-style: italic; color: #4a3a6b; padding: 4px 0; }
.ch-line.ch-flavor { color: #6b5232; font-style: italic; font-size: 0.92em; }
.ch-event { background: rgba(245, 236, 210, 0.7); border: 1.5px solid #8a6a3a; border-radius: 8px; padding: 10px 14px; }
.chronik-card .btn-big { margin: 18px auto 0; }
.chronik-card .muted { color: #6b5232; text-align: center; }

.wahl-card {
  background: rgba(245, 236, 210, 0.65); border: 2px solid #8a6a3a; border-radius: 10px;
  padding: 12px 16px; margin: 6px 0;
}
.wahl-card.done { opacity: 0.85; border-style: dashed; }
.wahl-title { font-size: 1.3em; text-align: center; margin-bottom: 8px; }
.wahl-cands { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-bottom: 8px; }
.wahl-cand {
  width: 150px; text-align: center; padding: 8px;
  background: rgba(255, 250, 235, 0.7); border: 2px solid var(--pc, #8a6a3a); border-radius: 8px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.wahl-cand.volk { border-color: #8a6a3a; border-style: dotted; }
.wahl-medal {
  width: 46px; height: 46px; border-radius: 50%; font-size: 1.5em;
  background: radial-gradient(circle at 35% 30%, #f5ecd2, #d2bb88);
  border: 2px solid #5a4226; display: flex; align-items: center; justify-content: center;
}
.wahl-name { font-size: 1.02em; line-height: 1.1; }
.wahl-sub { font-size: 0.72em; color: #6b5232; }
.wahl-votes { font-family: var(--title-font); font-size: 0.8em; font-weight: 700; color: #2a1a08; }
.wahl-pending {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: center;
  padding: 7px; border-top: 1px dotted #8a6a3a; font-size: 0.95em;
}
.wahl-pending.vote-now { background: rgba(201, 162, 39, 0.15); border-radius: 6px; }
.wahl-result { text-align: center; color: #5a4226; font-size: 0.88em; padding-top: 4px; }

/* ---------- Jahresbericht ---------- */
.bericht-parch {
  background: linear-gradient(178deg, #efe1ba, #ddca96);
  border: 2px solid #5a4226; border-radius: 6px;
  box-shadow: inset 0 0 30px rgba(90, 66, 38, 0.25);
  color: #2a1a08; padding: 14px 18px; margin-bottom: 12px;
}

/* ---------- Brautwerbung & Geschenke ---------- */
.geschenk-box {
  background: linear-gradient(178deg, #efe1ba, #ddca96);
  border: 2px solid #5a4226; border-radius: 6px;
  box-shadow: inset 0 0 28px rgba(90, 66, 38, 0.25);
  color: #2a1a08; padding: 12px 16px; margin: 12px 0;
}
.gs-status { text-align: center; font-size: 0.95em; margin: 4px 0 10px; display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; }
.geschenk-box .bar { border-color: #5a4226; background: #c9b68c; }
.geschenk-box .bar-fill { background: linear-gradient(90deg, #a33d2d, #e0608a); }
.gs-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.geschenk-box .donate-card { background: rgba(245, 236, 210, 0.7); border-color: #8a6a3a; color: #2a1a08; }
.geschenk-box .donate-card:hover:not(:disabled) { border-color: #a33d2d; }
.geschenk-box .donate-card:disabled { opacity: 0.45; cursor: not-allowed; }
.geschenk-box .don-gain { color: #8a2f5a; }
.geschenk-box .gs-none .don-ap { color: #8a1f10; }
