/* Nitro Settlers – Medieval Dark Gold Theme */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg-dark: #1a1410;
  --bg-panel: #241c14;
  --bg-card: #2a2218;
  --accent: #c9a227;
  --accent-light: #e8c547;
  --text: #e8e0d4;
  --text-muted: #a89880;
  --border: #5a4a32;
  --radius: 8px;
  --success: #27ae60;
  --danger: #c0392b;
  --warning: #e67e22;
  --map-tile-size: 56px;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Source Sans 3', sans-serif;
  background: var(--bg-dark);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

h1, h2, h3, h4 {
  font-family: 'Cinzel', serif;
  font-weight: 700;
}

a {
  color: var(--accent-light);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.hidden {
  display: none !important;
}

/* --- Screens --- */

.screen {
  min-height: 100vh;
}

/* --- Auth --- */

.auth-screen-bg {
  background:
    linear-gradient(180deg, rgba(26, 20, 16, 0.9) 0%, rgba(26, 20, 16, 0.82) 45%, rgba(26, 20, 16, 0.94) 100%),
    url('assets/img/auth-bg.png') center / cover no-repeat fixed;
}

.auth-container {
  max-width: 420px;
  margin: 0 auto;
  padding: 48px 24px;
  text-align: center;
  background: rgba(36, 28, 20, 0.88);
  border: 1px solid rgba(201, 162, 39, 0.25);
  border-radius: 14px;
  backdrop-filter: blur(10px);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
}

.game-title {
  font-size: 2rem;
  color: var(--accent-light);
  margin-bottom: 8px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.game-logo {
  display: block;
  max-width: 300px;
  width: 100%;
  height: auto;
  margin: 0 auto 16px;
  filter: drop-shadow(0 6px 20px rgba(0, 0, 0, 0.65));
}

.game-logo-sm {
  max-width: 200px;
  margin-bottom: 12px;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.15rem;
}

.header-logo {
  height: 42px;
  width: auto;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.5));
}

.res-icon {
  width: 1.15em;
  height: 1.15em;
  vertical-align: -0.15em;
  display: inline-block;
  object-fit: contain;
}

#game-screen {
  background:
    linear-gradient(180deg, rgba(26, 20, 16, 0.96) 0%, rgba(26, 20, 16, 0.99) 100%),
    url('assets/img/auth-bg.png') center top / cover no-repeat fixed;
}

.subtitle {
  color: var(--text-muted);
  margin-bottom: 28px;
  font-size: 0.95rem;
}

.auth-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.tab {
  flex: 1;
  padding: 12px;
  background: var(--bg-panel);
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.95rem;
  transition: background 0.15s, color 0.15s;
}

.tab:hover {
  color: var(--text);
}

.tab.active {
  background: rgba(201, 162, 39, 0.15);
  color: var(--accent-light);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.auth-form input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
  margin-bottom: 12px;
}

.auth-form input:focus,
.auth-select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(201, 162, 39, 0.2);
}

.error-msg {
  color: var(--danger);
  margin-top: 12px;
  font-size: 0.9rem;
}

.auth-hint {
  margin-top: 16px;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.wiki-auth-link {
  color: var(--accent-light);
}

.pending-email {
  margin: 16px 0 24px;
  color: var(--accent-light);
}

#pending-screen .btn-primary {
  margin-bottom: 12px;
}

.field-label {
  display: block;
  text-align: left;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.auth-select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
  margin-bottom: 12px;
}

/* --- Buttons --- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-panel);
  color: var(--text);
  font-family: inherit;
  font-size: 0.92rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.12s;
}

.btn:hover:not(:disabled) {
  background: #3a3024;
  border-color: var(--accent);
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(180deg, #8a7020 0%, #6b5518 100%);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(180deg, #a08828 0%, #7a6218 100%);
}

.btn-secondary {
  background: var(--bg-card);
}

.btn-danger {
  background: linear-gradient(180deg, #a03028 0%, #802018 100%);
  border-color: var(--danger);
  color: #fff;
}

.btn-danger:hover:not(:disabled) {
  background: linear-gradient(180deg, #c03830 0%, #902820 100%);
}

.btn-small {
  padding: 6px 12px;
  font-size: 0.82rem;
}

/* --- Game Header --- */

.game-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 20px;
  background: linear-gradient(180deg, #2f261c 0%, #241c14 100%);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.header-left h1 {
  font-size: 1.2rem;
  color: var(--accent-light);
}

.village-name {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.world-badge {
  display: inline-block;
  margin-left: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  background: rgba(201, 162, 39, 0.15);
  color: var(--accent-light);
  border: 1px solid rgba(201, 162, 39, 0.35);
  vertical-align: middle;
}

.world-badge-dev {
  background: rgba(39, 174, 96, 0.12);
  color: #7dcea0;
  border-color: rgba(39, 174, 96, 0.35);
}

.resources-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  flex: 1;
  justify-content: center;
}

.resource-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.85rem;
  padding: 4px 10px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.resource-item .icon {
  font-size: 1rem;
}

.resource-item .amount {
  color: var(--text);
  font-weight: 600;
}

.resource-item .capacity {
  color: var(--text-muted);
  font-size: 0.78rem;
}

.resource-item .rate {
  color: var(--success);
  font-size: 0.78rem;
}

.resource-item .rate.rate-negative {
  color: var(--danger);
}

.food-upkeep-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 10px 12px;
  margin-bottom: 12px;
  border-radius: var(--radius);
  border: 1px solid rgba(201, 162, 39, 0.35);
  background: rgba(0, 0, 0, 0.22);
  font-size: 0.82rem;
  color: var(--text-muted);
}

.food-upkeep-banner strong {
  color: var(--text);
}

.food-upkeep-banner--warn {
  border-color: rgba(192, 57, 43, 0.55);
  background: rgba(192, 57, 43, 0.12);
}

.food-upkeep-cap-tag {
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(192, 57, 43, 0.25);
  color: #f5b7b1;
  font-size: 0.75rem;
  font-weight: 600;
}

/* --- Navigation --- */

.game-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 8px 16px;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}

.nav-btn {
  padding: 8px 14px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  position: relative;
}

.nav-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.nav-btn.active {
  background: rgba(201, 162, 39, 0.12);
  color: var(--accent-light);
  border-color: rgba(201, 162, 39, 0.3);
}

.nav-badge {
  display: inline-block;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  margin-left: 4px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}

/* --- Main / Panels --- */

.game-main {
  padding: 20px 24px 40px;
  max-width: 1400px;
  margin: 0 auto;
}

.game-main:has(#panel-map:not(.hidden)) {
  max-width: min(99vw, 1720px);
}

.panel h2 {
  color: var(--accent-light);
  font-size: 1.4rem;
  margin-bottom: 6px;
}

.panel-desc {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 20px;
  line-height: 1.55;
}

.panel-desc strong {
  color: var(--text);
}

/* --- Builders Bar --- */

.builders-bar {
  margin-bottom: 16px;
}

.builders-bar-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: rgba(201, 162, 39, 0.08);
  border: 1px solid rgba(201, 162, 39, 0.25);
  border-radius: var(--radius);
  font-size: 0.88rem;
}

.builders-bar-inner.builders-low {
  border-color: rgba(192, 57, 43, 0.4);
  background: rgba(192, 57, 43, 0.08);
}

.builders-detail {
  color: var(--text-muted);
  font-size: 0.82rem;
}

/* --- Cost Items --- */

.building-cost,
.field-tooltip-cost {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin-top: 8px;
}

.cost-item {
  font-size: 0.82rem;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.2);
}

.cost-item.insufficient {
  color: var(--danger);
  background: rgba(192, 57, 43, 0.15);
}

.cost-label {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

/* --- Upgrade Timers --- */

.upgrade-timer {
  font-size: 0.85rem;
  color: var(--accent-light);
  padding: 6px 10px;
  background: rgba(201, 162, 39, 0.08);
  border-radius: 6px;
  margin-top: 8px;
}

.timer-text {
  font-weight: 600;
}

/* --- Fields – grafische Kartenansicht --- */

.fields-grid {
  display: block;
}

.fields-map {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.fields-zone {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: visible;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
}

.fields-zone-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.fields-zone-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.fields-zone-title h3 {
  font-size: 1rem;
  color: var(--accent-light);
}

.fields-zone-icon {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid rgba(201, 162, 39, 0.25);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.fields-zone-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.fields-zone-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.fields-zone-stats {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  text-align: right;
}

.fields-zone-rate {
  color: var(--success);
  font-size: 0.85rem;
  font-weight: 600;
}

.fields-zone-influence {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.fields-zone-bonus {
  font-size: 0.72rem;
  color: var(--accent-light);
  background: rgba(201, 162, 39, 0.12);
  padding: 2px 6px;
  border-radius: 4px;
}

.fields-zone-wood { border-top: 3px solid #3d6b28; }
.fields-zone-stone { border-top: 3px solid #6a6a78; }
.fields-zone-clay { border-top: 3px solid #b5651d; }
.fields-zone-food { border-top: 3px solid #d4a017; }

.fields-slots {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding: 16px;
}

.field-tile {
  position: relative;
  border-radius: 12px;
  overflow: visible;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.field-tile:hover {
  transform: translateY(-3px);
  z-index: 10;
}

.field-tile-scene {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 -20px 30px rgba(0, 0, 0, 0.35);
}

.field-tile-scene-empty {
  background: rgba(0, 0, 0, 0.2);
  border-style: dashed;
}

.field-tile-ground {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(0, 0, 0, 0.45) 100%);
  pointer-events: none;
}

.field-tile-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -55%) scale(var(--field-icon-scale, 1));
  font-size: 2.2rem;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.5));
  z-index: 2;
  transition: transform 0.2s;
}

.field-tile:hover .field-tile-icon {
  transform: translate(-50%, -58%) scale(calc(var(--field-icon-scale, 1) * 1.08));
}

.field-tile-icon-plus {
  color: var(--accent-light);
  font-size: 2rem;
  opacity: 0.7;
}

.field-tile-icon-muted {
  opacity: 0.35;
}

.field-tile-fx {
  position: absolute;
  top: 6px;
  right: 6px;
  font-size: 1rem;
  z-index: 3;
  animation: field-fx-pulse 1.5s ease-in-out infinite;
}

@keyframes field-fx-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.1); }
}

.field-tile-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.65);
  color: var(--accent-light);
  border: 1px solid rgba(232, 197, 71, 0.3);
  z-index: 3;
}

