/* =====================================================================
   public/assets/css/theme.css – Aussehen des ganzen Spiels
   ---------------------------------------------------------------------
   Stil: klassisches Lagezentrum. Gedecktes Oliv-Schiefer als Grund,
   Messing als Akzent (wie Rangabzeichen), Signalfarben nur dort, wo
   sie etwas bedeuten (Rot = Gefahr/Verlust, Grün = Gewinn, Blau = Info).

   Aufbau der Datei:
     1. Farben & Maße (Variablen) – hier ändert man das Aussehen zentral
     2. Grundlagen (Schrift, Hintergrund, Überschriften)
     3. Rahmen: Kopfleiste, Lagerleiste, Seitenleiste, Tab-Leiste, Inhalt
     4. Bootstrap-Bausteine (Karten, Tabellen, Formulare, Knöpfe …)
     5. Alte Spielklassen (res-card, chip, section-head …)
     6. Karte (Leaflet)
   ===================================================================== */

/* ---------- 1. Farben & Maße ---------- */
:root {
  /* Flächen: von dunkel (Grund) nach hell (erhoben) */
  --grund:      #161d1a;
  --flaeche:    #1f2925;
  --erhoben:    #28342f;
  --erhoben-2:  #31403a;
  --linie:      #36443e;
  --linie-hell: #4a5a52;

  /* Schrift */
  --text:       #ece9dd;
  --text-2:     #c9cbbf;
  --gedaempft:  #9ba393;
  --schwach:    #6f786c;

  /* Akzent Messing + Signalfarben */
  --messing:      #c9a227;
  --messing-hell: #e3c04f;
  --messing-tief: #8c7019;
  --rot:          #cf4b33;
  --gruen:        #79a85f;
  --blau:         #6a9cc4;
  --gelb:         #d9a43b;

  /* Maße des Rahmens */
  --kopf-h:  56px;
  --lager-h: 56px;
  --seite-b: 248px;
  --tab-h:   62px;
  --radius:  6px;
  --radius-k: 4px;

  --schatten: 0 1px 0 rgba(255,255,255,.03) inset, 0 6px 18px rgba(0,0,0,.28);

  /* Alte Namen – einzelne Seiten nutzen sie in ihrem eigenen <style> */
  --bg-primary:     var(--grund);
  --bg-card:        var(--flaeche);
  --bg-card-hover:  var(--erhoben);
  --bg-input:       #18201d;
  --bg-overlay:     rgba(14,19,17,.9);
  --border-subtle:  var(--linie);
  --border-strong:  var(--linie-hell);
  --text-primary:   var(--text);
  --text-secondary: var(--text-2);
  --text-muted:     var(--gedaempft);
  --text-disabled:  var(--schwach);
  --accent-primary: var(--messing);
  --accent-primary-hover: var(--messing-hell);
  --accent-success: var(--gruen);
  --accent-warning: var(--gelb);
  --accent-danger:  var(--rot);
  --accent-info:    var(--blau);
  --shadow-sm: 0 2px 6px rgba(0,0,0,.25);
  --shadow-md: var(--schatten);
  --shadow-lg: 0 12px 32px rgba(0,0,0,.45);
  /* weitere alte Namen aus Seiten-Stilen (vorher teils nirgends definiert) */
  --bg-page:      var(--grund);
  --bg-hover:     var(--erhoben);
  --primary:      var(--messing);
  --primary-dark: var(--messing-tief);
  --border:       var(--linie);
  --muted:        var(--gedaempft);
  --warning:      var(--gelb);
  --danger:       var(--rot);
}

/* Bootstrap-Variablen auf unsere Farben umstellen. So passen auch
   Klassen wie .text-muted, .bg-secondary oder .border automatisch. */
body.war-theme {
  --bs-body-bg: var(--grund);
  --bs-body-color: var(--text);
  --bs-body-font-family: 'Barlow', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --bs-body-font-size: 1rem;
  --bs-body-line-height: 1.5;
  --bs-emphasis-color: #fff;
  --bs-secondary-color: var(--gedaempft);
  --bs-tertiary-color: var(--schwach);
  --bs-secondary-bg: var(--erhoben);
  --bs-tertiary-bg: var(--flaeche);
  --bs-border-color: var(--linie);
  --bs-border-color-translucent: rgba(255,255,255,.09);
  --bs-border-radius: var(--radius);
  --bs-border-radius-sm: var(--radius-k);
  --bs-border-radius-lg: 8px;
  --bs-link-color: var(--messing-hell);
  --bs-link-color-rgb: 227,192,79;
  --bs-link-hover-color: #f0d478;
  --bs-link-hover-color-rgb: 240,212,120;
  --bs-heading-color: var(--text);
  --bs-code-color: var(--messing-hell);
  --bs-highlight-bg: rgba(201,162,39,.3);
  --bs-primary: var(--messing);
  --bs-primary-rgb: 201,162,39;
  --bs-secondary-rgb: 74,90,82;
  --bs-success-rgb: 121,168,95;
  --bs-danger-rgb: 207,75,51;
  --bs-warning-rgb: 217,164,59;
  --bs-info-rgb: 106,156,196;
  --bs-dark-rgb: 22,29,26;
  --bs-light-rgb: 236,233,221;
  --bs-primary-text-emphasis: var(--messing-hell);
  --bs-success-text-emphasis: #a9d18f;
  --bs-danger-text-emphasis: #f0907d;
  --bs-warning-text-emphasis: #f0c674;
  --bs-info-text-emphasis: #a5c8e4;
  --bs-primary-bg-subtle: rgba(201,162,39,.12);
  --bs-success-bg-subtle: rgba(121,168,95,.12);
  --bs-danger-bg-subtle: rgba(207,75,51,.13);
  --bs-warning-bg-subtle: rgba(217,164,59,.12);
  --bs-info-bg-subtle: rgba(106,156,196,.12);
  --bs-secondary-bg-subtle: rgba(255,255,255,.04);
  --bs-primary-border-subtle: rgba(201,162,39,.4);
  --bs-success-border-subtle: rgba(121,168,95,.4);
  --bs-danger-border-subtle: rgba(207,75,51,.45);
  --bs-warning-border-subtle: rgba(217,164,59,.4);
  --bs-info-border-subtle: rgba(106,156,196,.4);
  --bs-secondary-border-subtle: var(--linie);
  --bs-focus-ring-color: rgba(201,162,39,.35);
}

/* ---------- 2. Grundlagen ---------- */
html { -webkit-text-size-adjust: 100%; }

body.war-theme {
  background-color: var(--grund);
  /* Ganz leichtes Koordinatengitter wie auf einer Lagekarte – nur Struktur,
     keine Ablenkung. Bilder werden nicht geladen (schnell auf dem Handy). */
  background-image:
    linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px);
  background-size: 48px 48px;
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--bs-body-font-family);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}

