:root {
  --wood: #3b2614;
  --wood-2: #5a3a21;
  --wood-3: #7a5230;
  --parch: #f5ead3;
  --parch-2: #eadcb9;
  --parch-3: #dcc99c;
  --ink: #2b1d12;
  --ink-2: #5c4631;
  --gold: #d4a017;
  --gold-2: #f1c94c;
  --green: #5f7f2e;
  --meadow: #9ccc65;
  --meadow-2: #8bbf52;
  --forest: #4b7a35;
  --rock: #9a9183;
  --water: #6fb3e0;
  --red: #a63a2a;
  --ok: #3f7d3a;
  --shadow: 0 2px 6px rgba(43, 29, 18, .25);
  --radius: 10px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; color: var(--ink); font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--parch) radial-gradient(ellipse at top, #fbf3df, var(--parch) 60%, var(--parch-2));
  min-height: 100vh; display: flex; flex-direction: column;
}
h1, h2, h3, h4 { font-family: Georgia, "Times New Roman", serif; letter-spacing: .01em; margin: .2em 0 .4em; color: var(--wood); }
h1 { font-size: 1.8rem; } h2 { font-size: 1.35rem; } h3 { font-size: 1.1rem; }
a { color: var(--wood-2); }
p { margin: .4em 0 .8em; }
small, .muted { color: var(--ink-2); }
.muted { font-size: .9em; }
svg.esel { width: 1.3em; height: 1.3em; vertical-align: -.3em; fill: currentColor; }
/* Eigene Bildsymbole (templates/_symbole.svg) statt Emoji: auf jedem Gerät gleich */
svg.sym { width: 1.25em; height: 1.25em; vertical-align: -.27em; flex: none; overflow: visible; }
.sperre-schloss svg.sym { width: 15px; height: 15px; vertical-align: -3px; }