.field-tile-badge-new {
  color: var(--success);
  border-color: rgba(39, 174, 96, 0.35);
}

.field-tile-label {
  display: block;
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 6px;
}

.field-tile-actions {
  margin-top: 8px;
}

.field-tile-actions .btn {
  width: 100%;
}

.field-upgrade-timer {
  font-size: 0.82rem;
  color: var(--accent-light);
}

.field-tile-countdown {
  position: relative;
  margin-top: 6px;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(201, 162, 39, 0.35);
  overflow: hidden;
  text-align: center;
}

.field-tile-countdown-bar {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: calc(var(--field-progress, 1) * 100%);
  background: linear-gradient(90deg, rgba(201, 162, 39, 0.15), rgba(201, 162, 39, 0.32));
  transition: width 1s linear;
  pointer-events: none;
}

.field-tile-countdown-text {
  position: relative;
  z-index: 1;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent-light);
  font-variant-numeric: tabular-nums;
}

.field-tile-countdown .timer-text {
  display: inline-block;
  min-width: 3.5ch;
}

.field-tooltip-timer {
  color: var(--accent-light);
  font-variant-numeric: tabular-nums;
}

.field-tile[data-type="wood"] .field-tile-scene:not(.field-tile-scene-empty) {
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.05) 0%, rgba(0, 0, 0, 0.55) 100%),
    url('assets/img/field-wood.png') center / cover no-repeat;
}

.field-tile[data-type="stone"] .field-tile-scene:not(.field-tile-scene-empty) {
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.05) 0%, rgba(0, 0, 0, 0.55) 100%),
    url('assets/img/field-stone.png') center / cover no-repeat;
}

.field-tile[data-type="clay"] .field-tile-scene:not(.field-tile-scene-empty) {
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.05) 0%, rgba(0, 0, 0, 0.55) 100%),
    url('assets/img/field-clay.png') center / cover no-repeat;
}

.field-tile[data-type="food"] .field-tile-scene:not(.field-tile-scene-empty) {
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.05) 0%, rgba(0, 0, 0, 0.55) 100%),
    url('assets/img/field-food.png') center / cover no-repeat;
}

.field-tile-scene-preview {
  opacity: 0.72;
  border-style: dashed;
}

.field-tile-building .field-tile-scene {
  opacity: 0.75;
  border-color: rgba(201, 162, 39, 0.4);
}

.field-tile-upgrading .field-tile-scene {
  border-color: rgba(201, 162, 39, 0.55);
  box-shadow: 0 0 12px rgba(201, 162, 39, 0.2);
}

.field-tile-new .field-tile-scene {
  border-color: rgba(39, 174, 96, 0.35);
}

.field-tile-new:hover .field-tile-scene {
  border-color: var(--success);
  background: rgba(39, 174, 96, 0.08);
}

.field-tile-locked {
  opacity: 0.5;
  cursor: not-allowed;
}

.field-tile-locked:hover {
  transform: none;
}

.field-tile-lv1 .field-tile-icon { font-size: 1.6rem; }
.field-tile-lv2 .field-tile-icon { font-size: 1.75rem; }
.field-tile-lv3 .field-tile-icon { font-size: 1.9rem; }
.field-tile-lv4 .field-tile-icon { font-size: 2rem; }
.field-tile-lv5 .field-tile-icon { font-size: 2.1rem; }
.field-tile-lv6 .field-tile-icon { font-size: 2.2rem; }
.field-tile-lv7 .field-tile-icon { font-size: 2.35rem; }
.field-tile-lv8 .field-tile-icon { font-size: 2.5rem; }
.field-tile-lv9 .field-tile-icon { font-size: 2.65rem; }
.field-tile-lv10 .field-tile-icon { font-size: 2.8rem; }

.field-tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  width: max-content;
  max-width: 240px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
  z-index: 100;
  pointer-events: none;
}

.field-tooltip-inner {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: 0.82rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  text-align: left;
}

.field-tooltip-row {
  margin-bottom: 3px;
  color: var(--text-muted);
}

.field-tooltip-row:first-child {
  color: var(--text);
  font-weight: 600;
}

.field-tooltip-warn {
  color: var(--danger);
  font-size: 0.78rem;
}

.field-tooltip-arrow {
  display: block;
  width: 10px;
  height: 10px;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  transform: rotate(45deg);
  margin: -5px auto 0;
}

.field-tile:hover .field-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.fields-slots .field-tile:first-child .field-tooltip {
  left: 0;
  transform: translateX(0) translateY(8px);
}

.fields-slots .field-tile:first-child:hover .field-tooltip {
  transform: translateX(0) translateY(0);
}

.fields-slots .field-tile:first-child .field-tooltip-arrow {
  margin-left: 24px;
}

.fields-slots .field-tile:last-child .field-tooltip {
  left: auto;
  right: 0;
  transform: translateX(0) translateY(8px);
}

.fields-slots .field-tile:last-child:hover .field-tooltip {
  transform: translateX(0) translateY(0);
}

.fields-slots .field-tile:last-child .field-tooltip-arrow {
  margin-right: 24px;
  margin-left: auto;
}

/* --- Buildings --- */

.buildings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.building-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 16px 16px;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.building-art {
  height: 120px;
  margin: 0 -16px 14px;
  background-size: cover;
  background-position: center;
  border-bottom: 2px solid rgba(201, 162, 39, 0.25);
}

.building-art-default {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, #2a2218, #1a1410);
}

.building-art-default img {
  width: 64px;
  height: 64px;
  opacity: 0.85;
}

.building-card:hover:not(.locked) {
  border-color: rgba(201, 162, 39, 0.35);
}

.building-card.locked {
  opacity: 0.55;
}

.building-card.building-highlight {
  border-color: var(--accent);
  box-shadow: 0 0 16px rgba(201, 162, 39, 0.15);
}

.building-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.building-header .icon {
  font-size: 1.6rem;
}

.building-header h3 {
  flex: 1;
  font-size: 1rem;
  color: var(--accent-light);
}

.building-level {
  font-size: 0.78rem;
  color: var(--text-muted);
  padding: 2px 8px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}

.building-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.building-influence {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.building-actions {
  margin-top: 12px;
}

.building-actions .btn {
  width: 100%;
}

/* --- Barracks / Meisterei / Schmied / Championhalle --- */

.barracks-locked,
.barracks-building {
  max-width: 520px;
}

.barracks-status-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
}

.barracks-status-card .unit-icon {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 12px;
}

.barracks-status-card h3 {
  color: var(--accent-light);
  margin-bottom: 10px;
}

.barracks-status-card p {
  color: var(--text-muted);
  margin-bottom: 12px;
  font-size: 0.9rem;
}

.barracks-build-cost {
  margin: 12px 0;
}

.barracks-req {
  color: var(--danger);
  font-size: 0.85rem;
  margin: 8px 0;
}

.barracks-units-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

/* --- Kaserne: Ausbildungs-Animation --- */

.barracks-training-scene {
  margin-bottom: 20px;
  border: 2px solid rgba(201, 162, 39, 0.35);
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(180deg, #2a2218 0%, #1a1410 100%);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
}

.bts-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px 10px;
  border-bottom: 1px solid rgba(201, 162, 39, 0.2);
  background: rgba(0, 0, 0, 0.25);
}

.bts-header-text h3 {
  font-family: 'Cinzel', serif;
  font-size: 1rem;
  color: var(--accent-light);
  margin-bottom: 4px;
}

.bts-subtitle {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
  max-width: 520px;
}

.bts-kaserne-badge {
  flex-shrink: 0;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-light);
  border: 1px solid rgba(201, 162, 39, 0.4);
  background: rgba(201, 162, 39, 0.1);
}

.bts-stage {
  position: relative;
  height: 200px;
  overflow: hidden;
}