body.war-theme h1, body.war-theme h2, body.war-theme h3,
body.war-theme h4, body.war-theme h5, body.war-theme h6,
body.war-theme .h1, body.war-theme .h2, body.war-theme .h3,
body.war-theme .h4, body.war-theme .h5, body.war-theme .h6 {
  font-family: 'Barlow Condensed', 'Barlow', sans-serif;
  font-weight: 600;
  letter-spacing: .01em;
  line-height: 1.15;
  color: var(--text);
}
body.war-theme h1, body.war-theme .h1 { font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.1rem); font-weight: 700; }
body.war-theme h2, body.war-theme .h2 { font-size: clamp(1.35rem, 1.1rem + .9vw, 1.65rem); }
body.war-theme h3, body.war-theme .h3 { font-size: 1.4rem; }
body.war-theme h4, body.war-theme .h4 { font-size: 1.25rem; }
body.war-theme h5, body.war-theme .h5 { font-size: 1.15rem; }
body.war-theme h6, body.war-theme .h6 { font-size: 1rem; color: var(--text-2); }

/* Seitenüberschrift: feine Messing-Linie darunter = klare "Seitenkante" */
body.war-theme .inhalt h1:first-of-type {
  padding-bottom: .5rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--linie);
  position: relative;
}
body.war-theme .inhalt h1:first-of-type::after {
  content: "";
  position: absolute;
  left: 0; bottom: -1px;
  width: 56px; height: 2px;
  background: var(--messing);
}

/* Links: Farbe kommt aus --bs-link-color (oben). Kein "body a {…}" –
   das wäre stärker als .btn und färbt sonst Knopf-Texte messingfarben. */
