#factions {
  position: absolute;
  top: 150px;
  display: flex;
  flex-direction: row;
  flex-wrap: no-wrap;
  overflow-x: auto;
  max-width: calc(100vw - 450px);
  padding: 0 0 0 400px;
}

.faction-panel {
  margin: 0 0 0 -200px;
  position: relative;
  display: flex;
  width: 500px;
  height: calc(100vh - 400px);
  clip-path: polygon(40% 0, 100% 0, 60% 100%, 0 100%);
  justify-content: center;
  background-repeat: none;
  background-size: cover;
  padding: 0 50px;
}

.full-faction-logo {
  position: relative;
  width: 500px;
  height: 100%;
  bottom: 50px;
  background-size: 300px 100px;
  background-position: bottom left;
  background-repeat: no-repeat;
}

.faction-logo {
  width: 300px;
  height: 100px;
  background-size: contain;
  background-repeat: no-repeat;
}

body[data-faction="Marauders"], .faction-panel[data-faction="Marauders"] { background-image: url('/assets/Faction\ Backgrounds/Marauders.png'); }
body[data-faction="Terran Combine"], .faction-panel[data-faction="Terran Combine"] { background-image: url('/assets/Faction\ Backgrounds/Terran Combine.png'); }
body[data-faction="Atlas Syndicate"], .faction-panel[data-faction="Atlas Syndicate"] { background-image: url('/assets/Faction\ Backgrounds/Atlas Syndicate.png'); }
body[data-faction="Binderburg"], .faction-panel[data-faction="Binderburg"] { background-image: url('/assets/Faction\ Backgrounds/binderburg 1.png'); }
body[data-faction="Gelecek"], .faction-panel[data-faction="Gelecek"] { background-image: url('/assets/Faction\ Backgrounds/Gelecek.png'); }
body[data-faction="MPL"], .faction-panel[data-faction="MPL"] { background-image: url('/assets/Faction\ Backgrounds/MPL.png'); }
body[data-faction="Frontier Legion"], .faction-panel[data-faction="Frontier Legion"] { background-image: url('/assets/Faction\ Backgrounds/Frontier Legion.png'); }
body[data-faction="XAOC"], .faction-panel[data-faction="XAOC"] { background-image: url('/assets/Faction\ Backgrounds/XAOC.png'); }
body[data-faction="Tianchao"], .faction-panel[data-faction="Tianchao"] { background-image: url('/assets/Faction\ Backgrounds/Tianchao.png'); }
body[data-faction="Everliving"], .faction-panel[data-faction="Everliving"] { background-image: url('/assets/Faction\ Backgrounds/Everliving.png'); }
body[data-faction="Khajiit"], .faction-panel[data-faction="Khajiit"] { background-image: url('/assets/Faction\ Backgrounds/Khajiit.png'); }

.unit-container {
  position: absolute;
  left: 350px;
  top: 150px;
  /* The parent for all rarity groups. This is the vertical stack. */
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px; /* Space between each rarity group */
  overflow-y: auto;
  max-height: calc(100% - 200px);
  width: calc(100% - 400px);
  padding: 0 0 100px 0;
  box-sizing: border-box;
  
  background-color: rgba(0, 0, 0, 0.3);
}

.rarity {
  /* This is a direct child of the unit-container. It is a full-width row. */
  font-size: 1.5rem;
  font-weight: bold;
  color: #ccc;
  width: 100%;
  text-align: right;
  background-image: linear-gradient(to left, #6c6c6c, transparent);
  padding: 10px 30px 10px 0;
  box-sizing: border-box;
  font-size: 28px;
  color: white;
}

.rarity-unit-container {
  /* This is the container for the unit cards. It is a wrapping row. */
  width: 100%;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 25px;
  padding-right: 30px;
  box-sizing: border-box;
  /* Gap between cards */
}

.unit-card {
  /* Example styles for the card itself */
  width: 150px;
  height: 200px;
  background-color: #2a2a2a;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.2);
}