.bts-sky {
  position: absolute;
  inset: 0 0 55%;
  background: linear-gradient(180deg, #3a4a5a 0%, #5a7080 45%, #7a9098 100%);
}

.bts-sky::after {
  content: '';
  position: absolute;
  top: 18%;
  right: 12%;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: radial-gradient(circle, #ffeaa0 0%, rgba(255, 234, 160, 0.2) 70%);
  box-shadow: 0 0 24px rgba(255, 234, 160, 0.35);
  animation: bts-sun-glow 4s ease-in-out infinite;
}

@keyframes bts-sun-glow {
  0%, 100% { opacity: 0.85; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.05); }
}

.bts-ground {
  position: absolute;
  inset: 45% 0 0;
  background: linear-gradient(180deg, #4a6b38 0%, #3d5a2e 40%, #2d4524 100%);
}

.bts-barracks-building {
  position: absolute;
  left: 50%;
  bottom: 8px;
  transform: translateX(-50%);
  width: 88px;
  height: 72px;
  z-index: 2;
}

.bts-roof {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 48px solid transparent;
  border-right: 48px solid transparent;
  border-bottom: 28px solid #5a4030;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
}

.bts-walls {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 72px;
  height: 48px;
  background: linear-gradient(180deg, #6b5638 0%, #4a3828 100%);
  border: 2px solid #3a2818;
  border-radius: 2px 2px 0 0;
}

.bts-door {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 22px;
  height: 28px;
  background: #2a2018;
  border: 2px solid #1a1008;
  border-radius: 2px 2px 0 0;
}

.bts-flag {
  position: absolute;
  top: 8px;
  right: -8px;
  width: 3px;
  height: 36px;
  background: #4a3828;
  transform-origin: bottom center;
  animation: bts-flag-wave 2.5s ease-in-out infinite;
}

.bts-flag::after {
  content: '';
  position: absolute;
  top: 0;
  left: 3px;
  width: 18px;
  height: 12px;
  background: linear-gradient(90deg, #c0392b 0%, #922b21 100%);
  border-radius: 0 2px 2px 0;
  animation: bts-banner-wave 2.5s ease-in-out infinite;
}

@keyframes bts-flag-wave {
  0%, 100% { transform: rotate(-2deg); }
  50% { transform: rotate(3deg); }
}

@keyframes bts-banner-wave {
  0%, 100% { transform: skewY(-3deg); }
  50% { transform: skewY(4deg); }
}

.bts-track {
  position: absolute;
  inset: 8px 12px 10px;
  display: grid;
  grid-template-columns: 1fr 1.2fr 1fr;
  gap: 8px;
  z-index: 3;
}

.bts-zone {
  position: relative;
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.2);
  padding: 6px 8px;
  overflow: hidden;
}

.bts-zone-label {
  display: block;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(232, 197, 71, 0.65);
  margin-bottom: 6px;
}

.bts-recruits {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 52px;
  padding-top: 8px;
}

.bts-recruit {
  font-size: 1.4rem;
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

.bts-recruit.bts-walk {
  animation: bts-recruit-walk 2.8s ease-in-out infinite;
}

.bts-recruit.bts-idle-stand {
  opacity: 0.45;
  animation: bts-idle-bob 3s ease-in-out infinite;
}

@keyframes bts-recruit-walk {
  0% { transform: translateX(-8px) translateY(0); opacity: 0.5; }
  25% { transform: translateX(4px) translateY(-3px); opacity: 1; }
  50% { transform: translateX(14px) translateY(0); opacity: 1; }
  75% { transform: translateX(4px) translateY(-2px); opacity: 0.8; }
  100% { transform: translateX(-8px) translateY(0); opacity: 0.5; }
}

@keyframes bts-idle-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.bts-drill-pit {
  position: relative;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bts-drill-ring {
  position: absolute;
  width: 56px;
  height: 56px;
  border: 2px dashed rgba(201, 162, 39, 0.35);
  border-radius: 50%;
  animation: bts-ring-spin 8s linear infinite;
}

.barracks-training-scene.is-idle .bts-drill-ring {
  animation: none;
  opacity: 0.25;
}

@keyframes bts-ring-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.bts-drill-units {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  z-index: 1;
}

.bts-drill-unit {
  font-size: 1.5rem;
  line-height: 1;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.55));
}

.bts-drill-placeholder {
  font-size: 1.6rem;
  opacity: 0.25;
  animation: bts-idle-bob 3s ease-in-out infinite;
}

.bts-drill-sammler { animation: bts-drill-pack 1.2s ease-in-out infinite; }
.bts-drill-spaeher { animation: bts-drill-sneak 1.6s ease-in-out infinite; }
.bts-drill-schwertkaempfer { animation: bts-drill-parry 1s ease-in-out infinite; }
.bts-drill-axtkaempfer { animation: bts-drill-chop 0.9s ease-in-out infinite; }

@keyframes bts-drill-pack {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-6px) scale(1.08); }
}

@keyframes bts-drill-sneak {
  0%, 100% { transform: translateX(-4px) scale(0.95); opacity: 0.85; }
  50% { transform: translateX(4px) scale(1); opacity: 1; }
}

@keyframes bts-drill-parry {
  0%, 100% { transform: rotate(-8deg) translateX(-2px); }
  50% { transform: rotate(12deg) translateX(3px); }
}

@keyframes bts-drill-chop {
  0%, 100% { transform: rotate(0deg) translateY(0); }
  40% { transform: rotate(-18deg) translateY(-4px); }
  60% { transform: rotate(8deg) translateY(2px); }
}

.bts-ready-line {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 4px;
  height: 52px;
  padding-top: 8px;
}

.bts-ready-unit {
  font-size: 1.25rem;
  animation: bts-ready-march 2.2s ease-in-out infinite;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.45));
}

.bts-ready-unit:nth-child(2) { animation-delay: 0.3s; }
.bts-ready-unit:nth-child(3) { animation-delay: 0.6s; }

@keyframes bts-ready-march {
  0%, 100% { transform: translateX(0) translateY(0); }
  50% { transform: translateX(6px) translateY(-2px); }
}

.bts-ready-empty {
  color: rgba(255, 255, 255, 0.2);
  font-size: 1.2rem;
  line-height: 52px;
}

.bts-dust {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 20px;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.15));
  pointer-events: none;
}

.barracks-training-scene.is-training .bts-dust::before,
.barracks-training-scene.is-training .bts-dust::after {
  content: '💨';
  position: absolute;
  bottom: 4px;
  font-size: 0.9rem;
  opacity: 0;
  animation: bts-dust-puff 2s ease-out infinite;
}

.barracks-training-scene.is-training .bts-dust::before { left: 28%; }
.barracks-training-scene.is-training .bts-dust::after { left: 58%; animation-delay: 1s; }

@keyframes bts-dust-puff {
  0% { opacity: 0; transform: translateY(0) scale(0.6); }
  30% { opacity: 0.7; }
  100% { opacity: 0; transform: translateY(-16px) scale(1.2); }
}

.bts-footer {
  padding: 12px 18px 14px;
  border-top: 1px solid rgba(201, 162, 39, 0.15);
  background: rgba(0, 0, 0, 0.3);
}

.bts-progress-wrap {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  margin-bottom: 8px;
  opacity: 0.4;
  transition: opacity 0.3s;
}

.bts-progress-wrap.active {
  opacity: 1;
}

.bts-progress-bar {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #8a7020 0%, #e8c547 60%, #ffe680 100%);
  transition: width 0.8s linear;
  box-shadow: 0 0 8px rgba(232, 197, 71, 0.45);
}

.bts-status-text {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.barracks-training-scene.is-training .bts-status-text {
  color: var(--accent-light);
}

.barracks-training-scene.is-training .bts-zone-train {
  border-color: rgba(201, 162, 39, 0.45);
  background: rgba(201, 162, 39, 0.08);
  box-shadow: inset 0 0 16px rgba(201, 162, 39, 0.12);
}

@media (max-width: 720px) {
  .bts-stage { height: 180px; }
  .bts-track { grid-template-columns: 1fr; gap: 6px; inset: 6px 8px 8px; }
  .bts-zone { padding: 4px 6px; }
  .bts-recruits, .bts-ready-line { height: 36px; }
  .bts-drill-pit { height: 40px; }
  .bts-drill-ring { width: 40px; height: 40px; }
}

.barracks-building-scene {
  position: relative;
  overflow: hidden;
}

.bts-building-preview {
  position: relative;
  height: 100px;
  margin: -8px -8px 12px;
  background: linear-gradient(180deg, #4a6080 0%, #3d5a2e 100%);
  border-radius: 8px 8px 0 0;
}

.bts-building-crane {
  position: absolute;
  top: 12px;
  right: 20%;
  font-size: 1.6rem;
  animation: bts-crane-swing 3s ease-in-out infinite;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.5));
}

@keyframes bts-crane-swing {
  0%, 100% { transform: rotate(-5deg) translateY(0); }
  50% { transform: rotate(8deg) translateY(3px); }
}

.bts-building-frame {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 88px;
  height: 72px;
}

.bts-roof-build {
  animation: bts-roof-build 2.5s ease-in-out infinite;
  opacity: 0.7;
}

.bts-walls-build {
  animation: bts-walls-build 2.5s ease-in-out infinite;
}

@keyframes bts-roof-build {
  0%, 100% { transform: translateX(-50%) translateY(-4px); opacity: 0.5; }
  50% { transform: translateX(-50%) translateY(0); opacity: 1; }
}

@keyframes bts-walls-build {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; box-shadow: 0 0 12px rgba(201, 162, 39, 0.2); }
}

.bts-build-dust {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 8px;
  background: radial-gradient(ellipse, rgba(255, 255, 255, 0.15) 0%, transparent 70%);
  animation: bts-build-dust 2s ease-out infinite;
}

@keyframes bts-build-dust {
  0% { opacity: 0.3; transform: translateX(-50%) scaleX(0.8); }
  50% { opacity: 0.8; transform: translateX(-50%) scaleX(1.2); }
  100% { opacity: 0.3; transform: translateX(-50%) scaleX(0.8); }
}

.unit-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.unit-card-compact {
  padding: 14px;
}

.unit-card-locked {
  opacity: 0.55;
}

.unit-header {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 10px;
}

.unit-icon {
  font-size: 1.8rem;
  line-height: 1;
}

.unit-header h3 {
  font-size: 0.95rem;
  color: var(--accent-light);
  margin-bottom: 2px;
}

.unit-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.unit-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.unit-role-tag {
  font-size: 0.72rem;
  padding: 1px 6px;
  border-radius: 4px;
}

.unit-role-tag.defense {
  color: #7dcea0;
  background: rgba(39, 174, 96, 0.12);
}

.unit-role-tag.offense {
  color: #e8a0a0;
  background: rgba(192, 57, 43, 0.12);
}

.unit-counts {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.unit-train-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.train-input {
  width: 64px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  color: var(--text);
  font-family: inherit;
  text-align: center;
}

.train-queue-compact {
  font-size: 0.82rem;
  color: var(--text-muted);
  padding: 8px 10px;
  background: rgba(201, 162, 39, 0.08);
  border-radius: 6px;
  margin-top: 8px;
}

.train-queue-compact strong {
  color: var(--accent-light);
}

.gather-hint {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin: 8px 0;
}

.gather-unavailable {
  font-size: 0.82rem;
  color: var(--danger);
  margin: 8px 0;
}

/* --- Schmied / Research --- */

.schmied-summary {
  margin-bottom: 20px;
}

.schmied-summary-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  align-items: center;
  padding: 14px 16px;
  background: linear-gradient(135deg, rgba(201, 162, 39, 0.12), rgba(42, 34, 24, 0.5));
  border: 1px solid rgba(201, 162, 39, 0.35);
  border-radius: var(--radius);
}

