/* =============================================================
   DOMINIUM – Per Arma ad Gloriam — Stylesheet
   Theme: Mittelalter, dunkel, erdige Töne — Premium-Look
============================================================= */

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* ── Hintergründe ────────────────────────────────────────── */
  --bg-dark:      #0e0a06;
  --bg-medium:    #181008;
  --bg-panel:     #221608;
  --bg-card:      #2e1e0a;

  /* ── Borders ─────────────────────────────────────────────── */
  --border:       #5a3a18;
  --border-light: #7a5428;

  /* ── Gold-Palette ────────────────────────────────────────── */
  --gold:         #c8922a;
  --gold-light:   #e8b84a;
  --gold-dark:    #9a6810;
  --gold-glow:    rgba(200, 146, 42, 0.28);

  /* ── Text ────────────────────────────────────────────────── */
  --text:         #edd8a8;
  --text-muted:   #907858;

  /* ── Status-Farben ───────────────────────────────────────── */
  --green:        #3a7028;
  --green-light:  #5a9040;
  --red:          #8a2010;
  --red-light:    #c03828;

  /* ── Schatten-System ─────────────────────────────────────── */
  --shadow-sm:    0 2px 8px rgba(0, 0, 0, 0.55);
  --shadow-md:    0 4px 18px rgba(0, 0, 0, 0.65);
  --shadow-lg:    0 8px 32px rgba(0, 0, 0, 0.75);
  --shadow-inset: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  --shadow-gold:  0 0 14px rgba(200, 146, 42, 0.22);

  /* ── Typografie ──────────────────────────────────────────── */
  --font:         'Cinzel', 'Georgia', 'Times New Roman', serif;
  --font-ui:      'Segoe UI', Arial, sans-serif;
}

