/* Einheiten – gut lesbar, große Schrift */

body.units-body {
  background: #0a0c10;
  overflow-y: auto;
  font-size: 1.125rem;
  line-height: 1.6;
}

.units-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 5.5rem 1.25rem 7rem;
  position: relative;
  z-index: 1;
}

.units-page .legal-back {
  font-size: 1.15rem;
  margin-bottom: 1.25rem;
}

.units-page__title {
  margin: 0 0 0.5rem;
  font-family: "Rajdhani", Tahoma, sans-serif;
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 700;
  color: #f5e6a8;
  letter-spacing: 0.02em;
}

.units-hero__subtitle {
  margin: 0 0 1.5rem;
  font-size: 1.2rem;
  line-height: 1.65;
  color: #e0e0e0;
}

/* Toolbar */
.units-toolbar {
  position: sticky;
  top: var(--lang-bar-height);
  z-index: 20;
  margin: 0 0 2rem;
  padding: 1rem 0;
  background: linear-gradient(180deg, #0a0c10 0%, #0a0c10 80%, transparent 100%);
}

.units-search {
  width: 100%;
  margin-bottom: 1rem;
  padding: 1rem 1.15rem 1rem 3rem;
  font-family: "Rajdhani", sans-serif;
  font-size: 1.2rem;
  color: #ffffff;
  background: #1a2030;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  outline: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' fill='%23ccc' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85zm-5.242 1.156a5 5 0 1 1 0-10 5 5 0 0 1 0 10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 1rem center;
}

.units-search:focus {
  border-color: #e8c547;
  box-shadow: 0 0 0 4px rgba(232, 197, 71, 0.2);
}

.units-search::placeholder {
  color: #999999;
}

.units-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.units-filter__pill {
  font-family: "Rajdhani", sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  padding: 0.65rem 1.15rem;
  border-radius: 8px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  background: #1a2030;
  color: #eeeeee;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.units-filter__pill:hover {
  background: #252d40;
  border-color: rgba(255, 255, 255, 0.35);
}

.units-filter__pill--active {
  background: #3d3520;
  border-color: #e8c547;
  color: #fff8dc;
}

/* Legende */
.units-legend-panel {
  margin-bottom: 1.5rem;
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  background: #1a2030;
  overflow: hidden;
}

.units-legend-panel summary {
  padding: 1rem 1.15rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffffff;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.units-legend-panel summary::-webkit-details-marker {
  display: none;
}

.units-legend-panel summary::before {
  content: "▸ ";
  color: #e8c547;
}

.units-legend-panel[open] summary::before {
  content: "▾ ";
}

.units-legend-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  padding: 0 1.15rem 1.15rem;
}

.units-legend-grid dt {
  margin: 0 0 0.25rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: #f5e6a8;
}

.units-legend-grid dd {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.6;
  color: #dddddd;
}

/* Sektionen */
.units-section {
  scroll-margin-top: 12rem;
  margin-bottom: 2.75rem;
}

.units-section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.65rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid rgba(232, 197, 71, 0.35);
}

.units-section__title {
  margin: 0;
  font-family: "Rajdhani", sans-serif;
  font-size: 1.45rem;
  font-weight: 700;
  color: #f5e6a8;
}

.units-section__count {
  flex-shrink: 0;
  min-width: 2rem;
  padding: 0.1rem 0.7rem;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.6;
  text-align: center;
  color: #f5e6a8;
  background: #252d40;
}

.units-section__desc {
  margin: 0 0 1.25rem;
  font-size: 1.1rem;
  line-height: 1.65;
  color: #dddddd;
}

.units-section.is-hidden {
  display: none;
}