.schmied-summary-hint {
  color: var(--text-muted);
  font-size: 0.82rem;
  width: 100%;
}

.schmied-research-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.research-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.research-card-active {
  border-color: rgba(201, 162, 39, 0.45);
  box-shadow: 0 0 12px rgba(201, 162, 39, 0.1);
}

.research-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.research-card-header h3 {
  flex: 1;
  font-size: 0.95rem;
  color: var(--accent-light);
}

.research-tier-badge {
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(201, 162, 39, 0.15);
  color: var(--accent-light);
  border: 1px solid rgba(201, 162, 39, 0.3);
}

.research-tier-badge.inline {
  display: inline-block;
  margin-left: 4px;
}

.research-tier-badge.muted {
  opacity: 0.6;
}

.research-stats {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 8px 0;
}

.research-active {
  margin-top: 10px;
}

.research-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 6px;
}

.research-maxed {
  color: var(--success);
  font-size: 0.85rem;
  margin-top: 8px;
}

.research-next {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.research-next-title {
  font-size: 0.85rem;
  color: var(--accent-light);
  margin-bottom: 8px;
}

.research-timer {
  margin-top: 8px;
}

/* --- Rally / Treffpunkt --- */

.rally-summary {
  margin-bottom: 20px;
}

.rally-summary-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}

.rally-stat {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.rally-stat-num {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-light);
  font-family: 'Cinzel', serif;
}

.rally-stat span:last-child {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.rally-movements {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rally-card,
.mission-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-left-width: 4px;
  border-radius: var(--radius);
  padding: 14px 16px;
}

.mission-ongoing {
  border-left-color: var(--success) !important;
}

.rally-card-top {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 8px;
}

.rally-type-icon {
  font-size: 1.3rem;
}

.rally-card-main {
  flex: 1;
}

.rally-card-main strong {
  display: block;
  color: var(--text);
  font-size: 0.9rem;
}

.rally-route {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.mission-status {
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(201, 162, 39, 0.12);
  color: var(--accent-light);
  white-space: nowrap;
}

.rally-card-bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: center;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.rally-timer {
  color: var(--accent-light);
}

.rally-detail {
  font-size: 0.82rem;
  margin-top: 4px;
}

.rally-win { color: var(--success); }
.rally-loss { color: var(--danger); }
.rally-loot { color: var(--accent-light); }

.rally-goto {
  margin-top: 6px;
}

.rally-empty {
  text-align: center;
  padding: 40px 24px;
  background: var(--bg-panel);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

.rally-empty-icon {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 12px;
}

.combat-reports-section {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.combat-reports-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.combat-reports-header h3 {
  font-size: 1rem;
  color: var(--accent-light);
}

.combat-reports-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.combat-report-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}

.combat-report-card.report-win {
  border-left: 3px solid var(--success);
}

.combat-report-card.report-loss {
  border-left: 3px solid var(--danger);
}

.combat-report-card.report-unread {
  background: rgba(201, 162, 39, 0.06);
  border-color: rgba(201, 162, 39, 0.25);
}

.report-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.report-result {
  font-weight: 600;
  font-size: 0.9rem;
}

.report-win .report-result { color: var(--success); }
.report-loss .report-result { color: var(--danger); }

.report-time {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.report-card-body {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.report-loot {
  font-size: 0.82rem;
  color: var(--accent-light);
  margin-bottom: 8px;
}

.report-loot-lost {
  color: var(--danger);
}

.report-goto {
  margin-top: 4px;
}

.combat-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 14px 20px;
  background: var(--bg-card);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  z-index: 9999;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
  max-width: 360px;
}

.combat-toast.visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- Map --- */

.map-header {
  margin-bottom: 16px;
}

.map-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 20px;
  align-items: start;
}

.map-stage {
  background:
    linear-gradient(180deg, #3a3024 0%, #241c14 55%, #1a1410 100%);
  border: 2px solid #6b5638;
  border-radius: 14px;
  overflow: hidden;
  box-shadow:
    0 12px 48px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    inset 0 -1px 0 rgba(0, 0, 0, 0.35);
}

.map-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.35) 0%, rgba(0, 0, 0, 0.2) 100%),
    repeating-linear-gradient(90deg, transparent, transparent 18px, rgba(201, 162, 39, 0.03) 18px, rgba(201, 162, 39, 0.03) 19px);
  border-bottom: 1px solid rgba(201, 162, 39, 0.22);
  flex-wrap: wrap;
}

.map-toolbar-group {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.map-dpad {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.map-dpad-row {
  display: flex;
  gap: 3px;
}

.map-arrow {
  width: 42px;
  height: 42px;
  border: 1px solid #6b5638;
  border-radius: 10px;
  background: linear-gradient(180deg, #4a3d2c 0%, #2e251a 100%);
  color: var(--text);
  cursor: pointer;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.12s, box-shadow 0.15s;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.map-arrow:hover {
  background: linear-gradient(180deg, #5c4a34 0%, #3a3024 100%);
  border-color: var(--accent);
  color: var(--accent-light);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4), 0 0 12px rgba(201, 162, 39, 0.15);
}

.map-arrow-home {
  font-size: 1.2rem;
  color: var(--accent-light);
  border-color: rgba(232, 197, 71, 0.45);
  background: linear-gradient(180deg, #5a4820 0%, #3a3018 100%);
}

.map-zoom {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 10px;
  border: 1px solid rgba(201, 162, 39, 0.25);
  background: rgba(0, 0, 0, 0.28);
}

.map-zoom-btn {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-panel);
  color: var(--text);
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.map-zoom-btn:hover {
  border-color: var(--accent);
  color: var(--accent-light);
  background: rgba(201, 162, 39, 0.12);
}

.map-zoom-label {
  min-width: 44px;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent-light);
  font-family: monospace;
}

.map-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.map-coords {
  color: var(--accent-light);
  font-size: 0.95rem;
  font-family: 'Source Sans 3', monospace;
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 6px 12px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(201, 162, 39, 0.28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.map-hint {
  color: var(--text-muted);
  font-size: 0.72rem;
}

.map-container {
  padding: 16px 20px 24px;
  overflow: auto;
  max-height: calc(100vh - 240px);
  min-height: 520px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  background:
    radial-gradient(ellipse 80% 60% at 50% 45%, rgba(201, 162, 39, 0.09) 0%, transparent 65%),
    radial-gradient(circle at 15% 85%, rgba(42, 106, 154, 0.07) 0%, transparent 45%),
    radial-gradient(circle at 85% 20%, rgba(80, 50, 20, 0.08) 0%, transparent 40%),
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 28px,
      rgba(0, 0, 0, 0.025) 28px,
      rgba(0, 0, 0, 0.025) 29px
    ),
    #16120e;
}

.map-scene {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 20px;
  flex-wrap: nowrap;
  width: fit-content;
  max-width: 100%;
}

.map-frame-ornate {
  position: relative;
  flex-shrink: 0;
  padding: 22px 24px 24px;
  border: 3px solid #7a6238;
  border-radius: 14px;
  background:
    linear-gradient(145deg, #3d3226 0%, #2a2218 35%, #1a1410 100%);
  box-shadow:
    inset 0 0 0 1px rgba(232, 197, 71, 0.18),
    inset 0 2px 24px rgba(0, 0, 0, 0.45),
    0 16px 48px rgba(0, 0, 0, 0.55);
}

.map-frame-corner {
  position: absolute;
  width: 28px;
  height: 28px;
  border: 2px solid rgba(232, 197, 71, 0.55);
  pointer-events: none;
  z-index: 3;
}

.map-frame-corner-nw { top: 8px; left: 8px; border-right: none; border-bottom: none; border-radius: 6px 0 0 0; }
.map-frame-corner-ne { top: 8px; right: 8px; border-left: none; border-bottom: none; border-radius: 0 6px 0 0; }
.map-frame-corner-sw { bottom: 8px; left: 8px; border-right: none; border-top: none; border-radius: 0 0 0 6px; }
.map-frame-corner-se { bottom: 8px; right: 8px; border-left: none; border-top: none; border-radius: 0 0 6px 0; }

.map-compass {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 52px;
  height: 52px;
  z-index: 4;
  pointer-events: none;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.5));
}

.map-compass-svg {
  width: 100%;
  height: 100%;
}

.map-frame-label {
  position: absolute;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: rgba(232, 197, 71, 0.55);
  pointer-events: none;
  z-index: 2;
  font-family: 'Cinzel', serif;
}

.map-frame-label-n { top: 6px; left: 50%; transform: translateX(-50%); }
.map-frame-label-s { bottom: 6px; left: 50%; transform: translateX(-50%); }
.map-frame-label-w { left: 8px; top: 50%; transform: translateY(-50%) rotate(-90deg); }
.map-frame-label-e { right: 8px; top: 50%; transform: translateY(-50%) rotate(90deg); }

.map-frame-inner {
  position: relative;
  padding: 6px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.35);
  box-shadow: inset 0 2px 16px rgba(0, 0, 0, 0.45);
  width: fit-content;
}

.map-vignette {
  position: absolute;
  inset: 0;
  border-radius: 8px;
  pointer-events: none;
  z-index: 2;
  box-shadow: inset 0 0 32px rgba(0, 0, 0, 0.25);
}

.map-center-marker {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  border: 2px solid rgba(232, 197, 71, 0.35);
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
  box-shadow: 0 0 8px rgba(232, 197, 71, 0.2);
}

.map-center-marker::before,
.map-center-marker::after {
  content: '';
  position: absolute;
  background: rgba(232, 197, 71, 0.25);
}

.map-center-marker::before {
  top: 50%;
  left: -6px;
  right: -6px;
  height: 1px;
  margin-top: -0.5px;
}

.map-center-marker::after {
  left: 50%;
  top: -6px;
  bottom: -6px;
  width: 1px;
  margin-left: -0.5px;
}

.map-minimap-panel {
  flex-shrink: 0;
  width: 248px;
  padding: 14px;
  border-radius: 12px;
  border: 2px solid rgba(201, 162, 39, 0.28);
  background: linear-gradient(180deg, rgba(36, 28, 20, 0.95) 0%, rgba(26, 20, 16, 0.98) 100%);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.map-minimap-title {
  font-family: 'Cinzel', serif;
  font-size: 0.82rem;
  color: var(--accent-light);
  margin-bottom: 10px;
  letter-spacing: 0.06em;
}

.map-minimap-wrap {
  padding: 4px;
  border-radius: 8px;
  background: #0e0c0a;
  border: 1px solid rgba(201, 162, 39, 0.2);
  box-shadow: inset 0 2px 12px rgba(0, 0, 0, 0.6);
}

.map-minimap-wrap canvas {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 4px;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.map-minimap-hint {
  margin-top: 10px;
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.map-minimap-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  vertical-align: -1px;
  margin-right: 2px;
}

.map-minimap-dot.own {
  background: #e8c547;
  box-shadow: 0 0 6px rgba(232, 197, 71, 0.5);
}

.map-minimap-dot.view {
  background: transparent;
  border: 1.5px solid rgba(232, 197, 71, 0.75);
  width: 7px;
  height: 7px;
}

.map-grid-placeholder {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 280px;
  min-width: 280px;
  padding: 2rem;
  color: var(--text-muted);
  font-size: 0.95rem;
  text-align: center;
}

.map-grid-placeholder p {
  margin: 0;
}

.map-grid {
  display: grid;
  gap: 2px;
  width: fit-content;
  user-select: none;
  background:
    linear-gradient(180deg, rgba(20, 16, 12, 0.9) 0%, rgba(10, 8, 6, 0.95) 100%);
  padding: 4px;
  border-radius: 6px;
  box-shadow:
    inset 0 2px 16px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(201, 162, 39, 0.08);
  position: relative;
  z-index: 1;
}

.map-tile {
  width: var(--map-tile-size, 48px);
  height: var(--map-tile-size, 48px);
  cursor: pointer;
  position: relative;
  border-radius: 4px;
  transition: transform 0.14s ease, box-shadow 0.14s ease, z-index 0s;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.35);
}

.map-tile::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(155deg, var(--tile-light) 0%, var(--tile-dark) 100%);
  transition: filter 0.14s;
}

.map-tile.tile-parity-even::before {
  filter: brightness(1.05);
}

.map-tile::after {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.28;
  background-image:
    radial-gradient(circle at 28% 22%, rgba(255, 255, 255, 0.5) 0%, transparent 45%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, transparent 50%);
  pointer-events: none;
}

.map-tile.terrain-forest::before {
  background:
    linear-gradient(155deg, rgba(20, 42, 22, 0.5) 0%, rgba(0, 0, 0, 0.6) 100%),
    url('assets/img/field-wood.png') center / cover no-repeat;
}

.map-tile.terrain-hills::before {
  background:
    linear-gradient(160deg, rgba(40, 40, 48, 0.5) 0%, rgba(0, 0, 0, 0.6) 100%),
    url('assets/img/field-stone.png') center / cover no-repeat;
}

.map-tile.terrain-clay::before {
  background:
    linear-gradient(150deg, rgba(90, 56, 16, 0.5) 0%, rgba(0, 0, 0, 0.6) 100%),
    url('assets/img/field-clay.png') center / cover no-repeat;
}

.map-tile.terrain-fertile::before {
  background:
    linear-gradient(150deg, rgba(61, 90, 24, 0.45) 0%, rgba(0, 0, 0, 0.6) 100%),
    url('assets/img/field-food.png') center / cover no-repeat;
}

.map-tile.terrain-lake::before {
  background:
    linear-gradient(180deg, #5ab8e8 0%, var(--tile-light) 40%, var(--tile-dark) 100%);
  animation: map-lake-shimmer 5s ease-in-out infinite;
}

@keyframes map-lake-shimmer {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.12); }
}

.map-tile.terrain-mountain::before {
  background:
    repeating-linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.06) 0,
      rgba(255, 255, 255, 0.06) 2px,
      transparent 2px,
      transparent 6px
    ),
    linear-gradient(165deg, #7a7a88 0%, var(--tile-dark) 45%, #2a2a32 100%);
}

.map-tile.terrain-wilderness::before,
.map-tile.terrain-grassland::before {
  background:
    radial-gradient(circle at 20% 30%, rgba(120, 160, 80, 0.25) 0%, transparent 35%),
    radial-gradient(circle at 75% 70%, rgba(90, 130, 60, 0.2) 0%, transparent 30%),
    linear-gradient(155deg, var(--tile-light) 0%, var(--tile-dark) 70%, #2d4524 100%);
}

.map-tile.resource-field {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.map-tile.terrain-forest.resource-field { box-shadow: inset 0 0 0 2px rgba(107, 140, 66, 0.55); }
.map-tile.terrain-hills.resource-field { box-shadow: inset 0 0 0 2px rgba(180, 180, 180, 0.4); }
.map-tile.terrain-clay.resource-field { box-shadow: inset 0 0 0 2px rgba(181, 101, 29, 0.55); }
.map-tile.terrain-fertile.resource-field { box-shadow: inset 0 0 0 2px rgba(212, 160, 23, 0.5); }

.map-tile.settlement-field::before {
  box-shadow: inset 0 0 12px rgba(201, 162, 39, 0.15);
}

.map-tile.has-zombies::before {
  box-shadow: inset 0 0 16px rgba(192, 57, 43, 0.35);
}

.map-tile.has-zombies {
  animation: zombie-camp-pulse 3s ease-in-out infinite;
}

@keyframes zombie-camp-pulse {
  0%, 100% { box-shadow: inset 0 0 0 1px rgba(192, 57, 43, 0.35); }
  50% { box-shadow: inset 0 0 0 2px rgba(192, 57, 43, 0.55), 0 0 8px rgba(192, 57, 43, 0.2); }
}

.map-tile.gather-active::before { filter: brightness(1.1); }
.map-tile.gather-own { box-shadow: inset 0 0 0 2px rgba(46, 204, 113, 0.45); }
.map-tile.gather-enemy { box-shadow: inset 0 0 0 2px rgba(192, 57, 43, 0.45); }
.map-tile.gather-collecting { animation: gather-pulse 2s ease-in-out infinite; }

@keyframes gather-pulse {
  0%, 100% { box-shadow: inset 0 0 0 1px rgba(46, 204, 113, 0.35); }
  50% { box-shadow: inset 0 0 0 2px rgba(46, 204, 113, 0.6); }
}

.map-tile .tile-terrain-icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.32);
  pointer-events: none;
  transition: opacity 0.14s;
}

.map-tile .tile-terrain-icon svg {
  width: calc(var(--map-tile-size, 48px) * 0.42);
  height: calc(var(--map-tile-size, 48px) * 0.42);
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.45));
}

