.army-composition {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--line);
  background: #0d1118;
}

.shell {
  width: min(1780px, calc(100% - 24px));
}

.canvas-wrap {
  aspect-ratio: 1.18;
}

.playback button {
  min-height: 42px;
  touch-action: manipulation;
  user-select: none;
  transition: transform .08s ease, border-color .12s ease, background-color .12s ease, color .12s ease, box-shadow .12s ease;
}

.playback button:hover {
  border-color: #596579;
  color: var(--text);
}

.playback button:active,
.playback button.is-pressed {
  transform: translateY(1px) scale(.97);
  border-color: var(--lime);
  background: rgba(199, 255, 74, .18);
  color: var(--lime);
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, .38);
}

.playback button:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

#play-toggle[data-state="paused"] {
  border-color: rgba(85, 223, 255, .55);
  background: rgba(85, 223, 255, .1);
  color: var(--cyan);
}

#play-toggle[data-state="ended"] {
  border-color: rgba(255, 172, 91, .55);
  background: rgba(255, 172, 91, .1);
  color: var(--orange);
}

.analysis-grid {
  grid-template-columns: 1fr 1fr;
}

.analysis-grid .decisions {
  grid-column: 1 / -1;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 15px;
  padding: 9px 17px 0;
  color: var(--muted);
  font-size: .62rem;
}

.chart-legend span::before {
  display: inline-block;
  width: 18px;
  margin-right: 6px;
  border-top: 2px solid currentColor;
  content: "";
  vertical-align: middle;
}

.chart-legend .ours {
  color: var(--our-color, var(--cyan));
}

.chart-legend .enemy {
  color: var(--enemy-color, var(--red));
}

.chart-legend .baseline-line::before {
  border-top-style: dashed;
}

#strength-chart,
#cost-chart {
  display: block;
  width: 100%;
  height: 220px;
}

.roster-side {
  min-width: 0;
  padding: 11px 13px 12px;
}

.roster-side + .roster-side {
  border-left: 1px solid var(--line);
}

.roster-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 9px;
}

.roster-head b {
  overflow: hidden;
  color: var(--text);
  font-size: .68rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.roster-head b::before {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--side-color);
  content: "";
}

.roster-head span {
  flex: none;
  color: var(--muted);
  font-size: .6rem;
  font-variant-numeric: tabular-nums;
}

.roster-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.roster-unit {
  display: grid;
  grid-template-columns: 29px minmax(0, 1fr);
  align-items: center;
  min-width: 102px;
  max-width: 150px;
  padding: 4px 7px 4px 4px;
  border-radius: 7px;
  background: var(--surface2);
}

.roster-unit canvas {
  width: 29px;
  height: 29px;
}

.roster-unit div {
  min-width: 0;
}

.roster-unit b,
.roster-unit span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.roster-unit b {
  font-size: .61rem;
}

.roster-unit span {
  margin-top: 2px;
  color: var(--muted);
  font-size: .56rem;
  font-variant-numeric: tabular-nums;
}

.roster-empty {
  color: var(--muted);
  font-size: .62rem;
}

@media (max-width: 620px) {
  .army-composition {
    grid-template-columns: 1fr;
  }

  .roster-side + .roster-side {
    border-top: 1px solid var(--line);
    border-left: 0;
  }
}

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

  .analysis-grid .decisions {
    grid-column: auto;
  }

  .canvas-wrap {
    aspect-ratio: 1.3;
  }
}