/* Kopf */
header.top {
  background: linear-gradient(180deg, var(--wood-2), var(--wood)); color: var(--parch);
  padding: 8px 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 24px; box-shadow: var(--shadow);
}
.brand a { color: var(--gold-2); text-decoration: none; font-family: Georgia, serif; font-size: 1.35rem; font-weight: bold; white-space: nowrap; }
.brand svg.esel { width: 1.6em; height: 1.6em; vertical-align: -.4em; }
.resbar { display: flex; flex-wrap: wrap; gap: 6px 14px; flex: 1; }
.res { display: flex; align-items: baseline; gap: 4px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.res .ico { font-size: 1.1em; }
.res .amt { font-weight: bold; }
.res .rate { font-size: .78em; opacity: .85; }
.res .rate.plus { color: #b9e38a; } .res .rate.minus { color: #f2a08d; }
.res.short .amt { color: #ff9f8a; } .res.full .amt { color: #ffe08a; }

@media (max-width: 700px) {
  header.top { padding: 6px 10px; gap: 4px; }
  .brand { width: 100%; text-align: center; }
  .brand a { font-size: 1.2rem; }
  .resbar { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px 8px; font-size: .88em; }
  .res { gap: 3px; }
  .res .rate { font-size: .7em; }
}
nav.mainnav {
  display: flex; align-items: center; gap: 2px; flex-wrap: nowrap; overflow-x: auto; padding: 4px 10px;
  background: var(--parch-3); border-bottom: 2px solid var(--wood-3); scrollbar-width: thin; font-size: .95em;
}
nav.mainnav a { padding: 6px 8px; border-radius: 8px; text-decoration: none; color: var(--wood); white-space: nowrap; font-weight: 600; }
nav.mainnav svg.esel { width: 1.15em; height: 1.15em; }
nav.mainnav a.active, nav.mainnav a:hover { background: var(--wood); color: var(--gold-2); }
nav.mainnav .spacer { flex: 1; }
nav.mainnav .who { white-space: nowrap; padding: 0 8px; font-weight: 600; flex: none; overflow: visible; max-width: none; }
nav.mainnav .inline, nav.mainnav .glocke { flex: none; }   /* nichts in der Leiste darf zusammengedrückt werden – sie scrollt stattdessen */
.badge { display: inline-block; background: var(--red); color: #fff; border-radius: 10px; padding: 0 6px; font-size: .75em; vertical-align: top; }
.badge.warn { background: #c7811a; }
.linkbtn { background: none; border: 0; padding: 6px 8px; color: var(--wood-2); text-decoration: underline; cursor: pointer; font: inherit; }
form.inline { display: inline; }

main { flex: 1; width: 100%; max-width: 1200px; margin: 0 auto; padding: 14px 16px 30px; }
footer { padding: 14px 16px; color: var(--ink-2); font-size: .85em; text-align: center; }

.flash { padding: 10px 14px; border-radius: var(--radius); margin: 0 0 12px; border: 1px solid; }
.flash.ok { background: #e6f1dc; border-color: #9cc48a; }
.flash.err { background: #f7e0da; border-color: #d9958a; }
.flash.warn { background: #fde9c8; border-color: #e4b56b; }
.flash.short { background: #f9e5d0; border-color: #e6b58c; }

/* Karten & Raster */
.card { background: #fffaf0; border: 1px solid var(--parch-3); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); margin-bottom: 14px; }
.card h2:first-child, .card h3:first-child { margin-top: 0; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.cols3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 860px) { .cols, .cols3 { grid-template-columns: 1fr; } }

/* Hof-Karte */
.hof { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(280px, 1fr); gap: 16px; align-items: start; }
@media (max-width: 860px) { .hof { grid-template-columns: 1fr; } }
.hofkarte-rahmen {
  position: relative; background: var(--wood-2); padding: 4px; border-radius: 14px;
  border: 2px solid var(--wood); box-shadow: inset 0 0 10px rgba(0,0,0,.45), var(--shadow);
}
.hofkarte .karten-text text { font-family: Georgia, "Times New Roman", serif; pointer-events: none; }
.hofkarte-rahmen.vorschau { padding: 3px; }
.hofkarte { display: block; width: 100%; height: auto; }
.hofkarte .hex .base { stroke: rgba(43,29,18,.45); stroke-width: 1; }
.hofkarte a.hex { cursor: pointer; transition: transform .08s; }
.hofkarte a.hex:hover { transform: scale(1.07); }
.hofkarte a.hex:hover .base { stroke: var(--gold-2); stroke-width: 3; }
.hofkarte .hex.sel .base { stroke: var(--gold); stroke-width: 4; }
.hofkarte .icon { pointer-events: none; }
.hofkarte .mark { pointer-events: none; }
.hofkarte .schild circle { fill: rgba(245,234,211,.92); stroke: var(--wood); stroke-width: 1.2; }
.hofkarte .schild-icon { pointer-events: none; }
.hofkarte .lvl rect { fill: var(--wood); } .hofkarte .lvl text { fill: var(--gold-2); font: bold 11px system-ui, sans-serif; }
.hofkarte .busy-bg { fill: rgba(43,29,18,.82); } .hofkarte .busy { fill: #fff; font: 10px system-ui, sans-serif; }
.hofkarte-rahmen.vorschau .hex .base { stroke-width: .8; }
/* Karte aus einem Kundschaftsbericht: nicht eingesehene Felder bleiben leeres Pergament */
.hofkarte .hex.nebel .base { stroke: rgba(43,29,18,.3); stroke-dasharray: 5 4; }
.hofkarte .nebel-zeichen { font: italic 22px Georgia, "Times New Roman", serif; fill: #8d7a5a; opacity: .65; pointer-events: none; }
.report .kundschaft-karte { max-width: 480px; margin: 14px 0 6px; }
.report .kundschaft-karte h4 { margin: 0 0 8px; }
.report .karten-hinweis { font-size: .9em; margin: 8px 0 0; }
.legend { display: flex; flex-wrap: wrap; gap: 10px; font-size: .85em; margin-top: 8px; }
.legend span::before { content: ""; display: inline-block; width: 13px; height: 14px; margin-right: 4px; vertical-align: -2px; clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); }
.legend .W::before { background: #8fc257; } .legend .F::before { background: #3f7a30; } .legend .S::before { background: #9a9183; } .legend .B::before { background: #5fa8dc; }

.panel .bigicon { font-size: 2.4rem; float: right; margin: -4px 0 0 10px; }
.cost { display: inline-flex; flex-wrap: wrap; gap: 4px 10px; font-variant-numeric: tabular-nums; }
.cost .lack { color: var(--red); font-weight: bold; }
.buildlist { list-style: none; padding: 0; margin: 0; }
.buildlist li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--parch-2); }
.buildlist li:first-child { border-top: 0; }
.buildlist .ic { font-size: 1.6rem; width: 2rem; text-align: center; }
.buildlist .nm { flex: 1; min-width: 0; }
.buildlist .nm b { display: block; }
.buildlist .nm small { display: block; }
.buildlist li.locked { opacity: .6; }

/* Buttons & Formulare */
button, .btn {
  background: linear-gradient(180deg, var(--gold-2), var(--gold)); color: var(--ink); border: 1px solid #a67c0e; border-radius: 8px;
  padding: 7px 14px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; display: inline-block; box-shadow: 0 1px 2px rgba(0,0,0,.2);
}
button:hover, .btn:hover { filter: brightness(1.06); }
button:disabled { opacity: .5; cursor: not-allowed; filter: grayscale(.4); }
button.sec, .btn.sec { background: linear-gradient(180deg, #f1e6cb, #dccaa0); border-color: #b9a376; }
button.danger { background: linear-gradient(180deg, #d9735f, var(--red)); color: #fff; border-color: #7a2a1e; }
button.small, .btn.small { padding: 4px 9px; font-size: .85em; }
input[type=text], input[type=password], input[type=number], select, textarea {
  font: inherit; padding: 7px 9px; border: 1px solid #b9a376; border-radius: 8px; background: #fffdf7; color: var(--ink); max-width: 100%;
}
input[type=number] { width: 7em; }
label { display: block; margin: 8px 0 3px; font-weight: 600; font-size: .92em; }
.formrow { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: end; }
.formrow > div { display: flex; flex-direction: column; }
.formrow label { margin: 0 0 3px; }
textarea { width: 100%; min-height: 90px; }

/* Tabellen */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--parch-2); vertical-align: top; }
th { font-size: .85em; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-2); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.me { background: #fdf4d6; }
.tablewrap { overflow-x: auto; }

/* Esel */
/* ---- Die Herde: Stallbuch, Zuchtstation, Futtertröge, Koppel ---- */
.stallbuch { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
@media (max-width: 860px) { .stallbuch { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.kennzahl { background: var(--wood-2); color: #fff; border-radius: var(--radius); padding: 10px 12px; display: grid; grid-template-columns: auto 1fr; gap: 2px 8px; align-items: center; box-shadow: var(--shadow); }
.kennzahl .ic { font-size: 1.5em; grid-row: 1 / span 2; }
.kennzahl { min-width: 0; }
.kennzahl .lbl { font-size: .74em; text-transform: uppercase; letter-spacing: .05em; color: var(--gold-2); overflow-wrap: anywhere; line-height: 1.15; }
.kennzahl b { font-size: 1.15em; }
.kennzahl .bar, .kennzahl .dots, .kennzahl small { grid-column: 2; }
.kennzahl .bar { height: 7px; background: rgba(0,0,0,.35); border: 0; margin-top: 4px; }
.kennzahl .dots i { border-color: rgba(0,0,0,.4); background: rgba(255,255,255,.2); } .kennzahl .dots i.on { background: var(--gold); }
.kennzahl small.muted { color: var(--parch-3); }
.stall-oben { display: grid; grid-template-columns: minmax(260px, 1fr) minmax(0, 1.5fr); gap: 14px; margin-bottom: 14px; }
@media (max-width: 860px) { .stall-oben { grid-template-columns: 1fr; } }
.zuchtbox { background: #fffaf0 radial-gradient(ellipse at 90% 10%, #ffe9f0, transparent 45%); }
.trogliste { display: grid; gap: 6px; }
.trog { display: grid; grid-template-columns: 2.2em 1fr 120px; gap: 10px; align-items: center; padding: 6px 10px; border-radius: 8px; background: #fffaf0; border-left: 6px solid var(--tierfarbe); }
.trog.leer { opacity: .5; }
.trog svg.esel { width: 2em; height: 2em; color: var(--tierfarbe); }
.trog-text { min-width: 0; line-height: 1.25; } .trog-text small { display: block; }
.trog-stand .bar { height: 8px; } .trog-stand small { display: block; font-size: .8em; margin-top: 2px; } .trog-stand small.warn { color: var(--red); font-weight: 600; }
@media (max-width: 600px) { .trog { grid-template-columns: 2.2em 1fr; } .trog-stand { grid-column: 2; } }
.freilassen { margin-top: 10px; } .freilassen summary { cursor: pointer; }
.bar.fein { display: block; height: 5px; margin-top: 4px; width: min(100%, 260px); }
.box { margin-bottom: 16px; border-radius: 14px; border: 2px solid var(--parch-3); overflow: hidden; background: #f3ecd8; box-shadow: var(--shadow); }
.box .boxkopf { display: flex; align-items: center; gap: 10px; padding: 8px 14px; background: var(--wood-2); color: #fff; flex-wrap: wrap;
  border-bottom: 6px solid var(--tierfarbe); }
.box .boxkopf svg.esel { width: 1.8em; height: 1.8em; color: var(--tierfarbe); }
.box .boxkopf h3 { margin: 0; color: var(--gold-2); } .box .boxkopf h3 small { color: #fff; font-weight: normal; }
.box .boxinfo { margin-left: auto; font-size: .85em; color: var(--parch-2); }
.box.t4 { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(212,160,23,.25), var(--shadow); }
.box.t4 .koppel { background-image: radial-gradient(circle at 20% 0, rgba(255,230,140,.6), transparent 60%); }
.koppel { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; padding: 12px;
  background: #f3ecd8 repeating-linear-gradient(45deg, transparent 0 14px, rgba(122,82,48,.05) 14px 15px); }
.esel-karte { display: flex; gap: 10px; align-items: flex-start; background: #fffaf0; border: 1px solid var(--parch-3); border-radius: 10px; padding: 10px; }
.esel-karte.lernt { background: #fff7e0; border-style: dashed; }
.esel-karte svg.esel.gross { width: 3em; height: 3em; flex: none; color: var(--tierfarbe); filter: drop-shadow(0 1px 1px rgba(0,0,0,.25)); }
.esel-text { min-width: 0; flex: 1; }
.namensschild { display: inline-block; background: var(--wood-2); color: var(--gold-2); font: 700 .95em Georgia, "Times New Roman", serif; padding: 2px 10px; border-radius: 4px;
  border: 1px solid var(--wood); box-shadow: inset 0 1px 0 rgba(255,255,255,.15); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.esel-karte .klein { font-size: .85em; margin-top: 5px; } .esel-karte .gold { color: #9a7108; font-weight: 700; }
.esel-karte .status { font-size: .85em; margin-top: 3px; color: var(--ink-2); }
.esel-karte .status.warn { color: var(--red); font-weight: 600; }
/* Aufstieg als eigene, beschriftete Zeile: Hinweise dort betreffen den Aufstieg, nicht den Esel */
.esel-karte .aufstieg { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 8px; margin-top: 7px; font-size: .85em; }
.esel-karte .aufstieg .lbl { color: var(--ink-2); }

/* Gesperrte Knöpfe (Vorlage _sperre.html): Schloss-Plakette auf dem ausgegrauten Knopf; Zeigen, Antippen oder Fokus
   öffnet eine Info-Blase mit dem Grund. app.js hängt die offene Blase an den Seitenkörper und setzt sie über (notfalls
   unter) den Knopf, damit Bildlaufkästen und gedrehte Zettel sie nicht abschneiden. */
.sperre { position: relative; display: inline-block; cursor: help; outline: none; max-width: 100%; vertical-align: middle; }
.sperre button, .sperre .btn { pointer-events: none; }
.sperre-schloss { position: absolute; top: -10px; right: -10px; width: 22px; height: 22px; line-height: 20px; text-align: center; font-size: 13px; z-index: 1;
  border-radius: 50%; background: #fffaf0; border: 1px solid var(--wood); box-shadow: 0 1px 2px rgba(0,0,0,.3); pointer-events: none; }
.sperre:hover .sperre-schloss, .sperre:focus .sperre-schloss, .sperre.offen .sperre-schloss { background: var(--gold-2); }
.sperre-blase { display: none; position: absolute; width: 230px; z-index: 80; text-align: left; color: var(--ink); line-height: 1.35;
  background: #fffaf0; border: 1px solid var(--wood); border-radius: 8px; padding: 7px 10px; box-shadow: var(--shadow); font-size: .9rem; font-weight: normal; }
.sperre-blase.offen { display: block; }
.sperre-blase::before { content: ""; position: absolute; left: var(--pfeil, 50%); bottom: -6px; width: 10px; height: 10px; margin-left: -5px; background: #fffaf0;
  border-right: 1px solid var(--wood); border-bottom: 1px solid var(--wood); transform: rotate(45deg); }
.sperre-blase.unten::before { bottom: auto; top: -6px; border: 0; border-left: 1px solid var(--wood); border-top: 1px solid var(--wood); }
.sperre-blase > b { display: block; font-weight: 600; }
.sperre-blase small { display: block; color: var(--ink-2); margin-top: 3px; font-size: .92em; }
.sperre-blase small b { font-weight: 600; color: var(--ink); }
.esel-karte .mehr { margin-top: 5px; } .esel-karte .mehr summary { cursor: pointer; font-size: .8em; color: var(--ink-2); }
.esel-karte .mehr form { margin-top: 5px; }
@media (max-width: 600px) { .koppel { grid-template-columns: 1fr; } .box .boxinfo { margin-left: 0; } }

/* Welt */
.world { display: grid; grid-template-columns: minmax(300px, 1fr) minmax(0, 1.3fr); gap: 16px; align-items: start; }
.world th { white-space: nowrap; } .world td:first-child { min-width: 150px; }
.world .tablewrap.scrollbar { max-height: clamp(320px, calc(100vh - 250px), 760px); overflow: auto; }
.world .tablewrap.scrollbar thead th { position: sticky; top: 0; z-index: 1; background: var(--parch); box-shadow: 0 1px 0 var(--parch-3); }
table.sortierbar thead th[data-sort] { cursor: pointer; user-select: none; }
table.sortierbar thead th[data-sort]:hover { color: var(--ink); background: var(--parch-2); }
table.sortierbar thead th[data-sort]::after { content: " ↕"; opacity: .35; font-size: .85em; }
table.sortierbar thead th.sortiert.auf::after { content: " ▲"; opacity: 1; }
table.sortierbar thead th.sortiert.ab::after { content: " ▼"; opacity: 1; }
@media (max-width: 860px) { .world { grid-template-columns: 1fr; } }
.worldmap { width: 100%; height: auto; display: block; border: 3px solid var(--wood); border-radius: 10px; box-shadow: inset 0 0 10px rgba(0,0,0,.35);
  touch-action: none; }   /* Finger auf der Karte bewegt die Lupe, nicht die Seite */
.worldmap .farm { cursor: pointer; }
/* Farben der Höfe und Bewegungen stehen als Attribute im SVG (die Lupe kopiert nur Attribute) */
.worldmap .farm:hover .halo { fill-opacity: .5; }                   /* Schimmer = Klickziel, Hof selbst genau eine Wabe */
.worldmap .farm:hover .feld { stroke: var(--gold-2); stroke-width: .22; }
.worldmap text { pointer-events: none; }
.worldmap .lupe, .worldmap .lupe-ring { pointer-events: none; }
.worldmap .lupe-ring { fill: none; stroke: var(--wood); stroke-width: .7; filter: drop-shadow(0 0 1px rgba(0,0,0,.5)); }
.worldmap .farm.hervor .halo { fill-opacity: .6; }
.worldmap .farm.hervor .feld { stroke: var(--gold-2); stroke-width: .3; }
.worldmap .puls { fill: none; stroke: var(--gold); stroke-width: .6; pointer-events: none; transform-box: fill-box; transform-origin: center; animation: puls 1.1s ease-out infinite; }
@keyframes puls { 0% { transform: scale(.6); opacity: 1; } 100% { transform: scale(1.8); opacity: 0; } }
.world tr.hervor td { background: #fdf0c8; }
.world tr[data-farm] { transition: background .1s; }
.legend .me::before { background: #d4a017; } .legend .bot::before { background: #9a7a52; } .legend .safe::before { background: #8fb3d9; }

/* Start */
.hero { text-align: center; padding: 30px 10px 10px; }
.hero h1 { font-size: 2.6rem; margin-bottom: .1em; }
.hero .ruf { font-family: Georgia, "Times New Roman", serif; font-style: italic; font-weight: bold; font-size: 1.35rem; color: var(--gold); letter-spacing: .04em; margin-top: 4px; }
.hero .sub { font-size: 1.15rem; color: var(--ink-2); font-style: italic; }
.hero .cta { margin: 18px 0; display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.story { max-width: 740px; margin: 0 auto; font-size: 1.05em; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; margin: 20px 0; }
.features .card { margin: 0; }
.features .card .ic { font-size: 2rem; }
.report { max-width: 820px; }
.report .vs { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 600px) { .report .vs { grid-template-columns: 1fr; } }
.win { color: var(--ok); font-weight: 700; } .lose { color: var(--red); font-weight: 700; }
ul.plain { list-style: none; padding: 0; margin: 0; }
ul.plain li { padding: 6px 0; border-bottom: 1px solid var(--parch-2); }
.unread { font-weight: 700; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 2px 12px; }
.progress { height: 8px; background: var(--parch-2); border-radius: 4px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--gold); }


/* ---- Einblendungen statt Layoutverschiebung ---- */
#flashes { position: fixed; top: 10px; left: 50%; transform: translateX(-50%); z-index: 50; width: min(92vw, 520px); pointer-events: none; }
#flashes .flash { pointer-events: auto; box-shadow: var(--shadow); }
#toasts { position: fixed; top: 10px; left: 50%; transform: translateX(-50%); z-index: 60; width: min(92vw, 520px); display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { pointer-events: auto; padding: 10px 14px; border-radius: 10px; border: 1px solid; box-shadow: var(--shadow); opacity: 0; transform: translateY(-10px); transition: opacity .25s, transform .25s; cursor: pointer; }
.toast { display: flex; align-items: flex-start; gap: 8px; } .toast-text { flex: 1; min-width: 0; }
.toast-zu { flex: none; margin: -6px -8px -6px 0; padding: 2px 8px; background: none; border: 0; box-shadow: none; font-size: 24px; line-height: 1; color: var(--ink-2); cursor: pointer; }
.toast-zu:hover { color: var(--ink); background: none; transform: none; }
.toast.in { opacity: 1; transform: none; } .toast.out { opacity: 0; transform: translateY(-6px); }
.toast.ok { background: #e6f1dc; border-color: #9cc48a; } .toast.err { background: #f7e0da; border-color: #d9958a; } .toast.warn { background: #fde9c8; border-color: #e4b56b; }
#notices { position: fixed; right: 12px; bottom: 12px; z-index: 40; display: flex; flex-direction: column; gap: 6px; max-width: min(92vw, 360px); pointer-events: none; }
.notice { pointer-events: auto; font-size: .9em; padding: 8px 12px; border-radius: 10px; border: 1px solid; box-shadow: var(--shadow); }
.notice.warn { background: #fde9c8; border-color: #e4b56b; } .notice.short { background: #f9e5d0; border-color: #e6b58c; }
@media (max-width: 700px) { #notices { left: 12px; right: 12px; max-width: none; } }
.flash.inline-note { position: static; margin: 0 0 8px; }
#main { transition: opacity .15s; } #main.swap { opacity: .35; }
body.busy { cursor: progress; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .18s; }

/* ---- Balken ---- */
.bars .barrow { display: grid; grid-template-columns: 8.5em 1fr 5.5em; align-items: center; gap: 8px; margin: 4px 0; }
.bars .barrow.small { font-size: .85em; margin: 2px 0; }
.bars .val { text-align: right; font-variant-numeric: tabular-nums; }
.bar { display: block; height: 10px; background: var(--parch-2); border-radius: 5px; overflow: hidden; border: 1px solid var(--parch-3); }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold-2), var(--gold)); transition: width .4s; }
.bar.full i { background: linear-gradient(90deg, #d9735f, var(--red)); } .bar.short i { background: #e67e22; }
.barsub { margin-top: 8px; font-weight: 600; font-size: .9em; }
.dots i { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: var(--parch-3); margin-right: 4px; border: 1px solid var(--wood-3); }
.dots i.on { background: var(--gold); }

/* ---- Hof-Karte: Uferfelder, Denkmal ---- */
.outp { display: inline-block; margin-right: 10px; }
.amt.bump { animation: bump .6s ease-out; }
@keyframes bump { 0% { color: #ffe08a; transform: scale(1.2); } 100% { transform: none; } }

/* ---- Weltkarte: Bewegungen ---- */
.legend .mv { font-weight: 600; } .legend .mv.own { color: #3b2614; } .legend .mv.foe { color: #a63a2a; } .legend .mv.trade { color: #2f6f9f; }
.legend .mv::before { display: none; }

/* ---- Sonstiges ---- */
.btn.danger { background: linear-gradient(180deg, #d9735f, var(--red)); color: #fff; border-color: #7a2a1e; }
.who.viewing { background: #fde9c8; border-radius: 8px; padding: 2px 8px; }
nav.mainnav a.adminlink { color: #7a2a1e; }
.pricelist td, .pricelist th { padding: 3px 8px; font-size: .9em; }

.trainlist li { display: flex; align-items: center; gap: 10px; }
.trainlist .ic { width: 2rem; text-align: center; font-size: 1.4rem; }
.trainlist .ic svg.esel { width: 1.7em; height: 1.7em; }
.trainlist .nm { flex: 1; min-width: 0; }
.trainlist li.wartet .ic { opacity: .55; }
.trainlist .rechts { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.trainlist small b[data-until] { white-space: nowrap; }
.trainlist .dauer { display: block; }
.card.training { border-left: 5px solid var(--gold); }

.emojiwahl { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 8px; }
.emojibox { margin: 0; font-weight: normal; cursor: pointer; }
.emojibox input { position: absolute; opacity: 0; width: 0; height: 0; }
.emojibox span { display: inline-block; font-size: 1.3rem; line-height: 1; padding: 5px 7px; border: 1px solid var(--parch-3);
  border-radius: 8px; background: #fffdf7; transition: transform .08s; }
.emojibox input:checked + span { background: var(--gold-2); border-color: #a67c0e; transform: scale(1.08); }
.emojibox input:focus-visible + span { outline: 2px solid var(--wood); }

/* ---- Nichts darf seitlich aus dem Fenster laufen ---- */
html, body { max-width: 100%; overflow-x: hidden; }
main, .card, .cols, .cols3, .hof, .world, .panel, .formrow, .formrow > div { min-width: 0; }
.card { overflow-wrap: anywhere; }
.res .rate.fehlt { font-weight: 700; }
.who { max-width: 40vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 700px) {
  .resbar { grid-template-columns: repeat(3, 1fr); font-size: .8em; gap: 2px 6px; }
  .res .rate { font-size: .66em; }
  .res .amt { font-size: .95em; }
  .who { max-width: 55vw; }
  .bars .barrow { grid-template-columns: 7em 1fr 4.5em; font-size: .9em; }
  .formrow { gap: 6px 8px; }
  .formrow input[type=number] { width: 5.5em; }
  select, input[type=text], input[type=password] { max-width: 100%; }
  .emojibox span { font-size: 1.15rem; padding: 4px 6px; }
  .kv { grid-template-columns: max-content 1fr; gap: 2px 8px; font-size: .95em; }
  h1 { font-size: 1.45rem; }
}
@media (max-width: 420px) {
  .resbar { grid-template-columns: repeat(2, 1fr); }
  .legend { font-size: .78em; }
}

/* Hof gründen: Formular und Kartenvorschau nebeneinander */
.card.gruenden { max-width: 860px; margin: 20px auto; }
.gruenden-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px; align-items: start; }
@media (max-width: 700px) { .gruenden-cols { grid-template-columns: 1fr; } }
#kartenvorschau.laedt .hofkarte { opacity: .4; }
.gruenden-knoepfe { grid-column: 1 / -1; margin: 4px 0 0; }
.altknecht { padding-left: 20px; }
.altknecht li { margin: 6px 0; }
.altknecht li.dringend { background: #fde9c8; border-left: 4px solid #e4b56b; padding: 6px 8px; border-radius: 6px; list-style: none; margin-left: -20px; }

/* ---- Modal (Steckbrief eines Hofs) ---- */
.modal { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal[hidden] { display: none; }
.modal-hintergrund { position: absolute; inset: 0; background: rgba(43,29,18,.55); }
.modal-box { position: relative; width: min(560px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--parch);
  border: 3px solid var(--wood); border-radius: 14px; box-shadow: 0 12px 40px rgba(0,0,0,.45); padding: 18px 22px; animation: modal-in .15s ease-out; }
.modal-box.breit { width: min(920px, 100%); padding: 14px 18px 16px; }
/* Bericht im Fenster: keine Karte in der Karte – das Fenster selbst ist das Chronikblatt */
.modal-box.chronik { background: #fbf4e3; border-left: 10px solid var(--wood-2); border-radius: 6px 14px 14px 6px; padding: 16px 22px 18px; }
.modal-box.chronik .modal-seite .card { border: 0; background: none; box-shadow: none; padding: 0; margin: 0; }
.modal-box.chronik .blattkopf { margin-right: 28px; }
/* Depesche im Fenster: das Fenster ist der Brief */
.modal-box.brief-fenster { background: transparent; border: 0; box-shadow: none; padding: 0; width: min(560px, 100%); overflow: visible; }
.modal-box.brief-fenster .modal-seite, .modal-box.brief-fenster .brief { margin: 0; }
.modal-box.brief-fenster .brief { border-width: 2px; border-color: var(--wood); box-shadow: 0 12px 40px rgba(0,0,0,.45); padding: 16px 18px 12px; }
.modal-box.brief-fenster .brief .stempel { right: 48px; }
.modal-box.brief-fenster .brief .absender, .modal-box.brief-fenster .brief .brieftext { margin-right: 112px; }
.modal-box.brief-fenster .modal-close { top: 4px; right: 8px; }
.modal-seite h1 { margin: 0 32px 10px 0; font-size: 1.5rem; }
.modal-close { position: absolute; z-index: 2; top: 6px; right: 8px; background: none; border: 0; box-shadow: none; font-size: 28px; line-height: 1; color: var(--ink-2); cursor: pointer; padding: 4px 8px; }
.modal-close:hover { color: var(--ink); background: none; transform: none; }
.modal .steckbrief h2 { margin: 0 28px 10px 0; font-size: 1.35rem; }
.modal .steckbrief h2 small { display: block; font-size: .72em; font-weight: normal; margin-top: 2px; }
.steckbrief-aktionen { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 6px; }
.steckbrief-aktionen form { margin: 0; display: contents; }
body.modal-offen { overflow: hidden; }
@keyframes modal-in { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---- Berichte: Chronik des Hofs (Buchseite mit Siegeln) ---- */
.chronik { background: #fbf4e3; border: 1px solid var(--parch-3); border-left: 10px solid var(--wood-2); border-radius: 6px 12px 12px 6px;
  box-shadow: var(--shadow), inset 0 0 40px rgba(122,82,48,.08); padding: 14px 18px 12px; }
.chronik-filter { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.chip { font: 600 .85em system-ui, sans-serif; background: var(--parch); border: 1px solid var(--parch-3); color: var(--ink-2); border-radius: 999px; padding: 4px 11px; box-shadow: none; }
.chip small { opacity: .7; margin-left: 2px; } .chip:hover { background: var(--parch-2); transform: none; } .chip.an { background: var(--wood-2); color: #fff; border-color: var(--wood); }
.chronik-liste { list-style: none; margin: 0; padding: 0; }
.chronik-tag { margin: 12px 0 4px; font: italic 600 .9em Georgia, "Times New Roman", serif; color: var(--wood-3); display: flex; align-items: center; gap: 10px; }
.chronik-tag::before, .chronik-tag::after { content: ""; flex: 1; border-top: 1px dashed var(--parch-3); }
.chronik-eintrag a { display: grid; grid-template-columns: 34px 48px 1fr auto; align-items: center; gap: 8px; padding: 7px 8px 7px 4px; text-decoration: none; color: var(--ink);
  border-left: 3px solid transparent; border-radius: 6px; }
.chronik-eintrag a:hover { background: rgba(122,82,48,.08); }
.chronik-eintrag .siegel { display: inline-flex; width: 30px; height: 30px; border-radius: 50%; align-items: center; justify-content: center; font-size: 15px; background: var(--parch-2); border: 1px solid var(--parch-3); }
.chronik-eintrag .zeit { font: .85em/1 "Courier New", monospace; color: var(--ink-2); }
.chronik-eintrag .titel { font-family: Georgia, "Times New Roman", serif; }
.chronik-eintrag.neu .titel { font-weight: 700; }
.chronik-eintrag .neu-marke { font: 700 .7em system-ui; letter-spacing: .08em; text-transform: uppercase; color: #fff; background: var(--red); border-radius: 999px; padding: 2px 7px; }
.art-kampf .siegel { background: #f7dcd6; border-color: #d9958a; } .chronik-eintrag.art-kampf a { border-left-color: #c0392b; }
.art-warnung .siegel { background: #fde9c8; border-color: #e4b56b; } .chronik-eintrag.art-warnung a { border-left-color: #e67e22; }
.art-kundschaft .siegel { background: #e6e0f2; border-color: #b9a9d9; } .chronik-eintrag.art-kundschaft a { border-left-color: #6c5a9a; }
.art-handel .siegel { background: #dceaf5; border-color: #9cc0dd; } .chronik-eintrag.art-handel a { border-left-color: #2f6f9f; }
.art-info .siegel { background: var(--parch-2); } .chronik-eintrag.art-info a { border-left-color: var(--wood-3); }
.chronik-eintrag.versteckt { display: none; }
.chronik-fuss { margin-top: 12px; align-items: center; } .chronik-leer { padding: 10px 0; }
.chronik-blatt { border-left: 10px solid var(--wood-2); background: #fbf4e3; }
.blattkopf { display: flex; gap: 12px; align-items: center; margin-bottom: 8px; } .blattkopf h2 { margin: 2px 0 0; }
.siegel.gross { display: inline-flex; width: 46px; height: 46px; border-radius: 50%; align-items: center; justify-content: center; font-size: 22px; flex: none; background: var(--parch-2); border: 1px solid var(--parch-3); }
.blattfuss { margin-top: 14px; }
@media (max-width: 600px) { .chronik { padding: 10px 10px 10px 8px; } .chronik-eintrag a { grid-template-columns: 30px 44px 1fr; } .chronik-eintrag .neu-marke { grid-column: 3; justify-self: start; } }

/* ---- Eselpost: Briefbogen und Briefe ---- */
.post { display: grid; grid-template-columns: minmax(280px, 1fr) minmax(0, 1.4fr); gap: 18px; align-items: start; }
.post-ausgang { grid-column: 1; }
.post-eingang { grid-column: 2; grid-row: 1 / span 2; }
@media (max-width: 860px) { .post { grid-template-columns: 1fr; } .post-ausgang, .post-eingang { grid-column: 1; grid-row: auto; } }
.briefbogen { background: #fffdf6 repeating-linear-gradient(transparent 0 27px, rgba(122,82,48,.12) 27px 28px); background-position: 0 34px; border: 1px solid var(--parch-3);
  border-radius: 3px; padding: 14px 16px 12px; box-shadow: var(--shadow); }
.briefkopf { font: 700 1.1em Georgia, "Times New Roman", serif; margin-bottom: 8px; } .briefkopf .feder { margin-right: 4px; }
.briefbogen label { font-size: .9em; }
.briefbogen select, .briefbogen input[type=text] { width: 100%; max-width: 100%; box-sizing: border-box; }
.post > * { min-width: 0; }
.brief { position: relative; background: #fffdf6; border: 1px solid var(--parch-3); border-radius: 3px; padding: 12px 14px 10px; margin: 0 0 14px;
  box-shadow: 2px 3px 8px rgba(43,29,18,.18); transform: rotate(var(--neigung, 0deg)); }
.brief.ungeoeffnet { border-color: #d9958a; box-shadow: 2px 3px 8px rgba(43,29,18,.18), 0 0 0 3px #f7dcd6; }
.brief .stempel { position: absolute; top: 8px; right: 10px; width: 64px; height: 64px; border: 2px double var(--wood-3); border-radius: 50%; transform: rotate(-12deg);
  display: flex; flex-direction: column; align-items: center; justify-content: center; font: .62em/1.15 "Courier New", monospace; color: var(--wood-3); text-align: center; opacity: .8; pointer-events: none; }
.brief .stempel span { font-size: .85em; max-width: 54px; } .brief .stempel b { font-size: 1.1em; }
.brief .absender { font: italic .95em Georgia, "Times New Roman", serif; margin-right: 76px; }
.brief .brieftext { font: 1.12em/1.5 Georgia, "Times New Roman", serif; font-style: italic; margin: 8px 76px 6px 0; white-space: pre-wrap; }
.brief .brieffuss { display: flex; align-items: center; justify-content: space-between; margin-top: 4px; }
.brief .wachs { font-size: 1.15em; }
.post-leer { padding: 8px 0; }
.umschlaege { display: grid; gap: 8px; }
.brief-umschlag { position: relative; display: grid; grid-template-columns: 2em minmax(0, 1fr) auto; gap: 10px; align-items: center; text-decoration: none; color: var(--ink);
  background: #fffdf6; border: 1px solid var(--parch-3); border-radius: 4px; padding: 10px 12px; box-shadow: 1px 2px 5px rgba(43,29,18,.14);
  background-image: linear-gradient(135deg, transparent 49.5%, rgba(122,82,48,.18) 49.5% 50.5%, transparent 50.5%), linear-gradient(225deg, transparent 49.5%, rgba(122,82,48,.18) 49.5% 50.5%, transparent 50.5%);
  background-size: 100% 40%, 100% 40%; background-repeat: no-repeat; background-position: top, top; }
.brief-umschlag:hover { border-color: var(--gold); box-shadow: 2px 3px 8px rgba(43,29,18,.22); transform: translateY(-1px); }
.brief-umschlag.versiegelt { border-color: #d9958a; background-color: #fff6ef; }
.brief-umschlag .umschlag-ic { font-size: 1.5em; }
.brief-umschlag .umschlag-info { min-width: 0; font-family: Georgia, "Times New Roman", serif; }
.brief-umschlag .vorschau { display: block; font-style: italic; color: var(--ink-2); font-size: .92em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brief-umschlag.versiegelt .vorschau { color: var(--ink); font-weight: 600; }
.brief-umschlag .umschlag-zeit { display: flex; flex-direction: column; align-items: flex-end; font: .72em/1.2 "Courier New", monospace; color: var(--wood-3); text-align: right; }
.brief-umschlag .wachs { position: absolute; right: -6px; top: -8px; font-size: 1.1em; filter: drop-shadow(0 1px 1px rgba(0,0,0,.3)); }
.brief.offen { transform: none; }
@media (max-width: 600px) { .brief-umschlag { grid-template-columns: 2em minmax(0, 1fr); } .brief-umschlag .umschlag-zeit { grid-column: 2; flex-direction: row; gap: 6px; align-items: baseline; } }
.umschlag { display: flex; gap: 8px; align-items: flex-start; background: var(--parch); border: 1px solid var(--parch-3); border-radius: 6px; padding: 8px 10px; margin-bottom: 8px; }
.umschlag-ic { font-size: 1.3em; } .umschlag-text { font-style: italic; font-family: Georgia, "Times New Roman", serif; white-space: pre-wrap; }

/* ---- Akademie: Gelehrtenstube ---- */
.pult { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; background: var(--wood-2); color: #fff; border-radius: var(--radius);
  padding: 12px 16px; margin-bottom: 16px; box-shadow: var(--shadow), inset 0 0 30px rgba(0,0,0,.25); border-bottom: 4px solid var(--gold); }
.pult.leer { background: var(--parch-2); color: var(--ink); border-bottom-color: var(--parch-3); box-shadow: none; }
.pult-ic { font-size: 2.2em; } .pult-text { display: grid; gap: 3px; min-width: 0; } .pult-text b { font-family: Georgia, "Times New Roman", serif; font-size: 1.15em; }
.pult .bar { height: 8px; background: rgba(0,0,0,.35); border: 0; } .pult small.muted { color: var(--parch-3); } .pult.leer small.muted { color: var(--ink-2); }
.pult-zeit { text-align: right; } .pult-zeit b { display: block; font-size: 1.2em; color: var(--gold-2); }
.regal { margin-bottom: 18px; border-radius: 12px; background: #e9d9ae; border: 2px solid #b08a56; box-shadow: var(--shadow); overflow: hidden; }
.regal.gesperrt { opacity: .72; }
.regalkopf { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 8px 14px; background: var(--wood-3); color: #fff; border-bottom: 5px solid var(--wood); }
.regalkopf h3 { margin: 0; color: var(--gold-2); font-family: Georgia, "Times New Roman", serif; } .regalkopf h3 small { color: var(--parch-2); font-weight: normal; margin-left: 6px; }
.regal-schloss { margin-left: auto; font-size: .85em; color: var(--parch-2); }
.schriften { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; padding: 14px; }
.schrift { position: relative; background: #fbf4e3; border: 1px solid var(--parch-3); border-radius: 4px 14px 14px 4px; padding: 10px 12px; box-shadow: 2px 2px 6px rgba(43,29,18,.18);
  border-left: 7px solid var(--parch-3); display: flex; flex-direction: column; gap: 6px; }
.schrift.offen { border-left-color: var(--gold); }
.schrift.laeuft { border-left-color: #2f6f9f; background: #f3f6fb; }
.schrift.fertig { border-left-color: #4b7a35; background: #f0f5ea; }
.schrift.zu { border-left-color: var(--parch-3); color: var(--ink-2); }
.schrift.zu .schrift-kopf .ic { filter: grayscale(1); opacity: .6; }
.schrift.gross { grid-column: 1 / -1; background: linear-gradient(135deg, #fff6d6, #fbf4e3 60%); border-left-color: var(--gold); box-shadow: 0 0 0 3px rgba(212,160,23,.25), 2px 2px 6px rgba(43,29,18,.18); }
.schrift.gross.fertig { background: #f0f5ea; }
.schrift-kopf { display: flex; align-items: center; gap: 8px; } .schrift-kopf .ic { font-size: 1.5em; } .schrift-kopf b { font-family: Georgia, "Times New Roman", serif; font-size: 1.05em; flex: 1; }
.stempel-fertig { font: 700 .7em system-ui; letter-spacing: .1em; text-transform: uppercase; color: #3f6f2a; border: 2px solid #3f6f2a; border-radius: 4px; padding: 2px 6px; transform: rotate(-6deg); opacity: .8; }
.schrift-text { margin: 0; font-size: .9em; color: var(--ink-2); flex: 1; }
.schrift-fuss { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; font-size: .9em; }
.schrift-fuss form { margin-left: auto; } .laeuft-hinweis { color: #2f6f9f; font-weight: 600; }

/* ---- Markt: Stand, Kontor, Aushangbrett ---- */
.markt-oben { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(280px, 1fr); gap: 16px; margin-bottom: 16px; }
@media (max-width: 860px) { .markt-oben { grid-template-columns: 1fr; } }
.stand { border-radius: var(--radius); background: #fffaf0; border: 1px solid var(--parch-3); box-shadow: var(--shadow); overflow: hidden; }
.markise { height: 18px; background: repeating-linear-gradient(90deg, #c0392b 0 26px, #fdf6e3 26px 52px); border-bottom: 3px solid var(--wood);
  mask-image: radial-gradient(circle at 13px 100%, transparent 11px, #000 12px); -webkit-mask-image: radial-gradient(circle at 13px 100%, transparent 11px, #000 12px); mask-size: 26px 100%; -webkit-mask-size: 26px 100%; }
.stand-inhalt { padding: 12px 16px 14px; }
.stand-fakten { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .9em; margin-bottom: 8px; color: var(--ink-2); }
.tausch { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: end; }
.tausch-seite { display: grid; gap: 4px; } .tausch-seite input, .tausch-seite select { width: 100%; box-sizing: border-box; }
.tausch-pfeil { font-size: 1.6em; padding-bottom: 6px; color: var(--wood-3); }
@media (max-width: 600px) { .tausch { grid-template-columns: 1fr; } .tausch-pfeil { text-align: center; padding: 0; } }
.kontor { border-radius: var(--radius); background: var(--wood-2); color: #fff; padding: 12px 16px 14px; box-shadow: var(--shadow), inset 0 0 30px rgba(0,0,0,.25); }
.kontor h3 { margin-top: 0; color: var(--gold-2); } .kontor-hinweis { font-size: .88em; color: var(--parch-2); } .kontor-hinweis b { color: #fff; }
.preistafel { width: 100%; font-size: .92em; } .preistafel th, .preistafel td { border-bottom-color: rgba(255,255,255,.12); color: #fff; padding: 4px 6px; } .preistafel th { color: var(--gold-2); }
.kontor-formulare { display: grid; gap: 8px; margin-top: 10px; } .kontor-form label { color: var(--gold-2); font-size: .85em; }
.kontor-form .formrow { align-items: center; }
.preistafel td .btn { padding: 2px 9px; }
.modal .kontor-ware h2, .kontor-ware h2 { margin: 0 28px 10px 0; font-size: 1.35rem; }
.kontor-ware h2 small { display: block; font-size: .72em; font-weight: normal; margin-top: 2px; }
.kontor-handel { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; margin-top: 12px; }
.kontor-seite { background: var(--parch-2); border: 1px solid var(--parch-3); border-radius: 10px; padding: 10px 12px; }
.kontor-seite h3 { margin: 0 0 4px; } .kontor-seite p { margin: 4px 0 8px; font-size: .9em; }
.kontor-seite input[type=number] { width: 7em; } .kontor-seite .formrow { align-items: center; }
.kontor-summe b { font-variant-numeric: tabular-nums; } .kontor-form input[type=number] { width: 6em; }
.karawanen { margin-bottom: 16px; }
.brett { background: var(--wood-3) repeating-linear-gradient(0deg, transparent 0 46px, rgba(0,0,0,.08) 46px 48px); border: 10px solid var(--wood-2); border-radius: 10px; padding: 12px 14px 14px;
  box-shadow: inset 0 0 30px rgba(0,0,0,.35), var(--shadow); }
.brett h3 { margin: 0 0 10px; color: var(--gold-2); } .brett h3 small { color: var(--parch-2); font-weight: normal; }
.brett-leer { color: var(--parch-2); margin: 4px 0; }
.zettel-wand { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.zettel { position: relative; background: #fffdf3; border: 1px solid #e3d5ad; padding: 16px 12px 10px; box-shadow: 2px 3px 8px rgba(0,0,0,.35); transform: rotate(var(--neigung, 0deg)); display: grid; gap: 8px; }
.zettel.eigener { background: #fff6d6; }
.zettel .pin { position: absolute; top: -7px; left: 50%; width: 14px; height: 14px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #ff8a7a, #b3261e); box-shadow: 0 2px 3px rgba(0,0,0,.4); transform: translateX(-50%); }
.zettel-kopf { font-size: .92em; } .nur-fuer { display: inline-block; font: 700 .72em system-ui; background: var(--gold); color: var(--wood); border-radius: 999px; padding: 1px 7px; margin-left: 4px; }
.zettel-tausch { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 6px; text-align: center; }
.zettel-tausch small { display: block; font-size: .75em; color: var(--ink-2); } .zettel-tausch b { font-size: 1.3em; display: block; font-family: Georgia, "Times New Roman", serif; }
.zettel-tausch .pfeil { font-size: 1.4em; color: var(--wood-3); }
.zettel-fuss { display: flex; justify-content: space-between; align-items: center; gap: 6px; }

/* ---- Knüppelkammer: Schildwand, Wachbuch, Musterung, Feldzug ---- */
.alarm { background: #c0392b; color: #fff; border-radius: var(--radius); padding: 10px 14px; margin-bottom: 12px; box-shadow: var(--shadow); animation: alarm 1.2s ease-in-out infinite alternate; }
@keyframes alarm { from { box-shadow: 0 0 0 0 rgba(192,57,43,.6); } to { box-shadow: 0 0 0 6px rgba(192,57,43,0); } }
.kammer-oben { display: grid; grid-template-columns: minmax(300px, 1fr) minmax(0, 1fr); gap: 16px; margin-bottom: 16px; align-items: start; }
@media (max-width: 860px) { .kammer-oben { grid-template-columns: 1fr; } }
.schildwand { background: var(--wood-2) repeating-linear-gradient(90deg, transparent 0 60px, rgba(0,0,0,.12) 60px 62px); color: #fff; border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow), inset 0 0 30px rgba(0,0,0,.3);
  display: grid; gap: 10px; border-top: 6px solid var(--gold); }
.schild-wert { display: flex; align-items: baseline; gap: 10px; } .schild-wert small { color: var(--gold-2); text-transform: uppercase; letter-spacing: .06em; font-size: .78em; } .schild-wert b { font-size: 2em; font-family: Georgia, "Times New Roman", serif; }
.schild-teile { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 14px; font-size: .9em; }
.schild-teile span { display: flex; justify-content: space-between; gap: 6px; border-bottom: 1px solid rgba(255,255,255,.12); padding: 3px 0; } .schild-teile i { font-style: normal; color: var(--parch-2); }
.schild-teile em.rot, .posten .rot { color: #ffb3a7; font-style: normal; font-weight: 600; }
.posten-kopf { display: flex; justify-content: space-between; font-size: .9em; margin-bottom: 4px; } .posten .bar { height: 9px; background: rgba(0,0,0,.35); border: 0; } .posten small { display: block; margin-top: 4px; font-size: .82em; }
.sold { display: flex; justify-content: space-between; align-items: baseline; font-size: .9em; } .sold small { color: var(--parch-2); }
.wachbuch h3 { margin-top: 0; }
.musterung { background: #fffaf0; border: 1px solid var(--parch-3); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 16px; overflow: hidden; }
.musterung-kopf { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; padding: 10px 14px; background: var(--parch-2); border-bottom: 1px solid var(--parch-3); } .musterung-kopf h3 { margin: 0; }
.einheiten { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; padding: 14px; }
.einheit { display: grid; gap: 8px; background: var(--parch); border: 1px solid var(--parch-3); border-radius: 10px; padding: 10px 12px; }
.einheit.gesperrt { opacity: .65; }
.einheit-kopf { display: flex; gap: 8px; align-items: flex-start; } .einheit-kopf .ic { font-size: 1.8em; line-height: 1; } .einheit-kopf small { display: block; font-size: .8em; }
.einheit-zahl { display: flex; align-items: baseline; gap: 6px; } .einheit-zahl b { font-size: 1.7em; font-family: Georgia, "Times New Roman", serif; } .einheit-zahl small { color: var(--ink-2); }
.werte { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 8px; margin: 0; font-size: .85em; } .werte div { display: flex; justify-content: space-between; border-bottom: 1px dashed var(--parch-3); } .werte dt { color: var(--ink-2); } .werte dd { margin: 0; font-weight: 600; }
.einheit-fuss { display: grid; gap: 6px; } .einheit-fuss .formrow { align-items: center; } .schloss { font-size: .85em; color: var(--ink-2); }
.feldzug { background: #fbf4e3; border: 1px solid var(--parch-3); border-left: 8px solid #c0392b; border-radius: var(--radius); padding: 12px 16px 14px; box-shadow: var(--shadow); }
.feldzug h3 { margin-top: 0; }
.ziel { display: grid; gap: 4px; background: var(--parch); border: 1px solid var(--parch-3); border-radius: 8px; padding: 8px 12px; margin-bottom: 10px; }
.ziel-kopf b { font-size: 1.15em; font-family: Georgia, "Times New Roman", serif; } .ziel-kopf small { margin-right: 6px; }
.ziel-fakten { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: .9em; color: var(--ink-2); } .ziel-fakten b { color: var(--ink); }
.aufgebot { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; margin: 8px 0; }
.aufgebot-einheit { display: grid; grid-template-columns: auto 1fr 5.5em; gap: 8px; align-items: center; background: var(--parch); border: 1px solid var(--parch-3); border-radius: 8px; padding: 8px 10px; cursor: pointer; }
.aufgebot-einheit .ic { font-size: 1.6em; } .aufgebot-einheit small { display: block; font-size: .8em; } .aufgebot-einheit input { width: 100%; box-sizing: border-box; }
.feldzug-knoepfe { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.feldzuege .bar.fein { margin-top: 4px; }
/* Feldzugsfenster: Lage des Gegners, Aussicht, Aufgebot */
.feldzug-fenster h2 { margin: 0 28px 10px 0; font-size: 1.35rem; }
.feldzug-fenster h2 small { display: block; font-size: .72em; font-weight: normal; margin-top: 2px; }
.feldzug-fenster h3 { margin: 0 0 8px; font-size: 1.05rem; }
.lage { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; margin: 10px 0 12px; }
.lage > section { background: #fbf4e3; border: 1px solid var(--parch-3); border-radius: 8px; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.lage > section form { margin: 0; }
.lage-hinweis { margin: 0; font-size: .85em; }
.lage .flash.inline-note { margin: 0; font-size: .88em; }
.chance { display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 2px 10px; }
.chance b { font-size: 1.9em; font-family: Georgia, "Times New Roman", serif; line-height: 1.1; }
.chance .bar, .chance #fz-urteil { grid-column: 1 / -1; }
.chance .bar { height: 12px; }
.feldzug-fenster[data-aussicht="sicher"] .chance b, .feldzug-fenster[data-aussicht="gut"] .chance b { color: var(--ok); }
.feldzug-fenster[data-aussicht="sicher"] .chance .bar i, .feldzug-fenster[data-aussicht="gut"] .chance .bar i { background: linear-gradient(90deg, #7fa65a, var(--ok)); }
.feldzug-fenster[data-aussicht="kaum"] .chance b, .feldzug-fenster[data-aussicht="los"] .chance b { color: var(--red); }
.feldzug-fenster[data-aussicht="kaum"] .chance .bar i { background: linear-gradient(90deg, #d9735f, var(--red)); }
.aufgebot-kopf { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.aufgebot-kopf h3 { margin: 0; }
.kundschaft { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--parch-3); display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

/* ---- Glocke: Benachrichtigungen ---- */
.glocke { font-size: 1.15em; padding: 2px 6px; opacity: .75; }
.glocke.an { opacity: 1; filter: drop-shadow(0 0 3px rgba(241,201,76,.8)); }
.card.imbau { border-left: 5px solid var(--wood-3); }

/* Sprachwahl im Fuß */
footer { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px 18px; }
.sprachwahl { position: relative; display: inline-block; }
.sprachwahl summary { cursor: pointer; list-style: none; padding: 2px 8px; border-radius: 6px; border: 1px solid var(--parch-3); background: var(--parch); color: var(--ink); }
.sprachwahl summary::-webkit-details-marker { display: none; }
.sprachwahl ul { position: absolute; bottom: 110%; left: 50%; transform: translateX(-50%); margin: 0; padding: 6px; list-style: none; background: var(--parch); border: 1px solid var(--parch-3); border-radius: 8px; box-shadow: 0 4px 14px rgba(43,29,18,.25); display: grid; grid-template-columns: repeat(2, minmax(120px, 1fr)); gap: 2px 8px; z-index: 30; text-align: left; }
.sprachwahl li a { display: block; padding: 3px 8px; border-radius: 5px; color: var(--ink); text-decoration: none; white-space: nowrap; }
.sprachwahl li a:hover { background: var(--parch-2); }
.sprachwahl li a.an { font-weight: 700; background: var(--parch-2); }

/* Sprachleiste vor der Anmeldung (Start, Anmelden, Hof gründen) */
.sprachleiste { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; margin: 2px auto 12px; max-width: 980px; }
.sprachleiste .globus { font-size: 1.1em; margin-right: 2px; }
.sprachleiste a.chip { text-decoration: none; display: inline-block; line-height: 1.2; }
body.outside .sprachwahl { display: none; }

/* Verteidigung als Kasten im Hof (ab Gutshaus Stufe 2) */
.panel .schildwand { margin-bottom: 14px; }

/* Hof: Bauliste scrollt in sich, die Karte bleibt stehen */
.buildlist { max-height: min(58vh, 540px); overflow-y: auto; padding-right: 6px; }

/* Scrollbalken im Stil des Spiels: Pergamentrinne, Holzgriff mit Goldkante – überall, auch an der Seite selbst */
html { scrollbar-width: thin; scrollbar-color: var(--wood-3) var(--parch-2); }
*::-webkit-scrollbar { width: 11px; height: 11px; }
*::-webkit-scrollbar-track { background: var(--parch-2); border-radius: 8px; box-shadow: inset 1px 1px 2px rgba(43,29,18,.18); }
*::-webkit-scrollbar-thumb { background: linear-gradient(180deg, var(--wood-3), var(--wood-2)); border-radius: 8px; border: 2px solid var(--parch-2); box-shadow: inset 0 0 0 1px rgba(241,201,76,.35); }
*::-webkit-scrollbar-thumb:horizontal { background: linear-gradient(90deg, var(--wood-3), var(--wood-2)); }
*::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, var(--wood-2), var(--wood)); }
*::-webkit-scrollbar-corner { background: var(--parch-2); }
*::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
/* Hinweis beim allerersten Besuch des Hofs */
.einfuehrung .modal-box { text-align: center; padding: 22px 24px 20px; }
.einfuehrung h2 { margin: 6px 0 8px; } .einfuehrung p { margin: 0 0 14px; }
/* Rückfrage vor unumkehrbaren Schritten (statt des Browserdialogs) */
.frage { z-index: 70; }
.frage .modal-box { width: min(400px, 100%); text-align: center; padding: 22px 24px 20px; }
.frage-symbol { font-size: 2.4rem; line-height: 1.1; }
.frage-text { margin: 8px 0 16px; font-size: 1.08em; overflow-wrap: anywhere; }
.frage-knoepfe { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.frage-knoepfe button { min-width: 7em; }

/* Goldmünze als Symbol (statt Emoji) */
.ico-muenze { width: 1.15em; height: 1.15em; vertical-align: -.2em; }

/* Texte des Textdienstes: Altknecht-Rat und Zunftblatt */
.altknecht-rat { background: #fbf4e3; border-left: 6px solid var(--wood-3); }
.altknecht-rat p { margin: 4px 0; font-style: italic; }
.zunftblatt { font-family: Georgia, "Times New Roman", serif; background: #fbf4e3; border: 1px solid var(--parch-3); }
.zunftblatt h3 { font-family: system-ui, sans-serif; }
.zunftblatt p { margin: 6px 0; } .zunftblatt p:first-of-type { font-weight: 700; font-size: 1.15em; }

.esel-karte .rot { color: var(--red); }

/* Auswahllisten mit Bildsymbolen (app.js: wahlBauen). Das echte <select> bleibt unsichtbar im Formular. */
.wahl { position: relative; display: inline-block; max-width: 100%; vertical-align: bottom; }
.wahl .wahl-nativ { position: absolute; inset: auto 0 0 0; width: 100%; height: 1px; opacity: 0; pointer-events: none; padding: 0; border: 0; }
.wahl-knopf {
  font: inherit; color: var(--ink); background: #fffdf7; border: 1px solid #b9a376; border-radius: 8px;
  padding: 6px 30px 6px 9px; min-height: 2.35em; width: 100%; max-width: 100%; text-align: left; cursor: pointer;
  display: flex; align-items: center; gap: 7px; position: relative; box-shadow: none; font-weight: normal;
}
.wahl-knopf:hover { border-color: var(--wood-3); background: #fffaf0; }
.wahl-knopf:focus-visible { outline: 2px solid var(--wood); outline-offset: 1px; }
.wahl-knopf.leer .wahl-text { color: var(--ink-2); font-style: italic; }
.wahl.fehlt .wahl-knopf { border-color: var(--red); box-shadow: 0 0 0 2px rgba(166, 58, 42, .18); }
.wahl-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wahl-pfeil { position: absolute; right: 11px; top: 50%; width: 8px; height: 8px; margin-top: -6px;
  border: solid var(--wood-2); border-width: 0 2px 2px 0; transform: rotate(45deg); transition: transform .15s; }
.wahl.offen .wahl-pfeil { transform: rotate(-135deg); margin-top: -2px; }
.wahl-knopf svg.sym, .wahl-eintrag svg.sym, .wahl-gruppe svg.sym { width: 1.35em; height: 1.35em; vertical-align: middle; }
.wahl-knopf svg.esel, .wahl-eintrag svg.esel { width: 1.35em; height: 1.35em; vertical-align: middle; }
.wahl-knopf svg.ico-muenze, .wahl-eintrag svg.ico-muenze { width: 1.25em; height: 1.25em; vertical-align: middle; }
.wahl-liste {
  position: fixed; z-index: 60; width: max-content; max-width: min(calc(100vw - 16px), 460px);
  max-height: 320px; overflow-y: auto; overscroll-behavior: contain; margin: 0; padding: 5px; list-style: none;
  background: #fffaf0; border: 1px solid var(--wood-3); border-radius: 10px; box-shadow: 0 8px 22px rgba(43, 29, 18, .28);
}
.wahl-liste:focus { outline: none; }
.wahl-eintrag { display: flex; align-items: center; gap: 8px; padding: 7px 28px 7px 9px; border-radius: 7px; cursor: pointer; position: relative; }
.wahl-eintrag.eingerueckt { padding-left: 16px; }
.wahl-eintrag.leer { color: var(--ink-2); font-style: italic; }
.wahl-eintrag .wahl-text { white-space: normal; }
.wahl-eintrag.aktiv { background: #f6e3a8; }
.wahl-eintrag[aria-selected="true"] { font-weight: 700; }
.wahl-eintrag[aria-selected="true"]::after { content: ""; position: absolute; right: 11px; top: 50%; width: 5px; height: 10px; margin-top: -7px;
  border: solid var(--ok); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.wahl-eintrag[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.wahl-gruppe { display: flex; align-items: center; gap: 7px; padding: 9px 9px 4px; margin-top: 3px; border-top: 1px solid var(--parch-3);
  font: 700 .82em Georgia, "Times New Roman", serif; letter-spacing: .04em; text-transform: uppercase; color: var(--wood-2); cursor: default; }
.wahl-gruppe:first-child { border-top: 0; margin-top: 0; }
.tausch-seite .wahl, .briefbogen .wahl { display: block; width: 100%; }
@media (prefers-reduced-motion: reduce) { .wahl-pfeil { transition: none; } }

/* Hofkarte in 3D (static/hof3d.js). Das SVG bleibt im Dokument: Seine Links öffnen die Felder. */
.ansicht-wahl { display: flex; width: fit-content; margin: 8px 0 0 auto; gap: 2px; padding: 3px;
  background: rgba(59, 38, 20, .88); border-radius: 999px; box-shadow: 0 2px 6px rgba(43, 29, 18, .35); }
.ansicht-wahl button { background: transparent; border: 0; box-shadow: none; color: var(--parch); font: 700 12px/1 system-ui, sans-serif;
  letter-spacing: .06em; padding: 6px 13px; border-radius: 999px; }
.ansicht-wahl button[aria-pressed="true"] { background: var(--gold-2); color: var(--wood); }
.ansicht-wahl button:focus-visible { outline: 2px solid var(--gold-2); outline-offset: 2px; }
.hofkarte-rahmen.laedt-3d + .ansicht-wahl button[data-ansicht="3d"] { animation: hof3d-laedt 1s ease-in-out infinite alternate; }
@keyframes hof3d-laedt { to { opacity: .45; } }
.hofkarte-rahmen.ist-3d svg.hofkarte { display: none; }
.hof3d { position: relative; width: 100%; border-radius: 10px; overflow: hidden; outline: none; cursor: grab; touch-action: none;
  user-select: none; -webkit-user-select: none; background: radial-gradient(ellipse at 50% 30%, #fbf2db, #ead9b0 62%, #d6bf8c); }
.hof3d:active { cursor: grabbing; }
.hof3d:focus-visible { box-shadow: inset 0 0 0 3px var(--gold-2); }
.hof3d canvas { display: block; width: 100%; height: 100%; }
.hof3d-etiketten { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.hof3d-schild { position: absolute; left: 0; top: 0; pointer-events: none; white-space: nowrap; will-change: transform; }
.hof3d-schild.stufe { background: var(--wood); color: var(--gold-2); font: 700 11px/1 system-ui, sans-serif; padding: 3px 6px; border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .35); font-variant-numeric: tabular-nums; }
.hof3d-schild.zeit { display: flex; align-items: center; gap: 3px; background: rgba(43, 29, 18, .86); color: #fff; font: 10px/1 system-ui, sans-serif;
  padding: 3px 6px; border-radius: 4px; font-variant-numeric: tabular-nums; }
.hof3d-schild.zeit svg.sym { width: 12px; height: 12px; vertical-align: 0; }
.hof3d-schild.marke svg.sym { width: 16px; height: 16px; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .4)); }
.hof3d-schild.nebel { font: italic 22px Georgia, "Times New Roman", serif; color: #8d7a5a; }
.hof3d-tipp { position: absolute; left: 0; top: 0; z-index: 2000; max-width: 260px; pointer-events: none; background: #fffaf0;
  border: 1px solid var(--wood-3); border-radius: 6px; padding: 4px 8px; font-size: .84em; box-shadow: 0 3px 10px rgba(43, 29, 18, .25); }
.hof3d-ansage { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.hof3d-knoepfe { position: absolute; right: 8px; bottom: 8px; z-index: 2001; display: flex; gap: 4px; }
.hof3d-knoepfe button { width: 34px; height: 34px; padding: 0; display: grid; place-items: center; border-radius: 8px;
  background: rgba(255, 250, 240, .93); border: 1px solid var(--wood-3); box-shadow: 0 1px 3px rgba(43, 29, 18, .3); }
.hof3d-knoepfe button:focus-visible { outline: 2px solid var(--wood); outline-offset: 1px; }
.hof3d-knoepfe svg { width: 18px; height: 18px; fill: none; stroke: var(--wood); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