/* Karten – eine Spalte, groß */
.units-grid {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.unit-card {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  padding: 0 1.4rem 1.35rem;
  border-radius: 12px;
  border: 2px solid rgba(255, 255, 255, 0.14);
  background: #1a2030;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

.unit-card__photo {
  display: block;
  width: calc(100% + 2.8rem);
  height: auto;
  margin: 0 -1.4rem;
  aspect-ratio: 1230 / 384;
  object-fit: cover;
  background: #121820;
}

.unit-card.is-hidden {
  display: none;
}

.unit-card__head {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.unit-card__meta-top {
  flex: 1;
  min-width: 0;
}

.unit-card__name {
  margin: 0 0 0.55rem;
  font-family: "Rajdhani", sans-serif;
  font-size: 1.45rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.25;
}

.unit-card__costs {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.cost-chip {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  font-size: 1.15rem;
  font-weight: 700;
}

.cost-chip__label {
  min-width: 4.5rem;
  font-size: 1rem;
  font-weight: 600;
  color: #cccccc;
}

.cost-chip--steel {
  color: #ffaaaa;
}

.cost-chip--carbon {
  color: #ffe566;
}

/* Werte mit Balken */
.unit-card__stats {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.stat-row__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 0.35rem;
}

.stat-row__label {
  font-size: 1.05rem;
  font-weight: 600;
  color: #eeeeee;
}

.stat-row__value {
  font-size: 1.2rem;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
}

.stat-row__track {
  height: 14px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.15);
  overflow: hidden;
}

.stat-row__fill {
  height: 100%;
  border-radius: 7px;
}

.stat-row--attack .stat-row__fill {
  background: linear-gradient(90deg, #c9a227 0%, #ffe566 100%);
}

.stat-row--armor .stat-row__fill {
  background: linear-gradient(90deg, #5a8ab0 0%, #b8d4f0 100%);
}

.stat-row--range .stat-row__fill,
.stat-row--view .stat-row__fill {
  background: linear-gradient(90deg, #4a9a4a 0%, #8ed88e 100%);
}

.stat-bar-group + .stat-bar-group {
  margin-top: 0.35rem;
}

.unit-card__note {
  margin: 0;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.25);
  font-size: 1.1rem;
  font-weight: 600;
  color: #eeeeee;
}

/* Besonderheit */
.unit-card__spec-block {
  padding-top: 0.25rem;
}

.unit-card__spec-heading {
  margin: 0 0 0.5rem;
  font-family: "Rajdhani", sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: #f5e6a8;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.unit-card__spec {
  padding: 0.85rem 1rem;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.2);
  border-left: 4px solid #e8c547;
  font-size: 1.1rem;
  line-height: 1.65;
  color: #eeeeee;
}

.unit-card__spec strong {
  color: #fff8dc;
  font-weight: 700;
}

.unit-card__spec div[style] {
  padding: 0.5rem 0 0 !important;
  font-size: 1rem !important;
  color: #cccccc !important;
  line-height: 1.55 !important;
}

.unit-card__spec-bonus {
  margin-top: 0.75rem;
}

.unit-card__spec-bonus-label {
  font-size: 1.05rem;
  font-weight: 600;
  color: #eeeeee;
  margin-bottom: 0.35rem;
}

/* Verbrauch – klare Liste */
.unit-card__facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem 1rem;
  margin: 0;
  padding: 1rem 0 0;
  border-top: 2px solid rgba(255, 255, 255, 0.1);
}

.unit-fact {
  margin: 0;
}

.unit-fact dt {
  margin: 0 0 0.15rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: #bbbbbb;
}

.unit-fact dd {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
  color: #ffffff;
}

.units-empty {
  padding: 2rem 1.25rem;
  text-align: center;
  font-size: 1.15rem;
  font-weight: 600;
  color: #cccccc;
  border: 2px dashed rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  background: #1a2030;
}

@media (max-width: 480px) {
  body.units-body {
    font-size: 1.0625rem;
  }

  .units-page {
    padding: 5rem 1rem 6.5rem;
  }

  .unit-card__facts {
    grid-template-columns: 1fr;
  }

  .units-filter__pill {
    font-size: 1rem;
    padding: 0.6rem 1rem;
  }
}
