/* =====================================================================
   DESIGN-TOKENS (zentrale Steuerzentrale fuer Farben, Formen, Schrift)
   Werte entsprechen exakt dem bisherigen Design. Aenderungen hier wirken
   sich global aus. Verwendung im CSS ueber var(--name).
   ===================================================================== */
:root {
  --view-top-gap: 8px;
  --view-space-gain: calc(32px - var(--view-top-gap));
  --view-max-width: 1800px;
  --view-panel-gap: 16px;
  --view-panel-content-height: calc(800px + var(--view-space-gain));
  --view-panel-min-height: calc(var(--view-panel-content-height) + 32px);
  /* --- Gold --- */
  --gold: #bfa046;
  --gold-hell: #ffe08a;
  --gold-dunkel: #7c5a1a;
  --gold-glanz: #e2cfa1;

  /* --- Holz --- */
  --holz-hell: #c2a46b;
  --holz: #a88a4a;
  --holz-dunkel: #7c5a1a;

  /* --- Pergament / helle Flaechen --- */
  --pergament: #f8f5e6;
  --pergament-hell: #fff5d6;
  --pergament-mittel: #f3e2b8;
  --pergament-dunkel: #d2b778;

  /* --- Text / Hintergrund --- */
  --tinte: #2a1a0a;        /* dunkle Schrift auf hellem Grund */
  --hintergrund: #2a1a0a;  /* Seiten-Hintergrund */

  /* --- Status / Balken --- */
  --hp-rot: #aa2222;
  --mana-blau: #2255aa;
  --erfolg-gruen: #1e8f4c;
  --fehler-rot: #a23636;

  /* --- Aktions-Buttons (Waldgruen; Farben per Pipette aus Mockup) --- */
  --btn-gruen-hell: #294b16;   /* oberer, hellerer Ton */
  --btn-gruen: #1e3a10;
  --btn-gruen-dunkel: #12280b; /* unterer, dunkler Ton */
  --btn-text: #ffe9b0;
  --btn-rand: #d9b75a;
  --btn-rand-aussen: #0d1f07;
  --btn-verlauf: linear-gradient(180deg, #294b16 0%, #21400f 45%, #193310 72%, #12280b 100%);
  --btn-verlauf-hover: linear-gradient(180deg, #315a1c 0%, #294b16 45%, #1d3a10 72%, #163010 100%);
  --btn-schatten: 0 0 0 1px var(--btn-rand-aussen), inset 0 1px 0 #ffffff2e, inset 0 -2px 3px #0000006e, 0 2px 4px #0006;

  /* --- Destruktive Aktions-Buttons (gleiche Optik in Rot) --- */
  --btn-gefahr-rand-aussen: #310505;
  --btn-gefahr-verlauf: linear-gradient(180deg, #a52a24 0%, #8d1d18 45%, #711411 72%, #570b0a 100%);
  --btn-gefahr-verlauf-hover: linear-gradient(180deg, #bd352e 0%, #a52a24 45%, #841916 72%, #68100e 100%);

  /* --- Nav-Buttons (dunkles Holzbraun; gleiche Textfarbe/Struktur wie Aktions-Buttons) --- */
  --nav-btn-rand: var(--btn-rand);
  --nav-btn-rand-aussen: #150d05;
  --nav-btn-verlauf: linear-gradient(180deg, #5a3b1a 0%, #46300f 45%, #33220c 72%, #241608 100%);
  --nav-btn-verlauf-hover: linear-gradient(180deg, #6d4820 0%, #5a3b1a 45%, #402c0f 72%, #2c1c0a 100%);
  --nav-btn-schatten: 0 0 0 1px var(--nav-btn-rand-aussen), inset 0 1px 0 #ffffff22, inset 0 -2px 3px #0000006e, 0 2px 4px #0006;

  /* --- Form & Tiefe --- */
  --radius-panel: 18px;
  --radius-btn: 12px;
  --schatten-panel: 0 2px 12px #0002, 0 0 0 6px #bfa04622 inset;

  /* --- Schrift --- */
  --font-titel: 'EB Garamond', Georgia, serif;
  --font-zier: 'EB Garamond', Georgia, serif;
  /* --- Zierrahmen (border-image 9-Slice) --- */
  --rahmen-quelle: url("assets/deco/frame_gold.png");
  --rahmen-slice: 58;      /* Schnitt in Quell-Pixeln = Eckgroesse */
  --rahmen-breite: 30px;   /* gerenderte Randbreite (skaliert die Ecke) */
  --rahmen-outset: 0px;    /* Rahmen bleibt an der Panelkante (Grafik ohne transparenten Rand) */
  --nav-btn-rahmen-breite: 12px; /* gleicher Zierrahmen wie Panels, aber kleiner gerendert */

  /* --- Texturen (nahtlos kachelbar). Werden AUTOMATISCH aktiv, sobald die Datei
     existiert; fehlt sie, bleibt der Farbverlauf darunter als Fallback sichtbar. --- */
  --textur-holz: url("assets/deco/holz.webp");
  --textur-pergament: url("assets/deco/pergament.webp");
  --textur-pergament-hell: url("assets/deco/pergament_hell.webp");
  --textur-kachel: 480px;  /* Kachelgroesse der Textur */

  /* --- Wiederverwendbare Verlaeufe --- */
  --verlauf-holz:
    radial-gradient(ellipse at 20% 40%, #e2cfa1 0 18%, transparent 60%),
    radial-gradient(ellipse at 80% 60%, #bfa04699 0 16%, transparent 60%),
    radial-gradient(ellipse at 60% 20%, #bfa04666 0 12%, transparent 60%),
    radial-gradient(ellipse at 40% 80%, #a88a4a 0 10%, transparent 60%),
    linear-gradient(180deg, #c2a46b 0%, #a88a4a 100%);
  --verlauf-titel:
    radial-gradient(ellipse at 20% 40%, #bfa046 0 18%, transparent 60%),
    radial-gradient(ellipse at 80% 60%, #a88a4a 0 16%, transparent 60%),
    radial-gradient(ellipse at 60% 20%, #a88a4a99 0 12%, transparent 60%),
    radial-gradient(ellipse at 40% 80%, #7c5a1a 0 10%, transparent 60%),
    linear-gradient(180deg, #a88a4a 0%, #7c5a1a 100%);
  --verlauf-pergament:
    radial-gradient(ellipse at 25% 30%, #fff5d6 0 20%, transparent 60%),
    radial-gradient(ellipse at 75% 70%, #f3e2b8 0 18%, transparent 60%),
    linear-gradient(180deg, #f8f5e6 0%, #efe1bf 100%);
}

@font-face {
  font-family: 'EB Garamond';
  src: url('assets/fonts/EBGaramond-Regular.ttf') format('truetype');
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
}
@font-face {
  font-family: 'EB Garamond';
  src: url('assets/fonts/EBGaramond-Italic.ttf') format('truetype');
  font-style: italic;
  font-weight: 400 800;
  font-display: swap;
}
/* Bestehende Schriftnamen in UI-Regeln nutzen dieselben lokalen Font-Dateien. */
@font-face {
  font-family: 'MedievalSharp';
  src: url('assets/fonts/EBGaramond-Regular.ttf') format('truetype');
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
}
@font-face {
  font-family: 'MedievalSharp';
  src: url('assets/fonts/EBGaramond-Italic.ttf') format('truetype');
  font-style: italic;
  font-weight: 400 800;
  font-display: swap;
}
@font-face {
  font-family: 'UnifrakturCook';
  src: url('assets/fonts/EBGaramond-Regular.ttf') format('truetype');
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
}
@font-face {
  font-family: 'UnifrakturCook';
  src: url('assets/fonts/EBGaramond-Italic.ttf') format('truetype');
  font-style: italic;
  font-weight: 400 800;
  font-display: swap;
}

.ship-info-row {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 8px;
}

.ship-bauten-row {
  margin-top: 8px;
}

.ship-build-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ship-selector-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.ship-select {
  min-width: 160px;
  flex: 1 1 180px;
}

.ship-info-header {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  font-weight: 600;
}

.ship-label {
  opacity: 0.85;
}

.ship-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ship-message {
  font-size: 0.85em;
  margin-top: 4px;
  display: none;
}

.ship-range-display {
  font-weight: 600;
}

.ship-range-display:not(:empty)::before {
  content: ' Ã‚Â· ';
}

.ship-purchase-btn {
  white-space: nowrap;
}

.storage-popup.ship-purchase-modal {
  width: max-content;
  box-sizing: border-box;
}

.storage-popup.ship-purchase-modal .ship-purchase-list {
  width: max-content;
  flex-shrink: 0;
  grid-template-columns: repeat(3, minmax(400px, 1fr));
}

.ship-purchase-modal .equip-popup-header {
  text-align: center;
  margin-left: 24px;
  margin-right: 24px;
  min-height: 24px;
}

.ship-purchase-list .build-entry {
  align-items: stretch;
}

.storage-popup .build-entry.ship-build-entry {
  box-sizing: border-box;
  grid-template-columns: 80px 1fr;
}

.storage-popup .build-entry.ship-build-entry .build-icon {
  width: 80px;
  height: 80px;
  object-fit: contain;
  image-rendering: pixelated;
  align-self: center;
}

.storage-popup .build-entry.ship-build-entry .build-info {
  display: grid;
  grid-template-rows: none;
  row-gap: 6px;
}

.ship-template-stats {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.9em;
  color: #2a1a0a;
}

.ship-stat-line {
  line-height: 1.2;
}

.ship-template-costs {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.storage-popup .build-entry.ship-build-entry .build-actions {
  display: flex;
  justify-content: flex-start !important;
  align-items: flex-start;
  text-align: left;
  justify-self: start;
}

.storage-popup .build-entry button.ship-template-buy {
  margin: 0;
  align-self: flex-start;
}

.ship-purchase-loading,
.ship-purchase-empty {
  padding: 24px 8px;
  text-align: center;
  font-size: 0.95em;
  color: #2a1a0a;
}
/* ===== Kampfansicht ===== */
.fight-view {
  display: flex;
  flex-direction: row;
  height: 100%;
}
/* Panels fÃƒÂ¼r Kampfansicht */
/* Container fÃƒÂ¼r Kampfansicht-Panels */
#fightview-schlachtfeld {
  margin-top: 0;
  /* auf volle Spaltenbreite strecken, damit der Abstand zur Mitte exakt dem Grid-Gap entspricht */
  align-self: stretch;
  width: 100%;
}
/* Fightview Panels gezielt positionieren und dimensionieren */
.schlachtfeld-panel {
  width: 100%;
  /* Fixe Breiten entfernen, damit das Panel die ganze linke Spalte fÃƒÂ¼llt */
  height: var(--view-panel-min-height);
  margin: 0; /* kein zusÃƒÂ¤tzlicher Innenabstand zur mittleren Spalte erzeugen */
  background: #222;
  border-radius: 12px;
  box-shadow: 0 2px 8px #0008;
  padding: 16px 20px 20px 20px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
.kampfbericht-panel {
  width: 100%; /* Volle Breite der mittleren Grid-Spalte */
  margin: 0; /* kein zusÃƒÂ¤tzlicher AuÃƒÅ¸enabstand */
  height: var(--view-panel-min-height);
  background: #222;
  border-radius: 12px;
  box-shadow: 0 2px 8px #0008;
  padding: 16px 20px 20px 20px;
  min-width: 260px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  overflow: hidden; /* Inhalt innerhalb halten; Scrollen ÃƒÂ¼bernimmt .fight-log */
}
/* In der Kampfansicht soll der Kampfbericht die gleiche Breite wie das Bauten-Panel haben (520px) */
body.fight-mode #center-column .kampfbericht-panel { width: 100%; margin: 0; }
.kampfbericht-panel .report-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-right: 36px; /* 18px EinrÃƒÂ¼ckung + 18px Header-ÃƒÅ“berbreite ausgleichen */
}
.kampfbericht-panel .report-header .report-mode label {
  color: #2a1a0a;
  font-size: 0.8em;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.kampfbericht-panel .report-header .report-mode {
  margin-right: 24px !important; /* Abstand vom rechten Rand sichtbarer machen */
}
.schlachtfeld-panel h2, .kampfbericht-panel h2, .gruppe-panel h2 {
  margin-top: 0;
  margin-bottom: 12px;
  font-size: 1.3em;
  color: #fff;
}

.battlefield {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px; /* weniger Abstand zwischen Abteilen */
}
.battle-section-title {
  /* eigene, kompakte Titelzeile */
  margin: 2px 0 1px 0 !important; /* noch 1px nÃƒÂ¤her an die KÃƒÂ¤mpfer */
  font-size: 0.8em !important; /* gleiche GrÃƒÂ¶ÃƒÅ¸e wie KÃƒÂ¤mpfernamen */
  color: #2a1a0a !important;   /* gleiche Farbe wie gewÃƒÂ¼nscht */
  display: flex !important;
  align-items: center !important; /* Linie vertikal mittig zur Schrift */
  line-height: 1em !important; /* exakte BezugshÃƒÂ¶he fÃƒÂ¼r die Mitte der Schriftzeile */
  white-space: nowrap !important; /* kein Zeilenumbruch im Titel */
  gap: 8px !important; /* Abstand zwischen Titeltext und Linie */
  background: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  width: 100% !important;
}
.battle-section-title::after {
  content: '';
  display: block;
  height: 1px; /* dÃƒÂ¼nner Strich */
  background: #2a1a0a;
  flex: 1 1 auto;
  margin-right: 8px; /* nicht ganz bis zum Rand */
  opacity: 0.9;
  align-self: center; /* absolut mittig relativ zur Titelzeile */
}
.battle-row {
  display: flex;
  flex-direction: row;
  justify-content: center;
  gap: 24px;
  margin-bottom: 2px; /* 2px nÃƒÂ¤her an die nÃƒÂ¤chste Linie */
}
.fighter {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: transparent; /* grauen Hintergrund entfernen */
  border-radius: 8px;
  padding: 6px 10px 4px 10px; /* vertikal kompakter */
  min-width: 80px;
  box-shadow: none;
}
.fighter-icon {
  font-size: 1.5em; /* ~30% kleiner als zuvor */
  margin-bottom: 2px;
  width: 45px;  /* 64px -> ~45px */
  height: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative; /* Anker fÃƒÂ¼r Damage-Overlay */
}
.fighter-icon .fighter-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: auto;
  border-radius: 4px;
  background: transparent; /* sicherstellen, dass kein grauer BG sichtbar ist */
}
.fighter-name {
  font-size: 1em;
  color: #fff;
  margin-top: 2px;
  margin-bottom: 0;
  text-align: center;
}
/* Angriffsbump-Animation fÃƒÂ¼r detaillierten Kampf */
.battlefield.combat-playing { position: relative; }
.combat-playing .fighter { position: relative; }
.combat-playing .combat-source {
  outline: 3px solid #987334;
  outline-offset: -3px;
  box-shadow: inset 0 0 12px #98733450;
}
.combat-playing .combat-target {
  outline: 3px dashed #385d85;
  outline-offset: -3px;
}
.combat-playing .combat-source.combat-target { outline-color: #476a37; }
.combat-role {
  position: absolute;
  top: -9px;
  left: 4px;
  z-index: 4;
  padding: 1px 5px;
  border: 1px solid #987334;
  border-radius: 3px;
  background: #fff4d5;
  color: #2a1a0a;
  font-size: 11px;
  pointer-events: none;
}
.combat-role + .combat-role { left: auto; right: 4px; }
.combat-overlay {
  position: absolute;
  inset: 0;
  z-index: 8;
  overflow: hidden;
  pointer-events: none;
}
.combat-connection { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.combat-connection line { stroke: #7c5a1a; stroke-width: 3px; stroke-dasharray: 7 5; opacity: 0.65; }
.combat-connection polygon { fill: #7c5a1a; }
.combat-group-effects { padding: 4px 6px; border: 1px solid #476a37; color: #294b16; background: #fff4d5; font-size: 12px; }
.combat-projectile {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 2px solid #987334;
  border-radius: 50%;
  background: #fff4d5;
  color: #702020;
  box-shadow: 0 0 12px #fff0b0;
  font: bold 24px Georgia, serif;
}
.combat-projectile img { width: 28px; height: 28px; object-fit: contain; }
.combat-projectile.combat-spell { border-color: #385d85; color: #385d85; }
.combat-projectile.combat-support { border-color: #476a37; color: #294b16; }
.combat-projectile.combat-tick { border-color: #784b7e; color: #784b7e; }
.combat-playing .hp-bar .bar-inner,
.combat-playing .mana-bar .bar-inner { transition: none; }
.combat-bar-trail { position: absolute; inset: 0 auto 0 0; background: #f5cc6f; opacity: 0.85; }
.combat-playing .hp-bar span,
.combat-playing .mana-bar span { z-index: 2; }
.combat-playing .combat-defeated .fighter-icon { opacity: 0.35; filter: grayscale(1); }
.combat-result-float {
  position: absolute;
  top: 45%;
  left: 3px;
  right: 3px;
  z-index: 9;
  padding: 4px;
  border: 1px solid #987334;
  border-radius: 4px;
  background: #fff4d5;
  color: #2a1a0a;
  font-size: 13px;
  font-weight: bold;
  text-align: center;
  overflow-wrap: anywhere;
  pointer-events: none;
}
.combat-action-card {
  border: 1px solid #987334;
  border-left-width: 4px;
  border-radius: 4px;
  padding: 8px 10px;
  margin: 8px 0;
  background: #f8edcc;
  color: #2a1a0a;
  overflow-wrap: anywhere;
}
.combat-action-card[data-phase="announce"],
.combat-action-card[data-phase="execute"] { box-shadow: inset 0 0 0 1px #987334; }
.combat-action-card[data-type="support"] { border-left-color: #476a37; }
.combat-action-card[data-type="spell"] { border-left-color: #385d85; }
.combat-action-card[data-type="tick"] { border-left-color: #784b7e; }
.combat-action-card[data-type="round-end"] { border-left-color: #476a37; }
.combat-round-end-line { margin-top: 5px; font-size: 12px; }
.combat-action-heading { font-weight: bold; font-size: 15px; }
.combat-actor-buffs { margin-top: 5px; color: #294b16; font-size: 12px; }
.combat-narration { margin-top: 8px; border-top: 1px solid #98733460; padding-top: 4px; }
.combat-narration .fight-action { font-size: 12px; }
.combat-playback-controls { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: center; margin: 6px 0; }
/* Zentrale Rundenende-Mitteilung in der Optik der Schlachtfeld-Infokästchen. */
.combat-round-notice {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 3000;
  padding: 6px 16px;
  border: 1px solid #987334;
  border-radius: 4px;
  background: #fff4d5;
  color: #2a1a0a;
  font-size: 13px;
  font-weight: bold;
  text-align: center;
  pointer-events: none;
}
/* Ensure battlefield names match Schlachtfeld header color */
.schlachtfeld-panel .fighter-name {
  color: #2a1a0a;
  font-size: 0.8em; /* ~20% kleiner */
}
.hp-bar, .mana-bar {
  width: 100%;
  height: 14px; /* ~20% schmaler (vorher 18px) */
  background: #444;
  border-radius: 6px;
  margin-bottom: 1px; /* dichter zusammengerÃƒÂ¼ckt */
  position: relative;
  overflow: hidden;
  font-size: 0.9em;
}
/* Schlachtfeld: Balken mit fixer, einheitlicher Breite zentrieren */
.schlachtfeld-panel .hp-bar,
.schlachtfeld-panel .mana-bar {
  width: 80px;
  margin-left: auto;
  margin-right: auto;
}
.hp-bar .bar-inner {
  background: var(--hp-rot); /* dunkleres Rot */
  height: 100%;
  border-radius: 6px 0 0 6px;
  position: absolute;
  left: 0; top: 0;
  z-index: 1;
}
.mana-bar .bar-inner {
  background: var(--mana-blau); /* dunkleres Blau */
  height: 100%;
  border-radius: 6px 0 0 6px;
  position: absolute;
  left: 0; top: 0;
  z-index: 1;
}
.hp-bar span, .mana-bar span {
  position: relative;
  z-index: 2;
  color: #fff;
  width: 100%;
  text-align: center;
  display: block;
  font-size: 0.9em;
  line-height: 14px; /* passend zur geringeren HÃƒÂ¶he */
}
.battle-controls {
  margin-top: 0;
  display: flex;
  flex-direction: row;
  gap: 16px;
  align-items: center;
  justify-content: center; /* zentriert im Panel */
}
.battle-controls .battle-rounds {
  color: #2a1a0a; /* wie KÃƒÂ¤mpfernamen */
  font-size: 0.8em; /* gleiche GrÃƒÂ¶ÃƒÅ¸e wie KÃƒÂ¤mpfernamen */
  display: inline-flex; /* damit Text + Select eine Zeile bilden */
  align-items: center; /* vertikal mittig ausrichten */
  gap: 6px;
}
.battle-controls .standard-button { margin: 0; }
.fight-log {
  margin-top: 8px;
  color: #2a1a0a;
  font-size: 0.8em; /* wie KÃƒÂ¤mpfernamen */
  flex: 1 1 auto; /* nimmt restlichen Platz ein */
  overflow: auto;  /* bei langen Berichten scrollen */
  min-height: 0;   /* erlaubt flexbiles Schrumpfen fÃƒÂ¼r Scroll */
  max-width: 100%;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.kampfbericht-panel .report-actions {
  margin-top: 8px;
  display: flex;
  justify-content: center; /* unten mittig */
}
.kampfbericht-panel .report-actions .feld-aufwerten-link {
  font-size: 14px;
  margin-left: 0 !important; /* Center, nicht nach rechts schieben */
  margin-right: 0 !important;
}
.fight-round {
  margin-bottom: 10px;
}
.kampfbericht-panel .fight-round h3 {
  /* ZurÃƒÂ¼cksetzen der Panel-Titel-Styles */
  width: auto;
  margin: 0 0 4px 0;
  padding: 0;
  font-size: 0.8em; /* gleiche GrÃƒÂ¶ÃƒÅ¸e wie KÃƒÂ¤mpfernamen */
  color: #2a1a0a;
  background: none;
  box-shadow: none;
  border-radius: 0;
  letter-spacing: normal;
  /* Normale Textdarstellung */
  display: inline;
  font-family: inherit;
}
.fight-action {
  margin-left: 10px;
  margin-bottom: 2px;
}
.fight-mana-regeneration { margin: 5px 0 2px 10px; }
.fight-mana-entry { display: inline-block; }
.combat-narration .fight-mana-regeneration { margin: 0; font-size: 12px; }
.fight-action .log-name-hero, .fight-mana-regeneration .log-name-hero { color: #2255aa; font-weight: 600; }
.fight-action .log-name-monster, .fight-mana-regeneration .log-name-monster { color: #aa2222; font-weight: 600; }
.fight-action .skill-gain { color: #1e8f4c; font-weight: 600; margin-left: 6px; }
.fight-winner {
  margin-top: 16px;
  font-size: 1.1em;
  color: #2a1a0a;
  font-weight: bold;
}
/* Scrollbar-Styling fÃƒÂ¼r Kampfbericht (nur innerhalb des Panels) */
.kampfbericht-panel .fight-log {
  /* Firefox */
  scrollbar-color: #bfa046 #2a1a0a; /* thumb, track */
  scrollbar-width: auto; /* etwas breiter als 'thin' */
}
.kampfbericht-panel .fight-log::-webkit-scrollbar {
  width: 15px;  /* ~50% breiter */
  height: 15px; /* horizontal, falls nÃƒÂ¶tig */
}
.kampfbericht-panel .fight-log::-webkit-scrollbar-track {
  background: #2a1a0a;
  border-radius: 8px;
}
.kampfbericht-panel .fight-log::-webkit-scrollbar-thumb {
  background-color: #bfa046;
  border-radius: 8px;
  border: 3px solid #2a1a0a; /* proportional zum breiteren Balken */
}
.kampfbericht-panel .fight-log::-webkit-scrollbar-thumb:hover {
  background-color: #c6a543; /* dezente Hover-Farbe */
}
.kampfbericht-panel .fight-log::-webkit-scrollbar-button {
  background-color: #bfa046; /* Scrollpfeile (sofern dargestellt) */
  height: 15px;
}
.kampfbericht-panel .fight-log::-webkit-scrollbar-corner {
  background: #2a1a0a; /* Ecke bei gleichzeitigen Scrollbars */
}
/* ===== Skill-Tab-Buttons im Charaktere-Panel als Link-Style ===== */
.skill-tab-btn {
  background: none;
  border: none;
  color: #2a1a0a;
  text-decoration: underline;
  font-family: 'MedievalSharp', 'UnifrakturCook', cursive;
  font-size: 0.91em;
  font-weight: normal;
  cursor: pointer;
  margin-right: 1.2em;
  margin-bottom: 0;
  padding: 0 0.2em;
  transition: color 0.2s;
}
.skill-tab-btn:last-child {
  margin-right: 0;
}
.skill-tab-btn:hover, .skill-tab-btn:focus, .skill-tab-btn.active {
  color: #225522;
  text-decoration: underline;
}
/* CharakterÃƒÂ¼bersicht Tabelle */
.charakter-tabelle {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
  font-size: 1.1em;
  background: #fffbe8;
  box-shadow: 0 1px 4px #bfa04622;
}
.charakter-tabelle th, .charakter-tabelle td {
  border: 1px solid #e0d6b6;
  padding: 6px 10px;
  text-align: center;
}
.charakter-tabelle th {
  background: #f3e2b8;
  font-weight: bold;
  font-size: 1em;
}
.charakter-tabelle .klasse-icon-cell {
  padding-top: 4px;
  padding-bottom: 4px;
}
.klasse-icon {
  width: 22px;
  height: 22px;
  object-fit: contain;
  image-rendering: auto;
  vertical-align: middle;
  cursor: help;
}

/* Dropdown fÃƒÂ¼r Haltung in CharakterÃƒÂ¼bersicht */
.player-picker {
  display: inline-flex;
  align-items: center;
  width: 220px;
  max-width: 100%;
  min-width: 0;
  vertical-align: middle;
}
.haltung-dropdown.player-picker-input {
  box-sizing: border-box;
  height: 25px;
  width: 100%;
  min-width: 0;
  font: 14px 'EB Garamond', Georgia, serif;
}
.player-picker-panel {
  position: fixed;
  inset: auto;
  margin: 0;
  box-sizing: border-box;
  padding: 4px;
  overflow: auto;
  border: 1.5px solid #987334;
  border-radius: 4px;
  background: #f5e8c6;
  color: #2a1a0a;
  box-shadow: 0 4px 14px #0006;
  font: 16px 'EB Garamond', Georgia, serif;
  z-index: 10000;
}
.player-picker-panel[hidden] { display: none; }
.player-picker-option { padding: 5px 8px; cursor: pointer; overflow-wrap: anywhere; }
.player-picker-option:hover,
.player-picker-option[aria-selected="true"] { background: #e8d69a; box-shadow: inset 0 0 0 1px #bfa046; }
.player-picker-status { padding: 4px 8px; font-size: 14px; }
.player-picker-status:empty { display: none; }

.haltung-dropdown {
  height: 20px; /* etwas kleiner als Standard */
  font-size: 0.8em;
  vertical-align: top;
  border-radius: 6px;
  border: 1px solid #bfa046;
  background: #fffbe8;
  color: #2a1a0a;
  box-shadow: 0 1px 2px #bfa04622 inset;
}
.charakter-tabelle tr:nth-child(even) {
  background: #f8f5e6;
}
.charakter-tabelle tr:hover {
  background: #ffe08a44;
}
.route-heading-icon {
  width: 22px;
  height: 22px;
  object-fit: contain;
  vertical-align: middle;
}
.route-icon-button {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 26px;
  box-sizing: border-box;
  padding: 3px 6px;
  margin: 0 !important;
  line-height: 1;
  vertical-align: middle;
}
.route-icon-button img {
  display: block;
  width: 16px;
  height: 16px;
  object-fit: contain;
}
.route-price-cell {
  white-space: nowrap;
}
.route-price-editor {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.route-overview-price-input {
  width: 90px;
  height: 26px;
  box-sizing: border-box;
  vertical-align: middle;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.route-overview-price-input.is-saved {
  border-color: #2f8a38;
  box-shadow: 0 0 0 2px #4da85755, 0 1px 2px #2f8a3833 inset;
}
.route-price-confirm.is-saved {
  background: linear-gradient(#72c86f, #267b31);
  box-shadow: 0 0 0 1px #174f20, 0 0 8px #4da857cc, inset 0 1px 0 #ffffff99;
}
.route-overview-table col.route-column {
  width: 38%;
}
.route-overview-table col.route-price-column {
  width: 20%;
}
.route-overview-table col.route-compact-column {
  width: 14%;
}
.mayor-route-table {
  table-layout: fixed;
}
.mayor-route-table col.route-column {
  width: 34%;
}
.mayor-route-table col.route-owner-column {
  width: 22%;
}
.mayor-route-table col.route-compact-column {
  width: 11%;
}
.mayor-route-block + .mayor-route-block {
  margin-top: 20px;
}
.mayor-route-block h3 {
  margin: 2px 0 6px;
  font-size: 1.05em;
  letter-spacing: 0;
}
.storage-popup.mayor-routes-popup {
  width: min(920px, calc(100vw - 32px));
  height: auto;
  max-height: calc(100vh - 80px);
}
.mayor-routes-content {
  padding: 8px 12px;
  overflow: auto;
}
.mayor-routes-popup .equip-popup-header { margin-left: 24px; margin-right: 24px; min-height: 24px; }
.mayor-routes-popup .route-icon-button { height: 25px; padding: 2px 6px; }
/* ===== ÃƒÅ“bersichtspanel ===== */
#uebersicht-container {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  max-width: var(--view-max-width);
  margin: var(--view-top-gap) auto 0;
  gap: var(--view-panel-gap);
  align-items: stretch;
}

#uebersicht-panel {
  box-sizing: border-box;
  width: 100%;
  height: var(--view-panel-min-height);
  min-height: var(--view-panel-min-height);
  margin: 0;
  overflow: hidden;
}

#uebersicht-panel-title {
  flex-shrink: 0;
}

#profile-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}

#profile-container,
#chronicle-container,
#lexicon-container,
#chat-container,
#nation-container,
#forum-container {
  max-width: var(--view-max-width);
  margin: var(--view-top-gap) auto 0;
}

#chronicle-container {
  display: flex;
  justify-content: center;
}

#chronicle-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  position: relative;
}

.chronicle-content {
  width: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 0 16px;
  position: relative;
}
.chronicle-left {
  padding-right: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-self: start;
}
.chronicle-search-row {
  display: flex;
  gap: 10px;
  align-items: center;
}
.chronicle-search-label {
  display: block;
  margin-top: 6px;
  margin-bottom: 2px;
  font-weight: bold;
}
.chronicle-search-input {
  flex: 1 1 auto;
  min-width: 0;
  box-sizing: border-box;
  border: 1px solid #bfa046;
  border-radius: 8px;
  padding: 8px 10px;
  background: #fffbe8;
  color: #2a1a0a;
  font-family: 'MedievalSharp', 'UnifrakturCook', cursive;
}
.chronicle-type-filters {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 2px;
}
.chronicle-type-filter-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  line-height: 1.2;
}
.chronicle-type-filter-input {
  width: 16px;
  height: 16px;
  accent-color: #8f6a17;
}
.chronicle-divider {
  display: none;
}
.chronicle-content::before {
  content: '';
  position: absolute;
  left: 360px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(180deg, #a88a4a 0%, #7c5a1a 100%);
  box-shadow: 0 0 0 3px #bfa04622 inset;
  border-radius: 1px;
  pointer-events: none;
}
.chronicle-right {
  padding-left: 16px;
}
.chronicle-left,
.chronicle-right,
.lexicon-left,
.lexicon-right {
  min-height: 0;
  align-self: stretch;
  overflow: auto;
}
.chronicle-table {
  width: 100%;
  border-collapse: collapse;
  background: transparent;
  box-shadow: none;
}
.chronicle-table thead th {
  background: transparent;
  border: none;
  padding: 6px 10px;
  text-align: left;
}
.chronicle-table tbody td {
  border: none;
  padding: 6px 10px;
}
.chronicle-time-cell {
  width: 200px;
  white-space: nowrap;
}
.chronicle-type-cell {
  width: 140px;
  white-space: nowrap;
}
.chronicle-table tbody tr:nth-child(even) {
  background: transparent;
}

/* ===== Lexikon ===== */
#lexicon-container {
  display: flex;
  justify-content: center;
}
.lexicon-content {
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 0 16px;
  position: relative;
}
.lexicon-left {
  padding-right: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-self: stretch;
}
.lexicon-divider {
  display: none;
}
.lexicon-content::before {
  content: '';
  position: absolute;
  left: 360px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(180deg, #a88a4a 0%, #7c5a1a 100%);
  box-shadow: 0 0 0 3px #bfa04622 inset;
  border-radius: 1px;
  pointer-events: none;
}
.lexicon-right {
  padding-left: 16px;
  min-width: 0;
}

/* Linke Spalte: Themenbaum */
.lexicon-nav-list,
.lexicon-nav-articles {
  list-style: none;
  margin: 0;
  padding: 0;
}
.lexicon-nav-cat-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.lexicon-nav-toggle {
  width: 22px;
  flex: 0 0 22px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--gold);
  font-weight: 700;
  font-size: 0.95em;
  padding: 2px 0;
  -webkit-text-stroke: 0.6px #1b2b0c;
  text-shadow: 0 1px 1px #0007;
  border-radius: 0;
  transition: background 0.15s, box-shadow 0.15s;
}
.lexicon-nav-toggle.is-empty {
  visibility: hidden;
}
.lexicon-nav-cat-btn,
.lexicon-nav-article-btn,
.lexicon-breadcrumb {
  flex: 1 1 auto;
  text-align: left;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--btn-gruen-hell);
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 14px;
  font-weight: 600;
  line-height: normal;
  letter-spacing: normal;
  font-variant-numeric: lining-nums tabular-nums;
  text-decoration: underline;
  padding: 4px 6px;
  border-radius: 0;
  text-shadow: none;
  transition: background 0.15s, box-shadow 0.15s, color 0.15s;
}
.lexicon-nav-toggle:hover,
.lexicon-nav-toggle:focus {
  background: #e8d69a;
  box-shadow: 0 0 0 1px #bfa046 inset;
  outline: none;
}
.lexicon-nav-cat-btn:hover,
.lexicon-nav-article-btn:hover,
.lexicon-nav-cat-btn:focus,
.lexicon-nav-article-btn:focus,
.lexicon-breadcrumb:hover,
.lexicon-breadcrumb:focus {
  color: var(--btn-gruen-hell);
  background: #e8d69a;
  box-shadow: 0 0 0 1px #bfa046 inset;
  outline: none;
}
.lexicon-nav-cat-btn.active,
.lexicon-nav-article-btn.active {
  background: #e8d69a;
  box-shadow: 0 0 0 1px #bfa046 inset;
}
.lexicon-nav-articles {
  margin: 2px 0 6px 28px;
}
.is-admin-only::after {
  content: ' ⚙';
  color: #8f6a17;
}

/* Rechte Spalte: Kopfleiste */
.lexicon-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e0d3a8;
  margin-bottom: 14px;
}
.lexicon-toolbar-spacer {
  flex: 1 1 auto;
}
/* .feld-aufwerten-link setzt margin-left:auto und würde Flex-Reihen auseinanderziehen. */
.lexicon-toolbar .feld-aufwerten-link,
.lexicon-md-toolbar .feld-aufwerten-link,
.lexicon-edit-row .feld-aufwerten-link,
.lexicon-section-card-head .feld-aufwerten-link,
.lexicon-modal-footer .feld-aufwerten-link {
  margin-left: 0;
}
.lexicon-toolbar button[disabled] {
  opacity: 0.4;
  cursor: default;
}
/* .feld-aufwerten-link setzt display und würde das hidden-Attribut aushebeln. */
#lexicon-panel [hidden] {
  display: none !important;
}
.lexicon-adminview {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

/* Rechte Spalte: Inhalt */
.lexicon-body {
  padding-right: 8px;
}
.lexicon-head {
  display: flex;
  align-items: center;
  gap: 16px;
}
/* Die globale Panel-Titelleiste (.panel h3) darf nicht auf Inhaltsüberschriften wirken. */
.panel .lexicon-right h3,
.panel .lexicon-right h4,
.panel .lexicon-right h5,
.panel .lexicon-right h6 {
  display: block;
  width: auto;
  margin-left: 0;
  margin-right: 0;
  padding: 0;
  background: none;
  border-bottom: none;
  border-radius: 0;
}
.panel .lexicon-right .lexicon-title {
  margin: 0 0 8px 0;
  font-size: 1.45em;
}
.panel .lexicon-right .lexicon-subheading {
  margin: 22px 0 8px 0;
  padding-bottom: 4px;
  border-bottom: 1px solid #e0d3a8;
  font-size: 1.15em;
}
.panel .lexicon-right .lexicon-section-heading {
  margin: 0 0 6px 0;
  font-size: 1.1em;
}
.panel .lexicon-right .lexicon-article-body h3,
.panel .lexicon-right .lexicon-article-body h4,
.panel .lexicon-right .lexicon-article-body h5 {
  margin: 14px 0 6px 0;
  font-size: 1.05em;
}
.lexicon-breadcrumb::before {
  content: "\25b8";
  display: inline-block;
  margin-right: 5px;
  color: var(--gold);
  font-weight: 700;
  -webkit-text-stroke: 0.6px #1b2b0c;
  text-shadow: 0 1px 1px #0007;
  text-decoration: none;
}
.lexicon-summary {
  margin: 0 0 14px 0;
  font-style: italic;
  color: #5a4418;
}
.lexicon-subheading {
  margin: 22px 0 8px 0;
  border-bottom: 1px solid #e0d3a8;
  padding-bottom: 4px;
}
.lexicon-section {
  margin-bottom: 18px;
}
.lexicon-article-body p {
  margin: 0 0 10px 0;
  line-height: 1.5;
}
.lexicon-article-body ul,
.lexicon-article-body ol {
  margin: 0 0 10px 22px;
  padding: 0;
  line-height: 1.5;
}
.lexicon-section-admin {
  background: #efe6ff;
  border: 1px solid #b9a3e0;
  border-radius: 10px;
  padding: 10px 14px;
}
.lexicon-admin-badge {
  display: inline-block;
  background: #6a4fa3;
  color: #fff;
  border-radius: 6px;
  font-size: 0.75em;
  padding: 1px 7px;
  margin-bottom: 6px;
}
.lexicon-image {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 6px 0;
}
.lexicon-link,
.lexicon-extlink {
  color: var(--btn-gruen-hell);
  cursor: pointer;
  font-weight: 600;
  text-decoration: underline;
  text-shadow: none;
  border-radius: 3px;
  transition: background 0.15s, box-shadow 0.15s, color 0.15s;
}
.lexicon-link:hover,
.lexicon-link:focus,
.lexicon-extlink:hover,
.lexicon-extlink:focus {
  color: var(--btn-gruen-hell);
  background: #e8d69a;
  box-shadow: 0 0 0 1px #bfa046 inset;
  outline: none;
}
.lexicon-message {
  color: #5a4418;
}
.lexicon-message-error {
  color: #8a2020;
}

/* Listen von Unterthemen und Suchtreffern */
.lexicon-teaser-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.lexicon-teaser {
  padding: 8px 0;
  border-bottom: 1px solid #ece0bd;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
}
.lexicon-teaser-title,
.navigation-link {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--btn-gruen-hell);
  font-family: inherit;
  font-size: 1.05em;
  font-weight: 600;
  padding: 2px 4px;
  border-radius: 6px;
  text-align: left;
  text-decoration: underline;
  text-shadow: none;
  transition: background 0.15s, box-shadow 0.15s, color 0.15s;
}
.lexicon-teaser-title::before,
.navigation-link::before {
  content: "\25b8";
  display: inline-block;
  margin-right: 5px;
  color: var(--gold);
  font-weight: 700;
  text-decoration: none;
  -webkit-text-stroke: 0.6px #1b2b0c;
  text-shadow: 0 1px 1px #0007;
}
.lexicon-teaser-title:hover,
.lexicon-teaser-title:focus,
.navigation-link:hover,
.navigation-link:focus,
.guild-market-sort:hover,
.guild-market-sort:focus {
  color: var(--btn-gruen-hell);
  background: #e8d69a;
  box-shadow: 0 0 0 1px #bfa046 inset;
  outline: none;
}
.lexicon-teaser-category {
  font-size: 0.85em;
  color: #7c5a1a;
}
.lexicon-teaser-summary {
  flex: 1 1 100%;
  color: #5a4418;
}
.lexicon-tags {
  margin-top: 20px;
  padding-top: 10px;
  border-top: 1px solid #e0d3a8;
}
.lexicon-tags-label {
  font-weight: bold;
  margin-right: 4px;
}
.lexicon-tag {
  background: #f0e4bf;
  border: 1px solid #bfa046;
  border-radius: 10px;
  cursor: pointer;
  color: #5a4418;
  font-family: inherit;
  font-size: 0.85em;
  padding: 1px 9px;
}
.lexicon-tag:hover {
  background: #e8d69a;
}
.lexicon-edit-row {
  display: flex;
  gap: 8px;
  flex: 0 0 auto;
}
.lexicon-delete {
  color: #8a2020;
}

/* Admin-Editor (Overlay) */
.lexicon-modal-backdrop {
  position: fixed;
  inset: 0;
  background: #0008;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  z-index: 1200;
  padding: 40px 20px;
}
.lexicon-modal {
  width: min(1100px, 100%);
  background: #f8f5e6;
  border-radius: 14px;
  box-shadow: 0 8px 32px #0006;
  padding: 20px 26px 24px 26px;
}
.lexicon-modal-title {
  margin: 0 0 14px 0;
}
.lexicon-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 18px;
  margin-bottom: 18px;
}
.lexicon-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.lexicon-field-label {
  font-weight: bold;
  font-size: 0.9em;
}
.lexicon-select {
  border: 1px solid #bfa046;
  border-radius: 8px;
  padding: 7px 8px;
  background: #fffbe8;
  color: #2a1a0a;
  font-family: inherit;
}
.lexicon-section-card {
  border: 1px solid #dcc98d;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 14px;
  background: #fffdf2;
}
.lexicon-section-card-head {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}
.lexicon-section-card-head .chronicle-search-input {
  flex: 1 1 auto;
}
.lexicon-md-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
}
.lexicon-md-btn {
  min-width: 30px;
  padding: 2px 8px;
}
.lexicon-md-linkselect {
  padding: 2px 6px;
  font-size: 0.9em;
}
.lexicon-section-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.lexicon-textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #bfa046;
  border-radius: 8px;
  padding: 8px 10px;
  background: #fffbe8;
  color: #2a1a0a;
  font-family: inherit;
  line-height: 1.4;
  resize: vertical;
}
.lexicon-preview {
  border: 1px dashed #cbb46a;
  border-radius: 8px;
  padding: 8px 10px;
  overflow-y: auto;
  max-height: 320px;
  line-height: 1.45;
}
.lexicon-preview p {
  margin: 0 0 8px 0;
}
.lexicon-modal-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid #e0d3a8;
}
.lexicon-modal-status {
  flex: 1 1 auto;
  color: #8a2020;
}
.lexicon-sync-group {
  margin-bottom: 14px;
}
.lexicon-sync-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.lexicon-sync-list li {
  padding: 3px 0;
  border-bottom: 1px solid #ece0bd;
}
.lexicon-sync-detail {
  color: #5a4418;
  font-size: 0.9em;
}
.lexicon-sync-orphan {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

/* ===== Chat ===== */
#chat-container {
  display: flex;
  justify-content: center;
}
#chat-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-sizing: border-box;
}
.chat-content {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  grid-template-rows: minmax(0, 1fr);
  gap: 0 16px;
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
}
.chat-content::before {
  content: '';
  position: absolute;
  right: 360px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(180deg, #a88a4a 0%, #7c5a1a 100%);
  box-shadow: 0 0 0 3px #bfa04622 inset;
  border-radius: 1px;
  pointer-events: none;
}
.chat-left {
  display: flex;
  flex-direction: column;
  padding-right: 16px;
  min-height: 0;
  min-width: 0;
  gap: 12px;
}
.chat-messages {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 4px 6px;
  scrollbar-color: #bfa046 #2a1a0a;
  scrollbar-width: auto;
  font-family: 'MedievalSharp', 'UnifrakturCook', cursive;
  color: #2a1a0a;
  line-height: 1.4;
}
.chat-messages::-webkit-scrollbar {
  width: 15px;
  height: 15px;
}
.chat-messages::-webkit-scrollbar-track {
  background: #2a1a0a;
  border-radius: 8px;
}
.chat-messages::-webkit-scrollbar-thumb {
  background-color: #bfa046;
  border-radius: 8px;
  border: 3px solid #2a1a0a;
}
.chat-messages::-webkit-scrollbar-thumb:hover {
  background-color: #c6a543;
}
.chat-messages::-webkit-scrollbar-button {
  background-color: #bfa046;
  height: 15px;
}
.chat-messages::-webkit-scrollbar-corner {
  background: #2a1a0a;
}
.chat-msg {
  margin: 2px 0;
  word-break: break-word;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.chat-msg-portrait {
  flex: 0 0 auto;
  width: calc(1.4em * 3 * 4 / 5);
  height: calc(1.4em * 3);
  aspect-ratio: 4 / 5;
  border-radius: 6px;
  overflow: hidden;
  background: #2a1a0a22;
  border: 1px solid #bfa04688;
  box-sizing: border-box;
}
.chat-msg-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.chat-msg-body {
  flex: 1 1 auto;
  min-width: 0;
  align-self: center;
}
.chat-msg-meta {
  font-weight: bold;
}
.chat-msg-self .chat-msg-meta {
  color: #5a3a0a;
}
.chat-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 8px;
  flex-shrink: 0;
}
.chat-input-label {
  font-weight: bold;
  white-space: nowrap;
}
.chat-input {
  flex: 1 1 auto;
  min-width: 0;
  box-sizing: border-box;
  border: 1px solid #bfa046;
  border-radius: 8px;
  padding: 8px 10px;
  background: #fffbe8;
  color: #2a1a0a;
  font-family: 'MedievalSharp', 'UnifrakturCook', cursive;
  outline: none;
}
.chat-input:focus {
  border-color: #bfa046;
  box-shadow: 0 0 0 2px #bfa04644;
}
.chat-counter {
  min-width: 64px;
  text-align: right;
  font-variant-numeric: lining-nums tabular-nums;
  color: #5a3a0a;
}
.chat-counter.chat-counter-warn {
  color: #a33;
  font-weight: bold;
}
.chat-right {
  padding-left: 16px;
  min-height: 0;
  overflow: auto;
}
.chat-channel-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.chat-channel-list li {
  margin: 0;
  padding: 0;
}
.chat-channel-spacer {
  height: 18px;
}
.chat-channel-btn {
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  padding: 4px 6px;
  font-family: 'MedievalSharp', 'UnifrakturCook', cursive;
  font-weight: bold;
  color: #2a1a0a;
  cursor: pointer;
  border-radius: 6px;
}
.chat-channel-btn:hover:not(:disabled) {
  background: #bfa04633;
}
.chat-channel-btn.active {
  background: #bfa04655;
  text-decoration: underline;
}
.chat-channel-btn.chat-channel-disabled,
.chat-channel-btn:disabled {
  color: #8a7a5a;
  cursor: not-allowed;
  font-style: italic;
}

#nation-container {
  display: flex;
  justify-content: center;
}
#nation-panel {
  width: 100%;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}
.nation-scroll { flex: 1 1 auto; min-height: 0; min-width: 0; overflow: auto; }
#nation-status:empty { display: none; }
.nation-section { display: flex; flex-direction: column; gap: 12px; padding: 0 0 20px; }
#nation-banner-section[hidden] { display: none; }
.nation-form-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.nation-form-row input, .nation-form-row select { width: 240px; max-width: 100%; }
.nation-form-row .player-picker { width: 240px; }
#nation-panel .feld-aufwerten-link { margin: 0; }
#nation-members .nation-list-row { justify-content: flex-start; gap: 8px; }
.nation-description-actions { display: flex; justify-content: center; }
.nation-description-editor { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.nation-description-editor > h4 { margin: 0; }
#nation-panel :is(.nation-description-body, #nation-description-preview) :is(h3, h4, h5) {
  width: auto;
  margin: 14px 0 6px;
  padding: 0;
  background: none;
  border: none;
  border-radius: 0;
  font-size: 1.05em;
  letter-spacing: normal;
}
.nation-description-body > :first-child { margin-top: 0; }
.nation-description-body > :last-child { margin-bottom: 0; }
.nation-description-body img { max-width: 100%; max-height: 1920px; width: auto; height: auto; }
.nation-costs { display: inline-flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.nation-costs img { width: 20px; height: 20px; object-fit: contain; }
.nation-information { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 10px 16px; margin: 0; }
.nation-information dd { margin: 0; overflow-wrap: anywhere; }
.nation-description { white-space: pre-wrap; overflow-wrap: anywhere; }
.nation-list-row { min-height: 40px; display: flex; align-items: center; justify-content: space-between; gap: 12px; box-sizing: border-box; border-bottom: 1px solid #a88a4a55; }
.nation-list-row > div { min-width: 0; }
.nation-list-row > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.nation-list-actions { display: inline-flex; gap: 6px; flex-shrink: 0; }
.nation-dialog-actions { display: flex; justify-content: center; margin-top: 12px; }
.nation-dialog .nation-input, #nation-panel textarea { width: 100%; box-sizing: border-box; }
textarea.nation-input { height: auto; padding: 6px; }
.nation-scroll, .nation-list, .nation-dialog, .nation-dialog textarea, #nation-panel textarea {
  scrollbar-color: #f8f5e6 #2a1a0a;
  scrollbar-width: thin;
}
.nation-scroll::-webkit-scrollbar, .nation-list::-webkit-scrollbar, .nation-dialog::-webkit-scrollbar,
.nation-dialog textarea::-webkit-scrollbar, #nation-panel textarea::-webkit-scrollbar { width: 12px; height: 12px; }
.nation-scroll::-webkit-scrollbar-track, .nation-list::-webkit-scrollbar-track, .nation-dialog::-webkit-scrollbar-track,
.nation-dialog textarea::-webkit-scrollbar-track, #nation-panel textarea::-webkit-scrollbar-track { background: #2a1a0a; }
.nation-scroll::-webkit-scrollbar-thumb, .nation-list::-webkit-scrollbar-thumb, .nation-dialog::-webkit-scrollbar-thumb,
.nation-dialog textarea::-webkit-scrollbar-thumb, #nation-panel textarea::-webkit-scrollbar-thumb { background: #f8f5e6; border: 2px solid #2a1a0a; border-radius: 6px; }
.nation-scroll::-webkit-scrollbar-thumb:hover, .nation-list::-webkit-scrollbar-thumb:hover,
.nation-dialog::-webkit-scrollbar-thumb:hover, .nation-dialog textarea::-webkit-scrollbar-thumb:hover,
#nation-panel textarea::-webkit-scrollbar-thumb:hover { background: #fff0d0; }
.nation-scroll::-webkit-scrollbar-button, .nation-list::-webkit-scrollbar-button, .nation-dialog::-webkit-scrollbar-button,
.nation-dialog textarea::-webkit-scrollbar-button, #nation-panel textarea::-webkit-scrollbar-button { background: #f8f5e6; height: 12px; }
.nation-scroll::-webkit-scrollbar-corner, .nation-list::-webkit-scrollbar-corner, .nation-dialog::-webkit-scrollbar-corner,
.nation-dialog textarea::-webkit-scrollbar-corner, #nation-panel textarea::-webkit-scrollbar-corner { background: #2a1a0a; }
@media (max-width: 600px) {
  #nation-panel { width: calc(100vw - 16px); padding: 12px; }
  .nation-information { grid-template-columns: 1fr; gap: 4px; }
  .nation-list-row { flex-wrap: wrap; }
}

#profile-panel {
  width: 100%;
  max-width: 100%;
  display: flex;
  flex-direction: column;
}

.profile-scroll-content {
  display: flex;
  flex-direction: column;
  gap: 32px;
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

.profile-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex-shrink: 0;
}

.profile-images {
  display: flex;
  flex-wrap: wrap;
  gap: 24px 48px;
  align-items: flex-start;
}

.portrait-config {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  min-width: 0;
}

.portrait-input-column {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: stretch;
  width: 210px;
  max-width: calc(100vw - 180px);
}
.portrait-input-column .feld-aufwerten-link {
  align-self: stretch;
  margin-left: 0;
  text-align: center;
}

.portrait-url-input {
  flex: 1 1 auto;
  border: 1px solid #bfa046;
  border-radius: 6px;
  padding: 6px 8px;
  background: #fffbe8;
  color: #2a1a0a;
  font-size: 0.9em;
  box-shadow: inset 0 1px 2px #bfa04633;
}
.portrait-file-input {
  display: none;
}
.portrait-upload-status {
  min-height: 1.2em;
  margin: 0;
  color: var(--btn-gruen-hell);
  font-size: 0.82em;
}
.portrait-upload-status.is-error {
  color: var(--fehler-rot);
}

.portrait-controls {
  display: flex;
  flex-direction: row;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.portrait-zoom {
  flex: 1 1 auto;
}

.portrait-hint {
  margin: 0;
  font-size: 1em;
  line-height: 1.5;
  color: #2a1a0a;
}

.profile-label {
  font-weight: 600;
  font-size: 0.9em;
  color: #2a1a0a;
}

.portrait-frame {
  width: 120px;
  height: 150px;
  border: 2px solid #bfa046;
  border-radius: 8px;
  position: relative;
  overflow: hidden;
  background: #f8f1d1;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}
@media (max-width: 480px) {
  .profile-images { gap: 24px; }
  .portrait-config { gap: 12px; }
  .portrait-input-column { width: 180px; max-width: calc(100vw - 176px); }
}
.small-equip-popup.profile-image-dialog {
  position: fixed;
  inset: 0;
  margin: auto;
  box-sizing: border-box;
  width: min(540px, calc(100vw - 24px));
  height: auto;
  max-height: calc(100vh - 32px);
  padding: 14px 18px 18px;
}
.small-equip-popup.profile-image-dialog:not([open]) { display: none; }
.profile-image-dialog::backdrop { background: rgba(0, 0, 0, .65); }
.small-equip-popup.profile-image-dialog .equip-popup-header { margin: 0 24px 14px; }
.profile-image-dialog [hidden] { display: none; }
.profile-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 12px; max-height: 60vh; overflow-y: auto; }
.profile-gallery button { padding: 6px; border: 2px solid #bfa046; border-radius: 6px; background: #f8f1d1; text-align: center; cursor: pointer; }
.profile-gallery button[aria-pressed="true"] { border-color: #356b30; box-shadow: 0 0 0 2px #356b30; }
.profile-gallery img { display: block; width: 100%; height: 110px; object-fit: contain; }
.profile-gallery span { display: block; overflow-wrap: anywhere; }
.profile-image-stage { height: min(540px, 60vh); position: relative; overflow: hidden; background: #e4d9ad; touch-action: none; }
.profile-image-stage img { position: absolute; top: 50%; left: 50%; max-width: none; user-select: none; cursor: grab; touch-action: none; }
.profile-image-stage img.portrait-dragging { cursor: grabbing; }
.profile-image-guide { position: absolute; width: 124px; height: 154px; box-sizing: border-box; border: 2px solid #bfa046; border-radius: 8px; top: 50%; left: 50%; transform: translate(-50%, -50%); box-shadow: 0 0 0 500px rgba(0, 0, 0, .48); pointer-events: none; }
.profile-image-zoom, .profile-image-actions { display: flex; gap: 10px; align-items: center; margin-top: 12px; }
.profile-image-zoom input { flex: 1; min-width: 0; }
.profile-image-actions { justify-content: center; }
.small-equip-popup.profile-image-dialog .profile-image-actions .feld-aufwerten-link { margin: 0; }
.profile-image-message { color: var(--fehler-rot); min-height: 1.2em; }

.portrait-preview {
  max-width: none;
  max-height: none;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(1);
  cursor: grab;
  user-select: none;
}

.portrait-dragging {
  cursor: grabbing;
}

.portrait-empty {
  font-size: 0.9em;
  color: #2a1a0a99;
  text-align: center;
  padding: 0 12px;
}

.profile-placeholder {
  margin: 0;
  color: #2a1a0aaa;
  font-style: italic;
}

.account-delete-section {
  border-top: 1px solid rgba(191, 160, 70, 0.2);
  padding-top: 18px;
}

.account-delete-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 20px;
  border-radius: 10px;
  border: 1px solid #a23636;
  background: linear-gradient(180deg, #3c1717 0%, #281010 100%);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  color: #ffe9df;
}

.account-delete-card .profile-label {
  color: #ffdcdc;
}

.account-delete-warning {
  margin: 0;
  font-size: 0.92em;
  line-height: 1.5;
  color: #ffe9df;
}

.account-delete-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.account-delete-name {
  font-weight: 600;
}

.account-delete-input {
  border: 1px solid #a23636;
  border-radius: 6px;
  padding: 8px 10px;
  background: #1b0909;
  color: #ffe9df;
  font-size: 0.95em;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.45);
}

.account-delete-input::placeholder {
  color: rgba(255, 233, 223, 0.6);
}

.account-delete-input:focus {
  outline: 2px solid #d45a5a;
  outline-offset: 1px;
}

.account-delete-input.is-invalid {
  border-color: #e16f6f;
  box-shadow: inset 0 0 0 1px rgba(225, 111, 111, 0.4);
}

.account-delete-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 6px;
}

.account-delete-submit:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.account-delete-cancel {
  background: none;
  border: none;
  padding: 0;
  color: #ffdcdc;
  text-decoration: underline;
  font-family: 'MedievalSharp', 'UnifrakturCook', cursive;
  font-size: 0.9em;
  cursor: pointer;
  transition: color 0.2s ease;
}

.account-delete-cancel:hover,
.account-delete-cancel:focus-visible {
  color: #ffe9df;
}

.account-delete-cancel:focus-visible {
  outline: 2px solid #ffdcdc;
  outline-offset: 2px;
}

.account-delete-status {
  min-height: 20px;
  font-size: 0.9em;
  color: #ffdcdc;
}

.account-delete-status.success {
  color: #8ae1a8;
}

.account-delete-status.error {
  color: #ffb5b5;
}

/* RP-Beschreibung: Bilder responsiv begrenzen */
.rp-desc-view img,
.rp-editable img {
  max-width: 100%;
  height: auto;
}
.description-editor {
  display: grid;
  gap: 8px;
  min-width: 0;
}
.description-editor .lexicon-textarea {
  width: 100%;
  box-sizing: border-box;
}
.description-editor .forum-preview {
  max-height: 320px;
  overflow: auto;
}
.description-editor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
/* ===== Legenden-Ansicht ===== */
.legends-row {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: var(--view-panel-gap);
  align-items: start;
  justify-content: center;
  max-width: var(--view-max-width);
  margin: var(--view-top-gap) auto 0;
}
.panel-legend {
  background: #c3a86c; /* Angleichen an restliche Panel-Farbwelt falls nÃƒÂ¶tig */
  background: linear-gradient(180deg, #d2b778 0%, #b79145 95%);
  border-radius: 12px;
  box-shadow: 0 2px 6px #0006;
  padding: 10px 14px 12px 14px; /* kein zusÃƒÂ¤tzlicher Abstand nach unten */
  box-sizing: border-box;
  position: relative;
  display: flex;
  flex-direction: column;
  height: var(--view-panel-min-height);
  min-height: 0;
  overflow: hidden;
}
.panel-legend h3 {
  /* an Panel-Titel-Stil angleichen: leicht nach oben ziehen fÃƒÂ¼r ÃƒÂ¤hnlichen Abstand wie Umgebung */
  margin: -6px 0 6px 0;
  font-size: 0.95em;
  letter-spacing: 0.5px;
  color: #2a1a0a;
  font-weight: 600;
  background: none;
  box-shadow: none;
  padding: 0 0 0 2px;
}
.legend-list {
  flex: 1 1 auto;
  overflow: auto;
  min-height: 0;
  padding-right: 4px; /* Platz fÃƒÂ¼r Scrollbar visuell ausgleichen */
  font-size: 0.82em;
  color: #2a1a0a;
  /* Unsichtbare Tabelle / Struktur: Hintergrund transparent, keine Innen-Schatten */
  background: transparent;
  border-radius: 0;
  box-shadow: none;
}
.legend-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 2px 4px 2px 6px; /* dezenter, sehr flach */
  line-height: 1.15em;
  border-bottom: 1px solid rgba(191,160,70,0.25); /* leichte Linie fÃƒÂ¼rs Auge */
  white-space: nowrap;
  background: transparent; /* keine Zellenoptik */
}
.legend-row:last-child { border-bottom: none; }
.legend-row.is-self .name { font-weight: 700; color: #225522; text-decoration: underline; }
.legend-row .rank { width: 2.5em; text-align: right; font-weight: 600; }
.legend-row .value { margin-left: auto; font-weight: 600; }
.legend-footer {
  flex-shrink: 0;
  margin: 0 -18px -14px;
  padding: 4px 10px 4px 10px; /* kompakter, damit kein zusÃƒÂ¤tzlicher Bedarf am Panel-Ende entsteht */
  display: flex;
  justify-content: center;
  background-color: var(--pergament);
  background-image: var(--textur-pergament);
  background-size: var(--textur-kachel);
  background-repeat: repeat;
  border-top: 2px solid var(--holz-dunkel);
  border-radius: 0 0 12px 12px;
}
.legend-footer .feld-aufwerten-link { margin-left: 0 !important; }
.panel-legend .legend-generated {
  flex-shrink: 0;
  font-size: 0.65em;
  color: #2a1a0a;
  opacity: 0.7;
  margin: 0;
  pointer-events: none; /* rein informativ */
}
/* Container ohne unteren Abstand, um Scroll durch AuÃƒÅ¸enabstÃƒÂ¤nde zu vermeiden */
#legends-container { margin-bottom: 0; padding-bottom: 0; overflow-y: hidden; }
/* Scrollbar-Stil fÃƒÂ¼r Legendenlisten analog Kampfbericht */
.legend-list {
  scrollbar-color: #bfa046 #2a1a0a;
  scrollbar-width: auto;
}
.legend-list::-webkit-scrollbar { width: 15px; height: 15px; }
.legend-list::-webkit-scrollbar-track { background: #2a1a0a; border-radius: 8px; }
.legend-list::-webkit-scrollbar-thumb { background-color: #bfa046; border-radius: 8px; border: 3px solid #2a1a0a; }
.legend-list::-webkit-scrollbar-thumb:hover { background-color: #c6a543; }
.legend-list::-webkit-scrollbar-button { background-color: #bfa046; height: 15px; }
.legend-list::-webkit-scrollbar-corner { background: #2a1a0a; }
/* RP-Editor: Scrollbar-Farben (Daumen/Track/Buttons) */
.rp-editable {
  /* Firefox */
  scrollbar-color: #f8f5e6 #2a1a0a; /* thumb track */
  scrollbar-width: thin;
}
.rp-editable::-webkit-scrollbar { width: 12px; height: 12px; }
.rp-editable::-webkit-scrollbar-track { background: #2a1a0a; }
.rp-editable::-webkit-scrollbar-thumb { background-color: #f8f5e6; border-radius: 6px; border: 2px solid #2a1a0a; }
/* Up/Down Buttons (sofern vorhanden) */
.rp-editable::-webkit-scrollbar-button {
  background: #f8f5e6;
  height: 12px;
}

/* RP-Editor Toolbar */
.rp-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  margin-bottom: 8px;
  white-space: nowrap;
}
.rp-toolbar .feld-aufwerten-link {
  margin: 0;
  padding: 2px 6px;
  line-height: 1.1;
  font-size: 0.9em;
}
.rp-toolbar .rp-count {
  margin-left: auto;
  min-width: 72px; /* Fixe Breite verhindert Layout-Sprung (z.B. 000/500 bis 500/500) */
  text-align: right;
  opacity: 0.8;
  font-variant-numeric: lining-nums tabular-nums;
  font-feature-settings: 'tnum' 1;
}
.uebersicht-btn-row {
  display: flex;
  flex-direction: row;
  gap: 2em;
  margin-bottom: 7px;
  margin-top: 0; /* Direkt unter die Navigationsleiste */
  justify-content: center;
}
.pr-itm, .cost-itm, .cost-gs {
  display: inline-flex;
  align-items: center;       /* Icon und Zahl vertikal mittig */
  gap: 4px;
  line-height: 1;            /* Baseline-Drift minimieren */
  margin-right: 0;
}
.pr-itm:last-child, .cost-itm:last-child, .cost-gs:last-child { margin-right: 0; }
.pr-itm img, .cost-itm img {
  width: 16px;
  height: 16px;
  vertical-align: middle;    /* falls inline gerendert wird */
  transform: translateY(-2px); /* Feintuning fÃƒÂ¼r Baseline-Ausrichtung */
}
.building-view-layout #b-lager-list img {
  width: 16px;
  height: 16px;
  vertical-align: middle;
  transform: translateY(-2px);
}
.building-view-layout #b-lager-list > div {
  display: flex;            /* Blockzeile mit vertikaler Zentrierung */
  align-items: center;      /* Icon und Text auf gleiche HÃƒÂ¶he */
  line-height: 1.2;         /* wie Inventar-Zeilen */
  font-weight: normal;      /* Zahlen nicht fett */
  color: #2a1a0a;           /* gleiche Farbe wie im Panel-Inventar */
}
.prod-label {
  margin-right: 6px;
}
.ausbauten-tabelle .ausbauten-kosten {
  white-space: nowrap;
}
.building-admin .prod-summary {
  white-space: nowrap;
}
.building-admin .prod-summary { margin-bottom: 2px; }
.building-admin .prod-recipe { white-space: nowrap; }
.building-admin .prod-summary .prod-cap-note { color:#2a1a0a; font-style: normal; margin-left: 2px; }
/* VorrÃƒÂ¤te-Zeile nÃƒÂ¤her an Produktion rÃƒÂ¼cken */
.building-admin .vorrat-row { margin-top: 2px !important; align-items: center; }
.uebersicht-btn {
  background: linear-gradient(145deg, #bfa046 0%, #7c5a1a 100%);
  color: #2a1a0a;
  border: 2px solid #bfa046;
  border-radius: 10px 10px 14px 14px/14px 14px 10px 10px;
  padding: 0.08em 1.1em;
  font-size: 0.91em;
  font-family: 'MedievalSharp', 'UnifrakturCook', cursive;
  letter-spacing: 1px;
  box-shadow: 0 1px 4px #0006 inset, 0 1px 4px #bfa04633;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
  text-shadow: 0 1px 2px #0006;
  margin-bottom: 0px;
  min-height: 22px;
  min-width: 120px;
  max-width: 120px;
  text-align: center;
  white-space: nowrap;
}
.uebersicht-btn.active, .uebersicht-btn:focus {
  background: linear-gradient(145deg, #ffe08a 0%, #bfa046 100%);
  color: #7c5a1a;
  box-shadow: 0 4px 16px #bfa04688, 0 2px 8px #0008 inset;
}
.panel-uebersicht {
  box-sizing: border-box;
  width: 100%;
  height: var(--view-panel-min-height);
  min-height: var(--view-panel-min-height);
  overflow: hidden;
  background: #f8f5e6;
  border-radius: 18px;
  box-shadow: 0 4px 24px #bfa04622, 0 1px 2px #0002;
  padding: 8px 32px 32px 32px; /* Weniger padding oben, damit das Panel nach oben wÃƒÂ¤chst */
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  margin-left: auto;
  margin-right: auto;
}
.panel-uebersicht > h2,
.panel-legend > h3 {
  flex-shrink: 0;
}
#uebersicht-panel-content {
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}
.bar-label {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.68em;
  color: #222c;
  font-weight: 500;
  pointer-events: none;
  text-shadow: 0 1px 2px #fff4;
  z-index: 2;
}
.bar {
  position: relative;
}
/* ===== Gruppe-Panel: Gruppenmitglieder ===== */
.group-member {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  margin-bottom: 0px;
  padding: 1px 0 1px 0;
  font-family: 'MedievalSharp', 'UnifrakturCook', cursive;
  font-size: 1.08em;
}
/* Titelzeile je Held: Name + Linie rechts (wie battle-section-title) */
.group-member-title {
  margin: 6px 0 4px 0;
  font-size: 0.9em;
  color: #2a1a0a;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}
.group-member-title::after {
  content: '';
  display: block;
  height: 1px;
  background: #2a1a0a;
  flex: 1 1 auto;
  margin-right: 8px;
  opacity: 0.9;
}
.group-member-name-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.group-member-name-button:hover,
.group-member-name-button:focus {
  color: #225522;
  text-decoration: underline;
}
/* Separator-Zeile in Charakter-ÃƒÅ“bersicht zwischen Gruppen- und GebÃƒÂ¤ude-Charakteren */
tr.charakter-separator td { padding: 4px 6px 2px 6px; }
.group-row.top {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
}
.group-stance { margin-left: 0; }
.group-row.top .group-stance select.haltung-dropdown { margin-left: 0; }
.group-aa-wrap { display: flex; flex-direction: column; gap: 4px; margin: 0 8px; align-items: flex-start; }
.group-aa-wrap .aa-row { display: flex; flex-direction: row; align-items: center; gap: 6px; line-height: 1; }
.group-aa-wrap .aa-icon { font-size: 0.8em; }
.group-aa-wrap .aa-val { font-size: 0.8em; color: #2a1a0a; min-width: 18px; text-align: right; }
.group-row.inventory-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  padding-left: 0;
}
.inventory-name-spacer { display:none; }
.group-row.inventory-row select.haltung-dropdown {
  min-width: 190px; /* ~10% schmaler als vorher (170px) */
  width: 190px;
}
/* Item- und Ziel-Dropdowns angleichen */
.inventory-row .inventory-dropdown { width:180px; }
.inventory-row .inventory-target-dropdown { width:150px; }
.inventory-row .inventory-qty-input {
  width: 70px;
  height: 16px;
  text-align: center;
}
.inventory-equip-btn, .inventory-ok-btn {
  /* Gruene Mockup-Button-Optik (kompakt) fuer Ausruestung/benutzen */
  font-size: 0.82em !important;
  background: var(--btn-verlauf);
  border: 1px solid var(--btn-rand);
  border-radius: 8px;
  padding: 2px 9px;
  margin-left: 4px;
  height: auto;
  min-height: 0;
  cursor: pointer;
  color: var(--btn-text);
  font-family: var(--font-titel);
  font-weight: 500;
  letter-spacing: 0.2px;
  line-height: 1.2;
  text-decoration: none;
  box-shadow: var(--btn-schatten);
  text-shadow: 0 1px 1px #0009;
  transition: background 0.12s, box-shadow 0.12s;
}
.inventory-equip-btn:hover, .inventory-equip-btn:focus,
.inventory-ok-btn:hover, .inventory-ok-btn:focus { background: var(--btn-verlauf-hover); }

/* ===== Begegnungen-Panel ===== */
#begegnungen-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.begegnung-row {
  display: grid;
  grid-template-columns: 46px 1fr;
  column-gap: 8px;
  align-items: center;
}

.begegnung-icon-wrap {
  width: 46px;
  height: 46px;
  margin-left: -6px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.begegnung-icon-img {
  width: 46px;
  height: 46px;
  object-fit: contain;
}

.begegnung-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.begegnung-name {
  color: #2a1a0a;
  font-size: 0.98em;
  font-weight: 600;
  line-height: 1.2;
  word-break: break-word;
}

.begegnung-interact-btn {
  margin-left: 0 !important;
  font-size: 0.9em;
  line-height: 1.2;
  align-self: flex-start;
  text-align: left;
}

.begegnung-interact-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  color: #2a1a0a;
}

.begegnung-interact-btn.army-interact-btn { margin-left: 0 !important; }

.begegnung-separator {
  border-top: 1px solid #2a1a0a;
  opacity: 0.7;
  margin: 2px 0;
}

.begegnung-empty {
  color: #2a1a0a99;
  font-size: 0.88em;
}

/* ===== Spieler-Interaktionen (Ansehen / Handeln) ===== */
.small-equip-popup.interaction-menu-popup { width: 260px; height: auto; max-height: none; overflow: visible; }
.interaction-menu-popup .equip-popup-header { font-size: 1.2em; }
.interaction-menu-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin-top: 6px; }
/* Menueoeffner linksbuendig anordnen. */
.interaction-menu-popup .interaction-menu-actions .feld-aufwerten-link {
  margin-left: 0 !important;
  margin-top: 0;
  text-align: left;
}

.army-interaction-overlay { background: transparent; padding: 0 !important; }
.small-equip-popup.army-interaction-popup {
  width: min(300px, calc(100vw - 16px));
  box-sizing: border-box;
  max-height: calc(100vh - 16px);
  overflow-y: auto;
}
.army-interaction-popup .army-content { flex: 0 0 auto; }
.army-interaction-popup .barracks-name { margin: 0; padding-left: 4px; }
.army-interaction-popup .barracks-name label { flex: 0 1 auto; min-width: 0; }
.army-interaction-popup .barracks-name input { max-width: 140px; }
.army-interaction-popup .barracks-name-save[hidden] { display: none; }
.army-interaction-popup .panel-bottom-actions { display: block; margin-top: 8px; padding: 0; border: 0; }
.army-interaction-popup .interaction-menu-actions { margin-top: 0; }
.army-menu-action { display: flex; align-items: baseline; gap: 4px; flex-wrap: wrap; }
.army-menu-action span { white-space: normal; }
.army-interaction-popup .army-behavior { width: 100%; padding-left: 4px; box-sizing: border-box; }
.army-interaction-popup .army-behavior label { display: flex; align-items: center; gap: 6px; }
.army-interaction-popup .army-behavior select { min-width: 0; }
.army-menu-danger { display: flex; justify-content: flex-end; margin-top: 8px; }
.small-equip-popup.barracks-popup.army-view-popup { width: min(calc(36px + 222px * var(--army-table-count, 1)), calc(100vw - 32px)); height: auto; max-height: calc(100vh - 112px); box-sizing: border-box; }
/* Tabellenkopf + 20 Einheitenzeilen + Tabellenrand. */
.army-view-popup .army-content { max-height: calc(60px + 20 * 32px + 1px); overflow: auto; scrollbar-gutter: stable both-edges; min-height: 0; }
.army-view-popup .barracks-footer { display: none; }
.army-view-grid { display: grid; grid-template-columns: repeat(var(--army-table-count, 1), 210px); gap: 12px; align-items: start; justify-content: safe center; }
.army-view-type { width: 100%; border-collapse: collapse; }
.army-view-type th, .army-view-type td { border: 1px solid var(--holz-dunkel); padding: 5px; }
.army-view-type thead { height: 60px; }
.army-view-unit { height: 32px; }
.army-view-heading { display: flex; align-items: center; justify-content: center; gap: 8px; }
.army-view-heading img { width: 48px; height: 48px; object-fit: contain; }
.army-view-unit td:first-child { text-align: right; white-space: nowrap; }
.army-view-unit td:last-child { width: 90px; }
.army-view-unit .hp-bar { width: 80px; margin: 0 auto; }
.army-view-unit .hp-bar[data-health="high"] .bar-inner { background: #246b39; }
.army-view-unit .hp-bar[data-health="medium"] .bar-inner { background: #877000; }
.army-view-unit .hp-bar[data-health="low"] .bar-inner { background: #b45309; }
.army-view-unit .hp-bar[data-health="critical"] .bar-inner { background: var(--hp-rot); }

.interact-group-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 10px;
  padding: 6px 2px;
}
.interact-group-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: none;
  border: none;
  padding: 6px;
  text-align: center;
}
.interact-group-portrait { width: 56px; height: 56px; display: flex; align-items: center; justify-content: center; }
.interact-group-portrait img { width: 100%; height: 100%; object-fit: contain; }
.interact-group-namerow { display: flex; align-items: center; justify-content: center; gap: 4px; }
.interact-group-name { font-weight: bold; font-size: 0.85em; }
.interact-group-hp { width: 80px; height: 14px; font-size: 0.75em; }
.interact-group-mana { width: 80px; height: 14px; font-size: 0.75em; }
.interact-view-popup .equip-popup-header { padding-right: 26px; }
.inn-recovery-popup .bar-inner { transition: width 900ms ease-out; }
.inn-recovery-gains { display: flex; justify-content: center; gap: 6px; font-weight: bold; }
.inn-hp-gain { color: var(--hp-rot); }
.inn-mana-gain { color: var(--mana-blau); }
.inn-recovery-error { color: var(--fehler-rot); }
.inn-recovery-error:empty { display: none; }
.inn-recovery-popup .inn-recovery-footer { width: auto; margin: 12px -14px -14px; padding: 6px 14px; }
.inn-repeat-cost { white-space: nowrap; }
@media (prefers-reduced-motion: reduce) {
  .inn-recovery-popup .bar-inner { transition: none; }
}

.interact-trade-popup .interact-trade-tabs { display: flex; justify-content: center; gap: 8px; margin-bottom: 8px; }
.interact-trade-popup .interact-trade-tabs .interact-tab { margin-left: 0 !important; }
.interact-trade-popup .interact-tab.active { background: var(--btn-verlauf-hover); }
.interact-trade-scroll { flex: 1 1 auto; overflow: auto; padding: 0 6px; }
.interact-section-title { font-weight: 600; margin: 8px 0 4px; }
.interact-coins-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 4px 0 10px; }
.interact-trade-table { margin-bottom: 4px; }
.interact-res-all { margin-left: 0 !important; }
.interact-item-picker { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.interact-item-picker .interact-item-char,
.interact-item-picker .interact-item-qty,
.interact-item-picker .interact-item-add,
.interact-item-picker .icon-select-trigger {
  height: 24px;
  box-sizing: border-box;
  line-height: 1;
}
.interact-item-picker .interact-item-add { padding: 0 10px; margin-left: 0; }
.interact-item-list { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; }
.interact-item-line { display: flex; align-items: center; gap: 8px; font-size: 0.9em; }
.interact-item-remove { background: none; border: none; color: #a00; cursor: pointer; font-weight: bold; }
.interact-secure-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.interact-pending-box { margin-top: 10px; padding: 8px; border: 1px solid #bfa04655; border-radius: 8px; background: #2a1a0a14; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.interact-incoming-offer { z-index: 10001; }

/* Handel-Popup: eigener Scrollbereich + flacher Footer (kein sticky-Overlay) */
.storage-popup.market-popup-wide.interact-trade-popup { max-height: 84vh; display: flex; flex-direction: column; overflow: hidden; }
.storage-popup.market-popup-wide.interact-trade-popup .storage-actions {
  position: static;
  flex: 0 0 auto;
  background-color: var(--pergament-hell);
  background-image: var(--textur-pergament-hell);
  background-size: var(--textur-kachel);
  background-repeat: repeat;
  border-top: 1px solid #2a1a0a66;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px 6px;
}
.interact-trade-popup .storage-actions #it-msg { min-height: 18px; }
.interact-footer-buttons { display: flex; justify-content: center; gap: 12px; }
.interact-footer-buttons .feld-aufwerten-link { margin-left: 0 !important; margin-top: 0; }

.group-member:last-child {
  border-bottom: none;
}
.group-member-name {
  flex: 0 0 110px;
  max-width: 110px;
  min-width: 110px;
  font-weight: bold;
  color: #2a1a0a;
  letter-spacing: 1px;
  line-height: 1.05;
  font-size: 0.95em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
}
.group-member-name.small { font-size: 0.7em; }
.group-bars {
  /* Entfernt flex-grow, damit Haltung direkt anschlieÃƒÅ¸en kann */
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0px;
  min-width: 0;
  max-width: none;
}
/* Schlankere Balken im Gruppen-Panel analog Schlachtfeld (80px Breite) */
.group-panel-content .group-bars .hp-bar,
.group-panel-content .group-bars .mana-bar {
  width: 80px;
  height: 14px;
  font-size: 0.8em;
}
.group-panel-content .group-bars .hp-bar span,
.group-panel-content .group-bars .mana-bar span {
  line-height: 14px;
  font-size: 0.8em;
}
.group-portrait {
  flex: 0 0 auto;
  width: 40px;
  height: 30px; /* ungefÃƒÂ¤hr HÃƒÂ¶he von zwei 14px-Balken + AbstÃƒÂ¤nde (~2px) */
  display: flex;
  align-items: center;
  justify-content: center;
}
.group-portrait-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: auto;
  border-radius: 4px;
}
.group-stance {
  flex: 0 0 auto;
  margin-left: 8px;
  display: flex;
  align-items: center;
}
.bar {
  width: 100%;
  height: 11px; /* ~20% schmaler (vorher 14px) */
  background: #e6e6e6;
  border-radius: 7px;
  overflow: hidden;
  border: 1px solid #bfa04644;
  box-shadow: 0 1px 2px #bfa04622 inset;
  position: relative;
}
.bar-hp {
  margin-bottom: 2px;
}
.bar-mana {
  margin-top: 0;
}
.bar-inner {
  height: 100%;
  transition: width 0.3s cubic-bezier(.4,1.4,.6,1);
  border-radius: 7px;
  box-shadow: 0 1px 4px #0002 inset;
}
.bar-hp .bar-inner {
  background: var(--hp-rot); /* dunkleres Rot */
}
.bar-mana .bar-inner {
  background: var(--mana-blau); /* dunkleres Blau */
}
/* Rohstoff-Info-Zeile im Umgebungspanel */
#rohstoff-rows {
  display: grid;
  width: 100%;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 8px 14px;
}
.rohstoff-info-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.rohstoff-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: normal;
  white-space: nowrap;
}
/* ===== Aktions-Button (Pergament und Messing) =====
   Zentrale Klasse fuer fast alle Aktionen (Sammeln, Feld aufwerten, Wegwerfen, Ok ...).
   Dichte Aktions-Listen (z. B. Bauten-Panel) erhalten weiter unten einen kompakten Link-Stil. */
.feld-aufwerten-link {
  cursor: pointer;
  display: inline-block;
  color: var(--tinte);
  text-decoration: none;
  font-family: var(--font-titel);
  font-size: 0.82em;
  font-weight: 600;
  letter-spacing: 0.2px;
  background: linear-gradient(180deg, #f8edcc 0%, #e8cf98 100%);
  border: 1.5px solid #987334;
  border-radius: 4px;
  padding: 2px 6px;
  margin-left: 8px;
  box-shadow: inset 0 1px 0 #fff8, inset 0 -1px 0 #936b2426, 0 1px 2px #2a1a0a26;
  text-shadow: none;
  transition: background 0.12s, box-shadow 0.12s, transform 0.04s;
}
.feld-aufwerten-link:hover, .feld-aufwerten-link:focus {
  background: linear-gradient(180deg, #fff8e4 0%, #f6dfa8 100%);
  box-shadow: inset 0 1px 0 #fffc, 0 2px 4px #2a1a0a40;
  outline: none;
}
.feld-aufwerten-link:focus-visible {
  outline: 2px solid var(--gold-dunkel);
  outline-offset: 2px;
}
.feld-aufwerten-link:active {
  transform: translateY(1px);
}
/* Gemeinsame Variante fuer destruktive Aktionen. */
.feld-aufwerten-link.feld-aufwerten-link--danger {
  color: #f8edcc;
  background: linear-gradient(180deg, #a52e2e 0%, #781c1c 100%);
  border-color: #702020;
  box-shadow: inset 0 1px 0 #fff8, inset 0 -1px 0 #36090966, 0 1px 2px #2a1a0a26;
}
.feld-aufwerten-link.feld-aufwerten-link--danger:hover,
.feld-aufwerten-link.feld-aufwerten-link--danger:focus {
  background: linear-gradient(180deg, #b83b3b 0%, #922727 100%);
  box-shadow: inset 0 1px 0 #fffc, 0 2px 4px #48101040;
}
.feld-aufwerten-link.feld-aufwerten-link--danger:focus-visible {
  outline-color: #702020;
}
/* Feldwert-Label im Umgebungspanel fett */
.feldwert-label {
  font-weight: bold;
}
/* "Feld aufwerten" (rechtsbuendig, etwas groesser) */
.feld-aufwerten-link {
  font-size: 1em;
  margin-left: auto;
}

/* Ehemalige Stil-2-Menueoeffner verwenden jetzt den Standardbutton. */
.bauten-actions .feld-aufwerten-link:not(.feld-aufwerten-link--danger),
.admin-actions .feld-aufwerten-link:not(.feld-aufwerten-link--danger),
.button-style-2:not(.feld-aufwerten-link--danger) {
  margin-left: 0;
}
/* Feld-Info-Zeile im Umgebungspanel */
.feld-info-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  margin-bottom: 8px;
  gap: 8px;
}
.field-action { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
#field-clear-actions { display: contents; }
#field-actions { display: flex; flex-wrap: wrap; gap: 8px 14px; }
#field-actions:not(:empty) { margin-top: 8px; }
/* GebÃƒÂ¤ude-Admin: Link-Buttons innerhalb dieses Panels nicht nach rechts schieben */
.building-admin .feld-aufwerten-link { margin-left: 0 !important; }
.building-admin .admin-actions { align-items: flex-start !important; }
.building-admin .vorrat-row .feld-aufwerten-link { margin-left: 0 !important; }
/* Stadtansicht: Buttons in Panels links anordnen */
#city-view .panel .feld-aufwerten-link,
#settlement-view .city-routes-panel .feld-aufwerten-link { margin-left: 0 !important; align-self: flex-start; }

.city-facilities-panel {
  gap: 12px;
}
.city-facility-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}
.city-facility-title {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  color: #2a1a0a;
  font-family: 'MedievalSharp', 'UnifrakturCook', cursive;
  font-size: 0.97em;
}
.city-facility-title::after {
  content: '';
  display: block;
  height: 1px;
  margin-right: 8px;
  background: #2a1a0a;
  flex: 1 1 auto;
  opacity: 0.9;
}
.city-facility-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 12px;
  width: 100%;
}
.city-facility-actions .feld-aufwerten-link {
  justify-self: start;
  white-space: nowrap;
}

.city-routes-panel {
  min-height: 0;
  overflow: hidden !important;
}
.city-routes-content {
  display: flex;
  min-height: 0;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-color: #bfa046 #2a1a0a;
}
.city-route-entry {
  padding: 2px 2px 7px 0;
  border-bottom: 1px solid #2a1a0a66;
}
.city-route-entry:last-child {
  border-bottom: 0;
}
.city-route-main,
.city-route-details {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.city-route-details {
  justify-content: flex-start;
  margin-top: 1px;
  font-size: 0.86em;
}
.city-route-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
}
.city-route-actions .route-manage:not(.standard-button) {
  min-width: 34px;
  padding-inline: 8px;
  font-family: var(--font-titel);
  font-size: 1.05em;
  line-height: 1;
}
.city-routes-footer {
  flex: 0 0 auto;
}
.route-error,
.route-dialog-message {
  color: #8b1e16;
}

.small-equip-popup.route-dialog {
  width: min(520px, calc(100vw - 32px));
  height: auto;
  max-height: calc(100vh - 120px);
  box-sizing: border-box;
}
.route-dialog-body {
  padding: 8px 12px;
  color: #2a1a0a;
  line-height: 1.35;
}
.route-dialog-body p {
  margin: 0 0 10px;
}
.route-field-label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
}
.route-number-input {
  width: 150px;
  box-sizing: border-box;
}
.route-management-grid {
  display: grid;
  grid-template-columns: max-content 78px max-content;
  align-items: center;
  justify-content: start;
  gap: 10px 8px;
}
.route-management-grid .route-number-input {
  width: 78px;
}
.route-management-grid .feld-aufwerten-link {
  margin-left: 0;
  white-space: nowrap;
}
.storage-popup.route-management-dialog .storage-actions {
  grid-template-columns: 1fr;
}
.route-management-dialog .route-dialog-message {
  min-height: 1.2em;
}
.route-management-dialog .route-dialog-footer-actions {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  width: 100%;
}
.route-management-dialog .route-dialog-cancel {
  grid-column: 2;
  justify-self: center;
}
.route-management-dialog .route-delete {
  grid-column: 3;
  justify-self: end;
}
.route-dialog .storage-actions .feld-aufwerten-link,
.route-recording-popup .route-recording-actions .feld-aufwerten-link {
  display: inline-block;
  margin-left: 8px;
  text-decoration: none;
}
.route-recording-layer {
  position: fixed;
  inset: 0;
  z-index: 12000;
  pointer-events: none;
}
.small-equip-popup.route-recording-popup {
  position: fixed;
  top: 82px;
  right: 22px;
  width: min(340px, calc(100vw - 24px));
  height: auto;
  overflow: hidden;
  box-sizing: border-box;
  pointer-events: auto;
}
.route-recording-drag-handle {
  display: flex;
  width: 100%;
  min-height: 42px;
  box-sizing: border-box;
  align-items: center;
  gap: 9px;
  padding: 8px 12px;
  cursor: grab;
  touch-action: none;
  user-select: none;
}
.route-recording-drag-handle:active {
  cursor: grabbing;
}
.route-drag-grip {
  font-size: 1.25em;
  line-height: 1;
  opacity: 0.75;
}
.route-recording-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 10px;
}
.route-recording-actions {
  display: flex;
  justify-content: flex-end;
  padding: 2px 10px 6px;
}

.city-election-panel {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.city-election-statusline {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1em;
  color: #2a1a0a;
}

.city-election-statuslabel {
  font-weight: bold;
}

.city-election-actions,
.city-election-vote-row,
.city-election-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.city-election-actions {
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: flex-start;
}

.city-election-actions button,
.city-election-vote-row button,
.city-election-footer button {
  margin-left: 0;
}

#settlement-view .city-election-footer .field-action {
  flex-wrap: wrap;
}

.city-election-note {
  font-size: 0.85em;
  color: #2a1a0aaa;
}

.city-election-status {
  min-height: 18px;
  font-size: 0.85em;
  color: #2a1a0a;
}

.city-election-status.success { color: #1e8f4c; }
.city-election-status.error { color: #a23636; }

.city-election-hint {
  font-size: 0.85em;
  color: #a23636;
  background: rgba(162, 54, 54, 0.12);
  border-left: 3px solid #a23636;
  padding: 6px 8px;
  border-radius: 4px;
}
/* Button im Panel wie Nav-Button, aber kleiner */
.panel-nav-btn {
  background: linear-gradient(145deg, #bfa046 0%, #7c5a1a 100%);
  color: #2a1a0a;
  border: 2px solid #bfa046;
  border-radius: 10px 10px 14px 14px/14px 14px 10px 10px;
  padding: 0.3em 1.1em;
  font-size: 0.98em;
  font-family: 'MedievalSharp', 'UnifrakturCook', cursive;
  letter-spacing: 1px;
  box-shadow: 0 2px 8px #0008 inset, 0 2px 8px #bfa04644;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
  text-shadow: 0 2px 2px #0008;
  margin-left: auto;
}
.panel-nav-btn:hover, .panel-nav-btn:focus {
  background: linear-gradient(145deg, #ffe08a 0%, #bfa046 100%);
  color: #7c5a1a;
  box-shadow: 0 4px 16px #bfa04688, 0 2px 8px #0008 inset;
}
/* Kleines AusrÃƒÂ¼stungs-Popup (ankerbasiert neben Waffen/RÃƒÂ¼stungen Button) */
.small-equip-popup {
  position: relative;
  width: 400px;
  height: 140px;
  background-color: var(--pergament-hell);
  background-image: var(--textur-pergament-hell);
  background-size: var(--textur-kachel);
  background-repeat: repeat;
  border: 0;
  border-radius: 0;
  box-shadow: 0 4px 18px #0005, 0 2px 4px #bfa04655 inset;
  padding: 10px 14px 14px 14px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  font-family: 'MedievalSharp', 'UnifrakturCook', cursive;
  font-size: 0.85em;
  overflow: auto;
}
.small-equip-popup::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  border: var(--rahmen-breite) solid transparent;
  border-image-source: var(--rahmen-quelle);
  border-image-slice: var(--rahmen-slice);
  border-image-width: var(--rahmen-breite);
  border-image-outset: var(--rahmen-outset);
  border-image-repeat: stretch;
}
.small-equip-popup > * {
  position: relative;
  z-index: 3;
}
.small-equip-popup .equip-popup-header {
  font-weight: bold;
  font-size: 0.9em;
  text-align: center;
  margin-bottom: 6px;
  line-height: 1.2;
  color: #2a1a0a;
}
/* RP-Panel Titel mit Bearbeiten-Button rechts */
.rp-panel h2.rp-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
#city-view .rp-panel h2.rp-title-row {
  flex-wrap: wrap;
  row-gap: 6px;
}
.rp-panel h2.rp-title-row .feld-aufwerten-link {
  margin: 0;
  /* Abstand vom rechten Rand wie Titel links (18px) */
  margin-right: 18px;
}
.small-equip-popup .equip-char-name { font-weight: normal; font-size: 0.85em; }
.small-equip-popup .equip-row { display:flex; flex-direction:row; align-items:center; margin-bottom:6px; gap:6px; }
.small-equip-popup .equip-label { flex:0 0 70px; text-align:right; font-weight:bold; }
.small-equip-popup select.equip-slot-select { flex:1 1 auto; font-size:0.85em; }
.small-equip-popup button.feld-aufwerten-link { margin-left:auto; margin-top:4px; }
/* Ausnahme: In der RP-Toolbar sollen die Buttons linksbÃƒÂ¼ndig und eng stehen */
.small-equip-popup .rp-toolbar button.feld-aufwerten-link {
  margin-left: 0 !important;
  margin-right: 0 !important;
  margin-top: 0;
}

/* Lager-Transfer Popup auf Basis der Equip-Optik */
.storage-popup {
  position: relative;
  width: 720px;
  max-width: 95vw;
  height: auto;
  max-height: 90vh;
  overflow: auto;
  font-size: 0.9em;
  background-color: var(--pergament-hell);
  background-image: var(--textur-pergament-hell);
  background-size: var(--textur-kachel);
  background-repeat: repeat;
  border: 0;
  border-radius: 0;
  box-shadow: 0 4px 18px #0005, 0 2px 4px #bfa04655 inset;
}
.storage-popup::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  border: var(--rahmen-breite) solid transparent;
  border-image-source: var(--rahmen-quelle);
  border-image-slice: var(--rahmen-slice);
  border-image-width: var(--rahmen-breite);
  border-image-outset: var(--rahmen-outset);
  border-image-repeat: stretch;
}
.storage-popup > * {
  position: relative;
  z-index: 3;
}
.storage-popup.message-compose-popup {
  width: 860px;
  background-color: var(--pergament-hell);
  background-image: var(--textur-pergament-hell);
  background-repeat: repeat;
  background-size: var(--textur-kachel);
  background-position: center;
}
.message-compose-popup .compose-content { display: flex; gap: 16px; align-items: stretch; }
.message-compose-popup .compose-recipient { width: 160px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.message-compose-popup .compose-portrait-frame { width: 120px; height: 150px; border: 2px solid #bfa046; border-radius: 8px; overflow: hidden; background: #f8f1d1; display: flex; align-items: center; justify-content: center; }
.message-compose-popup .compose-portrait-img { width: 100%; height: 100%; object-fit: cover; }
.message-compose-popup .compose-recipient-name { margin-top: 8px; font-weight: bold; text-align: center; }
.message-compose-popup .compose-recipient .compose-hierarchy { margin: 8px 0 0; }
.message-compose-popup .compose-form { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.message-compose-popup .compose-form input,
.message-compose-popup .compose-form textarea { width: 100%; }
.storage-popup .equip-popup-header { margin-bottom: 8px; font-size: 1.2em; }
.storage-popup .build-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: stretch; }
.storage-popup .build-entry { background: #2a1a0a22; border: 1px solid #bfa04655; padding: 8px 10px; border-radius: 8px; font-size: 0.9em; display: grid; grid-template-columns: 56px 1fr; column-gap: 10px; align-items: start; }
.storage-popup .build-entry.build-entry-wide { grid-column: 1 / -1; }
.storage-popup .build-entry .build-icon { width: 56px; height: 56px; object-fit: contain; image-rendering: pixelated; align-self: center; }
.storage-popup .build-entry .build-info { display: grid; grid-template-rows: auto auto auto; row-gap: 4px; }
.storage-popup .build-entry .build-title { line-height: 1.1; }
.storage-popup .build-entry .build-costs { color: #2a1a0a; }
.storage-popup .build-entry .build-cost-icon { width: 16px; height: 16px; image-rendering: pixelated; vertical-align: -2px; }
.storage-popup .build-entry button.feld-aufwerten-link { margin-left: 0; margin-top: 4px; }
.storage-popup.building-build-popup {
  --build-columns: 1;
  width: max-content;
  box-sizing: border-box;
}
.building-build-popup .equip-popup-header { margin-left: 24px; margin-right: 24px; min-height: 24px; text-align: center; }
.storage-popup.building-build-popup .build-list { width: max-content; grid-template-columns: repeat(var(--build-columns), minmax(max-content, 1fr)); }
.building-build-popup .build-list { flex-shrink: 0; }
.storage-popup.building-build-popup .build-entry { box-sizing: border-box; min-width: 400px; grid-template-columns: 56px minmax(max-content, 1fr); }
.storage-popup.building-build-popup .build-info { min-width: 0; grid-template-rows: none; row-gap: 6px; }
.building-build-popup .build-description { max-width: 340px; line-height: 22px; }
.building-build-popup .build-description .ui-value-icon { vertical-align: middle; }
.storage-popup.building-build-popup .build-costs { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.building-build-popup .build-actions { display: flex; align-items: center; gap: 8px; }
.storage-popup.building-build-popup .build-entry button.feld-aufwerten-link { margin: 0; }
.building-build-popup .build-costs .requisition-costs { white-space: nowrap; }
.building-build-popup .build-cost-value,
.building-admin .build-cost-value { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.building-build-popup #settlement-name { box-sizing: border-box; flex: 1; min-width: 120px; height: 25px; padding: 2px 6px; }
.building-build-popup .build-availability-error { max-width: 340px; color: #8a1c1c; }
/* Nachricht verfassen: Inhalt-Textarea nicht manuell vergrÃƒÂ¶ÃƒÅ¸er-/verkleinerbar */
.storage-popup #msg-body { resize: none; }
/* Nachricht verfassen: Scrollbar-Stil wie RP-Editor */
.storage-popup #msg-body {
  /* Firefox */
  scrollbar-color: #f8f5e6 #2a1a0a; /* thumb track */
  scrollbar-width: thin;
}
.storage-popup #msg-body::-webkit-scrollbar { width: 12px; height: 12px; }
.storage-popup #msg-body::-webkit-scrollbar-track { background: #2a1a0a; }
.storage-popup #msg-body::-webkit-scrollbar-thumb { background-color: #f8f5e6; border-radius: 6px; border: 2px solid #2a1a0a; }
.storage-popup #msg-body::-webkit-scrollbar-button { background: #f8f5e6; height: 12px; }
.storage-popup .storage-columns { position: relative; display: grid; grid-template-columns: 1fr 1fr; column-gap: 24px; align-items: start; }
.storage-popup .storage-columns::before { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 1px; background: #2a1a0a66; transform: translateX(-0.5px); }
.storage-popup .storage-col h4 { margin: 2px 0 6px 0; }
.storage-popup .storage-list { display: flex; flex-direction: column; gap: 6px; }
.storage-popup .storage-item { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px; }
.storage-popup .storage-line { display: flex; align-items: center; gap: 6px; }
.storage-popup .storage-icon { width: 16px; height: 16px; image-rendering: pixelated; }

/* Taverne: kompakte EintrÃƒÂ¤ge, Trenner und Button rechts neben Namen */
.storage-popup #tavern-list { display: flex; flex-direction: column; }
.tavern-popup .equip-popup-header { margin-left: 24px; margin-right: 24px; min-height: 24px; }
.storage-popup .tavern-row { padding: 6px 0; border-top: 1px solid #2a1a0a; display: flex; gap: 12px; align-items: center; }
.storage-popup .tavern-row:first-child { border-top: none; }
.storage-popup .tavern-class-icon { width: auto; height: 54px; flex-shrink: 0; object-fit: contain; image-rendering: pixelated; }
.storage-popup .tavern-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.storage-popup .tavern-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.storage-popup .tavern-hire { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.storage-popup .tavern-hire .hire-btn { margin: 0; }
.storage-popup .tavern-costs { white-space: nowrap; }
.storage-popup .tavern-name { font-weight: bold; }
.storage-popup .tavern-meta { color: #2a1a0a; font-size: 0.9em; }
.storage-popup .tavern-talents { color: #2a1a0a; font-size: 0.9em; }
.storage-popup .stor-qty { font-weight: normal; }
.storage-popup .storage-input { display: flex; align-items: center; gap: 6px; }
.storage-popup .storage-input .stor-all { margin-left: 0; }
.storage-popup .storage-actions { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; margin-top: 16px; }
.storage-popup .storage-actions #stor-swap { grid-column: 2; justify-self: center; }
.storage-popup .storage-actions #stor-close { grid-column: 3; justify-self: end; }
.storage-popup .storage-actions #rp-save { grid-column: 2; justify-self: center; }
.storage-popup .storage-actions #rp-cancel { grid-column: 3; justify-self: end; }
.storage-popup .storage-actions #msg-send { grid-column: 2; justify-self: center; }
.storage-popup .storage-actions #msg-cancel { grid-column: 3; justify-self: end; }
.storage-popup .storage-actions .feld-aufwerten-link { margin-left: 0 !important; }
.storage-popup.castle-protection-popup { width: min(460px, calc(100vw - 32px)); height: auto; max-height: calc(100vh - 100px); box-sizing: border-box; overflow: hidden; }
.castle-protection-popup .equip-popup-header { min-height: 24px; line-height: 24px; }
.castle-protection-popup .castle-protection-list { min-height: 48px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.castle-protection-popup .castle-protection-target { display: flex; align-items: baseline; gap: 6px; cursor: pointer; }
.castle-protection-popup .castle-protection-target input { flex: 0 0 auto; }
.castle-protection-popup .castle-protection-error { color: #a00; margin-top: 8px; }
.castle-protection-popup .panel-bottom-actions { flex: 0 0 auto; width: auto; margin: 12px -14px -14px; padding: 6px 14px; z-index: 1; }
.castle-protection-popup .panel-bottom-actions .route-icon-button { padding: 3px 6px; }
.storage-popup.school-training-popup { position: relative; width: min(900px, calc(100vw - 32px)); }
.small-equip-popup .school-popup-close,
.small-equip-popup .popup-close-button { position: absolute; top: 10px; right: 10px; z-index: 4; display: flex; align-items: center; justify-content: center; width: 24px; height: 24px; margin: 0; padding: 2px; border: 0; border-radius: 0; background: transparent; box-shadow: none; cursor: pointer; }
.school-popup-close img,
.popup-close-button img { display: block; width: 18px; height: 18px; object-fit: contain; pointer-events: none; }
.school-popup-close:hover, .school-popup-close:focus,
.popup-close-button:hover, .popup-close-button:focus { background: transparent; box-shadow: none; outline: none; }
.school-popup-close:hover img, .school-popup-close:focus img,
.popup-close-button:hover img, .popup-close-button:focus img { opacity: 0.75; }
.school-train-button img { display: block; width: 16px; height: 16px; object-fit: contain; }
.school-training-table-wrap { max-width: 100%; overflow-x: auto; padding: 4px 0; }
.school-training-table { width: 100%; min-width: 820px; table-layout: fixed; border-collapse: collapse; background: #fffbe8; }
.school-training-table th, .school-training-table td { border: 1px solid #e0d6b6; padding: 6px 8px; text-align: center; vertical-align: middle; }
.school-training-table th { background: #f3e2b8; font-weight: bold; }
.school-training-table th:nth-child(1) { width: 19%; }
.school-training-table th:nth-child(2) { width: 8%; }
.school-training-table th:nth-child(3) { width: 11%; }
.school-training-table th:nth-child(4) { width: 22%; }
.school-training-table th:nth-child(5) { width: 8%; }
.school-training-table th:nth-child(6) { width: 22%; }
.school-training-table th:nth-child(7) { width: 10%; }
.school-training-table tbody tr { transition: background-color 120ms ease; }
.school-training-table tbody tr:hover { background: #f8efd8; }
.school-training-table .school-character-name { text-align: left; font-weight: normal; }
.school-training-table .school-character-xp { text-align: right; font-variant-numeric: lining-nums tabular-nums; }
.school-training-table select { width: 100%; min-width: 0; box-sizing: border-box; margin: 0; }
.school-training-table .school-levels-select { max-width: 54px; }
.school-training-table .school-training-costs { font-size: 0.88em; line-height: 1.25; font-variant-numeric: lining-nums tabular-nums; }
.small-equip-popup .school-train-button { margin: 0; }
.school-training-feedback-overlay { z-index: 10001; }
.small-equip-popup.school-training-feedback { width: min(380px, calc(100vw - 32px)); height: auto; min-height: 100px; overflow: hidden; padding: 14px 42px 18px 18px; justify-content: center; }
.school-feedback-message { color: #2a1a0a; line-height: 1.45; text-align: center; }
.city-overview-table-wrap { max-width: 100%; overflow-x: auto; }
.storage-popup .inventory-qty-input { width: 80px; height: 18px; text-align: center; }

/* ===== Markt-Popup Spezifika ===== */
.market-popup-wide { width: 1484px; }
.storage-popup.market-compact {
  --market-player-width: 393px;
  --market-place-width: 785px;
  box-sizing: border-box;
  width: calc(var(--market-player-width) + 24px + var(--market-place-width) + 40px);
  max-width: calc(100vw - 32px);
}
.market-compact.is-visitor { --market-place-width: 705px; }
.market-compact.is-blackmarket { --market-place-width: 453px; }
.storage-popup.market-compact.is-settings-only { --market-place-width: 597px; width: calc(var(--market-place-width) + 40px); }
.storage-popup.market-compact :is(.market-top-row, .market-gold-row, .market-tables-columns) {
  grid-template-columns: var(--market-player-width) var(--market-place-width);
}
.market-compact.is-settings-only :is(.market-top-row, .market-tables-columns) { grid-template-columns: var(--market-place-width); }
.market-top-row { display:grid; grid-template-columns: 440px 1000px; column-gap: 24px; align-items: baseline; padding: 4px 0 2px 0; }
.market-top-row.is-visitor { grid-template-columns: 440px 920px; }
.market-top-row > div { padding: 0 6px; }
.market-top-row strong { font-size: 1.1em; }
.market-gold-row { display: grid; grid-template-columns: 440px 1000px; column-gap: 24px; align-items: center; padding: 0 0 6px 0; }
.market-gold-row.is-visitor { grid-template-columns: 440px 920px; }
.market-gold-row > div { padding: 0 6px; }
.market-gold-left, .market-gold-right { display: flex; align-items: center; gap: 6px; }
.market-compact .market-gold-left,
.market-compact .market-gold-right { flex-wrap: wrap; }
.market-money-value,
.market-transfer-label { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.market-footer-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 16px; }
.market-compact .equip-popup-header { margin-left: 24px; margin-right: 24px; min-height: 24px; }
.market-header-list { padding: 0 6px 4px 6px; }
.market-rows-list { padding: 0 6px; }
.storage-popup.market-popup-wide { max-height: 84vh; display: flex; flex-direction: column; overflow: hidden; }
.storage-popup.market-popup-wide .market-scroll { flex: 1 1 auto; overflow: auto; }
.storage-popup.market-popup-wide .market-scroll,
.army-view-popup .army-content,
#uebersicht-panel-content,
:is(.view-scroll, .legend-list, .building-3col-layout .rp-block, .kampfbericht-panel .fight-log, body.fight-mode .battle-sections) {
  /* Scrollbar-Styling wie im Popup "Beschreibung bearbeiten" (.rp-editable) */
  /* Firefox */
  scrollbar-color: #f8f5e6 #2a1a0a; /* thumb, track */
  scrollbar-width: thin;
}
/* Lager-Popup: definierte Breiten */
.storage-popup.market-popup-wide.storage-transfer { width: 910px; }
.storage-popup.market-popup-wide.storage-transfer .market-tables-columns.storage-equal-cols { grid-template-columns: 440px 440px; }
.storage-popup.market-popup-wide .market-scroll::-webkit-scrollbar,
.army-view-popup .army-content::-webkit-scrollbar,
#uebersicht-panel-content::-webkit-scrollbar,
:is(.view-scroll, .legend-list, .building-3col-layout .rp-block, .kampfbericht-panel .fight-log, body.fight-mode .battle-sections)::-webkit-scrollbar {
  width: 12px;  /* wie .rp-editable */
  height: 12px; /* horizontal, falls nÃƒÂ¶tig */
}
.storage-popup.market-popup-wide .market-scroll::-webkit-scrollbar-track,
.army-view-popup .army-content::-webkit-scrollbar-track,
#uebersicht-panel-content::-webkit-scrollbar-track,
:is(.view-scroll, .legend-list, .building-3col-layout .rp-block, .kampfbericht-panel .fight-log, body.fight-mode .battle-sections)::-webkit-scrollbar-track {
  background: #2a1a0a;
}
.storage-popup.market-popup-wide .market-scroll::-webkit-scrollbar-thumb,
.army-view-popup .army-content::-webkit-scrollbar-thumb,
#uebersicht-panel-content::-webkit-scrollbar-thumb,
:is(.view-scroll, .legend-list, .building-3col-layout .rp-block, .kampfbericht-panel .fight-log, body.fight-mode .battle-sections)::-webkit-scrollbar-thumb {
  background-color: #f8f5e6;
  border-radius: 6px;
  border: 2px solid #2a1a0a;
}
.storage-popup.market-popup-wide .market-scroll::-webkit-scrollbar-thumb:hover,
.army-view-popup .army-content::-webkit-scrollbar-thumb:hover,
#uebersicht-panel-content::-webkit-scrollbar-thumb:hover,
:is(.view-scroll, .legend-list, .building-3col-layout .rp-block, .kampfbericht-panel .fight-log, body.fight-mode .battle-sections)::-webkit-scrollbar-thumb:hover {
  background-color: #fff0d0; /* dezente Hover-Farbe analog Stylewelt */
}
.storage-popup.market-popup-wide .market-scroll::-webkit-scrollbar-button,
.army-view-popup .army-content::-webkit-scrollbar-button,
#uebersicht-panel-content::-webkit-scrollbar-button,
:is(.view-scroll, .legend-list, .building-3col-layout .rp-block, .kampfbericht-panel .fight-log, body.fight-mode .battle-sections)::-webkit-scrollbar-button {
  background: #f8f5e6;
  height: 12px;
}
.storage-popup.market-popup-wide .market-scroll::-webkit-scrollbar-corner,
.army-view-popup .army-content::-webkit-scrollbar-corner,
#uebersicht-panel-content::-webkit-scrollbar-corner,
:is(.view-scroll, .legend-list, .building-3col-layout .rp-block, .kampfbericht-panel .fight-log, body.fight-mode .battle-sections)::-webkit-scrollbar-corner {
  background: #2a1a0a; /* Ecke bei gleichzeitigen Scrollbars */
}
.storage-popup.market-popup-wide .storage-actions { position: sticky; bottom: 0; background: rgba(255,245,214,0.94); border-top: 1px solid #bfa04655; box-shadow: 0 -2px 8px #0001; padding: 8px 6px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; }
.storage-popup.market-compact .storage-actions { background: transparent; border-top: 0; box-shadow: none; }
.storage-popup.market-popup-wide .market-sticky-header { position: sticky; top: 0; z-index: 5; background: rgba(255,245,214,0.94); border-bottom: 1px solid #bfa04655; box-shadow: 0 2px 8px #0001; }
.storage-popup.market-compact .market-sticky-header { position: static; flex: 0 0 auto; overflow: hidden; background: transparent; border-bottom: 0; box-shadow: none; }
.storage-popup.market-popup-wide .market-sticky-header .market-top-row,
.storage-popup.market-popup-wide .market-sticky-header .market-gold-row { background: transparent; }
.market-table thead th { position: sticky; top: var(--market-sticky-offset, 0px); z-index: 3; /* Hintergrund sicherstellen */ background: #f3e2b8; }
/* Marktplatz: SpaltenÃƒÂ¼berschriften grundsÃƒÂ¤tzlich zentriert (nicht fÃƒÂ¼r Lager-Transfer) */
.storage-popup.market-popup-wide:not(.storage-transfer) .market-table thead th { text-align: center !important; }
/* Lager-Transfer: Header ebenfalls zentrieren, Inhalte bleiben wie bisher */
.storage-popup.market-popup-wide.storage-transfer .market-table thead th { text-align: center !important; }
.discard-popup {
  width: 760px;
  max-width: 95vw;
}
.discard-popup .market-scroll {
  max-height: 60vh;
  overflow: auto;
}
.discard-popup .discard-table th,
.discard-popup .discard-table td {
  font-size: 0.9em;
}
.discard-popup .discard-table .discard-cell {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.discard-popup .discard-table .inventory-icon {
  width: 18px;
  height: 18px;
  image-rendering: pixelated;
}
.discard-popup .discard-msg {
  min-height: 18px;
  font-size: 0.85em;
  align-self: center;
}
.discard-popup .discard-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
}
.discard-actions-buttons {
  display: flex;
  align-items: center;
  gap: 12px;
}
.discard-carry-info {
  font-size: 0.85em;
  color: #2a1a0a;
}
.market-tables-columns { display: grid; grid-template-columns: 440px 1000px; column-gap: 24px; align-items: start; }
.market-tables-columns.is-visitor { grid-template-columns: 440px 920px; }
.market-table-wrap { padding: 0 6px; }
.market-table { width: 100%; table-layout: fixed; border-collapse: collapse; background: #fffbe8; box-shadow: 0 1px 4px #bfa04622; }
.market-table th, .market-table td { border: 1px solid #e0d6b6; padding: 4px 6px; }
/* Collapsed borders scroll away from sticky cells and expose a thin row-colored seam. */
.market-compact .market-table { border-collapse: separate; border-spacing: 0; }
.market-compact .market-table :is(th, td) { border-width: 0 1px 1px 0; }
.market-compact .market-table :is(th, td):first-child { border-left-width: 1px; }
.market-compact .market-table thead th { border-top-width: 1px; }
.market-table th { background: #f3e2b8; font-weight: bold; }
.market-table th.left, .market-table td.left { text-align: left; }
.market-table th.right, .market-table td.right { text-align: right; }
.market-table th.center, .market-table td.center { text-align: center; }
.market-table td .res-cell { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.market-table .storage-icon { width: 16px; height: 16px; vertical-align: middle; transform: translateY(-2px); }
.market-table .inventory-qty-input { width: 70px; text-align: center; }
.market-table .mp-input-70 { width: 70px; }
.market-compact .inventory-qty-input {
  box-sizing: border-box;
  height: 25px;
  padding: 2px 4px;
  font-family: inherit;
  font-size: 0.9em;
  line-height: normal;
  vertical-align: middle;
  appearance: textfield;
  -moz-appearance: textfield;
}
.market-compact .market-table .inventory-qty-input { max-width: 100%; font-size: 1em; }
.market-compact .inventory-qty-input::-webkit-inner-spin-button,
.market-compact .inventory-qty-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.market-compact .market-table :is([data-cfg-ek], [data-cfg-vk]) { width: 52px; }
.market-table td.right, .market-table .stor-qty { font-variant-numeric: lining-nums tabular-nums; font-feature-settings: 'tnum' 1; }
.market-cols-header { display: grid; grid-template-columns: 1fr 68px 56px 70px 70px 70px 70px auto 80px; align-items: center; gap: 4px; }
.market-cols-header .col-title { font-weight: bold; }
.market-cols-header .col-center { text-align: center; }
.market-cols-header .col-right { text-align: right; }
/* Wichtig: Marktzeilen dÃƒÂ¼rfen NICHT vom generischen .storage-item-Grid (1fr auto) ÃƒÂ¼berfahren werden. */
.market-row { display: grid; grid-template-columns: 1fr 68px 56px 70px 70px 70px 70px auto 80px; align-items: center; gap: 4px; }
/* HÃƒÂ¶here SpezifitÃƒÂ¤t, um das 2-Spalten-Layout von .storage-item zu ÃƒÂ¼berschreiben. */
.storage-popup .storage-item.market-row { grid-template-columns: 1fr 68px 56px 70px 70px 70px 70px auto 80px; }
/* Optional: Sichere Spaltenausrichtung auch bei sehr langen Titeln, ohne das Grid aufzubrechen. */
.storage-popup .storage-item.market-row .market-row-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.market-row-title { display: flex; align-items: center; gap: 6px; }
.cell-center { text-align: center; }
.cell-left { text-align: left; }
.cell-right { text-align: right; }
.stor-qty { font-variant-numeric: lining-nums tabular-nums; font-feature-settings: 'tnum' 1; }
.mp-input-70 { width: 70px; }
.mp-input-90 { width: 90px; }

/* Spieler-Seite: Header und Zeilen mit explizitem Grid (Ware, Menge, Alle, Eingabe) */
.market-player-header { display: grid; grid-template-columns: 1fr 68px auto 80px; align-items: center; gap: 4px; }
.market-player-row { display: grid; grid-template-columns: 1fr 68px auto 80px; align-items: center; gap: 4px; }
/* Sicherstellen, dass generisches Storage-Grid nicht greift */
.storage-popup .storage-item.market-player-row { grid-template-columns: 1fr 68px auto 80px; }

/* Optional: zarte Spaltenhilfslinien einschalten, indem ein Vorfahr .market-show-guides hat */
.market-show-guides .market-cols-header > div:not(:last-child),
.market-show-guides .market-row > div:not(:last-child),
.market-show-guides .market-player-header > div:not(:last-child),
.market-show-guides .market-player-row > div:not(:last-child) {
  box-shadow: inset -1px 0 #2a1a0a33; /* dÃƒÂ¼nne Linie rechts je Zelle */
}

/* ===== StadtÃƒÂ¼bersicht Popup ===== */
.city-overview-popup { width: 1874.73px; max-width: calc(100vw - 32px); height: 84vh; max-height: 84vh; box-sizing: border-box; overflow: hidden; }
.city-overview-popup > * { flex-shrink: 0; }
.city-overview-popup > .co-scroll { flex: 1 1 auto; min-height: 0; overflow: auto; }
.city-overview-popup .city-overview-table-wrap { max-width: none; overflow: visible; }
.city-overview-popup .city-overview-table { table-layout: fixed; min-width: calc(326.4px + var(--co-resource-width, 0px)); }
.city-overview-popup .co-posten-col { width: 326.4px; }
.city-overview-row { display: grid; grid-template-columns: 200px 1fr; align-items: center; gap: 8px; padding: 2px 6px; }
.city-overview-rows { display: flex; flex-direction: column; gap: 4px; }
.city-overview-popup .co-limit-lowest { font-weight: 700; }
.city-overview-table { width: 100%; border-collapse: collapse; font-size: 0.9em; background: #fffbe8; box-shadow: 0 1px 4px #bfa04622; }
.city-overview-table th, .city-overview-table td { border: 1px solid #e0d6b6; padding: 4px 6px; text-align: center; }
.city-overview-table th { background: #f3e2b8; font-weight: bold; }
.city-overview-popup .city-overview-table td.co-shortage { background: #fae7e4; }
.city-overview-popup .city-overview-table th.co-shortage { background: #eed1c9; }
.city-overview-popup .city-overview-table .co-result th { background: #e6cf9e; }
.city-overview-popup .city-overview-table .co-result th.co-shortage { background: #e9bfb1; }
.city-overview-table .storage-icon { width: 16px; height: 16px; vertical-align: middle; transform: translateY(-2px); }
.city-overview-table .num-pos { color: #1a7f37; font-weight: 600; }
.city-overview-table .num-neg { color: #b91c1c; font-weight: 600; }
.city-overview-table .num-zero { color: #0000; }
.city-overview-popup .city-overview-table :is(td, th):first-child { text-align: left; }
.city-overview-popup .num-balance { color: #000; font-weight: 600; }
.city-overview-popup .co-label { display: flex; align-items: center; gap: 4px; }
.city-overview-popup .co-building-type .co-label { padding-left: 16px; }
.co-building-fields { display: grid; grid-template-columns: minmax(0, 1fr) 64px 48px 58px; align-items: center; gap: 4px; padding-left: 24px; white-space: nowrap; }
.co-building-active { display: inline-flex; align-items: center; gap: 4px; }
.co-active-toggle { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 18px; width: 18px; height: 18px; box-sizing: border-box; padding: 1px; border: 0; border-radius: 0; background: none; box-shadow: none; cursor: pointer; }
.co-active-toggle img { display: block; width: 11.2px; height: 11.2px; }
.co-active-toggle:hover { background: #e8d69a; }
.co-active-toggle:focus-visible { outline: 2px solid #7c5a1a; outline-offset: 1px; }
.co-active-toggle:disabled { opacity: 0.55; cursor: default; }
#co-error { color: #a52e2e; }
#co-error:not(:empty) { margin: 8px 6px; }
.city-overview-note { color: #2a1a0a; opacity: 0.9; font-size: 0.9em; margin-top: 6px; text-align: center; }

/* Positionierung: Modal-Overlay Variante oben/zentriert */
.modal-overlay.top-center { align-items: flex-start; padding-top: 80px; }

/* Allgemeines Overlay fÃƒÂ¼r Modals (z.B. BestÃƒÂ¤tigungsdialog) */
.modal-overlay {
  position: fixed;
  left: 0; right: 0; top: 0; bottom: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000; /* ÃƒÂ¼ber .small-equip-popup */
}
/* BestÃƒÂ¤tigungs-Popup nutzt die gleiche Optik wie das AusrÃƒÂ¼stungs-Popup,
   ÃƒÂ¼berschreibt jedoch GrÃƒÂ¶ÃƒÅ¸e und Layout fÃƒÂ¼r variable HÃƒÂ¶he */
.confirm-popup {
  width: 320px;
  height: auto;
  max-width: 90vw;
  max-height: 80vh;
  padding: 12px 16px 14px 16px; /* etwas grÃƒÂ¶ÃƒÅ¸ere InnenabstÃƒÂ¤nde */
  overflow: hidden;
}
.confirm-popup .confirm-message {
  color: #2a1a0a;
  text-align: center;
  margin: 6px 2px 10px 2px;
  line-height: 1.3;
}
.confirm-delete-label {
  color: var(--tinte);
  text-align: center;
  margin: 2px 12px 4px;
}
.small-equip-popup .confirm-delete-input {
  align-self: center;
  width: min(240px, calc(100% - 24px));
  box-sizing: border-box;
  margin: 0 12px 8px;
  text-align: center;
}
.confirm-popup .confirm-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
.confirm-popup .confirm-actions .feld-aufwerten-link {
  margin: 0 2px;
  font-size: 0.85em;
}
/* Umgebungspanel: Koordinaten direkt neben dem Titel */
#umgebung-info {
  text-align: left;
  width: auto;
  font-size: 0.95em;
  font-weight: normal;
  margin: 0;
  white-space: nowrap;
}
/* ===== Navigation ===== */
#main-nav {
  width: 100%;
  background-color: var(--holz-dunkel);      /* Fallback, falls Textur fehlt */
  background-image: linear-gradient(rgba(0,0,0,.55), rgba(0,0,0,.55)), var(--textur-holz);
  background-size: auto, var(--textur-kachel);
  background-repeat: no-repeat, repeat;
  border-bottom: 1.5px solid var(--gold);
  padding: 0.3em 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5em;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  box-shadow: 0 1px 0 var(--gold-hell) inset, 0 4px 16px rgba(60,40,10,0.18);
  font-family: var(--font-zier);
}
#world-clock-display {
  color: var(--gold-hell); font-size: 14px; max-width: 250px;
  min-width: 0; overflow-wrap: anywhere; text-align: right;
}
#main-nav:has(#world-clock-display) { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.nav-buttons { grid-area: 1 / 1; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 12px; }
#main-nav > #world-clock-display { grid-area: 1 / 1; justify-self: end; margin-right: 12px; }
@media (max-width: 1800px) {
  #main-nav > #world-clock-display { grid-area: 2 / 1; }
}
dialog.small-equip-popup.standard-popup.world-clock-popup { height: fit-content; overflow: hidden; }
.world-clock-popup > .standard-popup-content { overflow: auto; }
.world-clock-popup > .equip-popup-header { flex-shrink: 0; }
.world-clock-form { border-top: 1px solid #987334; padding: 8px 0; }
.world-clock-form h3 { margin: 0 0 8px; }
.world-clock-fields, .world-clock-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.world-clock-fields label { display: flex; flex-direction: column; gap: 4px; }
.world-clock-form input { width: 90px; }
.world-clock-form button { margin-top: 8px; }
.world-clock-error { color: #781c1c; }
.prod-season-note { display: block; margin-top: 4px; }


.nav-btn {
  position: relative;
  background-color: var(--pergament);
  background-image: var(--textur-pergament);
  background-size: var(--textur-kachel);
  background-repeat: repeat;
  color: var(--tinte);
  border: 0;
  border-radius: 0; /* rechteckig, damit der Zierrahmen (Ecken-Ornamente) buendig sitzt */
  padding: 0.5em 1.6em;
  font-size: 1.04em;
  font-family: 'MedievalSharp', 'UnifrakturCook', cursive;
  letter-spacing: 1px;
  box-shadow: 0 2px 6px #0004;
  cursor: pointer;
  transition: filter 0.15s, transform 0.06s;
  margin-bottom: 2px;
  min-width: 140px;
  max-width: 140px;
  text-align: center;
  white-space: nowrap;
}
/* Gleicher Zierrahmen wie bei den Panels (frame_gold.png), nur kleiner gerendert */
.nav-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border: var(--nav-btn-rahmen-breite) solid transparent;
  border-image-source: var(--rahmen-quelle);
  border-image-slice: var(--rahmen-slice);
  border-image-width: var(--nav-btn-rahmen-breite);
  border-image-repeat: stretch;
}
.nav-btn:hover, .nav-btn:focus {
  filter: brightness(0.92);
}
.nav-btn:active {
  filter: brightness(0.85);
  transform: translateY(1px);
}

.nav-dropdown {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-bottom: 0;
}

.nav-dropdown .nav-btn {
  width: 100%;
  margin-bottom: 0;
}

.nav-submenu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  display: none;
  flex-direction: column;
  gap: 6px;
  padding: 10px;
  min-width: 200px;
  background-color: var(--pergament);
  background-image: var(--textur-pergament);
  background-size: var(--textur-kachel);
  background-repeat: repeat;
  border: 2px solid #bfa046;
  border-radius: 14px;
  box-shadow: 0 8px 16px #0006;
  z-index: 999;
}

.nav-dropdown:hover .nav-submenu,
.nav-submenu:hover,
.nav-submenu.open {
  display: flex;
}

.submenu-btn {
  background: none;
  border: none;
  border-radius: 0;
  padding: 4px 6px;
  color: var(--btn-gruen-hell);
  font-family: 'MedievalSharp', 'UnifrakturCook', cursive;
  font-size: 0.92em;
  font-weight: 600;
  text-decoration: underline;
  text-align: left;
  cursor: pointer;
  box-shadow: none;
  text-shadow: none;
  transition: background 0.15s, box-shadow 0.15s, color 0.15s;
}
.submenu-btn::before {
  content: "\25b8";
  display: inline-block;
  margin-right: 5px;
  color: var(--gold);
  font-weight: 700;
  -webkit-text-stroke: 0.6px #1b2b0c;
  text-shadow: 0 1px 1px #0007;
}
.submenu-btn:hover,
.submenu-btn.active,
.submenu-btn:focus {
  background: #e8d69a;
  box-shadow: 0 0 0 1px #bfa046 inset;
  color: var(--btn-gruen-hell);
  text-shadow: none;
  outline: none;
}

body {
  padding-top: var(--navigation-height, 56px);
  background-color: var(--hintergrund);      /* Fallback, falls Textur fehlt */
  background-image: var(--textur-holz);
  background-size: var(--textur-kachel);
  background-repeat: repeat;
  font-family: var(--font-titel);
  font-variant-numeric: lining-nums tabular-nums;
}
button, input, select, textarea {
  font-family: var(--font-titel);
  font-variant-numeric: lining-nums tabular-nums;
}
/* ===== Container ===== */

/* ===== Haupt-Grid ===== */
#main-grid {
  display: grid;
  grid-template-columns: 2fr 560px 2fr;
  gap: var(--view-panel-gap);
  max-width: var(--view-max-width);
  margin: var(--view-top-gap) auto 0;
  min-height: var(--view-panel-content-height);
}

#left-column {
  display: flex;
  flex-direction: column;
  height: 100%;
}

#umgebung-panel {
  height: auto;
  min-height: calc(260px + var(--view-space-gain));
  flex-shrink: 0;
  margin-bottom: var(--view-panel-gap);
}

#left-column .panel-row {
  height: auto;
  flex: 1 1 auto;
  min-height: 0;
}

#left-column .panel-row .panel-small {
  box-sizing: border-box;
  height: 100%;
  min-height: 0;
}

.performance-view {
  box-sizing: border-box;
  max-width: var(--view-max-width);
  height: var(--view-panel-min-height);
  margin: var(--view-top-gap) auto 0;
  display: flex;
  flex-direction: column;
  gap: var(--view-panel-gap);
}
.performance-header { flex: 0 0 auto; }
.performance-header h2 { margin: 0 0 8px; }
.performance-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.performance-toolbar .standard-button { margin: 0; }
.performance-status { margin: 8px 0 0; }
.performance-error { color: #9c2525; margin: 4px 0 0; }
.performance-error:empty { display: none; }
.performance-content { min-height: 0; overflow: auto; padding: 2px 6px 6px 2px; }
.performance-cards, .performance-charts { display: grid; gap: var(--view-panel-gap); margin: 0 0 var(--view-panel-gap); }
.performance-cards { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.performance-charts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.performance-card, .performance-chart { border: 1px solid #98733470; background: #fff8e43b; padding: 12px; min-width: 0; }
.performance-card h3, .performance-chart h3 { font-size: 15px; margin: 0 0 6px; }
.performance-card p, .performance-chart-caption { font-size: 13px; margin: 6px 0 0; }
.performance-value { display: block; font-size: 25px; color: #294b16; }
.performance-chart svg { display: block; width: 100%; height: 105px; border-bottom: 1px solid #98733470; }
.performance-section { margin: var(--view-panel-gap) 0; }
.performance-section > h3 { margin: 0 0 8px; }
.performance-hint { margin: 0 0 var(--view-panel-gap); }
.performance-empty { padding: 24px 0; }
.performance-table-scroll { overflow-x: auto; }
.performance-table { width: 100%; border-collapse: collapse; }
.performance-table th, .performance-table td { text-align: right; padding: 8px; border-bottom: 1px solid #98733470; white-space: nowrap; }
.performance-table th:first-child, .performance-table td:first-child { text-align: left; }
.performance-table small { display: block; white-space: normal; overflow-wrap: anywhere; max-width: 420px; }
@media (max-width: 1000px) {
  .performance-charts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .performance-charts { grid-template-columns: minmax(0, 1fr); }
}
.panel-small {
  height: 100%;
  min-height: 140px;
  flex: 1 1 0;
}

.panel-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--view-panel-gap);
  height: 300px;
}
.panel-large {
  height: 100%;
  min-height: 260px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 12px;
}
.panel-small {
  height: 462px;
  flex: 1 1 0;
}

/* ===== Panel-Design ===== */
.panel {
  background-color: var(--pergament);      /* Fallback, falls Textur fehlt */
  background-image: var(--textur-pergament);
  background-size: var(--textur-kachel);
  background-repeat: repeat;
  border: 0;                   /* Rahmen kommt als Overlay (::after) */
  border-radius: 0;            /* eckig, damit der eckige Zierrahmen buendig abschliesst */
  box-shadow: 0 4px 14px #0004;
  color: var(--tinte);
  padding: 18px 18px 14px 18px;
  margin-bottom: 0;
  font-family: 'MedievalSharp', 'UnifrakturCook', cursive;
  font-size: 0.9em; /* globale SchriftgrÃƒÂ¶ÃƒÅ¸e fÃƒÂ¼r Panel-Inhalte */
  min-width: 0;
  position: relative;          /* Bezug fuer den Zierrahmen-Overlay */
}
/* Zierrahmen als Overlay (::after) fuer ALLE Panels - veraendert die Panel-Groesse
   NICHT und sitzt exakt an der aeusseren Kante. Kein eigener Hintergrund (transparente Mitte). */
.panel::after {
  content: "";
  position: absolute;
  inset: 0;                    /* startet exakt an der Panel-Aussenkante */
  z-index: 2;                  /* immer ueber Panel-Inhalten (z.B. Footer-Leisten) */
  pointer-events: none;        /* Klicks gehen durch zum Panel-Inhalt */
  border: var(--rahmen-breite) solid transparent;
  border-image-source: var(--rahmen-quelle);
  border-image-slice: var(--rahmen-slice);
  border-image-width: var(--rahmen-breite);
  border-image-outset: var(--rahmen-outset);
  border-image-repeat: stretch;
}
.panel-large {
  min-height: 260px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 12px;
}
.panel-small {
  min-height: 140px;
  flex: 1 1 0;
}
.panel-tall {
  height: var(--view-panel-content-height);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
}

/* Im Fight-Modus soll das Gruppen-Panel dieselbe HÃƒÂ¶he wie die Kampf-Panels haben */
body.fight-mode #right-column #gruppe-panel { display: none; }

/* Setze die HÃƒÂ¶he des rechten Grid-Items im Fight-Modus fest,
   damit die GesamtzeilenhÃƒÂ¶he mit den anderen Fight-Panels ÃƒÂ¼bereinstimmt */
body.fight-mode #right-column {
  display: none;
}

/* Einheitliche SchriftgrÃƒÂ¶ÃƒÅ¸e fÃƒÂ¼r alle Panel-Titel (h2, h3) wie Inventar */
/* Panel-Titel nÃƒÂ¤her an den linken und oberen Rand */
/* Panel-Titel mit abgesetztem, dunklerem Hintergrund, optisch an Navigationsleiste angelehnt */
/* Panel-Titel mit durchgehendem Hintergrund ÃƒÂ¼ber gesamte Panel-Breite */
/* Panel-Titel mit Hintergrund exakt bÃƒÂ¼ndig zum Panel-Rand */
/* Panel-Titel bÃƒÂ¼ndig mit Panel-Rand, Hintergrund ÃƒÂ¼ber gesamte Breite */
/* Panel-Titel bÃƒÂ¼ndig mit Panel-Rand, Hintergrund ÃƒÂ¼ber gesamte Breite und oben bÃƒÂ¼ndig */
/* Panel-Titel bÃƒÂ¼ndig, Schrift nach rechts, Hintergrund bleibt bÃƒÂ¼ndig */
.panel h2, .panel h3 {
  display: block;
  width: calc(100% + 18px); /* nur links ausgleichen */
  margin-top: -18px;
  margin-left: -18px;
  margin-right: 0;
  margin-bottom: 10px;
  color: var(--tinte);
  font-family: var(--font-titel);
  font-weight: bold;
  letter-spacing: 1px;
  font-size: 1.2em; /* globale SchriftgrÃƒÂ¶ÃƒÅ¸e fÃƒÂ¼r Panel-Titel */
  padding: 8px 0 8px 18px;
  border-radius: 12px 12px 8px 8px;
  background-color: var(--pergament);
  background-image: var(--textur-pergament);
  background-size: var(--textur-kachel);
  background-repeat: repeat;
  border-bottom: 2px solid var(--holz-dunkel);

/* ÃƒÅ“bersichtspanel: Titelleiste bÃƒÂ¼ndig mit breitem Panel */
.panel-uebersicht h2, .panel-uebersicht h3 {
  width: calc(100% + 32px);
  margin-top: -24px;
  margin-left: -32px;
  margin-bottom: 18px;
  padding: 12px 0 12px 32px;
}
}

/* Abstand zwischen allen Panels */
.panel, .panel-row {
  margin-bottom: 0;
}

/* Spezifische Korrektur: rechten Innenabstand im Kampfbericht-Header vergrÃƒÂ¶ÃƒÅ¸ern */
.panel.kampfbericht-panel .report-header {
  padding-right: 48px !important;
}

#map-container {
  position: relative;
  margin-left: auto;
  margin-right: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}
/* Buttons im Umgebungspanel anpassen */
#umgebung-panel button {
  width: 100%;
  margin-bottom: 8px;
}

/* Inventar-Liste */
#inventar-panel ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
#inventar-panel li {
  margin-bottom: 3px;
}

#controls {
  margin-right: 20px;
}

/* ===== Buttons ===== */
#controls button {
  display: block;
  margin-bottom: 5px;
  padding: 5px 10px;
  cursor: pointer;
}

/* ===== Inventar ===== */
#inventar-panel {
  display: flex;
  flex-direction: column;
  position: relative;
  min-height: 320px;
}
.inventory-scroll {
  flex: 1 1 auto;
  overflow-y: auto;
  padding-right: 6px;
}
#inventory h3 { margin: 10px 0 5px; }
#inventory .inventory-list { display: flex; flex-direction: column; gap: 6px; }
.inventory-panel .inventory-row-item { display: flex; align-items: center; gap: 6px; line-height: 1.2; }
.inventory-panel .inventory-icon { width: 16px; height: 16px; image-rendering: pixelated; transform: translateY(-2px); }
.inventory-panel .inventory-label { flex: 0 0 auto; color: #2a1a0a; }
.inventory-panel .inventory-qty { font-weight: normal; color: #2a1a0a; }
.inventory-footer {
  position: sticky;
  bottom: -18px;
  margin-top: 12px;
  margin-left: -18px;
  margin-right: -18px;
  margin-bottom: -14px;
  padding: 6px 18px;
  display: flex;
  justify-content: center;
  background-color: var(--pergament);
  background-image: var(--textur-pergament);
  background-size: var(--textur-kachel);
  background-repeat: repeat;
  border-top: 2px solid var(--holz-dunkel);
  border-radius: 0 0 12px 12px;
}
.inventory-footer .feld-aufwerten-link {
  margin: 0 !important;
}
.carry-indicator {
  font-size: 0.85em;
  margin-left: 8px;
  color: #2a1a0a;
  transition: color 0.25s ease;
  white-space: nowrap;
}
.carry-indicator.carry-overloaded {
  font-weight: 600;
}
.carry-indicator.carry-hardcap {
  text-shadow: 0 0 6px rgba(201, 26, 26, 0.4);
}

/* ===== Map Grid ===== */
/* Map-Container mit eigenem Goldrahmen (nur um die Map) */
#map-container {
  position: relative;
  margin: 0 auto;
  width: 560px;
  height: 560px;
  box-sizing: border-box;
  background: #333;
  border: 0;
  border-radius: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
}
/* Goldener Zierrahmen als Overlay – identisch zu .panel::after */
#map-container::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  border: var(--rahmen-breite) solid transparent;
  border-image-source: var(--rahmen-quelle);
  border-image-slice: var(--rahmen-slice);
  border-image-width: var(--rahmen-breite);
  border-image-outset: var(--rahmen-outset);
  border-image-repeat: stretch;
}
#map {
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  gap: 0;
  background: #333;
  margin: 0;
  will-change: transform;
}

/* Markieren/Textauswahl auf der Karte unterbinden (störendes Drag-Select über
   Tiles/Charakter-Icons). Gilt für den Container inkl. aller Overlay-Ebenen. */
#map-container {
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
}
#map-container img {
  -webkit-user-drag: none;
  user-select: none;
}

/* Fixes Spieler-Overlay: bleibt immer in der Kartenmitte, während die
   Kachel-Ebene (#map) beim Gehen darunter durchscrollt. */
#map-player-actor {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 52px;
  height: 52px;
  z-index: 3;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}
#map-player-actor img {
  width: 52px;
  height: 52px;
  object-fit: contain;
  filter: drop-shadow(0 1px 2px #fff8);
}
#map-player-actor .player-fallback {
  font-size: 28px;
}

/* Overlay-Ebene für fremde Spieler-Gruppen: liegt über den Kacheln und scrollt
   synchron mit der Kachel-Ebene (#map) – gleiche Transform. So können fremde
   Gruppen bei Bewegung flüssig gleiten statt zu springen. */
#map-foreign-actors {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  pointer-events: none;
  will-change: transform;
}
.foreign-actor {
  position: absolute;
  top: 0;
  left: 0;
  width: 52px;
  height: 52px;
  margin-left: -26px;
  margin-top: -26px;
  will-change: transform;
}
.foreign-actor img {
  width: 52px;
  height: 52px;
  object-fit: contain;
  filter: drop-shadow(0 1px 2px #fff8);
}

/* Overlay-Ebene für Monster: wie die Fremdspieler-Ebene, aber darunter (fremde
   Spieler liegen visuell über Monstern). Ebenfalls synchron mit #map. */
#map-monster-actors {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  pointer-events: none;
  will-change: transform;
}
.monster-actor {
  position: absolute;
  top: 0;
  left: 0;
  width: 52px;
  height: 52px;
  margin-left: -26px;
  margin-top: -26px;
  will-change: transform;
}
.monster-actor img {
  width: 52px;
  height: 52px;
  object-fit: contain;
  filter: drop-shadow(0 1px 2px #fff8);
}

/* ===== Tiles ===== */
.tile {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  font-size: 12px;
  cursor: pointer;
  border: none;
  box-sizing: border-box;
  overflow: hidden;
  margin: 0;
  padding: 0;
}
.tile .tile-bg-img {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
  pointer-events: none;
}

/* Monster-Icon auf der Map */
.monster-icon {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: 3.5em; /* ca. doppelt so groÃƒÅ¸ wie zuvor */
  z-index: 2;
  pointer-events: none;
  filter: drop-shadow(0 1px 2px #fff8);
}
.monster-icon-img {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 52px;  /* ca. doppelte GrÃƒÂ¶ÃƒÅ¸e */
  height: 52px;
  object-fit: contain;
  z-index: 2;
  pointer-events: none;
  filter: drop-shadow(0 1px 2px #fff8);
}

.map-multi-group-badge {
  position: absolute;
  left: calc(50% + 18px);
  top: calc(50% - 26px);
  transform: translate(-50%, -50%);
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #bfa046;
  border: 1px solid #7c5a1a;
  color: #000;
  font-size: 13px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  z-index: 4;
  pointer-events: none;
  box-shadow: 0 1px 3px #0006;
}

/* GebÃƒÂ¤ude Icons (Layer zwischen Tile-Hintergrund und Monstern/Spieler) */
.building-icon-img {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 60px;
  height: 60px;
  object-fit: contain;
  z-index: 2; /* gleiche Ebene wie Monster -> Reihenfolge: zuerst GebÃƒÂ¤ude eingefÃƒÂ¼gt */
  opacity: 0.95;
  pointer-events: none;
  filter: drop-shadow(0 1px 2px #0008);
}

.tile .building-tile-img {
  left: 0;
  top: 0;
  transform: none;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 1;
  filter: none;
}

.nest-icon-img {
  width: 56px;
  height: 56px;
}

/* Feldtypen Farben */
.tile.weide { background-color: #b7e1a1; }     
.tile.wald { background-color: #4a7c35; }      
.tile.gebirge { background-color: #888888; }   
.tile.wasser { background-color: #4da6ff; }    
.tile.hochsee { background-color: #002b80; }   /* NEU */
.tile.anleger { background-color: #f3d7a1; }
.tile.hafen { background-color: #e5c07b; }

/* ===== Spieler ===== */
.player {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: 28px;
  pointer-events: none;
  z-index: 2;
}

/* ===== Koordinaten ===== */
.coords {
  position: absolute;
  bottom: 2px;
  left: 2px;
  font-size: 10px;
  color: #000;
  background-color: rgba(255,255,255,0.6);
  padding: 1px 3px;
  border-radius: 3px;
}

/* ===== Ressourcenanzeige ===== */
.res {
  position: absolute;
  top: 2px;
  right: 2px;
  font-size: 10px;
  color: #000;
  background-color: rgba(255,255,255,0.6);
  padding: 1px 3px;
  border-radius: 3px;
}

/* ===== AP Anzeige ===== */
#ap-display {
  margin-top: 10px;
  font-weight: bold;
}

.ui-value-icon {
  display: inline-block;
  width: 16px;
  height: 16px;
  object-fit: contain;
  vertical-align: -3px;
  flex: 0 0 16px;
}

.aa-icon .ui-value-icon {
  display: block;
  vertical-align: middle;
}

.friend-controls .player-picker,
.enemy-controls .player-picker {
  width: 200px;
}

.friend-controls a,
#friends-list a,
.enemy-controls a,
#enemies-list a {
  font-size:1em;
}

/* ===== GebÃƒÂ¤udeansicht (Full Screen) ===== */
/* Gleiche AuÃƒÅ¸enabstÃƒÂ¤nde wie #main-grid: kein seitliches Padding hier, Top-Abstand ÃƒÂ¼ber Grid-Margin */
.building-view-layout { position:relative; width:100%; padding:0; box-sizing:border-box; overflow-x:hidden; }
/* 3-Spalten Grid analog #main-grid (2fr 560px 2fr) */
.building-3col-layout { display:grid; grid-template-columns:minmax(0, 2fr) 560px minmax(0, 2fr); gap:var(--view-panel-gap); max-width:var(--view-max-width); margin:var(--view-top-gap) auto 0; align-items:start; min-height:var(--view-panel-min-height); }
.building-3col-layout .bcol { display:flex; flex-direction:column; gap:var(--view-panel-gap); min-height:0; min-width:0; }
/* Linke Spalte: Rollenspiel-Panel fÃƒÂ¼llt komplette HÃƒÂ¶he */
.building-3col-layout .bcol-left { height:var(--building-col-height); min-height:var(--building-col-height); display:flex; flex-direction:column; }
.building-3col-layout .bcol-left .rp-panel { flex:1 1 0; display:flex; flex-direction:column; min-height:0; overflow:hidden; box-sizing:border-box; }
.building-3col-layout .bcol-left .rp-panel .rp-block { flex:1 1 auto; min-height:0; overflow-y:auto; overflow-x:hidden; }
.building-3col-layout { --building-col-height:var(--view-panel-min-height); }
/* Center + Right: gleiche feste HÃƒÂ¶he und gleich hohe Unterpanels */
.building-3col-layout .bcol-center, .building-3col-layout .bcol-right { height:var(--building-col-height); min-height:var(--building-col-height); display:flex; flex-direction:column; }
.building-3col-layout .bcol-right { display:grid; grid-template-rows:repeat(2, minmax(0, 1fr)); }
.building-3col-layout .bcol-center > .panel, .building-3col-layout .bcol-right > .panel { flex:1 1 0; min-height:0; display:flex; flex-direction:column; overflow-y:auto; overflow-x:hidden; }
/* Linkes Panel ebenfalls gegen horizontales ÃƒÅ“berlaufen absichern (Header nutzt neg. Margin) */
.building-3col-layout .bcol-left > .panel { overflow-x:hidden; }
.building-3col-layout :is(.bcol, .building-storage-row) > .panel {
  box-sizing: border-box;
  margin: 0;
}
#building-view :is(.bcol, .building-storage-row) > .panel {
  overflow: hidden;
}
.building-3col-layout :is(.bcol, .building-storage-row) > .panel > :is(h2, h3) {
  flex-shrink: 0;
}
.building-storage-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--view-panel-gap);
  min-height: 0;
  min-width: 0;
}
.building-storage-row > .panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.building-storage-row .inventory-scroll {
  min-height: 0;
}
.building-storage-row .inventory-footer {
  flex-shrink: 0;
  justify-content: safe center;
  overflow: auto;
}
.building-panel-content {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}
#building-view .danger-zone {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-shrink: 0;
  margin-top: 8px;
}
#building-view .building-storage #b-lager-list {
  max-height: none;
  overflow: visible;
}

.rp-panel .rp-block p { margin:4px 0 8px; }
/* Crew Columns */
.crew-columns { display:flex; gap:12px; align-items:flex-start; }
.building-crew .crew-columns { flex-direction: column; gap: 4px; }
.building-crew .crew-head { display:grid; grid-template-columns: 1fr 1fr; column-gap: 24px; margin-bottom: 2px; width:100%; }
.building-crew .crew-lists { display:grid; grid-template-columns: 1fr 1fr; column-gap: 24px; position: relative; width:100%; }
.building-crew .crew-lists::before { content:""; position:absolute; top:0; bottom:0; left:50%; width:1px; background:#2a1a0a66; transform: translateX(-0.5px); }
.building-crew .crew-actions { display:flex; justify-content:center; margin-top: 10px; }
.building-crew .crew-actions .feld-aufwerten-link { margin: 0; }
.building-crew .crew-col-list > div { margin-bottom: 4px; }

/* ===== Diplomatie-Ansicht Layout ===== */
.diplomacy-grid { display:grid; grid-template-columns:minmax(0, 2fr) 560px minmax(0, 2fr); gap:var(--view-panel-gap); max-width:var(--view-max-width); margin:var(--view-top-gap) auto 0; align-items:start; height:var(--view-panel-min-height); }
.diplomacy-left { display:flex; flex-direction:column; gap:var(--view-panel-gap); height:100%; min-height:0; }
.diplomacy-grid .panel { box-sizing:border-box; min-height:0; margin:0; overflow:hidden; }
.diplomacy-grid .panel > :is(h2, h3) { flex-shrink:0; }
.diplomacy-left > .panel-large { height:auto; flex:0 0 calc(292px + var(--view-space-gain)); }
.diplomacy-left > .panel-row { flex:1 1 auto; height:auto; min-height:0; }
.diplomacy-left .panel-small { display:flex; flex-direction:column; height:100%; }
.diplomacy-panel-content { flex:1 1 auto; min-height:0; width:100%; overflow:auto; }
#nachrichten-panel { height:100%; }
#nachrichten-panel > :not(#messages-list) { flex-shrink:0; }
.lehnwesen-controls { display:flex; flex-direction:column; gap:12px; align-items:stretch; }
.lehnwesen-controls { display:flex; flex-direction:column; gap:12px; align-items:flex-start; }
.lehn-selection-row { display:flex; flex-wrap:wrap; gap:10px; align-items:center; }
.lehn-selection-actions { margin-left:auto; display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.lehn-label { font-weight:600; color:#2a1a0a; }
.lehn-hint { margin:0; font-size:0.85em; color:#2a1a0a99; }
.lehnwesen-controls .feld-aufwerten-link { font-size:1em; }

.lehn-summary { width:100%; display:flex; flex-direction:column; gap:12px; align-items:flex-start; text-align:left; }
.lehn-summary-label { font-weight:600; color:#2a1a0a; }
.lehn-summary-body { width:100%; display:flex; flex-direction:column; align-items:flex-start; justify-content:flex-start; gap:8px; }
.lehn-summary-body .liege-node { padding:0; background:transparent; box-shadow:none; }
.lehn-summary-body .liege-node-portrait { width:96px; height:120px; }
.lehn-summary-body .liege-node-name { text-decoration:underline; font-size:0.95em; }
.lehn-summary-placeholder { font-size:0.85em; color:#2a1a0a99; text-align:left; }

dialog.small-equip-popup.standard-popup.liege-chain-popup {
  --liege-blue: #0a151c;
  --liege-gold: #e4cb8b;
  width: min(1600px, calc(100vw - 32px));
  height: min(820px, calc(100dvh - 32px));
  padding: 20px 24px;
  overflow: hidden;
  color: var(--liege-gold);
  background: linear-gradient(#0006, #0006), var(--liege-blue) url('assets/bg/Lehnskette.webp') center / cover no-repeat;
}
.liege-chain-popup[open] { display: flex; flex-direction: column; }
.liege-chain-popup > .equip-popup-header { flex: none; color: var(--liege-gold); text-shadow: 0 2px 3px #000; }
.liege-chain-popup > .standard-popup-content { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.liege-chain-view { position: relative; flex: 1; min-height: 0; }
.liege-chain-viewport { position: absolute; inset: 0; overflow: hidden; cursor: grab; touch-action: none; user-select: none; }
.liege-chain-viewport.is-dragging { cursor: grabbing; }
.liege-chain-viewport:focus-visible { outline: 1px solid var(--liege-gold); outline-offset: -1px; }
.liege-chain-canvas { position: absolute; top: 0; left: 0; width: 0; height: 0; transform-origin: 0 0; }
.liege-chain-lines { position: absolute; left: 0; top: 0; width: 1px; height: 1px; overflow: visible; pointer-events: none; }
.liege-chain-lines path { fill: none; stroke: var(--liege-gold); stroke-width: 2; stroke-linecap: square; }
.liege-tree-card {
  position: absolute; box-sizing: border-box; display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 8px; border: 2px solid var(--liege-gold); border-radius: 2px;
  background: var(--liege-blue); color: var(--liege-gold); box-shadow: 0 3px 8px #0008;
}
.liege-tree-card[hidden] { display: none; }
.liege-tree-card-focus { background: #193444; box-shadow: 0 0 12px #e4cb8b80; }
.liege-tree-portrait { width: 80px; height: 100px; flex: none; overflow: hidden; background: url('assets/placeholders/character.svg') center / contain no-repeat; }
.liege-tree-portrait img { display: block; width: 100%; height: 100%; object-fit: cover; }
.liege-tree-portrait img:not([src]), .liege-tree-portrait img[hidden] { visibility: hidden; }
.liege-tree-name { font-size: 14px; line-height: 16px; font-weight: 600; text-align: center; overflow-wrap: anywhere; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.liege-chain-arrow {
  position: absolute; z-index: 1; display: flex; align-items: center; justify-content: center;
  box-sizing: border-box; width: 32px; height: 32px; margin: 0; padding: 0;
  color: var(--liege-gold); background: var(--liege-blue); border: 1px solid var(--liege-gold); border-radius: 2px;
  font: 20px Georgia, serif; cursor: pointer; box-shadow: 0 2px 6px #0008;
}
.liege-chain-arrow[hidden] { display: none; }
.liege-chain-arrow:hover, .liege-chain-arrow:focus-visible { background: #18313f; outline: 2px solid var(--liege-gold); outline-offset: 1px; }
.liege-chain-arrow[data-direction="up"] { top: 0; left: calc(50% - 16px); }
.liege-chain-arrow[data-direction="down"] { bottom: 0; left: calc(50% - 16px); }
.liege-chain-arrow[data-direction="left"] { left: 0; top: calc(50% - 16px); }
.liege-chain-arrow[data-direction="right"] { right: 0; top: calc(50% - 16px); }
.liege-chain-status { flex: none; min-height: 18px; margin: 6px 0 0; text-align: center; font-size: 14px; text-shadow: 0 1px 3px #000; }
.liege-chain-controls { flex: none; flex-wrap: wrap; margin-top: 6px; padding: 8px; background: var(--liege-blue); border: 1px solid #e4cb8b66; border-radius: 2px; }
.liege-chain-controls input[type="range"] { accent-color: var(--liege-gold); }
.liege-chain-player { display: flex; align-items: center; gap: 8px; min-width: 0; max-width: 100%; }
.liege-chain-player .player-picker { width: 180px; }
.liege-chain-zoom-value { width: 52px; text-align: right; font-size: 14px; }
@media (max-width: 600px) {
  dialog.small-equip-popup.standard-popup.liege-chain-popup { padding: 14px 12px; }
  .liege-chain-controls { gap: 6px; }
  .liege-chain-controls input[type="range"] { flex-basis: calc(100% - 140px); }
  .liege-chain-controls [data-action] { flex: 1; }
  .liege-chain-player { flex: 1 1 100%; }
  .liege-chain-player .player-picker { flex: 1; }
}

.liege-node { display:flex; flex-direction:column; align-items:center; gap:8px; padding:8px 12px; border-radius:10px; background:transparent; min-width:120px; max-width:180px; }
.liege-node-portrait { width:96px; height:120px; border:1px solid #e0c97a; border-radius:10px; overflow:hidden; background:#f0e6c0; display:flex; align-items:center; justify-content:center; }
.liege-node-portrait img { width:100%; height:100%; object-fit:cover; }
.liege-node-name { border:none; background:none; cursor:pointer; color:#2a1a0a; font-weight:600; text-decoration:underline; font-size:0.95em; }
.liege-node-name:disabled { cursor:default; text-decoration:none; color:#2a1a0a; }
.liege-node-focus .liege-node-portrait { border-width:2px; border-color:#7c5a1a; box-shadow:0 2px 8px #0003; }
.liege-node-focus .liege-node-name { text-decoration:none; cursor:default; }
.liege-node-liege .liege-node-portrait { border-style:solid; }
.liege-node-vassal .liege-node-portrait { border-color:#bfa046; }
.diplomacy-messages { grid-column: 2 / 4; display:flex; flex-direction:column; overflow:hidden; align-items: stretch; }
.building-crew .crew-line { display:flex; align-items:center; gap:6px; }
.building-crew .crew-line label { display:flex; align-items:center; gap:6px; }
.building-crew .crew-class-icon { width:16px; height:16px; transform: translateY(-2px); }
.building-crew .crew-head > div { text-align: left; }
.building-crew .crew-head h4 { margin: 0 0 2px 0; }
.crew-col { flex:1; max-height:220px; overflow:auto; font-size:0.85em; line-height:1.2; }
.crew-col h4 { margin:0 0 4px 0; font-size:0.9em; }
.admin-buttons { display:flex; flex-wrap:wrap; gap:6px; margin-bottom:8px; }
.admin-buttons button { font-size:0.8em; }
.supplies-form { display:flex; align-items:center; gap:6px; margin-top:4px; }
.supplies-form input { font-size:0.8em; }
/* VorrÃƒÂ¤te: Eingabefeld soll wie im Gruppen-Inventar aussehen */
.building-admin .vorrat-row.inventory-row { gap: 8px; }
.building-storage #b-lager-list div { font-size:0.9em; }
.building-storage #b-lager-list { display: grid; grid-template-columns: minmax(0, 1fr); row-gap: 2px; align-items: start; max-height: 320px; overflow:auto; position: relative; }
.building-storage #b-lager-list.placeholder { display:flex; align-items:center; justify-content:center; position:relative; }
/* Align resource rows top-left in each column */
.building-storage #b-lager-list > div { justify-content: flex-start; align-items: center; }
.building-storage #b-lager-list > div:last-child { margin-bottom: 0; }
/* Panels ÃƒÂ¼bernehmen Standard-.panel Stil (Gradient, Header). Keine Override-HintergrÃƒÂ¼nde mehr. */
/* Kleinere Anpassungen nur falls nÃƒÂ¶tig */
.building-view-layout .panel { position:relative; }
/* GebÃƒÂ¤udeinfo-Zeile: Besitzer inline neben Name/Koordinaten */
.building-admin .building-title { display:flex; flex-wrap:wrap; gap:8px; align-items:baseline; }
.building-admin .building-title .owner-label { white-space:nowrap; }
/* Produktionstabelle im GebÃƒÂ¤ude */
.produktion-wrapper { margin-top:4px; }
.produktion-tabelle { width:100%; border-collapse:collapse; font-size:0.85em; background:#fffbe8; box-shadow:0 1px 4px #bfa04622; }
.produktion-tabelle th, .produktion-tabelle td { border:1px solid #e0d6b6; padding:4px 6px; text-align:center; }
.produktion-tabelle th { background:#f3e2b8; font-weight:bold; font-size:0.9em; }
.produktion-tabelle tbody tr:nth-child(even):not(.fert-row) { background:#f8f5e6; }
.produktion-tabelle button.prod-up-btn { background:none; border:1px solid #bfa046aa; border-radius:6px; padding:2px 6px; cursor:pointer; font-family:'MedievalSharp','UnifrakturCook',cursive; font-size:0.85em; color:#2a1a0a; }
.produktion-tabelle button.prod-up-btn:hover { background:#ffe08a55; }
/* Variante ohne sichtbares Grid */
.produktion-tabelle.no-grid { background:transparent; box-shadow:none; }
.produktion-tabelle.no-grid th, .produktion-tabelle.no-grid td { border:none; background:transparent; }
.produktion-tabelle.no-grid tbody tr:nth-child(even) { background:transparent; }
.produktion-tabelle.no-grid th { font-weight:bold; }
.produktion-tabelle.no-grid button.prod-up-btn { border:1px solid #bfa04666; }
/* Sonstiges Tabelle */
.misc-wrapper { margin-top:18px; }
.misc-tabelle { width:100%; border-collapse:collapse; font-size:0.85em; background:#fffbe8; box-shadow:0 1px 4px #bfa04622; }
.misc-tabelle th, .misc-tabelle td { border:1px solid #e0d6b6; padding:4px 6px; text-align:center; }
.misc-tabelle th { background:#f3e2b8; font-weight:bold; font-size:0.9em; }
.misc-tabelle.no-grid { background:transparent; box-shadow:none; }
.misc-tabelle.no-grid th, .misc-tabelle.no-grid td { border:none; background:transparent; }
.misc-tabelle.no-grid tbody tr:nth-child(even) { background:transparent; }
.misc-tabelle button.misc-up-btn { background:none; border:1px solid #bfa046aa; border-radius:6px; padding:2px 6px; cursor:pointer; font-family:'MedievalSharp','UnifrakturCook',cursive; font-size:0.85em; color:#2a1a0a; }
.misc-tabelle button.misc-up-btn:hover { background:#ffe08a55; }
/* Neue kombinierte Ausbauten-Tabelle */
.prod-summary { margin:4px 0 12px 0; font-weight:normal; line-height:1.25; }
.prod-summary .prod-label { font-weight:bold; }
.prod-summary .prod-period { font-weight:normal; }
.ausbauten-wrapper { margin-top:4px; }
.ausbauten-title { margin:0 0 6px 0; font-size:0.9em; font-weight:bold; letter-spacing:0.5px; }
.ausbauten-tabelle { width:100%; border-collapse:collapse; font-size:0.9em; background:#fffbe8; box-shadow:0 1px 4px #bfa04622; }
.ausbauten-tabelle th, .ausbauten-tabelle td { border:1px solid #e0d6b6; padding:4px 6px; text-align:center; }
.ausbauten-tabelle th { background:#f3e2b8; font-weight:bold; font-size:0.9em; }
.ausbauten-tabelle.no-grid { background:transparent; box-shadow:none; }
.ausbauten-tabelle.no-grid th, .ausbauten-tabelle.no-grid td { border:none; background:transparent; }
.ausbauten-tabelle.no-grid tbody tr:nth-child(even) { background:transparent; }
.ausbauten-tabelle button.ausbau-up-btn { background:none; border:1px solid #bfa046aa; border-radius:6px; padding:2px 6px; cursor:pointer; font-family:'MedievalSharp','UnifrakturCook',cursive; font-size:0.85em; color:#2a1a0a; }
.ausbauten-tabelle button.ausbau-up-btn:hover { background:#ffe08a55; }
/* Trennzeile zwischen Produktions- und sonstigen Ausbauten */
.ausbauten-tabelle tr.sep-row td { position:relative; }
.ausbauten-tabelle.no-grid tr.sep-row td { padding-top:8px; }
.ausbauten-tabelle.no-grid tr.sep-row:first-child td { padding-top:4px; }
.ausbauten-tabelle.no-grid tr.sep-row td::before { content:""; position:absolute; left:0; right:0; top:2px; height:1px; background:#2a1a0a66; }

/* ===== Aktionen-Ansicht: Bauten-Panel unter der Map ===== */
#center-column .panel-bauten {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  flex: 0 0 220px;
  width: 560px;
  height: 220px;
  min-height: 220px;
  margin-left: auto;
  margin-right: auto;
  overflow: hidden;
}
#bauten-content { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; }
#bauten-content .bauten-row { display: grid; grid-template-columns: 120px 1fr; column-gap: 16px; align-items: start; }
#bauten-content .bauten-row.no-icon { grid-template-columns: 1fr; }
/* In der Kampfansicht kein Bauten-Panel anzeigen */
body.fight-mode #center-column #bauten-panel { display: none !important; }
#bauten-content .bauten-icon { width: 120px; height: 120px; object-fit: contain; image-rendering: pixelated; }
#bauten-content .bauten-lines { display: flex; flex-direction: column; gap: 8px; }
#bauten-content .bauten-header { display: flex; align-items: baseline; gap: 12px; }
#bauten-content .bauten-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
#bauten-content .bauten-actions .feld-aufwerten-link { margin: 0; }
#bauten-content .bauten-empty { font-style: italic; opacity: 0.8; }

/* Gleiche Abstaende zwischen Status, Karte und Bauten. */
#center-column { display: flex; flex-direction: column; align-items: center; gap: var(--view-panel-gap); }

/* ===== Aktionen-Ansicht: Statusleiste über der Map ===== */
#status-panel {
  position: relative;
  z-index: 3;
  box-sizing: border-box;
  width: 560px;
  height: 44px;
  flex: 0 0 44px;
  margin-left: auto;
  margin-right: auto;
  padding: 8px 18px;
  color: var(--btn-text);
}
#status-panel::before {
  content: "";
  position: absolute;
  left: -12px;
  top: -7px;
  width: calc(100% + 24px);
  height: 82px;
  background: url("assets/deco/status_bar.png") center / 100% 100% no-repeat;
  pointer-events: none;
}
#status-panel .status-values-row {
  position: relative;
  top: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
#status-panel #ap-display { margin: 0; font-weight: bold; text-align: center; }
#status-panel #adminToggleBtn { display: inline-block; margin: 0; white-space: nowrap; }

#map-view-menu { position: relative; }
#map-view-button { margin: 0; white-space: nowrap; }
#map-view-options {
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 999;
  min-width: 150px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: #2a1a0a;
  background-color: var(--pergament);
  background-image: var(--textur-pergament);
  border: 2px solid var(--gold);
  border-radius: 14px;
  box-shadow: 0 8px 16px #0006;
}
#map-view-options[hidden] { display: none; }
#map-view-options label { cursor: pointer; white-space: nowrap; }
.field-ownership-row { display: flex; width: 100%; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.field-ownership-row > span:first-child { flex: 0 1 auto; min-width: 0; overflow-wrap: anywhere; }
#umgebung-panel #requisition-button { margin: 0; white-space: nowrap; }
#umgebung-panel .field-action button { width: auto; margin: 0; white-space: nowrap; }
#umgebung-panel .field-action .standard-button,
#umgebung-panel .standard-button,
.standard-button,
#bauten-panel .feld-aufwerten-link {
  display: inline-flex;
  box-sizing: border-box;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: var(--standard-button-width, auto);
  height: 25px;
  font-family: var(--font-titel);
  font-size: 14px;
  font-weight: 600;
  font-style: normal;
  font-variant-numeric: lining-nums tabular-nums;
  line-height: normal;
  letter-spacing: 0.2px;
  white-space: nowrap;
}
.standard-button--mini { --standard-button-width: 30px; }
.standard-button--small { --standard-button-width: 55px; }
.standard-button--large { --standard-button-width: 180px; }
.panel > .panel-help-header {
  display: flex;
  align-items: center;
  gap: 8px;
}
.panel > .panel-help-header > .panel-help-button,
#umgebung-panel .panel-help-button {
  display: inline-flex;
  box-sizing: border-box;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 25px;
  padding: 0;
  margin: 0 10px 0 auto !important;
  align-self: center !important;
  appearance: none;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  cursor: pointer;
}
.panel-help-button:focus-visible {
  outline: 2px solid #7c5a1a;
  outline-offset: 2px;
}
.panel-help-button img {
  display: block;
  width: 20px;
  height: 20px;
  object-fit: contain;
}
.standard-popup .standard-button,
.market-compact .standard-button,
.owned-recipes .standard-button,
#city-open-library,
[data-guild],
#admin-recipe-editor {
  color: #2a1a0a;
  background: linear-gradient(180deg, #f8edcc 0%, #e8cf98 100%);
  border: 1.5px solid #987334;
  border-radius: 4px;
  padding: 2px 6px;
  margin: 0;
  text-decoration: none;
  text-shadow: none;
  box-shadow: inset 0 1px 0 #fff8, inset 0 -1px 0 #936b2426, 0 1px 2px #2a1a0a26;
  cursor: pointer;
  transition: background 0.12s, box-shadow 0.12s, transform 0.04s;
}
.standard-popup .standard-button:hover,
.standard-popup .standard-button:focus,
.market-compact .standard-button:hover,
.market-compact .standard-button:focus,
[data-guild]:hover, [data-guild]:focus,
.owned-recipes .standard-button:hover,
.owned-recipes .standard-button:focus,
#city-open-library:hover, #city-open-library:focus,
#admin-recipe-editor:hover, #admin-recipe-editor:focus {
  background: linear-gradient(180deg, #fff8e4 0%, #f6dfa8 100%);
  box-shadow: inset 0 1px 0 #fffc, 0 2px 4px #2a1a0a40;
}
.standard-popup .standard-button:focus-visible,
.market-compact .standard-button:focus-visible,
[data-guild]:focus-visible,
.owned-recipes .standard-button:focus-visible,
#city-open-library:focus-visible,
#admin-recipe-editor:focus-visible { outline: 2px solid #7c5a1a; outline-offset: 2px; }
.standard-popup .standard-button:active,
.market-compact .standard-button:active,
[data-guild]:active,
.owned-recipes .standard-button:active,
#city-open-library:active,
#admin-recipe-editor:active { transform: translateY(1px); }
.standard-popup .standard-button--danger {
  color: #f8edcc;
  border-color: #702020;
  background: linear-gradient(180deg, #a52e2e 0%, #781c1c 100%);
  box-shadow: inset 0 1px 0 #fff8, inset 0 -1px 0 #36090966, 0 1px 2px #2a1a0a26;
}
.standard-popup .standard-button--danger:hover,
.standard-popup .standard-button--danger:focus {
  color: #f8edcc;
  background: linear-gradient(180deg, #b83b3b 0%, #922727 100%);
  box-shadow: inset 0 1px 0 #fffc, 0 2px 4px #48101040;
}
.standard-popup .standard-button--danger:focus-visible { outline-color: #702020; }
.standard-popup .standard-button:disabled,
.market-compact .standard-button:disabled,
.owned-recipes .standard-button:disabled { opacity: 0.55; cursor: default; transform: none; }
.standard-popup .standard-button img,
.market-compact .standard-button img { display: block; width: 16px; height: 16px; object-fit: contain; }
.market-compact .standard-button { vertical-align: middle; }
dialog.small-equip-popup.standard-popup {
  position: fixed;
  inset: 0;
  margin: auto;
  width: min(760px, calc(100vw - 32px));
  height: auto;
  max-height: calc(100vh - 32px);
  box-sizing: border-box;
  color: var(--tinte);
  overflow: auto;
}
.standard-popup::backdrop { background: #0008; }
.standard-popup .equip-popup-header { text-align: center; padding: 0 28px; margin-bottom: 12px; }
.standard-popup-content { min-height: 0; overflow-wrap: anywhere; }
.recipe-filters, .recipe-editor-selection, .recipe-entry-action,
.recipe-crafting-row, .recipe-editor-actions, .recipe-effect-row, .recipe-resource-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.recipe-filters { margin-bottom: 12px; }
.recipe-filters label, .recipe-editor-fields label { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.recipe-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: 12px; }
.recipe-entry { border: 1px solid #987334; padding: 10px; }
.recipe-item-heading { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.recipe-entry-action { margin-top: 8px; }
.recipe-cost, .recipe-price { display: inline-flex; gap: 3px; align-items: center; white-space: nowrap; }
.recipe-message { margin: 8px 0; }
.recipe-message:empty, .recipe-blocked-reason:empty { display: none; }
.recipe-error, .recipe-blocked-reason { color: #8a1c1c; }
#b-crafting { margin-top: 6px; }
.recipe-editor-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px; }
.recipe-definition-form { display: grid; gap: 12px; }
.recipe-definition-form fieldset { border: 1px solid #987334; margin: 0; min-width: 0; padding: 8px; }
.recipe-definition-form fieldset[hidden] { display: none; }
.recipe-editor-description { display: flex; flex-direction: column; gap: 4px; }
.recipe-editor-description textarea { width: 100%; box-sizing: border-box; resize: vertical; }
.recipe-definition-form input:not([type="checkbox"]):not([type="hidden"]),
.recipe-definition-form select { min-width: 0; max-width: 100%; box-sizing: border-box; }
.recipe-effect-row, .recipe-resource-row { margin-bottom: 6px; }
.recipe-resource-row input, .recipe-effect-row input { width: 90px; }
.recipe-icon-gallery { display: flex; flex-wrap: wrap; gap: 6px; max-height: 180px; overflow: auto; margin-top: 8px; }
.recipe-icon-gallery [aria-pressed="true"] { outline: 2px solid #294b16; outline-offset: 1px; }
dialog.small-equip-popup.recipe-purge-confirmation { width: min(460px, calc(100vw - 32px)); }
.recipe-editor-actions { margin-top: 8px; }
.standard-popup, .standard-popup * {
  scrollbar-color: #f8f5e6 #2a1a0a;
  scrollbar-width: thin;
}
.standard-popup::-webkit-scrollbar, .standard-popup *::-webkit-scrollbar { width: 12px; height: 12px; }
.standard-popup::-webkit-scrollbar-track, .standard-popup *::-webkit-scrollbar-track { background: #2a1a0a; }
.standard-popup::-webkit-scrollbar-thumb, .standard-popup *::-webkit-scrollbar-thumb { background: #f8f5e6; border-radius: 6px; border: 2px solid #2a1a0a; }
.standard-popup::-webkit-scrollbar-thumb:hover, .standard-popup *::-webkit-scrollbar-thumb:hover { background: #fff0d0; }
.standard-popup::-webkit-scrollbar-button, .standard-popup *::-webkit-scrollbar-button { background: #f8f5e6; height: 12px; }
.standard-popup::-webkit-scrollbar-corner, .standard-popup *::-webkit-scrollbar-corner { background: #2a1a0a; }
.standard-button--medium { --standard-button-width: 140px; }
#bauten-panel .feld-aufwerten-link { --standard-button-width: 180px; }
:is(.standard-button, .feld-aufwerten-link).standard-button--inactive,
:is(.standard-button, .feld-aufwerten-link).standard-button--inactive:is(:hover, :focus, :active) {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}
.guild-ranks { display: grid; gap: 12px; }
dialog.small-equip-popup.standard-popup.guild-popup,
dialog.small-equip-popup.standard-popup.guild-report-popup { height: fit-content; overflow: hidden; }
dialog.small-equip-popup.standard-popup.guild-fighter-report-popup { width: min(912px, calc(100vw - 32px)); }
.guild-popup > .equip-popup-header,
.guild-report-popup > .equip-popup-header { flex-shrink: 0; }
.guild-popup > .standard-popup-content,
.guild-report-popup > .standard-popup-content { overflow: auto; }
.guild-popup > .standard-popup-content > :first-child,
.guild-report-popup > .standard-popup-content > :first-child { margin-top: 0; }
.guild-popup > .standard-popup-content > :last-child,
.guild-report-popup > .standard-popup-content > :last-child { margin-bottom: 0; }
.guild-rank { border-top: 1px solid #987334; padding-top: 8px; }
.guild-rank h3 { margin: 0 0 6px; }
.guild-action { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.guild-action label { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.guild-action select { max-width: 100%; }
.guild-cost { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.guild-message { color: #8b2020; }
.guild-message:empty { display: none; }
.guild-table-scroll { max-width: 100%; overflow: auto; }
.guild-market-table { min-width: 500px; }
.guild-resource-table { table-layout: fixed; min-width: 700px; }
.guild-resource-table th, .guild-resource-table td { overflow-wrap: anywhere; }
.guild-resource-table .guild-market-sort { max-width: 100%; box-sizing: border-box; }
.guild-resource-table .guild-market-sort span { min-width: 0; }
.guild-market-table th { text-align: center; }
.guild-market-table .guild-market-label { text-align: left; }
.guild-market-table td.right { text-align: right; }
.guild-monster-icon { display: block; width: 40px; height: 40px; margin: 0 auto; object-fit: contain; }
.guild-resource-icon, .guild-status-icon { width: 16px; height: 16px; object-fit: contain; vertical-align: middle; }
.guild-market-sort {
  display: inline-flex; align-items: center;
  background: none; border: 0; border-radius: 0; box-shadow: none; padding: 4px 6px;
  font-family: 'MedievalSharp', Georgia, serif; font-size: 14px; font-weight: 600; font-style: normal;
  line-height: normal; letter-spacing: normal; font-variant-numeric: lining-nums tabular-nums;
  color: var(--btn-gruen-hell); text-align: left; text-decoration: none; text-shadow: none; cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s, color 0.15s;
}
.guild-market-sort span { text-decoration: underline; }
.guild-market-sort::after { content: "\2191\2193"; margin-left: 0.25em; width: 1.5em; flex: 0 0 1.5em; text-align: center; transform: scale(0.8); }
.guild-market-table th[aria-sort="ascending"] button::after { content: "\2191"; }
.guild-market-table th[aria-sort="descending"] button::after { content: "\2193"; }
.guild-warrior-lists { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.guild-warrior-lists section { min-width: 0; }
.guild-warrior-lists h3 { margin-top: 0; }
.guild-warrior-table { width: 100%; table-layout: fixed; }
.guild-warrior-table th, .guild-warrior-table td { overflow-wrap: anywhere; }
.guild-relationships-friends { color: var(--btn-gruen-hell); }
.guild-relationships-enemies { color: #781c1c; }
@media (max-width: 600px) {
  .guild-warrior-lists { grid-template-columns: minmax(0, 1fr); }
}
.ship-build-action { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.requisition-costs { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
#requisition-status { margin: 6px 0 0; font-size: 0.9em; }
#requisition-status:empty { display: none; }

#map-details-layer {
  position: absolute;
  left: 0;
  top: 0;
  display: grid;
  gap: 0;
  z-index: 4;
  pointer-events: none;
  will-change: transform;
}
.map-details-cell { position: relative; display: flex; justify-content: center; align-items: center; overflow: hidden; }
.map-show-grid #map-details-layer::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right, #0007 1px, transparent 1px),
    linear-gradient(to bottom, #0007 1px, transparent 1px);
  background-size: var(--map-tile-width) var(--map-tile-height);
}
.map-owner-banner { position: relative; overflow: hidden; display: none; }
.map-owner-banner img { position: absolute; left: 50%; top: 50%; max-width: none; max-height: none; transform-origin: center; }
.map-field-value {
  position: absolute;
  z-index: 1;
  display: none;
  color: var(--gold);
  font-weight: bold;
  font-size: 28px;
  -webkit-text-stroke: 1px #000;
  paint-order: stroke fill;
  text-shadow: -1px -1px #000, 1px -1px #000, -1px 1px #000, 1px 1px #000;
}
.map-show-field-values .map-field-value { display: block; }
.map-show-ownership .map-owner-banner:not([hidden]) { display: block; }
.map-hide-objects .tile > :not(.tile-bg-img),
.map-hide-objects #map-player-actor,
.map-hide-objects #map-foreign-actors,
.map-hide-objects #map-monster-actors { visibility: hidden; }
#map-container { isolation: isolate; }
#map-container::after { z-index: 5; }

/* ===== Diplomatie: Nachrichten-Volltext ===== */
.msg-item {
  padding: 8px 6px;
  position: relative;
  margin: 0; /* kein AuÃƒÅ¸enabstand; AbstÃƒÂ¤nde und Linie ÃƒÂ¼bernimmt .msg-sep */
  display: block;
  width: 100%;
  box-sizing: border-box;
}
.msg-sep {
  height: 1px;
  background: #2a1a0a; /* braune Trennlinie zwischen Nachrichten */
  margin: 6px 0; /* 1 Zeile frei ÃƒÂ¼ber/unter der Linie */
}
.diplomacy-messages #messages-list {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden; /* kein horizontaler Scrollbalken */
  min-height: 0; /* erlaubt inneres Scrollen im Flex-Container */
}

/* Diplomatie: Compose-Zeile Ã¢â‚¬â€œ OK-Button soll direkt neben dem Dropdown bleiben */
#nachrichten-panel .compose-row .feld-aufwerten-link { margin-left: 0 !important; }
/* Diplomatie: Links in Freunde/Feinde wie Text-Buttons darstellen */
#friends-list a:link,
#friends-list a:visited,
#enemies-list a:link,
#enemies-list a:visited {
  color: #2a1a0a;
  text-decoration: underline;
  font-family: 'MedievalSharp', 'UnifrakturCook', cursive;
  font-size: 1em;
}
#friends-list a:hover, #friends-list a:focus,
#enemies-list a:hover, #enemies-list a:focus {
  color: #225522;
}
.msg-header {
  color: #444;
  margin-bottom: 4px;
}
.msg-body {
  white-space: pre-wrap; /* AbsÃƒÂ¤tze erhalten */
  word-break: break-word; /* sehr lange WÃƒÂ¶rter umbrechen */
}
.msg-item.unread {
  background: #f8f5e6;           /* wie Popup-Hintergrund */
  border: 2px solid #bfa046;     /* schmaler goldener Rand */
  border-radius: 14px;           /* abgerundete Ecken wie Popup */
  width: 100%;                   /* immer volle Listenbreite */
  box-sizing: border-box;
}
.msg-item.unread .msg-header strong { color: #7c5a1a; }
.msg-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 6px;
}

/* Diplomatie: aktive Filter-Links minimal hervorheben */
#nachrichten-panel .msg-filters .filter-btn.active {
  color: #225522;
  text-decoration: underline;
  font-weight: bold;
}

.landing-page {
  min-height: 100vh;
  margin: 0;
  color: #f8f5e6;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 16px;
.uebersicht-btn-row { height: 36px; }
.uebersicht-btn-row--hidden {
  visibility: hidden;
  pointer-events: none;
}
  box-sizing: border-box;
  font-family: 'MedievalSharp', 'UnifrakturCook', cursive, sans-serif;
  /* Hintergrund ohne Schleier/Overlay, neues komprimiertes WebP */
  background: url('./assets/bg/bg_landing.webp') center/cover no-repeat;
}
.landing-wrapper {
  width: 100%;
  max-width: 720px;
  display: flex;
  flex-direction: column;
  gap: 0;
  align-items: center;
}
.landing-panel {
  width: 100%;
  max-width: 320px; /* ~10% schmaler */
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  overflow: hidden;
}
.landing-tabs {
  display: flex;
  justify-content: center;
  gap: 0;
  flex-wrap: nowrap;
  margin: -18px -18px 0 -18px;
  padding: 0;
}
.landing-tab {
  background: linear-gradient(180deg, #d6b468 0%, #a9853f 100%);
  color: #2a1a0a;
  border: 3px solid #bfa046;
  border-bottom: none;
  border-radius: 16px 16px 0 0;
  padding: 0.65em 0.2em;
  font-size: 1.02em;
  font-family: 'MedievalSharp', 'UnifrakturCook', cursive;
  letter-spacing: 1px;
  box-shadow: 0 2px 6px #0006;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
  text-shadow: 0 2px 2px #0006;
  flex: 1 1 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
}
.landing-tab + .landing-tab {
  margin-left: -3px;
}
.landing-tab.active {
  background: linear-gradient(180deg, #ffe08a 0%, #cda04b 100%);
  color: #7c5a1a;
  box-shadow: 0 6px 16px #0008;
  z-index: 2;
  margin-bottom: -3px;
}
.landing-tab:not(.active) {
  opacity: 0.85;
}
.landing-tab:hover,
.landing-tab:focus {
  background: linear-gradient(180deg, #ffe08a 0%, #cda04b 100%);
  color: #7c5a1a;
  box-shadow: 0 4px 12px #0007;
}
.landing-tab:focus-visible {
  outline: 2px solid #ffe08a;
  outline-offset: 3px;
}
.landing-tab-body {
  width: 100%;
  display: grid; /* Grid behalten, um beide Forms ÃƒÂ¼bereinander zu legen */
  grid-template-columns: 1fr;
  justify-items: center; /* horizontale Zentrierung */
  align-content: center; /* vertikale Zentrierung innerhalb min-height */
  padding: 16px 4px 2px 4px; /* etwas weniger Padding, damit HÃƒÂ¶he schrumpft */
  min-height: 260px; /* ~14% weniger HÃƒÂ¶he als vorher */
}
.landing-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  max-width: 300px; /* ~6% schmaler passend zum Panel */
  margin: 0 auto;
  align-items: stretch;
  grid-area: 1 / 1 / 2 / 2;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.landing-form.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.landing-form .form-field {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
  max-width: 300px; /* an neue Formularbreite anpassen */
  margin-left: auto; /* echte horizontale Zentrierung im Panel */
  margin-right: auto;
}
.landing-form label {
  font-weight: bold;
  font-size: 0.95em;
  letter-spacing: 0.5px;
  color: #2a1a0a;
}
.landing-submit {
  background: linear-gradient(145deg, #bfa046 0%, #7c5a1a 100%);
  color: #2a1a0a;
  border: 2px solid #bfa046;
  border-radius: 12px 12px 16px 16px/16px 16px 12px 12px;
  padding: 0.55em 1.8em;
  font-size: 1em;
  font-family: 'MedievalSharp', 'UnifrakturCook', cursive;
  letter-spacing: 1px;
  box-shadow: 0 2px 8px #0008 inset, 0 2px 8px #bfa04644;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
  text-shadow: 0 2px 2px #0008;
  margin-top: 4px;
  align-self: center;
}
.landing-submit:hover,
.landing-submit:focus {
  background: linear-gradient(145deg, #ffe08a 0%, #bfa046 100%);
  color: #7c5a1a;
  box-shadow: 0 4px 16px #bfa04688, 0 2px 8px #0008 inset;
}
.landing-message {
  min-height: 20px;
  font-size: 0.9em;
  color: #2a1a0a;
  text-align: center;
  margin-top: 4px;
  width: 100%;
}
.landing-message.error {
  color: #aa2222;
  font-weight: bold;
}
.landing-message.ok {
  color: #1e8f4c;
  font-weight: bold;
}

/* ===== Charaktererstellung ===== */
.create-character-page {
  padding-top: 8px;
  background: #2a1a0a;
  color: #f8f5e6;
  font-family: 'MedievalSharp', 'UnifrakturCook', cursive, sans-serif;
}
.create-character-container {
  max-width: 1980px;
  margin: 8px auto 40px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 0 16px;
  box-sizing: border-box;
}
.create-character-toolbar {
  display: flex;
  justify-content: flex-end;
}
.create-character-grid {
  display: grid;
  grid-template-columns: 1.3fr 0.6fr 1.3fr;
  gap: 20px;
  justify-content: center;
}
.create-description-panel,
.create-character-panel,
.create-talents-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.description-placeholder {
  font-style: italic;
  opacity: 0.75;
}
.create-character-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.create-character-form .form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 320px;
}
.create-character-form label {
  font-weight: bold;
  font-size: 0.95em;
  letter-spacing: 0.5px;
}
.gold-input {
  width: 100%;
  max-width: 320px;
  padding: 10px 12px;
  border: 1px solid #bfa046;
  border-radius: 12px;
  background: #fffbe8;
  color: #2a1a0a;
  font-family: inherit;
  font-size: 1em;
  box-shadow: 0 1px 2px #bfa04633 inset;
  box-sizing: border-box;
}
.gold-input:focus {
  outline: none;
  box-shadow: 0 0 0 2px #bfa04655;
}
.create-character-form .form-actions {
  display: flex;
  justify-content: center;
  margin-top: 12px;
}
.create-character-form .form-actions button {
  margin: 0 auto;
}
#msg {
  min-height: 20px;
  font-size: 0.9em;
  color: #aa2222;
  margin-top: 4px;
}
#msg.error {
  font-weight: bold;
}
.create-talents-panel #skills-table {
  overflow-x: auto;
}
.talent-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.talent-column {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.talent-table {
  width: 100%;
  border-collapse: collapse;
  background: transparent;
  box-shadow: none;
}
.talent-table th,
.talent-table td {
  border: none;
  padding: 4px 8px;
  font-size: 0.9em;
  text-align: right;
  color: #2a1a0a;
}
.talent-table th:first-child,
.talent-table td:first-child {
  text-align: left;
}
.talent-table th {
  font-weight: bold;
}
.talent-total-cell {
  font-weight: bold;
}
.talent-group-heading td {
  font-weight: bold;
  text-align: left;
  padding-top: 10px;
}
.talent-group-spacer td {
  border: none;
  height: 8px;
  background: transparent;
}
.talent-group-spacer-wide td {
  height: 38px;
  line-height: 38px;
}
.talent-empty {
  font-style: italic;
  opacity: 0.75;
}
@media (max-width: 1700px) {
  .create-character-grid {
    grid-template-columns: repeat(3, minmax(280px, 1fr));
  }
}
@media (max-width: 1200px) {
  .create-character-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .talent-columns {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 960px) {
  .create-character-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== Item-Icons & IconSelect (eigenes Dropdown mit PNG-Icons) ===== */
.item-icon { display:inline-block; vertical-align: middle; image-rendering: auto; }
.item-icon-sm { width:20px; height:20px; margin-right:6px; }
.item-icon-md { width:32px; height:32px; }

/* Container */
.icon-select { position: relative; display: inline-flex; align-items: center; font-family: inherit; vertical-align: middle; line-height: 1; }
.icon-select.disabled { opacity: 0.6; pointer-events: none; }

/* Trigger-Button (geschlossener Zustand) */
.icon-select-trigger {
  display: inline-flex; align-items: center; gap: 4px;
  min-width: 150px; max-width: 100%;
  height: 20px;
  box-sizing: border-box;
  padding: 0 6px;
  margin: 0;
  font-size: 0.8em; line-height: 1;
  border-radius: 6px;
  border: 1px solid #bfa046;
  background: #fffbe8;
  color: #2a1a0a;
  cursor: pointer;
  box-shadow: 0 1px 2px #bfa04622 inset;
  text-align: left;
}
.icon-select-trigger:hover { background: #fff5d0; }
.icon-select.open .icon-select-trigger { border-color: #8a6a14; }
.icon-select-trigger-icon { flex: 0 0 auto; margin-right: 2px; }
.icon-select-trigger-icon:not([src]) { visibility: hidden; }
.icon-select-trigger-label {
  flex: 1 1 auto;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.icon-select-caret { flex: 0 0 auto; font-size: 0.9em; color: #8a6a14; margin-left: 2px; }

/* MenÃƒÂ¼ (geÃƒÂ¶ffnet) */
.icon-select-menu {
  position: absolute; z-index: 2000;
  top: calc(100% + 2px); left: 0;
  min-width: 100%;
  max-height: 280px; overflow-y: auto;
  margin: 0; padding: 2px 0;
  list-style: none;
  background: #fffbe8;
  border: 1px solid #bfa046;
  border-radius: 6px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}
.icon-select-option {
  display: flex; align-items: center; gap: 4px;
  padding: 3px 8px;
  font-size: 0.85em; line-height: 1.2;
  color: #2a1a0a;
  cursor: pointer;
  white-space: nowrap;
}
.icon-select-option:hover,
.icon-select-option.selected { background: #ffe08a; }
.icon-select-option.disabled { color: #999; cursor: not-allowed; background: transparent; }
.icon-select-option .item-icon { flex: 0 0 auto; }
.icon-select-option .item-icon:not([src]) { visibility: hidden; }
.icon-select-option-label { flex: 1 1 auto; }

/* Sizing parallel zu .haltung-dropdown in Inventory-/Equip-Kontexten */
.group-row.inventory-row .icon-select { width: 180px; }
.group-row.inventory-row .icon-select-trigger { min-width: 0; width: 100%; }
.small-equip-popup.equip-popup { height: auto; overflow: visible; }
.equip-popup .icon-select-trigger { min-width: 180px; }
.spell-select { width: min(100%, 210px); }
.spell-select .icon-select-trigger { width: 100%; min-width: 0; height: 20px; }
.zauber-cell .spell-select { max-width: 100%; }
.icon-select-option.keyboard-active { outline: 2px solid #225522; outline-offset: -2px; }
body.fight-mode #main-grid {
  grid-template-columns: minmax(0, 2fr) 560px minmax(0, 2fr);
  grid-template-rows: minmax(0, 1fr);
  height: var(--view-panel-min-height);
  min-height: 0;
}
body.fight-mode #left-column { grid-column: 1 / 3; min-width: 0; min-height:0; }
body.fight-mode #center-column { grid-column: 3; min-width: 0; min-height:0; }
body.fight-mode #fightview-kampfbericht { width: 100%; min-width: 0; align-self: stretch; }
body.fight-mode :is(#fightview-schlachtfeld, #fightview-kampfbericht) { height:100%; min-height:0; }
body.fight-mode :is(.schlachtfeld-panel, .kampfbericht-panel) { height:100%; overflow:hidden; }
body.fight-mode :is(.schlachtfeld-panel, .kampfbericht-panel) > h2 { flex-shrink:0; }
body.fight-mode .battlefield { min-height: 0; gap: 6px; }
body.fight-mode .battle-sections { overflow: auto; flex: 1; min-height: 0; }
body.fight-mode .battle-section { min-width: 0; margin-bottom: 4px; container: battle-row / inline-size; }
body.fight-mode .battle-section:last-child { margin-bottom: 0; }
body.fight-mode .battle-section-title { margin-bottom: 3px !important; font-weight: 700; }
body.fight-mode .battle-row { flex-wrap: wrap; gap: 6px; align-items: flex-start; margin-bottom: 0; }
body.fight-mode .battle-row > .fighter {
  flex: 0 0 calc((100% - 42px) / 8);
  width: calc((100% - 42px) / 8);
  min-width: 0;
  box-sizing: border-box;
}
:is(body.fight-mode, .group-card-grid) .battle-member {
  display: flex;
  align-items: stretch;
  gap: 4px;
  padding: 5px;
  border: 1px solid #9b814e66;
  border-radius: 4px;
  font-size: 12px;
}
:is(body.fight-mode, .group-card-grid) .battle-member .group-member-title { margin: -2px 0 0; min-height: 18px; justify-content: center; }
:is(body.fight-mode, .group-card-grid) .battle-member .group-member-title::after { display: none; }
:is(body.fight-mode, .group-card-grid) .battle-member .fighter-name { color: var(--tinte); font-size: 12px; overflow-wrap: anywhere; width: 100%; text-align: center; margin: 0; }
:is(body.fight-mode, .group-card-grid) .battle-member .group-row.top { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 4px; }
:is(body.fight-mode, .group-card-grid) .battle-member .group-portrait { grid-row: 1 / 3; width: 44px; height: 72px; margin: 0; }
:is(body.fight-mode, .group-card-grid) .battle-member .group-portrait-img { width: 100%; height: 100%; object-fit: contain; }
:is(body.fight-mode, .group-card-grid) .battle-member .group-bars { width: 100%; min-width: 0; margin: 0; }
body.fight-mode .battle-section { --battle-bar-width: min(88px, calc((100cqw - 42px) / 8 - 60px)); }
:is(body.fight-mode .schlachtfeld-panel, .group-card-grid) .hp-bar,
:is(body.fight-mode .schlachtfeld-panel, .group-card-grid) .mana-bar { width: min(100%, var(--battle-bar-width)); height: 14px; margin: 0 auto 1px; }
:is(body.fight-mode, .group-card-grid, .interact-group-grid) .hp-bar[data-health="high"] .bar-inner { background: #246b39; }
:is(body.fight-mode, .group-card-grid, .interact-group-grid) .hp-bar[data-health="medium"] .bar-inner { background: #877000; }
:is(body.fight-mode, .group-card-grid, .interact-group-grid) .hp-bar[data-health="low"] .bar-inner { background: #b45309; }
:is(body.fight-mode, .group-card-grid, .interact-group-grid) .hp-bar[data-health="critical"] .bar-inner { background: var(--hp-rot); }
:is(body.fight-mode .schlachtfeld-panel, .group-card-grid) .hp-bar span,
:is(body.fight-mode .schlachtfeld-panel, .group-card-grid) .mana-bar span {
  font-family: var(--font-titel);
  font-variant-numeric: lining-nums tabular-nums;
  font-size: 10.5px;
  line-height: 14px;
  font-weight: 400;
}
:is(body.fight-mode, .group-card-grid) .battle-member .group-aa-wrap { grid-column: 2; justify-self: center; flex-direction: row; justify-content: center; width: min(100%, var(--battle-bar-width)); gap: 6px; margin: 3px 0 0; }
:is(body.fight-mode, .group-card-grid) .battle-member .aa-row { gap: 2px; }
:is(body.fight-mode, .group-card-grid) .battle-member .aa-val { min-width: 0; font-size: 11px; }
:is(body.fight-mode, .group-card-grid) .battle-member .aa-icon { font-size: 12px; }
:is(body.fight-mode, .group-card-grid) .battle-member .aa-row { display: grid; grid-template-columns: auto auto; align-items: center; }
:is(body.fight-mode, .group-card-grid) .battle-member .combat-effect-icon { grid-column: 1; grid-row: 2; justify-self: center; width: 14px; height: 14px; padding: 0; border: 0; background: none; cursor: help; }
.combat-effect-icon img { display: block; width: 14px; height: 14px; object-fit: contain; }
.combat-effects-tooltip .item-tooltip-row { white-space: normal; overflow-wrap: anywhere; }
:is(body.fight-mode, .group-card-grid) .battle-member-control { display: grid; grid-template-columns: repeat(3, 30px); gap: 3px; align-items: center; justify-content: center; }
@container battle-row (max-width: 1000px) {
  body.fight-mode .battle-row { --battle-bar-width: min(88px, calc((100cqw - 42px) / 8 - 6px)); }
  body.fight-mode .battle-member { padding: 2px; }
  body.fight-mode .battle-member .group-row.top { grid-template-columns: minmax(0, 1fr); }
  body.fight-mode .battle-member .group-portrait { grid-row: auto; justify-self: center; max-width: 100%; }
  body.fight-mode .battle-member .fighter-name { font-size: 10px; }
  body.fight-mode .battle-member .group-aa-wrap { width: 100%; gap: 2px; }
}
@container battle-row (max-width: 600px) {
  body.fight-mode .battle-member { padding: 1px; }
  body.fight-mode .battle-member-control { grid-template-columns: 30px; }
  body.fight-mode .battle-quick-items { grid-template-columns: minmax(0, 1fr); }
  body.fight-mode .battle-member .group-aa-wrap { flex-wrap: wrap; }
  body.fight-mode .battle-member .icon-select-trigger { gap: 1px; padding: 0; overflow: hidden; }
  body.fight-mode .schlachtfeld-panel .hp-bar span,
  body.fight-mode .schlachtfeld-panel .mana-bar span { font-size: min(10.5px, calc(var(--battle-bar-width) / 7)); }
}
:is(body.fight-mode, .group-card-grid) .battle-member-spells { min-width: 0; width: 100%; }
:is(body.fight-mode, .group-card-grid) .battle-member-control .group-stance { margin: 0; }
:is(body.fight-mode, .group-card-grid) .battle-member .battle-stance-button { width: 30px; height: 26px; margin: 0; padding: 0; }
:is(body.fight-mode, .group-card-grid) .battle-member .battle-stance-button img { width: 16px; height: 16px; }
:is(body.fight-mode, .group-card-grid) .battle-member .inventory-row { display: grid; grid-template-columns: minmax(0, 1fr) 70px; gap: 3px; }
:is(body.fight-mode, .group-card-grid) .battle-member .inventory-row .inventory-target-dropdown { grid-column: 1; }
:is(body.fight-mode, .group-card-grid) .battle-member .inventory-row .inventory-ok-btn { grid-column: 2; }
:is(body.fight-mode, .group-card-grid) .battle-member .haltung-dropdown,
:is(body.fight-mode, .group-card-grid) .battle-member .icon-select,
:is(body.fight-mode, .group-card-grid) .battle-member .inventory-row select.haltung-dropdown {
  width: 100%; min-width: 0; max-width: 100%; height: 22px; margin: 0; box-sizing: border-box; font-size: 11px;
}
:is(body.fight-mode, .group-card-grid) .battle-member .icon-select-trigger { height: 22px; min-width: 0; font-size: 11px; padding: 1px 3px; }
:is(body.fight-mode, .group-card-grid) .battle-member .icon-select-trigger-label { min-width: 0; }
:is(body.fight-mode, .group-card-grid) .battle-member .inventory-equip-btn,
:is(body.fight-mode, .group-card-grid) .battle-member .inventory-ok-btn {
  width: 100%; min-width: 0; height: 22px; margin: 0; padding: 1px 0; letter-spacing: 0;
}
:is(body.fight-mode, .group-card-grid) .battle-member-control .inventory-equip-btn { height: 26px; }
:is(body.fight-mode, .group-card-grid) .battle-member .inventory-ok-btn { width: 30px; height: 26px; justify-self: center; }
:is(body.fight-mode, .group-card-grid) .battle-member .inventory-ok-btn img { width: 16px; height: 16px; }
.battle-quick-items { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2px; min-height: 26px; }
.battle-quick-item { display: flex; align-items: center; justify-content: center; min-width: 0; height: 26px; padding: 2px; border: 1px solid #9b814e; border-radius: 3px; background: #fffbe866; cursor: pointer; }
.battle-quick-item img { width: 20px; height: 20px; object-fit: contain; }
.battle-quick-item:disabled { opacity: .5; cursor: wait; }
.battle-inventory { width: 100%; }
.battle-inventory-toggle.button-style-2,
.small-equip-popup .battle-inventory-toggle.button-style-2 { display: block; box-sizing: border-box; width: 100%; margin: 0; padding: 1px 0; font-size: 11px; line-height: 14px; text-align: center; }
.battle-member .inventory-row .icon-select-trigger { width: 100%; }
.battle-member .inventory-row .inventory-qty-input .icon-select-input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; appearance: textfield; text-align: center; }
.battle-member .inventory-row .inventory-qty-input .icon-select-input::-webkit-inner-spin-button,
.battle-member .inventory-row .inventory-qty-input .icon-select-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.battle-member .inventory-row .inventory-target-dropdown .icon-select-trigger-icon,
.battle-member .inventory-row .inventory-qty-input .icon-select-trigger-icon { display: none; }
.battle-member .inventory-row .inventory-qty-input .icon-select-trigger { display: flex; }
.battle-member .inventory-row .icon-select-menu { max-height: 260px; }
.battle-member .inventory-row .icon-select-menu .icon-select-option { height: 26px; box-sizing: border-box; }
.icon-select-menu.inventory-battle-menu { max-height: 260px; max-width: calc(100vw - 12px); }
.icon-select-menu.inventory-battle-menu .icon-select-option { height: 26px; box-sizing: border-box; }
.icon-select-menu.inventory-battle-menu .icon-select-option[data-section="1"] {
  font-weight: 700;
  color: var(--tinte);
  background: var(--pergament-mittel);
  cursor: default;
}
:is(body.fight-mode, .group-card-grid) .battle-member .inventory-row[popover] {
  position: fixed;
  inset: auto;
  margin: 0;
  padding: 8px;
  box-sizing: border-box;
  border: 1px solid #9b814e;
  border-radius: 4px;
  background: var(--pergament) var(--textur-pergament);
  box-shadow: 0 3px 8px #0005;
  overflow: visible;
}
:is(body.fight-mode, .group-card-grid) .battle-member .inventory-row[popover]:not(:popover-open) { display: none; }
.battle-inventory .inventory-row::backdrop { display: none; }
.icon-select-menu[popover] { margin: 0; right: auto; bottom: auto; }
.icon-select-menu[popover]::backdrop { display: none; }
.icon-select-option.quick-item-selected { background: #53452b; color: #fffbe8; }
.icon-select-option.quick-item-selected:hover { background: #6b5938; }
body.fight-mode .battle-controls { flex-wrap: wrap; flex-shrink: 0; gap: 6px 16px; }
body.fight-mode .kampfbericht-panel .report-header { display: flex; flex-wrap: wrap; gap: 8px; box-sizing: border-box; padding-right: 12px; }
body.fight-mode .kampfbericht-panel .report-mode { margin-right: 0 !important; }
:is(body.fight-mode, .group-card-grid) .battle-member :focus-visible,
body.fight-mode .battle-sections:focus-visible { outline: 2px solid #225522; outline-offset: 1px; }
@media (max-width: 1100px) {
  body.fight-mode #main-grid { grid-template-columns: minmax(0, 1fr); grid-template-rows:repeat(2, minmax(0, 1fr)); gap:var(--view-panel-gap); }
  body.fight-mode #left-column, body.fight-mode #center-column { grid-column: 1; }
}
.group-panel-content { container-type: inline-size; width: 100%; min-width: 0; flex-shrink: 0; box-sizing: border-box; }
.group-panel-content .group-row { width: 100%; box-sizing: border-box; }
#gruppe-panel { container: actions-group / inline-size; }
#gruppe-panel > .group-card-grid {
  --group-columns: 3;
  --battle-bar-width: min(88px, calc((100cqw - (var(--group-columns) - 1) * 6px) / var(--group-columns) - 60px));
  display: grid;
  grid-template-columns: repeat(var(--group-columns), minmax(0, 1fr));
  gap: 6px;
  align-content: start;
  align-items: start;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  container: group-cards / inline-size;
}
#gruppe-panel .battle-member { width: 100%; min-width: 0; box-sizing: border-box; }
@container actions-group (max-width: 359px) {
  #gruppe-panel > .group-card-grid { --group-columns: 2; }
}
@container actions-group (max-width: 239px) {
  #gruppe-panel > .group-card-grid { --group-columns: 1; }
}
@container group-cards (max-width: 459px) {
  .group-card-grid .battle-member { --battle-bar-width: 88px; }
  .group-card-grid .battle-member .group-row.top { grid-template-columns: minmax(0, 1fr); }
  .group-card-grid .battle-member .group-portrait { grid-row: auto; justify-self: center; }
  .group-card-grid .battle-member .group-aa-wrap { margin-left: auto; margin-right: auto; }
}
.group-row.top { gap: 6px; }
.group-row.top .group-aa-wrap { margin: 0; gap: 2px; }
.group-row.top .inventory-equip-btn { flex: 0 0 24px; width: 24px; padding: 2px 0; margin: 0; letter-spacing: 0; }
.group-magic-controls { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 0; }
.group-magic-controls .group-stance { flex: 0 0 auto; margin: 0; }
.group-magic-controls .haltung-dropdown { height: 20px; box-sizing: border-box; }
.group-magic-controls .spell-select { flex: 1; min-width: 0; }
@container (max-width: 480px) {
  .group-magic-controls { flex-direction: column; align-items: stretch; gap: 2px; }
  .group-magic-controls .spell-select, .group-magic-controls .haltung-dropdown { width: 100%; }
  .group-row.inventory-row:not([popover]) { display: grid; grid-template-columns: minmax(0, 1fr) 40px minmax(0, 1fr) auto; gap: 4px; }
  .group-row.inventory-row .icon-select,
  .group-row.inventory-row select.haltung-dropdown,
  .group-row.inventory-row .inventory-qty-input { width: 100%; min-width: 0; box-sizing: border-box; }
  .group-row.inventory-row .inventory-ok-btn { margin: 0; }
}
.item-tooltip-body.item-tooltip-with-heading { display: block; }
.item-tooltip-heading { text-align: center; margin-bottom: 6px; overflow-wrap: anywhere; }
.item-tooltip-title { color: #5a4014; font-size: 1.2em; font-weight: 700; }
.item-tooltip-subtitle { color: #2a1a0a; font-size: 0.9em; }
.item-tooltip-content { display: flex; gap: 8px; align-items: center; }
.spell-tooltip .item-tooltip-row { white-space: normal; }
.spell-scaling { color: #1759b3; }
.summon-dialog { box-sizing: border-box; width: 360px; max-width: calc(100vw - 24px); padding: 18px; border: 1px solid #8a6a14; border-radius: 6px; background: #fffbe8; color: #2a1a0a; }
.summon-dialog::backdrop { background: rgba(0,0,0,.5); }
.summon-dialog [hidden] { display: none; }
.summon-dialog h3 { margin: 0 24px 10px 0; font-size: 1.1rem; overflow-wrap: anywhere; }
.summon-dialog p { margin: 0 0 14px; }
.global-spell-controls { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.global-spell-controls[hidden] { display: none; }
.summon-costs img { width: 16px; height: 16px; vertical-align: middle; }
.summon-close { position: absolute; right: 6px; top: 6px; width: 24px; height: 24px; border: 0; background: none; padding: 3px; cursor: pointer; }
.summon-close img { width: 18px; height: 18px; }
.market-popup-wide .icon-select-trigger { min-width: 220px; }

/* Trigger-Icon kleiner halten als Trigger-HÃƒÂ¶he, damit der Button die gleiche
   HÃƒÂ¶he wie benachbarte Inputs/Selects behÃƒÂ¤lt (sonst dehnt das 20px-Icon den
   Button ÃƒÂ¼ber sein border-box hinaus). Im aufgeklappten MenÃƒÂ¼ bleibt das Icon
   in voller GrÃƒÂ¶ÃƒÅ¸e. */
.icon-select-trigger .item-icon-sm { width: 14px; height: 14px; }

.standard-dropdown, .standard-eingabefeld {
  height: 22px;
  max-width: 100%;
  flex: 0 0 auto;
  box-sizing: border-box;
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 11px;
  font-weight: 400;
  font-variant-numeric: lining-nums tabular-nums;
  line-height: 1;
}
.standard-eingabefeld { width: 70px; }
:is(.standard-dropdown, .standard-eingabefeld) .icon-select-trigger,
input.standard-eingabefeld {
  width: 100%;
  min-width: 0;
  height: 22px;
  margin: 0;
  padding: 1px 3px;
  gap: 4px;
  border: 1px solid #bfa046;
  border-radius: 6px;
  background: #fffbe8;
  color: #2a1a0a;
  box-shadow: 0 1px 2px #bfa04622 inset;
}
:is(.standard-dropdown, .standard-eingabefeld) .icon-select-trigger { font: inherit; }
:is(.standard-dropdown, .standard-eingabefeld) .icon-select-trigger:hover,
input.standard-eingabefeld:hover { background: #fff5d0; }
:is(.standard-dropdown, .standard-eingabefeld).open .icon-select-trigger { border-color: #8a6a14; }
:is(.standard-dropdown, .standard-eingabefeld) .icon-select-trigger:focus-visible,
.standard-eingabefeld .icon-select-trigger:focus-within,
input.standard-eingabefeld:focus-visible { outline: 2px solid #225522; outline-offset: 2px; }
.standard-dropdown .icon-select-trigger-icon { width: 14px; height: 14px; margin: 0 2px 0 0; transform: none; }
.standard-dropdown .icon-select-trigger-icon:not([src]) { display: none; }
.standard-dropdown .icon-select-trigger-label { min-width: 0; }
.standard-eingabefeld .icon-select-input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font: inherit;
  color: inherit;
  appearance: textfield;
  text-align: center;
}
.standard-eingabefeld .icon-select-input::-webkit-inner-spin-button,
.standard-eingabefeld .icon-select-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.standard-dropdown-menu, .standard-eingabefeld-menu {
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 16px;
  font-variant-numeric: lining-nums tabular-nums;
  max-width: calc(100vw - 12px);
}
.standard-eingabefeld-menu { max-height: 260px; }
.standard-eingabefeld-menu .icon-select-option { height: 26px; box-sizing: border-box; }
.building-supply-select { width: 90px; }
.recipe-crafting-row > label { display: inline-flex; align-items: center; gap: 4px; }

/* ------- Item-Tooltip (Hover) ------- */
.item-tooltip {
  position: fixed; z-index: 99999;
  background: #fffbe8;
  border: 1px solid #bfa046;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.18);
  padding: 6px 8px;
  font-size: 0.85em; line-height: 1.25;
  color: #2a1a0a;
  max-width: 320px;
  pointer-events: none; /* damit Hover nicht flackert */
}
.item-tooltip-body { display: flex; gap: 8px; align-items: center; }
.item-tooltip-left { flex: 0 0 auto; }
.item-tooltip-icon { width: 32px; height: 32px; image-rendering: pixelated; }
.item-tooltip-icon:not([src]) { visibility: hidden; }
.item-tooltip-right { flex: 1 1 auto; min-width: 0; }
.item-tooltip-row { white-space: nowrap; }
.item-tooltip-key { color: #6a4a14; font-weight: 600; }
.item-tooltip-val { color: #2a1a0a; }
.item-tooltip-flavor { margin-top: 4px; font-style: italic; color: #5a4014; white-space: normal; }

/* Gegenstandshandel-Popup: ca. 20% schmaler als generisches market-popup-wide,
   damit der Item-Tooltip links vom Popup Platz hat. */
.storage-popup.market-popup-wide.tpi-popup { width: 1187px; }
/* Kein horizontaler Scrollbalken im schmaleren TPI-Popup */
.storage-popup.market-popup-wide.tpi-popup .market-scroll { overflow-x: hidden; }
.storage-popup.market-popup-wide.tpi-popup .market-scroll::-webkit-scrollbar:horizontal { display: none; height: 0; }
/* Im Anbieten-Bereich alle 4 Elemente exakt gleich hoch ausrichten */
.tpi-popup #tpi-list-section .group-row {
  align-items: center;
}
.tpi-popup #tpi-list-section .haltung-dropdown,
.tpi-popup #tpi-list-section .inventory-qty-input,
.tpi-popup #tpi-list-section .icon-select-trigger {
  height: 20px;
  box-sizing: border-box;
  padding-top: 0;
  padding-bottom: 0;
  margin: 0;
  vertical-align: middle;
  line-height: 18px;
}
.tpi-popup #tpi-list-section .icon-select { vertical-align: middle; }

/* Item-Label-Highlights (Zustand & Stack-Menge) */
.item-cond { font-weight: 600; }
.item-cond.cond-good { color: #1e8f4c; }   /* gruen */
.item-cond.cond-mid  { color: #a8610f; }   /* orange */
.item-cond.cond-low  { color: #aa2222; }   /* rot */
.item-stack { font-weight: 600; }

/* Schmaler Zustands-Balken (Dropdowns, TPI-Liste): max. halb so breit wie HP-Balken,
   keine Zahl. Farbschema identisch zu .item-cond. */
.item-cond-bar {
  display: inline-block;
  vertical-align: middle;
  position: relative;
  top: -1px;
  width: 30px;
  height: 7px;
  background: #444;
  border-radius: 4px;
  overflow: hidden;
  margin-left: 4px;
}
.item-cond-bar .bar-inner {
  display: block;
  height: 100%;
  border-radius: 4px 0 0 4px;
}
.item-cond-bar.cond-good .bar-inner { background: #1e8f4c; }
.item-cond-bar.cond-mid  .bar-inner { background: #a8610f; }
.item-cond-bar.cond-low  .bar-inner { background: #aa2222; }
/* Kontext-spezifische Feinjustierung der vertikalen Position, weil je nach
   line-height/Schriftgröße die optische Schriftmitte unterschiedlich liegt. */
.icon-select-option .item-cond-bar { top: -2px; }
.tpi-popup #tpi-rows .item-cond-bar { top: -2px; }
/* In Dropdown-Optionen liegen Icon und Balken durch flex/align-items: center
   minimal tiefer als die optische Schriftmitte der Item-Namen. Beide zusammen
   leicht anheben, damit alles auf einer Ebene sitzt. */
.icon-select-option .item-icon { position: relative; top: -2px; }
.tpi-popup #tpi-rows .item-icon { position: relative; top: -2px; }

/* Charakterdetail aus Übersicht > Charaktere */
.character-detail-open {
  padding: 0;
  border: 0;
  background: transparent;
  color: #2a1a0a;
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}
.character-detail-open:hover,
.character-detail-open:focus {
  color: #225522;
}
.character-detail-overlay {
  padding: 8px;
  box-sizing: border-box;
}
.storage-popup.character-detail-popup {
  width: min(1340px, calc(100vw - 16px));
  max-width: none;
  max-height: calc(100vh - 16px);
  padding: 16px 20px 18px;
  box-sizing: border-box;
  overflow: hidden;
}
.character-detail-title {
  font-size: 1.35em !important;
}
.character-detail-layout {
  display: grid;
  grid-template-columns: minmax(515px, 0.85fr) minmax(672px, 1.15fr);
  gap: 16px;
  min-height: 0;
  overflow: hidden;
}
.character-detail-left,
.character-detail-skills {
  min-width: 0;
  overflow-y: auto;
  padding-right: 8px;
}
.character-detail-left {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.character-detail-section {
  border-top: 1px solid #8a6a2c99;
  padding-top: 8px;
}
.character-detail-section:first-child {
  border-top: 0;
  padding-top: 0;
}
.character-detail-section h3,
.character-detail-section h4 {
  margin: 0 0 6px;
  color: #2a1a0a;
}
.character-detail-identity {
  display: grid;
  grid-template-columns: 148px 1fr;
  gap: 16px;
  align-items: center;
}
.character-detail-images {
  display: grid;
  grid-template-columns: 104px 44px;
  gap: 8px;
  align-items: center;
  justify-content: center;
}
.character-detail-class-image {
  width: 87px;
  height: 116px;
  object-fit: contain;
  justify-self: center;
}
.character-detail-icon-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  justify-content: center;
}
.character-detail-race-icon,
.character-detail-class-icon {
  width: 44px;
  height: 44px;
  object-fit: contain;
}
.character-detail-info {
  display: grid;
  gap: 4px;
}
.character-detail-info-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 8px;
}
.character-detail-history {
  min-height: 70px;
}
.character-detail-history p {
  margin: 0;
  color: #5f4a28;
  font-style: italic;
}
.character-detail-group-view {
  --battle-bar-width: 88px;
  max-width: 180px;
}
.character-detail-group-view .group-member-title {
  display: none;
}
.character-detail-group-view .battle-member {
  margin: 0;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.character-detail-group-view .group-portrait {
  display: none;
}
.character-detail-group-view .battle-member .group-row.top {
  grid-template-columns: minmax(0, 1fr);
}
.character-detail-skills {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 8px;
  align-content: start;
  border-top: 0;
  border-left: 1px solid #8a6a2c99;
  padding: 0 4px 0 20px;
}
.character-detail-skills > h3 {
  grid-column: 1 / -1;
}
.character-detail-skill-column {
  min-width: 0;
}
.character-detail-skill-group {
  margin-bottom: 9px;
}
.character-detail-skill-group h4 {
  padding-bottom: 2px;
  border-bottom: 1px solid #8a6a2c55;
}
.character-detail-skill-row {
  display: grid;
  grid-template-columns: minmax(146px, 1fr) repeat(3, 62px);
  min-height: 20px;
  align-items: center;
}
.character-detail-skill-row > span {
  align-self: stretch;
  display: flex;
  align-items: center;
  padding: 1px 4px;
  box-sizing: border-box;
}
.character-detail-skill-row span:not(:first-child) {
  justify-content: center;
  text-align: center;
  font-variant-numeric: lining-nums tabular-nums;
}
.character-detail-skill-row:nth-child(odd) {
  background: #fffbe866;
}
.character-detail-skill-header {
  font-weight: bold;
  font-size: 0.78em;
  background: #f3e2b8 !important;
}
.panel-bottom-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 2px solid var(--holz-dunkel);
  box-sizing: border-box;
}
.room-action {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.room-action span, .room-ap { display: inline-flex; align-items: center; gap: 4px; }
#room-view {
  min-height: calc(100vh - 56px - var(--view-top-gap));
  padding: 24px 12px;
  box-sizing: border-box;
  align-items: center;
  justify-content: center;
}
.room-panel { width: min(100%, 420px); box-sizing: border-box; }
.room-panel .panel-bottom-actions { margin-top: 20px; }
.room-panel .panel-bottom-actions .feld-aufwerten-link { margin: 0; }
.ambush-entry { margin-top: 8px; }
.ambush-overlay {
  position: fixed;
  inset: 0;
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0008;
  padding: 16px;
}
.small-equip-popup.ambush-popup { width: min(100%, 350px); height: auto; min-height: 185px; box-sizing: border-box; overflow: visible; }
.ambush-popup .equip-popup-header { padding-right: 26px; }
.ambush-options { display: grid; gap: 10px; margin-top: 14px; }
.ambush-options > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ambush-options .feld-aufwerten-link { margin: 0; }
.ambush-options span { white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }
.small-equip-popup .panel-bottom-actions .feld-aufwerten-link {
  margin: 0;
}
.inn-actions { display: grid; gap: 6px; width: 100%; }
.small-equip-popup.barracks-popup { width: min(940px, calc(100vw - 32px)); height: auto; max-height: calc(100vh - 112px); box-sizing: border-box; overflow: visible; }
.barracks-popup .equip-popup-header { padding: 0 24px; flex-shrink: 0; }
.barracks-content { overflow-y: auto; min-height: 0; padding: 0 4px; }
.barracks-content label { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 6px 0; }
.barracks-content input { min-width: 0; }
.barracks-content input[name="name"] { width: 210px; max-width: 70%; }
.barracks-army-select { width: 260px; min-width: 0; max-width: 75%; }
.barracks-section { border-top: 1px solid var(--holz-dunkel); margin-top: 10px; padding-top: 6px; }
.barracks-section h3 { margin: 4px 0; font-size: 1.1em; }
.barracks-summary { text-align: center; }
.barracks-columns { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); }
.barracks-column { min-width: 0; padding: 0 16px; }
.barracks-column + .barracks-column { border-left: 1px solid var(--holz-dunkel); }
.barracks-column > h3 { margin: 4px 0 12px; font-size: 1.1em; }
.barracks-cost { display: flex; justify-content: space-between; gap: 12px; }
.barracks-form-actions { display: flex; justify-content: center; padding: 6px 0; }
.barracks-popup .barracks-form-actions .feld-aufwerten-link,
.barracks-popup .barracks-army-actions .feld-aufwerten-link { margin: 0; }
.barracks-army-actions { display: grid; grid-template-columns: 30px minmax(0, 1fr) 30px; gap: 6px; align-items: center; }
.barracks-primary-actions { grid-column: 2; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.barracks-resource { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.barracks-resource .inventory-icon { width: 20px; height: 20px; object-fit: contain; }
.barracks-recruit-cost p { margin: 6px 0; }
@media (max-width: 700px) {
  .barracks-columns { grid-template-columns: minmax(0, 1fr); }
  .barracks-column { padding: 0 4px; }
  .barracks-column + .barracks-column { border-left: 0; border-top: 1px solid var(--holz-dunkel); margin-top: 12px; padding-top: 8px; }
}
.barracks-name { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.barracks-name label { flex: 1; }
.barracks-content .barracks-name-value { max-width: 70%; margin-left: auto; text-align: right; overflow-wrap: anywhere; }
.barracks-popup .route-icon-button { width: 30px; height: 25px; padding: 2px 6px; box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; margin: 0; }
.barracks-popup .route-icon-button img { width: 16px; height: 16px; }
.army-dissolve-popup .route-icon-button { height: 25px; padding: 2px 6px; }
.barracks-popup [hidden] { display: none; }
.barracks-popup .panel-bottom-actions { padding: 6px 0; }
.barracks-popup .barracks-footer,
.army-dissolve-popup .barracks-footer { flex: 0 0 auto; width: auto; margin: 12px -14px -14px; padding: 6px 14px; z-index: 1; }
.barracks-error { color: var(--fehler-rot, #a00); }
.barracks-error:empty { display: none; }
.army-feedback-overlay, .army-dissolve-overlay { z-index: 10001; }
.small-equip-popup.army-feedback-popup { width: min(400px, calc(100vw - 32px)); height: auto; max-height: calc(100vh - 32px); box-sizing: border-box; }
.small-equip-popup.info-popup { position: fixed; inset: 0; margin: auto; width: min(400px, calc(100vw - 32px)); height: fit-content; max-height: calc(100vh - 32px); box-sizing: border-box; }
.small-equip-popup.info-popup:not([open]) { display: none; }
.info-popup::backdrop { background: #0008; }
.info-popup .equip-popup-header { margin: 0 0 12px; }
.info-popup p { margin: 0 0 12px; overflow-wrap: anywhere; }
.small-equip-popup.info-popup button.standard-button { align-self: center; margin: 0; }
.info-popup button.standard-button img { display: block; width: 16px; height: 16px; object-fit: contain; }
.army-feedback-popup .equip-popup-header { padding: 0 24px; }
.army-feedback-popup p { margin: 8px 0 0; overflow-wrap: anywhere; }
.army-dissolve-popup form { margin-top: 12px; }
.army-dissolve-popup label { display: block; margin-bottom: 6px; text-align: center; }
.army-dissolve-popup .barracks-footer { border-top: 0; }
.army-dissolve-popup input { width: 100%; box-sizing: border-box; }
.army-dissolve-popup .popup-close-button { flex-shrink: 0; }
.barracks-popup button:disabled { opacity: .5; cursor: not-allowed; }
.inn-actions > div { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.inn-actions > div > span { white-space: nowrap; }
.inn-actions .feld-aufwerten-link:disabled { opacity: .5; cursor: not-allowed; }
.small-equip-popup.inn-business-popup {
  width: min(100%, 360px);
  height: auto;
  max-height: calc(100vh - 32px);
  box-sizing: border-box;
  overflow-y: auto;
}
.inn-business-popup .equip-popup-header { padding-right: 26px; }
.inn-business-fields { display: grid; gap: 9px; margin-top: 10px; }
.inn-business-fields label { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.inn-business-fields input { width: 92px; height: 22px; box-sizing: border-box; font-size: 1em; }
.inn-business-divider { height: 1px; background: #2a1a0a66; }
.inn-business-error { color: var(--fehler-rot); }
.inn-business-error:empty { display: none; }
.inn-business-popup .inn-business-footer {
  width: auto;
  margin: 12px -14px -14px;
  padding: 6px 14px;
}

@media (max-width: 1270px) {
  .storage-popup.character-detail-popup {
    overflow-y: auto;
  }
  .character-detail-layout {
    display: flex;
    flex-direction: column;
    overflow: visible;
  }
  .character-detail-left,
  .character-detail-skills {
    overflow: visible;
    padding-right: 0;
  }
  .character-detail-skills {
    border-top: 1px solid #8a6a2c99;
    border-left: 0;
    padding: 8px 0 0;
  }
}

@media (max-width: 680px) {
  .character-detail-overlay {
    padding: 8px;
  }
  .storage-popup.character-detail-popup {
    width: calc(100vw - 16px);
    max-height: calc(100vh - 16px);
    padding: 14px;
  }
  .character-detail-identity {
    grid-template-columns: 1fr;
  }
  .character-detail-images {
    justify-content: start;
  }
  .character-detail-skill-row {
    grid-template-columns: minmax(89px, 1fr) repeat(3, 62px);
  }
  .character-detail-skills {
    grid-template-columns: 1fr;
  }
  .character-detail-skills > h3 {
    grid-column: 1;
  }
}
#gruppe-panel .following-army-block { min-height: 210px; }
.following-army-block .army-group-aap { width: 100%; text-align: center; font-size: 11px; }
#gruppe-panel .following-army-block .group-portrait { width: 44px; height: 44px; margin: 0 auto; align-self: center; }
.following-army-block .group-portrait-img { width: 100%; height: 100%; object-fit: contain; }
.group-card-grid .group-empty-message { grid-column: 1 / -1; }
.group-card-grid .group-empty-message[hidden] { display: none; }
.following-army-block .army-group-stats { width: 100%; min-width: 0; font-size: 11px; line-height: 1.25; text-align: center; overflow-wrap: anywhere; }
.following-army-block .army-group-unit { margin-top: 2px; }
.following-army-block .following-army-actions { margin-top: auto; width: 100%; }
.army-supply-overlay .barracks-popup { width: min(423px, calc(100vw - 32px)); }
.army-supply-overlay .army-content { overflow-y: auto; min-height: 0; }
.army-supply-summary { text-align: center; }
.army-supply-resource { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 12px; }
.army-supply-demand { display: flex; align-items: center; gap: 6px; min-width: 0; }
.army-supply-demand .inventory-icon { width: 20px; height: 20px; object-fit: contain; flex-shrink: 0; }
.army-supply-resource input { width: 70px; flex-shrink: 0; }
.army-map-icon { z-index: 4; }
.army-fighter { width: 160px; min-width: 0; box-sizing: border-box; text-align: center; }
.army-fighter .fighter-icon { width: 44px; height: 44px; margin: 0 auto; align-self: center; }
.army-fighter .fighter-icon img { width: 100%; height: 100%; object-fit: contain; }
.army-fighter-units { width: 100%; font-size: 11px; line-height: 1.25; overflow-wrap: anywhere; }
.schlachtfeld-panel .army-fighter-units { color: #2a1a0a; }