/* Ecosystem Architect: the species tray and run controls sit in a strip under the board (shell panel moved to the
   bottom). Theme tokens only (docs/SHELL_CONTRACT.md §8). */
#topic-game .ts-body { flex-direction: column; }
#topic-game .ts-panel.ea-panel {
  width: auto; flex: none; border-left: 0; border-top: 2px solid var(--ts-line); padding: 6px 10px 4px; overflow: visible;
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 12px; align-items: start;
}
.ea-controls { display: flex; flex-direction: column; gap: 6px; min-width: 250px; }
.ea-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ea-run { min-width: 168px; min-height: 48px; font-size: 18px; }
.ea-speed { min-height: 48px; }
.ea-act { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; min-height: 44px; }
.ea-act[aria-pressed="true"] { background: var(--ts-accent-2); border-color: var(--ts-accent-2); color: #1a1206; }
.ea-ico { width: 18px; height: 18px; flex: none; }
.ea-acts-left { font-size: 16px; color: var(--ts-muted); }

.ea-tray { display: flex; gap: 6px; overflow-x: auto; padding: 2px 2px 6px; scrollbar-width: thin; }
.ea-card {
  flex: none; width: 158px; display: grid; grid-template-rows: auto auto; gap: 2px; padding: 4px;
  background: var(--ts-panel-2); border: 2px solid var(--ts-line); border-left-width: 6px; border-radius: 10px; position: relative;
}
.ea-card.ea-l1 { border-left-color: #5ea85a; }
.ea-card.ea-l2 { border-left-color: #e0b84a; }
.ea-card.ea-l3 { border-left-color: #e07a4a; }
.ea-card.ea-l4 { border-left-color: #c45a8a; }
.ea-card.ea-lD { border-left-color: #a8845a; }
.ea-card.ea-sel { border-color: var(--ts-focus); box-shadow: 0 0 0 1px var(--ts-focus) inset; }
.ea-card.ea-invasive { border-style: dashed; border-color: var(--ts-bad); }
.ea-card.ea-gone { opacity: .55; }
.ea-card.ea-target { box-shadow: 0 0 0 2px var(--ts-accent-2); }
.ea-pick {
  display: grid; grid-template-columns: 52px 1fr; grid-template-rows: auto auto auto; column-gap: 6px; align-items: center; text-align: left;
  min-height: 44px; padding: 2px; border: 0; border-radius: 8px; background: transparent; color: var(--ts-ink); font: 700 16px/1.15 var(--ts-font); cursor: pointer;
}
.ea-pick:hover { background: rgba(255, 255, 255, .05); }
.ea-pick img { grid-row: 1 / 3; width: 52px; height: 36px; }
.ea-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ea-sub { font-weight: 400; color: var(--ts-muted); font-size: 16px; white-space: nowrap; }
.ea-pmrow { display: flex; align-items: center; justify-content: space-between; gap: 4px; }
.ea-pm { min-width: 44px; min-height: 40px; padding: 0; font-size: 22px; line-height: 1; }
.ea-count { flex: 1; text-align: center; font: 700 18px var(--ts-mono); color: var(--ts-accent); }
.ea-tag { font-size: 16px; color: var(--ts-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-height: 1.15em; line-height: 1.15; }
.ea-status { grid-column: 1 / -1; margin: 0; font-size: 16px; line-height: 1.3; color: var(--ts-muted); min-height: 1.3em; }

@media (max-width: 900px) {
  #topic-game .ts-panel.ea-panel { grid-template-columns: minmax(0, 1fr); }
  .ea-controls { min-width: 0; }
}
@media (max-width: 759px) {
  #topic-game .ts-stage { flex: none; height: calc((100vw - 16px) * 1.656 + 16px); min-height: 0; }
  #topic-game .ts-play, #topic-game .ts-body { flex: none; }
  #topic-game { overflow: visible; height: auto !important; min-height: 100dvh !important; }
  .ea-tray { flex-wrap: wrap; overflow: visible; }
  .ea-card { width: calc(50% - 3px); }
}