.map-tile .tile-village-icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 2;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.7));
}

.map-tile .tile-village-icon svg {
  width: calc(var(--map-tile-size, 48px) * 0.52);
  height: calc(var(--map-tile-size, 48px) * 0.52);
}

.map-tile .tile-village-icon.own svg { color: #e8c547; }
.map-tile .tile-village-icon.other svg { color: #d4c4a8; }

.map-tile .tile-marker {
  position: absolute;
  z-index: 3;
  font-size: calc(var(--map-tile-size, 48px) * 0.28);
  line-height: 1;
  pointer-events: none;
  padding: 2px 3px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.55);
}

.map-tile .tile-marker-zombie { top: 2px; left: 2px; }
.map-tile .tile-marker-gather { top: 2px; right: 2px; }

.map-tile .tile-marker-gather.own {
  border-color: rgba(46, 204, 113, 0.55);
  background: rgba(20, 60, 35, 0.8);
}

.map-tile .tile-marker-gather.enemy {
  border-color: rgba(192, 57, 43, 0.55);
  background: rgba(60, 20, 18, 0.8);
}

.map-tile .tile-marker-horde {
  bottom: 2px;
  left: 2px;
  border-color: rgba(160, 60, 220, 0.6);
  background: rgba(40, 15, 55, 0.85);
}

.map-tile .tile-coords {
  position: absolute;
  bottom: 3px;
  right: 3px;
  font-size: max(8px, calc(var(--map-tile-size, 48px) * 0.2));
  color: rgba(255, 255, 255, 0.55);
  line-height: 1;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.14s;
  font-family: monospace;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
  z-index: 4;
}

.map-tile:hover {
  transform: scale(1.1);
  z-index: 5;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.3), 0 8px 20px rgba(0, 0, 0, 0.6);
}

.map-tile:hover::before { filter: brightness(1.2); }
.map-tile:hover .tile-terrain-icon { opacity: 0.6; color: rgba(255, 255, 255, 0.55); }
.map-tile:hover .tile-coords { opacity: 1; }

.map-tile.selected {
  z-index: 10;
  transform: scale(1.08);
  overflow: visible;
  box-shadow:
    0 0 0 2px var(--accent-light),
    0 0 0 4px #14100c,
    0 0 0 5px var(--accent),
    0 0 28px rgba(232, 197, 71, 0.8),
    0 8px 22px rgba(0, 0, 0, 0.6);
}

.map-tile.selected::after {
  inset: 2px;
  opacity: 1;
  background: none;
  background-image: none;
  border: 2px solid rgba(255, 248, 220, 0.92);
  border-radius: 3px;
  box-shadow: inset 0 0 12px rgba(232, 197, 71, 0.4);
  z-index: 4;
}

.map-tile.selected::before { filter: brightness(1.25); }
.map-tile.selected .tile-terrain-icon { opacity: 0.65; }
.map-tile.selected .tile-coords { opacity: 1; color: rgba(255, 248, 220, 0.95); }