a { text-underline-offset: 2px; }
body.war-theme .text-muted, body.war-theme .form-text { color: var(--gedaempft) !important; }
body.war-theme small, body.war-theme .small { font-size: .875rem; }
body.war-theme code { color: var(--messing-hell); background: rgba(0,0,0,.25); padding: .1rem .35rem; border-radius: 3px; }
body.war-theme hr { border-color: var(--linie); opacity: 1; }
body.war-theme ::selection { background: rgba(201,162,39,.35); color: #fff; }

/* Zahlen gleich breit → Spalten und Zähler springen nicht */
body.war-theme .table td, body.war-theme .lager-wert, body.war-theme .timer,
body.war-theme .badge, body.war-theme .stat-value, body.war-theme .res-value { font-variant-numeric: tabular-nums; }

/* Tastatur-Fokus gut sichtbar */
body.war-theme :focus-visible {
  outline: 2px solid var(--messing-hell);
  outline-offset: 2px;
}

/* Farben für Text in Meldungen */
.text-gefahr { color: #f0907d !important; }
body.war-theme .text-danger  { color: #f0907d !important; }
body.war-theme .text-success { color: #a9d18f !important; }
body.war-theme .text-warning { color: #f0c674 !important; }
body.war-theme .text-info    { color: #a5c8e4 !important; }
body.war-theme .text-primary { color: var(--messing-hell) !important; }

/* ---------- 3. Rahmen (App-Shell) ---------- */

/* 3a) Kopfleiste */
.kopfleiste {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: calc(var(--kopf-h) + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) max(12px, env(safe-area-inset-right)) 0 max(12px, env(safe-area-inset-left));
  z-index: 1040;
  display: flex;
  align-items: center;
  gap: .75rem;
  background: #121815;
  border-bottom: 1px solid var(--linie);
  /* Messing-Kante oben: klassischer "Dienstgrad-Streifen" */
  box-shadow: inset 0 2px 0 var(--messing-tief);
}

.marke {
  display: flex;
  align-items: center;
  gap: .55rem;
  color: var(--text) !important;
  text-decoration: none;
  flex-shrink: 0;
}
.marke-abzeichen { width: 30px; height: 30px; color: var(--messing); }
.marke-text {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 1.4rem;
  letter-spacing: .03em;
  line-height: 1;
}
.marke-text small {
  font-size: .8rem;
  font-weight: 600;
  color: var(--grund);
  background: var(--messing);
  padding: .1rem .35rem;
  border-radius: 3px;
  vertical-align: middle;
  margin-left: .2rem;
}
@media (min-width: 992px) {
  /* Marke steht genau über der Seitenleiste */
  .marke { width: calc(var(--seite-b) - 24px); }
}

.stadt-anzeige {
  align-items: center;
  gap: .55rem;
  padding: .3rem .75rem;
  border: 1px solid var(--linie);
  border-radius: var(--radius);
  background: var(--flaeche);
  color: var(--text) !important;
  text-decoration: none;
  min-width: 0;
}
.stadt-anzeige:hover { border-color: var(--linie-hell); }
.stadt-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.land-name  { color: var(--gedaempft); font-size: .9rem; white-space: nowrap; }
.stadt-anzeige .land-name::before { content: "/"; margin-right: .55rem; color: var(--schwach); }
.land-punkt {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--land, #8a8f7a);
  box-shadow: 0 0 0 2px rgba(0,0,0,.35), 0 0 0 3px rgba(255,255,255,.12);
  flex-shrink: 0;
}

.kopf-rechts { margin-left: auto; display: flex; align-items: center; gap: .4rem; }
.kopf-knopf {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px; height: 42px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-2) !important;
  font-size: 1.25rem;
  text-decoration: none;
}
.kopf-knopf:hover { background: var(--erhoben); color: var(--text) !important; }
.kopf-knopf .zaehler { position: absolute; top: 3px; right: 1px; }
.kopf-link { color: var(--text-2) !important; text-decoration: none; padding: .4rem .6rem; }
.kopf-link:hover { color: var(--text) !important; }

.konto-knopf {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  height: 40px;
  padding: 0 .7rem;
  border-radius: var(--radius);
  border: 1px solid var(--linie);
  background: var(--flaeche);
  color: var(--text);
  font-weight: 500;
}
.konto-knopf:hover, .konto-knopf[aria-expanded="true"] { border-color: var(--linie-hell); background: var(--erhoben); }
.konto-knopf .bi { font-size: 1.1rem; color: var(--messing); }
.konto-knopf .klein { font-size: .75rem; color: var(--gedaempft); }
.konto-knopf span { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Zähler-Abzeichen (Meldungen, Bergung) */
.zaehler {
  min-width: 19px; height: 19px;
  padding: 0 5px;
  border-radius: 10px;
  background: var(--rot);
  color: #fff;
  font-size: .72rem;
  font-weight: 700;
  line-height: 19px;
  text-align: center;
  box-shadow: 0 0 0 2px #121815;
}
.zaehler[hidden] { display: none !important; }

/* 3b) Lagerleiste (Ressourcen) */
.lagerleiste {
  position: fixed;
  top: calc(var(--kopf-h) + env(safe-area-inset-top));
  left: 0; right: 0;
  height: var(--lager-h);
  z-index: 1030;
  background: #19211e;
  border-bottom: 1px solid var(--linie);
  box-shadow: 0 4px 12px rgba(0,0,0,.22);
}
.lager-innen {
  height: 100%;
  display: flex;
  align-items: stretch;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;            /* Firefox: Leiste ohne Scrollbalken */
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
}
.lager-innen::-webkit-scrollbar { display: none; }
.seitenleiste .offcanvas-body::-webkit-scrollbar { width: 6px; }
.seitenleiste .offcanvas-body::-webkit-scrollbar-thumb { background: var(--linie-hell); border-radius: 3px; }
.seitenleiste .offcanvas-body::-webkit-scrollbar-track { background: transparent; }

.lager-posten {
  flex: 1 0 auto;
  min-width: 104px;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: .5rem;
  align-items: center;
  padding: .35rem .8rem;
  border-right: 1px solid var(--linie);
  color: var(--text) !important;
  text-decoration: none;
  scroll-snap-align: start;
}
.lager-posten:last-child { border-right: 0; }
a.lager-posten:hover { background: var(--flaeche); }
.lager-icon { grid-row: 1 / span 2; font-size: 1.2rem; color: var(--res, var(--gedaempft)); }
.lager-text { display: flex; flex-direction: column; line-height: 1.05; min-width: 0; }
.lager-name { font-size: .72rem; color: var(--gedaempft); letter-spacing: .02em; }
.lager-wert {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 600;
  font-size: 1.12rem;
  white-space: nowrap;
}
.lager-rate {
  grid-column: 2;
  font-size: .72rem;
  font-weight: 600;
  color: var(--schwach);
  white-space: nowrap;
  line-height: 1.1;
}
.lager-rate.plus  { color: var(--gruen); }
.lager-rate.minus { color: #ef7d66; }
.lager-rate:not(:empty)::after { content: "/min"; font-weight: 400; opacity: .75; margin-left: 1px; }
.res-energie .lager-rate::after { content: none; }
.lager-rate.ohne-min::after { content: none; }
/* Geld im Minus: Posten rot hinterlegt, damit es sofort auffällt */
.lager-posten.lager-alarm { background: rgba(207,75,51,.18); }
.lager-posten.lager-alarm .lager-wert { color: #f0907d; }

/* Erkennungsfarbe je Rohstoff (Icon) */
.res-getreide   { --res: #d8b64c; }
.res-holz       { --res: #a9814f; }
.res-erz        { --res: #b39b86; }
.res-kohle      { --res: #8d8f8e; }
.res-stahl      { --res: #9fb3c2; }
.res-oel        { --res: #6f7f8a; }
.res-treibstoff { --res: #c97c3a; }
.res-munition   { --res: #9b9a5a; }
.res-abfang     { --res: #7fb3d5; }   /* Abfangraketen (Flugabwehr) */
.res-teile      { --res: #a3b1bd; }   /* Maschinenteile (Veredelung) */
.res-kunststoff { --res: #6cc4b8; }   /* Kunststoff */
.res-waren      { --res: #d98bb4; }   /* Konsumgüter */
.res-geld       { --res: #e3c04f; }
.res-energie    { --res: #f2d04e; }

/* Ressourcen-Symbol im Text (src/ui.php → res_symbol) */
.res-sym { color: var(--res, var(--gedaempft)); }
.res-liste { list-style: none; padding: 0; margin: .15rem 0 .6rem; font-size: .9rem; }
.res-liste li { display: flex; align-items: center; gap: .45rem; padding: .1rem 0; }
.res-liste li strong { margin-left: auto; font-weight: 600; font-variant-numeric: tabular-nums; }
.res-liste .res-sym { width: 1.1rem; text-align: center; }

/* Abzeichen für Computergegner */
.bot-abzeichen {
  display: inline-flex; align-items: center; gap: .2rem;
  font-size: .72rem; font-weight: 600; line-height: 1;
  padding: .15rem .35rem; border-radius: 3px; vertical-align: middle;
  color: #a5c8e4; background: rgba(106,156,196,.14); border: 1px solid rgba(106,156,196,.4);
}

/* 3c) Seitenleiste */
.seitenleiste .offcanvas-header {
  border-bottom: 1px solid var(--linie);
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.3rem;
  font-weight: 600;
}
body.war-theme .seitenleiste {
  background: #121815 !important;   /* Bootstrap setzt hier sonst "transparent" */
  border-right: 1px solid var(--linie);
  color: var(--text);
  --bs-offcanvas-width: min(300px, 86vw);
  --bs-offcanvas-bg: #121815;
}
.seitenleiste .offcanvas-body {
  /* schmaler, dunkler Scrollbalken statt des grauen Standardbalkens */
  scrollbar-width: thin;
  scrollbar-color: var(--linie-hell) transparent;
  display: flex;
  flex-direction: column;
  padding: .75rem 0 1.5rem;
  overflow-y: auto;
}
@media (min-width: 992px) {
  body.war-theme .seitenleiste {
    position: fixed;
    top: calc(var(--kopf-h) + env(safe-area-inset-top));
    bottom: 0; left: 0;
    width: var(--seite-b);
    z-index: 1020;
  }
  .seitenleiste .offcanvas-body { padding: 1rem 0 2rem; overflow-y: auto; height: 100%; }
}

.menue-stadt {
  display: flex;
  align-items: center;
  gap: .7rem;
  margin: 0 .9rem .75rem;
  padding: .7rem .8rem;
  border: 1px solid var(--linie);
  border-radius: var(--radius);
  background: var(--flaeche);
}
.menue-gruppe { padding: .25rem 0 .6rem; }
.menue-gruppe + .menue-gruppe { border-top: 1px solid rgba(255,255,255,.05); padding-top: .6rem; }
.menue-titel {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 600;
  font-size: .95rem;
  letter-spacing: .04em;
  color: var(--messing);
  padding: .2rem 1.25rem .35rem;
}
.menue-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: .75rem;
  min-height: 42px;                /* groß genug für den Daumen */
  padding: .4rem 1.25rem;
  color: var(--text-2) !important;
  text-decoration: none;
  font-weight: 500;
  border-left: 3px solid transparent;
}
.menue-link .bi { font-size: 1.1rem; width: 1.25rem; text-align: center; color: var(--gedaempft); }
.menue-link:hover { background: var(--flaeche); color: var(--text) !important; }
.menue-link:hover .bi { color: var(--text-2); }
.menue-link.aktiv {
  background: linear-gradient(90deg, rgba(201,162,39,.16), rgba(201,162,39,0) 85%);
  border-left-color: var(--messing);
  color: #fff !important;
  font-weight: 600;
}
.menue-link.aktiv .bi { color: var(--messing-hell); }
.menue-link .zaehler { margin-left: auto; box-shadow: none; }

/* 3d) Tab-Leiste unten (nur Handy/Tablet) */
.tableiste {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 1035;
  height: calc(var(--tab-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  background: #121815;
  border-top: 1px solid var(--linie);
  box-shadow: 0 -6px 16px rgba(0,0,0,.3);
}
.tab {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border: 0;
  background: transparent;
  color: var(--gedaempft) !important;
  text-decoration: none;
  font-size: .74rem;
  font-weight: 500;
}
.tab .bi { font-size: 1.35rem; line-height: 1; }
.tab.aktiv { color: var(--messing-hell) !important; }
.tab.aktiv::before {
  content: "";
  position: absolute;
  top: -1px; left: 26%; right: 26%;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: var(--messing);
}
.zaehler-tab { position: absolute; top: 6px; left: calc(50% + 6px); }

/* 3e) Inhaltsbereich */
.inhalt {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-top: calc(var(--kopf-h) + env(safe-area-inset-top) + 1.25rem);
  padding-left: max(14px, env(safe-area-inset-left));
  padding-right: max(14px, env(safe-area-inset-right));
}
/* Mit Lagerleiste: Inhalt beginnt darunter */
body:has(.lagerleiste) .inhalt {
  padding-top: calc(var(--kopf-h) + var(--lager-h) + env(safe-area-inset-top) + 1.25rem);
}
/* Platz für die Tab-Leiste unten */
body.mit-shell:not(.admin-bereich) .inhalt {
  padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom));
}
.inhalt-schmal { width: 100%; max-width: 1240px; margin: 0 auto; flex: 1 0 auto; }
.inhalt-breit  { width: 100%; flex: 1 0 auto; }

@media (min-width: 992px) {
  body.mit-shell .lagerleiste { left: var(--seite-b); }
  body.mit-shell .inhalt {
    margin-left: var(--seite-b);
    padding-left: 2rem;
    padding-right: 2rem;
  }
  body.mit-shell:not(.admin-bereich) .inhalt { padding-bottom: 0; }
}

/* Ohne Login (Anmelden/Registrieren): schmal und mittig */
body.ohne-shell .inhalt-schmal { max-width: 980px; }

.seiten-fuss {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .4rem 1.25rem;
  padding: 2rem 0 1.25rem;
  margin-top: 2rem;
  font-size: .85rem;
  color: var(--schwach);
}
.seiten-fuss a { color: var(--gedaempft) !important; text-decoration: none; }
.seiten-fuss a:hover { color: var(--text) !important; text-decoration: underline; }

/* ---------- 4. Bootstrap-Bausteine ---------- */

/* Karten */
body.war-theme .card {
  --bs-card-bg: var(--flaeche);
  --bs-card-border-color: var(--linie);
  --bs-card-cap-bg: var(--erhoben);
  --bs-card-color: var(--text);
  --bs-card-border-radius: var(--radius);
  --bs-card-inner-border-radius: calc(var(--radius) - 1px);
  --bs-card-spacer-y: 1.1rem;
  --bs-card-spacer-x: 1.15rem;
  box-shadow: var(--schatten);
}
body.war-theme .card-header {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 600;
  font-size: 1.1rem;
  border-bottom-color: var(--linie);
}
body.war-theme .card-footer { border-top-color: var(--linie); background: rgba(0,0,0,.12); }
body.war-theme .card-title { font-family: 'Barlow Condensed', sans-serif; font-weight: 600; }
body.war-theme .card-body > h5:first-child,
body.war-theme .card-body > h4:first-child {
  display: flex;
  align-items: center;
  gap: .5rem;
}

/* Tabellen */
body.war-theme .table {
  --bs-table-bg: transparent;
  --bs-table-color: var(--text);
  --bs-table-border-color: var(--linie);
  --bs-table-striped-bg: rgba(255,255,255,.025);
  --bs-table-striped-color: var(--text);
  --bs-table-hover-bg: rgba(201,162,39,.06);
  --bs-table-hover-color: var(--text);
  --bs-table-active-bg: rgba(201,162,39,.1);
  --bs-table-active-color: var(--text);
  margin-bottom: 0;
}
body.war-theme .table > :not(caption) > * > * { padding: .55rem .65rem; }
body.war-theme .table-sm > :not(caption) > * > * { padding: .4rem .55rem; }
body.war-theme .table thead th {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 600;
  font-size: .95rem;
  letter-spacing: .02em;
  color: var(--gedaempft);
  background: rgba(0,0,0,.14);
  border-bottom: 1px solid var(--linie-hell);
  white-space: nowrap;
}
body.war-theme .table-dark { --bs-table-bg: transparent; --bs-table-color: var(--text); }
body.war-theme .table-responsive { border-radius: var(--radius-k); }

/* Formulare */
body.war-theme .form-control,
body.war-theme .form-select {
  background-color: var(--bg-input);
  border: 1px solid var(--linie-hell);
  color: var(--text);
  border-radius: var(--radius-k);
  min-height: 42px;               /* bequem auf dem Handy */
}
body.war-theme .form-control-sm, body.war-theme .form-select-sm { min-height: 34px; }
body.war-theme .form-control::placeholder { color: var(--schwach); }
body.war-theme .form-control:focus,
body.war-theme .form-select:focus {
  background-color: #1b2420;
  border-color: var(--messing);
  color: var(--text);
  box-shadow: 0 0 0 .2rem rgba(201,162,39,.2);
}
body.war-theme .form-control:disabled, body.war-theme .form-select:disabled { background-color: rgba(0,0,0,.2); color: var(--schwach); }
body.war-theme .form-select {
  /* Pfeil in heller Farbe, sonst unsichtbar auf dunklem Grund */
  --bs-form-select-bg-img: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23c9cbbf' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
}
body.war-theme .form-label { color: var(--text-2); font-weight: 500; margin-bottom: .3rem; }
body.war-theme .form-check-input { background-color: var(--bg-input); border-color: var(--linie-hell); }
body.war-theme .form-check-input:checked { background-color: var(--messing); border-color: var(--messing); }
body.war-theme .form-range::-webkit-slider-thumb { background: var(--messing); }
body.war-theme .form-range::-moz-range-thumb { background: var(--messing); }
body.war-theme .input-group-text { background: var(--erhoben); border-color: var(--linie-hell); color: var(--text-2); }

/* Knöpfe – Messing = Hauptaktion, Farben nur mit Bedeutung */
body.war-theme .btn {
  --bs-btn-font-weight: 600;
  --bs-btn-border-radius: var(--radius-k);
  --bs-btn-padding-y: .45rem;
  --bs-btn-padding-x: .95rem;
  letter-spacing: .01em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
}
body.war-theme .btn-sm { --bs-btn-padding-y: .25rem; --bs-btn-padding-x: .6rem; --bs-btn-font-size: .85rem; }
body.war-theme .btn-lg { --bs-btn-padding-y: .65rem; --bs-btn-padding-x: 1.3rem; }
body.war-theme .btn-primary {
  --bs-btn-color: #1a1505;
  --bs-btn-bg: var(--messing);
  --bs-btn-border-color: var(--messing);
  --bs-btn-hover-color: #1a1505;
  --bs-btn-hover-bg: var(--messing-hell);
  --bs-btn-hover-border-color: var(--messing-hell);
  --bs-btn-active-color: #1a1505;
  --bs-btn-active-bg: #b08d1f;
  --bs-btn-active-border-color: #b08d1f;
  --bs-btn-disabled-color: #1a1505;
  --bs-btn-disabled-bg: var(--messing-tief);
  --bs-btn-disabled-border-color: var(--messing-tief);
  --bs-btn-focus-shadow-rgb: 201,162,39;
}
body.war-theme .btn-success {
  --bs-btn-color: #fff; --bs-btn-bg: #4f7a3d; --bs-btn-border-color: #4f7a3d;
  --bs-btn-hover-color: #fff; --bs-btn-hover-bg: #5d8c48; --bs-btn-hover-border-color: #5d8c48;
  --bs-btn-active-bg: #446a34; --bs-btn-active-border-color: #446a34;
  --bs-btn-disabled-bg: #3d5531; --bs-btn-disabled-border-color: #3d5531;
}
body.war-theme .btn-danger {
  --bs-btn-color: #fff; --bs-btn-bg: #a8392a; --bs-btn-border-color: #a8392a;
  --bs-btn-hover-color: #fff; --bs-btn-hover-bg: #bf4331; --bs-btn-hover-border-color: #bf4331;
  --bs-btn-active-bg: #8f3123; --bs-btn-active-border-color: #8f3123;
  --bs-btn-disabled-bg: #6e2a20; --bs-btn-disabled-border-color: #6e2a20;
}
body.war-theme .btn-warning {
  --bs-btn-color: #1d1606; --bs-btn-bg: #c48e2c; --bs-btn-border-color: #c48e2c;
  --bs-btn-hover-color: #1d1606; --bs-btn-hover-bg: #d9a43b; --bs-btn-hover-border-color: #d9a43b;
  --bs-btn-active-bg: #a97a25; --bs-btn-active-border-color: #a97a25;
}
body.war-theme .btn-info {
  --bs-btn-color: #fff; --bs-btn-bg: #426f93; --bs-btn-border-color: #426f93;
  --bs-btn-hover-color: #fff; --bs-btn-hover-bg: #4d7ea6; --bs-btn-hover-border-color: #4d7ea6;
  --bs-btn-active-bg: #385f7e; --bs-btn-active-border-color: #385f7e;
}
body.war-theme .btn-secondary,
body.war-theme .btn-dark {
  --bs-btn-color: var(--text); --bs-btn-bg: var(--erhoben-2); --bs-btn-border-color: var(--linie-hell);
  --bs-btn-hover-color: #fff; --bs-btn-hover-bg: #3b4b44; --bs-btn-hover-border-color: #5a6b62;
  --bs-btn-active-bg: #2b3833; --bs-btn-active-border-color: var(--linie-hell);
}
body.war-theme .btn-outline-secondary,
body.war-theme .btn-outline-light,
body.war-theme .btn-ghost {
  --bs-btn-color: var(--text-2); --bs-btn-border-color: var(--linie-hell); --bs-btn-bg: transparent;
  --bs-btn-hover-color: var(--text); --bs-btn-hover-bg: var(--erhoben); --bs-btn-hover-border-color: #5a6b62;
  --bs-btn-active-color: var(--text); --bs-btn-active-bg: var(--erhoben-2); --bs-btn-active-border-color: #5a6b62;
}
body.war-theme .btn-outline-primary {
  --bs-btn-color: var(--messing-hell); --bs-btn-border-color: var(--messing);
  --bs-btn-hover-color: #1a1505; --bs-btn-hover-bg: var(--messing); --bs-btn-hover-border-color: var(--messing);
  --bs-btn-active-color: #1a1505; --bs-btn-active-bg: var(--messing); --bs-btn-active-border-color: var(--messing);
}
body.war-theme .btn-outline-danger {
  --bs-btn-color: #f0907d; --bs-btn-border-color: #a8392a;
  --bs-btn-hover-color: #fff; --bs-btn-hover-bg: #a8392a; --bs-btn-hover-border-color: #a8392a;
}
body.war-theme .btn-outline-success {
  --bs-btn-color: #a9d18f; --bs-btn-border-color: #4f7a3d;
  --bs-btn-hover-color: #fff; --bs-btn-hover-bg: #4f7a3d; --bs-btn-hover-border-color: #4f7a3d;
}
body.war-theme .btn-outline-warning {
  --bs-btn-color: #f0c674; --bs-btn-border-color: #c48e2c;
  --bs-btn-hover-color: #1d1606; --bs-btn-hover-bg: #c48e2c; --bs-btn-hover-border-color: #c48e2c;
}
body.war-theme .btn-outline-info {
  --bs-btn-color: #a5c8e4; --bs-btn-border-color: #426f93;
  --bs-btn-hover-color: #fff; --bs-btn-hover-bg: #426f93; --bs-btn-hover-border-color: #426f93;
}
body.war-theme .btn-link { --bs-btn-color: var(--messing-hell); --bs-btn-hover-color: #f0d478; }

/* Hinweise */
body.war-theme .alert {
  --bs-alert-border-radius: var(--radius);
  border-width: 1px 1px 1px 4px;
}
body.war-theme .alert-secondary,
body.war-theme .alert-light,
body.war-theme .alert-dark {
  --bs-alert-color: var(--text-2);
  --bs-alert-bg: rgba(255,255,255,.035);
  --bs-alert-border-color: var(--linie);
  border-left-color: var(--linie-hell);
}
body.war-theme .alert-primary { border-left-color: var(--messing); }
body.war-theme .alert-success { border-left-color: var(--gruen); }
body.war-theme .alert-danger  { border-left-color: var(--rot); }
body.war-theme .alert-warning { border-left-color: var(--gelb); }
body.war-theme .alert-info    { border-left-color: var(--blau); }
body.war-theme .alert .alert-link { color: inherit; }

/* Abzeichen */
body.war-theme .badge {
  font-weight: 600;
  font-size: .74rem;
  padding: .3em .55em;
  border-radius: 3px;
  letter-spacing: .01em;
}
body.war-theme .badge.bg-warning, body.war-theme .badge.text-bg-warning { color: #1d1606 !important; }
body.war-theme .badge.bg-primary, body.war-theme .badge.text-bg-primary { color: #1a1505 !important; }
body.war-theme .badge.bg-secondary { color: var(--text) !important; }
body.war-theme .badge.bg-light { color: var(--grund) !important; }

/* Klappmenüs */
body.war-theme .dropdown-menu {
  --bs-dropdown-bg: var(--erhoben);
  --bs-dropdown-border-color: var(--linie-hell);
  --bs-dropdown-color: var(--text);
  --bs-dropdown-link-color: var(--text-2);
  --bs-dropdown-link-hover-color: #fff;
  --bs-dropdown-link-hover-bg: var(--erhoben-2);
  --bs-dropdown-link-active-color: #1a1505;
  --bs-dropdown-link-active-bg: var(--messing);
  --bs-dropdown-divider-bg: var(--linie);
  --bs-dropdown-header-color: var(--gedaempft);
  --bs-dropdown-border-radius: var(--radius);
  --bs-dropdown-item-padding-y: .5rem;
  box-shadow: var(--shadow-lg);
}
body.war-theme .dropdown-item { display: flex; align-items: center; gap: .55rem; }
body.war-theme .dropdown-item .bi { color: var(--gedaempft); }

/* Listen */
body.war-theme .list-group {
  --bs-list-group-bg: var(--flaeche);
  --bs-list-group-color: var(--text);
  --bs-list-group-border-color: var(--linie);
  --bs-list-group-action-hover-bg: var(--erhoben);
  --bs-list-group-action-hover-color: var(--text);
  --bs-list-group-active-bg: rgba(201,162,39,.18);
  --bs-list-group-active-border-color: var(--messing);
  --bs-list-group-active-color: #fff;
}

/* Ungelesene Meldungen: Messing-Kante statt gelbem Hintergrund */
body.war-theme .list-group-item-warning {
  background: rgba(201,162,39,.07);
  color: var(--text);
  box-shadow: inset 3px 0 0 var(--messing);
}

/* Reiter (Tabs) – aktive Seite mit Messing-Unterstrich, klassisch wie Aktenreiter */
body.war-theme .nav-tabs {
  --bs-nav-tabs-border-color: var(--linie);
  --bs-nav-tabs-link-active-bg: var(--flaeche);
  --bs-nav-tabs-link-active-color: var(--text);
  --bs-nav-tabs-link-active-border-color: var(--linie) var(--linie) var(--flaeche);
  --bs-nav-tabs-link-hover-border-color: transparent;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}
body.war-theme .nav-tabs::-webkit-scrollbar { display: none; }
body.war-theme .nav-tabs .nav-link {
  color: var(--gedaempft);
  font-weight: 600;
  white-space: nowrap;
}
body.war-theme .nav-tabs .nav-link:hover { color: var(--text); }
body.war-theme .nav-tabs .nav-link.active { box-shadow: inset 0 2px 0 var(--messing); }
body.war-theme .nav-pills {
  --bs-nav-pills-link-active-bg: var(--messing);
  --bs-nav-pills-link-active-color: #1a1505;
}
body.war-theme .nav-pills .nav-link { color: var(--text-2); }
body.war-theme .nav-pills .nav-link.active { color: #1a1505; }

/* Fortschrittsbalken (Bau, Forschung) */
body.war-theme .progress {
  --bs-progress-bg: rgba(0,0,0,.3);
  --bs-progress-bar-bg: var(--messing);
  --bs-progress-border-radius: 3px;
  box-shadow: inset 0 0 0 1px var(--linie);
}

/* Dialoge, ausfahrende Fenster, Tooltips */
body.war-theme .modal {
  --bs-modal-bg: var(--flaeche);
  --bs-modal-border-color: var(--linie-hell);
  --bs-modal-header-border-color: var(--linie);
  --bs-modal-footer-border-color: var(--linie);
  --bs-modal-color: var(--text);
}
body.war-theme .modal-title { font-family: 'Barlow Condensed', sans-serif; font-weight: 600; font-size: 1.35rem; }
body.war-theme .btn-close { filter: invert(1) grayscale(1) brightness(1.6); }
body.war-theme .tooltip { --bs-tooltip-bg: #0e1311; --bs-tooltip-color: var(--text); --bs-tooltip-opacity: .97; }
body.war-theme .popover {
  --bs-popover-bg: var(--erhoben); --bs-popover-border-color: var(--linie-hell);
  --bs-popover-header-bg: var(--erhoben-2); --bs-popover-body-color: var(--text);
}
body.war-theme .pagination {
  --bs-pagination-bg: var(--flaeche); --bs-pagination-border-color: var(--linie);
  --bs-pagination-color: var(--text-2); --bs-pagination-hover-bg: var(--erhoben);
  --bs-pagination-hover-color: var(--text); --bs-pagination-hover-border-color: var(--linie-hell);
  --bs-pagination-active-bg: var(--messing); --bs-pagination-active-border-color: var(--messing);
  --bs-pagination-active-color: #1a1505;
  --bs-pagination-disabled-bg: var(--grund); --bs-pagination-disabled-color: var(--schwach);
  --bs-pagination-disabled-border-color: var(--linie);
}
body.war-theme .bg-dark  { background-color: var(--flaeche) !important; }
body.war-theme .bg-light { background-color: var(--erhoben) !important; color: var(--text) !important; }
body.war-theme .border   { border-color: var(--linie) !important; }

/* ---------- 5. Alte Spielklassen (werden von einzelnen Seiten benutzt) ---------- */

.res-card {
  position: relative;
  background: var(--erhoben);
  border: 1px solid var(--linie);
  border-radius: var(--radius-k);
  padding: .65rem .85rem;
}
.res-title { font-size: .85rem; color: var(--gedaempft); margin-bottom: .1rem; }
.res-value {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.45rem;
  font-weight: 600;
  line-height: 1.15;
  color: var(--text);
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .5rem 1rem;
  margin-bottom: 1rem;
}
.section-head h2 { font-size: 1.35rem; margin: 0; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-size: .8rem;
  padding: .2rem .6rem;
  border-radius: 3px;
  background: rgba(255,255,255,.05);
  color: var(--text-2);
  border: 1px solid var(--linie);
  font-weight: 500;
}

.glass {
  background: var(--flaeche);
  border: 1px solid var(--linie);
  border-radius: var(--radius);
  box-shadow: var(--schatten);
  color: var(--text);
}
.hero-war {
  background: linear-gradient(135deg, rgba(201,162,39,.1), rgba(121,168,95,.06)), var(--flaeche);
  border-radius: var(--radius);
  padding: 1.5rem;
  border: 1px solid var(--linie);
  box-shadow: var(--schatten);
}
.hero-war .stat { display: flex; gap: .5rem; align-items: center; font-weight: 600; }
.hero-war .muted { color: var(--gedaempft); font-weight: 400; }

.content-slot {
  min-height: 420px;
  border: 2px dashed var(--linie);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gedaempft);
}
.card-compact .card-body { padding: .75rem 1rem; }
.loading { opacity: .6; pointer-events: none; }

/* Wiederkehrende Kacheln mehrerer Seiten (Kennzahlen) */
body.war-theme .stat-card,
body.war-theme .info-card {
  background: var(--flaeche);
  border: 1px solid var(--linie);
  border-radius: var(--radius);
  box-shadow: var(--schatten);
}
body.war-theme .stat-label { color: var(--gedaempft); }
body.war-theme .stat-value { font-family: 'Barlow Condensed', sans-serif; font-weight: 600; }
body.war-theme .stat-value.positive { color: #a9d18f; }
body.war-theme .stat-value.negative { color: #f0907d; }

/* Anmelden / Registrieren: schmale Karte in der Mitte */
.anmelde-karte {
  max-width: 440px;
  margin: 2rem auto 0;
  padding: 2rem 1.75rem 1.5rem;
  background: var(--flaeche);
  border: 1px solid var(--linie);
  border-top: 3px solid var(--messing);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}
.anmelde-kopf { text-align: center; margin-bottom: 1.5rem; }
.anmelde-kopf img { margin-bottom: .75rem; }
body.war-theme .anmelde-kopf h1 { border: 0; padding: 0; margin: 0 0 .35rem; }
body.war-theme .anmelde-kopf h1::after { content: none; }
.anmelde-kopf p { color: var(--gedaempft); margin: 0; }
.anmelde-fuss { text-align: center; margin: 1.25rem 0 0; color: var(--gedaempft); }
@media (max-width: 575.98px) { .anmelde-karte { margin-top: .5rem; padding: 1.5rem 1.1rem 1.25rem; } }

/* ---------- 6. Karte (Leaflet) ---------- */
body.war-theme .leaflet-container { background: #0f1513; font-family: var(--bs-body-font-family); }
body.war-theme .leaflet-bar a,
body.war-theme .leaflet-control-zoom a {
  background: var(--erhoben) !important;
  color: var(--text) !important;
  border-color: var(--linie) !important;
}
body.war-theme .leaflet-bar { border: 1px solid var(--linie-hell) !important; box-shadow: var(--shadow-sm) !important; }
body.war-theme .leaflet-popup-content-wrapper,
body.war-theme .leaflet-popup-tip {
  background: var(--erhoben);
  color: var(--text);
  box-shadow: var(--shadow-lg);
}
body.war-theme .leaflet-popup-content-wrapper { border: 1px solid var(--linie-hell); border-radius: var(--radius); }
body.war-theme .leaflet-control-attribution { background: rgba(18,24,21,.8) !important; color: var(--gedaempft) !important; }
body.war-theme .leaflet-control-attribution a { color: var(--text-2) !important; }

/* ---------- Kleinere Bildschirme ---------- */
@media (max-width: 575.98px) {
  :root { --lager-h: 52px; }
  .lager-posten { min-width: 96px; padding: .3rem .65rem; }
  .lager-wert { font-size: 1.05rem; }
  .marke-text { font-size: 1.25rem; }
  body.war-theme .card { --bs-card-spacer-x: .9rem; --bs-card-spacer-y: .9rem; }
  .res-value { font-size: 1.25rem; }
  .section-head { align-items: flex-start; }
}

/* Weniger Bewegung, wenn der Nutzer das im System eingestellt hat */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* Druck: Rahmen weglassen, nur Inhalt */
@media print {
  .kopfleiste, .lagerleiste, .seitenleiste, .tableiste, .seiten-fuss { display: none !important; }
  .inhalt { margin: 0 !important; padding: 0 !important; }
  body.war-theme { background: #fff; color: #000; }
}

/* Anrollender Angriff: Zähler bei „Verteidigung“ pulsiert leicht */
.zaehler-alarm { animation: zaehler-puls 1.6s ease-in-out infinite; }
@keyframes zaehler-puls { 50% { box-shadow: 0 0 0 2px #121815, 0 0 0 6px rgba(207,75,51,.35); } }
@media (prefers-reduced-motion: reduce) { .zaehler-alarm { animation: none; } }


/* ===== Hinweis "App installieren" (public/js/app-installieren.js) =====
   Unten mittig über allem; auf dem Handy volle Breite mit 16px Rand.
   env(safe-area-inset-bottom): Abstand zur Wisch-Leiste beim iPhone. */
.app-hinweis {
  position: fixed; z-index: 2000;
  left: 50%; transform: translateX(-50%);
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  width: min(560px, calc(100% - 32px));
  display: flex; align-items: center; gap: .85rem; flex-wrap: wrap;
  padding: .85rem 1rem;
  background: #1d2622; color: var(--text, #e8e4d8);
  border: 1px solid rgba(201, 162, 39, .55); border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .55);
  animation: app-hinweis-rein .35s ease-out;
}
.app-hinweis-bild { width: 48px; height: 48px; border-radius: 11px; flex: 0 0 auto; }
.app-hinweis-text { flex: 1 1 220px; display: flex; flex-direction: column; gap: .15rem; font-size: .92rem; line-height: 1.4; }
.app-hinweis-text strong { color: #c9a227; font-size: 1rem; }
.app-hinweis-text span { color: var(--gedaempft, #a9b0a8); }
.app-hinweis-text b { color: var(--text, #e8e4d8); }
.app-hinweis-knoepfe { display: flex; gap: .5rem; margin-left: auto; }
@keyframes app-hinweis-rein { from { opacity: 0; transform: translate(-50%, 20px); } to { opacity: 1; transform: translate(-50%, 0); } }
/* Als installierte App: Abstand oben für Uhr/Notch am iPhone */
@media (display-mode: standalone) { body { padding-top: env(safe-area-inset-top, 0px); } }

/* ===== Fotos auf Einheiten- und Gebäudekarten (src/ui.php spiel_bild_html) =====
   Einheitlich 16:10, oben an der Karte, leicht entsättigt passend zum dunklen Militär-Stil. */
.card > .spiel-bild {
  display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover;
  border-top-left-radius: inherit; border-top-right-radius: inherit;
  filter: saturate(.85) contrast(1.03);
  border-bottom: 1px solid rgba(201, 162, 39, .35);
}

/* ===== Kompakte Karten (Marco, 10.10.2026: „alles kleiner, man muss sehr viel scrollen“) =====
   Einheiten, Gebäude, Forschung: flaches Foto als Streifen, kleinere Schrift, Kosten nebeneinander.
   Alle Informationen bleiben – nur dichter. Auf großen Bildschirmen 4 Karten je Zeile. */
.kompakt .card > .spiel-bild { aspect-ratio: 16 / 5; object-position: center 45%; }
.kompakt .card-body { padding: .55rem .7rem; font-size: .84rem; }
.kompakt .card-title { font-size: 1rem; margin-bottom: .3rem; }
.kompakt .card-title .badge { font-size: .7rem; }
.kompakt .card-body > .small, .kompakt .card-body .small { font-size: .78rem; }
.kompakt .card-body > .small.mb-2 { margin-bottom: .35rem !important; line-height: 1.3; }
.kompakt .rk-werte, .kompakt .gb-werte { font-size: .78rem; gap: 0 .6rem; margin-bottom: .3rem; }
.kompakt .res-liste { display: flex; flex-wrap: wrap; gap: .1rem .7rem; font-size: .8rem; margin: .05rem 0 .35rem; }
.kompakt .res-liste li { padding: 0; gap: .25rem; }
.kompakt .res-liste li span { color: var(--gedaempft); }
.kompakt .res-liste li strong { margin-left: 0; }
.kompakt .form-control, .kompakt .btn { padding-top: .2rem; padding-bottom: .2rem; font-size: .82rem; }
.kompakt .alert { padding: .35rem .5rem; margin-bottom: .4rem; font-size: .78rem; }
.kompakt .row.g-3 { --bs-gutter-y: .6rem; }
/* Forschung */
.kompakt .research-card { padding: .6rem .7rem .7rem; margin-bottom: .6rem; height: calc(100% - .6rem); }
.kompakt .research-icon { width: 30px; height: 30px; font-size: .95rem; margin-bottom: .3rem; }
.kompakt .research-name { font-size: 1.05rem; margin-bottom: .15rem; }
.kompakt .research-level { top: .55rem; right: .6rem; font-size: .8rem; }
.kompakt .research-effect { font-size: .8rem; margin-bottom: .3rem; }
.kompakt .research-cost { margin-top: .4rem; padding-top: .4rem; gap: .3rem; }
.kompakt .cost-item { font-size: .78rem; padding: .1rem .4rem; }

/* Schnellknöpfe unter Mengenfeldern (public/js/bedienung.js) – klein, damit Tabellen nicht aufquellen */
.schnell-knoepfe { display: flex; margin-top: 2px; }
.schnell-knoepfe .btn { padding: 0 .35rem; font-size: .7rem; line-height: 1.5; }
.schnell-leiste .btn { font-size: .78rem; }

/* Lagergrenze überschritten (src/Game/Lager.php): Wert orange, Überschuss verdirbt */
.lager-posten.lager-voll .lager-wert { color: #e8913a; }
.lager-posten.lager-voll .lager-name::after { content: " · voll"; color: #e8913a; }

/* Übersicht: Truppen in der Stadt kompakt als Raster nach Gattung (statt einer langen Liste) */
.ue-gruppe { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-gedaempft, #9ba393); margin: .5rem 0 .2rem; }
.ue-gruppe:first-child { margin-top: 0; }
.ue-raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .25rem; }
.ue-chip { display: flex; justify-content: space-between; gap: .4rem; padding: .15rem .45rem; font-size: .82rem;
           border: 1px solid var(--linie-hell, #2c3631); border-radius: 4px; background: rgba(255,255,255,.02); }
.ue-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ue-chip strong { font-variant-numeric: tabular-nums; }

/* Roter Alarm-Balken auf der Übersicht (Angriffe aufs Land/Verbündete, Notrufe) – pulsiert leicht */
.ue-alarm { border-left: 6px solid #cf4b33; animation: ue-puls 2s ease-in-out infinite; }
/* Nur Bot-Städte bedroht: zugeklappt, kein Pulsieren, gedämpft (Marco, 11.10.2026: Balken zu groß) */
.ue-alarm > summary { cursor: pointer; list-style: none; }
.ue-alarm > summary::-webkit-details-marker { display: none; }
.ue-alarm > summary::after { content: ' ▾'; opacity: .7; }
.ue-alarm:not([open]) > summary::after { content: ' ▸'; }
.ue-alarm-ruhig { animation: none; opacity: .85; padding-top: .5rem; padding-bottom: .5rem; }
.ue-alarm-liste li { margin-bottom: .15rem; }
@keyframes ue-puls { 0%, 100% { box-shadow: 0 0 0 0 rgba(207,75,51,.0); } 50% { box-shadow: 0 0 0 4px rgba(207,75,51,.35); } }

/* Steckbrief zum „i“ an Einheiten (Combat.php kampf_steckbrief_html, Marco 11.10.2026) */
.steckbrief { background: var(--erhoben, rgba(255,255,255,.04)); border: 1px solid var(--linie, rgba(255,255,255,.12));
  border-left: 3px solid var(--messing, #c9a227); border-radius: 4px; padding: .5rem .7rem; margin: .25rem 0 .5rem; line-height: 1.45; }
.steckbrief > div + div { margin-top: .15rem; }
.js-steckbrief { color: var(--messing, #c9a227); text-decoration: none; line-height: 1; }
.js-steckbrief[aria-expanded="true"] .bi::before { content: "\f430"; }   /* bi-x-circle: zeigt „zuklappen“ */

/* Kampfbericht in Reitern (public/partials/_kampfbericht.php, 11.10.2026) */
.kb-reiter { overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; }
.kb-reiter .nav-link { white-space: nowrap; }
.kb-kachel { border-radius: 6px; padding: .75rem .9rem; border: 1px solid var(--linie, rgba(255,255,255,.12)); }
.kb-kachel.kb-ich { box-shadow: 0 0 0 2px var(--messing, #c9a227) inset; }
.kb-kachel-kopf { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-gedaempft, #9aa39a); margin-bottom: .35rem; }
.kb-balken { height: 10px; border-radius: 5px; background: rgba(120, 190, 120, .35); overflow: hidden; }
.kb-balken > span { display: block; height: 100%; background: #cf4b33; }
.kb-tabelle tr.kb-weg td { opacity: .6; text-decoration: line-through; text-decoration-color: rgba(207,75,51,.6); }
.kb-tabelle tr.kb-weg td:last-child { text-decoration: none; }
.kb-schuetze { padding: .45rem 0; border-bottom: 1px dashed var(--linie, rgba(255,255,255,.12)); }
.kb-schuetze:last-child { border-bottom: 0; }
.kb-ziele { display: flex; flex-wrap: wrap; gap: .25rem .75rem; font-size: .85rem; margin-top: .15rem; }
.kb-ziel { white-space: nowrap; }

/* ---------- Reiterleiste der Menügruppen (includes/menue_gruppen.php, 14.10.2026) ----------
   Mehrere Seiten teilen sich einen Menüpunkt; oben stehen sie als Reiter. Auf dem Handy wischt man seitlich. */
.gruppen-reiter {
  display: flex;
  gap: .25rem;
  margin: 0 0 1rem;
  border-bottom: 1px solid var(--linie);
  overflow-x: auto;
  scrollbar-width: none;            /* Leiste scrollt, ohne Balken */
  -webkit-overflow-scrolling: touch;
}
.gruppen-reiter::-webkit-scrollbar { display: none; }
.gruppen-reiter-link {
  display: flex;
  align-items: center;
  gap: .4rem;
  flex: 0 0 auto;
  min-height: 42px;                 /* groß genug für den Daumen */
  padding: .45rem .85rem;
  color: var(--text-2) !important;
  text-decoration: none;
  font-weight: 500;
  white-space: nowrap;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
}
.gruppen-reiter-link .bi { color: var(--gedaempft); }
.gruppen-reiter-link:hover { color: var(--text) !important; background: var(--flaeche); }
.gruppen-reiter-link.aktiv {
  color: #fff !important;
  font-weight: 600;
  border-bottom-color: var(--messing);
  background: linear-gradient(0deg, rgba(201,162,39,.14), rgba(201,162,39,0));
}
.gruppen-reiter-link.aktiv .bi { color: var(--messing-hell); }
/* Weicher Rand, wenn dort noch Reiter versteckt sind */
.gruppen-reiter.mehr-rechts { -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); }
.gruppen-reiter.mehr-links  { -webkit-mask-image: linear-gradient(90deg, transparent, #000 15%); mask-image: linear-gradient(90deg, transparent, #000 15%); }
.gruppen-reiter.mehr-links.mehr-rechts { -webkit-mask-image: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent); mask-image: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent); }

/* ---------- Einheitenauswahl: Reiter nach Waffengattung (partials/_units_table.php, 14.10.2026) ---------- */
.ei-reiter { display: flex; gap: .3rem; overflow-x: auto; scrollbar-width: none; margin: 0 0 .6rem; padding-bottom: 2px; }
.ei-reiter::-webkit-scrollbar { display: none; }
.ei-reiter-knopf {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: .35rem; min-height: 38px; padding: .3rem .7rem;
  border: 1px solid var(--linie); border-radius: 999px; background: var(--flaeche); color: var(--text-2);
  font-size: .9rem; white-space: nowrap;
}
.ei-reiter-knopf:hover { color: var(--text); border-color: var(--linie-hell); }
.ei-reiter-knopf.aktiv { background: rgba(201,162,39,.18); border-color: var(--messing); color: #fff; font-weight: 600; }
.ei-reiter-knopf.aktiv .bi { color: var(--messing-hell); }
.ei-reiter-zahl { background: var(--messing); color: #161d1a; border-radius: 999px; font-size: .72rem; font-weight: 700; padding: 0 .4rem; line-height: 1.35; }
@media (min-width: 992px) { .ei-reiter { flex-wrap: wrap; overflow: visible; } }   /* am PC umbrechen statt wischen */
/* Von den Reitern ausgeblendet (js/einheiten_reiter.js) – eigene Klasse, damit andere Skripte weiter hidden setzen können */
.ei-aus { display: none !important; }
/* Reichweite in der Einheitenauswahl: Ziel zu weit → rot (missions.php) */
.ei-zu-weit-text { display: none; }
.ei-zu-weit .ei-reichweite { color: var(--rot); font-weight: 600; }
.ei-zu-weit .ei-zu-weit-text { display: inline; }
/* Bestenlisten (partials/_rangliste_bestenlisten.php): Zahl immer ganz sichtbar, lange Namen mit … */
.bl-tabelle { table-layout: fixed; width: 100%; }
.bl-tabelle td:first-child { width: 2.4rem; }
.bl-tabelle .bl-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bl-tabelle .bl-wert { width: 7.5rem; white-space: nowrap; }
