.deck-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
}

.add-deck-button {
  display: grid;
  place-items: center;
  width: 44px;
  min-width: 44px;
  padding: 0;
  font-size: 1.8rem;
  line-height: 1;
}

.deck-list {
  display: grid;
  gap: 16px;
  padding-bottom: 42px;
}

.deck-panel {
  padding: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 6px 18px rgba(42, 35, 24, 0.06);
}

.deck-header {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 42px;
  gap: 10px;
  margin-bottom: 14px;
}

.deck-name {
  font-weight: 800;
}

.remove-deck {
  display: grid;
  place-items: center;
  padding: 0;
  background: #6d2f22;
  font-size: 1.35rem;
}

.deck-slots {
  display: grid;
  grid-template-columns: repeat(5, minmax(110px, 1fr));
  gap: 12px;
}

.deck-slot-wrap {
  min-width: 0;
}

.deck-slot {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 5 / 6;
  height: auto;
  padding: 10px;
  background: #fff;
  border: 2px dashed #b8afa1;
  color: var(--muted);
}

.deck-slot.has-card {
  border-style: solid;
  border-color: rgba(190, 93, 54, 0.36);
  background: #fffdfa;
}

.deck-slot img {
  display: none;
  width: min(86px, 72%);
  height: auto;
}

.deck-slot.has-card img {
  display: block;
}

.deck-slot.has-card .slot-empty {
  display: none;
}

.slot-empty {
  font-size: 0.8rem;
  font-weight: 800;
}

.slot-card-name {
  min-height: 2.3em;
  margin-top: 7px;
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 800;
  line-height: 1.15;
  text-align: center;
}

.card-picker {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(31, 35, 40, 0.4);
  z-index: 10;
}

.card-picker[hidden] {
  display: none;
}

.picker-panel {
  width: min(520px, 100%);
  max-height: min(680px, calc(100vh - 36px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 10px;
  padding: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.picker-results {
  display: grid;
  gap: 6px;
  overflow: auto;
  padding-right: 4px;
}

.picker-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  height: auto;
  min-height: 54px;
  padding: 6px 8px;
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
  text-align: left;
}

.picker-card img {
  width: 36px;
  height: 36px;
  border-radius: 4px;
}

.picker-card span {
  overflow: hidden;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.secondary-button {
  background: #fff;
  color: var(--ink);
}

.secondary-button:hover {
  background: #efe8dc;
}

@media (max-width: 860px) {
  .deck-slots {
    grid-template-columns: repeat(3, minmax(96px, 1fr));
  }
}

@media (max-width: 520px) {
  .deck-slots {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