.map-tile.selected:hover {
  transform: scale(1.12);
  box-shadow:
    0 0 0 2px #fff6d0,
    0 0 0 4px #14100c,
    0 0 0 6px var(--accent-light),
    0 0 32px rgba(232, 197, 71, 0.9),
    0 8px 24px rgba(0, 0, 0, 0.65);
}

.map-tile.selected.gather-collecting {
  animation: none;
}

.map-tile.selected.gather-own,
.map-tile.selected.gather-enemy,
.map-tile.selected.resource-field {
  box-shadow:
    0 0 0 2px var(--accent-light),
    0 0 0 4px #14100c,
    0 0 0 5px var(--accent),
    0 0 28px rgba(232, 197, 71, 0.8),
    0 8px 22px rgba(0, 0, 0, 0.6);
}

.map-tile.has-village::before { filter: brightness(0.88); }

.map-tile.own-village::before {
  background:
    radial-gradient(circle at 50% 40%, rgba(232, 197, 71, 0.25) 0%, transparent 55%),
    linear-gradient(145deg, #7a6828 0%, #4a4018 55%, #2a2410 100%);
}

.map-tile.own-village {
  box-shadow: inset 0 0 0 2px rgba(232, 197, 71, 0.6), 0 0 12px rgba(232, 197, 71, 0.18);
  animation: own-village-glow 3s ease-in-out infinite;
}

@keyframes own-village-glow {
  0%, 100% { box-shadow: inset 0 0 0 2px rgba(232, 197, 71, 0.55), 0 0 8px rgba(232, 197, 71, 0.12); }
  50% { box-shadow: inset 0 0 0 2px rgba(232, 197, 71, 0.8), 0 0 18px rgba(232, 197, 71, 0.32); }
}

.map-tile.own-village.selected {
  animation: none;
  box-shadow:
    0 0 0 2px #fff6d0,
    0 0 0 4px #14100c,
    0 0 0 5px var(--accent-light),
    0 0 32px rgba(232, 197, 71, 0.9),
    0 8px 24px rgba(0, 0, 0, 0.6);
}

.map-tile.unbuildable .tile-terrain-icon { opacity: 0.45; color: rgba(255, 255, 255, 0.25); }
.map-tile.unbuildable::before { filter: saturate(0.8) brightness(0.92); }

.map-tile.has-wandering-horde::before {
  box-shadow: inset 0 0 14px rgba(160, 60, 220, 0.25);
}

.map-sidebar {
  background: linear-gradient(180deg, #2f261c 0%, #241c14 100%);
  border: 1px solid #5a4a32;
  border-radius: 12px;
  padding: 16px;
  position: sticky;
  top: 16px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
}

.map-tile-info {
  background: var(--bg-card);
  border-radius: 10px;
  border: 1px solid var(--border);
  padding: 14px;
  margin-bottom: 14px;
  min-height: 120px;
}

.map-tile-info-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 10px;
  background: rgba(0, 0, 0, 0.15);
}

.map-tile-info-empty .tile-info-icon {
  font-size: 2rem;
  opacity: 0.35;
}

.map-tile-info .tile-header {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.map-tile-info .tile-header-icon {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.map-tile-info .tile-header-icon svg {
  width: 28px;
  height: 28px;
  color: rgba(255, 255, 255, 0.85);
}

.map-tile-info .tile-header-text h3 {
  font-family: 'Cinzel', serif;
  font-size: 1.05rem;
  color: var(--accent-light);
  margin-bottom: 2px;
}

.map-tile-info .tile-header-text .tile-coords-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-family: monospace;
}

.map-tile-info .tile-rows {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.map-tile-info .tile-row {
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.map-tile-info .tile-row strong { color: var(--text); }

.map-tile-info .tile-bonus {
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  background: rgba(39, 174, 96, 0.1);
  border: 1px solid rgba(39, 174, 96, 0.2);
  font-size: 0.82rem;
  color: var(--success);
}

.map-tile-info .tile-village-badge {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-radius: 8px;
  margin-top: 4px;
}

.map-tile-info .tile-village-badge.own {
  background: rgba(232, 197, 71, 0.1);
  border: 1px solid rgba(232, 197, 71, 0.25);
}

.map-tile-info .tile-village-badge.other {
  background: rgba(168, 152, 128, 0.08);
  border: 1px solid rgba(168, 152, 128, 0.2);
}

.map-tile-info .tile-village-badge svg {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.map-tile-info .tile-village-badge.own svg { color: #e8c547; }
.map-tile-info .tile-village-badge.other svg { color: #a89880; }

.map-sidebar-hint {
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.45;
}

/* Karten-Feld Pop-up */
.map-tile-popup {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.map-tile-popup.hidden {
  display: none;
}

.map-tile-popup-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 6, 4, 0.72);
  backdrop-filter: blur(2px);
}

.map-tile-popup-dialog {
  position: relative;
  width: min(420px, 100%);
  max-height: min(88vh, 640px);
  display: flex;
  flex-direction: column;
  background: linear-gradient(165deg, #352a1f 0%, #241c14 100%);
  border: 1px solid #6b5638;
  border-radius: 14px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55);
  overflow: hidden;
}

.map-popup-close {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.35);
  color: var(--text);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.map-popup-close:hover {
  background: rgba(232, 197, 71, 0.2);
  color: var(--accent-light);
}

.map-popup-content {
  overflow-y: auto;
  padding: 14px 14px 16px;
}

.map-popup-header {
  display: flex;
  gap: 12px;
  align-items: center;
  padding-right: 36px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.map-popup-header-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.map-popup-header-icon svg {
  width: 26px;
  height: 26px;
  color: rgba(255, 255, 255, 0.9);
}

.map-popup-header h3 {
  font-family: 'Cinzel', serif;
  font-size: 1.05rem;
  color: var(--accent-light);
  margin: 0 0 2px;
}

.map-popup-coords {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: monospace;
  margin: 0;
}

.map-popup-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.map-action-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 11px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.map-action-chip:hover {
  border-color: rgba(232, 197, 71, 0.45);
  background: rgba(232, 197, 71, 0.12);
}

.map-action-chip.active {
  border-color: var(--accent);
  background: rgba(232, 197, 71, 0.22);
  color: var(--accent-light);
}

.map-action-chip:disabled,
.map-action-chip.disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.map-popup-panels {
  min-height: 0;
}

.map-popup-panel {
  display: none;
}

.map-popup-panel.active {
  display: block;
}

.map-popup-panel .map-zombie-box,
.map-popup-panel .map-gather-box,
.map-popup-panel .map-settlement-box,
.map-popup-panel .map-village-attack-box,
.map-popup-panel .map-gather-occupancy,
.map-popup-panel .map-stash-box,
.map-popup-panel .map-wander-box {
  margin: 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.map-popup-panel h4 {
  font-family: 'Cinzel', serif;
  font-size: 0.88rem;
  margin: 0 0 8px;
  color: var(--accent-light);
}

.map-popup-meta {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.82rem;
}

.map-popup-meta .tile-row,
.map-popup-meta .tile-bonus,
.map-popup-meta .gather-hint {
  font-size: 0.8rem;
}

.map-popup-meta .map-missions-box {
  margin-top: 8px;
  padding: 8px 10px;
  font-size: 0.78rem;
}

.map-popup-empty {
  padding: 12px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.map-legend { margin-top: 4px; }

.map-legend-symbols {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.map-legend h4 {
  font-family: 'Cinzel', serif;
  font-size: 0.82rem;
  color: var(--accent-light);
  margin-bottom: 10px;
  letter-spacing: 0.04em;
}

.map-legend ul {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.map-legend li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.map-legend .legend-icon {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(145deg, var(--legend-light), var(--legend-dark));
}

.map-legend .legend-icon svg {
  width: 14px;
  height: 14px;
  color: rgba(255, 255, 255, 0.7);
}

.map-legend .legend-label { line-height: 1.2; }

.map-legend .legend-tag {
  display: inline-block;
  font-size: 0.62rem;
  font-style: normal;
  color: var(--success);
  background: rgba(39, 174, 96, 0.12);
  padding: 1px 4px;
  border-radius: 3px;
  margin-left: 2px;
}

.map-symbol-list {
  grid-template-columns: 1fr !important;
  gap: 5px !important;
}

.map-symbol-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.72rem;
  flex-shrink: 0;
}

.map-symbol-chip.own {
  border-color: rgba(232, 197, 71, 0.45);
  color: var(--accent-light);
}

.map-symbol-chip.gather { border-color: rgba(46, 204, 113, 0.4); }
.map-symbol-chip.zombie { border-color: rgba(192, 57, 43, 0.4); }
.map-symbol-chip.horde { border-color: rgba(160, 60, 220, 0.45); }
.map-symbol-chip.settle { border-color: rgba(201, 162, 39, 0.4); }

/* Map action boxes */

.map-gather-box,
.map-zombie-box,
.map-village-attack-box,
.map-stash-box,
.map-missions-box {
  margin-top: 12px;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.2);
}

.map-gather-box h4,
.map-zombie-box h4,
.map-village-attack-box h4,
.map-stash-box h4,
.map-missions-box h4 {
  font-size: 0.9rem;
  color: var(--accent-light);
  margin-bottom: 8px;
}

.map-wander-box {
  border-color: rgba(160, 60, 220, 0.35);
  background: rgba(40, 15, 55, 0.15);
}

.map-gather-occupancy {
  margin-top: 12px;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.map-gather-occupancy.gather-occupancy-own {
  border-color: rgba(46, 204, 113, 0.35);
  background: rgba(20, 60, 35, 0.12);
}

.map-gather-occupancy.gather-occupancy-enemy {
  border-color: rgba(192, 57, 43, 0.35);
  background: rgba(60, 20, 18, 0.1);
}

.map-gather-occupancy h4 {
  font-size: 0.9rem;
  color: var(--accent-light);
  margin-bottom: 6px;
}

.gather-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
}

.gather-send-row,
.raid-row {
  flex-direction: column;
  align-items: stretch;
}

.gather-escort-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.gather-escort-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.gather-escort-label .train-input {
  width: 56px;
}

.gather-rate-line,
.gather-loot-line {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 4px 0;
}

.gather-capacity-hint {
  margin-top: 6px;
  font-size: 0.78rem;
}

.raid-inputs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.zombie-stats {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.zombie-loot-est {
  font-size: 0.82rem;
  color: var(--accent-light);
  margin-bottom: 8px;
}

.loot-tier.gold { color: #e8c547; }
.loot-tier.silver { color: #c0c0c0; }
.loot-tier.bronze { color: #cd7f32; }

.settlement-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.map-mission-summary {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.map-mission-row {
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 6px;
  margin-top: 6px;
  font-size: 0.82rem;
}

.map-mission-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.map-mission-status {
  font-size: 0.75rem;
  color: var(--accent-light);
}

.map-mission-eta {
  color: var(--text-muted);
  font-size: 0.78rem;
}

.map-mission-clock {
  color: var(--text-muted);
  font-size: 0.72rem;
}

.map-mission-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.map-mission-recall {
  margin-top: 6px;
}

/* --- Messages --- */

.messages-toolbar {
  margin-bottom: 16px;
}

.messages-toolbar-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.messages-tabs {
  display: flex;
  gap: 8px;
}

.messages-main {
  min-height: 280px;
}

.messages-empty {
  text-align: center;
  padding: 48px 24px;
  background: var(--bg-panel);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

.messages-empty-icon {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 12px;
}

.messages-empty p {
  color: var(--text-muted);
  margin-bottom: 16px;
}

.messages-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.message-row {
  width: 100%;
  text-align: left;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  cursor: pointer;
  color: var(--text);
  font-family: inherit;
  transition: border-color 0.15s, background 0.15s;
}

.message-row:hover {
  border-color: rgba(201, 162, 39, 0.35);
  background: rgba(201, 162, 39, 0.04);
}

.message-row-unread {
  border-left: 3px solid var(--accent);
  background: rgba(201, 162, 39, 0.06);
}

.message-row-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
  font-size: 0.82rem;
}

.message-row-top strong {
  color: var(--accent-light);
}

.message-date {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.message-row-subject {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 4px;
}

.message-row-preview {
  font-size: 0.82rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-detail,
.message-compose {
  max-width: 720px;
}

.message-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.message-detail-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.message-detail-meta {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.message-detail-subject {
  font-size: 1.1rem;
  color: var(--accent-light);
  margin-bottom: 16px;
}

.message-detail-body {
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--text);
}

.message-compose-form {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.message-input,
.message-textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  color: var(--text);
  font-family: inherit;
  font-size: 0.92rem;
  margin-bottom: 12px;
}

.message-textarea {
  resize: vertical;
  min-height: 120px;
}

.msg-recipient-wrap {
  position: relative;
  margin-bottom: 12px;
}

.msg-player-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-height: 200px;
  overflow-y: auto;
  z-index: 50;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.msg-suggestion-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
  padding: 10px 12px;
  border: none;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.msg-suggestion-item:hover {
  background: rgba(201, 162, 39, 0.08);
}

.msg-suggestion-item strong {
  color: var(--accent-light);
}

.msg-suggestion-item span {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.msg-suggestion-empty {
  padding: 12px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* --- Wiki --- */

.wiki-frame {
  width: 100%;
  min-height: calc(100vh - 200px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-panel);
}

.wiki-standalone-body {
  background: var(--bg-dark);
}

.wiki-standalone-wrap {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px 20px 48px;
}

.wiki-back-link {
  margin-bottom: 16px;
  font-size: 0.9rem;
}

body.wiki-embed {
  background: transparent;
}

body.wiki-embed .wiki-standalone-wrap {
  padding: 0;
  max-width: none;
}

.wiki-page {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.wiki-header h2 {
  color: var(--accent-light);
  margin-bottom: 8px;
}

.wiki-toc {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  padding: 14px 16px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius);
  margin-bottom: 24px;
}

.wiki-toc a {
  font-size: 0.82rem;
  color: var(--text-muted);
  padding: 4px 8px;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
}

.wiki-toc a:hover {
  color: var(--accent-light);
  background: rgba(201, 162, 39, 0.1);
  text-decoration: none;
}

.wiki-section {
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.wiki-section:last-child {
  border-bottom: none;
}

.wiki-section h3 {
  color: var(--accent-light);
  font-size: 1.1rem;
  margin-bottom: 10px;
}

.wiki-section p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 10px;
  line-height: 1.55;
}

.wiki-list {
  list-style: none;
  padding-left: 0;
}

.wiki-list li {
  font-size: 0.88rem;
  color: var(--text-muted);
  padding: 4px 0 4px 16px;
  position: relative;
  line-height: 1.5;
}

.wiki-list li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--accent);
}

.wiki-table-wrap {
  overflow-x: auto;
  margin: 12px 0;
}

.wiki-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.wiki-table th,
.wiki-table td {
  padding: 8px 12px;
  border: 1px solid var(--border);
  text-align: left;
}

.wiki-table th {
  background: rgba(201, 162, 39, 0.1);
  color: var(--accent-light);
  font-family: 'Cinzel', serif;
  font-weight: 600;
}

.wiki-table td {
  color: var(--text-muted);
}

/* --- Leaderboard --- */

.leaderboard-summary {
  margin-bottom: 16px;
}

.leaderboard-stat-card {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 20px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 16px;
}

.leaderboard-stat-accent {
  border-color: rgba(201, 162, 39, 0.35);
  background: rgba(201, 162, 39, 0.08);
}

.leaderboard-stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.leaderboard-stat-card strong,
.leaderboard-stat-card span:last-child {
  font-size: 1.4rem;
  color: var(--accent-light);
  font-family: 'Cinzel', serif;
}

.leaderboard-own-breakdown {
  margin-bottom: 20px;
}

.leaderboard-breakdown {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.leaderboard-breakdown-item {
  font-size: 0.82rem;
  padding: 6px 10px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 6px;
  color: var(--text-muted);
}

.leaderboard-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.leaderboard-table th {
  background: rgba(201, 162, 39, 0.1);
  color: var(--accent-light);
  font-family: 'Cinzel', serif;
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.leaderboard-table td {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
}

.leaderboard-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.leaderboard-row-own {
  background: rgba(201, 162, 39, 0.08) !important;
}

.leaderboard-row-own td {
  color: var(--text);
}

.leaderboard-rank {
  font-weight: 700;
  color: var(--accent-light);
  width: 60px;
}

.leaderboard-influence {
  font-weight: 600;
  color: var(--text);
}

.leaderboard-you {
  font-size: 0.78rem;
  color: var(--accent-light);
}

.leaderboard-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 24px;
}

/* --- Admin --- */

.admin-grid {
  display: grid;
  grid-template-columns: minmax(280px, 360px) 1fr;
  gap: 20px;
  margin-top: 20px;
}

.admin-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.admin-card-wide { min-width: 0; }

.admin-card h3 {
  font-family: 'Cinzel', serif;
  color: var(--accent-light);
  margin-bottom: 16px;
  font-size: 1.1rem;
}

.admin-form {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.admin-field-hint {
  margin: -6px 0 10px;
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.admin-form input,
.admin-form textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-panel);
  color: var(--text);
  font-family: inherit;
  margin-bottom: 10px;
}

.admin-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.admin-worlds-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.admin-world-row {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}

.admin-world-dev {
  border-color: rgba(39, 174, 96, 0.35);
}

.admin-world-main {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.admin-status {
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
}

.admin-status-active,
.admin-status-development {
  color: #7dcea0;
  background: rgba(39, 174, 96, 0.12);
}

.admin-status-scheduled {
  color: var(--accent-light);
  background: rgba(201, 162, 39, 0.12);
}

.admin-status-ended {
  color: #e8a0a0;
  background: rgba(192, 57, 43, 0.12);
}

.admin-world-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.admin-world-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.admin-world-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.admin-tag {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.admin-empty {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.admin-msg {
  margin-top: 12px;
  font-size: 0.88rem;
}

.admin-msg-success { color: var(--success); }
.admin-msg-error { color: var(--danger); }

.admin-section {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.admin-section > h3 {
  font-family: 'Cinzel', serif;
  color: var(--accent-light);
  margin-bottom: 8px;
}

.admin-grid-testers {
  margin-top: 16px;
}

.admin-whitelist-list {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-whitelist-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.85rem;
}

.admin-whitelist-note {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* --- Championhalle & Multi-Dorf --- */

.championhalle-summary-inner,
.villages-summary-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  align-items: center;
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(201, 162, 39, 0.25);
  border-radius: 8px;
}

.championhalle-hint {
  flex: 1 1 100%;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.championhalle-missions h3 {
  margin: 1.25rem 0 0.75rem;
  font-size: 1rem;
}

.villages-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.village-card {
  padding: 1rem;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.village-card-active {
  border-color: rgba(232, 197, 71, 0.45);
  box-shadow: 0 0 0 1px rgba(232, 197, 71, 0.15);
}

.village-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.village-active-badge {
  font-size: 0.72rem;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: rgba(232, 197, 71, 0.2);
  color: var(--accent-light);
  border: 1px solid rgba(232, 197, 71, 0.35);
}

.village-card-meta,
.village-card-res {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.map-settlement-box {
  margin-top: 0.75rem;
  padding: 0.85rem;
  border-radius: 8px;
  border: 1px solid rgba(201, 162, 39, 0.35);
  background: rgba(201, 162, 39, 0.08);
}

.map-settlement-box h4 {
  margin: 0 0 0.35rem;
}

.map-settlement-conquer {
  border-color: rgba(192, 57, 43, 0.35);
  background: rgba(192, 57, 43, 0.08);
}

.settle-name-input {
  width: 100%;
  margin: 0.5rem 0;
  padding: 0.45rem 0.6rem;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
}

.tile-marker-settle {
  background: rgba(201, 162, 39, 0.85);
  font-size: 0.65rem;
}

.tile-marker-settle.enemy {
  background: rgba(160, 60, 60, 0.85);
}

.map-tile.settlement-active {
  outline: 2px solid rgba(201, 162, 39, 0.55);
  outline-offset: -2px;
}

.map-tile.own-village-alt {
  outline: 1px dashed rgba(232, 197, 71, 0.45);
  outline-offset: -2px;
}

.tile-village-icon.own-alt {
  opacity: 0.85;
}

.map-symbol-chip.champion {
  border-color: rgba(201, 162, 39, 0.45);
}

/* --- Responsive --- */

@media (max-width: 960px) {
  .map-layout { grid-template-columns: 1fr; }
  .map-sidebar { position: static; }
  .map-tile {
    width: var(--map-tile-size, 40px);
    height: var(--map-tile-size, 40px);
  }
  .map-scene { flex-direction: column; align-items: center; }
  .map-minimap-panel { width: 100%; max-width: 280px; }
  .map-legend ul { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .fields-map { grid-template-columns: 1fr; }
  .fields-slots { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .rally-summary-grid { grid-template-columns: repeat(2, 1fr); }
  .barracks-units-grid { grid-template-columns: 1fr; }
  .admin-grid { grid-template-columns: 1fr; }
  .game-header { flex-direction: column; align-items: flex-start; }
  .resources-bar { justify-content: flex-start; }
}

@media (max-width: 600px) {
  .map-toolbar { flex-direction: column; align-items: stretch; }
  .map-meta { align-items: flex-start; }
  .map-container { padding: 12px; }
  .map-frame { padding: 10px; }
  .fields-slots { grid-template-columns: 1fr 1fr; }
  .game-main { padding: 16px 12px 32px; }
  .game-nav { padding: 6px 8px; }
  .nav-btn { padding: 6px 10px; font-size: 0.78rem; }
  .buildings-grid { grid-template-columns: 1fr; }
  .schmied-research-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .fields-slots { grid-template-columns: 1fr; }
  .rally-summary-grid { grid-template-columns: 1fr; }
  .auth-container { padding: 32px 16px; }
  .game-title { font-size: 1.6rem; }
  .tutorial-panel { left: 8px; right: 8px; bottom: 8px; max-width: none; }
}

/* --- Tutorial --- */
.tutorial-panel {
  position: fixed;
  bottom: 16px;
  right: 16px;
  z-index: 1200;
  max-width: 340px;
  width: calc(100% - 32px);
  pointer-events: none;
}

.tutorial-panel-inner {
  pointer-events: auto;
  background: linear-gradient(145deg, rgba(28, 32, 48, 0.98), rgba(18, 22, 34, 0.98));
  border: 1px solid rgba(201, 162, 39, 0.45);
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

.tutorial-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.tutorial-badge {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent-light);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.tutorial-progress {
  margin-left: auto;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.tutorial-skip-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 4px;
}

.tutorial-skip-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.tutorial-title {
  margin: 0 0 8px;
  font-size: 1.05rem;
}

.tutorial-desc {
  margin: 0 0 8px;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.tutorial-objective {
  margin: 0 0 10px;
  font-size: 0.9rem;
  color: #fff;
  padding: 8px 10px;
  background: rgba(201, 162, 39, 0.12);
  border-radius: 8px;
  border-left: 3px solid var(--accent);
}

.tutorial-reward {
  margin-bottom: 12px;
  font-size: 0.85rem;
  color: var(--success);
}

.tutorial-go-btn {
  width: 100%;
}

.tutorial-highlight {
  outline: 2px solid var(--accent-light) !important;
  outline-offset: 3px;
  box-shadow: 0 0 0 4px rgba(201, 162, 39, 0.25) !important;
  animation: tutorial-pulse 1.6s ease-in-out infinite;
  z-index: 5;
  position: relative;
}

@keyframes tutorial-pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(201, 162, 39, 0.25); }
  50% { box-shadow: 0 0 0 8px rgba(201, 162, 39, 0.12); }
}

.tutorial-toast-host {
  position: fixed;
  top: 72px;
  right: 16px;
  z-index: 1300;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.tutorial-toast {
  background: linear-gradient(135deg, rgba(34, 60, 38, 0.98), rgba(22, 42, 28, 0.98));
  border: 1px solid rgba(90, 180, 100, 0.5);
  border-radius: 10px;
  padding: 12px 14px;
  min-width: 240px;
  max-width: 320px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  animation: tutorial-toast-in 0.35s ease-out;
}

.tutorial-toast-title {
  font-weight: 700;
  margin-bottom: 4px;
  color: #b8f0be;
}

.tutorial-toast-reward {
  font-size: 0.88rem;
  color: #e8f5e9;
}

@keyframes tutorial-toast-in {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

/* --- Landing Page --- */

.landing-body {
  background: var(--bg-dark);
}

.landing-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 24px;
  background: rgba(26, 20, 16, 0.92);
  border-bottom: 1px solid rgba(201, 162, 39, 0.2);
  backdrop-filter: blur(10px);
}

.landing-brand {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.landing-brand:hover {
  text-decoration: none;
}

.landing-brand-logo {
  height: 44px;
  width: auto;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.5));
}

.landing-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 20px;
}

.landing-nav a:not(.btn) {
  color: var(--text-muted);
  font-size: 0.95rem;
  text-decoration: none;
  transition: color 0.15s;
}

.landing-nav a:not(.btn):hover {
  color: var(--accent-light);
  text-decoration: none;
}

.landing-nav-cta {
  padding: 8px 16px;
  font-size: 0.88rem;
}

.landing-hero {
  min-height: calc(100vh - 69px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 24px 64px;
}

.landing-hero-inner {
  max-width: 720px;
  text-align: center;
}

.landing-hero-tagline {
  font-family: 'Cinzel', serif;
  font-size: clamp(1.25rem, 3vw, 1.65rem);
  color: var(--accent-light);
  margin-bottom: 16px;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
}

.landing-hero-desc {
  color: var(--text);
  font-size: 1.05rem;
  line-height: 1.65;
  margin-bottom: 32px;
  max-width: 620px;
  margin-left: auto;
  margin-right: auto;
}

.landing-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-bottom: 40px;
}

.btn-lg {
  padding: 14px 28px;
  font-size: 1rem;
}

.landing-hero-stats {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px 24px;
  padding: 20px 24px;
  background: rgba(36, 28, 20, 0.75);
  border: 1px solid rgba(201, 162, 39, 0.25);
  border-radius: 12px;
  backdrop-filter: blur(8px);
}

.landing-hero-stats li {
  color: var(--text-muted);
  font-size: 0.92rem;
}

.landing-hero-stats strong {
  display: block;
  color: var(--accent-light);
  font-family: 'Cinzel', serif;
  font-size: 1.15rem;
  margin-bottom: 2px;
}

.landing-container {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 24px;
}

.landing-section {
  padding: 72px 0;
}

.landing-section-alt {
  background: rgba(0, 0, 0, 0.18);
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.landing-section h2 {
  text-align: center;
  color: var(--accent-light);
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin-bottom: 12px;
}

.landing-section-lead {
  text-align: center;
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto 40px;
  font-size: 1.05rem;
}

.landing-features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

.landing-feature-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px 24px;
  transition: border-color 0.2s, transform 0.2s;
}

.landing-feature-card:hover {
  border-color: rgba(201, 162, 39, 0.45);
  transform: translateY(-2px);
}

.landing-feature-icon {
  font-size: 2rem;
  display: block;
  margin-bottom: 12px;
}

.landing-feature-card h3 {
  color: var(--accent-light);
  font-size: 1.05rem;
  margin-bottom: 10px;
}

.landing-feature-card p {
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.6;
}

.landing-mechanics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  margin-top: 8px;
}

.landing-mechanic h3 {
  color: var(--text);
  font-size: 1rem;
  margin-bottom: 8px;
  font-family: 'Source Sans 3', sans-serif;
  font-weight: 600;
}

.landing-mechanic p {
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.6;
}

.landing-steps {
  list-style: none;
  max-width: 640px;
  margin: 32px auto 0;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.landing-steps li {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.landing-step-num {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #8a7020 0%, #6b5518 100%);
  border: 1px solid var(--accent);
  border-radius: 50%;
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: 1.1rem;
  color: #fff;
}

.landing-steps h3 {
  color: var(--accent-light);
  font-size: 1.05rem;
  margin-bottom: 6px;
}

.landing-steps p {
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

.landing-note {
  text-align: center;
  max-width: 560px;
  margin: 36px auto 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.landing-cta {
  padding: 72px 24px;
  text-align: center;
}

.landing-cta-inner h2 {
  margin-bottom: 12px;
}

.landing-cta-inner p {
  color: var(--text-muted);
  margin-bottom: 28px;
  font-size: 1.05rem;
}

.landing-footer {
  padding: 28px 0;
  border-top: 1px solid var(--border);
  background: var(--bg-panel);
}

.landing-footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.landing-footer p {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.landing-footer-nav {
  display: flex;
  gap: 20px;
}

.landing-footer-nav a {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.landing-footer-nav a:hover {
  color: var(--accent-light);
}

@media (max-width: 640px) {
  .landing-header {
    flex-direction: column;
    align-items: stretch;
    padding: 12px 16px;
  }

  .landing-nav {
    justify-content: center;
  }

  .landing-hero {
    min-height: auto;
    padding: 40px 16px 48px;
  }

  .landing-hero-stats {
    gap: 16px;
  }

  .landing-hero-stats li {
    flex: 1 1 40%;
    text-align: center;
  }

  .landing-section {
    padding: 48px 0;
  }

  .landing-footer-inner {
    flex-direction: column;
    text-align: center;
  }
}