html, body {
  height: 100%;
  background: radial-gradient(ellipse at 50% 0%, #1a0e04 0%, #0e0a06 60%);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 17px;
}

h2 {
  font-family: var(--font);
  color: var(--gold-light);
  margin-bottom: 16px;
  font-size: 1.55rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-shadow: 0 1px 6px rgba(200, 146, 42, 0.25);
}
h3 {
  font-family: var(--font);
  color: var(--gold);
  margin-bottom: 10px;
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

a { color: var(--gold-light); }
code {
  background: var(--bg-card);
  padding: 2px 5px;
  border-radius: 3px;
  font-size: 1.05em;
  color: var(--gold-light);
  border: 1px solid var(--border);
}

/* ---- Buttons ---- */
.btn {
  display: inline-block;
  padding: 6px 14px;
  background: linear-gradient(180deg, #3c2814 0%, #281808 100%);
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  border-radius: 5px;
  font-family: var(--font-ui);
  font-size: 16px;
  transition: background 0.18s, border-color 0.18s, box-shadow 0.18s, color 0.18s;
  box-shadow: var(--shadow-sm), var(--shadow-inset);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}
.btn:hover {
  background: linear-gradient(180deg, #4e3020 0%, #3a2010 100%);
  border-color: var(--gold);
  color: var(--gold-light);
  box-shadow: var(--shadow-sm), var(--shadow-gold);
}
.btn:active { box-shadow: inset 0 2px 4px rgba(0,0,0,0.5); transform: translateY(1px); }
.btn:disabled { opacity: 0.38; cursor: not-allowed; box-shadow: none; }

.btn-primary {
  background: linear-gradient(180deg, #e0a030 0%, #a07020 100%);
  border-color: var(--gold-light);
  color: #160e02;
  font-weight: bold;
  text-shadow: 0 1px 1px rgba(255,255,255,0.15);
  box-shadow: 0 3px 10px rgba(160, 110, 30, 0.5), var(--shadow-inset);
}
.btn-primary:hover {
  background: linear-gradient(180deg, #f0b840 0%, #b88028 100%);
  box-shadow: 0 3px 14px rgba(200, 146, 42, 0.6), var(--shadow-inset);
  color: #100a00;
}

.btn-danger {
  background: linear-gradient(180deg, #a02810 0%, #781808 100%);
  border-color: var(--red-light);
  color: #f0d8d0;
  box-shadow: 0 3px 8px rgba(140, 40, 20, 0.4), var(--shadow-inset);
}
.btn-danger:hover {
  background: linear-gradient(180deg, #c03820 0%, #902010 100%);
  box-shadow: 0 3px 12px rgba(180, 50, 30, 0.55), var(--shadow-inset);
}
.btn-success {
  background: linear-gradient(180deg, #1a6a30 0%, #0f4018 100%);
  border-color: var(--green-light);
  color: #b8f0c8;
  box-shadow: 0 3px 8px rgba(20, 100, 40, 0.4), var(--shadow-inset);
}
.btn-success:hover {
  background: linear-gradient(180deg, #228040 0%, #145520 100%);
  box-shadow: 0 3px 12px rgba(30, 130, 55, 0.55), var(--shadow-inset);
}

.btn-sm { padding: 3px 10px; font-size: 15px; }

/* ---- Resource Bar (Header) ---- */
#resource-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 20px;
  background: linear-gradient(180deg, #221608 0%, #150e04 100%);
  border-bottom: 2px solid var(--border);
  box-shadow: 0 3px 16px rgba(0, 0, 0, 0.7), 0 1px 0 rgba(200, 146, 42, 0.12);
  flex-wrap: wrap;
}

.res-group {
  display: flex;
  align-items: center;
  gap: 5px;
  background: linear-gradient(180deg, #3c2814 0%, #261408 100%);
  padding: 5px 11px;
  border-radius: 6px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm), var(--shadow-inset);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.res-group:hover {
  border-color: var(--border-light);
  box-shadow: var(--shadow-sm), 0 0 8px rgba(200, 146, 42, 0.12);
}
.res-icon { font-size: 19px; }
.res-label { color: var(--text-muted); font-size: 15px; }
.res-value { font-weight: bold; color: var(--text); min-width: 50px; text-align: right; }
.res-rate { color: var(--text-muted); font-size: 14px; min-width: 55px; }
.res-full { color: var(--text-muted); font-size: 13px; min-width: 88px; }
.res-full-max { color: #d04838; font-weight: bold; font-size: 13px; }

.pop-group { border-color: var(--border-light); }
#pop-display { font-weight: bold; }
#pop-display.pop-warning { color: #e8b84a; }
#pop-display.pop-full { color: var(--red-light); }

.points-group {
  border-color: var(--gold-dark);
  background: linear-gradient(180deg, #3c2808 0%, #281800 100%);
  box-shadow: var(--shadow-sm), 0 0 8px rgba(200, 146, 42, 0.15);
}
.points-group:hover { box-shadow: var(--shadow-sm), var(--shadow-gold); }
#village-points { font-weight: bold; color: var(--gold-light); }

.protection-timer {
  width: 100%;
  order: 99;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 4px 16px;
  background: linear-gradient(135deg, rgba(74, 128, 64, 0.18) 0%, rgba(58, 112, 40, 0.1) 100%);
  border: 1px solid rgba(58, 112, 40, 0.55);
  border-radius: 5px;
  font-size: 16px;
  color: var(--green-light);
  box-shadow: 0 0 8px rgba(58, 112, 40, 0.1);
}
.protection-label { color: var(--text-muted); }
#protection-countdown {
  font-family: 'Courier New', monospace;
  font-weight: bold;
  font-size: 17px;
  color: var(--green-light);
  letter-spacing: 0.05em;
}

.btn-updates {
  padding: 4px 10px;
  border-radius: 4px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  color: var(--text-muted);
  font-size: 16px;
  text-decoration: none;
  transition: border-color 0.2s, color 0.2s;
  cursor: pointer;
}
.btn-updates:hover { border-color: var(--gold); color: var(--gold-light); }

.header-village {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}
#village-name {
  font-family: var(--font);
  font-size: 1.3rem;
  color: var(--gold-light);
}
/* Goldener Rahmen für Spender im Header */
#village-name.village-name-donor {
  border: 1px solid #c8922a;
  border-radius: 5px;
  padding: 2px 8px;
  box-shadow: 0 0 6px rgba(200, 146, 42, 0.35);
}
/* Spender-Titel im Header ausblenden (stattdessen Rahmen) */
#village-name .donor-title {
  display: none;
}
.premium-btn {
  padding: 4px 12px;
  border-radius: 4px;
  cursor: pointer;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 16px;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.premium-btn:hover { border-color: var(--gold); color: var(--text); }
.premium-btn.premium-active {
  background: #3a2e00;
  border-color: var(--gold-light);
  color: var(--gold-light);
  font-weight: bold;
  box-shadow: 0 0 6px rgba(232,184,74,0.25);
}

/* Dorfname-Sektion im Rathaus */
.village-name-section {
  background: linear-gradient(160deg, #2e1e0a 0%, #1e1206 100%);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}
.vname-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.vname-label {
  font-weight: bold;
  color: var(--gold-light);
  font-size: 16px;
  white-space: nowrap;
}
.vname-input {
  flex: 1;
  min-width: 140px;
  max-width: 280px;
  background: var(--bg-dark);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 16px;
  font-family: var(--font-ui);
}
.vname-input:focus {
  outline: none;
  border-color: var(--gold);
}
.vname-feedback {
  font-size: 14px;
  margin-top: 6px;
  min-height: 18px;
}
.vname-feedback.vname-ok { color: var(--green); }
.vname-feedback.vname-err { color: var(--red-light); }

/* Slot-Banner im Rathaus */
.slot-banner {
  margin-bottom: 8px;
  padding: 5px 10px;
  background: linear-gradient(180deg, #2a1a08 0%, #1e1206 100%);
  border: 1px solid var(--border);
  border-radius: 4px;
  box-shadow: var(--shadow-sm);
}

#btn-reset {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 19px;
  transition: color 0.15s;
}
#btn-reset:hover { color: var(--red-light); border-color: var(--red-light); }

/* ---- Navigation ---- */
#main-nav {
  display: flex;
  gap: 3px;
  padding: 8px 14px 0;
  background: linear-gradient(180deg, #1a1008 0%, #120c04 100%);
  border-bottom: 2px solid var(--border);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
  flex-wrap: wrap;
}
.tab-btn {
  padding: 7px 16px;
  background: linear-gradient(180deg, #2a1a0a 0%, #180e04 100%);
  border: 1px solid var(--border);
  border-bottom: none;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 5px 5px 0 0;
  font-size: 15px;
  transition: background 0.18s, color 0.18s, border-color 0.18s, box-shadow 0.18s;
  position: relative;
}
.tab-btn:hover {
  background: linear-gradient(180deg, #3a2210 0%, #241408 100%);
  color: var(--text);
  border-color: var(--border-light);
}
.tab-btn.active {
  background: linear-gradient(180deg, #3e2812 0%, #2a1808 100%);
  color: var(--gold-light);
  border-color: var(--gold-dark);
  font-weight: bold;
  box-shadow: inset 0 -1px 0 var(--bg-card);
}
.tab-btn.active::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--gold-dark), var(--gold-light), var(--gold-dark));
  border-radius: 5px 5px 0 0;
}
.tab-placeholder { color: #5a4030; }
.tab-placeholder:hover { color: var(--text-muted); }

/* ---- Tab Content ---- */
.tab-content {
  display: none;
  padding: 22px 24px;
  max-width: 1100px;
  margin: 0 auto;
}
.tab-content.active { display: block; }

/* ---- Info Box ---- */
.info-box {
  background: linear-gradient(135deg, #321e0c 0%, #221408 100%);
  border: 1px solid var(--border);
  border-left: 4px solid var(--gold);
  padding: 12px 16px;
  border-radius: 6px;
  color: var(--text-muted);
  box-shadow: var(--shadow-sm);
}

/* ---- Dorfpunkte-Bar (Dorfübersicht) ---- */
.overview-points-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  background: linear-gradient(135deg, #2a1a08 0%, #1e1206 100%);
  border: 1px solid var(--border);
  border-left: 3px solid var(--gold-dark);
  border-radius: 6px;
  margin-bottom: 12px;
  font-size: 17px;
  box-shadow: var(--shadow-sm);
}
.pts-label { color: var(--text-muted); }
.pts-value { font-weight: bold; color: var(--gold-light); font-size: 19px; }
.pts-threat { font-size: 15px; color: var(--text-muted); margin-left: 6px; }
.pts-threat.pts-threat-active { color: var(--red-light); font-weight: bold; }

/* ---- Building Grid (Dorfübersicht) ---- */
.building-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.building-tile {
  background: linear-gradient(160deg, #382010 0%, #241408 100%);
  border: 2px solid var(--border);
  border-radius: 8px;
  padding: 14px 10px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s, transform 0.15s;
  position: relative;
  box-shadow: var(--shadow-sm), var(--shadow-inset);
}
.building-tile:hover {
  border-color: var(--gold);
  background: linear-gradient(160deg, #4a2c16 0%, #301808 100%);
  box-shadow: var(--shadow-md), var(--shadow-gold);
  transform: translateY(-2px);
}
.building-tile.upgrading {
  border-color: var(--gold);
  box-shadow: 0 0 14px rgba(200, 146, 42, 0.35), var(--shadow-sm);
  animation: pulse 1.5s infinite;
}
.building-tile.level-0 { opacity: 0.45; border-style: dashed; box-shadow: none; transform: none; }

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(200,146,42,0.4); }
  50% { box-shadow: 0 0 0 6px rgba(200,146,42,0); }
}

.tile-icon { font-size: 2rem; display: block; margin-bottom: 6px; }
.tile-name { font-weight: bold; color: var(--text); display: block; margin-bottom: 4px; font-size: 16px; }
.tile-level { color: var(--text-muted); font-size: 15px; }
.tile-level span { color: var(--gold-light); font-weight: bold; }
.tile-protection {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.2;
}
.tile-protection strong { color: #7eb8d0; }

.tile-timer {
  display: block;
  margin-top: 5px;
  font-size: 13px;
  color: var(--gold);
  text-align: center;
  line-height: 1.2;
}

/* ---- Building List (Rathaus) ---- */
.building-list { display: flex; flex-direction: column; gap: 10px; }

.building-row {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  align-items: center;
  gap: 14px;
  background: linear-gradient(180deg, #342010 0%, #221408 100%);
  border: 1px solid var(--border);
  border-left: 3px solid transparent;
  border-radius: 6px;
  padding: 12px 14px;
  transition: border-color 0.2s, box-shadow 0.2s, border-left-color 0.2s;
  box-shadow: var(--shadow-sm), var(--shadow-inset);
}
.building-row:hover {
  border-color: var(--border-light);
  border-left-color: var(--gold-dark);
  box-shadow: var(--shadow-md), 0 0 8px rgba(200, 146, 42, 0.08);
}
.building-row.is-upgrading {
  border-color: var(--gold-dark);
  border-left-color: var(--gold-light);
  box-shadow: var(--shadow-sm), 0 0 10px rgba(200, 146, 42, 0.2);
}

.brow-icon { font-size: 2rem; text-align: center; }
.brow-info { }
.brow-name { font-weight: bold; color: var(--gold-light); font-size: 17px; }
.brow-desc { color: var(--text-muted); font-size: 15px; margin-top: 2px; }
.brow-level { font-size: 15px; color: var(--text-muted); margin-top: 4px; }
.brow-capacity { font-size: 15px; color: var(--text-muted); margin-top: 4px; }
.brow-capacity strong { color: var(--gold-light); }
.brow-costs { display: flex; gap: 8px; margin-top: 5px; flex-wrap: wrap; }
.cost-item { font-size: 15px; display: flex; align-items: center; gap: 3px; }
.cost-item.insufficient { color: var(--red-light); }
.cost-item.sufficient { color: #7fb870; }

.brow-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; min-width: 130px; }
.brow-timer { font-size: 15px; color: var(--gold); }

/* Build queue display */
#build-queue-section { margin-bottom: 18px; }
.queue-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(180deg, #2e1e0e 0%, #1e1208 100%);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 12px;
  margin-bottom: 6px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.18s, box-shadow 0.18s;
}
.queue-item-active {
  border-color: var(--gold-dark);
  box-shadow: 0 0 10px rgba(200, 146, 42, 0.15), var(--shadow-sm);
}
.queue-item-wait   { border-color: var(--border); }

/* Schmiede-Forschungswarteschlange */
.bq-entry {
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(180deg, #2e1e0e 0%, #1e1208 100%);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 7px 12px;
  margin-bottom: 6px;
  box-shadow: var(--shadow-sm);
}
.bq-icon  { font-size: 1.3rem; flex-shrink: 0; }
.bq-name  { flex: 1; font-weight: bold; }
.bq-timer { color: var(--gold); font-size: 14px; margin-right: 4px; }
.bq-cancel-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  opacity: 0.6;
  padding: 2px 5px;
  border-radius: 4px;
  transition: opacity 0.15s, background 0.15s;
  flex-shrink: 0;
}
.bq-cancel-btn:hover { opacity: 1; background: rgba(192,56,40,0.15); }

.queue-icon { font-size: 1.5rem; flex-shrink: 0; }
.queue-info { flex: 1; min-width: 0; }
.queue-name { font-weight: bold; }
.queue-timer { color: var(--gold); font-size: 15px; }
.queue-timer-wait { color: var(--text-muted); }
.queue-progress {
  height: 5px;
  background: rgba(90, 58, 24, 0.5);
  border-radius: 3px;
  margin-top: 5px;
  overflow: hidden;
}
.queue-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-dark), var(--gold-light));
  border-radius: 3px;
  transition: width 1s linear;
}

/* Queue Badges */
.queue-badge {
  display: inline-block;
  font-size: 13px;
  padding: 1px 5px;
  border-radius: 3px;
  margin-right: 3px;
  vertical-align: middle;
}
.queue-badge-active { background: var(--gold); color: #1a140d; font-weight: bold; }
.queue-badge-wait   { background: var(--bg-panel); border: 1px solid var(--border-light); color: var(--text-muted); }

/* Queue Aktion-Buttons */
.queue-btns {
  display: flex;
  flex-direction: column;
  gap: 3px;
  align-items: flex-end;
  flex-shrink: 0;
}
.queue-move-btn { padding: 2px 7px; font-size: 14px; }

/* ---- Troop List (Kaserne) ---- */
.troop-list { display: flex; flex-direction: column; gap: 10px; }

.troop-row {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  align-items: center;
  gap: 14px;
  background: linear-gradient(180deg, #342010 0%, #221408 100%);
  border: 1px solid var(--border);
  border-left: 3px solid transparent;
  border-radius: 6px;
  padding: 12px 14px;
  transition: border-color 0.2s, box-shadow 0.2s, border-left-color 0.2s;
  box-shadow: var(--shadow-sm), var(--shadow-inset);
}
.troop-row:hover {
  border-color: var(--border-light);
  border-left-color: var(--gold-dark);
  box-shadow: var(--shadow-md), 0 0 8px rgba(200, 146, 42, 0.08);
}

.trow-icon { font-size: 2rem; text-align: center; }
.trow-info { }
.trow-name { font-weight: bold; color: var(--gold-light); font-size: 17px; }
.trow-stats { font-size: 14px; color: var(--text-muted); margin-top: 2px; }
.trow-costs { display: flex; gap: 8px; margin-top: 5px; flex-wrap: wrap; }
.trow-lock-note { font-size: 11px; color: #e08050; margin-top: 5px; }
.troop-row-locked { opacity: .6; border-left-color: #604020 !important; }
.trow-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}
.trow-quick-btns { display: flex; gap: 4px; }
.trow-quick-btn  { font-size: 14px; padding: 3px 9px; }
.trow-recruit-row { display: flex; align-items: center; gap: 8px; }
.trow-amount-input {
  width: 60px;
  background: var(--bg-dark);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 4px 7px;
  border-radius: 4px;
  font-size: 16px;
  text-align: right;
}
.trow-amount-input:focus { outline: none; border-color: var(--gold); }

/* Recruit queue */
#recruit-queue-section { margin-bottom: 18px; }
.rqueue-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(180deg, #2e1e0e 0%, #1e1208 100%);
  border: 1px solid var(--gold-dark);
  border-radius: 6px;
  padding: 8px 12px;
  margin-bottom: 4px;
  box-shadow: var(--shadow-sm), 0 0 6px rgba(200, 146, 42, 0.08);
}
.rqueue-icon { font-size: 1.5rem; }
.rqueue-info { flex: 1; }
.rqueue-name { font-weight: bold; }
.rqueue-timer { color: var(--gold); font-size: 15px; }
.rqueue-count { color: var(--text-muted); font-size: 15px; }

/* ---- Troops Overview ---- */
.troop-overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  margin-top: 8px;
}
.troop-card {
  background: linear-gradient(160deg, #382010 0%, #241408 100%);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow-sm), var(--shadow-inset);
  transition: border-color 0.2s, box-shadow 0.2s;
  padding: 14px 10px;
  text-align: center;
}
.troop-card:hover {
  border-color: var(--border-light);
  box-shadow: var(--shadow-md), 0 0 8px rgba(200, 146, 42, 0.12);
}
.troop-card-icon { font-size: 2rem; display: block; margin-bottom: 6px; }
.troop-card-name { font-weight: bold; display: block; color: var(--text); font-size: 16px; }
.troop-card-count { font-size: 2rem; font-weight: bold; color: var(--gold-light); display: block; margin: 6px 0; }
.troop-card-atk, .troop-card-def { font-size: 14px; color: var(--text-muted); }

/* ---- Tooltip ---- */
.tooltip {
  position: fixed;
  z-index: 9999;
  background: linear-gradient(135deg, #2a1c0c 0%, #1a1006 100%);
  border: 1px solid var(--gold-dark);
  border-radius: 7px;
  padding: 10px 14px;
  font-size: 15px;
  color: var(--text);
  pointer-events: none;
  max-width: 240px;
  box-shadow: var(--shadow-lg), 0 0 20px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
  line-height: 1.5;
}

/* ---- Inline-Fehlermeldung (ersetzt alert()) ---- */
.inline-error {
  background: rgba(138, 48, 32, 0.25);
  border: 1px solid var(--red-light);
  color: var(--red-light);
  border-radius: 4px;
  padding: 6px 10px;
  font-size: 15px;
  margin-top: 6px;
  animation: inline-err-fade 3.5s ease-out forwards;
}
@keyframes inline-err-fade {
  0%, 65% { opacity: 1; }
  100%     { opacity: 0; }
}

/* ---- Reset-Button Bestätigungs-Zustand ---- */
#btn-reset.confirm-state {
  background: var(--red);
  border-color: var(--red-light);
  color: #fff;
  font-size: 14px;
}

/* ================================================================
   WELTKARTE
================================================================ */

/* Layout – Karte allein (keine Seitenspalten) */
#wm-layout {
  display: block;
}

#wm-grid-section { width: 100%; }

/* Größen-Preset-Buttons */
#wm-size-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
#wm-size-controls span {
  font-size: 12px;
  color: var(--text-muted);
}
.wm-size-btn {
  font-size: 12px;
  padding: 3px 10px;
  background: linear-gradient(180deg, #2e1e0e 0%, #1e1208 100%);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  box-shadow: var(--shadow-sm);
}
.wm-size-btn:hover {
  background: linear-gradient(180deg, #3e2810 0%, #281808 100%);
  color: var(--text);
  border-color: var(--border-light);
}
.wm-size-btn.active {
  background: linear-gradient(180deg, var(--gold) 0%, var(--gold-dark) 100%);
  border-color: var(--gold-light);
  color: #1a140d;
  font-weight: bold;
  box-shadow: 0 0 6px rgba(200, 146, 42, 0.3);
}

/* Scrollbarer, per Drag skalierbarer Kartenbereich */
#wm-grid-scroll {
  overflow: auto;
  resize: both;
  height: 900px;
  min-height: 300px;
  max-height: 95vh;
  border: 3px solid #3a6018;
  border-radius: 4px;
  box-shadow: 0 6px 28px rgba(0,0,0,0.7), inset 0 0 20px rgba(0,0,0,0.25);
}

/* Karten-Gitter */
#wm-grid {
  display: grid;
  gap: 0;
  border: 1px solid #2a5010;
  background: #3a6820;
  width: fit-content;
}

/* Achsen: Pergament-Stil wie im Original */
.wm-axis-corner {
  background: #a09060;
  border: 1px solid #7a6840;
}

.wm-axis-label {
  background: #b8a870;
  border: 1px solid #8a7850;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: bold;
  color: #3a2c18;
}

/* Kopfzeile (X-Achse): 22 px hoch */
.wm-axis-x { height: 22px; }

/* Linke Spalte (Y-Achse): 60 px hoch */
.wm-axis-y { height: 60px; }

/* ── Basis-Zelle ─────────────────────────────────────────────── */
.wm-cell {
  width: 60px;
  height: 60px;
  border: 1px solid rgba(0,0,0,0.22);
  background: #6aa040;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: default;
  position: relative;
  overflow: hidden;
  transition: filter 0.1s;
  user-select: none;
}
.wm-cell:hover { filter: brightness(1.12); }

/* ── Dorf-Zellen ─────────────────────────────────────────────── */
.wm-cell.wm-has-village {
  border: 1px solid rgba(0,0,0,0.4);
  cursor: pointer;
}
.wm-cell.wm-has-village:hover {
  filter: brightness(1.15);
  border-color: rgba(255,255,255,0.3);
}

/* ── Barbarendorf-Zelle — ausgegraut ─────────────────────────── */
.wm-cell.wm-barbar {
  border: 1px solid rgba(110, 110, 110, 0.5);
  filter: saturate(0.45) brightness(0.82);
}
.wm-cell.wm-barbar:hover {
  filter: saturate(0.55) brightness(0.95);
  border-color: rgba(160, 160, 160, 0.6);
}
/* Bereits eroberte Barbarendörfer — etwas heller */
.wm-cell.wm-barbar.wm-conquered {
  filter: saturate(0.55) brightness(0.88);
  border: 2px solid rgba(154, 96, 192, 0.7) !important;
}

/* ── Menschlicher Mitspieler (feindlich) ─────────────────────── */
.wm-cell.wm-human {
  border: 2px solid #e84a4a;
  box-shadow: inset 0 0 10px rgba(232,74,74,0.3), 0 0 8px rgba(232,74,74,0.4);
  cursor: pointer;
}
.wm-cell.wm-human:hover {
  filter: brightness(1.15);
  box-shadow: inset 0 0 16px rgba(232,74,74,0.5), 0 0 14px rgba(232,74,74,0.6);
  border-color: #ff7070;
}
/* ── Stammesmitglied (verbündet) ─────────────────────────────── */
.wm-cell.wm-ally {
  border: 2px solid #4a90e8 !important;
  box-shadow: inset 0 0 10px rgba(74,144,232,0.3), 0 0 8px rgba(74,144,232,0.4) !important;
  cursor: default;
}
.wm-cell.wm-ally:hover {
  filter: brightness(1.15);
  box-shadow: inset 0 0 16px rgba(74,144,232,0.5), 0 0 14px rgba(74,144,232,0.6) !important;
  border-color: #70b0ff !important;
}

/* ── Spieler-Zelle ───────────────────────────────────────────── */
.wm-cell.wm-player {
  border: 2px solid #e8b84a;
  box-shadow: inset 0 0 12px rgba(232,184,74,0.35), 0 0 8px rgba(232,184,74,0.45);
}
.wm-cell.wm-player:hover {
  filter: brightness(1.1);
  box-shadow: inset 0 0 16px rgba(232,184,74,0.5), 0 0 14px rgba(232,184,74,0.6);
}

/* ── Village-Inhalt ──────────────────────────────────────────── */
.wm-village-icon {
  font-size: 24px;
  line-height: 1;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.75));
  position: relative;
  z-index: 2;
}
.wm-village-name {
  font-size: 10px;
  color: #f4edcc;
  text-align: center;
  max-width: 56px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  margin-top: 1px;
  text-shadow: 0 1px 3px rgba(0,0,0,0.95), 0 0 6px rgba(0,0,0,0.8);
  font-weight: bold;
  position: relative;
  z-index: 2;
}
.wm-village-pts {
  font-size: 10px;
  color: #ffe87a;
  text-align: center;
  font-weight: bold;
  line-height: 1;
  text-shadow: 0 1px 3px rgba(0,0,0,0.95);
  position: relative;
  z-index: 2;
}
.wm-cell-coord {
  font-size: 9px;
  color: rgba(0,0,0,0.28);
  position: relative;
  z-index: 2;
}

/* ── Terrain-Icon (kleiner Hinweis-Indikator unten rechts) ───── */
.wm-terrain-icon {
  position: absolute;
  bottom: 2px;
  right: 3px;
  font-size: 8px;
  opacity: 0.45;
  pointer-events: none;
  line-height: 1;
  z-index: 2;
}

/* ════════════════════════════════════════════════════════════════
   TERRAIN-HINTERGRÜNDE — Hell, satt, wie eine echte Karte
════════════════════════════════════════════════════════════════ */

/* ── Ebene (Plains) — sattes Grasgrün ───────────────────────── */
.wm-cell.ter-plains {
  background: linear-gradient(155deg, #88c050 0%, #68a838 55%, #78b244 100%);
}
.wm-cell.ter-plains::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 25% 65%, rgba(150,210,80,0.22) 0%, transparent 45%),
    radial-gradient(ellipse at 72% 28%, rgba(110,170,50,0.18) 0%, transparent 45%);
  pointer-events: none; z-index: 0;
}

/* ── Wald (Forest) — dunkles Dunkelgrün ─────────────────────── */
.wm-cell.ter-forest {
  background: linear-gradient(155deg, #3a7820 0%, #224e12 60%, #2e6418 100%);
}
/* Baumgruppen auf leeren Waldfeldern */
.wm-cell.ter-forest::before {
  content: '🌲🌲';
  position: absolute; top: 3px; left: 2px;
  font-size: 15px; line-height: 1.15;
  z-index: 1; opacity: 0.82; pointer-events: none;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.65));
}
.wm-cell.ter-forest::after {
  content: '🌲';
  position: absolute; bottom: 9px; right: 3px;
  font-size: 19px;
  z-index: 1; opacity: 0.7; pointer-events: none;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.65));
}
/* Bäume ausblenden wenn Dorf drauf steht */
.wm-cell.wm-has-village.ter-forest::before,
.wm-cell.wm-player.ter-forest::before,
.wm-cell.wm-has-village.ter-forest::after,
.wm-cell.wm-player.ter-forest::after { content: none; }

/* ── Hügel (Hills) — gelblich-grün ──────────────────────────── */
.wm-cell.ter-hills {
  background: linear-gradient(155deg, #9aaa5a 0%, #7a8a40 55%, #8a9850 100%);
}
.wm-cell.ter-hills::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 100%, rgba(100,80,30,0.28) 0%, transparent 65%);
  pointer-events: none; z-index: 0;
}
.wm-cell.ter-hills::after {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 30% 85%, rgba(120,100,40,0.18) 0%, transparent 45%);
  pointer-events: none; z-index: 0;
}

/* ── Gebirge (Mountain) — grau-braun, felsig ────────────────── */
.wm-cell.ter-mountain {
  background: linear-gradient(155deg, #908272 0%, #706050 55%, #806860 100%);
}
.wm-cell.ter-mountain::before {
  content: '';
  position: absolute; inset: 0;
  background:
    linear-gradient(155deg, rgba(255,255,255,0.14) 0%, transparent 35%),
    radial-gradient(ellipse at 25% 25%, rgba(255,255,255,0.1) 0%, transparent 45%);
  pointer-events: none; z-index: 0;
}
.wm-cell.ter-mountain::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, transparent 45%, rgba(0,0,0,0.22) 100%);
  pointer-events: none; z-index: 0;
}

/* ── Fluss (River) — leuchtendes Blau ───────────────────────── */
.wm-cell.ter-river {
  background: linear-gradient(155deg, #5aa4dc 0%, #3880c4 55%, #4892cc 100%);
}
.wm-cell.ter-river::before {
  content: '';
  position: absolute; inset: 0;
  background: repeating-linear-gradient(
    -40deg,
    rgba(255,255,255,0.09) 0px, rgba(255,255,255,0.09) 2px,
    transparent 2px, transparent 10px
  );
  pointer-events: none; z-index: 0;
}
.wm-cell.ter-river::after {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 38%, rgba(255,255,255,0.18) 0%, transparent 55%);
  pointer-events: none; z-index: 0;
}

/* ── Terrain × Dorf-Zelle ────────────────────────────────────── */
.wm-cell.wm-has-village.ter-plains   { background: linear-gradient(155deg, #78b048 0%, #589030 100%); }
.wm-cell.wm-has-village.ter-forest   { background: linear-gradient(155deg, #2e5e18 0%, #1a4010 100%); }
.wm-cell.wm-has-village.ter-hills    { background: linear-gradient(155deg, #889850 0%, #6a7838 100%); }
.wm-cell.wm-has-village.ter-mountain { background: linear-gradient(155deg, #807060 0%, #605040 100%); }
.wm-cell.wm-has-village.ter-river    { background: linear-gradient(155deg, #4888c8 0%, #3070a8 100%); }

/* ── Terrain × Spieler-Zelle ─────────────────────────────────── */
.wm-cell.wm-player.ter-plains   { background: linear-gradient(155deg, #8ac050 0%, #68a838 100%); }
.wm-cell.wm-player.ter-forest   { background: linear-gradient(155deg, #347020 0%, #1e4c10 100%); }
.wm-cell.wm-player.ter-hills    { background: linear-gradient(155deg, #929858 0%, #788040 100%); }
.wm-cell.wm-player.ter-mountain { background: linear-gradient(155deg, #888068 0%, #686050 100%); }
.wm-cell.wm-player.ter-river    { background: linear-gradient(155deg, #5090d0 0%, #3878b8 100%); }

/* ── Missions-Punkt-Indikator ────────────────────────────────── */
.wm-mission-dot {
  position: absolute;
  top: 3px;
  right: 4px;
  font-size: 12px;
  color: #ff2222;
  line-height: 1;
  z-index: 5;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.9));
}

/* ── Legende ─────────────────────────────────────────────────── */
#wm-legend {
  margin-top: 10px;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 14px;
  color: var(--text-muted);
}
.wm-legend-item { display: flex; align-items: center; gap: 5px; }
.wm-legend-swatch {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 2px;
  border: 1px solid rgba(0,0,0,0.4);
}
.wm-legend-player { background: #8ac050; border-color: #e8b84a; }
.wm-legend-npc    { background: #4a7828; border-color: #386020; }
.wm-legend-empty  { background: #88c050; border-color: #5a9030; }

.wm-empty { font-size: 15px; color: var(--text-muted); font-style: italic; }

/* ================================================================
   VERSAMMLUNGSPLATZ
================================================================ */

/* Obere Zeile: Eigene Bewegungen + Feindliche Angriffe nebeneinander */
.rally-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 20px;
  margin-bottom: 24px;
}

@media (max-width: 700px) {
  .rally-columns { grid-template-columns: 1fr; }
}

.rally-section {
  background: linear-gradient(160deg, #221a0c 0%, #181008 100%);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
}

.rally-section h3 {
  margin-bottom: 10px;
  font-size: 1.1rem;
}

/* Feindliche-Angriffe-Sektion: rote Akzentlinie */
.rally-section:nth-child(2) {
  border-color: rgba(138, 48, 32, 0.5);
  border-top: 2px solid rgba(192, 56, 40, 0.55);
  background: linear-gradient(160deg, #200e0e 0%, #150808 100%);
}

/* Kampfberichte-Sektion darunter */
.rally-reports-section {
  background: linear-gradient(160deg, #221a0c 0%, #181008 100%);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
}

.rally-reports-section h3 { margin-bottom: 10px; }

/* ---- Missions-Liste ---- */
.mission-item {
  background: linear-gradient(180deg, #221a0c 0%, #181008 100%);
  border: 1px solid var(--border);
  border-left: 3px solid var(--border-light);
  border-radius: 5px;
  padding: 8px 12px;
  margin: 6px 0;
  font-size: 15px;
  box-shadow: var(--shadow-sm);
}
.cancel-countdown {
  font-size: 12px;
  color: var(--orange-light);
  margin-top: 4px;
  opacity: 0.85;
}
.mission-item.mission-incoming {
  border-color: rgba(192, 56, 40, 0.45);
  border-left-color: var(--red-light);
  background: linear-gradient(180deg, #220e0e 0%, #150808 100%);
  box-shadow: var(--shadow-sm), 0 0 6px rgba(192, 56, 40, 0.12);
}
.mission-item.mission-returning { opacity: 0.7; }
.mission-item.mission-cancelled {
  border-color: rgba(160, 100, 20, 0.45);
  border-left-color: var(--orange-light);
  background: linear-gradient(180deg, #221508 0%, #180f05 100%);
  opacity: 0.8;
}
.mission-item.mission-defeat {
  border-color: rgba(120, 40, 40, 0.45);
  border-left-color: #a03030;
  background: linear-gradient(180deg, #1a0808 0%, #110505 100%);
  opacity: 0.75;
}
.mission-item.mission-support {
  border-color: rgba(40, 120, 200, 0.45);
  border-left-color: var(--blue-light);
  background: linear-gradient(180deg, #0d1a2b 0%, #080f1c 100%);
  box-shadow: var(--shadow-sm), 0 0 6px rgba(40, 120, 200, 0.12);
}
.support-recall-btn {
  margin-top: 6px;
  background: linear-gradient(180deg, #1a4a80 0%, #0f2d55 100%);
  border-color: var(--blue-light);
  color: #b8d8f0;
  font-size: 11px;
  padding: 3px 10px;
}
.support-recall-btn:hover {
  background: linear-gradient(180deg, #2560a8 0%, #163c72 100%);
}

/* Reisende eingehende Unterstützung — leicht transparenter Rahmen */
.mission-item.mission-traveling-support {
  border-color: rgba(40, 180, 120, 0.45);
  border-left-color: #40c080;
  background: rgba(40, 180, 120, 0.06);
}

/* Toast-Benachrichtigungen */
#toast-container {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.game-toast {
  background: linear-gradient(135deg, #1a2a40 0%, #0d1a2e 100%);
  border: 1px solid rgba(100, 160, 255, 0.35);
  border-left: 3px solid #5090e0;
  color: #c8d8f0;
  padding: 10px 16px;
  border-radius: 6px;
  font-size: 0.85rem;
  line-height: 1.5;
  max-width: 320px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.55);
  opacity: 0;
  transform: translateX(30px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: auto;
}
.game-toast.toast-visible {
  opacity: 1;
  transform: translateX(0);
}

/* Kleiner roter X-Button zum Abbrechen von Missionen / Händlerlieferungen */
.btn-cancel-mission {
  background: none;
  border: 1px solid rgba(220, 60, 60, 0.65);
  color: #e06060;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  min-width: 20px;
  padding: 0;
  line-height: 18px;
  font-size: 11px;
  font-weight: bold;
  cursor: pointer;
  margin-left: auto;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.btn-cancel-mission:hover {
  background: rgba(220, 60, 60, 0.22);
  color: #ff8080;
  border-color: #e06060;
}

.mission-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 3px;
}
.mission-type  { font-weight: bold; font-size: 15px; }
.mission-timer { color: var(--gold); font-size: 14px; }
.mission-detail { color: var(--text-muted); font-size: 14px; }
.mission-troops { margin-top: 2px; }

/* ---- Kampfberichte ---- */
.battle-report {
  background: linear-gradient(180deg, #221a0c 0%, #181008 100%);
  border: 1px solid var(--border);
  border-left: 3px solid transparent;
  border-radius: 5px;
  padding: 10px 12px;
  margin-bottom: 8px;
  font-size: 15px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s;
}
.battle-report.report-victory {
  border-color: rgba(58, 112, 40, 0.45);
  border-left-color: var(--green-light);
}
.battle-report.report-defeat {
  border-color: rgba(138, 32, 16, 0.45);
  border-left-color: var(--red-light);
}

.report-header {
  font-weight: bold;
  margin-bottom: 3px;
}
.report-time {
  font-weight: normal;
  font-size: 13px;
  color: var(--text-muted);
  margin-left: 6px;
}
.report-detail { color: var(--text-muted); font-size: 14px; margin-top: 1px; }
.report-loot   { color: var(--gold);       font-size: 14px; margin-top: 3px; }

/* ================================================================
   NACHRICHTEN-TAB — Berichte
   ================================================================ */

/* Tab-Button Badge */
.nav-badge {
  display: inline-block;
  background: var(--red-light);
  color: #fff;
  font-size: 10px;
  font-weight: bold;
  line-height: 1;
  padding: 2px 5px;
  border-radius: 10px;
  margin-left: 5px;
  vertical-align: middle;
}

/* Eingehende-Angriffe-Warnbar */
#incoming-alert-bar {
  background: linear-gradient(90deg, #5a1010 0%, #3d0a0a 100%);
  border-bottom: 2px solid var(--red-light);
  color: #f0c0b0;
  font-size: 14px;
  padding: 7px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  animation: pulse-alert 1.5s ease-in-out infinite alternate;
}
.alert-bar-btn {
  background: rgba(192,56,40,0.25);
  border: 1px solid var(--red-light);
  color: #f0c0b0;
  border-radius: 4px;
  padding: 3px 12px;
  cursor: pointer;
  font-size: 13px;
  transition: background 0.15s;
}
.alert-bar-btn:hover { background: rgba(192,56,40,0.5); }
@keyframes pulse-alert {
  from { border-bottom-color: rgba(192,56,40,0.4); }
  to   { border-bottom-color: var(--red-light); }
}

/* Sub-Tab-Nav */
.msg-tabs {
  display: flex;
  gap: 6px;
  padding: 10px 16px 0;
  border-bottom: 1px solid var(--border);
  background: var(--bg-medium);
}
.msg-tab-btn {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: bold;
  padding: 8px 14px;
  cursor: pointer;
  transition: color .15s, border-color .15s;
}
.msg-tab-btn:hover  { color: var(--text); }
.msg-tab-btn.active { color: var(--gold-light); border-bottom-color: var(--gold); }

/* Sub-Panel */
.msg-sub-panel { padding: 16px; }

/* ---- Berichts-Liste ---- */
.msg-report-list { display: flex; flex-direction: column; gap: 6px; }

.msg-report-row {
  display: grid;
  grid-template-columns: 28px 1fr auto 20px;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid transparent;
  border-radius: 5px;
  padding: 10px 12px;
  cursor: pointer;
  transition: background .12s, border-color .12s;
}
.msg-report-row:hover  { background: var(--bg-card-h); }
.msg-report-row.report-victory { border-left-color: var(--green-light); }
.msg-report-row.report-defeat  { border-left-color: var(--red-light); }

.mrr-icon  { font-size: 18px; text-align: center; }
.mrr-title { font-size: 14px; font-weight: bold; color: var(--text-bright); }
.mrr-loot  { font-size: 12px; color: var(--gold); margin-top: 2px; }
.mrr-time  { font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.mrr-arrow { font-size: 18px; color: var(--text-muted); }

/* ---- Detail-Ansicht ---- */
.rdetail-container {
  max-width: 720px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.rdetail-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
}
.rdetail-date { font-size: 12px; color: var(--text-muted); }
.rdetail-back { white-space: nowrap; }

.rdetail-headline {
  font-size: 18px;
  font-weight: bold;
  padding: 12px 16px;
  border-radius: 6px;
  border-left: 4px solid transparent;
}
.rdetail-win  { background: rgba(58,112,40,.18); border-left-color: var(--green-light); color: var(--green-light); }
.rdetail-loss { background: rgba(138,32,16,.18); border-left-color: var(--red-light);   color: var(--red-light); }

/* Glücks-Balken */
.rdetail-luck-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--bg-card);
  border-radius: 5px;
}
.rdetail-luck-label { font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.rdetail-luck-bar {
  flex: 1;
  height: 10px;
  background: var(--bg-medium);
  border-radius: 5px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.rdetail-luck-fill {
  height: 100%;
  border-radius: 5px;
  transition: width .3s;
}
.luck-pos { background: var(--green-light); }
.luck-neg { background: var(--red-light); }
.rdetail-luck-val { font-size: 13px; font-weight: bold; white-space: nowrap; }

/* Angreifer / Verteidiger Sektion */
.rdetail-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px 14px;
}
.rdetail-section-title {
  font-size: 13px;
  font-weight: bold;
  color: var(--text-bright);
  margin-bottom: 4px;
}
.rdetail-coord {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

/* Truppen-Tabelle */
.report-troop-table {
  border-collapse: collapse;
  font-size: 13px;
  width: 100%;
}
.report-troop-table th,
.report-troop-table td {
  text-align: center;
  padding: 4px 6px;
  border: 1px solid var(--border);
  min-width: 32px;
}
.report-troop-table thead th { background: var(--bg-medium); font-size: 16px; }
.rtd-lbl { font-size: 11px; color: var(--text-muted); text-align: left !important; white-space: nowrap; }
.rtd-loss { color: var(--red-light); font-weight: bold; }

/* Beute */
.rdetail-loot {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--gold);
  border-radius: 6px;
  padding: 10px 14px;
}
.rdetail-loot-res { font-size: 14px; color: var(--gold); font-weight: bold; }

/* Zustimmung */
.rdetail-loyalty {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--red-light);
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 14px;
  color: var(--red-light);
}

/* ---- Angriffs-Panel (inline in Weltkarten-Sidebar) ---- */
#wm-attack-panel {
  background: linear-gradient(160deg, #221a0c 0%, #181008 100%);
  border: 2px solid var(--border-light);
  border-top: 2px solid var(--gold-dark);
  border-radius: 8px;
  padding: 14px 14px 12px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.attack-troop-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 7px;
  font-size: 16px;
}
.attack-troop-label { flex: 1; }
.attack-input {
  width: 72px;
  padding: 4px 6px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 3px;
  text-align: right;
  font-size: 16px;
}
.attack-input:focus { outline: none; border-color: var(--gold); }
.attack-input:disabled { opacity: 0.4; cursor: not-allowed; }
.attack-troop-avail { font-size: 14px; color: var(--text-muted); min-width: 40px; }

/* ================================================================
   RESSOURCENGEBÄUDE-DETAIL (inline in Dorfübersicht)
================================================================ */
#res-detail-panel {
  background: linear-gradient(160deg, #281e0c 0%, #1a1208 100%);
  border: 1px solid var(--border-light);
  border-top: 3px solid var(--gold-dark);
  border-radius: 8px;
  padding: 20px 24px 18px;
  margin-top: 20px;
  position: relative;
  max-width: 460px;
  box-shadow: var(--shadow-md);
}
#res-detail-panel h3 {
  color: var(--gold-light);
  margin-bottom: 12px;
  padding-right: 30px;
}
.res-detail-close {
  position: absolute;
  top: 10px;
  right: 12px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 21px;
  cursor: pointer;
  padding: 2px 7px;
  border-radius: 3px;
  line-height: 1;
}
.res-detail-close:hover { color: var(--text); background: var(--bg-card); }

/* ---- Animations-Container ---- */
.res-anim-scene {
  position: relative;
  height: 120px;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 16px;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm), inset 0 0 20px rgba(0, 0, 0, 0.35);
  user-select: none;
}

/* Jede Szene füllt den Container vollständig aus */
.res-anim-woodcutter,
.res-anim-clay,
.res-anim-mine {
  position: absolute;
  inset: 0;
}

/* ----------------------------------------------------------------
   HOLZFÄLLER-SZENE
---------------------------------------------------------------- */
.res-anim-woodcutter {
  background: linear-gradient(180deg, #091409 0%, #122212 50%, #3a2a10 100%);
}

/* Bodenstreifen */
.wc-ground {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 26px;
  background: linear-gradient(180deg, #4a3818 0%, #3a2c10 100%);
  border-top: 1px solid #6a5028;
}

/* Statische Elemente */
.wc-tree1 {
  position: absolute;
  left: 5%; bottom: 22px;
  font-size: 44px;
  filter: drop-shadow(2px 0 8px #1a4a1a);
}
.wc-tree2 {
  position: absolute;
  left: 19%; bottom: 22px;
  font-size: 30px;
  opacity: 0.75;
}
.wc-sawmill {
  position: absolute;
  right: 5%; bottom: 22px;
  font-size: 34px;
}

/* Holzfäller bewegt sich zwischen Sägewerk (rechts) und Wald (links) */
.wc-worker {
  position: absolute;
  bottom: 24px;
  font-size: 24px;
  animation: wc-walk 5s ease-in-out infinite;
}
/* Axt erscheint beim Fällen */
.wc-axe {
  position: absolute;
  bottom: 48px;
  font-size: 18px;
  animation: wc-axe 5s ease-in-out infinite;
}
/* Baumstamm erscheint auf dem Rückweg */
.wc-log {
  position: absolute;
  bottom: 49px;
  font-size: 16px;
  animation: wc-log-carry 5s ease-in-out infinite;
}

@keyframes wc-walk {
  0%    { left: 64%; transform: scaleX(-1); }  /* am Sägewerk, schaut links */
  32%   { left: 26%; transform: scaleX(-1); }  /* am Wald angekommen */
  44%   { left: 26%; transform: scaleX(-1); }  /* fällt Baum */
  48%   { left: 26%; transform: scaleX(1);  }  /* dreht sich um */
  80%   { left: 64%; transform: scaleX(1);  }  /* zurück am Sägewerk */
  90%   { left: 64%; transform: scaleX(1);  }  /* kurze Pause */
  100%  { left: 64%; transform: scaleX(-1); }  /* dreht sich wieder */
}
@keyframes wc-axe {
  0%, 29%  { left: 22%; opacity: 0; transform: rotate(0deg); }
  36%      { left: 22%; opacity: 1; transform: rotate(-55deg); }
  40%      { left: 22%; opacity: 1; transform: rotate(15deg); }
  44%      { left: 22%; opacity: 1; transform: rotate(-55deg); }
  47%      { left: 22%; opacity: 0; }
  100%     { opacity: 0; }
}
@keyframes wc-log-carry {
  0%, 47%  { left: 26%; opacity: 0; }
  51%      { left: 26%; opacity: 1; }
  79%      { left: 64%; opacity: 1; }
  85%      { left: 64%; opacity: 0; }
  100%     { opacity: 0; }
}

/* ----------------------------------------------------------------
   LEHMGRUBE-SZENE
---------------------------------------------------------------- */
.res-anim-clay {
  background: linear-gradient(180deg, #2a1206 0%, #3e1e0a 50%, #5a3818 100%);
}

.cp-ground {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 26px;
  background: linear-gradient(180deg, #6a4818 0%, #5a3810 100%);
  border-top: 1px solid #8a6030;
}

/* Grube als Ellipse */
.cp-pit {
  position: absolute;
  bottom: 22px;
  left: 50%; transform: translateX(-50%);
  width: 110px; height: 40px;
  background: radial-gradient(ellipse at 50% 80%, #12080a 30%, #3a1a0a 100%);
  border-radius: 50%;
  border: 2px solid #5a3010;
}

.cp-worker {
  position: absolute;
  bottom: 32px;
  left: calc(50% - 14px);
  font-size: 24px;
  animation: cp-dig 2.2s ease-in-out infinite;
}
.cp-pickaxe {
  position: absolute;
  bottom: 56px;
  left: 53%;
  font-size: 18px;
  transform-origin: bottom left;
  animation: cp-swing 2.2s ease-in-out infinite;
}

/* Lehmklumpen fliegen aus der Grube */
.cp-chunk1 {
  position: absolute;
  bottom: 42px; left: 43%;
  font-size: 14px;
  animation: cp-chunk 2.2s ease-in-out infinite;
}
.cp-chunk2 {
  position: absolute;
  bottom: 42px; left: 53%;
  font-size: 11px;
  animation: cp-chunk 2.2s ease-in-out infinite 0.4s;
}
.cp-chunk3 {
  position: absolute;
  bottom: 42px; left: 37%;
  font-size: 10px;
  animation: cp-chunk 2.2s ease-in-out infinite 0.75s;
}

@keyframes cp-dig {
  0%, 100%  { transform: translateY(0); }
  42%       { transform: translateY(6px); }
}
@keyframes cp-swing {
  0%, 100%  { transform: rotate(-38deg); }
  42%       { transform: rotate(28deg); }
}
@keyframes cp-chunk {
  0%    { transform: translateY(0) scale(0); opacity: 0; }
  28%   { transform: translateY(0) scale(1);   opacity: 1; }
  65%   { transform: translateY(-30px) scale(0.75); opacity: 0.7; }
  100%  { transform: translateY(-50px) scale(0.3);  opacity: 0; }
}

/* ----------------------------------------------------------------
   EISENMINE-SZENE
---------------------------------------------------------------- */
.res-anim-mine {
  background: linear-gradient(180deg, #04040a 0%, #0c080e 50%, #1a1014 100%);
}

.im-ground {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 26px;
  background: linear-gradient(180deg, #1e1016 0%, #160c12 100%);
  border-top: 1px solid #3a2028;
}

/* Stollen-Eingang */
.im-arch {
  position: absolute;
  bottom: 0; left: 11%;
  width: 72px; height: 88px;
  background: radial-gradient(ellipse at 50% 100%, #02010a 60%, transparent 100%);
  border: 2px solid var(--border);
  border-bottom: none;
  border-radius: 50% 50% 0 0;
}

/* Arbeiter schwingt Pickel in der Mine */
.im-worker {
  position: absolute;
  bottom: 26px; left: 33%;
  font-size: 22px;
  animation: im-hammer 1.5s ease-in-out infinite;
}
.im-pickaxe {
  position: absolute;
  bottom: 48px; left: 40%;
  font-size: 16px;
  transform-origin: bottom left;
  animation: im-swing 1.5s ease-in-out infinite;
}

/* Funken */
.im-spark1 {
  position: absolute;
  bottom: 54px; left: 48%;
  font-size: 12px;
  animation: im-spark 1.5s ease-in-out infinite;
}
.im-spark2 {
  position: absolute;
  bottom: 50px; left: 44%;
  font-size: 9px;
  animation: im-spark 1.5s ease-in-out infinite 0.5s;
}
.im-spark3 {
  position: absolute;
  bottom: 58px; left: 52%;
  font-size: 8px;
  animation: im-spark 1.5s ease-in-out infinite 0.27s;
}

/* Erzbrocken leuchtet auf */
.im-ore {
  position: absolute;
  bottom: 26px; right: 18%;
  font-size: 22px;
  animation: im-ore-glow 3s ease-in-out infinite;
}

@keyframes im-hammer {
  0%, 100%  { transform: translateY(0); }
  38%       { transform: translateY(5px); }
}
@keyframes im-swing {
  0%, 100%  { transform: rotate(-42deg); }
  38%       { transform: rotate(22deg); }
}
@keyframes im-spark {
  0%    { opacity: 0; transform: translate(0, 0) scale(0); }
  22%   { opacity: 1; transform: translate(5px, -10px) scale(1); }
  60%   { opacity: 0.5; transform: translate(11px, -22px) scale(0.65); }
  100%  { opacity: 0; transform: translate(18px, -34px) scale(0); }
}
@keyframes im-ore-glow {
  0%, 100%  { transform: scale(1);   opacity: 0.65; filter: brightness(1); }
  50%       { transform: scale(1.12); opacity: 1;  filter: brightness(1.5) drop-shadow(0 0 6px #c8922a); }
}

/* ================================================================
   PRODUKTIONSSTATISTIK
================================================================ */
.res-modal-stats {
  background: linear-gradient(160deg, #1e1608 0%, #161008 100%);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 14px 16px;
  box-shadow: var(--shadow-sm), var(--shadow-inset);
}
.res-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 7px;
  font-size: 16px;
}
.res-stat-label { color: var(--text-muted); }
.res-stat-value { color: var(--text); font-weight: bold; }

.res-stat-divider {
  height: 1px;
  background: var(--border);
  margin: 10px 0;
}
.res-stat-section {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin-bottom: 7px;
}
.res-bonus-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  margin-bottom: 5px;
}
.res-bonus-name  { flex: 1; }
.res-bonus-value { color: var(--gold); font-weight: bold; min-width: 36px; text-align: right; }
.res-bonus-active   { color: var(--green); font-size: 14px; }
.res-bonus-inactive { color: var(--text-muted); font-size: 14px; }
.res-no-bonus {
  font-size: 15px;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 4px;
}
.res-stat-total .res-stat-label { color: var(--text); font-weight: bold; }
.res-stat-total .res-stat-value { color: var(--gold-light); font-size: 18px; }

/* ================================================================
   MARKTPLATZ — Angebotsbasiert (mit Unterreitern)
================================================================ */

/* ---- Unterreiter-Navigation ---- */
.market-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 18px;
  border-bottom: 2px solid var(--border);
  padding-bottom: 0;
  flex-wrap: wrap;
  background: linear-gradient(180deg, #1a1008 0%, #120c04 100%);
  padding: 6px 8px 0;
  border-radius: 6px 6px 0 0;
}
.market-tab-btn {
  background: linear-gradient(180deg, #2a1a0a 0%, #180e04 100%);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: 6px 6px 0 0;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  font-family: var(--font-ui);
  padding: 8px 16px;
  position: relative;
  bottom: -2px;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.market-tab-btn:hover {
  background: linear-gradient(180deg, #3a2210 0%, #241408 100%);
  color: var(--text);
  border-color: var(--border-light);
}
.market-tab-btn.active {
  background: linear-gradient(180deg, #3e2812 0%, #2a1808 100%);
  border-color: var(--gold-dark);
  border-bottom-color: #2a1808;
  color: var(--gold-light);
  font-weight: bold;
}
.market-badge {
  background: var(--green);
  border-radius: 10px;
  color: #fff;
  font-size: 11px;
  font-weight: bold;
  margin-left: 5px;
  padding: 1px 6px;
  vertical-align: middle;
}

/* ---- Sub-Panel-Sichtbarkeit ---- */
.market-sub-panel { display: none; }
.market-sub-panel.active { display: block; }

/* ---- Händler-Status-Leiste ---- */
.market-trader-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(90deg, #1e1208 0%, #2a1a0a 100%);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 7px 14px;
  margin-bottom: 8px;
  font-size: 13px;
  color: var(--text-muted);
}
.mtb-icon { font-size: 16px; }
.mtb-label { font-weight: bold; color: var(--text); }
.mtb-counts { display: flex; align-items: baseline; gap: 2px; }
.mtb-used  { color: var(--gold-light); font-weight: bold; font-size: 15px; }
.mtb-max   { color: var(--text); font-size: 13px; }
.mtb-sep   { color: var(--text-muted); margin: 0 1px; }
.mtb-unit  { font-size: 11px; margin-left: 4px; }
.mtb-track {
  flex: 1;
  height: 8px;
  background: #1a0e04;
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  min-width: 60px;
}
.mtb-fill {
  height: 100%;
  width: 0%;
  background: var(--green-light);
  border-radius: 4px;
  transition: width 0.4s ease, background 0.4s ease;
}
.mtb-fill.mtb-fill-warn { background: var(--orange-light); }
.mtb-fill.mtb-fill-full { background: var(--red-light); }
.mtb-cap {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}
.market-trader-bar.mtb-exhausted { border-color: var(--red-light); }
.market-trader-bar.mtb-exhausted .mtb-label { color: var(--red-light); }
.mtb-bonus-badge {
  font-size: 11px;
  color: var(--green-light, #7ecf7e);
  background: rgba(126,207,126,0.12);
  border: 1px solid rgba(126,207,126,0.35);
  border-radius: 4px;
  padding: 1px 6px;
  white-space: nowrap;
}

/* ---- Eingehende Missionen — Header-Indikator ---- */
.incoming-indicator-group {
  display: flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(180deg, #2e1010 0%, #1a0808 100%);
  border: 1px solid rgba(192,56,40,0.45);
  border-radius: 6px;
  padding: 5px 10px;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-shadow: var(--shadow-sm);
}
.incoming-indicator-group:hover { border-color: var(--red-light); }
.incoming-indicator-group.has-attack {
  animation: pulse-inc-indicator 1.3s ease-in-out infinite alternate;
}
.incoming-indicator-group.support-only {
  background: linear-gradient(180deg, #0e2010 0%, #081508 100%);
  border-color: rgba(80,180,60,0.4);
}
@keyframes pulse-inc-indicator {
  from { box-shadow: var(--shadow-sm), 0 0 5px rgba(192,56,40,0.15); }
  to   { box-shadow: var(--shadow-sm), 0 0 14px rgba(192,56,40,0.65); }
}
.inc-item { font-size: 13px; font-weight: bold; white-space: nowrap; }
.inc-attack  { color: #f08080; }
.inc-support { color: var(--green-light, #7ecf7e); }
.inc-timer { font-family: 'Courier New', monospace; font-size: 12px; margin-left: 3px; opacity: 0.85; }
.inc-sep   { color: var(--text-muted); font-size: 11px; }

/* ---- Globales Feedback ---- */
.market-feedback {
  font-size: 14px;
  min-height: 18px;
  margin-bottom: 8px;
}
.market-feedback.market-ok  { color: #7fb870; }
.market-feedback.market-err { color: var(--red-light); }

/* ---- Angebot einstellen ---- */
.market-form {
  background: linear-gradient(160deg, #2e1e0a 0%, #1e1206 100%);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px 20px;
  max-width: 560px;
  box-shadow: var(--shadow-sm);
}
.market-form-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.market-label {
  min-width: 90px;
  font-weight: bold;
  color: var(--gold-light);
  font-size: 16px;
}
.market-select {
  background: var(--bg-dark);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 15px;
  font-family: var(--font-ui);
  cursor: pointer;
  min-width: 130px;
}
.market-select:focus { outline: none; border-color: var(--gold); }
.market-filter-select { min-width: 160px; }

.market-amount-input {
  width: 100px;
  background: var(--bg-dark);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 15px;
  font-family: var(--font-ui);
  text-align: right;
}
.market-amount-input:focus { outline: none; border-color: var(--gold); }

.market-avail {
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
}
.market-hint {
  margin-top: 12px;
  font-size: 13px;
  color: var(--text-muted);
  max-width: 560px;
  line-height: 1.5;
}
.market-swap-row {
  display: flex;
  justify-content: flex-start;
  margin: 10px 0 10px 100px;
}
.market-swap-btn {
  font-size: 18px;
  padding: 2px 14px;
  border-color: var(--border-light);
}
.market-swap-btn:hover { color: var(--gold-light); border-color: var(--gold); }

.market-ratio {
  margin-top: 14px;
  padding: 8px 12px;
  background: linear-gradient(180deg, #1e1608 0%, #161008 100%);
  border: 1px solid var(--border);
  border-radius: 5px;
  font-size: 15px;
  color: var(--text);
  box-shadow: var(--shadow-sm), var(--shadow-inset);
}
.market-ratio-valid   { border-color: var(--green);     background: rgba(74,128,64,0.12); }
.market-ratio-invalid { border-color: var(--red-light); background: rgba(138,48,32,0.12); }
#market-ratio-value { font-weight: bold; color: var(--gold-light); }
#market-ratio-status { margin-left: 8px; font-size: 14px; }

.market-actions { margin-top: 14px; }

/* ---- Filter-Zeile (Angebote) ---- */
.market-filter-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding: 10px 14px;
  background: linear-gradient(180deg, #2a1a08 0%, #1e1206 100%);
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: var(--shadow-sm);
}
.market-filter-label {
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
}
.market-filter-sep {
  color: var(--border-light);
  font-size: 18px;
  padding: 0 4px;
  user-select: none;
}
.market-filter-select { min-width: 130px; }

/* ---- Angebotsliste ---- */
.market-offers-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 680px;
}

/* Trennlinie zwischen eigenen und fremden Angeboten */
.offer-separator {
  border: none;
  border-top: 1px solid var(--border-light);
  margin: 6px 0;
  position: relative;
}
.offer-separator::after {
  content: 'andere Angebote';
  position: absolute;
  top: -9px;
  left: 12px;
  background: var(--bg-panel);
  color: var(--text-muted);
  font-size: 11px;
  padding: 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Einzelne Angebotskarte */
.offer-card {
  background: linear-gradient(160deg, #2e1e0a 0%, #1e1206 100%);
  border: 1px solid var(--border);
  border-left: 3px solid transparent;
  border-radius: 8px;
  padding: 12px 16px;
  transition: border-color 0.15s, box-shadow 0.15s;
  box-shadow: var(--shadow-sm);
}
.offer-card:hover        { border-color: var(--border-light); box-shadow: var(--shadow-md); }
.offer-card.offer-own    { border-left-color: var(--gold); }
.offer-card.offer-urgent { border-color: rgba(192, 56, 40, 0.5); border-left-color: var(--red-light); }

.offer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.offer-creator      { font-size: 14px; font-weight: bold; }
.offer-creator-self { color: var(--gold-light); }
.offer-creator-npc  { color: var(--text); }
.offer-timer        { font-size: 13px; color: var(--text-muted); }
.offer-timer-urgent { color: var(--red-light); font-weight: bold; }

.offer-body {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.offer-gives, .offer-wants {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.offer-dir-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.offer-res        { font-size: 16px; color: var(--text); }
.offer-res strong { color: var(--gold-light); }
.offer-arrow      { font-size: 20px; color: var(--gold); font-weight: bold; }

.offer-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  border-top: 1px solid var(--border);
  padding-top: 8px;
}
.offer-ratio { font-size: 13px; color: var(--text-muted); }
.offer-eta   { font-size: 13px; color: var(--green-light); margin-left: auto; }

.btn-cancel-offer { background: var(--bg-panel); border-color: var(--red-light); color: var(--red-light); }
.btn-cancel-offer:hover { background: var(--red); color: #fff; }
.btn-disabled-offer {
  background: var(--bg-dark); border: 1px solid var(--border);
  color: var(--text-muted); opacity: 0.6; cursor: not-allowed; font-size: 13px;
}

/* ---- Lieferungen unterwegs ---- */
.market-delivery-card {
  background: linear-gradient(160deg, #182818 0%, #101e10 100%);
  border: 1px solid rgba(58, 112, 40, 0.55);
  border-left: 3px solid var(--green-light);
  border-radius: 8px;
  padding: 12px 16px;
  max-width: 560px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  box-shadow: var(--shadow-sm), 0 0 6px rgba(58, 112, 40, 0.1);
}
.delivery-card-res {
  font-size: 17px;
  color: var(--text);
  font-weight: bold;
}
.delivery-card-res strong { color: var(--gold-light); }
.delivery-card-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
}
.delivery-from  { color: var(--text-muted); font-size: 13px; }
.delivery-timer { color: var(--green-light); font-size: 14px; font-weight: bold; white-space: nowrap; }

/* ---- Handelshistorie ---- */
.market-history {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 680px;
}
.trade-item {
  background: linear-gradient(180deg, #2e1e0a 0%, #1e1206 100%);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 9px 14px;
  font-size: 14px;
  box-shadow: var(--shadow-sm);
}
.trade-item-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 5px;
}
.trade-label { font-size: 13px; color: var(--text-muted); }
.trade-tag {
  display: inline-block; font-size: 11px; padding: 2px 7px;
  border-radius: 3px; background: var(--bg-panel); border: 1px solid var(--border); margin-right: 4px;
}
.trade-tag-accepted { background: rgba(74,128,64,0.2);    border-color: var(--green);     color: #7fb870; }
.trade-tag-npc      { background: rgba(200,146,42,0.15);  border-color: var(--gold);      color: var(--gold-light); }
.trade-item-body {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.trade-arrow  { color: var(--gold); font-weight: bold; font-size: 15px; }
.trade-ratio  { color: var(--text-muted); font-size: 13px; margin-left: auto; }
.trade-time   { color: var(--text-muted); font-size: 12px; white-space: nowrap; }

/* ---- Leer-Meldungen ---- */
.market-empty {
  font-size: 14px; color: var(--text-muted); font-style: italic; padding: 10px 0;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-dark); border-radius: 4px; }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #5a3a18 0%, #3c2810 100%);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #7a5428 0%, #5a3a18 100%);
}

/* ================================================================
   SPENDENLISTE / DONOR LEADERBOARD
================================================================ */

/* ---- Inline-Badges (neben Namen) ---- */
.donor-name-wrap {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.2;
  vertical-align: middle;
}
.donor-name-line {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.donor-badge {
  display: inline-block;
  font-size: 0.85em;
  vertical-align: middle;
  line-height: 1;
}

/* Rang 1–3: Epischer Gold-Glow */
.donor-badge-epic {
  filter: drop-shadow(0 0 4px rgba(232, 184, 74, 0.8));
  animation: donor-epic-glow 2s ease-in-out infinite;
}
.donor-badge-1 { font-size: 1.05em; }
.donor-badge-2 { font-size: 0.95em; }
.donor-badge-3 { font-size: 0.95em; }

@keyframes donor-epic-glow {
  0%, 100% { filter: drop-shadow(0 0 4px rgba(232, 184, 74, 0.6)); }
  50%      { filter: drop-shadow(0 0 10px rgba(232, 184, 74, 1))
                     drop-shadow(0 0 20px rgba(200, 146, 42, 0.4)); }
}

/* Rang 4–10: Elegantes Emblem */
.donor-badge-emblem {
  filter: drop-shadow(0 0 3px rgba(100, 160, 220, 0.5));
  opacity: 0.88;
}

/* Rang 1–50: „Spender"-Titel */
.donor-title {
  display: block;
  font-size: 10px;
  font-variant: small-caps;
  letter-spacing: 0.08em;
  color: var(--gold);
  line-height: 1;
  margin-top: 1px;
}

/* ---- Header-Button ---- */
.btn-donors {
  padding: 4px 10px;
  border-radius: 4px;
  background: var(--bg-card);
  border: 1px solid var(--gold);
  color: var(--gold-light);
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s, box-shadow 0.2s;
}
.btn-donors:hover {
  background: var(--bg-panel);
  border-color: var(--gold-light);
  color: #fff;
  box-shadow: 0 0 8px rgba(232, 184, 74, 0.3);
}

/* ---- Modal-Overlay ---- */
.donor-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
}
.donor-modal {
  background: linear-gradient(160deg, #221a0c 0%, #181008 100%);
  border: 2px solid var(--gold-dark);
  border-top: 3px solid var(--gold-light);
  border-radius: 10px;
  padding: 24px 28px;
  max-width: 700px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg), 0 0 40px rgba(200, 146, 42, 0.18);
}
.donor-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.donor-modal-header h2 {
  margin: 0;
  font-size: 1.3rem;
}
.donor-modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 22px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  line-height: 1;
  transition: color 0.2s, background 0.2s;
}
.donor-modal-close:hover {
  color: var(--text);
  background: var(--bg-card);
}
.donor-modal-desc {
  color: var(--text-muted);
  font-size: 15px;
  margin-bottom: 16px;
  font-style: italic;
}

/* ---- Spender-Tabelle ---- */
.donor-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}
.donor-table thead {
  border-bottom: 2px solid var(--border-light, var(--border));
}
.donor-table th {
  text-align: left;
  padding: 8px 10px;
  color: var(--gold);
  font-size: 14px;
  font-weight: bold;
}
.donor-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
}
.donor-col-rank {
  width: 40px;
  text-align: center;
}
.donor-col-highest,
.donor-col-total {
  text-align: right;
}
.donor-cell-highest,
.donor-cell-total {
  text-align: right;
  color: var(--text);
}
.donor-rank {
  text-align: center;
  font-weight: bold;
  color: var(--text-muted);
}
.donor-display-name {
  font-weight: bold;
  color: var(--text);
}
.donor-cell-name {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

/* Titel-Tag in der Tabelle */
.donor-title-inline {
  font-size: 10px;
  font-variant: small-caps;
  letter-spacing: 0.06em;
  color: var(--gold);
  background: rgba(200, 146, 42, 0.15);
  padding: 1px 6px;
  border-radius: 3px;
  line-height: 1.3;
}

/* Zeilen-Highlights nach Rang */
.donor-row-epic {
  background: rgba(200, 146, 42, 0.12);
}
.donor-row-epic .donor-rank {
  color: var(--gold-light);
  font-size: 18px;
}
.donor-row-epic .donor-display-name {
  color: var(--gold-light);
}
.donor-row-epic .donor-cell-total {
  color: var(--gold-light);
  font-weight: bold;
}

.donor-row-emblem {
  background: rgba(100, 160, 220, 0.06);
}
.donor-row-emblem .donor-rank {
  color: #8ab8e0;
}
.donor-row-emblem .donor-display-name {
  color: #c0d8f0;
}

.donor-row-title .donor-display-name {
  color: var(--text);
}

/* Kompakt: Badges in Weltkarte-Zellen */
.wm-village-name .donor-badge {
  font-size: 10px;
}

/* ================================================================
   AUTH — Logout-Button & Benutzeranzeige
================================================================ */

.btn-logout {
  padding: 4px 10px;
  border-radius: 4px;
  background: var(--bg-card);
  border: 1px solid var(--red-light);
  color: var(--red-light);
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.btn-logout:hover {
  background: var(--red);
  border-color: #e06050;
  color: #fff;
}


.user-display {
  font-size: 13px;
  color: var(--gold-light);
  font-weight: bold;
  padding: 3px 8px;
  background: rgba(200, 146, 42, 0.12);
  border: 1px solid var(--border);
  border-radius: 4px;
  white-space: nowrap;
}

/* ---- Responsive ---- */
@media (max-width: 600px) {
  #resource-bar { gap: 8px; padding: 6px 10px; }
  .res-label { display: none; }
  .building-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
  .building-row { grid-template-columns: 36px 1fr; }
  .brow-actions { grid-column: 1 / -1; flex-direction: row; align-items: center; }

  /* Donor-Modal Responsive */
  .donor-modal {
    padding: 16px 14px;
    max-width: 98%;
  }
  .donor-table { font-size: 13px; }
  .donor-table th,
  .donor-table td { padding: 6px 6px; }
  .donor-col-highest,
  .donor-cell-highest { display: none; }
}

/* ================================================================
   STAMMESSYSTEM
================================================================ */

/* ---- Stammeskürzel-Badge (erscheint überall vor dem Dorfnamen) ---- */
.tribe-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: bold;
  color: var(--gold-light);
  background: rgba(200, 146, 42, 0.15);
  border: 1px solid rgba(200, 146, 42, 0.45);
  border-radius: 3px;
  padding: 0 4px;
  line-height: 1.45;
  vertical-align: middle;
  letter-spacing: 0.04em;
  cursor: default;
  white-space: nowrap;
}

/* Kompaktere Darstellung in der Weltkarte (kleine Zellen) */
.wm-cell .tribe-tag {
  font-size: 9px;
  padding: 0 3px;
  line-height: 1.3;
  color: #ffe878;
  text-shadow: 0 1px 3px rgba(0,0,0,0.95);
  font-weight: bold;
}

/* ---- Stamm-Tab — Layout ---- */
#tribe-section {
  max-width: 680px;
}

/* ---- Stamm-Panel (Karte) ---- */
.tribe-panel {
  background: linear-gradient(160deg, #221a0c 0%, #181008 100%);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px 24px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
}

.tribe-panel-title {
  font-family: var(--font);
  font-size: 1rem;
  color: var(--gold);
  margin-bottom: 14px;
}

/* ---- Trennlinie ---- */
.tribe-divider {
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
  margin: 4px 0 12px;
}
.tribe-divider::before,
.tribe-divider::after {
  content: '';
  display: inline-block;
  width: 90px;
  height: 1px;
  background: var(--border);
  vertical-align: middle;
  margin: 0 8px;
}

/* ---- Aktiver Stamm — Kopfzeile ---- */
.tribe-info-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.tribe-info-tag {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--gold-light);
  background: linear-gradient(135deg, rgba(200, 146, 42, 0.18) 0%, rgba(154, 104, 16, 0.12) 100%);
  border: 1px solid var(--gold-dark);
  border-radius: 6px;
  padding: 4px 14px;
  letter-spacing: 0.1em;
  box-shadow: 0 0 8px rgba(200, 146, 42, 0.15);
  text-shadow: 0 1px 4px rgba(200, 146, 42, 0.3);
}

.tribe-info-name {
  font-family: var(--font);
  font-size: 1.1rem;
  color: var(--text);
}

.tribe-info-row {
  font-size: 13px;
  color: var(--text-muted);
  margin: 4px 0;
}
.tribe-info-row strong {
  color: var(--text);
}

/* ---- Mitgliedertabelle ---- */
.tribe-members-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
}
.tribe-members-table th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  padding: 5px 10px;
  text-align: left;
  font-weight: normal;
}
.tribe-members-table td {
  font-size: 13px;
  padding: 7px 10px;
  border-bottom: 1px solid rgba(107, 80, 48, 0.25);
  color: var(--text);
}
.tribe-members-table tr:last-child td {
  border-bottom: none;
}

.tribe-role-leader { color: var(--gold-light); font-size: 12px; }
.tribe-role-member  { color: var(--text-muted); font-size: 12px; }
.tribe-role-rank    { color: #8fc8d4; font-size: 12px; }

/* ---- Rang-Manager ---- */
.rank-manager-grid {
  display: grid;
  grid-template-columns: 90px 1fr 64px;
  gap: 8px 10px;
  align-items: center;
  margin-bottom: 4px;
}
.rank-manager-header {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted);
  font-weight: bold;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}
.rank-manager-badge {
  font-size: 13px;
  color: #8fc8d4;
  font-weight: 600;
}
.rank-manager-center {
  text-align: center;
}

.online-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  box-shadow: 0 0 4px currentColor;
}

/* ---- Formular ---- */
.tribe-form-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.tribe-form-row label {
  font-size: 13px;
  color: var(--text-muted);
  width: 65px;
  flex-shrink: 0;
}
.tribe-input {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  padding: 5px 10px;
  font-size: 13px;
  flex: 1;
  min-width: 80px;
  font-family: var(--font-ui);
}
.tribe-input:focus {
  outline: none;
  border-color: var(--gold);
}
.tribe-input-tag {
  flex: none;
  max-width: 88px;
}

/* ---- Feedback ---- */
.tribe-feedback {
  font-size: 13px;
  margin-top: 7px;
  min-height: 18px;
}
.tribe-feedback.ok  { color: var(--green-light); }
.tribe-feedback.err { color: #e07060; }

/* ---- Einlade-Suche ---- */
.tribe-invite-search-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* ---- Einlade-Spielerliste ---- */
.tribe-invite-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.tribe-invite-item:last-child { border-bottom: none; }
.tribe-invite-item-name { color: var(--text); }

/* ---- Ausstehende Einladungen ---- */
.tribe-pending-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.tribe-pending-item:last-child { border-bottom: none; }
.tribe-pending-item-info { flex: 1; min-width: 0; }
.tribe-pending-item-tag  { font-weight: 700; color: var(--gold-light); }
.tribe-pending-item-btns { display: flex; gap: 6px; flex-shrink: 0; }

/* ---- Responsive ---- */
@media (max-width: 560px) {
  .tribe-panel { padding: 14px 14px; }
  .tribe-info-tag { font-size: 1.2rem; }
  .tribe-members-table th,
  .tribe-members-table td { padding: 5px 6px; }
  .tribe-pending-item { flex-direction: column; align-items: flex-start; }
}

/* ================================================================
   TAB-HERO — Panoramische Kopfgrafik je Tab-Seite
   Ersetzt das einfache <h2> oben in jedem Tab
================================================================ */
.tab-hero {
  position: relative;
  height: 96px;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 22px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md), inset 0 -32px 48px rgba(0,0,0,0.45);
  user-select: none;
}

/* Bodenstreifen-Dunkelabsatz */
.tab-hero::before {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 26px;
  background: rgba(0,0,0,0.22);
  z-index: 1;
  pointer-events: none;
}

/* Seitliches Vignetten-Abdunkeln */
.tab-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg,
    rgba(0,0,0,0.38) 0%,
    transparent 16%,
    transparent 84%,
    rgba(0,0,0,0.38) 100%);
  pointer-events: none;
  z-index: 2;
}

/* Einzelne Emoji-Szenen-Elemente */
.th-bg-emote {
  position: absolute;
  pointer-events: none;
  z-index: 3;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.75));
  line-height: 1;
}

/* Titel-Overlay in der Mitte */
.th-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10;
  pointer-events: none;
}
.th-title {
  font-family: var(--font);
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--gold-light);
  text-shadow:
    0 2px 12px rgba(0,0,0,0.98),
    0 0 28px rgba(200,146,42,0.5),
    0 0 3px rgba(0,0,0,1);
  letter-spacing: 0.04em;
}
.th-motto {
  font-size: 11px;
  color: rgba(210, 178, 118, 0.75);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-top: 6px;
  text-shadow: 0 1px 8px rgba(0,0,0,0.95);
}

/* ── Per-Tab Hintergrund-Farbverläufe ── */
.tab-hero-overview  { background: linear-gradient(180deg, #0d1a06 0%, #1c2a0c 42%, #2e1c0a 100%); }
.tab-hero-hq        { background: linear-gradient(180deg, #141008 0%, #261a0a 42%, #342210 100%); }
.tab-hero-barracks  { background: linear-gradient(180deg, #100808 0%, #220e0a 42%, #2c1008 100%); }
.tab-hero-stable    { background: linear-gradient(180deg, #110e06 0%, #241808 42%, #302010 100%); }
.tab-hero-workshop  { background: linear-gradient(180deg, #090c12 0%, #141822 42%, #1e1812 100%); }
.tab-hero-smithy    { background: linear-gradient(180deg, #0c0c08 0%, #201a08 42%, #2e2010 100%); }
.tab-hero-noble     { background: linear-gradient(180deg, #100814 0%, #200c28 42%, #2c1030 100%); }
.tab-hero-troops    { background: linear-gradient(180deg, #0a0e14 0%, #141c28 42%, #200e10 100%); }
.tab-hero-rally     { background: linear-gradient(180deg, #110808 0%, #220c0c 42%, #320e0a 100%); }
.tab-hero-worldmap  { background: linear-gradient(180deg, #050c10 0%, #0c1c1e 42%, #1a2c10 100%); }
.tab-hero-market    { background: linear-gradient(180deg, #110c04 0%, #281a06 42%, #342208 100%); }
.tab-hero-tribe     { background: linear-gradient(180deg, #0a0812 0%, #180e22 42%, #240e1c 100%); }
.tab-hero-ranking   { background: linear-gradient(180deg, #12100a 0%, #2a1e08 42%, #1a1206 100%); }
.tab-hero-messages  { background: linear-gradient(180deg, #08070d 0%, #14102a 42%, #1c1422 100%); }

/* ================================================================
   MARKET-SUB-HERO — Kleine Kopfleiste in jedem Markt-Unterreiter
================================================================ */
.market-sub-hero {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 13px 20px;
  margin-bottom: 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255,255,255,0.04);
}
.msh-icon {
  font-size: 2.1rem;
  filter: drop-shadow(0 2px 5px rgba(0,0,0,0.6));
  flex-shrink: 0;
}
.msh-text { display: flex; flex-direction: column; gap: 3px; }
.msh-title {
  font-family: var(--font);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--gold-light);
  text-shadow: 0 1px 6px rgba(0,0,0,0.8);
}
.msh-desc {
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.07em;
}

/* Varianten je Unterreiter */
.msh-offers     { background: linear-gradient(135deg, #261e08 0%, #1a1404 100%); border-color: #6a4820; }
.msh-create     { background: linear-gradient(135deg, #1c2408 0%, #141a04 100%); border-color: #4a5a22; }
.msh-deliveries { background: linear-gradient(135deg, #0e2018 0%, #0a1812 100%); border-color: #2a5a3a; }
.msh-history    { background: linear-gradient(135deg, #1a1824 0%, #12101c 100%); border-color: #3a3060; }
.msh-transfer   { background: linear-gradient(135deg, #241808 0%, #180e04 100%); border-color: #6a4010; }

/* ---- Stammestransfer-Formular ---- */
.transfer-form {
  padding: 4px 0 12px;
}
.transfer-res-rows {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 8px 0 10px;
}
.transfer-res-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.transfer-res-icon { font-size: 18px; min-width: 26px; text-align: center; }
.transfer-res-name { min-width: 44px; font-size: 13px; color: var(--text-muted); }
.transfer-res-row .market-amount-input { flex: 1; min-width: 0; width: auto; }
.transfer-avail-label { font-size: 12px; color: var(--text-muted); min-width: 68px; text-align: right; white-space: nowrap; }
.transfer-fill-all-row { margin-top: 10px; border-top: 1px solid var(--border); padding-top: 10px; }

/* ================================================================
   RANGLISTE — Tab-Unterreiter + Tabellen
================================================================ */

/* ── Unterreiter-Navigation ─────────────────────────────────────── */
.ranking-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 18px;
  border-bottom: 2px solid var(--border);
  padding-bottom: 0;
}
.ranking-refresh-info {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 6px;
}
#ranking-last-updated {
  font-size: 11px;
  color: var(--text-muted);
}
.ranking-tab-btn {
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  padding: 10px 22px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  letter-spacing: 0.03em;
}
.ranking-tab-btn:hover {
  color: var(--gold-light);
}
.ranking-tab-btn.active {
  color: var(--gold);
  border-bottom-color: var(--gold);
}

/* ── Sub-Panel Sichtbarkeit ──────────────────────────────────────── */
.ranking-sub-panel {
  display: none;
}
.ranking-sub-panel.active {
  display: block;
}

/* ── Filter-Buttons (Alle / Nur menschliche Spieler) ─────────────── */
.ranking-filter-btns {
  display: flex;
  gap: 8px;
  padding: 8px 12px 0;
  flex-wrap: wrap;
}
.ranking-filter-btns .btn {
  font-size: 12px;
  padding: 5px 14px;
  border: 1px solid var(--border-light);
  background: var(--bg-panel);
  color: var(--text-muted);
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.ranking-filter-btns .btn:hover {
  border-color: var(--gold);
  color: var(--text);
}
.ranking-filter-btns .btn.active {
  background: var(--gold);
  color: #1a140d;
  border-color: var(--gold-light);
  font-weight: bold;
}

/* ── Toolbar (Suche + Paginierung) ───────────────────────────────── */
.ranking-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.ranking-search-wrap {
  flex: 1;
  min-width: 180px;
}
.ranking-search {
  width: 100%;
  padding: 8px 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 13px;
}
.ranking-search::placeholder {
  color: var(--text-muted);
}
.ranking-search:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(200,146,42,0.2);
}
.ranking-page-info {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}
.ranking-page-btns {
  display: flex;
  gap: 4px;
}

/* ── Tabelle ─────────────────────────────────────────────────────── */
.ranking-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}
.ranking-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.ranking-table thead {
  background: linear-gradient(180deg, #1e1608 0%, #181008 100%);
  position: sticky;
  top: 0;
  z-index: 2;
}
.ranking-table th {
  padding: 10px 14px;
  text-align: left;
  color: var(--gold);
  font-family: var(--font);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
  user-select: none;
}
.ranking-table th.ranking-sortable {
  cursor: pointer;
}
.ranking-table th.ranking-sortable:hover {
  color: var(--gold-light);
}
.ranking-table th.ranking-sortable.active {
  color: #ffe87a;
}
.ranking-table td {
  padding: 9px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  color: var(--text);
}
.ranking-table tbody tr {
  background: rgba(0,0,0,0.15);
  transition: background 0.12s;
}
.ranking-table tbody tr:nth-child(even) {
  background: rgba(0,0,0,0.08);
}
.ranking-table tbody tr:hover {
  background: rgba(200,146,42,0.08);
}

/* ── Rang-Zelle ──────────────────────────────────────────────────── */
.rank-col { width: 50px; text-align: center; }
.ranking-table td.rank-col {
  font-weight: bold;
  color: var(--text-muted);
  text-align: center;
}
/* Top-3 Gold/Silber/Bronze */
.ranking-table tr.rank-1 td.rank-col { color: #ffd700; }
.ranking-table tr.rank-2 td.rank-col { color: #c0c0c0; }
.ranking-table tr.rank-3 td.rank-col { color: #cd7f32; }
.ranking-table tr.rank-self {
  background: rgba(200,146,42,0.12);
  border-left: 3px solid var(--gold);
}

/* ── Spieler-/Stammesname ────────────────────────────────────────── */
.rank-player-name {
  font-weight: 600;
  color: var(--gold-light);
}
.rank-tribe-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: bold;
  color: var(--gold-light);
  background: rgba(200,146,42,0.15);
  border: 1px solid rgba(200,146,42,0.35);
  border-radius: 3px;
  padding: 0 5px;
  line-height: 1.45;
  letter-spacing: 0.04em;
}
.rank-tribe-name {
  font-weight: 600;
  color: var(--gold-light);
}

/* ── Punkte-Spalte ───────────────────────────────────────────────── */
.rank-points-col { min-width: 90px; }
.ranking-table td.rank-points-val {
  color: #ffe87a;
  font-weight: 600;
}

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .ranking-tab-btn { padding: 8px 14px; font-size: 12px; }
  .ranking-table th, .ranking-table td { padding: 7px 8px; font-size: 12px; }
  .rank-col { width: 36px; }
}

/* =============================================================
   SCHMIEDE — Forschungs-Tab
============================================================= */

.smithy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.smithy-card {
  background: linear-gradient(160deg, #2e1c08 0%, #1e1006 100%);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.smithy-card:hover {
  border-color: var(--gold-dark);
  box-shadow: var(--shadow-sm), 0 0 10px rgba(200, 146, 42, 0.1);
}

.smithy-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
}
.smithy-icon { font-size: 1.5rem; }
.smithy-name {
  font-weight: bold;
  color: var(--text);
  flex: 1;
  font-size: 14px;
}
.smithy-level {
  font-size: 12px;
  color: var(--gold);
  background: rgba(200, 146, 42, 0.12);
  border: 1px solid rgba(200, 146, 42, 0.25);
  border-radius: 4px;
  padding: 1px 7px;
}

.smithy-bonus {
  font-size: 12px;
  color: var(--text-muted);
}

.smithy-maxed {
  font-size: 12px;
  color: var(--green-light);
  font-weight: 600;
}
.smithy-queued {
  font-size: 12px;
  color: var(--gold);
  font-weight: 600;
}
.smithy-locked2 {
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
}

.smithy-research-btn {
  width: 100%;
  text-align: center;
  line-height: 1.4;
}
.smithy-research-btn small {
  font-size: 11px;
  opacity: 0.85;
}

/* =============================================================
   WELTKARTE — Zustimmung & Eroberung
============================================================= */

/* Verdunkeltes Overlay für eroberte Dörfer */
.wm-cell.wm-conquered {
  border: 2px solid #9a60c0 !important;
  box-shadow: inset 0 0 12px rgba(154, 96, 192, 0.35), 0 0 8px rgba(154, 96, 192, 0.4);
}
.wm-cell.wm-conquered:hover {
  box-shadow: inset 0 0 16px rgba(154, 96, 192, 0.5), 0 0 14px rgba(154, 96, 192, 0.6);
}

/* Zustimmungs-Badge auf Weltkarten-Zelle */
.wm-loyalty {
  position: absolute;
  bottom: 2px;
  left: 2px;
  font-size: 9px;
  background: rgba(0, 0, 0, 0.65);
  color: #e8d8b0;
  border-radius: 3px;
  padding: 0 3px;
  line-height: 1.5;
  z-index: 4;
  pointer-events: none;
}
.wm-loyalty.low { color: #ff8040; }
.wm-loyalty.critical { color: #ff3030; font-weight: bold; }

/* Erobe­rungs-Banner (über dem Spielbereich) */
.conquest-banner {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #3a1060 0%, #6a20a0 50%, #3a1060 100%);
  border: 2px solid #c080f0;
  border-radius: 10px;
  padding: 16px 32px;
  text-align: center;
  color: #eeddf8;
  font-size: 16px;
  font-weight: bold;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.75), 0 0 24px rgba(192, 128, 240, 0.4);
  z-index: 9000;
  animation: conquest-in 0.4s ease-out;
  max-width: 420px;
  white-space: nowrap;
}
.conquest-banner .conquest-title {
  font-size: 20px;
  color: #f0c0ff;
  margin-bottom: 6px;
  display: block;
  letter-spacing: 0.05em;
}
.conquest-banner .conquest-coords {
  font-size: 13px;
  color: #c890e8;
  opacity: 0.85;
}

@keyframes conquest-in {
  from { opacity: 0; transform: translateX(-50%) translateY(-20px) scale(0.9); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0)    scale(1);   }
}

/* ================================================================
   GEBÄUDE — Gesperrte Gebäude (Voraussetzungen nicht erfüllt)
================================================================ */

/* Trennlinie "Noch nicht verfügbar" */
.brow-locked-header {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-muted);
  padding: 12px 0 6px;
  border-top: 1px solid var(--border);
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.brow-locked-header::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* Gesperrte Gebäude-Zeile */
.brow-locked {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(90, 58, 24, 0.35);
  margin-bottom: 4px;
  opacity: 0.65;
  transition: opacity 0.15s;
}
.brow-locked:hover { opacity: 0.80; }

/* Icon-Zelle bei gesperrtem Gebäude */
.brow-locked .brow-icon {
  filter: grayscale(0.7) brightness(0.7);
}

/* Namens-Block */
.brow-locked .brow-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.brow-locked .brow-name {
  color: var(--text-muted);
  font-size: 15px;
}

/* Voraussetzungs-Liste */
.breq-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 3px;
}

/* Einzelner Voraussetzungs-Badge */
.breq-item {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 12px;
  padding: 2px 7px;
  border-radius: 10px;
  font-weight: 500;
  white-space: nowrap;
  line-height: 1.4;
}

/* Erfüllt: grüner Ton */
.breq-item.met {
  background: rgba(58, 112, 40, 0.18);
  border: 1px solid rgba(90, 144, 64, 0.5);
  color: #7abf68;
}
.breq-item.met::before { content: '✓ '; font-size: 11px; }

/* Nicht erfüllt: roter Ton */
.breq-item.unmet {
  background: rgba(138, 32, 16, 0.18);
  border: 1px solid rgba(192, 56, 40, 0.45);
  color: #d06050;
}
.breq-item.unmet::before { content: '✗ '; font-size: 11px; }

/* =============================================================
   3D DORFÜBERSICHT — Toggle, Container, Tooltip, Kamera
============================================================= */

/* ── 2D / 3D Toggle ── */
.village-toggle {
  display: flex;
  gap: 4px;
  margin: 8px 0 4px;
  justify-content: flex-end;
}
.nav-view-divider {
  width: 1px;
  background: var(--border);
  margin: 2px 6px;
  opacity: 0.5;
  align-self: stretch;
}
.view-btn {
  padding: 6px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-muted);
  cursor: pointer;
  font-family: var(--font);
  font-size: 0.88rem;
  transition: all 0.2s;
  white-space: nowrap;
}
.view-btn.active {
  background: linear-gradient(135deg, #382010 0%, #241408 100%);
  color: var(--gold-light);
  border-color: var(--gold);
  box-shadow: 0 0 8px rgba(200, 146, 42, 0.2);
}
.view-btn:hover {
  border-color: var(--gold);
  color: var(--text);
}

/* ── 3D Container ── */
#village-3d-container {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: #0A0A2E;
}
#village-3d-container canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

/* ── Hover-Tooltip ── */
.village-3d-tooltip {
  position: fixed;
  background: linear-gradient(135deg, #2a1a08 0%, #1e1206 100%);
  border: 1px solid var(--gold);
  border-radius: 6px;
  padding: 8px 12px;
  color: var(--text);
  font-size: 0.85rem;
  pointer-events: none;
  z-index: 9999;
  max-width: 200px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
  line-height: 1.4;
}

/* ── Kamera-Preset-Buttons ── */
.village-3d-camera-btns {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 4px;
  z-index: 10;
}
.cam-btn {
  padding: 5px 10px;
  background: rgba(26, 20, 13, 0.85);
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.75rem;
  font-family: var(--font);
  transition: all 0.2s;
  backdrop-filter: blur(4px);
}
.cam-btn:hover {
  color: var(--gold-light);
  border-color: var(--gold);
  background: rgba(56, 32, 16, 0.9);
}

/* =============================================================
   KAMPFSYSTEM — Alarm-Bar, Berichte, Spionage, Toggle
============================================================= */

/* ── Eingehende-Angriffe-Alarm ── */
.incoming-alert-bar {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: linear-gradient(90deg, #5a1008 0%, #8a2010 50%, #5a1008 100%);
  color: #ffd0c0;
  font-size: 0.92rem;
  font-weight: 600;
  border-bottom: 2px solid #c03828;
  z-index: 100;
}
.alert-pulse {
  color: #ff4030;
  font-weight: 700;
  animation: alertPulse 1.2s ease-in-out infinite;
}
@keyframes alertPulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.4; }
}
.alert-bar-btn {
  margin-left: auto;
  padding: 4px 12px;
  background: rgba(0,0,0,0.35);
  border: 1px solid #c03828;
  border-radius: 4px;
  color: #ffd0c0;
  cursor: pointer;
  font-size: 0.82rem;
  white-space: nowrap;
}
.alert-bar-btn:hover {
  background: rgba(192, 56, 40, 0.4);
}

/* ── Angriff/Spionage-Toggle ── */
.attack-type-btn {
  padding: 5px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s;
}
.attack-type-btn.active {
  background: linear-gradient(135deg, #382010 0%, #241408 100%);
  color: var(--gold-light);
  border-color: var(--gold);
  box-shadow: 0 0 8px rgba(200, 146, 42, 0.2);
}
.attack-type-btn:hover {
  border-color: var(--gold);
  color: var(--text);
}

/* ── Kampfberichte — Spionage-Sektion ── */
.rdetail-spy {
  margin: 12px 0;
  padding: 10px;
  background: rgba(42, 120, 180, 0.08);
  border: 1px solid rgba(42, 120, 180, 0.3);
  border-radius: 6px;
}
.rdetail-spy h4 {
  color: #6ab8e8;
  margin-bottom: 8px;
  font-size: 0.95rem;
}
.spy-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.spy-row span {
  font-size: 0.88rem;
}
.spy-buildings-table {
  width: 100%;
  font-size: 0.82rem;
  border-collapse: collapse;
  margin-top: 6px;
}
.spy-buildings-table th,
.spy-buildings-table td {
  padding: 3px 8px;
  border-bottom: 1px solid rgba(90, 58, 24, 0.3);
  text-align: left;
}
.spy-buildings-table th {
  color: var(--gold);
  font-weight: 600;
}

/* ── Kampfberichte — Wall-Schaden ── */
.rdetail-wall {
  margin: 8px 0;
  padding: 8px 10px;
  background: rgba(180, 100, 20, 0.1);
  border: 1px solid rgba(180, 100, 20, 0.3);
  border-radius: 5px;
  font-size: 0.9rem;
}

/* ── Kampfberichte — Gebäude-Schaden ── */
.rdetail-bldg-dmg {
  margin: 8px 0;
  padding: 8px 10px;
  background: rgba(180, 40, 20, 0.1);
  border: 1px solid rgba(180, 40, 20, 0.3);
  border-radius: 5px;
  font-size: 0.9rem;
}

/* ── Kampfberichte — Moral-Anzeige ── */
.rdetail-morale {
  margin: 6px 0;
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* ── Kampfberichte — Aktions-Links ── */
.rdetail-actions {
  margin-top: 12px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.rdetail-action-link {
  padding: 5px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--gold);
  cursor: pointer;
  font-size: 0.82rem;
  text-decoration: none;
  transition: all 0.2s;
}
.rdetail-action-link:hover {
  border-color: var(--gold);
  color: var(--gold-light);
  background: rgba(56, 32, 16, 0.6);
}

/* ── Kampfberichte — Forschungsbonus-Zeile ── */
.rtd-bonus {
  font-size: 0.78rem;
  color: #6ab878;
  font-style: italic;
}

/* ── Berichte-Liste — Spionage-Icons ── */
.report-spy-ok {
  color: #6ab8e8;
}
.report-spy-fail {
  color: #d06050;
}

/* =============================================================
   MOBILE OPTIMIERUNG — Handy (max 600px)
   v0.0.46 — Komplette Responsive-Anpassung
============================================================= */

/* ── Globale Touch-Optimierung ── */
@media (pointer: coarse) {
  *, *::before, *::after { -webkit-tap-highlight-color: transparent; }
  button, .tab-btn, .btn, .view-btn, a { touch-action: manipulation; }
}

@media (max-width: 600px) {

  /* ────────────────────────────────────────────────────────────
     1. RESOURCE BAR
  ──────────────────────────────────────────────────────────── */
  #resource-bar {
    gap: 3px;
    padding: 4px 6px;
    font-size: 12px;
  }
  .res-group {
    padding: 2px 5px;
    gap: 2px;
    font-size: 12px;
  }
  .res-label { display: none; }
  .res-value, .res-rate {
    min-width: unset;
    font-size: 11px;
  }
  .res-full { display: none; }
  .pop-group, .points-group { font-size: 11px; }
  .header-village {
    gap: 4px;
    font-size: 12px;
    flex-wrap: wrap;
  }
  #village-name {
    max-width: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .header-village .btn {
    padding: 3px 8px;
    font-size: 11px;
  }
  .protection-timer {
    font-size: 11px;
    padding: 2px 6px;
  }

  /* ────────────────────────────────────────────────────────────
     2. NAVIGATION — Horizontal scrollbar
  ──────────────────────────────────────────────────────────── */
  #main-nav {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 2px;
    padding: 3px 4px;
    scrollbar-width: none;
  }
  #main-nav::-webkit-scrollbar { display: none; }
  .tab-btn {
    padding: 5px 9px;
    font-size: 11px;
    white-space: nowrap;
    flex-shrink: 0;
  }
  .nav-view-divider { display: none; }
  .view-btn {
    padding: 4px 8px;
    font-size: 10px;
    flex-shrink: 0;
  }

  /* ────────────────────────────────────────────────────────────
     3. TAB CONTENT — Weniger Padding
  ──────────────────────────────────────────────────────────── */
  .tab-content {
    padding: 10px 8px;
    max-width: 100%;
  }
  .tab-section {
    padding: 10px 8px;
  }

  /* ────────────────────────────────────────────────────────────
     4. TAB HERO — Kompakter
  ──────────────────────────────────────────────────────────── */
  .tab-hero {
    height: 52px;
    margin-bottom: 10px;
  }
  .th-title {
    font-size: 1rem;
  }
  .th-sub {
    font-size: 0.7rem;
  }
  .tab-hero .th-deco,
  .tab-hero [style*="position:absolute"] {
    display: none;
  }

  /* ────────────────────────────────────────────────────────────
     5. ALLGEMEINE TYPOGRAFIE
  ──────────────────────────────────────────────────────────── */
  h2 { font-size: 1rem; }
  h3 { font-size: 0.9rem; }
  .btn {
    padding: 6px 10px;
    font-size: 12px;
  }

  /* ────────────────────────────────────────────────────────────
     6. GEBÄUDE-GRID (Dorfübersicht-Tiles)
  ──────────────────────────────────────────────────────────── */
  .building-grid {
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 6px;
  }
  .building-tile {
    padding: 8px 6px;
  }
  .tile-icon { font-size: 1.6rem; }
  .tile-name { font-size: 13px; }
  .tile-level { font-size: 11px; }

  /* ────────────────────────────────────────────────────────────
     7. GEBÄUDE-REIHEN (Rathaus-Liste)
  ──────────────────────────────────────────────────────────── */
  .building-row {
    grid-template-columns: 30px 1fr;
    gap: 6px;
    padding: 8px;
  }
  .brow-icon {
    width: 30px;
    height: 30px;
    font-size: 1.2rem;
  }
  .brow-name { font-size: 13px; }
  .brow-desc { font-size: 11px; }
  .brow-level { font-size: 11px; }
  .brow-actions {
    grid-column: 1 / -1;
    flex-direction: row;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
  }
  .cost-item { font-size: 11px; }
  .brow-actions .btn {
    padding: 5px 8px;
    font-size: 11px;
  }

  /* Gesperrte Gebäude */
  .brow-locked {
    grid-template-columns: 28px 1fr;
    gap: 6px;
    padding: 6px 8px;
  }
  .brow-locked .brow-name { font-size: 13px; }
  .breq-item { font-size: 10px; padding: 1px 5px; }

  /* ────────────────────────────────────────────────────────────
     8. TRUPPEN-REIHEN (Kaserne/Stall/Werkstatt)
  ──────────────────────────────────────────────────────────── */
  .troop-row {
    grid-template-columns: 30px 1fr;
    gap: 6px;
    padding: 8px;
  }
  .trow-icon {
    width: 30px;
    height: 30px;
    font-size: 1.2rem;
  }
  .trow-name { font-size: 13px; }
  .trow-desc { font-size: 11px; }
  .trow-stats { font-size: 11px; gap: 4px; }
  .trow-actions {
    grid-column: 1 / -1;
    gap: 4px;
    flex-wrap: wrap;
  }
  .trow-amount-input {
    width: 45px;
    font-size: 12px;
    padding: 4px;
  }
  .trow-actions .btn {
    padding: 5px 8px;
    font-size: 11px;
  }

  /* ────────────────────────────────────────────────────────────
     9. WARTESCHLANGEN (Bau + Rekrutierung)
  ──────────────────────────────────────────────────────────── */
  .queue-entry {
    padding: 6px 8px;
    font-size: 12px;
    gap: 4px;
  }
  .queue-entry .btn {
    padding: 3px 6px;
    font-size: 10px;
  }

  /* ────────────────────────────────────────────────────────────
     10. WELTKARTE
  ──────────────────────────────────────────────────────────── */
  #wm-grid-scroll {
    height: auto;
    max-height: 65vh;
  }
  .wm-cell {
    width: 34px;
    height: 34px;
    font-size: 7px;
  }
  .wm-axis-label {
    font-size: 8px;
  }
  .wm-axis-x { height: 16px; }
  .wm-axis-y { width: 16px; height: 34px; }
  .wm-coord-label { font-size: 8px; }
  #wm-size-controls {
    flex-wrap: wrap;
    gap: 4px;
    font-size: 12px;
  }
  #wm-size-controls .btn {
    padding: 4px 8px;
    font-size: 11px;
  }
  #wm-attack-panel,
  #wm-support-panel {
    padding: 8px;
    font-size: 12px;
  }
  #wm-attack-panel .btn,
  #wm-support-panel .btn {
    padding: 5px 8px;
    font-size: 11px;
  }
  #wm-attack-panel input,
  #wm-support-panel input {
    width: 45px;
    font-size: 12px;
    padding: 3px;
  }
  #wm-legend {
    font-size: 11px;
    gap: 6px;
    flex-wrap: wrap;
  }

  /* ────────────────────────────────────────────────────────────
     11. RALLY / VERSAMMLUNGSPLATZ
  ──────────────────────────────────────────────────────────── */
  .rally-columns { grid-template-columns: 1fr; }
  .rally-section {
    padding: 8px;
  }
  .rally-section h3 { font-size: 0.85rem; }
  .troop-overview-grid {
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    gap: 4px;
  }
  .troop-overview-card {
    padding: 6px;
    font-size: 12px;
  }

  /* Kampfberichte */
  .report-list-item {
    padding: 6px 8px;
    font-size: 12px;
  }
  .report-detail {
    padding: 10px;
    font-size: 12px;
  }
  .rdetail-table { font-size: 11px; }
  .rdetail-table th,
  .rdetail-table td { padding: 3px 4px; }
  .rdetail-actions { gap: 4px; }
  .rdetail-action-link { padding: 4px 8px; font-size: 11px; }

  /* ────────────────────────────────────────────────────────────
     12. MARKTPLATZ
  ──────────────────────────────────────────────────────────── */
  .market-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    gap: 2px;
  }
  .market-tabs::-webkit-scrollbar { display: none; }
  .market-tab-btn {
    padding: 5px 9px;
    font-size: 11px;
    white-space: nowrap;
    flex-shrink: 0;
  }
  .market-sub-panel { padding: 8px; }
  .market-offer-row {
    font-size: 12px;
    padding: 6px;
    gap: 4px;
    flex-wrap: wrap;
  }
  .market-create-form input,
  .market-create-form select {
    font-size: 12px;
    padding: 4px 6px;
  }
  .market-filter-select {
    font-size: 12px;
    padding: 3px 6px;
  }

  /* ────────────────────────────────────────────────────────────
     13. STAMM / ALLIANZ
  ──────────────────────────────────────────────────────────── */
  .tribe-panel { padding: 8px; }
  .tribe-info-grid { gap: 6px; }
  .tribe-info-tag { font-size: 1rem; }
  .tribe-members-table th,
  .tribe-members-table td {
    padding: 4px 5px;
    font-size: 11px;
  }
  .tribe-btn {
    padding: 5px 8px;
    font-size: 11px;
  }
  .tribe-pending-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    font-size: 12px;
  }

  /* ────────────────────────────────────────────────────────────
     14. RANGLISTE
  ──────────────────────────────────────────────────────────── */
  .ranking-tab-btn {
    padding: 6px 10px;
    font-size: 11px;
  }
  .ranking-table th,
  .ranking-table td {
    padding: 5px 6px;
    font-size: 11px;
  }
  .rank-col { width: 30px; }
  .rank-points-col { min-width: 60px; }

  /* ────────────────────────────────────────────────────────────
     15. SCHMIEDE
  ──────────────────────────────────────────────────────────── */
  .smithy-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .smithy-card { padding: 10px 12px; }
  .smithy-name { font-size: 13px; }
  .smithy-research-btn { font-size: 12px; }

  /* ────────────────────────────────────────────────────────────
     16. NACHRICHTEN
  ──────────────────────────────────────────────────────────── */
  .msg-sub-panel { padding: 8px; }
  .msg-list-item {
    padding: 6px 8px;
    font-size: 12px;
  }

  /* ────────────────────────────────────────────────────────────
     17. MODALS & OVERLAYS
  ──────────────────────────────────────────────────────────── */
  .pause-modal {
    padding: 20px 16px;
    width: 92%;
    max-width: 95vw;
  }
  .donor-modal {
    padding: 14px 12px;
    max-width: 96%;
  }

  /* ────────────────────────────────────────────────────────────
     18. EINGEHENDE ANGRIFFE — Alert Bar
  ──────────────────────────────────────────────────────────── */
  .incoming-alert-bar {
    padding: 5px 8px;
    font-size: 0.78rem;
    gap: 4px;
    flex-wrap: wrap;
  }
  .alert-bar-btn {
    padding: 3px 8px;
    font-size: 0.72rem;
  }

  /* ────────────────────────────────────────────────────────────
     19. EROBERUNGS-BANNER
  ──────────────────────────────────────────────────────────── */
  .conquest-banner {
    padding: 10px 16px;
    font-size: 13px;
    max-width: 90vw;
    white-space: normal;
    top: 60px;
  }
  .conquest-banner .conquest-title { font-size: 16px; }
  .conquest-banner .conquest-coords { font-size: 11px; }

  /* ────────────────────────────────────────────────────────────
     20. 3D VIEW
  ──────────────────────────────────────────────────────────── */
  .village-3d-camera-btns { gap: 2px; }
  .cam-btn {
    padding: 3px 6px;
    font-size: 0.65rem;
  }

  /* ────────────────────────────────────────────────────────────
     21. TOOLTIP
  ──────────────────────────────────────────────────────────── */
  #tooltip {
    font-size: 12px;
    max-width: 250px;
    padding: 6px 10px;
  }

} /* Ende @media (max-width: 600px) */

/* ================================================================
   PREMIUM-SYSTEM — Token-Anzeige, Modal, Shop, Login-Kalender
================================================================ */

/* ---- Generisches Modal-Overlay (wiederverwendet) ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(0, 0, 0, 0.78);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeInOverlay 0.2s ease;
}
@keyframes fadeInOverlay {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.modal-panel {
  position: relative;
  background: linear-gradient(160deg, #2a1e0c 0%, #1a120a 100%);
  border: 2px solid var(--border);
  border-top: 3px solid var(--gold-light);
  border-radius: 10px;
  padding: 24px 28px;
  width: 90%;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: 0 8px 40px rgba(0,0,0,0.7), 0 0 40px rgba(200,146,42,0.12);
  animation: slideInModal 0.2s ease;
}
@keyframes slideInModal {
  from { transform: translateY(-16px); opacity: 0.6; }
  to   { transform: translateY(0);     opacity: 1;   }
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
}
.modal-close:hover {
  color: var(--text);
  background: var(--bg-card);
}

/* ---- Premium-Token-Button in Resource Bar ---- */
.premium-token-btn {
  padding: 4px 12px;
  border-radius: 4px;
  cursor: pointer;
  background: var(--bg-card);
  border: 1px solid var(--gold);
  color: var(--gold-light);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
  white-space: nowrap;
}
.premium-token-btn:hover {
  background: #3a2e00;
  border-color: var(--gold-light);
  box-shadow: 0 0 8px rgba(232,184,74,0.3);
}
.premium-token-btn.premium-active-glow {
  background: #3a2a00;
  border-color: var(--gold-light);
  box-shadow: 0 0 10px rgba(232,184,74,0.4);
  animation: tokenGlow 2.4s ease-in-out infinite;
}
@keyframes tokenGlow {
  0%, 100% { box-shadow: 0 0 6px rgba(232,184,74,0.35); }
  50%       { box-shadow: 0 0 14px rgba(232,184,74,0.6); }
}

/* ---- Premium-Modal-Panel ---- */
.premium-panel {
  max-width: 680px;
}

/* ---- Premium-Modal-Kopfzeile ---- */
.premium-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(200,146,42,0.08);
  border: 1px solid rgba(200,146,42,0.25);
  border-radius: 8px;
  margin-bottom: 20px;
}
.premium-balance {
  display: flex;
  align-items: center;
  gap: 8px;
}
.premium-star {
  font-size: 24px;
}
.premium-token-count {
  font-size: 28px;
  font-weight: bold;
  color: var(--gold-light);
  font-family: var(--font);
}
.premium-token-label {
  font-size: 13px;
  color: var(--text-muted);
}
.premium-active-features {
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: flex-end;
}
.feature-badge {
  font-size: 12px;
  padding: 3px 8px;
  border-radius: 4px;
  white-space: nowrap;
}
.feature-build {
  background: rgba(40,120,60,0.18);
  border: 1px solid #3a7a48;
  color: #6dc882;
}
.feature-res {
  background: rgba(40,80,180,0.18);
  border: 1px solid #3a60b0;
  color: #80a8e8;
}
.feature-inactive {
  background: rgba(80,60,40,0.18);
  border: 1px solid var(--border);
  color: var(--text-muted);
  opacity: 0.7;
}

/* ---- Premium-Sektion ---- */
.premium-section {
  margin-bottom: 24px;
}
.premium-section-title {
  font-size: 15px;
  color: var(--gold);
  margin-bottom: 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

/* ---- Shop-Grid ---- */
.premium-shop-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 540px) {
  .premium-shop-grid { grid-template-columns: 1fr; }
}

.premium-shop-card {
  background: linear-gradient(160deg, #261c0c 0%, #1a1208 100%);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
}
.shop-card-title {
  font-size: 14px;
  font-weight: bold;
  color: var(--text);
  margin-bottom: 5px;
}
.shop-card-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.premium-tier-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* ---- Shop-Tier-Button ---- */
.premium-tier-btn {
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid var(--gold);
  background: rgba(200,146,42,0.1);
  color: var(--gold-light);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  line-height: 1.3;
  transition: background 0.2s, box-shadow 0.2s;
}
.premium-tier-btn:hover:not(.disabled) {
  background: rgba(200,146,42,0.22);
  box-shadow: 0 0 8px rgba(200,146,42,0.25);
}
.premium-tier-btn.disabled,
.premium-tier-btn:disabled {
  border-color: var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  cursor: not-allowed;
  opacity: 0.6;
}
.premium-tier-btn small {
  display: block;
  font-size: 11px;
  font-weight: normal;
  margin-top: 2px;
  color: var(--text-muted);
}

/* ---- Login-Kalender ---- */
.login-claim-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(40,120,60,0.15);
  border: 1px solid #3a7a48;
  border-radius: 6px;
  margin-bottom: 12px;
  font-size: 14px;
  color: var(--text);
}
.login-claimed-banner {
  padding: 10px 14px;
  background: rgba(60,50,30,0.25);
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
}

.login-calendar {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 5px;
}
@media (max-width: 480px) {
  .login-calendar { grid-template-columns: repeat(5, 1fr); }
}

.cal-day {
  border-radius: 6px;
  padding: 6px 4px;
  text-align: center;
  border: 1px solid var(--border);
  font-size: 11px;
  line-height: 1.35;
}
.cal-day-num {
  display: block;
  font-weight: bold;
  font-size: 12px;
}
.cal-day-reward {
  display: block;
  font-size: 10px;
  margin-top: 2px;
}
.cal-day.done {
  background: rgba(40,120,60,0.15);
  border-color: #3a7a48;
  color: #6dc882;
}
.cal-day.today {
  background: rgba(200,146,42,0.18);
  border-color: var(--gold-light);
  color: var(--gold-light);
  font-weight: bold;
  box-shadow: 0 0 6px rgba(200,146,42,0.3);
  animation: calToday 1.8s ease-in-out infinite;
}
@keyframes calToday {
  0%, 100% { box-shadow: 0 0 5px rgba(200,146,42,0.3); }
  50%       { box-shadow: 0 0 12px rgba(200,146,42,0.55); }
}
.cal-day.future {
  background: rgba(60,40,20,0.12);
  color: var(--text-muted);
  opacity: 0.6;
}

/* ---- Login-Reward-Popup ---- */
.login-reward-panel {
  max-width: 360px;
  text-align: center;
}

/* ---- Toast-Notification ---- */
.premium-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: linear-gradient(160deg, #2e220a 0%, #1c1408 100%);
  border: 1px solid var(--gold);
  border-radius: 6px;
  padding: 10px 22px;
  color: var(--gold-light);
  font-size: 14px;
  font-weight: 600;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
  white-space: nowrap;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}
.premium-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
